@khvavuong/ezchat 1.1.18 → 1.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ezchat.umd.js +7 -7
- package/dist/ezchat.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/ezchat.umd.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.appendChild(document.createTextNode(`.chat-messages-container{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:0;display:flex;flex-direction:column;box-sizing:border-box;transform:translateZ(0);-webkit-transform:translateZ(0);will-change:scroll-position;background-attachment:fixed;background-size:cover;background-repeat:no-repeat;background-position:center;scroll-behavior:auto!important}.chat-popup-window--fullscreen .chat-messages-container{-webkit-overflow-scrolling:touch;overscroll-behavior:contain;max-height:calc(100% - 105px)}.chat-popup-window--mobile .chat-messages-container{flex:1;min-height:0;max-height:100%}.chat-messages-container:before,.chat-messages-container:after{content:"";flex-shrink:0}.chat-messages-container:before{height:20px}.chat-messages-container:after{height:20px}.chat-messages-container>*{margin-left:24px;margin-right:24px}.chat-message{margin-bottom:12px;display:flex;justify-content:flex-end;flex-shrink:0}.chat-message.bot{justify-content:flex-start}.feedback-button{background:transparent;border:none;width:16px;height:16px;cursor:pointer;display:flex;align-items:center;justify-content:center;box-sizing:border-box}.feedback-button:hover{transform:scale(1.1)}.feedback-button:active{transform:scale(.95)}.chat-messages-container::-webkit-scrollbar{width:2px}.chat-messages-container::-webkit-scrollbar-track{background:transparent}.chat-messages-container::-webkit-scrollbar-thumb{background:#1aaf74}.chat-messages-container::-webkit-scrollbar-thumb:hover{background:#1aaf74}.message-popup{position:absolute;top:-40px;right:0;background:#fff;border-radius:8px;box-shadow:0 2px 8px #00000026;padding:8px;display:flex;gap:8px;border:1px solid #e0e0e0}.message-popup-button{background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;display:flex;align-items:center;justify-content:center}.message-popup-button:hover{background:#f0f0f0}.chat-message-edit-textarea{flex:1;padding:8px;width:30vw;border-radius:8px;border:0px;font-size:16px;font-weight:500;font-family:inherit;background:transparent;outline:none;resize:none;min-height:60px;max-height:200px;overflow:auto}.chat-message-edit-textarea::-webkit-scrollbar{display:none}.message-edit-button{background:transparent;font-weight:400;color:#000;font-size:16px;padding:8px 12px;border-radius:8px;border:none;cursor:pointer;transition:background-color .2s ease}.message-edit-button:hover,.message-edit-button:active{background:#1aaf7433}.message-cancel-button{background:transparent;font-weight:400;color:#767676;font-size:16px;padding:8px 12px;border-radius:8px;border:none;cursor:pointer;transition:background-color .2s ease}.message-cancel-button:hover,.message-cancel-button:active{background:#1aaf7433}.survey-message{background:#fff;border-radius:24px;box-shadow:0 2px 8px #00000014;padding:16px;max-width:70vh}.survey-options{display:flex;flex-direction:column;gap:12px;align-items:flex-start}.survey-option{border:1px solid #51D6A1;border-radius:24px;padding:12px 16px;background:none;font-size:16px;cursor:grab;text-align:left;user-select:none;transition:all .2s ease}.survey-option:active{cursor:grabbing}.survey-option:hover:not(.dragging){cursor:grabbing;background:#eafaf3}.survey-option:active,.survey-option.dragging{opacity:.4;transform:scale(.95);cursor:grabbing}.survey-option.hovered{background:#d4f5ed;transform:translateY(5px)}.survey-option.multi-selected.selected{background:#1aaf741a}.survey-submit-button{background:transparent;font-weight:400;color:#1aaf74;font-size:16px;padding:8px 12px;border-radius:4px;border:none;cursor:pointer;transition:background-color .2s ease}.survey-submit-button:hover{background:#1aaf741a}.survey-submit-button:active{background:#1aaf7433}.survey-cancel-button{background:transparent;font-weight:400;color:#767676;font-size:16px;padding:8px 12px;border-radius:4px;border:none;cursor:pointer;transition:background-color .2s ease}.survey-cancel-button:hover{background:#1aaf741a}.survey-cancel-button:active{background:#1aaf7433}.survey-input{width:100%;padding:12px 16px;border-radius:12px;font-size:14px;font-weight:500;background:#efefef;border:0px solid #fff;box-sizing:border-box}.survey-input::placeholder{color:#1113154d}.survey-input:focus{border:1px solid #1AAF74;outline:none}.survey-tooltip{text-align:left;position:absolute;right:0;left:auto;background:#fff;color:#333;border:1px solid #ddd;border-radius:4px;padding:8px 12px;font-size:13px;min-width:280px;max-width:90vw;box-shadow:0 2px 8px #00000014;white-space:normal;overflow-wrap:break-word;word-break:break-word;z-index:10}.chat-input-container{padding:15px;background:#fff;border-top:1px solid #e0e0e0;display:flex;gap:10px;flex-shrink:0;box-sizing:border-box}.chat-input-field{padding:15px 12px;width:100%;background:#efefef;border:1px solid #EFEFEF;border-radius:100px;outline:none;font-size:16px;font-weight:500;box-sizing:border-box;font-family:Manrope,Arial,sans-serif;overflow-y:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none;transition:height .12s ease}.chat-input-field:focus{border:1px solid #1AAF74;background:#efefef}.chat-input-field::-webkit-scrollbar{width:0;height:0}.chat-input-container.is-maxed .chat-input-field{border-radius:28px;transition:border-radius .12s ease}.chat-input-button{padding:10px 20px;background:#1677ff;color:#fff;border:none;border-radius:20px;cursor:pointer;font-weight:500}.chat-input-floating-box .chat-input-container{background:transparent;box-shadow:none;width:100%;padding:0;border-top:none;gap:0}.chat-input-floating-box .chat-input-field{background:#efefef;border-radius:100px;width:100%;box-shadow:none;padding:15px 24px}.chat-input-field::-webkit-scrollbar{display:none}.chat-popup-button{position:absolute;bottom:12px;right:12px;width:60px;height:60px;border-radius:50%;background:#fff;border:none;color:#fff;font-size:24px;cursor:pointer;box-shadow:0 4px 12px #00000026;z-index:1000;display:flex;align-items:center;justify-content:center}.chat-popup-button:hover{transform:scale(1.1)}.chat-popup-window{position:absolute;top:0;left:0;width:100%;height:100%;background:#fff;border-radius:12px;box-shadow:0 8px 32px #0000001a;z-index:999;display:flex;flex-direction:column;overflow:hidden;transform:scale(.85);opacity:0;transition:opacity .25s;transform-origin:right bottom}.chat-popup-window:not(.chat-popup-window--fullscreen):not(.chat-popup-window--mobile)>div:last-child{flex:1;overflow:hidden;display:flex;flex-direction:column}.chat-popup-window--open{transform:scale(1);opacity:1;transition:transform .35s cubic-bezier(.4,0,.2,1),opacity .25s}.chat-popup-window--fullscreen:not(.chat-popup-window--open),.chat-popup-window--mobile:not(.chat-popup-window--open){transition:opacity .25s!important}.chat-popup-window--fullscreen{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none;max-height:none;border-radius:12px;z-index:9999;background:#fff;display:flex;flex-direction:column}.chat-popup-window--fullscreen .chat-input-floating-box{top:50%;bottom:auto;left:50%;transform:translate(-50%,-50%);width:60%;max-width:70%;gap:16px;display:flex;flex-direction:column;align-items:center}.chat-popup-window--fullscreen .chat-input-floating-box--with-messages{top:auto;bottom:24px;transform:translate(-50%);width:95%;max-width:95%}.chat-popup-window--mobile{inset:0!important;width:100%!important;height:100%!important;max-width:none;max-height:none;border-radius:12px;z-index:9999;background:#fff;display:flex;flex-direction:column}.chat-popup-window--mobile>div:last-child{flex:1;overflow:hidden;display:flex;flex-direction:column}.chat-popup-window,.chat-popup-window--fullscreen,.chat-popup-window--mobile{background-image:url("data:image/svg+xml,%3csvg%20width='702'%20height='333'%20viewBox='0%200%20702%20333'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='702'%20height='332.5'%20transform='translate(0%200.5)'%20fill='%23F9F9F9'/%3e%3cmask%20id='mask0_2126_250272'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='702'%20height='333'%3e%3crect%20y='0.5'%20width='702'%20height='332.5'%20fill='%23F9F9F9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_2126_250272)'%3e%3cg%20opacity='0.4'%20filter='url(%23filter0_f_2126_250272)'%3e%3cellipse%20cx='217.889'%20cy='89.4345'%20rx='92.9028'%20ry='132.599'%20fill='url(%23paint0_linear_2126_250272)'/%3e%3cellipse%20cx='267.576'%20cy='251.281'%20rx='94.725'%20ry='141.383'%20fill='url(%23paint1_linear_2126_250272)'/%3e%3cellipse%20cx='198.685'%20cy='149.02'%20rx='145.472'%20ry='113.673'%20fill='url(%23paint2_linear_2126_250272)'/%3e%3cellipse%20cx='502.354'%20cy='219.212'%20rx='76.572'%20ry='89.1293'%20fill='url(%23paint3_linear_2126_250272)'/%3e%3cellipse%20cx='329.854'%20cy='242.986'%20rx='90.3027'%20ry='136.639'%20fill='url(%23paint4_linear_2126_250272)'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_f_2126_250272'%20x='-152.057'%20y='-248.434'%20width='936.253'%20height='846.368'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='BackgroundImageFix'%20result='shape'/%3e%3cfeGaussianBlur%20stdDeviation='102.635'%20result='effect1_foregroundBlur_2126_250272'/%3e%3c/filter%3e%3clinearGradient%20id='paint0_linear_2126_250272'%20x1='124.986'%20y1='89.4345'%20x2='310.792'%20y2='89.4345'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231AAF74'/%3e%3cstop%20offset='1'%20stop-color='%231AAF74'%20stop-opacity='0.7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_2126_250272'%20x1='172.851'%20y1='251.281'%20x2='362.301'%20y2='251.281'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231AAF74'/%3e%3cstop%20offset='1'%20stop-color='%231AAF74'%20stop-opacity='0.7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_2126_250272'%20x1='53.2129'%20y1='149.02'%20x2='344.158'%20y2='149.02'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F8FF99'/%3e%3cstop%20offset='1'%20stop-color='%23F8FF99'%20stop-opacity='0.7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_2126_250272'%20x1='425.782'%20y1='219.212'%20x2='578.926'%20y2='219.212'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231AAF74'/%3e%3cstop%20offset='1'%20stop-color='%231AAF74'%20stop-opacity='0.7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_2126_250272'%20x1='239.552'%20y1='242.986'%20x2='420.157'%20y2='242.986'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231AAF74'/%3e%3cstop%20offset='1'%20stop-color='%231AAF74'%20stop-opacity='0.7'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e");background-size:cover;background-repeat:no-repeat;background-position:center}.chat-popup-header{display:flex;align-items:center;justify-content:space-between;height:50px;padding:0 16px;background:#fff;color:#fff;font-weight:700;font-size:18px;flex-shrink:0;box-sizing:border-box}.chat-popup-title{flex:1;text-align:center;font-weight:700;font-size:24px;display:flex;justify-content:center;align-items:center}.chat-input-floating-box{position:absolute;left:50%;transform:translate(-50%);background:transparent;border-radius:24px;padding:0;z-index:10;width:60%;max-width:70%;display:flex;flex-direction:column;align-items:center;gap:28px;justify-content:flex-start}.chat-popup-action-buttons{display:flex;justify-content:center;align-items:center;gap:16px;width:100%;flex-wrap:wrap;background:transparent!important;box-shadow:none;border:none;padding:0;margin:0;position:static}.modal-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:20;display:flex;align-items:center;justify-content:center}.modal-button-delete{border:1px solid #EFEFEF;border-radius:24px;padding:12px;cursor:pointer;transition:background .2s,color .2s;font-family:Manrope,sans-serif}.modal-button-delete:hover{background:#f5f5f5;color:#1aaf74}.chat-popup-input{width:100%;padding:8px;border:1px solid #1AAF74;border-radius:4px;box-sizing:border-box;outline:none;transition:border-color .2s}.chat-popup-input:focus{border-color:#1aaf74}.sidebar-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background:#1e1e1e40;z-index:9;opacity:0;pointer-events:none;transition:opacity .2s}.sidebar-overlay--open{opacity:1;pointer-events:auto}.sidebar{position:absolute;top:0;left:0;width:420px;height:100%;background:#fff;box-shadow:2px 0 8px #00000014;z-index:10;padding:12px;transition:transform .35s cubic-bezier(.4,0,.2,1),opacity .25s;border-radius:12px;transform:translate(-100%);opacity:0;pointer-events:none}.sidebar--open{transform:translate(0);opacity:1;pointer-events:auto}.sidebar--fullscreen{position:static!important;width:320px!important;height:100%;box-shadow:none!important;transform:none!important;opacity:1!important;pointer-events:auto!important;border-top-right-radius:0!important}.sidebar-header{width:100%;display:flex;align-items:center;font-weight:700;font-size:24px;text-align:center;justify-content:left}.sidebar-section{display:flex;align-items:center;cursor:pointer;border-radius:8px;padding:8px;margin-top:18px;transition:background .2s}.sidebar-header-actions{margin-left:auto;display:flex;gap:8px;align-items:center}.sidebar-section--no-padding{margin-top:0!important}.sidebar-section:hover,.sidebar-section:focus{background:#f5f5f5}.sidebar-section .sidebar-section-icon{width:24px;height:24px;margin-right:8px}.sidebar-section .sidebar-section-title{font-weight:600;font-size:16px;user-select:none}.sidebar-conversation-row{display:flex;justify-content:space-between;align-items:center;margin-top:16px;border-radius:16px;padding:8px}.sidebar-conversation-action{display:flex;align-items:center;cursor:pointer;border-radius:8px;padding:8px;transition:background .2s}.sidebar-conversation-action:hover,.sidebar-conversation-action:focus{background:#f5f5f5}.sidebar-search-box{margin-top:8px;padding:12px;background:#f5f5f5;border-radius:8px;display:flex;align-items:center}.sidebar-search-box input{border:none;outline:none;background:transparent;width:100%;font-size:16px;font-weight:500}.sidebar-search-box input::placeholder{color:#1113154d;opacity:1}.sidebar-menu-row{display:flex;justify-content:space-between;align-items:center;cursor:pointer;border-radius:8px;padding:8px;transition:background .2s}.sidebar-menu-row:hover,.sidebar-menu-row:focus{background:#f5f5f5}.sidebar-popover{position:absolute;top:32px;right:0;background:#efefef;border:1px solid #858B934D;border-radius:12px;box-shadow:0 2px 8px #00000014;z-index:100;min-width:170px;padding:8px 0}.sidebar-popover-item{font-size:14px;padding:8px 16px;cursor:pointer;display:flex;align-items:center;gap:8px;transition:background .2s;color:#1a1d1f}.sidebar-popover-item:hover{background:#f5f5f5}.sidebar-menu-dot{opacity:0;pointer-events:none;transition:opacity .15s}.sidebar-menu-row:hover .sidebar-menu-dot,.sidebar-menu-row:focus .sidebar-menu-dot{opacity:1;pointer-events:auto}.sidebar-conversation-list{max-height:100%;overflow-y:auto}.sidebar-conversation-list::-webkit-scrollbar{width:2px}.sidebar-conversation-list::-webkit-scrollbar-track{background:transparent}.sidebar-conversation-list::-webkit-scrollbar-thumb{background:#1aaf74}.sidebar-conversation-list::-webkit-scrollbar-thumb:hover{background:#1aaf74}.sider-bar-input{width:100%;padding:8px;border:1px solid #1AAF74;border-radius:4px;box-sizing:border-box;outline:none;transition:border-color .2s}.sider-bar-input:focus{border-color:#1aaf74}.chat-action-btn{background:#1aaf741a;border:1px solid #1AAF744D;color:#1a1d1f;border-radius:24px;padding:8px 12px;font-size:14px;font-weight:400;cursor:pointer;transition:background .2s;outline:none;margin:0 8px}.chat-action-btn:hover{background:#d2f1e0}.header-steps{display:flex;justify-content:space-between;align-items:center;padding:12px 24px;border-bottom:1px solid #e0e0e0;background:#fff;position:sticky;top:0;height:28px;z-index:10;gap:16px}.header-steps-title{font-weight:700;font-size:18px;color:#1a1d1f;flex-shrink:0}.header-steps-container{display:flex;gap:0px;align-items:center;flex-shrink:0}.header-step{width:28px;height:28px;border-radius:50%;background:#f4f4f499;color:#000;border:2px solid #EFEFEF;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;transition:background-color .2s ease,color .2s ease}.header-step.active{background:#1aaf74;border:2px solid #1AAF74;color:#fff}.header-step-line{width:16px;height:2px;background:#858b934d;margin:0 4px;border-radius:1px;flex-shrink:0}.header-step-tooltip{position:absolute;top:36px;left:50%;transform:translate(-50%);background:#fff;color:#1a1d1f;padding:6px 12px;border-radius:6px;box-shadow:0 2px 8px #0000001f;white-space:nowrap;font-size:13px}.wave-svg{position:absolute;top:-6px;left:0;width:100%;height:6px;opacity:0;pointer-events:none;transition:opacity .05s linear}.wave-svg.active{opacity:1}`)),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
(function(Te,xe){typeof exports=="object"&&typeof module!="undefined"?xe(exports):typeof define=="function"&&define.amd?define(["exports"],xe):(Te=typeof globalThis!="undefined"?globalThis:Te||self,xe(Te.EzChat={}))})(this,(function(Te){"use strict";var t2=Object.defineProperty,n2=Object.defineProperties;var s2=Object.getOwnPropertyDescriptors;var ds=Object.getOwnPropertySymbols;var i2=Object.prototype.hasOwnProperty,o2=Object.prototype.propertyIsEnumerable;var In=(Te,xe,Pe)=>xe in Te?t2(Te,xe,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):Te[xe]=Pe,j=(Te,xe)=>{for(var Pe in xe||(xe={}))i2.call(xe,Pe)&&In(Te,Pe,xe[Pe]);if(ds)for(var Pe of ds(xe))o2.call(xe,Pe)&&In(Te,Pe,xe[Pe]);return Te},oe=(Te,xe)=>n2(Te,s2(xe));var Ce=(Te,xe,Pe)=>In(Te,typeof xe!="symbol"?xe+"":xe,Pe);var v=(Te,xe,Pe)=>new Promise((et,Ct)=>{var mt=Ye=>{try{Ze(Pe.next(Ye))}catch(vt){Ct(vt)}},jt=Ye=>{try{Ze(Pe.throw(Ye))}catch(vt){Ct(vt)}},Ze=Ye=>Ye.done?et(Ye.value):Promise.resolve(Ye.value).then(mt,jt);Ze((Pe=Pe.apply(Te,xe)).next())});const Pe=(t,e)=>t===e,et=Symbol("solid-proxy"),Ct=Symbol("solid-track"),mt={equals:Pe};let jt=En;const Ze=1,Ye=2,vt={owned:null,cleanups:null,context:null,owner:null};var _e=null;let dn=null,us=null,Me=null,Le=null,tt=null,zt=0;function Vt(t,e){const n=Me,s=_e,i=t.length===0,o=e===void 0?s:e,r=i?vt:{owned:null,cleanups:null,context:o?o.context:null,owner:o},c=i?t:()=>t(()=>Je(()=>Dt(r)));_e=r,Me=null;try{return wt(c,!0)}finally{Me=n,_e=s}}function L(t,e){e=e?Object.assign({},mt,e):mt;const n={value:t,observers:null,observerSlots:null,comparator:e.equals||void 0},s=i=>(typeof i=="function"&&(i=i(n.value)),Mn(n,i));return[kn.bind(n),s]}function fe(t,e,n){const s=fn(t,e,!1,Ze);Pt(s)}function nt(t,e,n){jt=ws;const s=fn(t,e,!1,Ze);s.user=!0,tt?tt.push(s):Pt(s)}function st(t,e,n){n=n?Object.assign({},mt,n):mt;const s=fn(t,e,!0,0);return s.observers=null,s.observerSlots=null,s.comparator=n.equals||void 0,Pt(s),kn.bind(s)}function hs(t){return wt(t,!1)}function Je(t){if(Me===null)return t();const e=Me;Me=null;try{return t()}finally{Me=e}}function fs(t,e,n){const s=Array.isArray(t);let i;return o=>{let r;if(s){r=Array(t.length);for(let a=0;a<t.length;a++)r[a]=t[a]()}else r=t();const c=Je(()=>e(r,i,o));return i=r,c}}function Rt(t){nt(()=>Je(t))}function un(t){return _e===null||(_e.cleanups===null?_e.cleanups=[t]:_e.cleanups.push(t)),t}function hn(){return Me}function gs(t,e){const n=Symbol("context");return{id:n,Provider:bs(n),defaultValue:t}}function ps(t){let e;return _e&&_e.context&&(e=_e.context[t.id])!==void 0?e:t.defaultValue}function Cs(t){const e=st(t),n=st(()=>gn(e()));return n.toArray=()=>{const s=n();return Array.isArray(s)?s:s!=null?[s]:[]},n}function kn(){if(this.sources&&this.state)if(this.state===Ze)Pt(this);else{const t=Le;Le=null,wt(()=>qt(this),!1),Le=t}if(Me){const t=this.observers?this.observers.length:0;Me.sources?(Me.sources.push(this),Me.sourceSlots.push(t)):(Me.sources=[this],Me.sourceSlots=[t]),this.observers?(this.observers.push(Me),this.observerSlots.push(Me.sources.length-1)):(this.observers=[Me],this.observerSlots=[Me.sources.length-1])}return this.value}function Mn(t,e,n){let s=t.value;return(!t.comparator||!t.comparator(s,e))&&(t.value=e,t.observers&&t.observers.length&&wt(()=>{for(let i=0;i<t.observers.length;i+=1){const o=t.observers[i],r=dn&&dn.running;r&&dn.disposed.has(o),(r?!o.tState:!o.state)&&(o.pure?Le.push(o):tt.push(o),o.observers&&Tn(o)),r||(o.state=Ze)}if(Le.length>1e6)throw Le=[],new Error},!1)),e}function Pt(t){if(!t.fn)return;Dt(t);const e=zt;ms(t,t.value,e)}function ms(t,e,n){let s;const i=_e,o=Me;Me=_e=t;try{s=t.fn(e)}catch(r){return t.pure&&(t.state=Ze,t.owned&&t.owned.forEach(Dt),t.owned=null),t.updatedAt=n+1,$n(r)}finally{Me=o,_e=i}(!t.updatedAt||t.updatedAt<=n)&&(t.updatedAt!=null&&"observers"in t?Mn(t,s):t.value=s,t.updatedAt=n)}function fn(t,e,n,s=Ze,i){const o={fn:t,state:s,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:_e,context:_e?_e.context:null,pure:n};return _e===null||_e!==vt&&(_e.owned?_e.owned.push(o):_e.owned=[o]),o}function Wt(t){if(t.state===0)return;if(t.state===Ye)return qt(t);if(t.suspense&&Je(t.suspense.inFallback))return t.suspense.effects.push(t);const e=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt<zt);)t.state&&e.push(t);for(let n=e.length-1;n>=0;n--)if(t=e[n],t.state===Ze)Pt(t);else if(t.state===Ye){const s=Le;Le=null,wt(()=>qt(t,e[0]),!1),Le=s}}function wt(t,e){if(Le)return t();let n=!1;e||(Le=[]),tt?n=!0:tt=[],zt++;try{const s=t();return vs(n),s}catch(s){n||(tt=null),Le=null,$n(s)}}function vs(t){if(Le&&(En(Le),Le=null),t)return;const e=tt;tt=null,e.length&&wt(()=>jt(e),!1)}function En(t){for(let e=0;e<t.length;e++)Wt(t[e])}function ws(t){let e,n=0;for(e=0;e<t.length;e++){const s=t[e];s.user?t[n++]=s:Wt(s)}for(e=0;e<n;e++)Wt(t[e])}function qt(t,e){t.state=0;for(let n=0;n<t.sources.length;n+=1){const s=t.sources[n];if(s.sources){const i=s.state;i===Ze?s!==e&&(!s.updatedAt||s.updatedAt<zt)&&Wt(s):i===Ye&&qt(s,e)}}}function Tn(t){for(let e=0;e<t.observers.length;e+=1){const n=t.observers[e];n.state||(n.state=Ye,n.pure?Le.push(n):tt.push(n),n.observers&&Tn(n))}}function Dt(t){let e;if(t.sources)for(;t.sources.length;){const n=t.sources.pop(),s=t.sourceSlots.pop(),i=n.observers;if(i&&i.length){const o=i.pop(),r=n.observerSlots.pop();s<i.length&&(o.sourceSlots[r]=s,i[s]=o,n.observerSlots[s]=r)}}if(t.tOwned){for(e=t.tOwned.length-1;e>=0;e--)Dt(t.tOwned[e]);delete t.tOwned}if(t.owned){for(e=t.owned.length-1;e>=0;e--)Dt(t.owned[e]);t.owned=null}if(t.cleanups){for(e=t.cleanups.length-1;e>=0;e--)t.cleanups[e]();t.cleanups=null}t.state=0}function ys(t){return t instanceof Error?t:new Error(typeof t=="string"?t:"Unknown error",{cause:t})}function $n(t,e=_e){throw ys(t)}function gn(t){if(typeof t=="function"&&!t.length)return gn(t());if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++){const s=gn(t[n]);Array.isArray(s)?e.push.apply(e,s):e.push(s)}return e}return t}function bs(t,e){return function(s){let i;return fe(()=>i=Je(()=>(_e.context=oe(j({},_e.context),{[t]:s.value}),Cs(()=>s.children))),void 0),i}}const _s=Symbol("fallback");function Rn(t){for(let e=0;e<t.length;e++)t[e]()}function Ss(t,e,n={}){let s=[],i=[],o=[],r=0,c=e.length>1?[]:null;return un(()=>Rn(o)),()=>{let a=t()||[],d=a.length,u,f;return a[Ct],Je(()=>{let V,U,F,J,H,E,b,y,q;if(d===0)r!==0&&(Rn(o),o=[],s=[],i=[],r=0,c&&(c=[])),n.fallback&&(s=[_s],i[0]=Vt(h=>(o[0]=h,n.fallback())),r=1);else if(r===0){for(i=new Array(d),f=0;f<d;f++)s[f]=a[f],i[f]=Vt(N);r=d}else{for(F=new Array(d),J=new Array(d),c&&(H=new Array(d)),E=0,b=Math.min(r,d);E<b&&s[E]===a[E];E++);for(b=r-1,y=d-1;b>=E&&y>=E&&s[b]===a[y];b--,y--)F[y]=i[b],J[y]=o[b],c&&(H[y]=c[b]);for(V=new Map,U=new Array(y+1),f=y;f>=E;f--)q=a[f],u=V.get(q),U[f]=u===void 0?-1:u,V.set(q,f);for(u=E;u<=b;u++)q=s[u],f=V.get(q),f!==void 0&&f!==-1?(F[f]=i[u],J[f]=o[u],c&&(H[f]=c[u]),f=U[f],V.set(q,f)):o[u]();for(f=E;f<d;f++)f in F?(i[f]=F[f],o[f]=J[f],c&&(c[f]=H[f],c[f](f))):i[f]=Vt(N);i=i.slice(0,r=d),s=a.slice(0)}return i});function N(V){if(o[f]=V,c){const[U,F]=L(f);return c[f]=F,e(a[f],U)}return e(a[f])}}}function ae(t,e){return Je(()=>t(e||{}))}const As=t=>`Stale read from <${t}>.`;function ut(t){const e="fallback"in t&&{fallback:()=>t.fallback};return st(Ss(()=>t.each,t.children,e||void 0))}function Qe(t){const e=t.keyed,n=st(()=>t.when,void 0,void 0),s=e?n:st(n,void 0,{equals:(i,o)=>!i==!o});return st(()=>{const i=s();if(i){const o=t.children;return typeof o=="function"&&o.length>0?Je(()=>o(e?i:()=>{if(!Je(s))throw As("Show");return n()})):o}return t.fallback},void 0,void 0)}const te=t=>st(()=>t());function xs(t,e,n){let s=n.length,i=e.length,o=s,r=0,c=0,a=e[i-1].nextSibling,d=null;for(;r<i||c<o;){if(e[r]===n[c]){r++,c++;continue}for(;e[i-1]===n[o-1];)i--,o--;if(i===r){const u=o<s?c?n[c-1].nextSibling:n[o-c]:a;for(;c<o;)t.insertBefore(n[c++],u)}else if(o===c)for(;r<i;)(!d||!d.has(e[r]))&&e[r].remove(),r++;else if(e[r]===n[o-1]&&n[c]===e[i-1]){const u=e[--i].nextSibling;t.insertBefore(n[c++],e[r++].nextSibling),t.insertBefore(n[--o],u),e[i]=n[o]}else{if(!d){d=new Map;let f=c;for(;f<o;)d.set(n[f],f++)}const u=d.get(e[r]);if(u!=null)if(c<u&&u<o){let f=r,N=1,V;for(;++f<i&&f<o&&!((V=d.get(e[f]))==null||V!==u+N);)N++;if(N>u-c){const U=e[r];for(;c<u;)t.insertBefore(n[c++],U)}else t.replaceChild(n[c++],e[r++])}else r++;else e[r++].remove()}}}const Pn="_$DX_DELEGATE";function Is(t,e,n,s={}){let i;return Vt(o=>{i=o,e===document?t():k(e,t(),e.firstChild?null:void 0,n)},s.owner),()=>{i(),e.textContent=""}}function O(t,e,n,s){let i;const o=()=>{const c=document.createElement("template");return c.innerHTML=t,c.content.firstChild},r=()=>(i||(i=o())).cloneNode(!0);return r.cloneNode=r,r}function yt(t,e=window.document){const n=e[Pn]||(e[Pn]=new Set);for(let s=0,i=t.length;s<i;s++){const o=t[s];n.has(o)||(n.add(o),e.addEventListener(o,ks))}}function ce(t,e,n){n==null?t.removeAttribute(e):t.setAttribute(e,n)}function it(t,e){e==null?t.removeAttribute("class"):t.className=e}function Zt(t,e,n,s){Array.isArray(n)?(t[`$$${e}`]=n[0],t[`$$${e}Data`]=n[1]):t[`$$${e}`]=n}function pn(t,e,n){if(!e)return n?ce(t,"style"):e;const s=t.style;if(typeof e=="string")return s.cssText=e;typeof n=="string"&&(s.cssText=n=void 0),n||(n={}),e||(e={});let i,o;for(o in n)e[o]==null&&s.removeProperty(o),delete n[o];for(o in e)i=e[o],i!==n[o]&&(s.setProperty(o,i),n[o]=i);return n}function l(t,e,n){n!=null?t.style.setProperty(e,n):t.style.removeProperty(e)}function Yt(t,e,n){return Je(()=>t(e,n))}function k(t,e,n,s){if(n!==void 0&&!s&&(s=[]),typeof e!="function")return Xt(t,e,s,n);fe(i=>Xt(t,e(),i,n),s)}function ks(t){let e=t.target;const n=`$$${t.type}`,s=t.target,i=t.currentTarget,o=a=>Object.defineProperty(t,"target",{configurable:!0,value:a}),r=()=>{const a=e[n];if(a&&!e.disabled){const d=e[`${n}Data`];if(d!==void 0?a.call(e,d,t):a.call(e,t),t.cancelBubble)return}return e.host&&typeof e.host!="string"&&!e.host._$host&&e.contains(t.target)&&o(e.host),!0},c=()=>{for(;r()&&(e=e._$host||e.parentNode||e.host););};if(Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return e||document}}),t.composedPath){const a=t.composedPath();o(a[0]);for(let d=0;d<a.length-2&&(e=a[d],!!r());d++){if(e._$host){e=e._$host,c();break}if(e.parentNode===i)break}}else c();o(s)}function Xt(t,e,n,s,i){for(;typeof n=="function";)n=n();if(e===n)return n;const o=typeof e,r=s!==void 0;if(t=r&&n[0]&&n[0].parentNode||t,o==="string"||o==="number"){if(o==="number"&&(e=e.toString(),e===n))return n;if(r){let c=n[0];c&&c.nodeType===3?c.data!==e&&(c.data=e):c=document.createTextNode(e),n=bt(t,n,s,c)}else n!==""&&typeof n=="string"?n=t.firstChild.data=e:n=t.textContent=e}else if(e==null||o==="boolean")n=bt(t,n,s);else{if(o==="function")return fe(()=>{let c=e();for(;typeof c=="function";)c=c();n=Xt(t,c,n,s)}),()=>n;if(Array.isArray(e)){const c=[],a=n&&Array.isArray(n);if(Cn(c,e,n,i))return fe(()=>n=Xt(t,c,n,s,!0)),()=>n;if(c.length===0){if(n=bt(t,n,s),r)return n}else a?n.length===0?Dn(t,c,s):xs(t,n,c):(n&&bt(t),Dn(t,c));n=c}else if(e.nodeType){if(Array.isArray(n)){if(r)return n=bt(t,n,s,e);bt(t,n,null,e)}else n==null||n===""||!t.firstChild?t.appendChild(e):t.replaceChild(e,t.firstChild);n=e}}return n}function Cn(t,e,n,s){let i=!1;for(let o=0,r=e.length;o<r;o++){let c=e[o],a=n&&n[t.length],d;if(!(c==null||c===!0||c===!1))if((d=typeof c)=="object"&&c.nodeType)t.push(c);else if(Array.isArray(c))i=Cn(t,c,a)||i;else if(d==="function")if(s){for(;typeof c=="function";)c=c();i=Cn(t,Array.isArray(c)?c:[c],Array.isArray(a)?a:[a])||i}else t.push(c),i=!0;else{const u=String(c);a&&a.nodeType===3&&a.data===u?t.push(a):t.push(document.createTextNode(u))}}return i}function Dn(t,e,n=null){for(let s=0,i=e.length;s<i;s++)t.insertBefore(e[s],n)}function bt(t,e,n,s){if(n===void 0)return t.textContent="";const i=s||document.createTextNode("");if(e.length){let o=!1;for(let r=e.length-1;r>=0;r--){const c=e[r];if(i!==c){const a=c.parentNode===t;!o&&!r?a?t.replaceChild(i,c):t.insertBefore(i,n):a&&c.remove()}else o=!0}}else t.insertBefore(i,n);return[i]}const mn="data:image/svg+xml,%3csvg%20width='44'%20height='40'%20viewBox='0%200%2044%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M36.4826%2032.6733C35.865%2033.1908%2035.1941%2033.6282%2034.4904%2033.957L33.74%2034.2621L29.7612%2035.8775C27.1272%2036.125%2024.4866%2036.253%2021.8465%2036.2542C21.235%2036.2549%2020.6236%2036.2482%2020.0127%2036.2348V33.2478L36.4826%2032.6733Z'%20fill='%239EACBA'/%3e%3cpath%20d='M0.438355%2018.8047C0.245806%2020.9769%200.245812%2023.1226%200.438355%2025.2946C0.535045%2025.9265%200.94889%2026.5048%201.4516%2026.8841C2.21046%2027.3799%202.95285%2027.8531%203.87299%2027.9711C4.74581%2027.9246%205.47724%2026.84%205.59973%2026.0356C5.89635%2023.3667%205.89636%2020.7328%205.59973%2018.0638C5.47724%2017.2593%204.74582%2016.1747%203.873%2016.1282C2.95286%2016.2462%202.21046%2016.7194%201.45161%2017.2152C0.948896%2017.5945%200.535045%2018.1729%200.438355%2018.8047Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M43.0616%2018.8047C43.2541%2020.9769%2043.2541%2023.1226%2043.0616%2025.2946C42.9649%2025.9265%2042.551%2026.5048%2042.0483%2026.8841C41.2895%2027.3799%2040.5471%2027.8531%2039.6269%2027.9711C38.7541%2027.9246%2038.0227%2026.84%2037.9002%2026.0356C37.6036%2023.3667%2037.6036%2020.7328%2037.9002%2018.0638C38.0227%2017.2593%2038.7541%2016.1747%2039.6269%2016.1282C40.5471%2016.2462%2041.2895%2016.7194%2042.0483%2017.2152C42.551%2017.5945%2042.9649%2018.1729%2043.0616%2018.8047Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M25.8389%208.85439H21.8867V7.22803H21.9359C22.2919%207.22803%2022.6365%207.24805%2022.9641%207.28506C24.6208%207.47311%2025.8389%208.10461%2025.8389%208.85439Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M22.9637%208.85422V11.641H20.9072V3.74219H21.8863V8.85422H22.9637Z'%20fill='%23171A3B'/%3e%3cpath%20d='M25.8393%208.85439C25.8393%209.60419%2024.6212%2010.2357%2022.9645%2010.4237C22.6369%2010.4607%2022.2923%2010.4808%2021.9362%2010.4808C21.5801%2010.4808%2021.2356%2010.4607%2020.908%2010.4237C19.2513%2010.2357%2018.0332%209.60419%2018.0332%208.85439C18.0332%208.104%2019.2513%207.47311%2020.908%207.28506C21.2204%207.24987%2021.5486%207.22985%2021.8871%207.22803V8.85439H25.8393Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M21.8871%208.85499V35.245H21.8465C21.235%2035.2456%2020.6235%2035.2389%2020.0127%2035.2256C17.1712%2035.1637%2014.331%2034.9538%2011.5017%2034.5856C7.74793%2034.0979%204.29685%2030.281%203.74784%2026.4459C3.32624%2023.5019%203.32624%2020.598%203.74784%2017.6541C4.29684%2013.819%207.74793%2010.0021%2011.5017%209.5144C14.9401%209.06731%2018.393%208.85317%2021.8465%208.85499H21.8871Z'%20fill='%23E7E9EB'/%3e%3cpath%20d='M40.114%2026.4452C39.7718%2028.7455%2038.3748%2031.0864%2036.4821%2032.6728C35.8646%2033.1902%2035.1936%2033.6276%2034.49%2033.9564C34.2437%2034.0716%2033.9931%2034.1736%2033.7396%2034.2615C33.2888%2034.4168%2032.8272%2034.5272%2032.3601%2034.5848C28.8781%2035.0149%2025.3827%2035.2406%2021.8867%2035.2442V8.85425C25.3821%208.85789%2028.8787%209.08355%2032.3601%209.51366C36.1382%209.98014%2039.5516%2013.8729%2040.114%2017.6533C40.5489%2020.5785%2040.5489%2023.5206%2040.114%2026.4452Z'%20fill='%23D1D3D4'/%3e%3cpath%20d='M27.1787%2013.3372C28.7256%2013.4409%2030.2804%2013.5888%2031.834%2013.7805C33.5282%2013.9898%2035.5612%2016.263%2035.8623%2018.2854C36.2336%2020.7829%2036.2336%2023.3159%2035.8623%2025.8127C35.6791%2027.0417%2034.8396%2028.4416%2033.7217%2029.3782C33.3772%2029.6675%2033.0233%2029.8974%2032.6709%2030.0618C32.5593%2030.1145%2032.4464%2030.1603%2032.3359%2030.1985C32.1609%2030.259%2031.9925%2030.2992%2031.835%2030.3186C28.467%2030.7347%2025.0907%2030.9456%2021.7998%2030.9456C21.2369%2030.9456%2020.667%2030.9391%2020.1064%2030.927C17.3961%2030.8675%2014.6875%2030.6643%2012.0566%2030.3215C11.6382%2030.2669%2011.1776%2030.0829%2010.7197%2029.7961L27.1787%2013.3372ZM21.7988%2013.1536C22.397%2013.1536%2022.9986%2013.1605%2023.6016%2013.175H23.6006C24.7855%2013.2017%2025.9795%2013.2559%2027.1777%2013.3372L10.7188%2029.7961C10.3196%2029.5462%209.92292%2029.2179%209.55957%2028.8303C9.2952%2028.5484%209.05604%2028.2435%208.84863%2027.927V27.926C8.40193%2027.2445%208.10127%2026.5082%208.00488%2025.8352C7.82534%2024.5778%207.73289%2023.3374%207.73047%2022.0969C7.72805%2020.825%207.8205%2019.5531%208.00488%2018.2629C8.14621%2017.2772%208.72802%2016.1571%209.56152%2015.2678C10.341%2014.4363%2011.2736%2013.8785%2012.0566%2013.7766C13.5174%2013.5867%2014.9995%2013.4403%2016.4912%2013.3372C18.2497%2013.2152%2020.0239%2013.1536%2021.7988%2013.1536Z'%20fill='%2333383F'/%3e%3cpath%20d='M21.8877%200.164557V4.90412C21.5382%204.90412%2021.207%204.8289%2020.9086%204.69301C20.0878%204.32054%2019.5176%203.49371%2019.5176%202.53403C19.5176%201.22554%2020.5786%200.164557%2021.8877%200.164557Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M29.7612%2035.877L20.0127%2039.8352V36.2343C20.6236%2036.2476%2021.235%2036.2543%2021.8465%2036.2537C24.4866%2036.2525%2027.1272%2036.1245%2029.7612%2035.877Z'%20fill='%23D1D3D4'/%3e%3cpath%20d='M24.2562%202.53403C24.2562%203.45488%2023.7309%204.2532%2022.9641%204.64569C22.6414%204.8107%2022.275%204.90411%2021.8867%204.90411V0.164551C23.1952%200.164551%2024.2562%201.22553%2024.2562%202.53403Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M22.9641%204.646V7.28541C22.6365%207.24841%2022.2919%207.22839%2021.9359%207.22839H21.8867V4.90441C22.275%204.90441%2022.6414%204.811%2022.9641%204.646Z'%20fill='%2301052B'/%3e%3cpath%20d='M15.4282%2025.5157C14.6141%2025.6903%2014.1949%2025.6903%2013.3808%2025.5157C12.8325%2025.2805%2012.4157%2024.7097%2012.2918%2024.124C12.0811%2022.4009%2012.0811%2020.7336%2012.2918%2019.0104C12.4157%2018.4248%2012.8325%2017.854%2013.3808%2017.6188C14.1949%2017.4441%2014.6141%2017.4441%2015.4282%2017.6188C15.9765%2017.854%2016.3933%2018.4248%2016.5173%2019.0104C16.7279%2020.7336%2016.7279%2022.4009%2016.5173%2024.124C16.3933%2024.7097%2015.9765%2025.2805%2015.4282%2025.5157Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M29.4946%2025.5157C28.6805%2025.6903%2028.2613%2025.6903%2027.4472%2025.5157C26.8989%2025.2805%2026.4821%2024.7097%2026.3582%2024.124C26.1475%2022.4009%2026.1475%2020.7336%2026.3582%2019.0104C26.4821%2018.4248%2026.8989%2017.854%2027.4472%2017.6188C28.2613%2017.4441%2028.6805%2017.4441%2029.4946%2017.6188C30.0429%2017.854%2030.4597%2018.4248%2030.5837%2019.0104C30.7943%2020.7336%2030.7943%2022.4009%2030.5837%2024.124C30.4597%2024.7097%2030.0429%2025.2805%2029.4946%2025.5157Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M18.9688%2024.187H23.91C24.2911%2024.187%2024.6004%2024.5023%2024.6004%2024.8906V24.9011C24.6004%2026.6789%2023.184%2028.1222%2021.4394%2028.1222C19.6948%2028.1222%2018.2783%2026.6789%2018.2783%2024.9011V24.8906C18.2783%2024.5023%2018.5877%2024.187%2018.9688%2024.187Z'%20fill='%2351D6A1'/%3e%3c/svg%3e",Ms="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='28'%20height='28'%20rx='14'%20fill='%23EFEFEF'/%3e%3cpath%20d='M20.667%209.83325L7.33366%209.83325'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M16.5%2014L7.33333%2014'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M11.5%2018.1667H7.33333'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Es="data:image/svg+xml,%3csvg%20width='29'%20height='28'%20viewBox='0%200%2029%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.5977%2016.0232C11.8613%2015.7596%2012.2882%2015.7596%2012.5518%2016.0232C12.8152%2016.2868%2012.8153%2016.7137%2012.5518%2016.9773L7.87109%2021.658H11.1221C11.4949%2021.658%2011.7969%2021.9609%2011.7969%2022.3337C11.7967%2022.7064%2011.4948%2023.0085%2011.1221%2023.0085H6.24121C5.86853%2023.0085%205.56658%2022.7064%205.56641%2022.3337V17.4529C5.56641%2017.0801%205.86842%2016.7771%206.24121%2016.7771C6.614%2016.7771%206.91602%2017.0801%206.91602%2017.4529V20.7039L11.5977%2016.0232ZM22.9082%204.99194C23.2808%204.99212%2023.583%205.29406%2023.583%205.66675V10.5476C23.583%2010.9203%2023.2808%2011.2222%2022.9082%2011.2224C22.5354%2011.2224%2022.2324%2010.9204%2022.2324%2010.5476V7.29663L17.5518%2011.9773C17.2882%2012.2408%2016.8613%2012.2407%2016.5977%2011.9773C16.3341%2011.7137%2016.3341%2011.2868%2016.5977%2011.0232L21.2783%206.34155H18.0273C17.6546%206.34155%2017.3516%206.03954%2017.3516%205.66675C17.3516%205.29396%2017.6546%204.99194%2018.0273%204.99194H22.9082Z'%20fill='%23858B93'%20stroke='%23858B93'%20stroke-width='0.1'/%3e%3c/svg%3e",Ts="data:image/svg+xml,%3csvg%20width='29'%20height='28'%20viewBox='0%200%2029%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.0737%2015.8249C12.4464%2015.8249%2012.7493%2016.127%2012.7495%2016.4997V21.3805C12.7495%2021.7533%2012.4465%2022.0563%2012.0737%2022.0563C11.7011%2022.0561%2011.3989%2021.7532%2011.3989%2021.3805V18.1296L6.71826%2022.8102C6.45466%2023.0738%206.02679%2023.0738%205.76318%2022.8102C5.49996%2022.5466%205.49985%2022.1196%205.76318%2021.8561L10.4438%2017.1755H7.19287C6.82019%2017.1753%206.51807%2016.8724%206.51807%2016.4997C6.51824%2016.1271%206.82029%2015.825%207.19287%2015.8249H12.0737ZM22.4302%205.18913C22.6937%204.9258%2023.1207%204.92591%2023.3843%205.18913C23.6479%205.45274%2023.6479%205.88061%2023.3843%206.14421L18.7046%2010.8249H21.9546C22.3273%2010.8249%2022.6302%2011.127%2022.6304%2011.4997C22.6304%2011.8725%2022.3274%2012.1755%2021.9546%2012.1755H17.0737C16.7011%2012.1753%2016.3989%2011.8724%2016.3989%2011.4997V6.61882C16.3991%206.24624%2016.7012%205.94419%2017.0737%205.94402C17.4464%205.94402%2017.7494%206.24613%2017.7495%206.61882V9.8698L22.4302%205.18913Z'%20fill='%23858B93'%20stroke='%23858B93'%20stroke-width='0.1'/%3e%3c/svg%3e",Bn="data:image/svg+xml,%3csvg%20width='34'%20height='34'%20viewBox='0%200%2034%2034'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.2391%208.55011C9.85199%208.16298%209.22434%208.16298%208.83722%208.55011C8.45009%208.93723%208.45009%209.56488%208.83722%209.95201L15.885%2016.9998L8.83728%2024.0476C8.45016%2024.4347%208.45016%2025.0624%208.83728%2025.4495C9.22441%2025.8366%209.85206%2025.8366%2010.2392%2025.4495L17.2869%2018.4017L24.3346%2025.4494C24.7217%2025.8365%2025.3494%2025.8365%2025.7365%2025.4494C26.1236%2025.0623%2026.1236%2024.4346%2025.7365%2024.0475L18.6888%2016.9998L25.7366%209.95207C26.1237%209.56495%2026.1237%208.9373%2025.7366%208.55017C25.3495%208.16305%2024.7218%208.16305%2024.3347%208.55017L17.2869%2015.5979L10.2391%208.55011Z'%20fill='%23858B93'/%3e%3c/svg%3e",$s="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.9912%202.92969C11.4392%202.92969%2010.9912%203.37769%2010.9912%203.92969V10.9297H3.99121C3.43921%2010.9297%202.99121%2011.3777%202.99121%2011.9297C2.99121%2012.4817%203.43921%2012.9297%203.99121%2012.9297H10.9912V19.9297C10.9912%2020.4817%2011.4392%2020.9297%2011.9912%2020.9297C12.5432%2020.9297%2012.9912%2020.4817%2012.9912%2019.9297V12.9297H19.9912C20.5432%2012.9297%2020.9912%2012.4817%2020.9912%2011.9297C20.9912%2011.3777%2020.5432%2010.9297%2019.9912%2010.9297H12.9912V3.92969C12.9912%203.37769%2012.5432%202.92969%2011.9912%202.92969Z'%20fill='%23858B93'/%3e%3c/svg%3e",Rs="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.6464%2010.3132C15.8417%2010.1179%2016.1583%2010.1179%2016.3536%2010.3132L20.3536%2014.3132C20.5488%2014.5085%2020.5488%2014.825%2020.3536%2015.0203C20.1583%2015.2156%2019.8417%2015.2156%2019.6464%2015.0203L16.5%2011.8739L16.5%2021.3334C16.5%2021.6096%2016.2761%2021.8334%2016%2021.8334C15.7239%2021.8334%2015.5%2021.6096%2015.5%2021.3334L15.5%2011.8739L12.3536%2015.0203C12.1583%2015.2156%2011.8417%2015.2156%2011.6464%2015.0203C11.4512%2014.825%2011.4512%2014.5085%2011.6464%2014.3132L15.6464%2010.3132Z'%20fill='%23858B93'/%3e%3c/svg%3e",Ps="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='28'%20height='28'%20rx='14'%20fill='%231AAF74'%20fill-opacity='0.1'/%3e%3cpath%20d='M20.667%209.83325L7.33366%209.83325'%20stroke='%231AAF74'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M16.5%2014L7.33333%2014'%20stroke='%231AAF74'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M11.5%2018.1667H7.33333'%20stroke='%231AAF74'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Ds="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='12'%20cy='6.5'%20r='4'%20stroke='%23858B93'%20stroke-width='1.3'/%3e%3cellipse%20cx='12'%20cy='17.5'%20rx='7'%20ry='4'%20stroke='%23858B93'%20stroke-width='1.3'/%3e%3c/svg%3e",Bs="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2012.5C2%207.78595%202%205.42893%203.46447%203.96447C4.92893%202.5%207.28595%202.5%2012%202.5C16.714%202.5%2019.0711%202.5%2020.5355%203.96447C22%205.42893%2022%207.78595%2022%2012.5C22%2017.214%2022%2019.5711%2020.5355%2021.0355C19.0711%2022.5%2016.714%2022.5%2012%2022.5C7.28595%2022.5%204.92893%2022.5%203.46447%2021.0355C2%2019.5711%202%2017.214%202%2012.5Z'%20stroke='%23858B93'%20stroke-width='1.3'/%3e%3cpath%20d='M7%2014.5L8.79689%2012.3437C9.50894%2011.4893%209.86496%2011.062%2010.3333%2011.062C10.8017%2011.062%2011.1577%2011.4893%2011.8698%2012.3437L12.1302%2012.6563C12.8423%2013.5107%2013.1983%2013.938%2013.6667%2013.938C14.135%2013.938%2014.4911%2013.5107%2015.2031%2012.6563L17%2010.5'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Hs="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M22%2011V12.5C22%2017.214%2022%2019.5711%2020.5355%2021.0355C19.0711%2022.5%2016.714%2022.5%2012%2022.5C7.28595%2022.5%204.92893%2022.5%203.46447%2021.0355C2%2019.5711%202%2017.214%202%2012.5C2%207.78595%202%205.42893%203.46447%203.96447C4.92893%202.5%207.28595%202.5%2012%202.5H13.5'%20stroke='%23858B93'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cpath%20d='M16.652%203.95506L17.3009%203.30624C18.3759%202.23125%2020.1188%202.23125%2021.1938%203.30624C22.2687%204.38124%2022.2687%206.12415%2021.1938%207.19914L20.5449%207.84795M16.652%203.95506C16.652%203.95506%2016.7331%205.33379%2017.9497%206.55032C19.1662%207.76685%2020.5449%207.84795%2020.5449%207.84795M16.652%203.95506L10.6872%209.91993C10.2832%2010.3239%2010.0812%2010.5259%209.90743%2010.7487C9.70249%2011.0114%209.52679%2011.2957%209.38344%2011.5965C9.26191%2011.8515%209.17157%2012.1225%208.99089%2012.6646L8.41242%2014.4M20.5449%207.84795L14.5801%2013.8128C14.1761%2014.2168%2013.9741%2014.4188%2013.7513%2014.5926C13.4886%2014.7975%2013.2043%2014.9732%2012.9035%2015.1166C12.6485%2015.2381%2012.3775%2015.3284%2011.8354%2015.5091L10.1%2016.0876M10.1%2016.0876L8.97709%2016.4619C8.71035%2016.5508%208.41626%2016.4814%208.21744%2016.2826C8.01862%2016.0837%207.9492%2015.7897%208.03811%2015.5229L8.41242%2014.4M10.1%2016.0876L8.41242%2014.4'%20stroke='%23858B93'%20stroke-width='1.5'/%3e%3c/svg%3e",Ls="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9.58366%202.79175C5.55658%202.79175%202.29199%206.05634%202.29199%2010.0834C2.29199%2014.1105%205.55658%2017.3751%209.58366%2017.3751C13.6107%2017.3751%2016.8753%2014.1105%2016.8753%2010.0834C16.8753%206.05634%2013.6107%202.79175%209.58366%202.79175ZM1.04199%2010.0834C1.04199%205.36598%204.86623%201.54175%209.58366%201.54175C14.3011%201.54175%2018.1253%205.36598%2018.1253%2010.0834C18.1253%2012.2172%2017.3429%2014.1682%2016.0494%2015.6653L18.7756%2018.3915C19.0197%2018.6356%2019.0197%2019.0313%2018.7756%2019.2754C18.5315%2019.5194%2018.1358%2019.5194%2017.8917%2019.2754L15.1655%2016.5491C13.6684%2017.8427%2011.7174%2018.6251%209.58366%2018.6251C4.86623%2018.6251%201.04199%2014.8008%201.04199%2010.0834Z'%20fill='%23858B93'/%3e%3c/svg%3e",Os="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17%2012.5C17%2011.3954%2017.8954%2010.5%2019%2010.5C20.1046%2010.5%2021%2011.3954%2021%2012.5C21%2013.6046%2020.1046%2014.5%2019%2014.5C17.8954%2014.5%2017%2013.6046%2017%2012.5Z'%20fill='%23858B93'/%3e%3cpath%20d='M10%2012.5C10%2011.3954%2010.8954%2010.5%2012%2010.5C13.1046%2010.5%2014%2011.3954%2014%2012.5C14%2013.6046%2013.1046%2014.5%2012%2014.5C10.8954%2014.5%2010%2013.6046%2010%2012.5Z'%20fill='%23858B93'/%3e%3cpath%20d='M3%2012.5C3%2011.3954%203.89543%2010.5%205%2010.5C6.10457%2010.5%207%2011.3954%207%2012.5C7%2013.6046%206.10457%2014.5%205%2014.5C3.89543%2014.5%203%2013.6046%203%2012.5Z'%20fill='%23858B93'/%3e%3c/svg%3e",Fs="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7%208.5C7%205.73858%209.23858%203.5%2012%203.5C14.7614%203.5%2017%205.73858%2017%208.5V11.5C17%2014.2614%2014.7614%2016.5%2012%2016.5C9.23858%2016.5%207%2014.2614%207%2011.5V8.5Z'%20stroke='%23858B93'%20stroke-width='1.5'/%3e%3cpath%20d='M11%208.5H13'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M10%2011.5L14%2011.5'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M20%2010.5V11.5C20%2015.9183%2016.4183%2019.5%2012%2019.5C7.58172%2019.5%204%2015.9183%204%2011.5V10.5'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M12%2019.5V22.5'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Hn="data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.25%202.49258C13.5179%201.2247%2015.5735%201.2247%2016.8414%202.49258C18.1093%203.76046%2018.1093%205.8161%2016.8414%207.08398L10.5131%2013.4123C10.1564%2013.769%209.9386%2013.9869%209.69583%2014.1762C9.40981%2014.3993%209.10033%2014.5906%208.77287%2014.7466C8.49494%2014.8791%208.20269%2014.9765%207.72413%2015.136L5.49692%2015.8784L4.9622%2016.0566C4.48358%2016.2162%203.95589%2016.0916%203.59915%2015.7349C3.2424%2015.3781%203.11783%2014.8504%203.27737%2014.3718L4.19801%2011.6099C4.3575%2011.1313%204.4549%2010.8391%204.58736%2010.5611C4.74342%2010.2337%204.93469%209.9242%205.15778%209.63817C5.34714%209.3954%205.56498%209.17759%205.92169%208.82091L12.25%202.49258ZM5.46809%2014.5704L4.76362%2013.8659L5.37064%2012.0449C5.54737%2011.5147%205.62037%2011.2991%205.71577%2011.0989C5.83276%2010.8534%205.97616%2010.6214%206.14342%2010.4069C6.27979%2010.2321%206.43997%2010.0704%206.83516%209.67521L11.7443%204.76607C11.9469%205.27439%2012.2898%205.88791%2012.8679%206.46606C13.4461%207.04422%2014.0596%207.38707%2014.5679%207.5897L9.65879%2012.4988C9.2636%2012.894%209.1019%2013.0542%208.92706%2013.1906C8.71262%2013.3578%208.4806%2013.5012%208.2351%2013.6182C8.03493%2013.7136%207.81935%2013.7866%207.28915%2013.9634L5.46809%2014.5704ZM15.564%206.59368C15.4608%206.57102%2015.3317%206.53694%2015.1851%206.48604C14.7817%206.34611%2014.2511%206.08149%2013.7518%205.58218C13.2525%205.08287%2012.9879%204.5523%2012.848%204.14895C12.7971%204.00226%2012.763%203.87323%2012.7403%203.77004L13.1339%203.37647C13.9136%202.59674%2015.1778%202.59674%2015.9575%203.37647C16.7373%204.15619%2016.7373%205.42038%2015.9575%206.2001L15.564%206.59368ZM3.209%2018.8333C3.209%2018.4882%203.48882%2018.2083%203.834%2018.2083H17.1673V19.4583H3.834C3.48882%2019.4583%203.209%2019.1785%203.209%2018.8333Z'%20fill='%23858B93'/%3e%3c/svg%3e",Ln="data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.4994%202.79166C9.68396%202.79166%208.9886%203.31251%208.7309%204.0416C8.61587%204.36705%208.2588%204.53763%207.93335%204.4226C7.6079%204.30757%207.43733%203.95049%207.55235%203.62504C7.98105%202.41215%209.13775%201.54166%2010.4994%201.54166C11.861%201.54166%2013.0177%202.41215%2013.4464%203.62504C13.5614%203.95049%2013.3908%204.30757%2013.0654%204.4226C12.74%204.53763%2012.3829%204.36705%2012.2678%204.0416C12.0101%203.31251%2011.3148%202.79166%2010.4994%202.79166Z'%20fill='%23858B93'/%3e%3cpath%20d='M2.79102%205.49999C2.79102%205.15481%203.07084%204.87499%203.41602%204.87499H17.5828C17.9279%204.87499%2018.2078%205.15481%2018.2078%205.49999C18.2078%205.84517%2017.9279%206.12499%2017.5828%206.12499H3.41602C3.07084%206.12499%202.79102%205.84517%202.79102%205.49999Z'%20fill='%23858B93'/%3e%3cpath%20d='M5.42859%207.54175C5.40563%207.19733%205.10781%206.93675%204.7634%206.95971C4.41898%206.98267%204.15839%207.28048%204.18135%207.6249L4.56756%2013.418C4.63881%2014.487%204.69636%2015.3504%204.83134%2016.028C4.97167%2016.7324%205.21035%2017.3208%205.70335%2017.782C6.19634%2018.2432%206.7993%2018.4422%207.51151%2018.5354C8.19654%2018.625%209.06191%2018.625%2010.1332%2018.625H10.8656C11.9369%2018.625%2012.8023%2018.625%2013.4873%2018.5354C14.1995%2018.4422%2014.8025%2018.2432%2015.2955%2017.782C15.7885%2017.3208%2016.0272%2016.7324%2016.1675%2016.028C16.3025%2015.3504%2016.36%2014.487%2016.4313%2013.418L16.8175%207.6249C16.8404%207.28048%2016.5798%206.98267%2016.2354%206.95971C15.891%206.93675%2015.5932%207.19733%2015.5702%207.54175L15.187%2013.291C15.1121%2014.4142%2015.0587%2015.1957%2014.9416%2015.7837C14.828%2016.3541%2014.6693%2016.656%2014.4415%2016.8692C14.2137%2017.0824%2013.9019%2017.2205%2013.3252%2017.296C12.7307%2017.3737%2011.9474%2017.375%2010.8216%2017.375H10.1772C9.05148%2017.375%208.26814%2017.3737%207.67364%2017.296C7.09697%2017.2205%206.78517%2017.0824%206.55733%2016.8692C6.32948%2016.656%206.17087%2016.3541%206.05725%2015.7837C5.94011%2015.1957%205.88675%2014.4142%205.81187%2013.291L5.42859%207.54175Z'%20fill='%23858B93'/%3e%3cpath%20d='M8.3539%209.04476C8.69736%209.01041%209.00364%209.261%209.03799%209.60447L9.45465%2013.7711C9.489%2014.1146%209.23841%2014.4209%208.89494%2014.4552C8.55148%2014.4896%208.2452%2014.239%208.21086%2013.8955L7.79419%209.72885C7.75984%209.38538%208.01043%209.0791%208.3539%209.04476Z'%20fill='%23858B93'/%3e%3cpath%20d='M13.2047%209.72885C13.239%209.38538%2012.9884%209.0791%2012.6449%209.04476C12.3015%209.01041%2011.9952%209.261%2011.9609%209.60447L11.5442%2013.7711C11.5098%2014.1146%2011.7604%2014.4209%2012.1039%2014.4552C12.4474%2014.4896%2012.7536%2014.239%2012.788%2013.8955L13.2047%209.72885Z'%20fill='%23858B93'/%3e%3c/svg%3e",Ns="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20d='M16%2022.6666L16%209.33331M16%209.33331L21%2014.3333M16%209.33331L11%2014.3333'%20stroke='%231AAF74'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Us="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2361_172518)'%3e%3cpath%20d='M15.6005%2011.6509C15.9284%2011.2327%2016.0856%2010.7843%2016.0656%2010.3226C16.0455%209.81401%2015.818%209.41585%2015.6306%209.1716C15.8481%208.62956%2015.9317%207.77636%2015.2057%207.11388C14.6737%206.62873%2013.7703%206.41125%2012.5189%206.47147C11.639%206.51162%2010.9029%206.67557%2010.8728%206.68226H10.8694C10.7021%206.71238%2010.5248%206.74918%2010.3441%206.78933C10.3307%206.57519%2010.3675%206.0432%2010.7623%204.84537C11.2308%203.42003%2011.204%202.32927%2010.6754%201.59987C10.1199%200.833663%209.23328%200.773438%208.9723%200.773438C8.72136%200.773438%208.49049%200.87716%208.32655%201.06787C7.95515%201.49949%207.99865%202.29581%208.04549%202.66386C7.60384%203.8483%206.36586%206.75253%205.3186%207.55888C5.29852%207.57227%205.2818%207.589%205.26507%207.60572C4.95724%207.93028%204.7498%208.28159%204.60927%208.58941C4.41187%208.48235%204.18769%208.42212%203.94679%208.42212H1.9058C1.13625%208.42212%200.513916%209.0478%200.513916%209.81401V15.2511C0.513916%2016.0206%201.1396%2016.6429%201.9058%2016.6429H3.94679C4.24457%2016.6429%204.52228%2016.5493%204.7498%2016.3887L5.53608%2016.4823C5.65653%2016.4991%207.7979%2016.7701%209.99614%2016.7266C10.3943%2016.7567%2010.769%2016.7734%2011.117%2016.7734C11.7159%2016.7734%2012.2379%2016.7266%2012.6728%2016.6329C13.6967%2016.4154%2014.396%2015.9805%2014.7506%2015.3414C15.0217%2014.8529%2015.0217%2014.3677%2014.9782%2014.0599C15.644%2013.4577%2015.7611%2012.7918%2015.7377%2012.3234C15.7243%2012.0524%2015.6641%2011.8215%2015.6005%2011.6509ZM1.9058%2015.7396C1.63479%2015.7396%201.4173%2015.5187%201.4173%2015.2511V9.81066C1.4173%209.53964%201.63813%209.32216%201.9058%209.32216H3.94679C4.21781%209.32216%204.43529%209.54299%204.43529%209.81066V15.2477C4.43529%2015.5187%204.21446%2015.7362%203.94679%2015.7362H1.9058V15.7396ZM14.7439%2011.2594C14.6034%2011.4066%2014.5767%2011.6308%2014.6837%2011.8048C14.6837%2011.8082%2014.8209%2012.0424%2014.8376%2012.3636C14.8611%2012.8019%2014.6503%2013.19%2014.2086%2013.5212C14.0513%2013.6417%2013.9878%2013.8491%2014.0547%2014.0365C14.0547%2014.0399%2014.1986%2014.4815%2013.9644%2014.8997C13.7402%2015.3013%2013.2416%2015.589%2012.4855%2015.7496C11.8799%2015.8801%2011.0568%2015.9035%2010.0463%2015.8232C10.0329%2015.8232%2010.0162%2015.8232%209.99949%2015.8232C7.84809%2015.87%205.67326%2015.589%205.64984%2015.5856H5.6465L5.30856%2015.5455C5.32864%2015.4518%205.33868%2015.3514%205.33868%2015.2511V9.81066C5.33868%209.66679%205.31525%209.52626%205.2751%209.39577C5.33533%209.1716%205.50262%208.67306%205.89744%208.24813C7.39974%207.057%208.86858%203.0386%208.93215%202.86461C8.95892%202.79435%208.96561%202.71739%208.95223%202.64044C8.89535%202.2657%208.91542%201.80731%208.99572%201.67013C9.17305%201.67348%209.65152%201.72367%209.93926%202.12183C10.2805%202.5936%2010.2672%203.43676%209.89911%204.55428C9.337%206.25734%209.29016%207.15403%209.73516%207.54885C9.95599%207.74625%2010.2504%207.75629%2010.4646%207.67933C10.6687%207.63249%2010.8627%207.59234%2011.0467%207.56223C11.0601%207.55888%2011.0769%207.55554%2011.0902%207.55219C12.1174%207.32802%2013.9577%207.19084%2014.5967%207.77302C15.1388%208.26821%2014.754%208.924%2014.7105%208.99427C14.5867%209.18163%2014.6235%209.42588%2014.7908%209.57645C14.7941%209.57979%2015.1455%209.91104%2015.1622%2010.356C15.1756%2010.6538%2015.035%2010.9583%2014.7439%2011.2594Z'%20fill='%23858B93'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2361_172518'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='translate(0.290527%200.773438)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",js="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2361_172521)'%3e%3cpath%20d='M0.980564%205.89598C0.652667%206.31422%200.495411%206.76256%200.515487%207.2243C0.535562%207.73287%200.763082%208.13103%200.950451%208.37528C0.732968%208.91731%200.649323%209.77051%201.37538%2010.433C1.90737%2010.9181%202.81076%2011.1356%204.06212%2011.0754C4.94209%2011.0353%205.67818%2010.8713%205.70829%2010.8646H5.71164C5.87893%2010.8345%206.05626%2010.7977%206.23694%2010.7575C6.25033%2010.9717%206.21352%2011.5037%205.81871%2012.7015C5.35028%2014.1268%205.37705%2015.2176%205.9057%2015.947C6.46112%2016.7132%207.34777%2016.7734%207.60875%2016.7734C7.85969%2016.7734%208.09056%2016.6697%208.25451%2016.479C8.6259%2016.0474%208.5824%2015.2511%208.53556%2014.883C8.97722%2013.6986%2010.2152%2010.7943%2011.2625%209.98799C11.2825%209.97461%2011.2993%209.95788%2011.316%209.94115C11.6238%209.6166%2011.8313%209.26528%2011.9718%208.95746C12.1692%209.06453%2012.3934%209.12475%2012.6343%209.12475H14.6753C15.4448%209.12475%2016.0671%208.49907%2016.0671%207.73287V2.29581C16.0671%201.52626%2015.4415%200.903928%2014.6753%200.903928H12.6343C12.3365%200.903928%2012.0588%200.997612%2011.8313%201.15821L11.045%201.06453C10.9245%201.0478%208.78316%200.776784%206.58491%200.820281C6.18675%200.790168%205.81201%200.773438%205.46404%200.773438C4.86513%200.773438%204.34317%200.82028%203.90821%200.913965C2.88437%201.13145%202.18508%201.56641%201.83042%202.20547C1.5594%202.69397%201.5594%203.17913%201.6029%203.48695C0.937067%204.0892%200.819963%204.75504%200.843384%205.22346C0.856767%205.49447%200.916992%205.72534%200.980564%205.89598ZM14.6753%201.80732C14.9463%201.80732%2015.1638%202.02814%2015.1638%202.29581V7.73621C15.1638%208.00723%2014.9429%208.22471%2014.6753%208.22471H12.6343C12.3632%208.22471%2012.1458%208.00389%2012.1458%207.73621V2.29916C12.1458%202.02814%2012.3666%201.81066%2012.6343%201.81066H14.6753V1.80732ZM1.83711%206.28745C1.97764%206.14023%202.0044%205.91606%201.89734%205.74207C1.89734%205.73872%201.76015%205.50451%201.74343%205.18331C1.72%204.745%201.93079%204.35688%202.37245%204.02563C2.52971%203.90518%202.59328%203.69774%202.52636%203.51037C2.52636%203.50702%202.38249%203.06537%202.6167%202.64713C2.84087%202.24562%203.33941%201.95788%204.09558%201.79728C4.70118%201.66679%205.52427%201.64337%206.53473%201.72367C6.54811%201.72367%206.56484%201.72367%206.58157%201.72367C8.73297%201.67683%2010.9078%201.95788%2010.9312%201.96123H10.9346L11.2725%202.00138C11.2524%202.09506%2011.2424%202.19544%2011.2424%202.29581V7.73621C11.2424%207.88009%2011.2658%208.02061%2011.306%208.1511C11.2457%208.37528%2011.0784%208.87381%2010.6836%209.29874C9.18132%2010.4899%207.71248%2014.5083%207.6489%2014.6823C7.62214%2014.7525%207.61545%2014.8295%207.62883%2014.9064C7.68571%2015.2812%207.66563%2015.7396%207.58533%2015.8767C7.408%2015.8734%206.92954%2015.8232%206.64179%2015.425C6.30051%2014.9533%206.3139%2014.1101%206.68194%2012.9926C7.24405%2011.2895%207.29089%2010.3928%206.84589%209.99803C6.62506%209.80062%206.33063%209.79059%206.11649%209.86754C5.91239%209.91438%205.71833%209.95453%205.53431%209.98465C5.52092%209.98799%205.50419%209.99134%205.49081%209.99468C4.46363%2010.2189%202.62339%2010.356%201.98433%209.77386C1.4423%209.27867%201.82707%208.62287%201.87057%208.55261C1.99437%208.36524%201.95756%208.12099%201.79027%207.97043C1.78692%207.96708%201.4356%207.63584%201.41887%207.19084C1.40549%206.89305%201.54602%206.58858%201.83711%206.28745Z'%20fill='%23858B93'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2361_172521'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='matrix(-1%200%200%20-1%2016.2905%2016.7734)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",zs="data:image/svg+xml,%3csvg%20width='16'%20height='17'%20viewBox='0%200%2016%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2361_92626)'%3e%3cpath%20d='M15.3092%2011.4575C15.6371%2011.0393%2015.7944%2010.591%2015.7743%2010.1292C15.7542%209.62065%2015.5267%209.22249%2015.3393%208.97824C15.5568%208.4362%2015.6405%207.58301%2014.9144%206.92052C14.3824%206.43537%2013.479%206.21789%2012.2277%206.27811C11.3477%206.31826%2010.6116%206.48221%2010.5815%206.4889H10.5782C10.4109%206.51902%2010.2335%206.55582%2010.0529%206.59597C10.0395%206.38183%2010.0763%205.84984%2010.4711%204.65201C10.9395%203.22667%2010.9127%202.13591%2010.3841%201.40651C9.82868%200.640304%208.94202%200.580078%208.68104%200.580078C8.4301%200.580078%208.19923%200.6838%208.03529%200.874516C7.66389%201.30613%207.70739%202.10245%207.75423%202.4705C7.31258%203.65494%206.0746%206.55917%205.02734%207.36552C5.00726%207.37891%204.99054%207.39564%204.97381%207.41237C4.66599%207.73692%204.45854%208.08823%204.31801%208.39605C4.12061%208.28899%203.89643%208.22876%203.65553%208.22876H1.61454C0.84499%208.22876%200.222656%208.85444%200.222656%209.62065V15.0577C0.222656%2015.8273%200.848336%2016.4496%201.61454%2016.4496H3.65553C3.95331%2016.4496%204.23102%2016.3559%204.45854%2016.1953L5.24482%2016.289C5.36527%2016.3057%207.50664%2016.5767%209.70488%2016.5332C10.103%2016.5633%2010.4778%2016.5801%2010.8258%2016.5801C11.4247%2016.5801%2011.9466%2016.5332%2012.3816%2016.4396C13.4054%2016.2221%2014.1047%2015.7871%2014.4594%2015.148C14.7304%2014.6595%2014.7304%2014.1744%2014.6869%2013.8666C15.3527%2013.2643%2015.4698%2012.5985%2015.4464%2012.1301C15.433%2011.859%2015.3728%2011.6282%2015.3092%2011.4575ZM1.61454%2015.5462C1.34353%2015.5462%201.12604%2015.3254%201.12604%2015.0577V9.6173C1.12604%209.34628%201.34687%209.1288%201.61454%209.1288H3.65553C3.92655%209.1288%204.14403%209.34963%204.14403%209.6173V15.0544C4.14403%2015.3254%203.9232%2015.5429%203.65553%2015.5429H1.61454V15.5462ZM14.4527%2011.0661C14.3122%2011.2133%2014.2854%2011.4375%2014.3925%2011.6114C14.3925%2011.6148%2014.5296%2011.849%2014.5464%2012.1702C14.5698%2012.6085%2014.359%2012.9966%2013.9173%2013.3279C13.7601%2013.4483%2013.6965%2013.6558%2013.7634%2013.8431C13.7634%2013.8465%2013.9073%2014.2881%2013.6731%2014.7064C13.4489%2015.1079%2012.9504%2015.3956%2012.1942%2015.5562C11.5886%2015.6867%2010.7655%2015.7101%209.75507%2015.6298C9.74169%2015.6298%209.72496%2015.6298%209.70823%2015.6298C7.55683%2015.6767%205.382%2015.3956%205.35858%2015.3923H5.35524L5.0173%2015.3521C5.03738%2015.2585%205.04742%2015.1581%205.04742%2015.0577V9.6173C5.04742%209.47343%205.02399%209.3329%204.98384%209.20241C5.04407%208.97824%205.21136%208.4797%205.60618%208.05477C7.10848%206.86364%208.57732%202.84524%208.64089%202.67125C8.66766%202.60099%208.67435%202.52403%208.66097%202.44708C8.60409%202.07234%208.62416%201.61396%208.70446%201.47677C8.88179%201.48012%209.36026%201.53031%209.648%201.92847C9.98928%202.40024%209.9759%203.2434%209.60785%204.36092C9.04574%206.06398%208.9989%206.96067%209.4439%207.35549C9.66473%207.55289%209.95917%207.56293%2010.1733%207.48597C10.3774%207.43913%2010.5715%207.39898%2010.7555%207.36887C10.7689%207.36552%2010.7856%207.36218%2010.799%207.35883C11.8262%207.13466%2013.6664%206.99748%2014.3055%207.57966C14.8475%208.07485%2014.4627%208.73064%2014.4192%208.80091C14.2954%208.98828%2014.3322%209.23252%2014.4995%209.38309C14.5029%209.38644%2014.8542%209.71768%2014.8709%2010.1627C14.8843%2010.4605%2014.7438%2010.7649%2014.4527%2011.0661Z'%20fill='%231AAF74'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2361_92626'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='translate(0%200.580078)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Vs="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2361_214893)'%3e%3cpath%20d='M0.784519%205.70262C0.456622%206.12086%200.299366%206.5692%200.319442%207.03094C0.339517%207.53951%200.567037%207.93767%200.754406%208.18192C0.536923%208.72395%200.453278%209.57715%201.17933%2010.2396C1.71133%2010.7248%202.61472%2010.9423%203.86607%2010.882C4.74604%2010.8419%205.48213%2010.6779%205.51225%2010.6713H5.51559C5.68289%2010.6411%205.86022%2010.6043%206.0409%2010.5642C6.05428%2010.7783%206.01748%2011.3103%205.62266%2012.5081C5.15424%2013.9335%205.18101%2015.0242%205.70965%2015.7536C6.26507%2016.5199%207.15173%2016.5801%207.41271%2016.5801C7.66365%2016.5801%207.89452%2016.4764%208.05846%2016.2856C8.42986%2015.854%208.38636%2015.0577%208.33952%2014.6897C8.78117%2013.5052%2010.0191%2010.601%2011.0664%209.79463C11.0865%209.78125%2011.1032%209.76452%2011.1199%209.74779C11.4278%209.42324%2011.6352%209.07192%2011.7757%208.7641C11.9731%208.87117%2012.1973%208.9314%2012.4382%208.9314H14.4792C15.2488%208.9314%2015.8711%208.30572%2015.8711%207.53951V2.10245C15.8711%201.3329%2015.2454%200.710568%2014.4792%200.710568H12.4382C12.1404%200.710568%2011.8627%200.804253%2011.6352%200.964854L10.8489%200.87117C10.7285%200.854441%208.58711%200.583425%206.38887%200.626922C5.99071%200.596808%205.61597%200.580078%205.268%200.580078C4.66909%200.580078%204.14713%200.626921%203.71216%200.720606C2.68832%200.938087%201.98904%201.37305%201.63437%202.01212C1.36336%202.50061%201.36336%202.98577%201.40685%203.29359C0.741022%203.89585%200.623918%204.56168%200.647339%205.0301C0.660722%205.30112%200.720947%205.53198%200.784519%205.70262ZM14.4792%201.61396C14.7502%201.61396%2014.9677%201.83478%2014.9677%202.10245V7.54286C14.9677%207.81387%2014.7469%208.03135%2014.4792%208.03135H12.4382C12.1672%208.03135%2011.9497%207.81053%2011.9497%207.54286V2.1058C11.9497%201.83478%2012.1706%201.6173%2012.4382%201.6173H14.4792V1.61396ZM1.64106%206.09409C1.78159%205.94687%201.80836%205.7227%201.70129%205.54871C1.70129%205.54536%201.56411%205.31115%201.54738%204.98995C1.52396%204.55164%201.73475%204.16352%202.1764%203.83227C2.33366%203.71182%202.39723%203.50438%202.33032%203.31701C2.33032%203.31366%202.18644%202.87201%202.42066%202.45377C2.64483%202.05227%203.14336%201.76452%203.89953%201.60392C4.50514%201.47343%205.32822%201.45001%206.33868%201.53031C6.35206%201.53031%206.36879%201.53031%206.38552%201.53031C8.53692%201.48347%2010.7117%201.76452%2010.7352%201.76787H10.7385L11.0764%201.80802C11.0564%201.9017%2011.0463%202.00208%2011.0463%202.10245V7.54286C11.0463%207.68673%2011.0698%207.82726%2011.1099%207.95774C11.0497%208.18192%2010.8824%208.68046%2010.4876%209.10538C8.98527%2010.2965%207.51643%2014.3149%207.45286%2014.4889C7.42609%2014.5592%207.4194%2014.6361%207.43278%2014.7131C7.48966%2015.0878%207.46959%2015.5462%207.38929%2015.6834C7.21196%2015.68%206.73349%2015.6298%206.44575%2015.2317C6.10447%2014.7599%206.11785%2013.9168%206.4859%2012.7992C7.04801%2011.0962%207.09485%2010.1995%206.64985%209.80467C6.42902%209.60726%206.13458%209.59723%205.92045%209.67418C5.71635%209.72102%205.52229%209.76117%205.33826%209.79129C5.32488%209.79463%205.30815%209.79798%205.29477%209.80132C4.26758%2010.0255%202.42735%2010.1627%201.78828%209.5805C1.24625%209.08531%201.63103%208.42951%201.67452%208.35925C1.79832%208.17188%201.76152%207.92763%201.59422%207.77707C1.59088%207.77372%201.23956%207.44248%201.22283%206.99748C1.20945%206.69969%201.34997%206.39522%201.64106%206.09409Z'%20fill='%23F34859'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2361_214893'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='matrix(-1%200%200%20-1%2016.0938%2016.5801)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Ws="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M22%2012.123C22%2017.6459%2017.5228%2022.123%2012%2022.123C6.47715%2022.123%202%2017.6459%202%2012.123C2%206.6002%206.47715%202.12305%2012%202.12305C17.5228%202.12305%2022%206.6002%2022%2012.123ZM16.0303%209.09272C16.3232%209.38561%2016.3232%209.86048%2016.0303%2010.1534L11.0303%2015.1534C10.7374%2015.4463%2010.2626%2015.4463%209.96967%2015.1534L7.96967%2013.1534C7.67678%2012.8605%207.67678%2012.3856%207.96967%2012.0927C8.26256%2011.7998%208.73744%2011.7998%209.03033%2012.0927L10.5%2013.5624L14.9697%209.09272C15.2626%208.79982%2015.7374%208.79982%2016.0303%209.09272Z'%20fill='%231AAF74'/%3e%3c/svg%3e",qs="data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.2904%2014.791C10.6355%2014.791%2010.9154%2014.5112%2010.9154%2014.166V9.16602C10.9154%208.82084%2010.6355%208.54102%2010.2904%208.54102C9.94519%208.54102%209.66537%208.82084%209.66537%209.16602V14.166C9.66537%2014.5112%209.94519%2014.791%2010.2904%2014.791Z'%20fill='%23858B93'/%3e%3cpath%20d='M10.2904%205.83268C10.7506%205.83268%2011.1237%206.20578%2011.1237%206.66602C11.1237%207.12625%2010.7506%207.49935%2010.2904%207.49935C9.83013%207.49935%209.45703%207.12625%209.45703%206.66602C9.45703%206.20578%209.83013%205.83268%2010.2904%205.83268Z'%20fill='%23858B93'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.33203%209.99935C1.33203%205.0518%205.34281%201.04102%2010.2904%201.04102C15.2379%201.04102%2019.2487%205.0518%2019.2487%209.99935C19.2487%2014.9469%2015.2379%2018.9577%2010.2904%2018.9577C5.34281%2018.9577%201.33203%2014.9469%201.33203%209.99935ZM10.2904%202.29102C6.03317%202.29102%202.58203%205.74215%202.58203%209.99935C2.58203%2014.2565%206.03317%2017.7077%2010.2904%2017.7077C14.5476%2017.7077%2017.9987%2014.2565%2017.9987%209.99935C17.9987%205.74215%2014.5476%202.29102%2010.2904%202.29102Z'%20fill='%23858B93'/%3e%3c/svg%3e",Zs="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.291%205.83301C17.291%206.17819%2017.0112%206.45801%2016.666%206.45801L3.33268%206.45801C2.9875%206.45801%202.70768%206.17819%202.70768%205.83301C2.70768%205.48783%202.9875%205.20801%203.33268%205.20801L16.666%205.20801C17.0112%205.20801%2017.291%205.48783%2017.291%205.83301Z'%20fill='%23858B93'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.291%2010C17.291%2010.3452%2017.0112%2010.625%2016.666%2010.625L3.33268%2010.625C2.9875%2010.625%202.70768%2010.3452%202.70768%2010C2.70768%209.65482%202.9875%209.375%203.33268%209.375L16.666%209.375C17.0112%209.375%2017.291%209.65482%2017.291%2010Z'%20fill='%23858B93'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.291%2014.167C17.291%2014.5122%2017.0112%2014.792%2016.666%2014.792L3.33268%2014.792C2.9875%2014.792%202.70768%2014.5122%202.70768%2014.167C2.70768%2013.8218%202.9875%2013.542%203.33268%2013.542L16.666%2013.542C17.0112%2013.542%2017.291%2013.8218%2017.291%2014.167Z'%20fill='%23858B93'/%3e%3c/svg%3e";var Ys=O("<div class=survey-message>"),Xs=O("<div style=margin-bottom:12px;text-align:left><div style=font-weight:500;font-size:14px>"),Qs=O("<div style=font-weight:400;font-size:12px;margin-top:4px>"),Gs=O("<div class=survey-message><div style=text-align:center;padding:24px>Biểu mẫu khảo sát"),Ks=O("<div class=survey-tooltip>"),Js=O("<button tabindex=-1 style=margin-left:8px;margin-top:6px><img alt=tooltip>"),ei=O("<div class=survey-message><div style=flex-direction:column;align-items:flex-start><div style=align-items:center;margin-bottom:8px><span style=font-weight:600;font-size:16px;text-align:left></span></div><div style=font-weight:400;font-size:12px;margin-bottom:16px></div></div><div style=justify-content:flex-end;margin-top:16px>"),ti=O("<div>"),ni=O("<span style=margin-right:4px>-"),si=O("<div class=survey-inputs>"),ii=O("<div style=margin-bottom:12px><div style=font-weight:500;margin-bottom:4px;text-align:left></div><input class=survey-input type=text>"),oi=O("<div class=survey-options>"),ri=O("<button type=button style=justify-content:space-between;align-items:center><span>"),ai=O("<img style=margin-right:10px>"),ci=O("<img style=margin-left:16px>"),li=O("<button class=survey-cancel-button>Hủy"),di=O("<button class=survey-submit-button>Gửi đáp án");const ui=t=>{var Z,K,M,S;const[e,n]=L(null),[s,i]=L(null),[o,r]=L(t.selectedIndexes||[]),[c,a]=L(Array((t.options||[]).length).fill("")),[d,u]=L(t.options||[]),[f,N]=L(!1),V=(M=(K=(Z=t.contents)==null?void 0:Z.find(C=>{var m;return(m=C.metadata)==null?void 0:m.description}))==null?void 0:K.metadata)==null?void 0:M.description,U=(S=t.multiSelect)!=null?S:!1,F=()=>{var C;return(C=t.isInputMode)!=null?C:!1},J=()=>t.type||"choice";let H;const E=(C,m)=>{!t.isEditing&&t.canSubmit===!1||m.button===0&&t.isDragDrop&&(m.preventDefault(),n(C))},b=C=>{if(e()===null||!H)return;const m=H.getBoundingClientRect();if(!(C.clientX>=m.left&&C.clientX<=m.right&&C.clientY>=m.top&&C.clientY<=m.bottom))return;const I=H.querySelectorAll(".survey-option");for(let P=0;P<I.length;P++){const D=I[P].getBoundingClientRect();if(C.clientX>=D.left&&C.clientX<=D.right&&C.clientY>=D.top&&C.clientY<=D.bottom&&P!==e()){i(P);return}}},y=C=>{if(e()===null||!H)return;const m=H.getBoundingClientRect();if(C.clientX>=m.left&&C.clientX<=m.right&&C.clientY>=m.top&&C.clientY<=m.bottom&&s()!==null){const I=[...d()],P=I[e()];I[e()]=I[s()],I[s()]=P,u(I)}n(null),i(null)},q=C=>{!t.isEditing&&t.canSubmit===!1||t.isDragDrop||r(U?m=>m.includes(C)?m.filter(w=>w!==C):[...m,C]:m=>m.includes(C)?[]:[C])},h=(C,m)=>{a(w=>{const I=[...w];return I[C]=m,I})},z=()=>{if(t.onSubmit){const C=t.msgId||"";if(F()){const m=c().filter(w=>w.trim()!=="");t.onSubmit(m,"input",C)}else if(t.isDragDrop)t.onSubmit(d(),"ordered",C);else if(U){const m=d().filter((w,I)=>o().includes(I));t.onSubmit(m,"selected",C)}else{const m=d()[o()[0]];t.onSubmit([m],"selected",C)}}};return Rt(()=>(document.addEventListener("mousemove",b),document.addEventListener("mouseup",y),()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",y)})),nt(()=>{u(t.options||[])}),nt(fs(()=>t.isEditing,C=>{C&&(r(t.selectedIndexes||[]),a(Array((t.options||[]).length).fill("").map((m,w)=>{var I;return t.fields&&((I=t.fields[w])==null?void 0:I.value)!==void 0?t.fields[w].value:""})),u(t.options||[]))})),J()==="normal"?(()=>{var C=Ys();return k(C,ae(ut,{get each(){return t.contents||[]},children:m=>(()=>{var w=Xs(),I=w.firstChild;return l(I,"color","#1A1D1F"),k(I,()=>m.content),k(w,(()=>{var P=te(()=>{var _;return!!((_=m.metadata)!=null&&_.description)});return()=>P()&&(()=>{var _=Qs();return l(_,"color","#858B93"),k(_,()=>m.metadata.description),_})()})(),null),w})()})),C})():J()==="form"?(()=>{var C=Gs(),m=C.firstChild;return l(m,"color","#858B93"),C})():(()=>{var C=ei(),m=C.firstChild,w=m.firstChild,I=w.firstChild,P=w.nextSibling,_=m.nextSibling;return l(m,"display","flex"),l(w,"display","flex"),l(I,"color","#1A1D1F"),k(I,(()=>{var D=te(()=>!!F());return()=>D()?"Nhập đáp án":t.question||"Chọn đáp án"})()),k(w,ae(Qe,{when:V,get children(){var D=Js(),Q=D.firstChild;return D.addEventListener("mouseleave",()=>N(!1)),D.addEventListener("mouseenter",()=>N(!0)),l(D,"background","none"),l(D,"border","none"),l(D,"cursor","pointer"),l(D,"position","relative"),ce(Q,"src",qs),l(Q,"width","20px"),l(Q,"height","20px"),k(D,ae(Qe,{get when(){return f()},get children(){var me=Ks();return k(me,ae(ut,{get each(){return(V||"Bạn có thể kéo thả để sắp xếp thứ tự đáp án ưu tiên A, B, C, D").split(/-\s*/).filter(ve=>ve.trim()!=="")},children:(ve,ue)=>(()=>{var re=ti();return k(re,(()=>{var ne=te(()=>ue()>0);return()=>ne()&&ni()})(),null),k(re,()=>ve.trim(),null),re})()})),me}}),null),D}}),null),l(P,"color","#858B93"),k(P,(()=>{var D=te(()=>!!F());return()=>D()?"Vui lòng nhập đầy đủ thông tin vào các trường bên dưới.":t.isDragDrop?"Bạn có thể kéo thả để sắp xếp thứ tự đáp án ưu tiên A, B, C, D":U?"Bạn có thể chọn nhiều đáp án hoặc nhập trực tiếp A, B, C, D theo thứ tự đáp án":"Bạn có thể chọn 1 đáp án hoặc nhập trực tiếp A, B, C, D"})()),k(C,(()=>{var D=te(()=>!!F());return()=>D()?(()=>{var Q=si();return k(Q,ae(ut,{get each(){return d()},children:(me,ve)=>(()=>{var ue=ii(),re=ue.firstChild,ne=re.nextSibling;return l(re,"color","#1A1D1F"),k(re,me),ne.$$input=T=>h(ve(),T.currentTarget.value),l(ne,"color","#1A1D1F"),fe(T=>{var G=t.placeholders?t.placeholders[ve()]:me,Ae=!t.isEditing&&t.canSubmit===!1;return G!==T.e&&ce(ne,"placeholder",T.e=G),Ae!==T.t&&(ne.disabled=T.t=Ae),T},{e:void 0,t:void 0}),fe(()=>ne.value=c()[ve()]),ue})()})),Q})():(()=>{var Q=oi(),me=H;return typeof me=="function"?Yt(me,Q):H=Q,k(Q,ae(ut,{get each(){return d()},children:(ve,ue)=>(()=>{var re=ri(),ne=re.firstChild;return re.$$click=()=>q(ue()),re.$$mousedown=T=>E(ue(),T),k(re,(()=>{var T=te(()=>!!t.isDragDrop);return()=>T()&&(()=>{var G=ai();return ce(G,"src",Zs),l(G,"width","20px"),l(G,"height","20px"),G})()})(),ne),l(ne,"color","#1A1D1F"),k(ne,ve),k(re,(()=>{var T=te(()=>!!(!t.isDragDrop&&o().includes(ue())));return()=>T()&&(()=>{var G=ci();return ce(G,"src",Ws),l(G,"width","20px"),l(G,"height","20px"),G})()})(),null),fe(T=>{var G=`survey-option${U?" multi-selected":""} ${e()===ue()?"dragging":""} ${s()===ue()?"hovered":""} ${!t.isDragDrop&&o().includes(ue())?"selected":""}`,Ae=j({display:"flex",width:U?"100%":"auto"},t.isDragDrop?{}:{cursor:"pointer"});return G!==T.e&&it(re,T.e=G),T.t=pn(re,Ae,T.t),T},{e:void 0,t:void 0}),re})()})),Q})()})(),_),l(_,"display","flex"),k(_,(()=>{var D=te(()=>!!t.isEditing);return()=>D()&&(()=>{var Q=li();return Zt(Q,"click",t.onCancelEdit),Q})()})(),null),k(_,(()=>{var D=te(()=>!!(t.canSubmit||t.isEditing));return()=>D()&&(()=>{var Q=di();return Q.$$click=z,Q})()})(),null),C})()};yt(["input","mousedown","click"]);var hi=O("<div style=text-align:center;font-weight:600;user-select:none;white-space:pre-line>Hôm nay thị trường khiến bạn <br>quan tâm điều gì?"),fi=O("<div class=chat-messages-container style=scroll-behavior:auto>"),gi=O("<div style=margin-bottom:8px>"),pi=O("<div class=message-popup><button class=message-popup-button><img></button><button class=message-popup-button><img>"),Ci=O('<div style=border-radius:24px;font-weight:500;font-size:16px;max-width:70%;word-break:break-word;white-space:pre-line;text-align:left;cursor:pointer><form style=flex-direction:column;align-items:flex-end><textarea class=chat-message-edit-textarea placeholder="Nhập vào tin nhắn..."rows=3 autofocus></textarea><div style=margin-top:8px><button class=message-cancel-button type=button>Hủy</button><button class=message-edit-button type=submit>Lưu'),mi=O("<div style=border-radius:24px;font-weight:500;font-size:16px;max-width:70%;word-break:break-word;white-space:pre-line;text-align:left;cursor:pointer>"),vi=O("<div style=font-size:12px;margin-top:12px;user-select:none;font-weight:400>"),wi=O('<div class="chat-message bot"style=margin-left:24px><div>'),yi=O("<div style=flex-direction:column;align-items:flex-start;margin-bottom:8px><div><div style=border-radius:24px;font-weight:500;font-size:16px;max-width:70%;word-break:break-word;white-space:pre-line;text-align:left>"),bi=O("<div style=margin-left:16px><button class=feedback-button><img></button><button class=feedback-button><img>");function _i(t){let e;const[n,s]=L(null),[i,o]=L({}),[r,c]=L(null),[a,d]=L(null),[u,f]=L(null),[N,V]=L(null),[U,F]=L("");function J(y){var z,Z;const q=t.messages[t.messages.length-1];return!((q.type==="survey"||q.type==="choice"||q.type==="form")&&!((Z=(z=t.submittedMessages)==null?void 0:z.has(q.id))!=null&&Z)&&q.id!==y)}const H=y=>{r()&&(clearTimeout(r()),c(null)),s(Number(y))},E=()=>{c(setTimeout(()=>s(null),300))},b=()=>{var y;return t.isFullScreen?t.messages.length>0?"100px":`${((y=t.inputHeight)!=null?y:0)+24}px`:(t.isMobile,t.messages.length>0?"10px":"0px")};return nt(()=>{if(!e)return;const y=()=>{a()&&clearTimeout(a()),d(setTimeout(()=>{var q;e.scrollTop===0&&((q=t.onLoadMoreMessages)==null||q.call(t)),d(null)},0))};e.addEventListener("scroll",y),un(()=>{e.removeEventListener("scroll",y),a()&&clearTimeout(a())})}),(()=>{var y=fi(),q=e;return typeof q=="function"?Yt(q,y):e=y,k(y,ae(Qe,{get when(){return te(()=>t.messages.length===0)()&&!t.isFullScreen},get children(){var h=hi();return l(h,"color","#1A1D1F"),fe(z=>l(h,"font-size",t.isMobile?"20px":"24px")),h}}),null),k(y,ae(ut,{get each(){return t.messages},children:(h,z)=>{const Z=z()===t.messages.length-1;return h.type==="normal"&&Array.isArray(h.contents)?ae(ut,{get each(){return h.contents},children:K=>(()=>{var M=gi();return M.addEventListener("mouseleave",()=>h.sender==="user"&&V(null)),M.addEventListener("mouseenter",()=>h.sender==="user"&&V(h.id)),M.$$click=()=>f(u()===h.id?null:h.id),l(M,"display","flex"),l(M,"position","relative"),k(M,(()=>{var S=te(()=>h.sender==="user"&&N()===h.id);return()=>S()&&(()=>{var C=pi(),m=C.firstChild,w=m.firstChild,I=m.nextSibling,P=I.firstChild;return m.addEventListener("mouseleave",_=>_.currentTarget.style.background="none"),m.addEventListener("mouseenter",_=>_.currentTarget.style.background="#f0f0f0"),m.$$click=_=>{var me,ve,ue,re;_.stopPropagation();const D=z(),Q=t.messages[D-1];if(!J(h.id)){alert("Hoàn thành câu hỏi theo mẫu trước khi chỉnh sửa");return}h.type==="normal"&&(Q&&Q.sender==="bot"&&Q.type==="normal"?(F(""),(me=t.setEditingMsgIdUser)==null||me.call(t,h.id),(ve=t.setEditingMsgIdBot)==null||ve.call(t,null)):Q&&Q.sender==="bot"&&(Q.type==="survey"||Q.type==="choice"||Q.type==="form")&&((ue=t.setEditingMsgIdBot)==null||ue.call(t,Q.id),(re=t.setEditingMsgIdUser)==null||re.call(t,h.id),F("")))},ce(w,"src",Hn),l(w,"width","16px"),l(w,"height","16px"),I.addEventListener("mouseleave",_=>_.currentTarget.style.background="none"),I.addEventListener("mouseenter",_=>_.currentTarget.style.background="#f0f0f0"),I.$$click=_=>{_.stopPropagation(),console.log("Delete message:",h.id)},ce(P,"src",Ln),l(P,"width","16px"),l(P,"height","16px"),C})()})(),null),k(M,(()=>{var S=te(()=>h.sender==="user"&&h.type==="normal"&&t.editingMsgIdUser===h.id&&!t.editingMsgIdBot);return()=>S()?(()=>{var C=Ci(),m=C.firstChild,w=m.firstChild,I=w.nextSibling,P=I.firstChild;return l(C,"background","#1AAF741A"),l(C,"color","#000"),l(C,"padding","10px 16px"),m.addEventListener("submit",_=>{var D,Q;_.preventDefault(),U().trim()&&((D=t.onUpdateSurvey)==null||D.call(t,[U()],"input",h.id),(Q=t.setEditingMsgIdUser)==null||Q.call(t,null))}),l(m,"width","100%"),l(m,"display","flex"),w.$$input=_=>F(_.currentTarget.value),l(I,"display","flex"),l(I,"gap","4px"),P.$$click=()=>{var _;return(_=t.setEditingMsgIdUser)==null?void 0:_.call(t,null)},fe(()=>w.value=U()),C})():(()=>{var C=mi();return l(C,"color","#000"),l(C,"padding","10px 16px"),k(C,()=>K.content,null),k(C,(()=>{var m=te(()=>!!(h.sender==="user"&&h.sentAt&&u()===h.id));return()=>m()&&(()=>{var w=vi();return l(w,"color","#858B93"),k(w,()=>new Date(h.sentAt).toLocaleString("vi-VN",{hour:"2-digit",minute:"2-digit"})),w})()})(),null),fe(m=>l(C,"background",h.sender==="user"?"#1AAF741A":"#fff")),C})()})(),null),fe(S=>{var C=`chat-message ${h.sender}`,m=h.id,w=h.sender==="bot"?"24px":"0px",I=h.sender==="user"?"24px":"0px",P=h.sender==="user"?"flex-end":"flex-start";return C!==S.e&&it(M,S.e=C),m!==S.t&&ce(M,"data-message-id",S.t=m),w!==S.a&&l(M,"margin-left",S.a=w),I!==S.o&&l(M,"margin-right",S.o=I),P!==S.i&&l(M,"justify-content",S.i=P),S},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),M})()}):h.type==="survey"||h.type==="choice"||h.type==="form"?(()=>{var K=wi(),M=K.firstChild;return k(M,ae(ui,{get msgId(){return h.id},get question(){return h.question},get options(){return h.options},get selectedIndexes(){return h.selectedIndexes},get fields(){return h.fields},get contents(){return h.contents},get multiSelect(){var S;return te(()=>h.multiSelect!==void 0)()?h.multiSelect:(S=t.surveyOptions)==null?void 0:S.multiSelect},get isInputMode(){var S;return te(()=>h.isInputMode!==void 0)()?h.isInputMode:(S=t.surveyOptions)==null?void 0:S.isInputMode},get isFormType(){return h.isFormType},get isNormalType(){return h.isNormalType},get isDragDrop(){return h.isDragDrop},get isEditing(){return t.editingMsgIdBot===h.id},onCancelEdit:()=>{var S,C;(S=t.setEditingMsgIdBot)==null||S.call(t,null),(C=t.setEditingMsgIdUser)==null||C.call(t,null)},onSubmit:(S,C,m)=>{var w,I,P,_;t.editingMsgIdUser?((w=t.onUpdateSurvey)==null||w.call(t,S,C,t.editingMsgIdUser),(I=t.setEditingMsgIdBot)==null||I.call(t,null),(P=t.setEditingMsgIdUser)==null||P.call(t,null)):(_=t.onSubmit)==null||_.call(t,S,C,m)},get canSubmit(){var S;return Z&&(!((S=t.submittedMessages)!=null&&S.has(h.id))||t.editingMsgIdBot===h.id)},get placeholders(){return h.placeholders}})),fe(()=>ce(K,"data-message-id",h.id)),K})():(()=>{var K=yi(),M=K.firstChild,S=M.firstChild;return l(K,"display","flex"),M.addEventListener("mouseleave",()=>E()),M.addEventListener("mouseenter",()=>h.sender==="bot"&&H(h.id)),l(M,"position","relative"),l(M,"width","100%"),l(S,"color","#000"),l(S,"padding","10px 16px"),k(S,()=>h.text),k(K,(()=>{var C=te(()=>h.sender==="bot");return()=>C()&&(()=>{var m=bi(),w=m.firstChild,I=w.firstChild,P=w.nextSibling,_=P.firstChild;return m.addEventListener("mouseleave",()=>E()),m.addEventListener("mouseenter",()=>H(h.id)),l(m,"display","flex"),l(m,"gap","8px"),l(m,"height","16px"),l(m,"transition","opacity 0.2s"),w.$$click=()=>o(D=>oe(j({},D),{[h.id]:"like"})),P.$$click=()=>o(D=>oe(j({},D),{[h.id]:"dislike"})),fe(D=>{var Q=n()===Number(h.id)?1:0,me=n()===Number(h.id)?"visible":"hidden",ve=n()===Number(h.id)?"auto":"none",ue=i()[Number(h.id)]==="like"?zs:Us,re=i()[Number(h.id)]==="dislike"?Vs:js;return Q!==D.e&&l(m,"opacity",D.e=Q),me!==D.t&&l(m,"visibility",D.t=me),ve!==D.a&&l(m,"pointer-events",D.a=ve),ue!==D.o&&ce(I,"src",D.o=ue),re!==D.i&&ce(_,"src",D.i=re),D},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),m})()})(),null),fe(C=>{var m=h.id,w=`chat-message ${h.sender}`,I=h.id,P=h.sender==="user"?"#1AAF741A":"#fff";return m!==C.e&&ce(K,"data-message-id",C.e=m),w!==C.t&&it(M,C.t=w),I!==C.a&&ce(M,"data-message-id",C.a=I),P!==C.o&&l(S,"background",C.o=P),C},{e:void 0,t:void 0,a:void 0,o:void 0}),K})()}}),null),fe(h=>{var z=t.messages.length===0?"center":"flex-start",Z=b(),K=t.isLoadingMessages?"hidden":"visible";return z!==h.e&&l(y,"justify-content",h.e=z),Z!==h.t&&l(y,"padding-bottom",h.t=Z),K!==h.a&&l(y,"visibility",h.a=K),h},{e:void 0,t:void 0,a:void 0}),y})()}yt(["click","input"]);var Si=O('<div class=chat-input-container><div style=min-width:0><img><textarea placeholder="Hỏi bất kỳ điều gì..."class=chat-input-field rows=1 style=padding-left:56px></textarea><div><img style=margin-top:4px><img>');function On(t){let e;const[s,i]=L(!1);function o(){var u,f;if(!e)return;if(e.style.height="auto",!t.input.trim()){e.style.height="48px",e.style.overflowY="hidden",i(!1),(u=t.onHeightChange)==null||u.call(t,48);return}const a=e.scrollHeight,d=Math.min(a,120);e.style.height=d+"px",e.style.overflowY=a>120?"auto":"hidden",i(a>120),(f=t.onHeightChange)==null||f.call(t,d)}nt(()=>{e&&o()});const r=a=>{t.setInput(a.currentTarget.value),o()},c=a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),t.sendMessage(),setTimeout(()=>{e&&o()},0))};return(()=>{var a=Si(),d=a.firstChild,u=d.firstChild,f=u.nextSibling,N=f.nextSibling,V=N.firstChild,U=V.nextSibling;return l(d,"position","relative"),l(d,"flex","1"),ce(u,"src",$s),l(u,"position","absolute"),l(u,"left","18px"),l(u,"top","50%"),l(u,"transform","translateY(-60%)"),l(u,"width","20px"),l(u,"height","20px"),l(u,"cursor","pointer"),f.addEventListener("keypress",c),f.$$input=r,Yt(F=>e=F,f),l(f,"color","#1A1D1F"),l(f,"resize","none"),l(f,"width","100%"),l(f,"max-height","120px"),l(f,"overflow","hidden"),l(N,"position","absolute"),l(N,"right","16px"),l(N,"top","50%"),l(N,"transform","translateY(-55%)"),l(N,"display","flex"),l(N,"gap","12px"),Zt(V,"click",t.sendMessage),ce(V,"src",Fs),l(V,"width","24px"),l(V,"height","24px"),l(V,"cursor","pointer"),Zt(U,"click",t.sendMessage),l(U,"width","32px"),l(U,"height","32px"),l(U,"cursor","pointer"),fe(F=>{var J=!!s(),H=t.disabled,E=t.input.trim()?Ns:Rs;return J!==F.e&&a.classList.toggle("is-maxed",F.e=J),H!==F.t&&(f.disabled=F.t=H),E!==F.a&&ce(U,"src",F.a=E),F},{e:void 0,t:void 0,a:void 0}),fe(()=>f.value=t.input),a})()}yt(["input","click"]);var Ai=O("<div class=sidebar-conversation-list style=overflow-y:auto>"),xi=O('<div><div class=sidebar-header><img style=margin-right:4px><span style=user-select:none>Ez</span><span style=margin-left:4px;user-select:none>Advise</span></div><div class=sidebar-section tabindex=0><img class=sidebar-section-icon><span class=sidebar-section-title>Chân dung nhà đầu tư</span></div><div class="sidebar-section sidebar-section--no-padding"tabindex=0><img class=sidebar-section-icon><span class=sidebar-section-title>Định hướng đầu tư</span></div><div class=sidebar-conversation-row><span style=font-weight:400;font-size:14px;user-select:none>Hội thoại</span><div class=sidebar-conversation-action tabindex=0><span style=font-weight:400;font-size:14px;user-select:none>Hội thoại mới</span><img style=margin-left:8px></div></div><div class=sidebar-search-box><img style=margin-right:8px><input type=text placeholder="Tìm kiếm hội thoại"></div><div></div><div style=margin-top:15px>'),Ii=O("<div>"),ki=O("<img style=margin-right:16px>"),Mi=O("<div class=sidebar-header-actions><button><img></button><button><img>"),Ei=O('<div class=sidebar-no-results style=text-align:center><img src=data:image/webp;base64,... alt="no results"><div style=font-size:14px;margin-top:8px>Không tìm thấy cuộc hội thoại nào!'),Ti=O("<div class=sidebar-menu-row>"),$i=O("<input class=sider-bar-input autofocus>"),Ri=O("<span style=font-weight:500;font-size:15px;user-select:none>"),Pi=O("<img class=sidebar-menu-dot style=margin-left:8px>"),Di=O("<div class=sidebar-popover><div class=sidebar-popover-item><img>Đổi tên</div><div class=sidebar-popover-item><img>Xóa");function Fn(t){const[e]=L(!1),[n,s]=L(null),[i,o]=L([]),[r,c]=L(""),[a,d]=L(null),[u,f]=L("");let N,V={};function U(b){return b.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/đ/g,"d").replace(/Đ/g,"d")}function F(){d(null),t.onClose()}function J(){return v(this,null,function*(){if(t.remoteRepo)try{const b=yield t.remoteRepo.listConversationAsync(10);o(b||[])}catch(b){console.error("Sidebar listConversationAsync error:",b)}})}Rt(J),t.onReloadConversations&&t.onReloadConversations(J);const H=st(()=>{const b=U(r());return b?i().filter(y=>U(y.name||"").includes(b)):i()}),E=()=>t.isMobile?"calc(90vh - 320px)":t.fullScreen?"calc(90vh - 330px)":"calc(400px - 220px)";return Rt(()=>{const b=y=>{var q;e(),n()&&V[n()]&&!((q=V[n()])!=null&&q.contains(y.target))&&s(null)};document.addEventListener("mousedown",b),un(()=>{document.removeEventListener("mousedown",b)})}),Rt(()=>v(null,null,function*(){if(t.remoteRepo)try{const b=yield t.remoteRepo.listConversationAsync(10);o(b||[])}catch(b){console.error("Sidebar listConversationAsync error:",b)}})),[te(()=>te(()=>!t.fullScreen)()&&(()=>{var b=Ii();return b.$$click=F,fe(()=>it(b,`sidebar-overlay${t.open?" sidebar-overlay--open":""}`)),b})()),(()=>{var b=xi(),y=b.firstChild,q=y.firstChild,h=q.nextSibling,z=h.nextSibling,Z=y.nextSibling,K=Z.firstChild,M=K.nextSibling,S=Z.nextSibling,C=S.firstChild,m=C.nextSibling,w=S.nextSibling,I=w.firstChild,P=I.nextSibling,_=P.firstChild,D=_.nextSibling,Q=w.nextSibling,me=Q.firstChild,ve=me.nextSibling,ue=Q.nextSibling,re=ue.nextSibling;return k(y,(()=>{var ne=te(()=>!t.fullScreen);return()=>ne()&&(()=>{var T=ki();return T.$$click=F,ce(T,"src",Ps),l(T,"width","28px"),l(T,"height","28px"),l(T,"cursor","pointer"),T})()})(),q),ce(q,"src",mn),l(q,"width","32px"),l(q,"height","32px"),l(h,"color","#1A1D1F"),l(z,"color","#1AAF74"),k(y,(()=>{var ne=te(()=>!!t.fullScreen);return()=>ne()&&(()=>{var T=Mi(),G=T.firstChild,Ae=G.firstChild,se=G.nextSibling,we=se.firstChild;return G.$$click=()=>{var Ve;(Ve=t.onShrink)==null||Ve.call(t)},l(G,"background","none"),l(G,"border","none"),l(G,"cursor","pointer"),l(G,"padding","0"),ce(Ae,"src",Ts),l(Ae,"width","20px"),l(Ae,"height","20px"),se.$$click=F,l(se,"background","none"),l(se,"border","none"),l(se,"cursor","pointer"),l(se,"padding","0"),ce(we,"src",Bn),l(we,"width","20px"),l(we,"height","20px"),T})()})(),null),ce(K,"src",Ds),l(M,"color","#1A1D1F"),ce(C,"src",Bs),l(m,"color","#1A1D1F"),l(I,"color","#858B93"),P.$$click=()=>{t.onNewConversation&&t.onNewConversation(),t.fullScreen||F()},l(_,"color","#858B93"),ce(D,"src",Hs),l(D,"width","20px"),l(D,"height","20px"),ce(me,"src",Ls),l(me,"width","18px"),l(me,"height","18px"),l(me,"opacity","0.7"),ve.addEventListener("change",ne=>c(ne.currentTarget.value)),ve.$$input=ne=>c(ne.currentTarget.value),l(ve,"color","#1A1D1F"),k(re,ae(Qe,{get when(){return H().length>0},get fallback(){return te(()=>i().length>0)()?(()=>{var ne=Ei(),T=ne.firstChild,G=T.nextSibling;return l(ne,"padding","32px 0"),l(T,"width","80px"),l(T,"height","80px"),l(T,"margin","0 auto 12px"),l(G,"color","#888"),ne})():null},get children(){var ne=Ai();return k(ne,ae(ut,{get each(){return H()},children:T=>(()=>{var G=Ti();return G.$$click=()=>{var Ae;(Ae=t.onLoadMessages)==null||Ae.call(t,T.id,T.name),t.fullScreen||F()},l(G,"cursor","pointer"),l(G,"position","relative"),k(G,(()=>{var Ae=te(()=>a()===T.id);return()=>Ae()?(()=>{var se=$i();return se.$$click=we=>we.stopPropagation(),se.addEventListener("blur",()=>{d(null)}),se.$$keydown=we=>v(null,null,function*(){var Ve;if(we.key==="Enter"){if(!u().trim()){console.log("Tên không được để trống");return}try{yield(Ve=t.remoteRepo)==null?void 0:Ve.updateConversationNameAsync(T.id,u().trim()),d(null),J()}catch(Ke){console.log("Error while rename: ",Ke)}}we.key==="Escape"&&d(null)}),se.$$input=we=>f(we.currentTarget.value),l(se,"color","#1A1D1F"),fe(()=>se.value=u()),se})():[(()=>{var se=Ri();return l(se,"color","#1A1D1F"),k(se,()=>T.name),se})(),(()=>{var se=Pi();return se.$$mousedown=we=>we.stopPropagation(),se.$$click=we=>{we.stopPropagation(),s(n()===T.id?null:T.id)},ce(se,"src",Os),l(se,"width","24px"),l(se,"height","24px"),se})(),te(()=>te(()=>n()===T.id)()&&(()=>{var se=Di(),we=se.firstChild,Ve=we.firstChild,Ke=we.nextSibling,ct=Ke.firstChild;return Yt(g=>V[T.id]=g,se),we.$$click=g=>{g.stopPropagation(),s(null),d(T.id),f(T.name)},ce(Ve,"src",Hn),l(Ve,"width","18px"),l(Ve,"height","18px"),l(Ve,"color","#1A1D1F"),Ke.$$click=g=>{var x;g.stopPropagation(),s(null),(x=t.onDeleteConversation)==null||x.call(t,T)},ce(ct,"src",Ln),l(ct,"width","18px"),l(ct,"height","18px"),l(ct,"color","#1A1D1F"),se})())]})()),G})()})),fe(T=>{var G=E(),Ae=E();return G!==T.e&&l(ne,"min-height",T.e=G),Ae!==T.t&&l(ne,"max-height",T.t=Ae),T},{e:void 0,t:void 0}),ne}})),fe(ne=>{var T=`sidebar${t.open?" sidebar--open":""}${t.fullScreen?" sidebar--fullscreen":""}${t.isMobile?" sidebar--mobile":""}`,G=t.isMobile?{width:"280px",height:"100%"}:{};return T!==ne.e&&it(b,ne.e=T),ne.t=pn(b,G,ne.t),ne},{e:void 0,t:void 0}),fe(()=>ve.value=r()),b})()]}yt(["click","input","keydown","mousedown"]);var Bi=O("<button class=chat-action-btn>");function Qt(t){return(()=>{var e=Bi();return Zt(e,"click",t.onClick),k(e,()=>t.text),e})()}yt(["click"]);var Hi=O("<div class=header-steps-container>"),Li=O("<div class=header-steps><div class=header-steps-title>"),Oi=O(`<div class=header-step-wrapper style=position:relative;display:flex><div><div><svg viewBox="0 0 28 6"width=28 height=6><path d="M0 3 Q 7 0 14 3 Q 21 6 28 3 V6 H0 Z"fill=#1AAF74><animate attributeName=d values="\r
|
|
2
|
+
(function(Te,xe){typeof exports=="object"&&typeof module!="undefined"?xe(exports):typeof define=="function"&&define.amd?define(["exports"],xe):(Te=typeof globalThis!="undefined"?globalThis:Te||self,xe(Te.EzChat={}))})(this,(function(Te){"use strict";var t2=Object.defineProperty,n2=Object.defineProperties;var s2=Object.getOwnPropertyDescriptors;var ds=Object.getOwnPropertySymbols;var i2=Object.prototype.hasOwnProperty,o2=Object.prototype.propertyIsEnumerable;var In=(Te,xe,Pe)=>xe in Te?t2(Te,xe,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):Te[xe]=Pe,z=(Te,xe)=>{for(var Pe in xe||(xe={}))i2.call(xe,Pe)&&In(Te,Pe,xe[Pe]);if(ds)for(var Pe of ds(xe))o2.call(xe,Pe)&&In(Te,Pe,xe[Pe]);return Te},ie=(Te,xe)=>n2(Te,s2(xe));var Ce=(Te,xe,Pe)=>In(Te,typeof xe!="symbol"?xe+"":xe,Pe);var v=(Te,xe,Pe)=>new Promise((et,Ct)=>{var mt=Ye=>{try{Ze(Pe.next(Ye))}catch(vt){Ct(vt)}},jt=Ye=>{try{Ze(Pe.throw(Ye))}catch(vt){Ct(vt)}},Ze=Ye=>Ye.done?et(Ye.value):Promise.resolve(Ye.value).then(mt,jt);Ze((Pe=Pe.apply(Te,xe)).next())});const Pe=(t,e)=>t===e,et=Symbol("solid-proxy"),Ct=Symbol("solid-track"),mt={equals:Pe};let jt=En;const Ze=1,Ye=2,vt={owned:null,cleanups:null,context:null,owner:null};var _e=null;let dn=null,us=null,Me=null,Le=null,tt=null,zt=0;function Vt(t,e){const n=Me,s=_e,i=t.length===0,o=e===void 0?s:e,r=i?vt:{owned:null,cleanups:null,context:o?o.context:null,owner:o},c=i?t:()=>t(()=>Je(()=>Dt(r)));_e=r,Me=null;try{return wt(c,!0)}finally{Me=n,_e=s}}function L(t,e){e=e?Object.assign({},mt,e):mt;const n={value:t,observers:null,observerSlots:null,comparator:e.equals||void 0},s=i=>(typeof i=="function"&&(i=i(n.value)),Mn(n,i));return[kn.bind(n),s]}function fe(t,e,n){const s=fn(t,e,!1,Ze);Pt(s)}function nt(t,e,n){jt=ws;const s=fn(t,e,!1,Ze);s.user=!0,tt?tt.push(s):Pt(s)}function st(t,e,n){n=n?Object.assign({},mt,n):mt;const s=fn(t,e,!0,0);return s.observers=null,s.observerSlots=null,s.comparator=n.equals||void 0,Pt(s),kn.bind(s)}function hs(t){return wt(t,!1)}function Je(t){if(Me===null)return t();const e=Me;Me=null;try{return t()}finally{Me=e}}function fs(t,e,n){const s=Array.isArray(t);let i;return o=>{let r;if(s){r=Array(t.length);for(let a=0;a<t.length;a++)r[a]=t[a]()}else r=t();const c=Je(()=>e(r,i,o));return i=r,c}}function $t(t){nt(()=>Je(t))}function un(t){return _e===null||(_e.cleanups===null?_e.cleanups=[t]:_e.cleanups.push(t)),t}function hn(){return Me}function gs(t,e){const n=Symbol("context");return{id:n,Provider:bs(n),defaultValue:t}}function ps(t){let e;return _e&&_e.context&&(e=_e.context[t.id])!==void 0?e:t.defaultValue}function Cs(t){const e=st(t),n=st(()=>gn(e()));return n.toArray=()=>{const s=n();return Array.isArray(s)?s:s!=null?[s]:[]},n}function kn(){if(this.sources&&this.state)if(this.state===Ze)Pt(this);else{const t=Le;Le=null,wt(()=>qt(this),!1),Le=t}if(Me){const t=this.observers?this.observers.length:0;Me.sources?(Me.sources.push(this),Me.sourceSlots.push(t)):(Me.sources=[this],Me.sourceSlots=[t]),this.observers?(this.observers.push(Me),this.observerSlots.push(Me.sources.length-1)):(this.observers=[Me],this.observerSlots=[Me.sources.length-1])}return this.value}function Mn(t,e,n){let s=t.value;return(!t.comparator||!t.comparator(s,e))&&(t.value=e,t.observers&&t.observers.length&&wt(()=>{for(let i=0;i<t.observers.length;i+=1){const o=t.observers[i],r=dn&&dn.running;r&&dn.disposed.has(o),(r?!o.tState:!o.state)&&(o.pure?Le.push(o):tt.push(o),o.observers&&Tn(o)),r||(o.state=Ze)}if(Le.length>1e6)throw Le=[],new Error},!1)),e}function Pt(t){if(!t.fn)return;Dt(t);const e=zt;ms(t,t.value,e)}function ms(t,e,n){let s;const i=_e,o=Me;Me=_e=t;try{s=t.fn(e)}catch(r){return t.pure&&(t.state=Ze,t.owned&&t.owned.forEach(Dt),t.owned=null),t.updatedAt=n+1,Rn(r)}finally{Me=o,_e=i}(!t.updatedAt||t.updatedAt<=n)&&(t.updatedAt!=null&&"observers"in t?Mn(t,s):t.value=s,t.updatedAt=n)}function fn(t,e,n,s=Ze,i){const o={fn:t,state:s,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:_e,context:_e?_e.context:null,pure:n};return _e===null||_e!==vt&&(_e.owned?_e.owned.push(o):_e.owned=[o]),o}function Wt(t){if(t.state===0)return;if(t.state===Ye)return qt(t);if(t.suspense&&Je(t.suspense.inFallback))return t.suspense.effects.push(t);const e=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt<zt);)t.state&&e.push(t);for(let n=e.length-1;n>=0;n--)if(t=e[n],t.state===Ze)Pt(t);else if(t.state===Ye){const s=Le;Le=null,wt(()=>qt(t,e[0]),!1),Le=s}}function wt(t,e){if(Le)return t();let n=!1;e||(Le=[]),tt?n=!0:tt=[],zt++;try{const s=t();return vs(n),s}catch(s){n||(tt=null),Le=null,Rn(s)}}function vs(t){if(Le&&(En(Le),Le=null),t)return;const e=tt;tt=null,e.length&&wt(()=>jt(e),!1)}function En(t){for(let e=0;e<t.length;e++)Wt(t[e])}function ws(t){let e,n=0;for(e=0;e<t.length;e++){const s=t[e];s.user?t[n++]=s:Wt(s)}for(e=0;e<n;e++)Wt(t[e])}function qt(t,e){t.state=0;for(let n=0;n<t.sources.length;n+=1){const s=t.sources[n];if(s.sources){const i=s.state;i===Ze?s!==e&&(!s.updatedAt||s.updatedAt<zt)&&Wt(s):i===Ye&&qt(s,e)}}}function Tn(t){for(let e=0;e<t.observers.length;e+=1){const n=t.observers[e];n.state||(n.state=Ye,n.pure?Le.push(n):tt.push(n),n.observers&&Tn(n))}}function Dt(t){let e;if(t.sources)for(;t.sources.length;){const n=t.sources.pop(),s=t.sourceSlots.pop(),i=n.observers;if(i&&i.length){const o=i.pop(),r=n.observerSlots.pop();s<i.length&&(o.sourceSlots[r]=s,i[s]=o,n.observerSlots[s]=r)}}if(t.tOwned){for(e=t.tOwned.length-1;e>=0;e--)Dt(t.tOwned[e]);delete t.tOwned}if(t.owned){for(e=t.owned.length-1;e>=0;e--)Dt(t.owned[e]);t.owned=null}if(t.cleanups){for(e=t.cleanups.length-1;e>=0;e--)t.cleanups[e]();t.cleanups=null}t.state=0}function ys(t){return t instanceof Error?t:new Error(typeof t=="string"?t:"Unknown error",{cause:t})}function Rn(t,e=_e){throw ys(t)}function gn(t){if(typeof t=="function"&&!t.length)return gn(t());if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++){const s=gn(t[n]);Array.isArray(s)?e.push.apply(e,s):e.push(s)}return e}return t}function bs(t,e){return function(s){let i;return fe(()=>i=Je(()=>(_e.context=ie(z({},_e.context),{[t]:s.value}),Cs(()=>s.children))),void 0),i}}const _s=Symbol("fallback");function $n(t){for(let e=0;e<t.length;e++)t[e]()}function Ss(t,e,n={}){let s=[],i=[],o=[],r=0,c=e.length>1?[]:null;return un(()=>$n(o)),()=>{let a=t()||[],d=a.length,u,f;return a[Ct],Je(()=>{let V,j,N,ee,H,T,b,y,q;if(d===0)r!==0&&($n(o),o=[],s=[],i=[],r=0,c&&(c=[])),n.fallback&&(s=[_s],i[0]=Vt(h=>(o[0]=h,n.fallback())),r=1);else if(r===0){for(i=new Array(d),f=0;f<d;f++)s[f]=a[f],i[f]=Vt(U);r=d}else{for(N=new Array(d),ee=new Array(d),c&&(H=new Array(d)),T=0,b=Math.min(r,d);T<b&&s[T]===a[T];T++);for(b=r-1,y=d-1;b>=T&&y>=T&&s[b]===a[y];b--,y--)N[y]=i[b],ee[y]=o[b],c&&(H[y]=c[b]);for(V=new Map,j=new Array(y+1),f=y;f>=T;f--)q=a[f],u=V.get(q),j[f]=u===void 0?-1:u,V.set(q,f);for(u=T;u<=b;u++)q=s[u],f=V.get(q),f!==void 0&&f!==-1?(N[f]=i[u],ee[f]=o[u],c&&(H[f]=c[u]),f=j[f],V.set(q,f)):o[u]();for(f=T;f<d;f++)f in N?(i[f]=N[f],o[f]=ee[f],c&&(c[f]=H[f],c[f](f))):i[f]=Vt(U);i=i.slice(0,r=d),s=a.slice(0)}return i});function U(V){if(o[f]=V,c){const[j,N]=L(f);return c[f]=N,e(a[f],j)}return e(a[f])}}}function ae(t,e){return Je(()=>t(e||{}))}const As=t=>`Stale read from <${t}>.`;function ut(t){const e="fallback"in t&&{fallback:()=>t.fallback};return st(Ss(()=>t.each,t.children,e||void 0))}function Qe(t){const e=t.keyed,n=st(()=>t.when,void 0,void 0),s=e?n:st(n,void 0,{equals:(i,o)=>!i==!o});return st(()=>{const i=s();if(i){const o=t.children;return typeof o=="function"&&o.length>0?Je(()=>o(e?i:()=>{if(!Je(s))throw As("Show");return n()})):o}return t.fallback},void 0,void 0)}const J=t=>st(()=>t());function xs(t,e,n){let s=n.length,i=e.length,o=s,r=0,c=0,a=e[i-1].nextSibling,d=null;for(;r<i||c<o;){if(e[r]===n[c]){r++,c++;continue}for(;e[i-1]===n[o-1];)i--,o--;if(i===r){const u=o<s?c?n[c-1].nextSibling:n[o-c]:a;for(;c<o;)t.insertBefore(n[c++],u)}else if(o===c)for(;r<i;)(!d||!d.has(e[r]))&&e[r].remove(),r++;else if(e[r]===n[o-1]&&n[c]===e[i-1]){const u=e[--i].nextSibling;t.insertBefore(n[c++],e[r++].nextSibling),t.insertBefore(n[--o],u),e[i]=n[o]}else{if(!d){d=new Map;let f=c;for(;f<o;)d.set(n[f],f++)}const u=d.get(e[r]);if(u!=null)if(c<u&&u<o){let f=r,U=1,V;for(;++f<i&&f<o&&!((V=d.get(e[f]))==null||V!==u+U);)U++;if(U>u-c){const j=e[r];for(;c<u;)t.insertBefore(n[c++],j)}else t.replaceChild(n[c++],e[r++])}else r++;else e[r++].remove()}}}const Pn="_$DX_DELEGATE";function Is(t,e,n,s={}){let i;return Vt(o=>{i=o,e===document?t():k(e,t(),e.firstChild?null:void 0,n)},s.owner),()=>{i(),e.textContent=""}}function O(t,e,n,s){let i;const o=()=>{const c=document.createElement("template");return c.innerHTML=t,c.content.firstChild},r=()=>(i||(i=o())).cloneNode(!0);return r.cloneNode=r,r}function yt(t,e=window.document){const n=e[Pn]||(e[Pn]=new Set);for(let s=0,i=t.length;s<i;s++){const o=t[s];n.has(o)||(n.add(o),e.addEventListener(o,ks))}}function ce(t,e,n){n==null?t.removeAttribute(e):t.setAttribute(e,n)}function it(t,e){e==null?t.removeAttribute("class"):t.className=e}function Zt(t,e,n,s){Array.isArray(n)?(t[`$$${e}`]=n[0],t[`$$${e}Data`]=n[1]):t[`$$${e}`]=n}function pn(t,e,n){if(!e)return n?ce(t,"style"):e;const s=t.style;if(typeof e=="string")return s.cssText=e;typeof n=="string"&&(s.cssText=n=void 0),n||(n={}),e||(e={});let i,o;for(o in n)e[o]==null&&s.removeProperty(o),delete n[o];for(o in e)i=e[o],i!==n[o]&&(s.setProperty(o,i),n[o]=i);return n}function l(t,e,n){n!=null?t.style.setProperty(e,n):t.style.removeProperty(e)}function Yt(t,e,n){return Je(()=>t(e,n))}function k(t,e,n,s){if(n!==void 0&&!s&&(s=[]),typeof e!="function")return Xt(t,e,s,n);fe(i=>Xt(t,e(),i,n),s)}function ks(t){let e=t.target;const n=`$$${t.type}`,s=t.target,i=t.currentTarget,o=a=>Object.defineProperty(t,"target",{configurable:!0,value:a}),r=()=>{const a=e[n];if(a&&!e.disabled){const d=e[`${n}Data`];if(d!==void 0?a.call(e,d,t):a.call(e,t),t.cancelBubble)return}return e.host&&typeof e.host!="string"&&!e.host._$host&&e.contains(t.target)&&o(e.host),!0},c=()=>{for(;r()&&(e=e._$host||e.parentNode||e.host););};if(Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return e||document}}),t.composedPath){const a=t.composedPath();o(a[0]);for(let d=0;d<a.length-2&&(e=a[d],!!r());d++){if(e._$host){e=e._$host,c();break}if(e.parentNode===i)break}}else c();o(s)}function Xt(t,e,n,s,i){for(;typeof n=="function";)n=n();if(e===n)return n;const o=typeof e,r=s!==void 0;if(t=r&&n[0]&&n[0].parentNode||t,o==="string"||o==="number"){if(o==="number"&&(e=e.toString(),e===n))return n;if(r){let c=n[0];c&&c.nodeType===3?c.data!==e&&(c.data=e):c=document.createTextNode(e),n=bt(t,n,s,c)}else n!==""&&typeof n=="string"?n=t.firstChild.data=e:n=t.textContent=e}else if(e==null||o==="boolean")n=bt(t,n,s);else{if(o==="function")return fe(()=>{let c=e();for(;typeof c=="function";)c=c();n=Xt(t,c,n,s)}),()=>n;if(Array.isArray(e)){const c=[],a=n&&Array.isArray(n);if(Cn(c,e,n,i))return fe(()=>n=Xt(t,c,n,s,!0)),()=>n;if(c.length===0){if(n=bt(t,n,s),r)return n}else a?n.length===0?Dn(t,c,s):xs(t,n,c):(n&&bt(t),Dn(t,c));n=c}else if(e.nodeType){if(Array.isArray(n)){if(r)return n=bt(t,n,s,e);bt(t,n,null,e)}else n==null||n===""||!t.firstChild?t.appendChild(e):t.replaceChild(e,t.firstChild);n=e}}return n}function Cn(t,e,n,s){let i=!1;for(let o=0,r=e.length;o<r;o++){let c=e[o],a=n&&n[t.length],d;if(!(c==null||c===!0||c===!1))if((d=typeof c)=="object"&&c.nodeType)t.push(c);else if(Array.isArray(c))i=Cn(t,c,a)||i;else if(d==="function")if(s){for(;typeof c=="function";)c=c();i=Cn(t,Array.isArray(c)?c:[c],Array.isArray(a)?a:[a])||i}else t.push(c),i=!0;else{const u=String(c);a&&a.nodeType===3&&a.data===u?t.push(a):t.push(document.createTextNode(u))}}return i}function Dn(t,e,n=null){for(let s=0,i=e.length;s<i;s++)t.insertBefore(e[s],n)}function bt(t,e,n,s){if(n===void 0)return t.textContent="";const i=s||document.createTextNode("");if(e.length){let o=!1;for(let r=e.length-1;r>=0;r--){const c=e[r];if(i!==c){const a=c.parentNode===t;!o&&!r?a?t.replaceChild(i,c):t.insertBefore(i,n):a&&c.remove()}else o=!0}}else t.insertBefore(i,n);return[i]}const mn="data:image/svg+xml,%3csvg%20width='44'%20height='40'%20viewBox='0%200%2044%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M36.4826%2032.6733C35.865%2033.1908%2035.1941%2033.6282%2034.4904%2033.957L33.74%2034.2621L29.7612%2035.8775C27.1272%2036.125%2024.4866%2036.253%2021.8465%2036.2542C21.235%2036.2549%2020.6236%2036.2482%2020.0127%2036.2348V33.2478L36.4826%2032.6733Z'%20fill='%239EACBA'/%3e%3cpath%20d='M0.438355%2018.8047C0.245806%2020.9769%200.245812%2023.1226%200.438355%2025.2946C0.535045%2025.9265%200.94889%2026.5048%201.4516%2026.8841C2.21046%2027.3799%202.95285%2027.8531%203.87299%2027.9711C4.74581%2027.9246%205.47724%2026.84%205.59973%2026.0356C5.89635%2023.3667%205.89636%2020.7328%205.59973%2018.0638C5.47724%2017.2593%204.74582%2016.1747%203.873%2016.1282C2.95286%2016.2462%202.21046%2016.7194%201.45161%2017.2152C0.948896%2017.5945%200.535045%2018.1729%200.438355%2018.8047Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M43.0616%2018.8047C43.2541%2020.9769%2043.2541%2023.1226%2043.0616%2025.2946C42.9649%2025.9265%2042.551%2026.5048%2042.0483%2026.8841C41.2895%2027.3799%2040.5471%2027.8531%2039.6269%2027.9711C38.7541%2027.9246%2038.0227%2026.84%2037.9002%2026.0356C37.6036%2023.3667%2037.6036%2020.7328%2037.9002%2018.0638C38.0227%2017.2593%2038.7541%2016.1747%2039.6269%2016.1282C40.5471%2016.2462%2041.2895%2016.7194%2042.0483%2017.2152C42.551%2017.5945%2042.9649%2018.1729%2043.0616%2018.8047Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M25.8389%208.85439H21.8867V7.22803H21.9359C22.2919%207.22803%2022.6365%207.24805%2022.9641%207.28506C24.6208%207.47311%2025.8389%208.10461%2025.8389%208.85439Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M22.9637%208.85422V11.641H20.9072V3.74219H21.8863V8.85422H22.9637Z'%20fill='%23171A3B'/%3e%3cpath%20d='M25.8393%208.85439C25.8393%209.60419%2024.6212%2010.2357%2022.9645%2010.4237C22.6369%2010.4607%2022.2923%2010.4808%2021.9362%2010.4808C21.5801%2010.4808%2021.2356%2010.4607%2020.908%2010.4237C19.2513%2010.2357%2018.0332%209.60419%2018.0332%208.85439C18.0332%208.104%2019.2513%207.47311%2020.908%207.28506C21.2204%207.24987%2021.5486%207.22985%2021.8871%207.22803V8.85439H25.8393Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M21.8871%208.85499V35.245H21.8465C21.235%2035.2456%2020.6235%2035.2389%2020.0127%2035.2256C17.1712%2035.1637%2014.331%2034.9538%2011.5017%2034.5856C7.74793%2034.0979%204.29685%2030.281%203.74784%2026.4459C3.32624%2023.5019%203.32624%2020.598%203.74784%2017.6541C4.29684%2013.819%207.74793%2010.0021%2011.5017%209.5144C14.9401%209.06731%2018.393%208.85317%2021.8465%208.85499H21.8871Z'%20fill='%23E7E9EB'/%3e%3cpath%20d='M40.114%2026.4452C39.7718%2028.7455%2038.3748%2031.0864%2036.4821%2032.6728C35.8646%2033.1902%2035.1936%2033.6276%2034.49%2033.9564C34.2437%2034.0716%2033.9931%2034.1736%2033.7396%2034.2615C33.2888%2034.4168%2032.8272%2034.5272%2032.3601%2034.5848C28.8781%2035.0149%2025.3827%2035.2406%2021.8867%2035.2442V8.85425C25.3821%208.85789%2028.8787%209.08355%2032.3601%209.51366C36.1382%209.98014%2039.5516%2013.8729%2040.114%2017.6533C40.5489%2020.5785%2040.5489%2023.5206%2040.114%2026.4452Z'%20fill='%23D1D3D4'/%3e%3cpath%20d='M27.1787%2013.3372C28.7256%2013.4409%2030.2804%2013.5888%2031.834%2013.7805C33.5282%2013.9898%2035.5612%2016.263%2035.8623%2018.2854C36.2336%2020.7829%2036.2336%2023.3159%2035.8623%2025.8127C35.6791%2027.0417%2034.8396%2028.4416%2033.7217%2029.3782C33.3772%2029.6675%2033.0233%2029.8974%2032.6709%2030.0618C32.5593%2030.1145%2032.4464%2030.1603%2032.3359%2030.1985C32.1609%2030.259%2031.9925%2030.2992%2031.835%2030.3186C28.467%2030.7347%2025.0907%2030.9456%2021.7998%2030.9456C21.2369%2030.9456%2020.667%2030.9391%2020.1064%2030.927C17.3961%2030.8675%2014.6875%2030.6643%2012.0566%2030.3215C11.6382%2030.2669%2011.1776%2030.0829%2010.7197%2029.7961L27.1787%2013.3372ZM21.7988%2013.1536C22.397%2013.1536%2022.9986%2013.1605%2023.6016%2013.175H23.6006C24.7855%2013.2017%2025.9795%2013.2559%2027.1777%2013.3372L10.7188%2029.7961C10.3196%2029.5462%209.92292%2029.2179%209.55957%2028.8303C9.2952%2028.5484%209.05604%2028.2435%208.84863%2027.927V27.926C8.40193%2027.2445%208.10127%2026.5082%208.00488%2025.8352C7.82534%2024.5778%207.73289%2023.3374%207.73047%2022.0969C7.72805%2020.825%207.8205%2019.5531%208.00488%2018.2629C8.14621%2017.2772%208.72802%2016.1571%209.56152%2015.2678C10.341%2014.4363%2011.2736%2013.8785%2012.0566%2013.7766C13.5174%2013.5867%2014.9995%2013.4403%2016.4912%2013.3372C18.2497%2013.2152%2020.0239%2013.1536%2021.7988%2013.1536Z'%20fill='%2333383F'/%3e%3cpath%20d='M21.8877%200.164557V4.90412C21.5382%204.90412%2021.207%204.8289%2020.9086%204.69301C20.0878%204.32054%2019.5176%203.49371%2019.5176%202.53403C19.5176%201.22554%2020.5786%200.164557%2021.8877%200.164557Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M29.7612%2035.877L20.0127%2039.8352V36.2343C20.6236%2036.2476%2021.235%2036.2543%2021.8465%2036.2537C24.4866%2036.2525%2027.1272%2036.1245%2029.7612%2035.877Z'%20fill='%23D1D3D4'/%3e%3cpath%20d='M24.2562%202.53403C24.2562%203.45488%2023.7309%204.2532%2022.9641%204.64569C22.6414%204.8107%2022.275%204.90411%2021.8867%204.90411V0.164551C23.1952%200.164551%2024.2562%201.22553%2024.2562%202.53403Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M22.9641%204.646V7.28541C22.6365%207.24841%2022.2919%207.22839%2021.9359%207.22839H21.8867V4.90441C22.275%204.90441%2022.6414%204.811%2022.9641%204.646Z'%20fill='%2301052B'/%3e%3cpath%20d='M15.4282%2025.5157C14.6141%2025.6903%2014.1949%2025.6903%2013.3808%2025.5157C12.8325%2025.2805%2012.4157%2024.7097%2012.2918%2024.124C12.0811%2022.4009%2012.0811%2020.7336%2012.2918%2019.0104C12.4157%2018.4248%2012.8325%2017.854%2013.3808%2017.6188C14.1949%2017.4441%2014.6141%2017.4441%2015.4282%2017.6188C15.9765%2017.854%2016.3933%2018.4248%2016.5173%2019.0104C16.7279%2020.7336%2016.7279%2022.4009%2016.5173%2024.124C16.3933%2024.7097%2015.9765%2025.2805%2015.4282%2025.5157Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M29.4946%2025.5157C28.6805%2025.6903%2028.2613%2025.6903%2027.4472%2025.5157C26.8989%2025.2805%2026.4821%2024.7097%2026.3582%2024.124C26.1475%2022.4009%2026.1475%2020.7336%2026.3582%2019.0104C26.4821%2018.4248%2026.8989%2017.854%2027.4472%2017.6188C28.2613%2017.4441%2028.6805%2017.4441%2029.4946%2017.6188C30.0429%2017.854%2030.4597%2018.4248%2030.5837%2019.0104C30.7943%2020.7336%2030.7943%2022.4009%2030.5837%2024.124C30.4597%2024.7097%2030.0429%2025.2805%2029.4946%2025.5157Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M18.9688%2024.187H23.91C24.2911%2024.187%2024.6004%2024.5023%2024.6004%2024.8906V24.9011C24.6004%2026.6789%2023.184%2028.1222%2021.4394%2028.1222C19.6948%2028.1222%2018.2783%2026.6789%2018.2783%2024.9011V24.8906C18.2783%2024.5023%2018.5877%2024.187%2018.9688%2024.187Z'%20fill='%2351D6A1'/%3e%3c/svg%3e",Ms="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='28'%20height='28'%20rx='14'%20fill='%23EFEFEF'/%3e%3cpath%20d='M20.667%209.83325L7.33366%209.83325'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M16.5%2014L7.33333%2014'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M11.5%2018.1667H7.33333'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Es="data:image/svg+xml,%3csvg%20width='29'%20height='28'%20viewBox='0%200%2029%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.5977%2016.0232C11.8613%2015.7596%2012.2882%2015.7596%2012.5518%2016.0232C12.8152%2016.2868%2012.8153%2016.7137%2012.5518%2016.9773L7.87109%2021.658H11.1221C11.4949%2021.658%2011.7969%2021.9609%2011.7969%2022.3337C11.7967%2022.7064%2011.4948%2023.0085%2011.1221%2023.0085H6.24121C5.86853%2023.0085%205.56658%2022.7064%205.56641%2022.3337V17.4529C5.56641%2017.0801%205.86842%2016.7771%206.24121%2016.7771C6.614%2016.7771%206.91602%2017.0801%206.91602%2017.4529V20.7039L11.5977%2016.0232ZM22.9082%204.99194C23.2808%204.99212%2023.583%205.29406%2023.583%205.66675V10.5476C23.583%2010.9203%2023.2808%2011.2222%2022.9082%2011.2224C22.5354%2011.2224%2022.2324%2010.9204%2022.2324%2010.5476V7.29663L17.5518%2011.9773C17.2882%2012.2408%2016.8613%2012.2407%2016.5977%2011.9773C16.3341%2011.7137%2016.3341%2011.2868%2016.5977%2011.0232L21.2783%206.34155H18.0273C17.6546%206.34155%2017.3516%206.03954%2017.3516%205.66675C17.3516%205.29396%2017.6546%204.99194%2018.0273%204.99194H22.9082Z'%20fill='%23858B93'%20stroke='%23858B93'%20stroke-width='0.1'/%3e%3c/svg%3e",Ts="data:image/svg+xml,%3csvg%20width='29'%20height='28'%20viewBox='0%200%2029%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.0737%2015.8249C12.4464%2015.8249%2012.7493%2016.127%2012.7495%2016.4997V21.3805C12.7495%2021.7533%2012.4465%2022.0563%2012.0737%2022.0563C11.7011%2022.0561%2011.3989%2021.7532%2011.3989%2021.3805V18.1296L6.71826%2022.8102C6.45466%2023.0738%206.02679%2023.0738%205.76318%2022.8102C5.49996%2022.5466%205.49985%2022.1196%205.76318%2021.8561L10.4438%2017.1755H7.19287C6.82019%2017.1753%206.51807%2016.8724%206.51807%2016.4997C6.51824%2016.1271%206.82029%2015.825%207.19287%2015.8249H12.0737ZM22.4302%205.18913C22.6937%204.9258%2023.1207%204.92591%2023.3843%205.18913C23.6479%205.45274%2023.6479%205.88061%2023.3843%206.14421L18.7046%2010.8249H21.9546C22.3273%2010.8249%2022.6302%2011.127%2022.6304%2011.4997C22.6304%2011.8725%2022.3274%2012.1755%2021.9546%2012.1755H17.0737C16.7011%2012.1753%2016.3989%2011.8724%2016.3989%2011.4997V6.61882C16.3991%206.24624%2016.7012%205.94419%2017.0737%205.94402C17.4464%205.94402%2017.7494%206.24613%2017.7495%206.61882V9.8698L22.4302%205.18913Z'%20fill='%23858B93'%20stroke='%23858B93'%20stroke-width='0.1'/%3e%3c/svg%3e",Bn="data:image/svg+xml,%3csvg%20width='34'%20height='34'%20viewBox='0%200%2034%2034'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.2391%208.55011C9.85199%208.16298%209.22434%208.16298%208.83722%208.55011C8.45009%208.93723%208.45009%209.56488%208.83722%209.95201L15.885%2016.9998L8.83728%2024.0476C8.45016%2024.4347%208.45016%2025.0624%208.83728%2025.4495C9.22441%2025.8366%209.85206%2025.8366%2010.2392%2025.4495L17.2869%2018.4017L24.3346%2025.4494C24.7217%2025.8365%2025.3494%2025.8365%2025.7365%2025.4494C26.1236%2025.0623%2026.1236%2024.4346%2025.7365%2024.0475L18.6888%2016.9998L25.7366%209.95207C26.1237%209.56495%2026.1237%208.9373%2025.7366%208.55017C25.3495%208.16305%2024.7218%208.16305%2024.3347%208.55017L17.2869%2015.5979L10.2391%208.55011Z'%20fill='%23858B93'/%3e%3c/svg%3e",Rs="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.9912%202.92969C11.4392%202.92969%2010.9912%203.37769%2010.9912%203.92969V10.9297H3.99121C3.43921%2010.9297%202.99121%2011.3777%202.99121%2011.9297C2.99121%2012.4817%203.43921%2012.9297%203.99121%2012.9297H10.9912V19.9297C10.9912%2020.4817%2011.4392%2020.9297%2011.9912%2020.9297C12.5432%2020.9297%2012.9912%2020.4817%2012.9912%2019.9297V12.9297H19.9912C20.5432%2012.9297%2020.9912%2012.4817%2020.9912%2011.9297C20.9912%2011.3777%2020.5432%2010.9297%2019.9912%2010.9297H12.9912V3.92969C12.9912%203.37769%2012.5432%202.92969%2011.9912%202.92969Z'%20fill='%23858B93'/%3e%3c/svg%3e",$s="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.6464%2010.3132C15.8417%2010.1179%2016.1583%2010.1179%2016.3536%2010.3132L20.3536%2014.3132C20.5488%2014.5085%2020.5488%2014.825%2020.3536%2015.0203C20.1583%2015.2156%2019.8417%2015.2156%2019.6464%2015.0203L16.5%2011.8739L16.5%2021.3334C16.5%2021.6096%2016.2761%2021.8334%2016%2021.8334C15.7239%2021.8334%2015.5%2021.6096%2015.5%2021.3334L15.5%2011.8739L12.3536%2015.0203C12.1583%2015.2156%2011.8417%2015.2156%2011.6464%2015.0203C11.4512%2014.825%2011.4512%2014.5085%2011.6464%2014.3132L15.6464%2010.3132Z'%20fill='%23858B93'/%3e%3c/svg%3e",Ps="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='28'%20height='28'%20rx='14'%20fill='%231AAF74'%20fill-opacity='0.1'/%3e%3cpath%20d='M20.667%209.83325L7.33366%209.83325'%20stroke='%231AAF74'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M16.5%2014L7.33333%2014'%20stroke='%231AAF74'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M11.5%2018.1667H7.33333'%20stroke='%231AAF74'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Ds="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='12'%20cy='6.5'%20r='4'%20stroke='%23858B93'%20stroke-width='1.3'/%3e%3cellipse%20cx='12'%20cy='17.5'%20rx='7'%20ry='4'%20stroke='%23858B93'%20stroke-width='1.3'/%3e%3c/svg%3e",Bs="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2012.5C2%207.78595%202%205.42893%203.46447%203.96447C4.92893%202.5%207.28595%202.5%2012%202.5C16.714%202.5%2019.0711%202.5%2020.5355%203.96447C22%205.42893%2022%207.78595%2022%2012.5C22%2017.214%2022%2019.5711%2020.5355%2021.0355C19.0711%2022.5%2016.714%2022.5%2012%2022.5C7.28595%2022.5%204.92893%2022.5%203.46447%2021.0355C2%2019.5711%202%2017.214%202%2012.5Z'%20stroke='%23858B93'%20stroke-width='1.3'/%3e%3cpath%20d='M7%2014.5L8.79689%2012.3437C9.50894%2011.4893%209.86496%2011.062%2010.3333%2011.062C10.8017%2011.062%2011.1577%2011.4893%2011.8698%2012.3437L12.1302%2012.6563C12.8423%2013.5107%2013.1983%2013.938%2013.6667%2013.938C14.135%2013.938%2014.4911%2013.5107%2015.2031%2012.6563L17%2010.5'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Hs="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M22%2011V12.5C22%2017.214%2022%2019.5711%2020.5355%2021.0355C19.0711%2022.5%2016.714%2022.5%2012%2022.5C7.28595%2022.5%204.92893%2022.5%203.46447%2021.0355C2%2019.5711%202%2017.214%202%2012.5C2%207.78595%202%205.42893%203.46447%203.96447C4.92893%202.5%207.28595%202.5%2012%202.5H13.5'%20stroke='%23858B93'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cpath%20d='M16.652%203.95506L17.3009%203.30624C18.3759%202.23125%2020.1188%202.23125%2021.1938%203.30624C22.2687%204.38124%2022.2687%206.12415%2021.1938%207.19914L20.5449%207.84795M16.652%203.95506C16.652%203.95506%2016.7331%205.33379%2017.9497%206.55032C19.1662%207.76685%2020.5449%207.84795%2020.5449%207.84795M16.652%203.95506L10.6872%209.91993C10.2832%2010.3239%2010.0812%2010.5259%209.90743%2010.7487C9.70249%2011.0114%209.52679%2011.2957%209.38344%2011.5965C9.26191%2011.8515%209.17157%2012.1225%208.99089%2012.6646L8.41242%2014.4M20.5449%207.84795L14.5801%2013.8128C14.1761%2014.2168%2013.9741%2014.4188%2013.7513%2014.5926C13.4886%2014.7975%2013.2043%2014.9732%2012.9035%2015.1166C12.6485%2015.2381%2012.3775%2015.3284%2011.8354%2015.5091L10.1%2016.0876M10.1%2016.0876L8.97709%2016.4619C8.71035%2016.5508%208.41626%2016.4814%208.21744%2016.2826C8.01862%2016.0837%207.9492%2015.7897%208.03811%2015.5229L8.41242%2014.4M10.1%2016.0876L8.41242%2014.4'%20stroke='%23858B93'%20stroke-width='1.5'/%3e%3c/svg%3e",Ls="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9.58366%202.79175C5.55658%202.79175%202.29199%206.05634%202.29199%2010.0834C2.29199%2014.1105%205.55658%2017.3751%209.58366%2017.3751C13.6107%2017.3751%2016.8753%2014.1105%2016.8753%2010.0834C16.8753%206.05634%2013.6107%202.79175%209.58366%202.79175ZM1.04199%2010.0834C1.04199%205.36598%204.86623%201.54175%209.58366%201.54175C14.3011%201.54175%2018.1253%205.36598%2018.1253%2010.0834C18.1253%2012.2172%2017.3429%2014.1682%2016.0494%2015.6653L18.7756%2018.3915C19.0197%2018.6356%2019.0197%2019.0313%2018.7756%2019.2754C18.5315%2019.5194%2018.1358%2019.5194%2017.8917%2019.2754L15.1655%2016.5491C13.6684%2017.8427%2011.7174%2018.6251%209.58366%2018.6251C4.86623%2018.6251%201.04199%2014.8008%201.04199%2010.0834Z'%20fill='%23858B93'/%3e%3c/svg%3e",Os="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17%2012.5C17%2011.3954%2017.8954%2010.5%2019%2010.5C20.1046%2010.5%2021%2011.3954%2021%2012.5C21%2013.6046%2020.1046%2014.5%2019%2014.5C17.8954%2014.5%2017%2013.6046%2017%2012.5Z'%20fill='%23858B93'/%3e%3cpath%20d='M10%2012.5C10%2011.3954%2010.8954%2010.5%2012%2010.5C13.1046%2010.5%2014%2011.3954%2014%2012.5C14%2013.6046%2013.1046%2014.5%2012%2014.5C10.8954%2014.5%2010%2013.6046%2010%2012.5Z'%20fill='%23858B93'/%3e%3cpath%20d='M3%2012.5C3%2011.3954%203.89543%2010.5%205%2010.5C6.10457%2010.5%207%2011.3954%207%2012.5C7%2013.6046%206.10457%2014.5%205%2014.5C3.89543%2014.5%203%2013.6046%203%2012.5Z'%20fill='%23858B93'/%3e%3c/svg%3e",Fs="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7%208.5C7%205.73858%209.23858%203.5%2012%203.5C14.7614%203.5%2017%205.73858%2017%208.5V11.5C17%2014.2614%2014.7614%2016.5%2012%2016.5C9.23858%2016.5%207%2014.2614%207%2011.5V8.5Z'%20stroke='%23858B93'%20stroke-width='1.5'/%3e%3cpath%20d='M11%208.5H13'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M10%2011.5L14%2011.5'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M20%2010.5V11.5C20%2015.9183%2016.4183%2019.5%2012%2019.5C7.58172%2019.5%204%2015.9183%204%2011.5V10.5'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M12%2019.5V22.5'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Hn="data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.25%202.49258C13.5179%201.2247%2015.5735%201.2247%2016.8414%202.49258C18.1093%203.76046%2018.1093%205.8161%2016.8414%207.08398L10.5131%2013.4123C10.1564%2013.769%209.9386%2013.9869%209.69583%2014.1762C9.40981%2014.3993%209.10033%2014.5906%208.77287%2014.7466C8.49494%2014.8791%208.20269%2014.9765%207.72413%2015.136L5.49692%2015.8784L4.9622%2016.0566C4.48358%2016.2162%203.95589%2016.0916%203.59915%2015.7349C3.2424%2015.3781%203.11783%2014.8504%203.27737%2014.3718L4.19801%2011.6099C4.3575%2011.1313%204.4549%2010.8391%204.58736%2010.5611C4.74342%2010.2337%204.93469%209.9242%205.15778%209.63817C5.34714%209.3954%205.56498%209.17759%205.92169%208.82091L12.25%202.49258ZM5.46809%2014.5704L4.76362%2013.8659L5.37064%2012.0449C5.54737%2011.5147%205.62037%2011.2991%205.71577%2011.0989C5.83276%2010.8534%205.97616%2010.6214%206.14342%2010.4069C6.27979%2010.2321%206.43997%2010.0704%206.83516%209.67521L11.7443%204.76607C11.9469%205.27439%2012.2898%205.88791%2012.8679%206.46606C13.4461%207.04422%2014.0596%207.38707%2014.5679%207.5897L9.65879%2012.4988C9.2636%2012.894%209.1019%2013.0542%208.92706%2013.1906C8.71262%2013.3578%208.4806%2013.5012%208.2351%2013.6182C8.03493%2013.7136%207.81935%2013.7866%207.28915%2013.9634L5.46809%2014.5704ZM15.564%206.59368C15.4608%206.57102%2015.3317%206.53694%2015.1851%206.48604C14.7817%206.34611%2014.2511%206.08149%2013.7518%205.58218C13.2525%205.08287%2012.9879%204.5523%2012.848%204.14895C12.7971%204.00226%2012.763%203.87323%2012.7403%203.77004L13.1339%203.37647C13.9136%202.59674%2015.1778%202.59674%2015.9575%203.37647C16.7373%204.15619%2016.7373%205.42038%2015.9575%206.2001L15.564%206.59368ZM3.209%2018.8333C3.209%2018.4882%203.48882%2018.2083%203.834%2018.2083H17.1673V19.4583H3.834C3.48882%2019.4583%203.209%2019.1785%203.209%2018.8333Z'%20fill='%23858B93'/%3e%3c/svg%3e",Ln="data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.4994%202.79166C9.68396%202.79166%208.9886%203.31251%208.7309%204.0416C8.61587%204.36705%208.2588%204.53763%207.93335%204.4226C7.6079%204.30757%207.43733%203.95049%207.55235%203.62504C7.98105%202.41215%209.13775%201.54166%2010.4994%201.54166C11.861%201.54166%2013.0177%202.41215%2013.4464%203.62504C13.5614%203.95049%2013.3908%204.30757%2013.0654%204.4226C12.74%204.53763%2012.3829%204.36705%2012.2678%204.0416C12.0101%203.31251%2011.3148%202.79166%2010.4994%202.79166Z'%20fill='%23858B93'/%3e%3cpath%20d='M2.79102%205.49999C2.79102%205.15481%203.07084%204.87499%203.41602%204.87499H17.5828C17.9279%204.87499%2018.2078%205.15481%2018.2078%205.49999C18.2078%205.84517%2017.9279%206.12499%2017.5828%206.12499H3.41602C3.07084%206.12499%202.79102%205.84517%202.79102%205.49999Z'%20fill='%23858B93'/%3e%3cpath%20d='M5.42859%207.54175C5.40563%207.19733%205.10781%206.93675%204.7634%206.95971C4.41898%206.98267%204.15839%207.28048%204.18135%207.6249L4.56756%2013.418C4.63881%2014.487%204.69636%2015.3504%204.83134%2016.028C4.97167%2016.7324%205.21035%2017.3208%205.70335%2017.782C6.19634%2018.2432%206.7993%2018.4422%207.51151%2018.5354C8.19654%2018.625%209.06191%2018.625%2010.1332%2018.625H10.8656C11.9369%2018.625%2012.8023%2018.625%2013.4873%2018.5354C14.1995%2018.4422%2014.8025%2018.2432%2015.2955%2017.782C15.7885%2017.3208%2016.0272%2016.7324%2016.1675%2016.028C16.3025%2015.3504%2016.36%2014.487%2016.4313%2013.418L16.8175%207.6249C16.8404%207.28048%2016.5798%206.98267%2016.2354%206.95971C15.891%206.93675%2015.5932%207.19733%2015.5702%207.54175L15.187%2013.291C15.1121%2014.4142%2015.0587%2015.1957%2014.9416%2015.7837C14.828%2016.3541%2014.6693%2016.656%2014.4415%2016.8692C14.2137%2017.0824%2013.9019%2017.2205%2013.3252%2017.296C12.7307%2017.3737%2011.9474%2017.375%2010.8216%2017.375H10.1772C9.05148%2017.375%208.26814%2017.3737%207.67364%2017.296C7.09697%2017.2205%206.78517%2017.0824%206.55733%2016.8692C6.32948%2016.656%206.17087%2016.3541%206.05725%2015.7837C5.94011%2015.1957%205.88675%2014.4142%205.81187%2013.291L5.42859%207.54175Z'%20fill='%23858B93'/%3e%3cpath%20d='M8.3539%209.04476C8.69736%209.01041%209.00364%209.261%209.03799%209.60447L9.45465%2013.7711C9.489%2014.1146%209.23841%2014.4209%208.89494%2014.4552C8.55148%2014.4896%208.2452%2014.239%208.21086%2013.8955L7.79419%209.72885C7.75984%209.38538%208.01043%209.0791%208.3539%209.04476Z'%20fill='%23858B93'/%3e%3cpath%20d='M13.2047%209.72885C13.239%209.38538%2012.9884%209.0791%2012.6449%209.04476C12.3015%209.01041%2011.9952%209.261%2011.9609%209.60447L11.5442%2013.7711C11.5098%2014.1146%2011.7604%2014.4209%2012.1039%2014.4552C12.4474%2014.4896%2012.7536%2014.239%2012.788%2013.8955L13.2047%209.72885Z'%20fill='%23858B93'/%3e%3c/svg%3e",Ns="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20d='M16%2022.6666L16%209.33331M16%209.33331L21%2014.3333M16%209.33331L11%2014.3333'%20stroke='%231AAF74'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Us="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2361_172518)'%3e%3cpath%20d='M15.6005%2011.6509C15.9284%2011.2327%2016.0856%2010.7843%2016.0656%2010.3226C16.0455%209.81401%2015.818%209.41585%2015.6306%209.1716C15.8481%208.62956%2015.9317%207.77636%2015.2057%207.11388C14.6737%206.62873%2013.7703%206.41125%2012.5189%206.47147C11.639%206.51162%2010.9029%206.67557%2010.8728%206.68226H10.8694C10.7021%206.71238%2010.5248%206.74918%2010.3441%206.78933C10.3307%206.57519%2010.3675%206.0432%2010.7623%204.84537C11.2308%203.42003%2011.204%202.32927%2010.6754%201.59987C10.1199%200.833663%209.23328%200.773438%208.9723%200.773438C8.72136%200.773438%208.49049%200.87716%208.32655%201.06787C7.95515%201.49949%207.99865%202.29581%208.04549%202.66386C7.60384%203.8483%206.36586%206.75253%205.3186%207.55888C5.29852%207.57227%205.2818%207.589%205.26507%207.60572C4.95724%207.93028%204.7498%208.28159%204.60927%208.58941C4.41187%208.48235%204.18769%208.42212%203.94679%208.42212H1.9058C1.13625%208.42212%200.513916%209.0478%200.513916%209.81401V15.2511C0.513916%2016.0206%201.1396%2016.6429%201.9058%2016.6429H3.94679C4.24457%2016.6429%204.52228%2016.5493%204.7498%2016.3887L5.53608%2016.4823C5.65653%2016.4991%207.7979%2016.7701%209.99614%2016.7266C10.3943%2016.7567%2010.769%2016.7734%2011.117%2016.7734C11.7159%2016.7734%2012.2379%2016.7266%2012.6728%2016.6329C13.6967%2016.4154%2014.396%2015.9805%2014.7506%2015.3414C15.0217%2014.8529%2015.0217%2014.3677%2014.9782%2014.0599C15.644%2013.4577%2015.7611%2012.7918%2015.7377%2012.3234C15.7243%2012.0524%2015.6641%2011.8215%2015.6005%2011.6509ZM1.9058%2015.7396C1.63479%2015.7396%201.4173%2015.5187%201.4173%2015.2511V9.81066C1.4173%209.53964%201.63813%209.32216%201.9058%209.32216H3.94679C4.21781%209.32216%204.43529%209.54299%204.43529%209.81066V15.2477C4.43529%2015.5187%204.21446%2015.7362%203.94679%2015.7362H1.9058V15.7396ZM14.7439%2011.2594C14.6034%2011.4066%2014.5767%2011.6308%2014.6837%2011.8048C14.6837%2011.8082%2014.8209%2012.0424%2014.8376%2012.3636C14.8611%2012.8019%2014.6503%2013.19%2014.2086%2013.5212C14.0513%2013.6417%2013.9878%2013.8491%2014.0547%2014.0365C14.0547%2014.0399%2014.1986%2014.4815%2013.9644%2014.8997C13.7402%2015.3013%2013.2416%2015.589%2012.4855%2015.7496C11.8799%2015.8801%2011.0568%2015.9035%2010.0463%2015.8232C10.0329%2015.8232%2010.0162%2015.8232%209.99949%2015.8232C7.84809%2015.87%205.67326%2015.589%205.64984%2015.5856H5.6465L5.30856%2015.5455C5.32864%2015.4518%205.33868%2015.3514%205.33868%2015.2511V9.81066C5.33868%209.66679%205.31525%209.52626%205.2751%209.39577C5.33533%209.1716%205.50262%208.67306%205.89744%208.24813C7.39974%207.057%208.86858%203.0386%208.93215%202.86461C8.95892%202.79435%208.96561%202.71739%208.95223%202.64044C8.89535%202.2657%208.91542%201.80731%208.99572%201.67013C9.17305%201.67348%209.65152%201.72367%209.93926%202.12183C10.2805%202.5936%2010.2672%203.43676%209.89911%204.55428C9.337%206.25734%209.29016%207.15403%209.73516%207.54885C9.95599%207.74625%2010.2504%207.75629%2010.4646%207.67933C10.6687%207.63249%2010.8627%207.59234%2011.0467%207.56223C11.0601%207.55888%2011.0769%207.55554%2011.0902%207.55219C12.1174%207.32802%2013.9577%207.19084%2014.5967%207.77302C15.1388%208.26821%2014.754%208.924%2014.7105%208.99427C14.5867%209.18163%2014.6235%209.42588%2014.7908%209.57645C14.7941%209.57979%2015.1455%209.91104%2015.1622%2010.356C15.1756%2010.6538%2015.035%2010.9583%2014.7439%2011.2594Z'%20fill='%23858B93'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2361_172518'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='translate(0.290527%200.773438)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",js="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2361_172521)'%3e%3cpath%20d='M0.980564%205.89598C0.652667%206.31422%200.495411%206.76256%200.515487%207.2243C0.535562%207.73287%200.763082%208.13103%200.950451%208.37528C0.732968%208.91731%200.649323%209.77051%201.37538%2010.433C1.90737%2010.9181%202.81076%2011.1356%204.06212%2011.0754C4.94209%2011.0353%205.67818%2010.8713%205.70829%2010.8646H5.71164C5.87893%2010.8345%206.05626%2010.7977%206.23694%2010.7575C6.25033%2010.9717%206.21352%2011.5037%205.81871%2012.7015C5.35028%2014.1268%205.37705%2015.2176%205.9057%2015.947C6.46112%2016.7132%207.34777%2016.7734%207.60875%2016.7734C7.85969%2016.7734%208.09056%2016.6697%208.25451%2016.479C8.6259%2016.0474%208.5824%2015.2511%208.53556%2014.883C8.97722%2013.6986%2010.2152%2010.7943%2011.2625%209.98799C11.2825%209.97461%2011.2993%209.95788%2011.316%209.94115C11.6238%209.6166%2011.8313%209.26528%2011.9718%208.95746C12.1692%209.06453%2012.3934%209.12475%2012.6343%209.12475H14.6753C15.4448%209.12475%2016.0671%208.49907%2016.0671%207.73287V2.29581C16.0671%201.52626%2015.4415%200.903928%2014.6753%200.903928H12.6343C12.3365%200.903928%2012.0588%200.997612%2011.8313%201.15821L11.045%201.06453C10.9245%201.0478%208.78316%200.776784%206.58491%200.820281C6.18675%200.790168%205.81201%200.773438%205.46404%200.773438C4.86513%200.773438%204.34317%200.82028%203.90821%200.913965C2.88437%201.13145%202.18508%201.56641%201.83042%202.20547C1.5594%202.69397%201.5594%203.17913%201.6029%203.48695C0.937067%204.0892%200.819963%204.75504%200.843384%205.22346C0.856767%205.49447%200.916992%205.72534%200.980564%205.89598ZM14.6753%201.80732C14.9463%201.80732%2015.1638%202.02814%2015.1638%202.29581V7.73621C15.1638%208.00723%2014.9429%208.22471%2014.6753%208.22471H12.6343C12.3632%208.22471%2012.1458%208.00389%2012.1458%207.73621V2.29916C12.1458%202.02814%2012.3666%201.81066%2012.6343%201.81066H14.6753V1.80732ZM1.83711%206.28745C1.97764%206.14023%202.0044%205.91606%201.89734%205.74207C1.89734%205.73872%201.76015%205.50451%201.74343%205.18331C1.72%204.745%201.93079%204.35688%202.37245%204.02563C2.52971%203.90518%202.59328%203.69774%202.52636%203.51037C2.52636%203.50702%202.38249%203.06537%202.6167%202.64713C2.84087%202.24562%203.33941%201.95788%204.09558%201.79728C4.70118%201.66679%205.52427%201.64337%206.53473%201.72367C6.54811%201.72367%206.56484%201.72367%206.58157%201.72367C8.73297%201.67683%2010.9078%201.95788%2010.9312%201.96123H10.9346L11.2725%202.00138C11.2524%202.09506%2011.2424%202.19544%2011.2424%202.29581V7.73621C11.2424%207.88009%2011.2658%208.02061%2011.306%208.1511C11.2457%208.37528%2011.0784%208.87381%2010.6836%209.29874C9.18132%2010.4899%207.71248%2014.5083%207.6489%2014.6823C7.62214%2014.7525%207.61545%2014.8295%207.62883%2014.9064C7.68571%2015.2812%207.66563%2015.7396%207.58533%2015.8767C7.408%2015.8734%206.92954%2015.8232%206.64179%2015.425C6.30051%2014.9533%206.3139%2014.1101%206.68194%2012.9926C7.24405%2011.2895%207.29089%2010.3928%206.84589%209.99803C6.62506%209.80062%206.33063%209.79059%206.11649%209.86754C5.91239%209.91438%205.71833%209.95453%205.53431%209.98465C5.52092%209.98799%205.50419%209.99134%205.49081%209.99468C4.46363%2010.2189%202.62339%2010.356%201.98433%209.77386C1.4423%209.27867%201.82707%208.62287%201.87057%208.55261C1.99437%208.36524%201.95756%208.12099%201.79027%207.97043C1.78692%207.96708%201.4356%207.63584%201.41887%207.19084C1.40549%206.89305%201.54602%206.58858%201.83711%206.28745Z'%20fill='%23858B93'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2361_172521'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='matrix(-1%200%200%20-1%2016.2905%2016.7734)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",zs="data:image/svg+xml,%3csvg%20width='16'%20height='17'%20viewBox='0%200%2016%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2361_92626)'%3e%3cpath%20d='M15.3092%2011.4575C15.6371%2011.0393%2015.7944%2010.591%2015.7743%2010.1292C15.7542%209.62065%2015.5267%209.22249%2015.3393%208.97824C15.5568%208.4362%2015.6405%207.58301%2014.9144%206.92052C14.3824%206.43537%2013.479%206.21789%2012.2277%206.27811C11.3477%206.31826%2010.6116%206.48221%2010.5815%206.4889H10.5782C10.4109%206.51902%2010.2335%206.55582%2010.0529%206.59597C10.0395%206.38183%2010.0763%205.84984%2010.4711%204.65201C10.9395%203.22667%2010.9127%202.13591%2010.3841%201.40651C9.82868%200.640304%208.94202%200.580078%208.68104%200.580078C8.4301%200.580078%208.19923%200.6838%208.03529%200.874516C7.66389%201.30613%207.70739%202.10245%207.75423%202.4705C7.31258%203.65494%206.0746%206.55917%205.02734%207.36552C5.00726%207.37891%204.99054%207.39564%204.97381%207.41237C4.66599%207.73692%204.45854%208.08823%204.31801%208.39605C4.12061%208.28899%203.89643%208.22876%203.65553%208.22876H1.61454C0.84499%208.22876%200.222656%208.85444%200.222656%209.62065V15.0577C0.222656%2015.8273%200.848336%2016.4496%201.61454%2016.4496H3.65553C3.95331%2016.4496%204.23102%2016.3559%204.45854%2016.1953L5.24482%2016.289C5.36527%2016.3057%207.50664%2016.5767%209.70488%2016.5332C10.103%2016.5633%2010.4778%2016.5801%2010.8258%2016.5801C11.4247%2016.5801%2011.9466%2016.5332%2012.3816%2016.4396C13.4054%2016.2221%2014.1047%2015.7871%2014.4594%2015.148C14.7304%2014.6595%2014.7304%2014.1744%2014.6869%2013.8666C15.3527%2013.2643%2015.4698%2012.5985%2015.4464%2012.1301C15.433%2011.859%2015.3728%2011.6282%2015.3092%2011.4575ZM1.61454%2015.5462C1.34353%2015.5462%201.12604%2015.3254%201.12604%2015.0577V9.6173C1.12604%209.34628%201.34687%209.1288%201.61454%209.1288H3.65553C3.92655%209.1288%204.14403%209.34963%204.14403%209.6173V15.0544C4.14403%2015.3254%203.9232%2015.5429%203.65553%2015.5429H1.61454V15.5462ZM14.4527%2011.0661C14.3122%2011.2133%2014.2854%2011.4375%2014.3925%2011.6114C14.3925%2011.6148%2014.5296%2011.849%2014.5464%2012.1702C14.5698%2012.6085%2014.359%2012.9966%2013.9173%2013.3279C13.7601%2013.4483%2013.6965%2013.6558%2013.7634%2013.8431C13.7634%2013.8465%2013.9073%2014.2881%2013.6731%2014.7064C13.4489%2015.1079%2012.9504%2015.3956%2012.1942%2015.5562C11.5886%2015.6867%2010.7655%2015.7101%209.75507%2015.6298C9.74169%2015.6298%209.72496%2015.6298%209.70823%2015.6298C7.55683%2015.6767%205.382%2015.3956%205.35858%2015.3923H5.35524L5.0173%2015.3521C5.03738%2015.2585%205.04742%2015.1581%205.04742%2015.0577V9.6173C5.04742%209.47343%205.02399%209.3329%204.98384%209.20241C5.04407%208.97824%205.21136%208.4797%205.60618%208.05477C7.10848%206.86364%208.57732%202.84524%208.64089%202.67125C8.66766%202.60099%208.67435%202.52403%208.66097%202.44708C8.60409%202.07234%208.62416%201.61396%208.70446%201.47677C8.88179%201.48012%209.36026%201.53031%209.648%201.92847C9.98928%202.40024%209.9759%203.2434%209.60785%204.36092C9.04574%206.06398%208.9989%206.96067%209.4439%207.35549C9.66473%207.55289%209.95917%207.56293%2010.1733%207.48597C10.3774%207.43913%2010.5715%207.39898%2010.7555%207.36887C10.7689%207.36552%2010.7856%207.36218%2010.799%207.35883C11.8262%207.13466%2013.6664%206.99748%2014.3055%207.57966C14.8475%208.07485%2014.4627%208.73064%2014.4192%208.80091C14.2954%208.98828%2014.3322%209.23252%2014.4995%209.38309C14.5029%209.38644%2014.8542%209.71768%2014.8709%2010.1627C14.8843%2010.4605%2014.7438%2010.7649%2014.4527%2011.0661Z'%20fill='%231AAF74'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2361_92626'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='translate(0%200.580078)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Vs="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2361_214893)'%3e%3cpath%20d='M0.784519%205.70262C0.456622%206.12086%200.299366%206.5692%200.319442%207.03094C0.339517%207.53951%200.567037%207.93767%200.754406%208.18192C0.536923%208.72395%200.453278%209.57715%201.17933%2010.2396C1.71133%2010.7248%202.61472%2010.9423%203.86607%2010.882C4.74604%2010.8419%205.48213%2010.6779%205.51225%2010.6713H5.51559C5.68289%2010.6411%205.86022%2010.6043%206.0409%2010.5642C6.05428%2010.7783%206.01748%2011.3103%205.62266%2012.5081C5.15424%2013.9335%205.18101%2015.0242%205.70965%2015.7536C6.26507%2016.5199%207.15173%2016.5801%207.41271%2016.5801C7.66365%2016.5801%207.89452%2016.4764%208.05846%2016.2856C8.42986%2015.854%208.38636%2015.0577%208.33952%2014.6897C8.78117%2013.5052%2010.0191%2010.601%2011.0664%209.79463C11.0865%209.78125%2011.1032%209.76452%2011.1199%209.74779C11.4278%209.42324%2011.6352%209.07192%2011.7757%208.7641C11.9731%208.87117%2012.1973%208.9314%2012.4382%208.9314H14.4792C15.2488%208.9314%2015.8711%208.30572%2015.8711%207.53951V2.10245C15.8711%201.3329%2015.2454%200.710568%2014.4792%200.710568H12.4382C12.1404%200.710568%2011.8627%200.804253%2011.6352%200.964854L10.8489%200.87117C10.7285%200.854441%208.58711%200.583425%206.38887%200.626922C5.99071%200.596808%205.61597%200.580078%205.268%200.580078C4.66909%200.580078%204.14713%200.626921%203.71216%200.720606C2.68832%200.938087%201.98904%201.37305%201.63437%202.01212C1.36336%202.50061%201.36336%202.98577%201.40685%203.29359C0.741022%203.89585%200.623918%204.56168%200.647339%205.0301C0.660722%205.30112%200.720947%205.53198%200.784519%205.70262ZM14.4792%201.61396C14.7502%201.61396%2014.9677%201.83478%2014.9677%202.10245V7.54286C14.9677%207.81387%2014.7469%208.03135%2014.4792%208.03135H12.4382C12.1672%208.03135%2011.9497%207.81053%2011.9497%207.54286V2.1058C11.9497%201.83478%2012.1706%201.6173%2012.4382%201.6173H14.4792V1.61396ZM1.64106%206.09409C1.78159%205.94687%201.80836%205.7227%201.70129%205.54871C1.70129%205.54536%201.56411%205.31115%201.54738%204.98995C1.52396%204.55164%201.73475%204.16352%202.1764%203.83227C2.33366%203.71182%202.39723%203.50438%202.33032%203.31701C2.33032%203.31366%202.18644%202.87201%202.42066%202.45377C2.64483%202.05227%203.14336%201.76452%203.89953%201.60392C4.50514%201.47343%205.32822%201.45001%206.33868%201.53031C6.35206%201.53031%206.36879%201.53031%206.38552%201.53031C8.53692%201.48347%2010.7117%201.76452%2010.7352%201.76787H10.7385L11.0764%201.80802C11.0564%201.9017%2011.0463%202.00208%2011.0463%202.10245V7.54286C11.0463%207.68673%2011.0698%207.82726%2011.1099%207.95774C11.0497%208.18192%2010.8824%208.68046%2010.4876%209.10538C8.98527%2010.2965%207.51643%2014.3149%207.45286%2014.4889C7.42609%2014.5592%207.4194%2014.6361%207.43278%2014.7131C7.48966%2015.0878%207.46959%2015.5462%207.38929%2015.6834C7.21196%2015.68%206.73349%2015.6298%206.44575%2015.2317C6.10447%2014.7599%206.11785%2013.9168%206.4859%2012.7992C7.04801%2011.0962%207.09485%2010.1995%206.64985%209.80467C6.42902%209.60726%206.13458%209.59723%205.92045%209.67418C5.71635%209.72102%205.52229%209.76117%205.33826%209.79129C5.32488%209.79463%205.30815%209.79798%205.29477%209.80132C4.26758%2010.0255%202.42735%2010.1627%201.78828%209.5805C1.24625%209.08531%201.63103%208.42951%201.67452%208.35925C1.79832%208.17188%201.76152%207.92763%201.59422%207.77707C1.59088%207.77372%201.23956%207.44248%201.22283%206.99748C1.20945%206.69969%201.34997%206.39522%201.64106%206.09409Z'%20fill='%23F34859'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2361_214893'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='matrix(-1%200%200%20-1%2016.0938%2016.5801)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Ws="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M22%2012.123C22%2017.6459%2017.5228%2022.123%2012%2022.123C6.47715%2022.123%202%2017.6459%202%2012.123C2%206.6002%206.47715%202.12305%2012%202.12305C17.5228%202.12305%2022%206.6002%2022%2012.123ZM16.0303%209.09272C16.3232%209.38561%2016.3232%209.86048%2016.0303%2010.1534L11.0303%2015.1534C10.7374%2015.4463%2010.2626%2015.4463%209.96967%2015.1534L7.96967%2013.1534C7.67678%2012.8605%207.67678%2012.3856%207.96967%2012.0927C8.26256%2011.7998%208.73744%2011.7998%209.03033%2012.0927L10.5%2013.5624L14.9697%209.09272C15.2626%208.79982%2015.7374%208.79982%2016.0303%209.09272Z'%20fill='%231AAF74'/%3e%3c/svg%3e",qs="data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.2904%2014.791C10.6355%2014.791%2010.9154%2014.5112%2010.9154%2014.166V9.16602C10.9154%208.82084%2010.6355%208.54102%2010.2904%208.54102C9.94519%208.54102%209.66537%208.82084%209.66537%209.16602V14.166C9.66537%2014.5112%209.94519%2014.791%2010.2904%2014.791Z'%20fill='%23858B93'/%3e%3cpath%20d='M10.2904%205.83268C10.7506%205.83268%2011.1237%206.20578%2011.1237%206.66602C11.1237%207.12625%2010.7506%207.49935%2010.2904%207.49935C9.83013%207.49935%209.45703%207.12625%209.45703%206.66602C9.45703%206.20578%209.83013%205.83268%2010.2904%205.83268Z'%20fill='%23858B93'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.33203%209.99935C1.33203%205.0518%205.34281%201.04102%2010.2904%201.04102C15.2379%201.04102%2019.2487%205.0518%2019.2487%209.99935C19.2487%2014.9469%2015.2379%2018.9577%2010.2904%2018.9577C5.34281%2018.9577%201.33203%2014.9469%201.33203%209.99935ZM10.2904%202.29102C6.03317%202.29102%202.58203%205.74215%202.58203%209.99935C2.58203%2014.2565%206.03317%2017.7077%2010.2904%2017.7077C14.5476%2017.7077%2017.9987%2014.2565%2017.9987%209.99935C17.9987%205.74215%2014.5476%202.29102%2010.2904%202.29102Z'%20fill='%23858B93'/%3e%3c/svg%3e",Zs="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.291%205.83301C17.291%206.17819%2017.0112%206.45801%2016.666%206.45801L3.33268%206.45801C2.9875%206.45801%202.70768%206.17819%202.70768%205.83301C2.70768%205.48783%202.9875%205.20801%203.33268%205.20801L16.666%205.20801C17.0112%205.20801%2017.291%205.48783%2017.291%205.83301Z'%20fill='%23858B93'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.291%2010C17.291%2010.3452%2017.0112%2010.625%2016.666%2010.625L3.33268%2010.625C2.9875%2010.625%202.70768%2010.3452%202.70768%2010C2.70768%209.65482%202.9875%209.375%203.33268%209.375L16.666%209.375C17.0112%209.375%2017.291%209.65482%2017.291%2010Z'%20fill='%23858B93'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.291%2014.167C17.291%2014.5122%2017.0112%2014.792%2016.666%2014.792L3.33268%2014.792C2.9875%2014.792%202.70768%2014.5122%202.70768%2014.167C2.70768%2013.8218%202.9875%2013.542%203.33268%2013.542L16.666%2013.542C17.0112%2013.542%2017.291%2013.8218%2017.291%2014.167Z'%20fill='%23858B93'/%3e%3c/svg%3e";var Ys=O("<div class=survey-message>"),Xs=O("<div style=margin-bottom:12px;text-align:left><div style=font-weight:500;font-size:14px>"),Qs=O("<div style=font-weight:400;font-size:12px;margin-top:4px>"),Gs=O("<div class=survey-message><div style=text-align:center;padding:24px>Biểu mẫu khảo sát"),Ks=O("<div class=survey-tooltip>"),Js=O("<button tabindex=-1 style=margin-left:8px;margin-top:6px><img alt=tooltip>"),ei=O("<div class=survey-message><div style=flex-direction:column;align-items:flex-start><div style=align-items:center;margin-bottom:8px><span style=font-weight:600;font-size:16px;text-align:left></span></div><div style=font-weight:400;font-size:12px;margin-bottom:16px></div></div><div style=justify-content:flex-end;margin-top:16px>"),ti=O("<div>"),ni=O("<span style=margin-right:4px>-"),si=O("<div class=survey-inputs>"),ii=O("<div style=margin-bottom:12px><div style=font-weight:500;margin-bottom:4px;text-align:left></div><input class=survey-input type=text>"),oi=O("<div class=survey-options>"),ri=O("<button type=button style=justify-content:space-between;align-items:center><span>"),ai=O("<img style=margin-right:10px>"),ci=O("<img style=margin-left:16px>"),li=O("<button class=survey-cancel-button>Hủy"),di=O("<button class=survey-submit-button>Gửi đáp án");const ui=t=>{var Z,K,E,S;const[e,n]=L(null),[s,i]=L(null),[o,r]=L(t.selectedIndexes||[]),[c,a]=L(Array((t.options||[]).length).fill("")),[d,u]=L(t.options||[]),[f,U]=L(!1),V=(E=(K=(Z=t.contents)==null?void 0:Z.find(C=>{var m;return(m=C.metadata)==null?void 0:m.description}))==null?void 0:K.metadata)==null?void 0:E.description,j=(S=t.multiSelect)!=null?S:!1,N=()=>{var C;return(C=t.isInputMode)!=null?C:!1},ee=()=>t.type||"choice";let H;const T=(C,m)=>{!t.isEditing&&t.canSubmit===!1||m.button===0&&t.isDragDrop&&(m.preventDefault(),n(C))},b=C=>{if(e()===null||!H)return;const m=H.getBoundingClientRect();if(!(C.clientX>=m.left&&C.clientX<=m.right&&C.clientY>=m.top&&C.clientY<=m.bottom))return;const I=H.querySelectorAll(".survey-option");for(let P=0;P<I.length;P++){const D=I[P].getBoundingClientRect();if(C.clientX>=D.left&&C.clientX<=D.right&&C.clientY>=D.top&&C.clientY<=D.bottom&&P!==e()){i(P);return}}},y=C=>{if(e()===null||!H)return;const m=H.getBoundingClientRect();if(C.clientX>=m.left&&C.clientX<=m.right&&C.clientY>=m.top&&C.clientY<=m.bottom&&s()!==null){const I=[...d()],P=I[e()];I[e()]=I[s()],I[s()]=P,u(I)}n(null),i(null)},q=C=>{!t.isEditing&&t.canSubmit===!1||t.isDragDrop||r(j?m=>m.includes(C)?m.filter(w=>w!==C):[...m,C]:m=>m.includes(C)?[]:[C])},h=(C,m)=>{a(w=>{const I=[...w];return I[C]=m,I})},F=()=>{if(t.onSubmit){const C=t.msgId||"";if(N()){const m=c().filter(w=>w.trim()!=="");t.onSubmit(m,"input",C)}else if(t.isDragDrop)t.onSubmit(d(),"ordered",C);else if(j){const m=d().filter((w,I)=>o().includes(I));t.onSubmit(m,"selected",C)}else{const m=d()[o()[0]];t.onSubmit([m],"selected",C)}}};return $t(()=>(document.addEventListener("mousemove",b),document.addEventListener("mouseup",y),()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",y)})),nt(()=>{u(t.options||[])}),nt(fs(()=>t.isEditing,C=>{C&&(r(t.selectedIndexes||[]),a(Array((t.options||[]).length).fill("").map((m,w)=>{var I;return t.fields&&((I=t.fields[w])==null?void 0:I.value)!==void 0?t.fields[w].value:""})),u(t.options||[]))})),ee()==="normal"?(()=>{var C=Ys();return k(C,ae(ut,{get each(){return t.contents||[]},children:m=>(()=>{var w=Xs(),I=w.firstChild;return l(I,"color","#1A1D1F"),k(I,()=>m.content),k(w,(()=>{var P=J(()=>{var _;return!!((_=m.metadata)!=null&&_.description)});return()=>P()&&(()=>{var _=Qs();return l(_,"color","#858B93"),k(_,()=>m.metadata.description),_})()})(),null),w})()})),C})():ee()==="form"?(()=>{var C=Gs(),m=C.firstChild;return l(m,"color","#858B93"),C})():(()=>{var C=ei(),m=C.firstChild,w=m.firstChild,I=w.firstChild,P=w.nextSibling,_=m.nextSibling;return l(m,"display","flex"),l(w,"display","flex"),l(I,"color","#1A1D1F"),k(I,(()=>{var D=J(()=>!!N());return()=>D()?"Nhập đáp án":t.question||"Chọn đáp án"})()),k(w,ae(Qe,{when:V,get children(){var D=Js(),Q=D.firstChild;return D.addEventListener("mouseleave",()=>U(!1)),D.addEventListener("mouseenter",()=>U(!0)),l(D,"background","none"),l(D,"border","none"),l(D,"cursor","pointer"),l(D,"position","relative"),ce(Q,"src",qs),l(Q,"width","20px"),l(Q,"height","20px"),k(D,ae(Qe,{get when(){return f()},get children(){var me=Ks();return k(me,ae(ut,{get each(){return(V||"Bạn có thể kéo thả để sắp xếp thứ tự đáp án ưu tiên A, B, C, D").split(/-\s*/).filter(ve=>ve.trim()!=="")},children:(ve,ue)=>(()=>{var oe=ti();return k(oe,(()=>{var ne=J(()=>ue()>0);return()=>ne()&&ni()})(),null),k(oe,()=>ve.trim(),null),oe})()})),me}}),null),D}}),null),l(P,"color","#858B93"),k(P,(()=>{var D=J(()=>!!N());return()=>D()?"Vui lòng nhập đầy đủ thông tin vào các trường bên dưới.":t.isDragDrop?"Bạn có thể kéo thả để sắp xếp thứ tự đáp án ưu tiên A, B, C, D":j?"Bạn có thể chọn nhiều đáp án hoặc nhập trực tiếp A, B, C, D theo thứ tự đáp án":"Bạn có thể chọn 1 đáp án hoặc nhập trực tiếp A, B, C, D"})()),k(C,(()=>{var D=J(()=>!!N());return()=>D()?(()=>{var Q=si();return k(Q,ae(ut,{get each(){return d()},children:(me,ve)=>(()=>{var ue=ii(),oe=ue.firstChild,ne=oe.nextSibling;return l(oe,"color","#1A1D1F"),k(oe,me),ne.$$input=M=>h(ve(),M.currentTarget.value),l(ne,"color","#1A1D1F"),fe(M=>{var G=t.placeholders?t.placeholders[ve()]:me,Ae=!t.isEditing&&t.canSubmit===!1;return G!==M.e&&ce(ne,"placeholder",M.e=G),Ae!==M.t&&(ne.disabled=M.t=Ae),M},{e:void 0,t:void 0}),fe(()=>ne.value=c()[ve()]),ue})()})),Q})():(()=>{var Q=oi(),me=H;return typeof me=="function"?Yt(me,Q):H=Q,k(Q,ae(ut,{get each(){return d()},children:(ve,ue)=>(()=>{var oe=ri(),ne=oe.firstChild;return oe.$$click=()=>q(ue()),oe.$$mousedown=M=>T(ue(),M),k(oe,(()=>{var M=J(()=>!!t.isDragDrop);return()=>M()&&(()=>{var G=ai();return ce(G,"src",Zs),l(G,"width","20px"),l(G,"height","20px"),G})()})(),ne),l(ne,"color","#1A1D1F"),k(ne,ve),k(oe,(()=>{var M=J(()=>!!(!t.isDragDrop&&o().includes(ue())));return()=>M()&&(()=>{var G=ci();return ce(G,"src",Ws),l(G,"width","20px"),l(G,"height","20px"),G})()})(),null),fe(M=>{var G=`survey-option${j?" multi-selected":""} ${e()===ue()?"dragging":""} ${s()===ue()?"hovered":""} ${!t.isDragDrop&&o().includes(ue())?"selected":""}`,Ae=z({display:"flex",width:j?"100%":"auto"},t.isDragDrop?{}:{cursor:"pointer"});return G!==M.e&&it(oe,M.e=G),M.t=pn(oe,Ae,M.t),M},{e:void 0,t:void 0}),oe})()})),Q})()})(),_),l(_,"display","flex"),k(_,(()=>{var D=J(()=>!!t.isEditing);return()=>D()&&(()=>{var Q=li();return Zt(Q,"click",t.onCancelEdit),Q})()})(),null),k(_,(()=>{var D=J(()=>!!(t.canSubmit||t.isEditing));return()=>D()&&(()=>{var Q=di();return Q.$$click=F,Q})()})(),null),C})()};yt(["input","mousedown","click"]);var hi=O("<div style=text-align:center;font-weight:600;user-select:none;white-space:pre-line>Hôm nay thị trường khiến bạn <br>quan tâm điều gì?"),fi=O("<div class=chat-messages-container style=scroll-behavior:auto>"),gi=O("<div style=margin-bottom:8px>"),pi=O("<div class=message-popup><button class=message-popup-button><img></button><button class=message-popup-button><img>"),Ci=O('<div style=border-radius:24px;font-weight:500;font-size:16px;max-width:70%;word-break:break-word;white-space:pre-line;text-align:left;cursor:pointer><form style=flex-direction:column;align-items:flex-end><textarea class=chat-message-edit-textarea placeholder="Nhập vào tin nhắn..."rows=3 autofocus></textarea><div style=margin-top:8px><button class=message-cancel-button type=button>Hủy</button><button class=message-edit-button type=submit>Lưu'),mi=O("<div style=border-radius:24px;font-weight:500;font-size:16px;max-width:70%;word-break:break-word;white-space:pre-line;text-align:left;cursor:pointer>"),vi=O("<div style=font-size:12px;margin-top:12px;user-select:none;font-weight:400>"),wi=O('<div class="chat-message bot"style=margin-left:24px><div>'),yi=O("<div style=flex-direction:column;align-items:flex-start;margin-bottom:8px><div><div style=border-radius:24px;font-weight:500;font-size:16px;max-width:70%;word-break:break-word;white-space:pre-line;text-align:left>"),bi=O("<div style=margin-left:16px><button class=feedback-button><img></button><button class=feedback-button><img>");function _i(t){let e;const[n,s]=L(null),[i,o]=L({}),[r,c]=L(null),[a,d]=L(null),[u,f]=L(null),[U,V]=L(null),[j,N]=L("");function ee(y){var F,Z;const q=t.messages[t.messages.length-1];return!((q.type==="survey"||q.type==="choice"||q.type==="form")&&!((Z=(F=t.submittedMessages)==null?void 0:F.has(q.id))!=null&&Z)&&q.id!==y)}const H=y=>{r()&&(clearTimeout(r()),c(null)),s(Number(y))},T=()=>{c(setTimeout(()=>s(null),300))},b=()=>{var y;return t.isFullScreen?t.messages.length>0?"100px":`${((y=t.inputHeight)!=null?y:0)+24}px`:(t.isMobile,t.messages.length>0?"10px":"0px")};return nt(()=>{if(!e)return;const y=()=>{a()&&clearTimeout(a()),d(setTimeout(()=>{var q;e.scrollTop===0&&((q=t.onLoadMoreMessages)==null||q.call(t)),d(null)},0))};e.addEventListener("scroll",y),un(()=>{e.removeEventListener("scroll",y),a()&&clearTimeout(a())})}),(()=>{var y=fi(),q=e;return typeof q=="function"?Yt(q,y):e=y,k(y,ae(Qe,{get when(){return J(()=>t.messages.length===0)()&&!t.isFullScreen},get children(){var h=hi();return l(h,"color","#1A1D1F"),fe(F=>l(h,"font-size",t.isMobile?"20px":"24px")),h}}),null),k(y,ae(ut,{get each(){return t.messages},children:(h,F)=>{const Z=F()===t.messages.length-1;return h.type==="normal"&&Array.isArray(h.contents)?ae(ut,{get each(){return h.contents},children:K=>(()=>{var E=gi();return E.addEventListener("mouseleave",()=>h.sender==="user"&&V(null)),E.addEventListener("mouseenter",()=>h.sender==="user"&&V(h.id)),E.$$click=()=>f(u()===h.id?null:h.id),l(E,"display","flex"),l(E,"position","relative"),k(E,(()=>{var S=J(()=>h.sender==="user"&&U()===h.id);return()=>S()&&(()=>{var C=pi(),m=C.firstChild,w=m.firstChild,I=m.nextSibling,P=I.firstChild;return m.addEventListener("mouseleave",_=>_.currentTarget.style.background="none"),m.addEventListener("mouseenter",_=>_.currentTarget.style.background="#f0f0f0"),m.$$click=_=>{var me,ve,ue,oe;_.stopPropagation();const D=F(),Q=t.messages[D-1];if(!ee(h.id)){alert("Hoàn thành câu hỏi theo mẫu trước khi chỉnh sửa");return}h.type==="normal"&&(Q&&Q.sender==="bot"&&Q.type==="normal"?(N(""),(me=t.setEditingMsgIdUser)==null||me.call(t,h.id),(ve=t.setEditingMsgIdBot)==null||ve.call(t,null)):Q&&Q.sender==="bot"&&(Q.type==="survey"||Q.type==="choice"||Q.type==="form")&&((ue=t.setEditingMsgIdBot)==null||ue.call(t,Q.id),(oe=t.setEditingMsgIdUser)==null||oe.call(t,h.id),N("")))},ce(w,"src",Hn),l(w,"width","16px"),l(w,"height","16px"),I.addEventListener("mouseleave",_=>_.currentTarget.style.background="none"),I.addEventListener("mouseenter",_=>_.currentTarget.style.background="#f0f0f0"),I.$$click=_=>{_.stopPropagation(),console.log("Delete message:",h.id)},ce(P,"src",Ln),l(P,"width","16px"),l(P,"height","16px"),C})()})(),null),k(E,(()=>{var S=J(()=>h.sender==="user"&&h.type==="normal"&&t.editingMsgIdUser===h.id&&!t.editingMsgIdBot);return()=>S()?(()=>{var C=Ci(),m=C.firstChild,w=m.firstChild,I=w.nextSibling,P=I.firstChild;return l(C,"background","#1AAF741A"),l(C,"color","#000"),l(C,"padding","10px 16px"),m.addEventListener("submit",_=>{var D,Q;_.preventDefault(),j().trim()&&((D=t.onUpdateSurvey)==null||D.call(t,[j()],"input",h.id),(Q=t.setEditingMsgIdUser)==null||Q.call(t,null))}),l(m,"width","100%"),l(m,"display","flex"),w.$$input=_=>N(_.currentTarget.value),l(I,"display","flex"),l(I,"gap","4px"),P.$$click=()=>{var _;return(_=t.setEditingMsgIdUser)==null?void 0:_.call(t,null)},fe(()=>w.value=j()),C})():(()=>{var C=mi();return l(C,"color","#000"),l(C,"padding","10px 16px"),k(C,()=>K.content,null),k(C,(()=>{var m=J(()=>!!(h.sender==="user"&&h.sentAt&&u()===h.id));return()=>m()&&(()=>{var w=vi();return l(w,"color","#858B93"),k(w,()=>new Date(h.sentAt).toLocaleString("vi-VN",{hour:"2-digit",minute:"2-digit"})),w})()})(),null),fe(m=>l(C,"background",h.sender==="user"?"#1AAF741A":"#fff")),C})()})(),null),fe(S=>{var C=`chat-message ${h.sender}`,m=h.id,w=h.sender==="bot"?"24px":"0px",I=h.sender==="user"?"24px":"0px",P=h.sender==="user"?"flex-end":"flex-start";return C!==S.e&&it(E,S.e=C),m!==S.t&&ce(E,"data-message-id",S.t=m),w!==S.a&&l(E,"margin-left",S.a=w),I!==S.o&&l(E,"margin-right",S.o=I),P!==S.i&&l(E,"justify-content",S.i=P),S},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),E})()}):h.type==="survey"||h.type==="choice"||h.type==="form"?(()=>{var K=wi(),E=K.firstChild;return k(E,ae(ui,{get msgId(){return h.id},get question(){return h.question},get options(){return h.options},get selectedIndexes(){return h.selectedIndexes},get fields(){return h.fields},get contents(){return h.contents},get multiSelect(){var S;return J(()=>h.multiSelect!==void 0)()?h.multiSelect:(S=t.surveyOptions)==null?void 0:S.multiSelect},get isInputMode(){var S;return J(()=>h.isInputMode!==void 0)()?h.isInputMode:(S=t.surveyOptions)==null?void 0:S.isInputMode},get isFormType(){return h.isFormType},get isNormalType(){return h.isNormalType},get isDragDrop(){return h.isDragDrop},get isEditing(){return t.editingMsgIdBot===h.id},onCancelEdit:()=>{var S,C;(S=t.setEditingMsgIdBot)==null||S.call(t,null),(C=t.setEditingMsgIdUser)==null||C.call(t,null)},onSubmit:(S,C,m)=>{var w,I,P,_;t.editingMsgIdUser?((w=t.onUpdateSurvey)==null||w.call(t,S,C,t.editingMsgIdUser),(I=t.setEditingMsgIdBot)==null||I.call(t,null),(P=t.setEditingMsgIdUser)==null||P.call(t,null)):(_=t.onSubmit)==null||_.call(t,S,C,m)},get canSubmit(){var S;return Z&&(!((S=t.submittedMessages)!=null&&S.has(h.id))||t.editingMsgIdBot===h.id)},get placeholders(){return h.placeholders}})),fe(()=>ce(K,"data-message-id",h.id)),K})():(()=>{var K=yi(),E=K.firstChild,S=E.firstChild;return l(K,"display","flex"),E.addEventListener("mouseleave",()=>T()),E.addEventListener("mouseenter",()=>h.sender==="bot"&&H(h.id)),l(E,"position","relative"),l(E,"width","100%"),l(S,"color","#000"),l(S,"padding","10px 16px"),k(S,()=>h.text),k(K,(()=>{var C=J(()=>h.sender==="bot");return()=>C()&&(()=>{var m=bi(),w=m.firstChild,I=w.firstChild,P=w.nextSibling,_=P.firstChild;return m.addEventListener("mouseleave",()=>T()),m.addEventListener("mouseenter",()=>H(h.id)),l(m,"display","flex"),l(m,"gap","8px"),l(m,"height","16px"),l(m,"transition","opacity 0.2s"),w.$$click=()=>o(D=>ie(z({},D),{[h.id]:"like"})),P.$$click=()=>o(D=>ie(z({},D),{[h.id]:"dislike"})),fe(D=>{var Q=n()===Number(h.id)?1:0,me=n()===Number(h.id)?"visible":"hidden",ve=n()===Number(h.id)?"auto":"none",ue=i()[Number(h.id)]==="like"?zs:Us,oe=i()[Number(h.id)]==="dislike"?Vs:js;return Q!==D.e&&l(m,"opacity",D.e=Q),me!==D.t&&l(m,"visibility",D.t=me),ve!==D.a&&l(m,"pointer-events",D.a=ve),ue!==D.o&&ce(I,"src",D.o=ue),oe!==D.i&&ce(_,"src",D.i=oe),D},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),m})()})(),null),fe(C=>{var m=h.id,w=`chat-message ${h.sender}`,I=h.id,P=h.sender==="user"?"#1AAF741A":"#fff";return m!==C.e&&ce(K,"data-message-id",C.e=m),w!==C.t&&it(E,C.t=w),I!==C.a&&ce(E,"data-message-id",C.a=I),P!==C.o&&l(S,"background",C.o=P),C},{e:void 0,t:void 0,a:void 0,o:void 0}),K})()}}),null),fe(h=>{var F=t.messages.length===0?"center":"flex-start",Z=b(),K=t.isLoadingMessages?"hidden":"visible";return F!==h.e&&l(y,"justify-content",h.e=F),Z!==h.t&&l(y,"padding-bottom",h.t=Z),K!==h.a&&l(y,"visibility",h.a=K),h},{e:void 0,t:void 0,a:void 0}),y})()}yt(["click","input"]);var Si=O('<div class=chat-input-container><div style=min-width:0><img><textarea placeholder="Hỏi bất kỳ điều gì..."class=chat-input-field rows=1 style=padding-left:56px></textarea><div><img style=margin-top:4px><img>');function On(t){let e;const[s,i]=L(!1);function o(){var u,f;if(!e)return;if(e.style.height="auto",!t.input.trim()){e.style.height="48px",e.style.overflowY="hidden",i(!1),(u=t.onHeightChange)==null||u.call(t,48);return}const a=e.scrollHeight,d=Math.min(a,120);e.style.height=d+"px",e.style.overflowY=a>120?"auto":"hidden",i(a>120),(f=t.onHeightChange)==null||f.call(t,d)}nt(()=>{e&&o()});const r=a=>{t.setInput(a.currentTarget.value),o()},c=a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),t.sendMessage(),setTimeout(()=>{e&&o()},0))};return(()=>{var a=Si(),d=a.firstChild,u=d.firstChild,f=u.nextSibling,U=f.nextSibling,V=U.firstChild,j=V.nextSibling;return l(d,"position","relative"),l(d,"flex","1"),ce(u,"src",Rs),l(u,"position","absolute"),l(u,"left","18px"),l(u,"top","50%"),l(u,"transform","translateY(-60%)"),l(u,"width","20px"),l(u,"height","20px"),l(u,"cursor","pointer"),f.addEventListener("keypress",c),f.$$input=r,Yt(N=>e=N,f),l(f,"color","#1A1D1F"),l(f,"resize","none"),l(f,"width","100%"),l(f,"max-height","120px"),l(f,"overflow","hidden"),l(U,"position","absolute"),l(U,"right","16px"),l(U,"top","50%"),l(U,"transform","translateY(-55%)"),l(U,"display","flex"),l(U,"gap","12px"),Zt(V,"click",t.sendMessage),ce(V,"src",Fs),l(V,"width","24px"),l(V,"height","24px"),l(V,"cursor","pointer"),Zt(j,"click",t.sendMessage),l(j,"width","32px"),l(j,"height","32px"),l(j,"cursor","pointer"),fe(N=>{var ee=!!s(),H=t.disabled,T=t.input.trim()?Ns:$s;return ee!==N.e&&a.classList.toggle("is-maxed",N.e=ee),H!==N.t&&(f.disabled=N.t=H),T!==N.a&&ce(j,"src",N.a=T),N},{e:void 0,t:void 0,a:void 0}),fe(()=>f.value=t.input),a})()}yt(["input","click"]);var Ai=O("<div class=sidebar-conversation-list style=overflow-y:auto>"),xi=O('<div><div class=sidebar-header><img style=margin-right:4px><span style=user-select:none>Ez</span><span style=margin-left:4px;user-select:none>Advise</span></div><div class=sidebar-section tabindex=0><img class=sidebar-section-icon><span class=sidebar-section-title>Chân dung nhà đầu tư</span></div><div class="sidebar-section sidebar-section--no-padding"tabindex=0><img class=sidebar-section-icon><span class=sidebar-section-title>Định hướng đầu tư</span></div><div class=sidebar-conversation-row><span style=font-weight:400;font-size:14px;user-select:none>Hội thoại</span><div class=sidebar-conversation-action tabindex=0><span style=font-weight:400;font-size:14px;user-select:none>Hội thoại mới</span><img style=margin-left:8px></div></div><div class=sidebar-search-box><img style=margin-right:8px><input type=text placeholder="Tìm kiếm hội thoại"></div><div></div><div style=margin-top:15px>'),Ii=O("<div>"),ki=O("<img style=margin-right:16px>"),Mi=O("<div class=sidebar-header-actions><button><img></button><button><img>"),Ei=O('<div class=sidebar-no-results style=text-align:center><img src=data:image/webp;base64,... alt="no results"><div style=font-size:14px;margin-top:8px>Không tìm thấy cuộc hội thoại nào!'),Ti=O("<div class=sidebar-menu-row>"),Ri=O("<input class=sider-bar-input autofocus>"),$i=O("<span style=font-weight:500;font-size:15px;user-select:none>"),Pi=O("<img class=sidebar-menu-dot style=margin-left:8px>"),Di=O("<div class=sidebar-popover><div class=sidebar-popover-item><img>Đổi tên</div><div class=sidebar-popover-item><img>Xóa");function Fn(t){const[e]=L(!1),[n,s]=L(null),[i,o]=L([]),[r,c]=L(""),[a,d]=L(null),[u,f]=L("");let U,V={};function j(b){return b.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/đ/g,"d").replace(/Đ/g,"d")}function N(){d(null),t.onClose()}function ee(){return v(this,null,function*(){if(t.remoteRepo)try{const b=yield t.remoteRepo.listConversationAsync(10);o(b||[])}catch(b){console.error("Sidebar listConversationAsync error:",b)}})}$t(ee),t.onReloadConversations&&t.onReloadConversations(ee);const H=st(()=>{const b=j(r());let y=i();return b&&(y=y.filter(q=>j(q.name||"").includes(b))),y.sort((q,h)=>{const F=q.id&&q.id.endsWith("~SURVEY"),Z=h.id&&h.id.endsWith("~SURVEY");return F&&!Z?-1:!F&&Z?1:0}),y}),T=()=>t.isMobile?"calc(90vh - 320px)":t.fullScreen?"calc(90vh - 330px)":"calc(400px - 220px)";return $t(()=>{const b=y=>{var q;e(),n()&&V[n()]&&!((q=V[n()])!=null&&q.contains(y.target))&&s(null)};document.addEventListener("mousedown",b),un(()=>{document.removeEventListener("mousedown",b)})}),$t(()=>v(null,null,function*(){if(t.remoteRepo)try{const b=yield t.remoteRepo.listConversationAsync(10);o(b||[])}catch(b){console.error("Sidebar listConversationAsync error:",b)}})),[J(()=>J(()=>!t.fullScreen)()&&(()=>{var b=Ii();return b.$$click=N,fe(()=>it(b,`sidebar-overlay${t.open?" sidebar-overlay--open":""}`)),b})()),(()=>{var b=xi(),y=b.firstChild,q=y.firstChild,h=q.nextSibling,F=h.nextSibling,Z=y.nextSibling,K=Z.firstChild,E=K.nextSibling,S=Z.nextSibling,C=S.firstChild,m=C.nextSibling,w=S.nextSibling,I=w.firstChild,P=I.nextSibling,_=P.firstChild,D=_.nextSibling,Q=w.nextSibling,me=Q.firstChild,ve=me.nextSibling,ue=Q.nextSibling,oe=ue.nextSibling;return k(y,(()=>{var ne=J(()=>!t.fullScreen);return()=>ne()&&(()=>{var M=ki();return M.$$click=N,ce(M,"src",Ps),l(M,"width","28px"),l(M,"height","28px"),l(M,"cursor","pointer"),M})()})(),q),ce(q,"src",mn),l(q,"width","32px"),l(q,"height","32px"),l(h,"color","#1A1D1F"),l(F,"color","#1AAF74"),k(y,(()=>{var ne=J(()=>!!t.fullScreen);return()=>ne()&&(()=>{var M=Mi(),G=M.firstChild,Ae=G.firstChild,re=G.nextSibling,we=re.firstChild;return G.$$click=()=>{var Ve;(Ve=t.onShrink)==null||Ve.call(t)},l(G,"background","none"),l(G,"border","none"),l(G,"cursor","pointer"),l(G,"padding","0"),ce(Ae,"src",Ts),l(Ae,"width","20px"),l(Ae,"height","20px"),re.$$click=N,l(re,"background","none"),l(re,"border","none"),l(re,"cursor","pointer"),l(re,"padding","0"),ce(we,"src",Bn),l(we,"width","20px"),l(we,"height","20px"),M})()})(),null),ce(K,"src",Ds),l(E,"color","#1A1D1F"),ce(C,"src",Bs),l(m,"color","#1A1D1F"),l(I,"color","#858B93"),P.$$click=()=>{t.onNewConversation&&t.onNewConversation(),t.fullScreen||N()},l(_,"color","#858B93"),ce(D,"src",Hs),l(D,"width","20px"),l(D,"height","20px"),ce(me,"src",Ls),l(me,"width","18px"),l(me,"height","18px"),l(me,"opacity","0.7"),ve.addEventListener("change",ne=>c(ne.currentTarget.value)),ve.$$input=ne=>c(ne.currentTarget.value),l(ve,"color","#1A1D1F"),k(oe,ae(Qe,{get when(){return H().length>0},get fallback(){return J(()=>i().length>0)()?(()=>{var ne=Ei(),M=ne.firstChild,G=M.nextSibling;return l(ne,"padding","32px 0"),l(M,"width","80px"),l(M,"height","80px"),l(M,"margin","0 auto 12px"),l(G,"color","#888"),ne})():null},get children(){var ne=Ai();return k(ne,ae(ut,{get each(){return H()},children:M=>(()=>{var G=Ti();return G.$$click=()=>{var Ae;(Ae=t.onLoadMessages)==null||Ae.call(t,M.id,M.name),t.fullScreen||N()},l(G,"cursor","pointer"),l(G,"position","relative"),k(G,(()=>{var Ae=J(()=>a()===M.id);return()=>Ae()?(()=>{var re=Ri();return re.$$click=we=>we.stopPropagation(),re.addEventListener("blur",()=>{d(null)}),re.$$keydown=we=>v(null,null,function*(){var Ve;if(we.key==="Enter"){if(!u().trim()){console.log("Tên không được để trống");return}try{yield(Ve=t.remoteRepo)==null?void 0:Ve.updateConversationNameAsync(M.id,u().trim()),d(null),ee()}catch(Ke){console.log("Error while rename: ",Ke)}}we.key==="Escape"&&d(null)}),re.$$input=we=>f(we.currentTarget.value),l(re,"color","#1A1D1F"),fe(()=>re.value=u()),re})():[(()=>{var re=$i();return k(re,()=>M.name),re})(),J(()=>J(()=>!(M.id&&M.id.endsWith("~SURVEY")))()&&(()=>{var re=Pi();return re.$$mousedown=we=>we.stopPropagation(),re.$$click=we=>{we.stopPropagation(),s(n()===M.id?null:M.id)},ce(re,"src",Os),l(re,"width","24px"),l(re,"height","24px"),re})()),J(()=>J(()=>n()===M.id)()&&(()=>{var re=Di(),we=re.firstChild,Ve=we.firstChild,Ke=we.nextSibling,ct=Ke.firstChild;return Yt(g=>V[M.id]=g,re),we.$$click=g=>{g.stopPropagation(),s(null),d(M.id),f(M.name)},ce(Ve,"src",Hn),l(Ve,"width","18px"),l(Ve,"height","18px"),l(Ve,"color","#1A1D1F"),Ke.$$click=g=>{var x;g.stopPropagation(),s(null),(x=t.onDeleteConversation)==null||x.call(t,M)},ce(ct,"src",Ln),l(ct,"width","18px"),l(ct,"height","18px"),l(ct,"color","#1A1D1F"),re})())]})()),G})()})),fe(M=>{var G=T(),Ae=T();return G!==M.e&&l(ne,"min-height",M.e=G),Ae!==M.t&&l(ne,"max-height",M.t=Ae),M},{e:void 0,t:void 0}),ne}})),fe(ne=>{var M=`sidebar${t.open?" sidebar--open":""}${t.fullScreen?" sidebar--fullscreen":""}${t.isMobile?" sidebar--mobile":""}`,G=t.isMobile?{width:"280px",height:"100%"}:{};return M!==ne.e&&it(b,ne.e=M),ne.t=pn(b,G,ne.t),ne},{e:void 0,t:void 0}),fe(()=>ve.value=r()),b})()]}yt(["click","input","keydown","mousedown"]);var Bi=O("<button class=chat-action-btn>");function Qt(t){return(()=>{var e=Bi();return Zt(e,"click",t.onClick),k(e,()=>t.text),e})()}yt(["click"]);var Hi=O("<div class=header-steps-container>"),Li=O("<div class=header-steps><div class=header-steps-title>"),Oi=O(`<div class=header-step-wrapper style=position:relative;display:flex><div><div><svg viewBox="0 0 28 6"width=28 height=6><path d="M0 3 Q 7 0 14 3 Q 21 6 28 3 V6 H0 Z"fill=#1AAF74><animate attributeName=d values="\r
|
|
3
3
|
M0 3 Q 7 0 14 3 Q 21 6 28 3 V6 H0 Z;\r
|
|
4
4
|
M0 3 Q 7 6 14 3 Q 21 0 28 3 V6 H0 Z;\r
|
|
5
5
|
M0 3 Q 7 0 14 3 Q 21 6 28 3 V6 H0 Z\r
|
|
6
|
-
"dur=0.5s repeatCount=indefinite></animate></path></svg></div><span style=user-select:none>`),Fi=O("<div class=header-step-tooltip>"),Ni=O("<span>: <!>%"),Ui=O("<div class=header-step-line>");const ji=t=>{const e=()=>t.currentStep||0,n=()=>t.totalSteps||0,[s,i]=L(null),o=()=>t.title;return(()=>{var r=Li(),c=r.firstChild;return k(c,o),k(r,ae(Qe,{get when(){return t.isSurveyConversation},get children(){var a=Hi();return k(a,()=>Array.from({length:n()},(d,u)=>{var V,U,F,J;const f=(U=(V=t.sections)==null?void 0:V[u])==null?void 0:U.id,N=f&&(J=(F=t.progress)==null?void 0:F[f])!=null?J:0;return[(()=>{var H=Oi(),E=H.firstChild,b=E.firstChild,y=b.firstChild,q=b.nextSibling;return E.addEventListener("mouseleave",()=>i(null)),E.addEventListener("mouseenter",()=>i(u)),l(E,"position","relative"),l(E,"overflow","hidden"),l(b,"position","absolute"),l(b,"left","0"),l(b,"bottom","0"),l(b,"width","100%"),l(b,"height",`${N}%`),l(b,"background","#1AAF74"),l(b,"transition","height 0.3s"),l(q,"position","relative"),l(q,"color",N>=70?"white":void 0),k(q,u+1),k(H,(()=>{var h=te(()=>{var z,Z;return!!(s()===u&&((Z=(z=t.sections)==null?void 0:z[u])!=null&&Z.title))});return()=>h()&&(()=>{var z=Fi();return k(z,()=>t.sections[u].title,null),k(z,(()=>{var Z=te(()=>!!(t.progress&&t.sections[u].id&&t.progress[t.sections[u].id]!=null));return()=>Z()&&(()=>{var K=Ni(),M=K.firstChild,S=M.nextSibling;return S.nextSibling,k(K,()=>t.progress[t.sections[u].id],S),fe(C=>{var m=t.progress[t.sections[u].id]===100?"#1AAF74":void 0,w=t.progress[t.sections[u].id]===100?"600":void 0;return m!==C.e&&l(K,"color",C.e=m),w!==C.t&&l(K,"font-weight",C.t=w),C},{e:void 0,t:void 0}),K})()})(),null),z})()})(),null),fe(h=>{var z=`header-step ${u+1===e()?"current":""} ${N===100?"active":""} ${s()===u?"wave":""}`,Z=`header-step-progress${s()===u&&N<100?" wave-animate":""}`,K=s()===u&&N<100?"wave-svg active":"wave-svg";return z!==h.e&&it(E,h.e=z),Z!==h.t&&it(b,h.t=Z),K!==h.a&&ce(y,"class",h.a=K),h},{e:void 0,t:void 0,a:void 0}),H})(),te(()=>te(()=>u<n()-1)()&&Ui())]})),a}}),null),r})()},Gt=Symbol("store-raw"),_t=Symbol("store-node"),ot=Symbol("store-has"),Nn=Symbol("store-self");function Un(t){let e=t[et];if(!e&&(Object.defineProperty(t,et,{value:e=new Proxy(t,Wi)}),!Array.isArray(t))){const n=Object.keys(t),s=Object.getOwnPropertyDescriptors(t);for(let i=0,o=n.length;i<o;i++){const r=n[i];s[r].get&&Object.defineProperty(t,r,{enumerable:s[r].enumerable,get:s[r].get.bind(e)})}}return e}function St(t){let e;return t!=null&&typeof t=="object"&&(t[et]||!(e=Object.getPrototypeOf(t))||e===Object.prototype||Array.isArray(t))}function At(t,e=new Set){let n,s,i,o;if(n=t!=null&&t[Gt])return n;if(!St(t)||e.has(t))return t;if(Array.isArray(t)){Object.isFrozen(t)?t=t.slice(0):e.add(t);for(let r=0,c=t.length;r<c;r++)i=t[r],(s=At(i,e))!==i&&(t[r]=s)}else{Object.isFrozen(t)?t=Object.assign({},t):e.add(t);const r=Object.keys(t),c=Object.getOwnPropertyDescriptors(t);for(let a=0,d=r.length;a<d;a++)o=r[a],!c[o].get&&(i=t[o],(s=At(i,e))!==i&&(t[o]=s))}return t}function Kt(t,e){let n=t[e];return n||Object.defineProperty(t,e,{value:n=Object.create(null)}),n}function Bt(t,e,n){if(t[e])return t[e];const[s,i]=L(n,{equals:!1,internal:!0});return s.$=i,t[e]=s}function zi(t,e){const n=Reflect.getOwnPropertyDescriptor(t,e);return!n||n.get||!n.configurable||e===et||e===_t||(delete n.value,delete n.writable,n.get=()=>t[et][e]),n}function jn(t){hn()&&Bt(Kt(t,_t),Nn)()}function Vi(t){return jn(t),Reflect.ownKeys(t)}const Wi={get(t,e,n){if(e===Gt)return t;if(e===et)return n;if(e===Ct)return jn(t),n;const s=Kt(t,_t),i=s[e];let o=i?i():t[e];if(e===_t||e===ot||e==="__proto__")return o;if(!i){const r=Object.getOwnPropertyDescriptor(t,e);hn()&&(typeof o!="function"||t.hasOwnProperty(e))&&!(r&&r.get)&&(o=Bt(s,e,o)())}return St(o)?Un(o):o},has(t,e){return e===Gt||e===et||e===Ct||e===_t||e===ot||e==="__proto__"?!0:(hn()&&Bt(Kt(t,ot),e)(),e in t)},set(){return!0},deleteProperty(){return!0},ownKeys:Vi,getOwnPropertyDescriptor:zi};function xt(t,e,n,s=!1){if(!s&&t[e]===n)return;const i=t[e],o=t.length;n===void 0?(delete t[e],t[ot]&&t[ot][e]&&i!==void 0&&t[ot][e].$()):(t[e]=n,t[ot]&&t[ot][e]&&i===void 0&&t[ot][e].$());let r=Kt(t,_t),c;if((c=Bt(r,e,i))&&c.$(()=>n),Array.isArray(t)&&t.length!==o){for(let a=t.length;a<o;a++)(c=r[a])&&c.$();(c=Bt(r,"length",o))&&c.$(t.length)}(c=r[Nn])&&c.$()}function zn(t,e){const n=Object.keys(e);for(let s=0;s<n.length;s+=1){const i=n[s];xt(t,i,e[i])}}function qi(t,e){if(typeof e=="function"&&(e=e(t)),e=At(e),Array.isArray(e)){if(t===e)return;let n=0,s=e.length;for(;n<s;n++){const i=e[n];t[n]!==i&&xt(t,n,i)}xt(t,"length",s)}else zn(t,e)}function Ht(t,e,n=[]){let s,i=t;if(e.length>1){s=e.shift();const r=typeof s,c=Array.isArray(t);if(Array.isArray(s)){for(let a=0;a<s.length;a++)Ht(t,[s[a]].concat(e),n);return}else if(c&&r==="function"){for(let a=0;a<t.length;a++)s(t[a],a)&&Ht(t,[a].concat(e),n);return}else if(c&&r==="object"){const{from:a=0,to:d=t.length-1,by:u=1}=s;for(let f=a;f<=d;f+=u)Ht(t,[f].concat(e),n);return}else if(e.length>1){Ht(t[s],e,[s].concat(n));return}i=t[s],n=[s].concat(n)}let o=e[0];typeof o=="function"&&(o=o(i,n),o===i)||s===void 0&&o==null||(o=At(o),s===void 0||St(i)&&St(o)&&!Array.isArray(o)?zn(i,o):xt(t,s,o))}function Vn(...[t,e]){const n=At(t||{}),s=Array.isArray(n),i=Un(n);function o(...r){hs(()=>{s&&r.length===1?qi(n,r[0]):Ht(n,r)})}return[i,o]}const Jt=new WeakMap,Wn={get(t,e){if(e===Gt)return t;const n=t[e];let s;return St(n)?Jt.get(n)||(Jt.set(n,s=new Proxy(n,Wn)),s):n},set(t,e,n){return xt(t,e,At(n)),!0},deleteProperty(t,e){return xt(t,e,void 0,!0),!0}};function $e(t){return e=>{if(St(e)){let n;(n=Jt.get(e))||Jt.set(e,n=new Proxy(e,Wn)),t(n)}return e}}const Zi=30,Yi="me~SURVEY";function Lt(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}const qn=gs(),Xi=t=>{const[e,n]=L(!1),[s,i]=L(!1),[o,r]=L(!1),[c,a]=L(!1),[d,u]=L(),[f,N]=L(),[V,U]=Vn([]),[F,J]=L(),[H,E]=Vn([]),[b,y]=L(),[q,h]=L(),[z,Z]=L({}),[K,M]=L(),[S,C]=L(),m=new Map,w=t.remoteRepository;t.exportMethods.appendConversation=g=>{if(!g.traceId)U($e(x=>{x.unshift(g)}));else{const x=d();x&&x.id===g.traceId&&(Z({hasNewer:!1,hasOlder:!1}),u(g)),U($e($=>{let A=$.findIndex(B=>B.id===g.traceId);A>=0?($[A].id=g.id,$[A].creating=!1):(A=$.findIndex(B=>B.id===g.id),A<0&&$.unshift(g))}))}},t.exportMethods.appendMessage=g=>{const x=d();if(x&&x.id==g.conversationId){g.traceId?E($e(B=>{let ye=B.findIndex(Ee=>Ee.id===g.traceId);ye>=0?(B[ye].id=g.id,B[ye].mentions=g.mentions,B[ye].sending=!1):(ye=B.findIndex(Ee=>Ee.id===g.id),ye<0&&B.push(g))})):E($e(B=>{B.push(g)}));const A=b();(!A||A&&A.messageId!=g.id)&&y({messageId:g.id,highlight:!1})}const $=V.findIndex(A=>A.id===g.conversationId);$>=0?U($e(A=>{const B=A[$];B.updatedAt=g.sentAt,B.lastMessage=g,A.splice($,1),A.unshift(B)})):w.getConversationAsync(g.conversationId).then(A=>{A&&U($e(B=>{A.updatedAt=g.sentAt||new Date,A.lastMessage=g,B.unshift(A)}))}),N(g)},t.exportMethods.updateMessage=g=>{var x;E($e($=>{const A=$.findIndex(B=>B.id===g.id);if(A>=0){const B=$[A];g.sentAt=B.sentAt,$[A]=g}})),U($e($=>{const A=$.findIndex(B=>B.id===g.conversationId);if(A>=0){const B=$[A];B.updatedAt=g.sentAt,B.lastMessage&&B.lastMessage.id===g.id&&(B.lastMessage=g)}})),((x=f())==null?void 0:x.id)==g.id&&N(g)},t.exportMethods.deleteMessage=g=>{E($e(x=>{const $=x.findIndex(A=>A.id===g.id);$>=0&&(x[$].deleted=!0,x[$].body=void 0)})),U($e(x=>{const $=x.findIndex(A=>A.id===g.conversationId);if($>=0){const A=x[$];A.lastMessage&&A.lastMessage.id===g.id&&(A.lastMessage=oe(j({},A.lastMessage),{deleted:!0,body:void 0}))}}))};function I(g,x){const $=m.get(g);$&&$(x?!1:x===!1?!0:A=>!A)}function P(g,x){const $=`cp-loader-${g}`;I($,x)}function _(g,x){const $=`cp-loader-${g}`;m.set($,x)}function D(g,x){if(!F())return;const A=`cp-drawer-${g}`;I(A,x)}function Q(g,x){const $=`cp-drawer-${g}`;m.set($,x)}t.exportMethods.deleteConversation=ve,t.exportMethods.updateConversationName=me;function me(g,x){U($e(A=>{const B=A.findIndex(ye=>ye.id===g);B>=0&&(A[B].name=x)}));const $=d();$&&$.id===g&&u(oe(j({},$),{name:x}))}function ve(g){var x;((x=d())==null?void 0:x.id)===g&&ue(void 0),U($e($=>{const A=$.findIndex(B=>B.id===g);A>=0&&$.splice(A,1)}))}function ue(g,x){E([]);let $;if(typeof g=="string"){const A=V.findIndex(B=>B.id===g);A>=0?$=V[A]:w.getConversationAsync(g).then(B=>{B?(Z(x?{hasNewer:!1,hasOlder:!1}:ye=>oe(j({},ye),{hasOlder:!0})),u(j({},B)),C(B.name)):u(void 0)})}else $=g;$?(Z(x?{hasNewer:!1,hasOlder:!1}:A=>oe(j({},A),{hasOlder:!0})),u(j({},$)),C($.name)):u(void 0)}function re(g,x){return v(this,null,function*(){const $=yield w.listConversationAsync(g,x);return U($),V})}function ne(g,x){return v(this,null,function*(){return U($e($=>{const A=$.findIndex(B=>B.id===g);if(A>=0){const B=$[A];B.isPinned=x,$.splice(A,1),$.unshift(B)}})),yield w.pinConversationAsync(g,x),!0})}function T(g,x){return v(this,null,function*(){return g.id?(g.traceId=g.id,g.creating=!0,U($e($=>{$.unshift(g)})),ue(g,!0),x&&x(),w.createConversationAsync(g)):(ue(g,!0),g)})}function G(g,x){return v(this,null,function*(){return me(g,x),yield w.updateConversationNameAsync(g,x),!0})}function Ae(g){return v(this,null,function*(){return ve(g),yield w.deleteConversationAsync(g),!0})}function se(g,x,$){return v(this,null,function*(){var ge,ee;const A=d(),B=A==null?void 0:A.id,ye=B||(A==null?void 0:A.id);if(!ye||!B)return H;g?(g=g.toUpperCase(),g!="BEFORE"&&g!="AFTER"&&(g="BEFORE")):g="BEFORE";const Ee=$||Zi;if(!g){const ke=yield w.listMessagesAsync(ye,void 0,void 0,Ee);return E($e(Ne=>{Ne.splice(0,Ne.length,...ke)})),H}if(x){const ke=H.findIndex(Ne=>Ne.id===x);if(ke>=0){if(g==="BEFORE"){if(ke-Ee>=0)return H}else if(ke+Ee<H.length)return H}}else g==="BEFORE"?x=(ge=H[0])==null?void 0:ge.id:x=(ee=H[H.length-1])==null?void 0:ee.id;const X=yield w.listMessagesAsync(B,g,x,Ee);return X.length>0?E($e(ke=>{g==="BEFORE"?ke.unshift(...X):ke.push(...X)})):Z(g==="BEFORE"?ke=>oe(j({},ke),{hasOlder:!1}):ke=>oe(j({},ke),{hasNewer:!1})),H})}function we(g){return v(this,null,function*(){if(H.length>0)return H;const{hasOlder:x}=z();return x&&(yield se(void 0,void 0,g)),H})}function Ve(g,x){return v(this,null,function*(){if(H.findIndex(B=>B.id===g)>=0){y({messageId:g,highlight:!0});return}let A=d();if(Z({hasOlder:!0,hasNewer:!0}),E([]),!A||A.id!==x){const B=V.findIndex(ye=>ye.id===x);if(B>=0){const ye=V[B];yield se("AFTER",g),ue(ye)}else{const ye=yield w.getConversationAsync(x);if(!ye)return;yield se("AFTER",g),ue(ye)}}else yield se("AFTER",g),yield se("BEFORE");setTimeout(()=>{y({messageId:g,highlight:!0})},100)})}function Ke(g){return v(this,null,function*(){let x=d();if(!x)throw new Error("No current conversation");let $=x.id;const A=Lt(),B=oe(j({},g),{id:A,conversationId:$,traceId:A,sending:!0,sentAt:new Date});if($)E($e(Ee=>{Ee.push(B)}));else{x.id=Lt();const Ee=yield T(x,()=>{B.conversationId=x.id,E($e(X=>{X.push(B)}))});B.conversationId=Ee.id,E($e(X=>{const ge=X.findIndex(ee=>ee.id===A);ge>=0&&(X[ge].conversationId=Ee.id)}))}y({messageId:A,highlight:!1});const ye=yield w.sendMessageAsync(B);return E($e(Ee=>{const X=Ee.findIndex(ge=>ge.id===A);X>=0&&(Ee[X].id=ye.id,Ee[X].mentions=ye.mentions,Ee[X].sending=!1)})),ye})}function ct(){return v(this,null,function*(){const g=yield w.getConversationAsync(Yi);return!g||!g.status?"NOT_DONE":g.status})}return ae(qn.Provider,{get value(){return{getPanelElement:F,setPanelElement:J,toggleLoader:P,registerLoader:_,toggleDrawer:D,registerDrawer:Q,getPopupState:e,setPopupState:n,getFullscreenState:s,setFullscreenState:i,getSidebarState:o,setSidebarState:r,getFooterSendBoxState:c,setFooterSendBoxState:a,gotoMessageAsync:Ve,getCurrentConversation:d,getLastMessage:f,setCurrentConversation:ue,getCurrentMessage:b,setCurrentQuotedMessage:h,getCurrentQuotedMessage:q,getCurrentMessages:()=>H,listConversationsAsync:re,createConversationAsync:T,pinConversationAsync:ne,updateConversationNameAsync:G,deleteConversationAsync:Ae,listMessagesAsync:se,initMessagesAsync:we,getMessageLoadingStatus:z,listChatTypesAsync:w.listChatTypesAsync,sendMessageAsync:Ke,updateMessageAsync:w.updateMessageAsync,deleteMessageAsync:w.deleteMessageAsync,batchGetUsersAsync:w.batchGetUsersAsync,searchConversationsAsync:w.searchConversationsAsync,searchMessagesAsync:w.searchMessagesAsync,uploadFile:w.uploadFile,getSurveyStatusAsync:ct,getCurrentChatType:K,setCurrentChatType:M,getTitle:S,setTitle:C}},get children(){return t.children}})};function Qi(){const t=ps(qn);if(!t)throw new Error("usePopup must be used within a PopupProvider");return t}function Gi(t){return t.map(e=>{var o,r,c,a,d,u,f,N,V,U,F,J,H,E,b,y,q,h,z,Z,K;const s=(((o=e.sender)==null?void 0:o.id)||"")==="me"?"user":"bot",i={id:e.id,text:e.content,sender:s,type:void 0,sentAt:e.sentAt};if(((r=e.body)==null?void 0:r.type)==="CHOICE"&&s==="bot")return[oe(j({},i),{type:"choice",question:e.body.content||"",options:((a=(c=e.body.choice)==null?void 0:c.items)==null?void 0:a.map(M=>M.label))||[],rawItems:((d=e.body.choice)==null?void 0:d.items)||[],multiSelect:!!((u=e.body.choice)!=null&&u.multiple),isDragDrop:!1,selectedIndexes:(f=e.body.choice)!=null&&f.items?e.body.choice.items.map((M,S)=>M.selected?S:-1).filter(M=>M!==-1):[],contents:[{content:e.body.content,metadata:e.body.metadata}]})];if(((N=e.body)==null?void 0:N.type)==="FORM"&&((V=e.body)!=null&&V.form)&&s==="bot")return[oe(j({},i),{type:"survey",question:e.content||"",options:((U=e.body.form.fields)==null?void 0:U.map(M=>M.label))||[],placeholders:((F=e.body.form.fields)==null?void 0:F.map(M=>{var S;return((S=M.options)==null?void 0:S.placeHolder)||M.label}))||[],isInputMode:!0,fields:e.body.form.fields})];if(((J=e.body)==null?void 0:J.type)==="FORM"&&s==="user"){const S=(((H=e.body.form)==null?void 0:H.fields)||[]).map(C=>C.value).join(`
|
|
6
|
+
"dur=0.5s repeatCount=indefinite></animate></path></svg></div><span style=user-select:none>`),Fi=O("<div class=header-step-tooltip>"),Ni=O("<span>: <!>%"),Ui=O("<div class=header-step-line>");const ji=t=>{const e=()=>t.currentStep||0,n=()=>t.totalSteps||0,[s,i]=L(null),o=()=>t.title;return(()=>{var r=Li(),c=r.firstChild;return k(c,o),k(r,ae(Qe,{get when(){return t.isSurveyConversation},get children(){var a=Hi();return k(a,()=>Array.from({length:n()},(d,u)=>{var V,j,N,ee;const f=(j=(V=t.sections)==null?void 0:V[u])==null?void 0:j.id,U=f&&(ee=(N=t.progress)==null?void 0:N[f])!=null?ee:0;return[(()=>{var H=Oi(),T=H.firstChild,b=T.firstChild,y=b.firstChild,q=b.nextSibling;return T.addEventListener("mouseleave",()=>i(null)),T.addEventListener("mouseenter",()=>i(u)),l(T,"position","relative"),l(T,"overflow","hidden"),l(b,"position","absolute"),l(b,"left","0"),l(b,"bottom","0"),l(b,"width","100%"),l(b,"height",`${U}%`),l(b,"background","#1AAF74"),l(b,"transition","height 0.3s"),l(q,"position","relative"),l(q,"color",U>=70?"white":void 0),k(q,u+1),k(H,(()=>{var h=J(()=>{var F,Z;return!!(s()===u&&((Z=(F=t.sections)==null?void 0:F[u])!=null&&Z.title))});return()=>h()&&(()=>{var F=Fi();return k(F,()=>t.sections[u].title,null),k(F,(()=>{var Z=J(()=>!!(t.progress&&t.sections[u].id&&t.progress[t.sections[u].id]!=null));return()=>Z()&&(()=>{var K=Ni(),E=K.firstChild,S=E.nextSibling;return S.nextSibling,k(K,()=>t.progress[t.sections[u].id],S),fe(C=>{var m=t.progress[t.sections[u].id]===100?"#1AAF74":void 0,w=t.progress[t.sections[u].id]===100?"600":void 0;return m!==C.e&&l(K,"color",C.e=m),w!==C.t&&l(K,"font-weight",C.t=w),C},{e:void 0,t:void 0}),K})()})(),null),F})()})(),null),fe(h=>{var F=`header-step ${u+1===e()?"current":""} ${U===100?"active":""} ${s()===u?"wave":""}`,Z=`header-step-progress${s()===u&&U<100?" wave-animate":""}`,K=s()===u&&U<100?"wave-svg active":"wave-svg";return F!==h.e&&it(T,h.e=F),Z!==h.t&&it(b,h.t=Z),K!==h.a&&ce(y,"class",h.a=K),h},{e:void 0,t:void 0,a:void 0}),H})(),J(()=>J(()=>u<n()-1)()&&Ui())]})),a}}),null),r})()},Gt=Symbol("store-raw"),_t=Symbol("store-node"),ot=Symbol("store-has"),Nn=Symbol("store-self");function Un(t){let e=t[et];if(!e&&(Object.defineProperty(t,et,{value:e=new Proxy(t,Wi)}),!Array.isArray(t))){const n=Object.keys(t),s=Object.getOwnPropertyDescriptors(t);for(let i=0,o=n.length;i<o;i++){const r=n[i];s[r].get&&Object.defineProperty(t,r,{enumerable:s[r].enumerable,get:s[r].get.bind(e)})}}return e}function St(t){let e;return t!=null&&typeof t=="object"&&(t[et]||!(e=Object.getPrototypeOf(t))||e===Object.prototype||Array.isArray(t))}function At(t,e=new Set){let n,s,i,o;if(n=t!=null&&t[Gt])return n;if(!St(t)||e.has(t))return t;if(Array.isArray(t)){Object.isFrozen(t)?t=t.slice(0):e.add(t);for(let r=0,c=t.length;r<c;r++)i=t[r],(s=At(i,e))!==i&&(t[r]=s)}else{Object.isFrozen(t)?t=Object.assign({},t):e.add(t);const r=Object.keys(t),c=Object.getOwnPropertyDescriptors(t);for(let a=0,d=r.length;a<d;a++)o=r[a],!c[o].get&&(i=t[o],(s=At(i,e))!==i&&(t[o]=s))}return t}function Kt(t,e){let n=t[e];return n||Object.defineProperty(t,e,{value:n=Object.create(null)}),n}function Bt(t,e,n){if(t[e])return t[e];const[s,i]=L(n,{equals:!1,internal:!0});return s.$=i,t[e]=s}function zi(t,e){const n=Reflect.getOwnPropertyDescriptor(t,e);return!n||n.get||!n.configurable||e===et||e===_t||(delete n.value,delete n.writable,n.get=()=>t[et][e]),n}function jn(t){hn()&&Bt(Kt(t,_t),Nn)()}function Vi(t){return jn(t),Reflect.ownKeys(t)}const Wi={get(t,e,n){if(e===Gt)return t;if(e===et)return n;if(e===Ct)return jn(t),n;const s=Kt(t,_t),i=s[e];let o=i?i():t[e];if(e===_t||e===ot||e==="__proto__")return o;if(!i){const r=Object.getOwnPropertyDescriptor(t,e);hn()&&(typeof o!="function"||t.hasOwnProperty(e))&&!(r&&r.get)&&(o=Bt(s,e,o)())}return St(o)?Un(o):o},has(t,e){return e===Gt||e===et||e===Ct||e===_t||e===ot||e==="__proto__"?!0:(hn()&&Bt(Kt(t,ot),e)(),e in t)},set(){return!0},deleteProperty(){return!0},ownKeys:Vi,getOwnPropertyDescriptor:zi};function xt(t,e,n,s=!1){if(!s&&t[e]===n)return;const i=t[e],o=t.length;n===void 0?(delete t[e],t[ot]&&t[ot][e]&&i!==void 0&&t[ot][e].$()):(t[e]=n,t[ot]&&t[ot][e]&&i===void 0&&t[ot][e].$());let r=Kt(t,_t),c;if((c=Bt(r,e,i))&&c.$(()=>n),Array.isArray(t)&&t.length!==o){for(let a=t.length;a<o;a++)(c=r[a])&&c.$();(c=Bt(r,"length",o))&&c.$(t.length)}(c=r[Nn])&&c.$()}function zn(t,e){const n=Object.keys(e);for(let s=0;s<n.length;s+=1){const i=n[s];xt(t,i,e[i])}}function qi(t,e){if(typeof e=="function"&&(e=e(t)),e=At(e),Array.isArray(e)){if(t===e)return;let n=0,s=e.length;for(;n<s;n++){const i=e[n];t[n]!==i&&xt(t,n,i)}xt(t,"length",s)}else zn(t,e)}function Ht(t,e,n=[]){let s,i=t;if(e.length>1){s=e.shift();const r=typeof s,c=Array.isArray(t);if(Array.isArray(s)){for(let a=0;a<s.length;a++)Ht(t,[s[a]].concat(e),n);return}else if(c&&r==="function"){for(let a=0;a<t.length;a++)s(t[a],a)&&Ht(t,[a].concat(e),n);return}else if(c&&r==="object"){const{from:a=0,to:d=t.length-1,by:u=1}=s;for(let f=a;f<=d;f+=u)Ht(t,[f].concat(e),n);return}else if(e.length>1){Ht(t[s],e,[s].concat(n));return}i=t[s],n=[s].concat(n)}let o=e[0];typeof o=="function"&&(o=o(i,n),o===i)||s===void 0&&o==null||(o=At(o),s===void 0||St(i)&&St(o)&&!Array.isArray(o)?zn(i,o):xt(t,s,o))}function Vn(...[t,e]){const n=At(t||{}),s=Array.isArray(n),i=Un(n);function o(...r){hs(()=>{s&&r.length===1?qi(n,r[0]):Ht(n,r)})}return[i,o]}const Jt=new WeakMap,Wn={get(t,e){if(e===Gt)return t;const n=t[e];let s;return St(n)?Jt.get(n)||(Jt.set(n,s=new Proxy(n,Wn)),s):n},set(t,e,n){return xt(t,e,At(n)),!0},deleteProperty(t,e){return xt(t,e,void 0,!0),!0}};function Re(t){return e=>{if(St(e)){let n;(n=Jt.get(e))||Jt.set(e,n=new Proxy(e,Wn)),t(n)}return e}}const Zi=30,Yi="me~SURVEY";function Lt(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}const qn=gs(),Xi=t=>{const[e,n]=L(!1),[s,i]=L(!1),[o,r]=L(!1),[c,a]=L(!1),[d,u]=L(),[f,U]=L(),[V,j]=Vn([]),[N,ee]=L(),[H,T]=Vn([]),[b,y]=L(),[q,h]=L(),[F,Z]=L({}),[K,E]=L(),[S,C]=L(),m=new Map,w=t.remoteRepository;t.exportMethods.appendConversation=g=>{if(!g.traceId)j(Re(x=>{x.unshift(g)}));else{const x=d();x&&x.id===g.traceId&&(Z({hasNewer:!1,hasOlder:!1}),u(g)),j(Re(R=>{let A=R.findIndex(B=>B.id===g.traceId);A>=0?(R[A].id=g.id,R[A].creating=!1):(A=R.findIndex(B=>B.id===g.id),A<0&&R.unshift(g))}))}},t.exportMethods.appendMessage=g=>{const x=d();if(x&&x.id==g.conversationId){g.traceId?T(Re(B=>{let ye=B.findIndex(Ee=>Ee.id===g.traceId);ye>=0?(B[ye].id=g.id,B[ye].mentions=g.mentions,B[ye].sending=!1):(ye=B.findIndex(Ee=>Ee.id===g.id),ye<0&&B.push(g))})):T(Re(B=>{B.push(g)}));const A=b();(!A||A&&A.messageId!=g.id)&&y({messageId:g.id,highlight:!1})}const R=V.findIndex(A=>A.id===g.conversationId);R>=0?j(Re(A=>{const B=A[R];B.updatedAt=g.sentAt,B.lastMessage=g,A.splice(R,1),A.unshift(B)})):w.getConversationAsync(g.conversationId).then(A=>{A&&j(Re(B=>{A.updatedAt=g.sentAt||new Date,A.lastMessage=g,B.unshift(A)}))}),U(g)},t.exportMethods.updateMessage=g=>{var x;T(Re(R=>{const A=R.findIndex(B=>B.id===g.id);if(A>=0){const B=R[A];g.sentAt=B.sentAt,R[A]=g}})),j(Re(R=>{const A=R.findIndex(B=>B.id===g.conversationId);if(A>=0){const B=R[A];B.updatedAt=g.sentAt,B.lastMessage&&B.lastMessage.id===g.id&&(B.lastMessage=g)}})),((x=f())==null?void 0:x.id)==g.id&&U(g)},t.exportMethods.deleteMessage=g=>{T(Re(x=>{const R=x.findIndex(A=>A.id===g.id);R>=0&&(x[R].deleted=!0,x[R].body=void 0)})),j(Re(x=>{const R=x.findIndex(A=>A.id===g.conversationId);if(R>=0){const A=x[R];A.lastMessage&&A.lastMessage.id===g.id&&(A.lastMessage=ie(z({},A.lastMessage),{deleted:!0,body:void 0}))}}))};function I(g,x){const R=m.get(g);R&&R(x?!1:x===!1?!0:A=>!A)}function P(g,x){const R=`cp-loader-${g}`;I(R,x)}function _(g,x){const R=`cp-loader-${g}`;m.set(R,x)}function D(g,x){if(!N())return;const A=`cp-drawer-${g}`;I(A,x)}function Q(g,x){const R=`cp-drawer-${g}`;m.set(R,x)}t.exportMethods.deleteConversation=ve,t.exportMethods.updateConversationName=me;function me(g,x){j(Re(A=>{const B=A.findIndex(ye=>ye.id===g);B>=0&&(A[B].name=x)}));const R=d();R&&R.id===g&&u(ie(z({},R),{name:x}))}function ve(g){var x;((x=d())==null?void 0:x.id)===g&&ue(void 0),j(Re(R=>{const A=R.findIndex(B=>B.id===g);A>=0&&R.splice(A,1)}))}function ue(g,x){T([]);let R;if(typeof g=="string"){const A=V.findIndex(B=>B.id===g);A>=0?R=V[A]:w.getConversationAsync(g).then(B=>{B?(Z(x?{hasNewer:!1,hasOlder:!1}:ye=>ie(z({},ye),{hasOlder:!0})),u(z({},B)),C(B.name)):u(void 0)})}else R=g;R?(Z(x?{hasNewer:!1,hasOlder:!1}:A=>ie(z({},A),{hasOlder:!0})),u(z({},R)),C(R.name)):u(void 0)}function oe(g,x){return v(this,null,function*(){const R=yield w.listConversationAsync(g,x);return j(R),V})}function ne(g,x){return v(this,null,function*(){return j(Re(R=>{const A=R.findIndex(B=>B.id===g);if(A>=0){const B=R[A];B.isPinned=x,R.splice(A,1),R.unshift(B)}})),yield w.pinConversationAsync(g,x),!0})}function M(g,x){return v(this,null,function*(){return g.id?(g.traceId=g.id,g.creating=!0,j(Re(R=>{R.unshift(g)})),ue(g,!0),x&&x(),w.createConversationAsync(g)):(ue(g,!0),g)})}function G(g,x){return v(this,null,function*(){return me(g,x),yield w.updateConversationNameAsync(g,x),!0})}function Ae(g){return v(this,null,function*(){return ve(g),yield w.deleteConversationAsync(g),!0})}function re(g,x,R){return v(this,null,function*(){var ge,te;const A=d(),B=A==null?void 0:A.id,ye=B||(A==null?void 0:A.id);if(!ye||!B)return H;g?(g=g.toUpperCase(),g!="BEFORE"&&g!="AFTER"&&(g="BEFORE")):g="BEFORE";const Ee=R||Zi;if(!g){const ke=yield w.listMessagesAsync(ye,void 0,void 0,Ee);return T(Re(Ne=>{Ne.splice(0,Ne.length,...ke)})),H}if(x){const ke=H.findIndex(Ne=>Ne.id===x);if(ke>=0){if(g==="BEFORE"){if(ke-Ee>=0)return H}else if(ke+Ee<H.length)return H}}else g==="BEFORE"?x=(ge=H[0])==null?void 0:ge.id:x=(te=H[H.length-1])==null?void 0:te.id;const X=yield w.listMessagesAsync(B,g,x,Ee);return X.length>0?T(Re(ke=>{g==="BEFORE"?ke.unshift(...X):ke.push(...X)})):Z(g==="BEFORE"?ke=>ie(z({},ke),{hasOlder:!1}):ke=>ie(z({},ke),{hasNewer:!1})),H})}function we(g){return v(this,null,function*(){if(H.length>0)return H;const{hasOlder:x}=F();return x&&(yield re(void 0,void 0,g)),H})}function Ve(g,x){return v(this,null,function*(){if(H.findIndex(B=>B.id===g)>=0){y({messageId:g,highlight:!0});return}let A=d();if(Z({hasOlder:!0,hasNewer:!0}),T([]),!A||A.id!==x){const B=V.findIndex(ye=>ye.id===x);if(B>=0){const ye=V[B];yield re("AFTER",g),ue(ye)}else{const ye=yield w.getConversationAsync(x);if(!ye)return;yield re("AFTER",g),ue(ye)}}else yield re("AFTER",g),yield re("BEFORE");setTimeout(()=>{y({messageId:g,highlight:!0})},100)})}function Ke(g){return v(this,null,function*(){let x=d();if(!x)throw new Error("No current conversation");let R=x.id;const A=Lt(),B=ie(z({},g),{id:A,conversationId:R,traceId:A,sending:!0,sentAt:new Date});if(R)T(Re(Ee=>{Ee.push(B)}));else{x.id=Lt();const Ee=yield M(x,()=>{B.conversationId=x.id,T(Re(X=>{X.push(B)}))});B.conversationId=Ee.id,T(Re(X=>{const ge=X.findIndex(te=>te.id===A);ge>=0&&(X[ge].conversationId=Ee.id)}))}y({messageId:A,highlight:!1});const ye=yield w.sendMessageAsync(B);return T(Re(Ee=>{const X=Ee.findIndex(ge=>ge.id===A);X>=0&&(Ee[X].id=ye.id,Ee[X].mentions=ye.mentions,Ee[X].sending=!1)})),ye})}function ct(){return v(this,null,function*(){const g=yield w.getConversationAsync(Yi);return!g||!g.status?"NOT_DONE":g.status})}return ae(qn.Provider,{get value(){return{getPanelElement:N,setPanelElement:ee,toggleLoader:P,registerLoader:_,toggleDrawer:D,registerDrawer:Q,getPopupState:e,setPopupState:n,getFullscreenState:s,setFullscreenState:i,getSidebarState:o,setSidebarState:r,getFooterSendBoxState:c,setFooterSendBoxState:a,gotoMessageAsync:Ve,getCurrentConversation:d,getLastMessage:f,setCurrentConversation:ue,getCurrentMessage:b,setCurrentQuotedMessage:h,getCurrentQuotedMessage:q,getCurrentMessages:()=>H,listConversationsAsync:oe,createConversationAsync:M,pinConversationAsync:ne,updateConversationNameAsync:G,deleteConversationAsync:Ae,listMessagesAsync:re,initMessagesAsync:we,getMessageLoadingStatus:F,listChatTypesAsync:w.listChatTypesAsync,sendMessageAsync:Ke,updateMessageAsync:w.updateMessageAsync,deleteMessageAsync:w.deleteMessageAsync,batchGetUsersAsync:w.batchGetUsersAsync,searchConversationsAsync:w.searchConversationsAsync,searchMessagesAsync:w.searchMessagesAsync,uploadFile:w.uploadFile,getSurveyStatusAsync:ct,getCurrentChatType:K,setCurrentChatType:E,getTitle:S,setTitle:C}},get children(){return t.children}})};function Qi(){const t=ps(qn);if(!t)throw new Error("usePopup must be used within a PopupProvider");return t}function Gi(t){return t.map(e=>{var o,r,c,a,d,u,f,U,V,j,N,ee,H,T,b,y,q,h,F,Z,K;const s=(((o=e.sender)==null?void 0:o.id)||"")==="me"?"user":"bot",i={id:e.id,text:e.content,sender:s,type:void 0,sentAt:e.sentAt};if(((r=e.body)==null?void 0:r.type)==="CHOICE"&&s==="bot")return[ie(z({},i),{type:"choice",question:e.body.content||"",options:((a=(c=e.body.choice)==null?void 0:c.items)==null?void 0:a.map(E=>E.label))||[],rawItems:((d=e.body.choice)==null?void 0:d.items)||[],multiSelect:!!((u=e.body.choice)!=null&&u.multiple),isDragDrop:!1,selectedIndexes:(f=e.body.choice)!=null&&f.items?e.body.choice.items.map((E,S)=>E.selected?S:-1).filter(E=>E!==-1):[],contents:[{content:e.body.content,metadata:e.body.metadata}]})];if(((U=e.body)==null?void 0:U.type)==="FORM"&&((V=e.body)!=null&&V.form)&&s==="bot")return[ie(z({},i),{type:"survey",question:e.content||"",options:((j=e.body.form.fields)==null?void 0:j.map(E=>E.label))||[],placeholders:((N=e.body.form.fields)==null?void 0:N.map(E=>{var S;return((S=E.options)==null?void 0:S.placeHolder)||E.label}))||[],isInputMode:!0,fields:e.body.form.fields})];if(((ee=e.body)==null?void 0:ee.type)==="FORM"&&s==="user"){const S=(((H=e.body.form)==null?void 0:H.fields)||[]).map(C=>C.value).join(`
|
|
7
7
|
|
|
8
|
-
`);return[
|
|
8
|
+
`);return[ie(z({},i),{text:S,type:"normal",isNormalType:!0,contents:[{content:S}]})]}if((T=e.body)!=null&&T.children&&Array.isArray(e.body.children)){const E=e.body.children.find(w=>w.choice&&Array.isArray(w.choice.items)),S=e.body.children.find(w=>w.ranking&&Array.isArray(w.ranking.items)),C=e.body.children.find(w=>w.form&&Array.isArray(w.form.fields)),m=e.body.children.filter(w=>typeof w.content=="string").map(w=>{let I=w.content;return typeof I=="string"&&I.includes("|")&&(I=I.split("|").map(P=>P.trim()).join(`
|
|
9
9
|
|
|
10
|
-
`)),
|
|
10
|
+
`)),ie(z({},i),{text:I,type:"normal",isNormalType:!0,contents:[{content:I,metadata:w.metadata}]})});if(S){const w=e.body.children.find(_=>_.type==="NORMAL"&&typeof _.content=="string"&&_.content.includes("Câu")),I=m.length>0?m[m.length-1].text:e.body.children.length>0?e.body.children[e.body.children.length-1].content:"";let P=m;return w?P=m.filter(_=>_.text!==w.content):m.length>1&&(P=m.slice(0,-1)),P.length===1&&P[0].text===I&&(P=[]),[...P,ie(z({},i),{type:"choice",question:I,options:S.ranking.items.map(_=>_.label)||[],rawItems:S.ranking.items||[],multiSelect:!1,isDragDrop:!0,selectedIndexes:S.ranking.items.map((_,D)=>_.rank?D:-1).filter(_=>_!==-1)||[]})]}else if(E){const w=e.body.children.find(_=>_.type==="NORMAL"&&typeof _.content=="string"&&_.content.includes("Câu")),I=m.length>0?m[m.length-1].text:e.body.children.length>0?e.body.children[e.body.children.length-1].content:"";let P=m;return w?P=m.filter(_=>_.text!==w.content):m.length>1&&(P=m.slice(0,-1)),P.length===1&&P[0].text===I&&(P=[]),[...P,ie(z({},i),{type:"choice",question:I,options:E.choice.items.map(_=>_.label)||[],rawItems:E.choice.items||[],multiSelect:!!E.choice.multiple,isDragDrop:!1,selectedIndexes:E.choice.items.map((_,D)=>_.selected?D:-1).filter(_=>_!==-1)||[],contents:e.body.children})]}else if(C){const w=e.body.children.find(_=>_.type==="NORMAL"&&typeof _.content=="string"&&_.content.includes("Câu")),I=m.length>0?m[m.length-1].text:e.body.children.length>0?e.body.children[e.body.children.length-1].content:"";let P=m;return w?P=m.filter(_=>_.text!==w.content):m.length>1&&(P=m.slice(0,-1)),P.length===1&&P[0].text===I&&(P=[]),[...P,ie(z({},i),{type:"survey",question:I,options:C.form.fields.map(_=>_.label)||[],placeholders:C.form.fields.map(_=>{var D;return((D=_.options)==null?void 0:D.placeHolder)||_.label})||[],isInputMode:!0,fields:C.form.fields})]}else if(e.body.children.every(w=>w.type==="NORMAL"))return e.body.children.map(w=>ie(z({},i),{text:w.content,type:"normal",isNormalType:!0,contents:[{content:w.content,metadata:w.metadata}]}))}if(((b=e.body)==null?void 0:b.type)==="CHOICE"&&s==="user"){const E=(q=(y=e.body.choice)==null?void 0:y.items)==null?void 0:q.filter(S=>S.selected);if(E&&E.length>0){const S=E.map(C=>C.label).join(`
|
|
11
11
|
|
|
12
|
-
`);return[
|
|
12
|
+
`);return[ie(z({},i),{text:S,type:"normal",isNormalType:!0,contents:[{content:S}]})]}}if(((h=e.body)==null?void 0:h.type)==="NORMAL"&&s==="user")return[ie(z({},i),{text:e.body.content,type:"normal",isNormalType:!0,contents:[{content:e.body.content}]})];if(((F=e.body)==null?void 0:F.type)==="RANKING"&&s==="user"){const E=(Z=e.body.ranking)==null?void 0:Z.items;if(Array.isArray(E)&&E.length>0){const C=[...E].sort((m,w)=>{var I,P;return((I=m.rank)!=null?I:0)-((P=w.rank)!=null?P:0)}).map(m=>m.label).join(`
|
|
13
13
|
|
|
14
|
-
`);return[
|
|
14
|
+
`);return[ie(z({},i),{text:C,type:"normal",isNormalType:!0,contents:[{content:C}]})]}}if(((K=e.body)==null?void 0:K.type)==="MULTIPLE"&&s==="user"){const E=e.body.children.find(S=>S.type==="NORMAL"&&typeof S.content=="string");if(E&&E.content){const S=E.content.split("|").map(C=>C.trim()).join(`
|
|
15
15
|
|
|
16
|
-
`);return[oe(j({},i),{text:S,type:"normal",isNormalType:!0,contents:[{content:S}]})]}}return s==="bot"&&e.body&&typeof e.body.content=="string"&&!e.body.type?[oe(j({},i),{text:e.body.content,type:"normal",isNormalType:!0,contents:[{content:e.body.content,metadata:e.body.metadata}]})]:[oe(j({},i),{type:"normal",isNormalType:!0,contents:i.text?[{content:i.text}]:[]})]}).flat().filter(e=>e.type==="choice"?!!e.question&&Array.isArray(e.options)&&e.options.length>0:e.type==="normal"?!!e.text&&e.text.trim()!=="":e.type==="form"?Array.isArray(e.fields)&&e.fields.length>0:e.type==="survey"?Array.isArray(e.options)&&e.options.length>0:!!e.text&&e.text.trim()!=="")}function Zn(t){return v(this,null,function*(){var n,s,i;if(!t)return!1;const e=yield t.listConversationAsync(100);for(const o of e)if(o.id&&o.id.endsWith("~SURVEY")){const r=yield t.listMessagesAsync(o.id);let c=1,a=6;for(let d=r.length-1;d>=0;d--){const u=r[d];if(((n=u.sender)==null?void 0:n.id)!=="me"&&((s=u.body)!=null&&s.children)){const f=(i=u.body.children.find(N=>N.metadata))==null?void 0:i.metadata;if(f){c=parseInt(f.section),a=parseInt(f.totalSections)||6;break}}}if(c<a)return!0}return!1})}function vn(t,e,n,s,i,o,r,c,a){return v(this,null,function*(){if(!t.remoteRepo)return;const u=(yield t.remoteRepo.listConversationAsync(100)).find(f=>f.id&&f.id.endsWith("~SURVEY"));if(u)e.setCurrentConversation({id:u.id,name:u.name,type:"BOT"}),n(u.id),s(u.name),i(!0),o(new Set),r(!1),yield e.listMessagesAsync(u.id),c&&c();else{const f=`${Lt()}~SURVEY`,V=yield e.createConversationAsync({id:f,name:"Tư vấn đầu tư",type:"BOT",members:[{userId:"BOT~surveybot",role:"MEMBER"}],updatedAt:new Date});e.setCurrentConversation({id:V.id,name:V.name,type:"BOT"}),n(V.id),s(V.name),i(!0),o(new Set),r(!1),yield e.listMessagesAsync(V.id),c&&c(),a&&a()}})}function Ki(t,e){if(!e||t.length===0)return!0;const n=[...t].reverse().find(s=>s.sender==="bot");return!!(n&&n.type==="normal")}function Ji(t,e,n,s,i,o,r,c,a,d,u){return v(this,null,function*(){if(yield Zn(t.remoteRepo)){alert("Bạn chưa hoàn thành khảo sát hiện tại!");return}const f=e.trim();if(!f){n("Vui lòng nhập tên cuộc hội thoại");return}if(f.length>100){n("Tên cuộc hội thoại không được quá 100 ký tự");return}n(void 0),s(!1);try{const N=Lt(),U=yield i.createConversationAsync({id:N,name:f,type:"BOT",members:[{userId:"BOT~rasaconnector",role:"MEMBER"}],updatedAt:new Date});i.setCurrentConversation({id:U.id,name:U.name,type:"BOT"}),o(U.id),r(U.name),c(!0),a(new Set),d(!1),yield i.listMessagesAsync(U.id),u&&u()}catch(N){console.error("Tạo hội thoại mới thất bại:",N)}})}function eo(t,e,n,s,i,o){return v(this,null,function*(){var f,N,V,U;const{props:r,currentConversationId:c,formattedMessages:a,popup:d,setSubmittedMessages:u}=s;if(!(!r.remoteRepo||!c))try{const F=[...a].reverse().find(b=>b.type==="choice"&&b.sender==="bot");if(!F)return;const J=Array.isArray(F.contents)&&F.contents.length>0?F.contents[F.contents.length-1].metadata||{}:{};u(b=>new Set([...b,n]));let H={};e==="ordered"?H={type:"RANKING",content:"",ranking:{items:((f=F.rawItems)==null?void 0:f.map(y=>oe(j({},y),{rank:t.indexOf(y.label)+1})))||t.map((y,q)=>({label:y,value:y,rank:q+1})),submitted:!0},metadata:J}:e==="selected"?H={type:"CHOICE",content:"",choice:{items:((N=F.rawItems)==null?void 0:N.map(y=>oe(j({},y),{selected:t.includes(y.label)})))||((V=F.options)==null?void 0:V.map(y=>({label:y,value:y,selected:t.includes(y)})))||[],multiple:F.multiSelect||!1,submitted:!0},metadata:J}:e==="input"&&(H={type:"FORM",content:"",form:{fields:((U=F.fields)==null?void 0:U.map((b,y)=>oe(j({},b),{value:t[y]||""})))||[],submitted:!0},metadata:J});const E={body:H,conversationId:c,sender:{id:"me"}};if(yield d.sendMessageAsync(E),r.remoteRepo&&o.length>0){const b=yield r.remoteRepo.getSurveyProgressAsync();let y=1;const q=o.map(h=>h.id);b!=null&&b.progress&&(y=q.findIndex(h=>!b.progress[h]||b.progress[h]<100)+1,y===0&&(y=q.length)),i(y)}}catch(F){console.error("Error sending survey response:",F)}})}function to(t,e,n,s,i,o){return v(this,null,function*(){var N,V,U,F;const{props:r,currentConversationId:c,formattedMessages:a,popup:d,setEditingMsgIdBot:u,setEditingMsgIdUser:f}=s;if(!(!r.remoteRepo||!c))try{if(!a.find(h=>h.id===n&&h.sender==="user"))return;const H=a.findIndex(h=>h.id===n);let E;for(let h=H-1;h>=0;h--){const z=a[h];if(z.sender==="bot"&&(z.type==="choice"||z.type==="survey"||z.type==="form")){E=z;break}}if(!E)return;const b=Array.isArray(E.contents)&&E.contents.length>0?E.contents[E.contents.length-1].metadata||{}:{};let y={};e==="input"?y={type:"NORMAL",content:t[0],metadata:b}:e==="ordered"?y={type:"RANKING",content:"",ranking:{items:((N=E.rawItems)==null?void 0:N.map(z=>oe(j({},z),{rank:t.indexOf(z.label)+1})))||t.map((z,Z)=>({label:z,value:z,rank:Z+1})),submitted:!0},metadata:b}:e==="selected"?y={type:"CHOICE",content:"",choice:{items:((V=E.rawItems)==null?void 0:V.map(z=>oe(j({},z),{selected:t.includes(z.label)})))||((U=E.options)==null?void 0:U.map(z=>({label:z,value:z,selected:t.includes(z)})))||[],multiple:E.multiSelect||!1,submitted:!0},metadata:b}:e==="input"&&(y={type:"FORM",content:"",form:{fields:((F=E.fields)==null?void 0:F.map((h,z)=>oe(j({},h),{value:t[z]||""})))||[],submitted:!0},metadata:b});const q={id:n,body:y,conversationId:c,sender:{id:"me"}};if(yield d.updateMessageAsync(q),r.remoteRepo&&o.length>0){const h=yield r.remoteRepo.getSurveyProgressAsync();let z=1;const Z=o.map(K=>K.id);h!=null&&h.progress&&(z=Z.findIndex(K=>!h.progress[K]||h.progress[K]<100)+1,z===0&&(z=Z.length)),i(z)}u(null),f(null)}catch(J){console.error("Error updating survey response:",J)}})}var no=O("<div>"),so=O("<button class=chat-popup-button><img>"),io=O("<div style=font-size:14px;margin-top:4px>"),oo=O("<div class=modal-backdrop><div class=modal-content style=background-color:white;border-radius:8px><div style=margin-bottom:12px><label style=margin-bottom:18px;font-weight:500>Tên cuộc trò chuyện mới:</label><input autofocus class=chat-popup-input></div><div style=text-align:right><button class=modal-button-delete style=margin-right:8px;background-color:#f0f0f0>Hủy bỏ</button><button class=modal-button-delete style=background-color:#1AAF74>Tạo"),ro=O("<div class=modal-backdrop><div style=background-color:white;border-radius:8px><div style=font-size:16px;font-weight:500;margin-bottom:12px>Xóa đoạn chat?</div><div style=font-size:14px;margin-bottom:16px>Hành động này sẽ xóa <b></b>?</div><div style=text-align:right><button class=modal-button-delete style=margin-right:8px>Hủy bỏ</button><button class=modal-button-delete style=background-color:#e74c3c>Xóa"),ao=O("<div class=modal-backdrop><div class=modal-content style=background-color:white;border-radius:8px><div style=font-size:16px;font-weight:500;margin-bottom:12px>Bạn chưa làm khảo sát. Vui lòng thực hiện khảo sát trước khi bắt đầu tư vấn!</div><div style=text-align:right><button class=modal-button-delete style=background-color:#1AAF74>Đã hiểu"),co=O("<div class=modal-backdrop><div class=modal-content style=background-color:white;border-radius:8px><div style=margin-bottom:12px><div style=font-size:16px;font-weight:500;margin-bottom:12px>Bắt đầu làm khảo sát đầu tư?</div><div style=font-size:14px;margin-bottom:16px>Chỉ với vài phút trả lời bảng hỏi, bạn sẽ giúp hệ thống hiểu rõ nhu cầu, khả năng tài chính và mức độ chấp nhận rủi ro của mình. Từ đó, chúng tôi có thể gửi đến bạn những gợi ý đầu tư cá nhân hóa, phù hợp nhất với mục tiêu và phong cách đầu tư của bạn</div></div><div style=text-align:right><button class=modal-button-delete style=margin-right:8px;background-color:#f0f0f0>Xem ví dụ</button><button class=modal-button-delete style=margin-right:8px;background-color:#f0f0f0>Hướng dẫn sử dụng</button><button class=modal-button-delete style=background-color:#1AAF74>Bắt đầu Khảo sát"),lo=O("<div><div style=flex-direction:row><div style=flex-direction:column;min-height:0>"),uo=O("<div class=chat-popup-header><img><div class=chat-popup-title><img style=margin-right:4px><span style=user-select:none>Ez</span><span style=margin-left:4px;user-select:none>Advise</span></div><div style=align-items:center;margin-top:4px><button><img>"),ho=O("<button><img>"),fo=O("<div><div>"),go=O("<div style=text-align:center;font-size:32px;font-weight:600;margin-bottom:32px;user-select:none>Hôm nay thị trường khiến bạn quan tâm điều gì?"),po=O("<div class=chat-popup-action-buttons>");function Co(t){var Ee;const e=Qi(),[n,s]=L(""),[i,o]=L(!1),[r,c]=L(!1),[a,d]=L(!1),[u,f]=L(!1),[N,V]=L(0),[U]=L({}),[F,J]=L(new Set),[H,E]=L(null),[b,y]=L(!1),[q,h]=L(!0),[z,Z]=L(""),[K,M]=L(1),[S,C]=L(7),[m,w]=L(null),[I,P]=L(null),[_,D]=L(!1),[Q,me]=L(""),[ve,ue]=L(void 0);let re=null;const[ne,T]=L(!1),[G,Ae]=L(null),[se,we]=L(!1),Ve=((Ee=t.options)==null?void 0:Ee.onlyMobile)||!1,[Ke,ct]=L([]),[g,x]=L(null),$=()=>v(null,null,function*(){yield vn(t,e,E,Z,h,J,y,re,()=>we(!0)),yield Ji(t,Q(),ue,D,e,E,Z,h,J,y,re)});nt(()=>{var ke;const X=Ke(),ge=(ke=g())==null?void 0:ke.progress;let ee=0;if(X.length&&ge){const Ne=X.map(at=>at.id),lt=Ne.findIndex(at=>ge[at]!==100);lt===-1?ee=Ne.length:ee=lt}M(ee)}),nt(()=>v(null,null,function*(){if(t.remoteRepo)try{const X=yield t.remoteRepo.listConversationAsync(10);console.log("listConversationAsync result:",X),(!X||X.length===0)&&console.warn("listConversationAsync returned empty or null");const ge=yield t.remoteRepo.getSurveyQuestionSectionAsync();ct(ge!=null?ge:[]),C(Array.isArray(ge)?ge.length:0);const ee=yield t.remoteRepo.getSurveyProgressAsync();x(ee),console.log("getSurveyProgressAsync result:",ee);const ke=ge!=null?ge:[],Ne=ee==null?void 0:ee.progress;let lt=0;if(ke.length&&Ne){const at=ke.map(pe=>pe.id),ln=at.findIndex(pe=>Ne[pe]!==100);ln===-1?lt=at.length:lt=ln}M(lt)}catch(X){console.error("Error calling listConversationAsync or getSurveyProgressAsync:",X)}}));const A=()=>{const X=H();return!!X&&X.endsWith("~SURVEY")},B=()=>v(null,null,function*(){me(""),ue(void 0),D(!0)}),ye=()=>v(null,null,function*(){if(t.remoteRepo)try{const X=yield t.remoteRepo.getSurveyProgressAsync();!X||!X.progress||Object.keys(X.progress).length===0?T(!0):x(X)}catch(X){console.error("Error checking survey progress:",X),T(!0)}});return Rt(()=>{const X=()=>{const ee=window.innerWidth<768;f(ee),a()&&ee&&(d(!1),f(!0))};return window.addEventListener("resize",X),X(),()=>{window.removeEventListener("resize",X)}}),nt(()=>{var X,ge;(X=t.options)!=null&&X.onFullScreen&&t.options.onFullScreen(a()),(ge=t.options)!=null&&ge.onMobile&&t.options.onMobile(u())}),(()=>{var X=no();return k(X,(()=>{var ge=te(()=>!i());return()=>ge()&&(()=>{var ee=so(),ke=ee.firstChild;return ee.$$click=()=>{var Ne;Ve&&f(!0),o(!0),(Ne=t.options)!=null&&Ne.onOpen&&t.options.onOpen()},l(ee,"background","none"),l(ee,"border","none"),l(ee,"cursor","pointer"),l(ee,"padding","0"),ce(ke,"src",mn),ee})()})(),null),k(X,(()=>{var ge=te(()=>!!i());return()=>ge()&&(()=>{const ee=st(()=>Gi(e.getCurrentMessages())),ke=()=>Ki(ee(),H()),Ne=(pe,Fe,he)=>eo(pe,Fe,he,{props:t,currentConversationId:H(),formattedMessages:ee(),popup:e,setSubmittedMessages:J},M,Ke()),lt=(pe,Fe,he)=>to(pe,Fe,he,{props:t,currentConversationId:H(),formattedMessages:ee(),popup:e,setEditingMsgIdBot:w,setEditingMsgIdUser:P},M,Ke()),at=()=>v(null,null,function*(){var pe,Fe;if(!(!n().trim()||!t.remoteRepo)){if(ee().length===0){yield ye();return}if(yield Zn(t.remoteRepo)){alert("Bạn chưa hoàn thành khảo sát hiện tại!");return}if(!H()){yield vn(t,e,E,Z,h,J,y,re,()=>we(!0));try{const he=Lt(),ie="BOT~rasaconnector",R=`Cuộc hội thoại mới ${he.slice(-4)}`,W=yield e.createConversationAsync({id:he,name:R,type:"BOT",members:[{userId:ie,role:"MEMBER"}],updatedAt:new Date});e.setCurrentConversation({id:W.id,name:W.name,type:"BOT"}),E(W.id),Z(W.name),h(!0),J(new Set),y(!1),yield e.listMessagesAsync(W.id),re&&re()}catch(he){console.error("Tạo hội thoại mới thất bại:",he);return}}try{let he={};const ie=ee().filter(W=>W.sender==="bot"&&Array.isArray(W.contents)&&W.contents.length>0&&W.contents[W.contents.length-1].metadata);if(ie.length>0){const W=ie[ie.length-1];he=((Fe=(pe=W.contents)==null?void 0:pe[W.contents.length-1])==null?void 0:Fe.metadata)||{}}const R={body:{type:"NORMAL",content:n(),metadata:he},conversationId:H(),sender:{id:"me"}};yield e.sendMessageAsync(R),s("")}catch(he){console.error("Error sending message:",he)}}}),ln=()=>v(null,null,function*(){var pe,Fe;if(!(!e||ee().length===0||!H()||!q()))try{const he=ee()[0].id,ie=30,R=ee().findIndex(Ue=>Ue.id===he);if(R>=0&&R-ie>=0)return;const W=document.querySelector(".chat-messages-container"),de=W==null?void 0:W.querySelector(`[data-message-id="${he}"]`),le=(pe=de==null?void 0:de.offsetTop)!=null?pe:0,qe=(Fe=W==null?void 0:W.scrollTop)!=null?Fe:0;yield e.listMessagesAsync("BEFORE",he,ie),requestAnimationFrame(()=>{var be;const Ue=W==null?void 0:W.querySelector(`[data-message-id="${he}"]`),je=(be=Ue==null?void 0:Ue.offsetTop)!=null?be:0;W&&(W.scrollTop=je-(le-qe))})}catch(he){console.error("Error loading more messages:",he)}});return nt(()=>{ee(),i()&&requestAnimationFrame(()=>{const pe=document.querySelector(".chat-messages-container");pe&&(pe.scrollTop=pe.scrollHeight)})}),(()=>{var pe=lo(),Fe=pe.firstChild,he=Fe.firstChild;return k(pe,ae(Qe,{get when(){return _()},get children(){var ie=oo(),R=ie.firstChild,W=R.firstChild,de=W.firstChild,le=de.nextSibling,qe=W.nextSibling,Ue=qe.firstChild,je=Ue.nextSibling;return ie.$$click=()=>D(!1),R.$$click=be=>be.stopPropagation(),l(R,"padding","20px"),l(R,"width","400px"),l(de,"display","block"),le.$$keydown=be=>{be.key==="Enter"&&$()},le.$$input=be=>me(be.currentTarget.value),k(W,ae(Qe,{get when(){return ve()},get children(){var be=io();return l(be,"color","red"),k(be,ve),be}}),null),Ue.$$click=()=>D(!1),je.$$click=$,l(je,"color","#fff"),fe(()=>le.value=Q()),ie}}),Fe),k(pe,(()=>{var ie=te(()=>!a());return()=>ie()&&(()=>{var R=uo(),W=R.firstChild,de=W.nextSibling,le=de.firstChild,qe=le.nextSibling,Ue=qe.nextSibling,je=de.nextSibling,be=je.firstChild,Xe=be.firstChild;return W.$$click=()=>c(!0),ce(W,"src",Ms),l(W,"width","28px"),l(W,"height","28px"),l(W,"cursor","pointer"),ce(le,"src",mn),l(le,"width","32px"),l(le,"height","32px"),l(qe,"color","#1A1D1F"),l(Ue,"color","#1AAF74"),l(je,"display","flex"),l(je,"gap","12px"),k(je,(()=>{var pt=te(()=>!u());return()=>pt()&&(()=>{var dt=ho(),xn=dt.firstChild;return dt.$$click=()=>{var ls;f(!1),d(!0),(ls=t.options)!=null&&ls.onMaximize&&t.options.onMaximize()},l(dt,"background","none"),l(dt,"border","none"),l(dt,"cursor","pointer"),l(dt,"padding","0"),ce(xn,"src",Es),l(xn,"width","20px"),l(xn,"height","20px"),dt})()})(),be),be.$$click=()=>{var pt;o(!1),setTimeout(()=>{f(!1),d(!1)},250),(pt=t.options)!=null&&pt.onClose&&t.options.onClose()},l(be,"background","none"),l(be,"border","none"),l(be,"cursor","pointer"),l(be,"padding","0"),ce(Xe,"src",Bn),l(Xe,"width","20px"),l(Xe,"height","20px"),R})()})(),Fe),l(Fe,"display","flex"),l(Fe,"height","100%"),k(Fe,(()=>{var ie=te(()=>!!a());return()=>ie()?ae(Fn,{onClose:()=>{var R;o(!1),setTimeout(()=>{f(!1),d(!1)},250),(R=t.options)!=null&&R.onClose&&t.options.onClose()},onShrink:()=>{var R;d(!1),(R=t.options)!=null&&R.onShrink&&t.options.onShrink()},open:!0,fullScreen:!0,get isMobile(){return u()},onMobile:()=>{d(!1),f(!0)},onNewConversation:B,get options(){return t.options},get remoteRepo(){var R;return(R=t.remoteRepo)!=null?R:void 0},onDeleteConversation:Ae,onReloadConversations:R=>re=R,onLoadMessages:(R,W)=>v(null,null,function*(){if(e.setCurrentConversation({id:R,name:"",type:"BOT"}),E(R),Z(W||""),h(!0),t.remoteRepo)try{yield e.listMessagesAsync(R),J(new Set),y(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const de=document.querySelector(".chat-messages-container");de&&(de.scrollTop=de.scrollHeight),y(!1)})})}catch(de){console.error("Error loading messages:",de),y(!1)}})}):ae(Fn,{onClose:()=>c(!1),get open(){return r()},fullScreen:!1,get isMobile(){return u()},onNewConversation:B,get options(){return t.options},get remoteRepo(){var R;return(R=t.remoteRepo)!=null?R:void 0},onDeleteConversation:Ae,onReloadConversations:R=>re=R,onLoadMessages:(R,W)=>v(null,null,function*(){if(e.setCurrentConversation({id:R,name:"",type:"BOT"}),E(R),Z(W||""),h(!0),t.remoteRepo)try{yield e.listMessagesAsync(R);const de=e.getCurrentMessages();console.log("message data: ",de),J(new Set),y(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const le=document.querySelector(".chat-messages-container");le&&(le.scrollTop=le.scrollHeight),y(!1)})})}catch(de){console.error("Error loading messages:",de),y(!1)}})})})(),he),l(he,"flex","1"),l(he,"display","flex"),l(he,"position","relative"),l(he,"height","100%"),k(he,(()=>{var ie=te(()=>!!a());return()=>ie()&&ae(ji,{get currentStep(){return K()},get totalSteps(){return S()},get title(){return z()},get isSurveyConversation(){return A()},get sections(){return Ke()},get progress(){var R;return(R=g())==null?void 0:R.progress}})})(),null),k(he,ae(_i,{get messages(){return ee()},get isFullScreen(){return a()},get inputHeight(){return te(()=>!!a())()?N():void 0},get isMobile(){return u()},onSubmit:Ne,onUpdateSurvey:lt,get surveyOptions(){return U()},get submittedMessages(){return F()},onLoadMoreMessages:ln,get conversationId(){return H()},get isLoadingMessages(){return b()},get editingMsgIdBot(){return m()},setEditingMsgIdBot:w,get editingMsgIdUser(){return I()},setEditingMsgIdUser:P}),null),k(he,(()=>{var ie=te(()=>!!a());return()=>ie()?(()=>{var R=fo(),W=R.firstChild;return k(R,(()=>{var de=te(()=>ee().length===0);return()=>de()&&(()=>{var le=go();return l(le,"width","100%"),l(le,"color","#1A1D1F"),le})()})(),W),l(W,"width","100%"),k(W,ae(On,{get input(){return n()},setInput:s,sendMessage:at,onHeightChange:V,disabled:!ke})),k(R,(()=>{var de=te(()=>ee().length===0);return()=>de()&&(()=>{var le=po();return k(le,ae(Qt,{text:"Khảo sát đầu tư"}),null),k(le,ae(Qt,{text:"Mục tiêu tài chính"}),null),k(le,ae(Qt,{text:"Khả năng chấp nhận rủi ro"}),null),k(le,ae(Qt,{text:"Khả năng chấp nhận rủi ro"}),null),le})()})(),null),fe(()=>it(R,`chat-input-floating-box${ee().length>0?" chat-input-floating-box--with-messages":""}`)),R})():ae(On,{get input(){return n()},setInput:s,sendMessage:at,onHeightChange:V,disabled:!ke})})(),null),k(pe,ae(Qe,{get when(){return!!G()},get children(){var ie=ro(),R=ie.firstChild,W=R.firstChild,de=W.nextSibling,le=de.firstChild,qe=le.nextSibling,Ue=de.nextSibling,je=Ue.firstChild,be=je.nextSibling;return ie.$$click=()=>Ae(null),R.$$click=Xe=>Xe.stopPropagation(),l(R,"padding","20px"),l(R,"width","350px"),k(qe,()=>{var Xe;return(Xe=G())==null?void 0:Xe.name}),je.$$click=Xe=>{Xe.stopPropagation(),Ae(null)},be.$$click=Xe=>v(null,null,function*(){var pt;Xe.stopPropagation();try{yield(pt=t.remoteRepo)==null?void 0:pt.deleteConversationAsync(G().id),Ae(null),re&&re()}catch(dt){alert("Xóa hội thoại thất bại!")}}),l(be,"color","#fff"),ie}}),null),k(pe,ae(Qe,{get when(){return se()},get children(){var ie=ao(),R=ie.firstChild,W=R.firstChild,de=W.nextSibling,le=de.firstChild;return ie.$$click=()=>we(!1),R.$$click=qe=>qe.stopPropagation(),l(R,"padding","20px"),l(R,"width","350px"),le.$$click=()=>we(!1),l(le,"color","#fff"),ie}}),null),k(pe,ae(Qe,{get when(){return ne()},get children(){var ie=co(),R=ie.firstChild,W=R.firstChild,de=W.firstChild;de.nextSibling;var le=W.nextSibling,qe=le.firstChild,Ue=qe.nextSibling,je=Ue.nextSibling;return ie.$$click=()=>T(!1),R.$$click=be=>be.stopPropagation(),l(R,"padding","20px"),l(R,"width","400px"),qe.$$click=()=>T(!1),Ue.$$click=()=>T(!1),je.$$click=()=>v(null,null,function*(){T(!1),yield vn(t,e,E,Z,h,J,y,re,()=>we(!0))}),l(je,"color","#fff"),ie}}),null),fe(ie=>{var R=`chat-popup-window${i()?" chat-popup-window--open":""}${a()?" chat-popup-window--fullscreen":""}${u()?" chat-popup-window--mobile":""}`,W=a()||u()?{"--chat-input-height":`${N()}px`}:void 0;return R!==ie.e&&it(pe,ie.e=R),ie.t=pn(pe,W,ie.t),ie},{e:void 0,t:void 0}),pe})()})()})(),null),X})()}yt(["click","input","keydown"]);function mo(t){return ae(Co,{get remoteRepo(){return t.remoteRepo},get options(){return t.options}})}class ht extends Error{constructor(e,n){const s=new.target.prototype;super(`${e}: Status code '${n}'`),this.statusCode=n,this.__proto__=s}}class wn extends Error{constructor(e="A timeout occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class Ge extends Error{constructor(e="An abort occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class vo extends Error{constructor(e,n){const s=new.target.prototype;super(e),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=s}}class wo extends Error{constructor(e,n){const s=new.target.prototype;super(e),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=s}}class yo extends Error{constructor(e,n){const s=new.target.prototype;super(e),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=s}}class Yn extends Error{constructor(e){const n=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class bo extends Error{constructor(e,n){const s=new.target.prototype;super(e),this.innerErrors=n,this.__proto__=s}}class Xn{constructor(e,n,s){this.statusCode=e,this.statusText=n,this.content=s}}class en{get(e,n){return this.send(oe(j({},n),{method:"GET",url:e}))}post(e,n){return this.send(oe(j({},n),{method:"POST",url:e}))}delete(e,n){return this.send(oe(j({},n),{method:"DELETE",url:e}))}getCookieString(e){return""}}var p;(function(t){t[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Information=2]="Information",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.None=6]="None"})(p||(p={}));class Ot{constructor(){}log(e,n){}}Ot.instance=new Ot;const _o="8.0.17";class Re{static isRequired(e,n){if(e==null)throw new Error(`The '${n}' argument is required.`)}static isNotEmpty(e,n){if(!e||e.match(/^\s*$/))throw new Error(`The '${n}' argument should not be empty.`)}static isIn(e,n,s){if(!(e in n))throw new Error(`Unknown ${s} value: ${e}.`)}}class Ie{static get isBrowser(){return!Ie.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!Ie.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!Ie.isNode&&typeof window=="object"&&typeof window.document=="undefined"}static get isNode(){return typeof process!="undefined"&&process.release&&process.release.name==="node"}}function Ft(t,e){let n="";return ft(t)?(n=`Binary data of length ${t.byteLength}`,e&&(n+=`. Content: '${So(t)}'`)):typeof t=="string"&&(n=`String data of length ${t.length}`,e&&(n+=`. Content: '${t}'`)),n}function So(t){const e=new Uint8Array(t);let n="";return e.forEach(s=>{const i=s<16?"0":"";n+=`0x${i}${s.toString(16)} `}),n.substr(0,n.length-1)}function ft(t){return t&&typeof ArrayBuffer!="undefined"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}function Qn(t,e,n,s,i,o){return v(this,null,function*(){const r={},[c,a]=It();r[c]=a,t.log(p.Trace,`(${e} transport) sending data. ${Ft(i,o.logMessageContent)}.`);const d=ft(i)?"arraybuffer":"text",u=yield n.post(s,{content:i,headers:j(j({},r),o.headers),responseType:d,timeout:o.timeout,withCredentials:o.withCredentials});t.log(p.Trace,`(${e} transport) request complete. Response status: ${u.statusCode}.`)})}function Ao(t){return t===void 0?new tn(p.Information):t===null?Ot.instance:t.log!==void 0?t:new tn(t)}class xo{constructor(e,n){this._subject=e,this._observer=n}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(n=>{})}}class tn{constructor(e){this._minLevel=e,this.out=console}log(e,n){if(e>=this._minLevel){const s=`[${new Date().toISOString()}] ${p[e]}: ${n}`;switch(e){case p.Critical:case p.Error:this.out.error(s);break;case p.Warning:this.out.warn(s);break;case p.Information:this.out.info(s);break;default:this.out.log(s);break}}}}function It(){let t="X-SignalR-User-Agent";return Ie.isNode&&(t="User-Agent"),[t,Io(_o,ko(),Eo(),Mo())]}function Io(t,e,n,s){let i="Microsoft SignalR/";const o=t.split(".");return i+=`${o[0]}.${o[1]}`,i+=` (${t}; `,e&&e!==""?i+=`${e}; `:i+="Unknown OS; ",i+=`${n}`,s?i+=`; ${s}`:i+="; Unknown Runtime Version",i+=")",i}function ko(){if(Ie.isNode)switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}else return""}function Mo(){if(Ie.isNode)return process.versions.node}function Eo(){return Ie.isNode?"NodeJS":"Browser"}function yn(t){return t.stack?t.stack:t.message?t.message:`${t}`}function To(){if(typeof globalThis!="undefined")return globalThis;if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw new Error("could not find global")}class $o extends en{constructor(e){if(super(),this._logger=e,typeof fetch=="undefined"||Ie.isNode){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._jar=new(n("tough-cookie")).CookieJar,typeof fetch=="undefined"?this._fetchType=n("node-fetch"):this._fetchType=fetch,this._fetchType=n("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(To());if(typeof AbortController=="undefined"){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._abortControllerType=n("abort-controller")}else this._abortControllerType=AbortController}send(e){return v(this,null,function*(){if(e.abortSignal&&e.abortSignal.aborted)throw new Ge;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const n=new this._abortControllerType;let s;e.abortSignal&&(e.abortSignal.onabort=()=>{n.abort(),s=new Ge});let i=null;if(e.timeout){const a=e.timeout;i=setTimeout(()=>{n.abort(),this._logger.log(p.Warning,"Timeout from HTTP request."),s=new wn},a)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},ft(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");let o;try{o=yield this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:e.withCredentials===!0?"include":"same-origin",headers:j({"X-Requested-With":"XMLHttpRequest"},e.headers),method:e.method,mode:"cors",redirect:"follow",signal:n.signal})}catch(a){throw s||(this._logger.log(p.Warning,`Error from HTTP request. ${a}.`),a)}finally{i&&clearTimeout(i),e.abortSignal&&(e.abortSignal.onabort=null)}if(!o.ok){const a=yield Gn(o,"text");throw new ht(a||o.statusText,o.status)}const c=yield Gn(o,e.responseType);return new Xn(o.status,o.statusText,c)})}getCookieString(e){let n="";return Ie.isNode&&this._jar&&this._jar.getCookies(e,(s,i)=>n=i.join("; ")),n}}function Gn(t,e){let n;switch(e){case"arraybuffer":n=t.arrayBuffer();break;case"text":n=t.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`);default:n=t.text();break}return n}class Ro extends en{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new Ge):e.method?e.url?new Promise((n,s)=>{const i=new XMLHttpRequest;i.open(e.method,e.url,!0),i.withCredentials=e.withCredentials===void 0?!0:e.withCredentials,i.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.content===""&&(e.content=void 0),e.content&&(ft(e.content)?i.setRequestHeader("Content-Type","application/octet-stream"):i.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const o=e.headers;o&&Object.keys(o).forEach(r=>{i.setRequestHeader(r,o[r])}),e.responseType&&(i.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{i.abort(),s(new Ge)}),e.timeout&&(i.timeout=e.timeout),i.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),i.status>=200&&i.status<300?n(new Xn(i.status,i.statusText,i.response||i.responseText)):s(new ht(i.response||i.responseText||i.statusText,i.status))},i.onerror=()=>{this._logger.log(p.Warning,`Error from HTTP request. ${i.status}: ${i.statusText}.`),s(new ht(i.statusText,i.status))},i.ontimeout=()=>{this._logger.log(p.Warning,"Timeout from HTTP request."),s(new wn)},i.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Po extends en{constructor(e){if(super(),typeof fetch!="undefined"||Ie.isNode)this._httpClient=new $o(e);else if(typeof XMLHttpRequest!="undefined")this._httpClient=new Ro(e);else throw new Error("No usable HttpClient found.")}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new Ge):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}class We{static write(e){return`${e}${We.RecordSeparator}`}static parse(e){if(e[e.length-1]!==We.RecordSeparator)throw new Error("Message is incomplete.");const n=e.split(We.RecordSeparator);return n.pop(),n}}We.RecordSeparatorCode=30,We.RecordSeparator=String.fromCharCode(We.RecordSeparatorCode);class Do{writeHandshakeRequest(e){return We.write(JSON.stringify(e))}parseHandshakeResponse(e){let n,s;if(ft(e)){const c=new Uint8Array(e),a=c.indexOf(We.RecordSeparatorCode);if(a===-1)throw new Error("Message is incomplete.");const d=a+1;n=String.fromCharCode.apply(null,Array.prototype.slice.call(c.slice(0,d))),s=c.byteLength>d?c.slice(d).buffer:null}else{const c=e,a=c.indexOf(We.RecordSeparator);if(a===-1)throw new Error("Message is incomplete.");const d=a+1;n=c.substring(0,d),s=c.length>d?c.substring(d):null}const i=We.parse(n),o=JSON.parse(i[0]);if(o.type)throw new Error("Expected a handshake response from the server.");return[s,o]}}var Y;(function(t){t[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close",t[t.Ack=8]="Ack",t[t.Sequence=9]="Sequence"})(Y||(Y={}));class Bo{constructor(){this.observers=[]}next(e){for(const n of this.observers)n.next(e)}error(e){for(const n of this.observers)n.error&&n.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new xo(this,e)}}class Ho{constructor(e,n,s){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=e,this._connection=n,this._bufferSize=s}_send(e){return v(this,null,function*(){const n=this._protocol.writeMessage(e);let s=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let i=()=>{},o=()=>{};ft(n)?this._bufferedByteCount+=n.byteLength:this._bufferedByteCount+=n.length,this._bufferedByteCount>=this._bufferSize&&(s=new Promise((r,c)=>{i=r,o=c})),this._messages.push(new Lo(n,this._totalMessageCount,i,o))}try{this._reconnectInProgress||(yield this._connection.send(n))}catch(i){this._disconnected()}yield s})}_ack(e){let n=-1;for(let s=0;s<this._messages.length;s++){const i=this._messages[s];if(i._id<=e.sequenceId)n=s,ft(i._message)?this._bufferedByteCount-=i._message.byteLength:this._bufferedByteCount-=i._message.length,i._resolver();else if(this._bufferedByteCount<this._bufferSize)i._resolver();else break}n!==-1&&(this._messages=this._messages.slice(n+1))}_shouldProcessMessage(e){if(this._waitForSequenceMessage)return e.type!==Y.Sequence?!1:(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(e))return!0;const n=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,n<=this._latestReceivedSequenceId?(n===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=n,this._ackTimer(),!0)}_resetSequence(e){if(e.sequenceId>this._nextReceivingSequenceId){this._connection.stop(new Error("Sequence ID greater than amount of messages we've received."));return}this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}_resend(){return v(this,null,function*(){const e=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;yield this._connection.send(this._protocol.writeMessage({type:Y.Sequence,sequenceId:e}));const n=this._messages;for(const s of n)yield this._connection.send(s._message);this._reconnectInProgress=!1})}_dispose(e){e!=null||(e=new Error("Unable to reconnect to server."));for(const n of this._messages)n._rejector(e)}_isInvocationMessage(e){switch(e.type){case Y.Invocation:case Y.StreamItem:case Y.Completion:case Y.StreamInvocation:case Y.CancelInvocation:return!0;case Y.Close:case Y.Sequence:case Y.Ping:case Y.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(()=>v(this,null,function*(){try{this._reconnectInProgress||(yield this._connection.send(this._protocol.writeMessage({type:Y.Ack,sequenceId:this._latestReceivedSequenceId})))}catch(e){}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0}),1e3))}}class Lo{constructor(e,n,s,i){this._message=e,this._id=n,this._resolver=s,this._rejector=i}}const Oo=30*1e3,Fo=15*1e3,No=1e5;var Se;(function(t){t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting"})(Se||(Se={}));class bn{static create(e,n,s,i,o,r,c){return new bn(e,n,s,i,o,r,c)}constructor(e,n,s,i,o,r,c){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(p.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},Re.isRequired(e,"connection"),Re.isRequired(n,"logger"),Re.isRequired(s,"protocol"),this.serverTimeoutInMilliseconds=o!=null?o:Oo,this.keepAliveIntervalInMilliseconds=r!=null?r:Fo,this._statefulReconnectBufferSize=c!=null?c:No,this._logger=n,this._protocol=s,this.connection=e,this._reconnectPolicy=i,this._handshakeProtocol=new Do,this.connection.onreceive=a=>this._processIncomingData(a),this.connection.onclose=a=>this._connectionClosed(a),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=Se.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:Y.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==Se.Disconnected&&this._connectionState!==Se.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}_startWithStateTransitions(){return v(this,null,function*(){if(this._connectionState!==Se.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=Se.Connecting,this._logger.log(p.Debug,"Starting HubConnection.");try{yield this._startInternal(),Ie.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=Se.Connected,this._connectionStarted=!0,this._logger.log(p.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=Se.Disconnected,this._logger.log(p.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}})}_startInternal(){return v(this,null,function*(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=new Promise((n,s)=>{this._handshakeResolver=n,this._handshakeRejecter=s});yield this.connection.start(this._protocol.transferFormat);try{let n=this._protocol.version;this.connection.features.reconnect||(n=1);const s={protocol:this._protocol.name,version:n};if(this._logger.log(p.Debug,"Sending handshake request."),yield this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(s)),this._logger.log(p.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),yield e,this._stopDuringStartError)throw this._stopDuringStartError;(this.connection.features.reconnect||!1)&&(this._messageBuffer=new Ho(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||(yield this._sendMessage(this._cachedPingMessage))}catch(n){throw this._logger.log(p.Debug,`Hub handshake failed with error '${n}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),yield this.connection.stop(n),n}})}stop(){return v(this,null,function*(){const e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),yield this._stopPromise;try{yield e}catch(n){}})}_stopInternal(e){if(this._connectionState===Se.Disconnected)return this._logger.log(p.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===Se.Disconnecting)return this._logger.log(p.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const n=this._connectionState;return this._connectionState=Se.Disconnecting,this._logger.log(p.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(p.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(n===Se.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new Ge("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}_sendCloseMessage(){return v(this,null,function*(){try{yield this._sendWithProtocol(this._createCloseMessage())}catch(e){}})}stream(e,...n){const[s,i]=this._replaceStreamingParams(n),o=this._createStreamInvocation(e,n,i);let r;const c=new Bo;return c.cancelCallback=()=>{const a=this._createCancelInvocation(o.invocationId);return delete this._callbacks[o.invocationId],r.then(()=>this._sendWithProtocol(a))},this._callbacks[o.invocationId]=(a,d)=>{if(d){c.error(d);return}else a&&(a.type===Y.Completion?a.error?c.error(new Error(a.error)):c.complete():c.next(a.item))},r=this._sendWithProtocol(o).catch(a=>{c.error(a),delete this._callbacks[o.invocationId]}),this._launchStreams(s,r),c}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...n){const[s,i]=this._replaceStreamingParams(n),o=this._sendWithProtocol(this._createInvocation(e,n,!0,i));return this._launchStreams(s,o),o}invoke(e,...n){const[s,i]=this._replaceStreamingParams(n),o=this._createInvocation(e,n,!1,i);return new Promise((c,a)=>{this._callbacks[o.invocationId]=(u,f)=>{if(f){a(f);return}else u&&(u.type===Y.Completion?u.error?a(new Error(u.error)):c(u.result):a(new Error(`Unexpected message type: ${u.type}`)))};const d=this._sendWithProtocol(o).catch(u=>{a(u),delete this._callbacks[o.invocationId]});this._launchStreams(s,d)})}on(e,n){!e||!n||(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(n)===-1&&this._methods[e].push(n))}off(e,n){if(!e)return;e=e.toLowerCase();const s=this._methods[e];if(s)if(n){const i=s.indexOf(n);i!==-1&&(s.splice(i,1),s.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const n=this._protocol.parseMessages(e,this._logger);for(const s of n)if(!(this._messageBuffer&&!this._messageBuffer._shouldProcessMessage(s)))switch(s.type){case Y.Invocation:this._invokeClientMethod(s).catch(i=>{this._logger.log(p.Error,`Invoke client method threw error: ${yn(i)}`)});break;case Y.StreamItem:case Y.Completion:{const i=this._callbacks[s.invocationId];if(i){s.type===Y.Completion&&delete this._callbacks[s.invocationId];try{i(s)}catch(o){this._logger.log(p.Error,`Stream callback threw error: ${yn(o)}`)}}break}case Y.Ping:break;case Y.Close:{this._logger.log(p.Information,"Close message received from server.");const i=s.error?new Error("Server returned an error on close: "+s.error):void 0;s.allowReconnect===!0?this.connection.stop(i):this._stopPromise=this._stopInternal(i);break}case Y.Ack:this._messageBuffer&&this._messageBuffer._ack(s);break;case Y.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(s);break;default:this._logger.log(p.Warning,`Invalid message type: ${s.type}.`);break}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let n,s;try{[s,n]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(i){const o="Error parsing handshake response: "+i;this._logger.log(p.Error,o);const r=new Error(o);throw this._handshakeRejecter(r),r}if(n.error){const i="Server returned handshake error: "+n.error;this._logger.log(p.Error,i);const o=new Error(i);throw this._handshakeRejecter(o),o}else this._logger.log(p.Debug,"Server handshake complete.");return this._handshakeResolver(),s}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if((!this.connection.features||!this.connection.features.inherentKeepAlive)&&(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle===void 0)){let e=this._nextKeepAlive-new Date().getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(()=>v(this,null,function*(){if(this._connectionState===Se.Connected)try{yield this._sendMessage(this._cachedPingMessage)}catch(n){this._cleanupPingTimer()}}),e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}_invokeClientMethod(e){return v(this,null,function*(){const n=e.target.toLowerCase(),s=this._methods[n];if(!s){this._logger.log(p.Warning,`No client method with the name '${n}' found.`),e.invocationId&&(this._logger.log(p.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),yield this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)));return}const i=s.slice(),o=!!e.invocationId;let r,c,a;for(const d of i)try{const u=r;r=yield d.apply(this,e.arguments),o&&r&&u&&(this._logger.log(p.Error,`Multiple results provided for '${n}'. Sending error to server.`),a=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),c=void 0}catch(u){c=u,this._logger.log(p.Error,`A callback for the method '${n}' threw error '${u}'.`)}a?yield this._sendWithProtocol(a):o?(c?a=this._createCompletionMessage(e.invocationId,`${c}`,null):r!==void 0?a=this._createCompletionMessage(e.invocationId,null,r):(this._logger.log(p.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),a=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),yield this._sendWithProtocol(a)):r&&this._logger.log(p.Error,`Result given for '${n}' method but server is not expecting a result.`)})}_connectionClosed(e){this._logger.log(p.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new Ge("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===Se.Disconnecting?this._completeClose(e):this._connectionState===Se.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===Se.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=Se.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(e!=null?e:new Error("Connection closed.")),this._messageBuffer=void 0),Ie.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(n=>n.apply(this,[e]))}catch(n){this._logger.log(p.Error,`An onclose callback called with error '${e}' threw error '${n}'.`)}}}_reconnect(e){return v(this,null,function*(){const n=Date.now();let s=0,i=e!==void 0?e:new Error("Attempting to reconnect due to a unknown error."),o=this._getNextRetryDelay(s++,0,i);if(o===null){this._logger.log(p.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),this._completeClose(e);return}if(this._connectionState=Se.Reconnecting,e?this._logger.log(p.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(p.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(r=>r.apply(this,[e]))}catch(r){this._logger.log(p.Error,`An onreconnecting callback called with error '${e}' threw error '${r}'.`)}if(this._connectionState!==Se.Reconnecting){this._logger.log(p.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.");return}}for(;o!==null;){if(this._logger.log(p.Information,`Reconnect attempt number ${s} will start in ${o} ms.`),yield new Promise(r=>{this._reconnectDelayHandle=setTimeout(r,o)}),this._reconnectDelayHandle=void 0,this._connectionState!==Se.Reconnecting){this._logger.log(p.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");return}try{if(yield this._startInternal(),this._connectionState=Se.Connected,this._logger.log(p.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(r=>r.apply(this,[this.connection.connectionId]))}catch(r){this._logger.log(p.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${r}'.`)}return}catch(r){if(this._logger.log(p.Information,`Reconnect attempt failed because of error '${r}'.`),this._connectionState!==Se.Reconnecting){this._logger.log(p.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),this._connectionState===Se.Disconnecting&&this._completeClose();return}i=r instanceof Error?r:new Error(r.toString()),o=this._getNextRetryDelay(s++,Date.now()-n,i)}}this._logger.log(p.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${s} failed attempts. Connection disconnecting.`),this._completeClose()})}_getNextRetryDelay(e,n,s){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:e,retryReason:s})}catch(i){return this._logger.log(p.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${n}) threw error '${i}'.`),null}}_cancelCallbacksWithError(e){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(s=>{const i=n[s];try{i(null,e)}catch(o){this._logger.log(p.Error,`Stream 'error' callback called with '${e}' threw error: ${yn(o)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,n,s,i){if(s)return i.length!==0?{arguments:n,streamIds:i,target:e,type:Y.Invocation}:{arguments:n,target:e,type:Y.Invocation};{const o=this._invocationId;return this._invocationId++,i.length!==0?{arguments:n,invocationId:o.toString(),streamIds:i,target:e,type:Y.Invocation}:{arguments:n,invocationId:o.toString(),target:e,type:Y.Invocation}}}_launchStreams(e,n){if(e.length!==0){n||(n=Promise.resolve());for(const s in e)e[s].subscribe({complete:()=>{n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(s)))},error:i=>{let o;i instanceof Error?o=i.message:i&&i.toString?o=i.toString():o="Unknown error",n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(s,o)))},next:i=>{n=n.then(()=>this._sendWithProtocol(this._createStreamItemMessage(s,i)))}})}}_replaceStreamingParams(e){const n=[],s=[];for(let i=0;i<e.length;i++){const o=e[i];if(this._isObservable(o)){const r=this._invocationId;this._invocationId++,n[r]=o,s.push(r.toString()),e.splice(i,1)}}return[n,s]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,n,s){const i=this._invocationId;return this._invocationId++,s.length!==0?{arguments:n,invocationId:i.toString(),streamIds:s,target:e,type:Y.StreamInvocation}:{arguments:n,invocationId:i.toString(),target:e,type:Y.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:Y.CancelInvocation}}_createStreamItemMessage(e,n){return{invocationId:e,item:n,type:Y.StreamItem}}_createCompletionMessage(e,n,s){return n?{error:n,invocationId:e,type:Y.Completion}:{invocationId:e,result:s,type:Y.Completion}}_createCloseMessage(){return{type:Y.Close}}}const Uo=[0,2e3,1e4,3e4,null];class Kn{constructor(e){this._retryDelays=e!==void 0?[...e,null]:Uo}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class gt{}gt.Authorization="Authorization",gt.Cookie="Cookie";class jo extends en{constructor(e,n){super(),this._innerClient=e,this._accessTokenFactory=n}send(e){return v(this,null,function*(){let n=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(n=!1,this._accessToken=yield this._accessTokenFactory()),this._setAuthorizationHeader(e);const s=yield this._innerClient.send(e);return n&&s.statusCode===401&&this._accessTokenFactory?(this._accessToken=yield this._accessTokenFactory(),this._setAuthorizationHeader(e),yield this._innerClient.send(e)):s})}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[gt.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[gt.Authorization]&&delete e.headers[gt.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}var De;(function(t){t[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling"})(De||(De={}));var Oe;(function(t){t[t.Text=1]="Text",t[t.Binary=2]="Binary"})(Oe||(Oe={}));let zo=class{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}};class Jn{get pollAborted(){return this._pollAbort.aborted}constructor(e,n,s){this._httpClient=e,this._logger=n,this._pollAbort=new zo,this._options=s,this._running=!1,this.onreceive=null,this.onclose=null}connect(e,n){return v(this,null,function*(){if(Re.isRequired(e,"url"),Re.isRequired(n,"transferFormat"),Re.isIn(n,Oe,"transferFormat"),this._url=e,this._logger.log(p.Trace,"(LongPolling transport) Connecting."),n===Oe.Binary&&typeof XMLHttpRequest!="undefined"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[s,i]=It(),o=j({[s]:i},this._options.headers),r={abortSignal:this._pollAbort.signal,headers:o,timeout:1e5,withCredentials:this._options.withCredentials};n===Oe.Binary&&(r.responseType="arraybuffer");const c=`${e}&_=${Date.now()}`;this._logger.log(p.Trace,`(LongPolling transport) polling: ${c}.`);const a=yield this._httpClient.get(c,r);a.statusCode!==200?(this._logger.log(p.Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new ht(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,r)})}_poll(e,n){return v(this,null,function*(){try{for(;this._running;)try{const s=`${e}&_=${Date.now()}`;this._logger.log(p.Trace,`(LongPolling transport) polling: ${s}.`);const i=yield this._httpClient.get(s,n);i.statusCode===204?(this._logger.log(p.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):i.statusCode!==200?(this._logger.log(p.Error,`(LongPolling transport) Unexpected response code: ${i.statusCode}.`),this._closeError=new ht(i.statusText||"",i.statusCode),this._running=!1):i.content?(this._logger.log(p.Trace,`(LongPolling transport) data received. ${Ft(i.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(i.content)):this._logger.log(p.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(s){this._running?s instanceof wn?this._logger.log(p.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=s,this._running=!1):this._logger.log(p.Trace,`(LongPolling transport) Poll errored after shutdown: ${s.message}`)}}finally{this._logger.log(p.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}})}send(e){return v(this,null,function*(){return this._running?Qn(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return v(this,null,function*(){this._logger.log(p.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{yield this._receiving,this._logger.log(p.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[n,s]=It();e[n]=s;const i={headers:j(j({},e),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials};let o;try{yield this._httpClient.delete(this._url,i)}catch(r){o=r}o?o instanceof ht&&(o.statusCode===404?this._logger.log(p.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(p.Trace,`(LongPolling transport) Error sending a DELETE request: ${o}`)):this._logger.log(p.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(p.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}})}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(p.Trace,e),this.onclose(this._closeError)}}}class Vo{constructor(e,n,s,i){this._httpClient=e,this._accessToken=n,this._logger=s,this._options=i,this.onreceive=null,this.onclose=null}connect(e,n){return v(this,null,function*(){return Re.isRequired(e,"url"),Re.isRequired(n,"transferFormat"),Re.isIn(n,Oe,"transferFormat"),this._logger.log(p.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((s,i)=>{let o=!1;if(n!==Oe.Text){i(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));return}let r;if(Ie.isBrowser||Ie.isWebWorker)r=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const c=this._httpClient.getCookieString(e),a={};a.Cookie=c;const[d,u]=It();a[d]=u,r=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:j(j({},a),this._options.headers)})}try{r.onmessage=c=>{if(this.onreceive)try{this._logger.log(p.Trace,`(SSE transport) data received. ${Ft(c.data,this._options.logMessageContent)}.`),this.onreceive(c.data)}catch(a){this._close(a);return}},r.onerror=c=>{o?this._close():i(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},r.onopen=()=>{this._logger.log(p.Information,`SSE connected to ${this._url}`),this._eventSource=r,o=!0,s()}}catch(c){i(c);return}})})}send(e){return v(this,null,function*(){return this._eventSource?Qn(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class Wo{constructor(e,n,s,i,o,r){this._logger=s,this._accessTokenFactory=n,this._logMessageContent=i,this._webSocketConstructor=o,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=r}connect(e,n){return v(this,null,function*(){Re.isRequired(e,"url"),Re.isRequired(n,"transferFormat"),Re.isIn(n,Oe,"transferFormat"),this._logger.log(p.Trace,"(WebSockets transport) Connecting.");let s;return this._accessTokenFactory&&(s=yield this._accessTokenFactory()),new Promise((i,o)=>{e=e.replace(/^http/,"ws");let r;const c=this._httpClient.getCookieString(e);let a=!1;if(Ie.isNode||Ie.isReactNative){const d={},[u,f]=It();d[u]=f,s&&(d[gt.Authorization]=`Bearer ${s}`),c&&(d[gt.Cookie]=c),r=new this._webSocketConstructor(e,void 0,{headers:j(j({},d),this._headers)})}else s&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(s)}`);r||(r=new this._webSocketConstructor(e)),n===Oe.Binary&&(r.binaryType="arraybuffer"),r.onopen=d=>{this._logger.log(p.Information,`WebSocket connected to ${e}.`),this._webSocket=r,a=!0,i()},r.onerror=d=>{let u=null;typeof ErrorEvent!="undefined"&&d instanceof ErrorEvent?u=d.error:u="There was an error with the transport",this._logger.log(p.Information,`(WebSockets transport) ${u}.`)},r.onmessage=d=>{if(this._logger.log(p.Trace,`(WebSockets transport) data received. ${Ft(d.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(d.data)}catch(u){this._close(u);return}},r.onclose=d=>{if(a)this._close(d);else{let u=null;typeof ErrorEvent!="undefined"&&d instanceof ErrorEvent?u=d.error:u="WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",o(new Error(u))}}})})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(p.Trace,`(WebSockets transport) sending data. ${Ft(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(p.Trace,"(WebSockets transport) socket closed."),this.onclose&&(this._isCloseEvent(e)&&(e.wasClean===!1||e.code!==1e3)?this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)):e instanceof Error?this.onclose(e):this.onclose())}_isCloseEvent(e){return e&&typeof e.wasClean=="boolean"&&typeof e.code=="number"}}const es=100;class qo{constructor(e,n={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,Re.isRequired(e,"url"),this._logger=Ao(n.logger),this.baseUrl=this._resolveUrl(e),n=n||{},n.logMessageContent=n.logMessageContent===void 0?!1:n.logMessageContent,typeof n.withCredentials=="boolean"||n.withCredentials===void 0)n.withCredentials=n.withCredentials===void 0?!0:n.withCredentials;else throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");n.timeout=n.timeout===void 0?100*1e3:n.timeout;let s=null,i=null;if(Ie.isNode&&typeof require!="undefined"){const o=typeof __webpack_require__=="function"?__non_webpack_require__:require;s=o("ws"),i=o("eventsource")}!Ie.isNode&&typeof WebSocket!="undefined"&&!n.WebSocket?n.WebSocket=WebSocket:Ie.isNode&&!n.WebSocket&&s&&(n.WebSocket=s),!Ie.isNode&&typeof EventSource!="undefined"&&!n.EventSource?n.EventSource=EventSource:Ie.isNode&&!n.EventSource&&typeof i!="undefined"&&(n.EventSource=i),this._httpClient=new jo(n.httpClient||new Po(this._logger),n.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=n,this.onreceive=null,this.onclose=null}start(e){return v(this,null,function*(){if(e=e||Oe.Binary,Re.isIn(e,Oe,"transferFormat"),this._logger.log(p.Debug,`Starting connection with transfer format '${Oe[e]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),yield this._startInternalPromise,this._connectionState==="Disconnecting"){const n="Failed to start the HttpConnection before stop() was called.";return this._logger.log(p.Error,n),yield this._stopPromise,Promise.reject(new Ge(n))}else if(this._connectionState!=="Connected"){const n="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(p.Error,n),Promise.reject(new Ge(n))}this._connectionStarted=!0})}send(e){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new _n(this.transport)),this._sendQueue.send(e))}stop(e){return v(this,null,function*(){if(this._connectionState==="Disconnected")return this._logger.log(p.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve();if(this._connectionState==="Disconnecting")return this._logger.log(p.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;this._connectionState="Disconnecting",this._stopPromise=new Promise(n=>{this._stopPromiseResolver=n}),yield this._stopInternal(e),yield this._stopPromise})}_stopInternal(e){return v(this,null,function*(){this._stopError=e;try{yield this._startInternalPromise}catch(n){}if(this.transport){try{yield this.transport.stop()}catch(n){this._logger.log(p.Error,`HttpConnection.transport.stop() threw error '${n}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(p.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")})}_startInternal(e){return v(this,null,function*(){let n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation)if(this._options.transport===De.WebSockets)this.transport=this._constructTransport(De.WebSockets),yield this._startTransport(n,e);else throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");else{let s=null,i=0;do{if(s=yield this._getNegotiationResponse(n),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new Ge("The connection was stopped during negotiation.");if(s.error)throw new Error(s.error);if(s.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(s.url&&(n=s.url),s.accessToken){const o=s.accessToken;this._accessTokenFactory=()=>o,this._httpClient._accessToken=o,this._httpClient._accessTokenFactory=void 0}i++}while(s.url&&i<es);if(i===es&&s.url)throw new Error("Negotiate redirection limit exceeded.");yield this._createTransport(n,this._options.transport,s,e)}this.transport instanceof Jn&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(p.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(s){return this._logger.log(p.Error,"Failed to start the connection: "+s),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(s)}})}_getNegotiationResponse(e){return v(this,null,function*(){const n={},[s,i]=It();n[s]=i;const o=this._resolveNegotiateUrl(e);this._logger.log(p.Debug,`Sending negotiation request: ${o}.`);try{const r=yield this._httpClient.post(o,{content:"",headers:j(j({},n),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(r.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${r.statusCode}'`));const c=JSON.parse(r.content);return(!c.negotiateVersion||c.negotiateVersion<1)&&(c.connectionToken=c.connectionId),c.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new Yn("Client didn't negotiate Stateful Reconnect but the server did.")):c}catch(r){let c="Failed to complete negotiation with the server: "+r;return r instanceof ht&&r.statusCode===404&&(c=c+" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(p.Error,c),Promise.reject(new Yn(c))}})}_createConnectUrl(e,n){return n?e+(e.indexOf("?")===-1?"?":"&")+`id=${n}`:e}_createTransport(e,n,s,i){return v(this,null,function*(){let o=this._createConnectUrl(e,s.connectionToken);if(this._isITransport(n)){this._logger.log(p.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=n,yield this._startTransport(o,i),this.connectionId=s.connectionId;return}const r=[],c=s.availableTransports||[];let a=s;for(const d of c){const u=this._resolveTransportOrError(d,n,i,(a==null?void 0:a.useStatefulReconnect)===!0);if(u instanceof Error)r.push(`${d.transport} failed:`),r.push(u);else if(this._isITransport(u)){if(this.transport=u,!a){try{a=yield this._getNegotiationResponse(e)}catch(f){return Promise.reject(f)}o=this._createConnectUrl(e,a.connectionToken)}try{yield this._startTransport(o,i),this.connectionId=a.connectionId;return}catch(f){if(this._logger.log(p.Error,`Failed to start the transport '${d.transport}': ${f}`),a=void 0,r.push(new yo(`${d.transport} failed: ${f}`,De[d.transport])),this._connectionState!=="Connecting"){const N="Failed to select transport before stop() was called.";return this._logger.log(p.Debug,N),Promise.reject(new Ge(N))}}}}return r.length>0?Promise.reject(new bo(`Unable to connect to the server with any of the available transports. ${r.join(" ")}`,r)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))})}_constructTransport(e){switch(e){case De.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Wo(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case De.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Vo(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case De.LongPolling:return new Jn(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,n){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=s=>v(this,null,function*(){let i=!1;if(this.features.reconnect)try{this.features.disconnected(),yield this.transport.connect(e,n),yield this.features.resend()}catch(o){i=!0}else{this._stopConnection(s);return}i&&this._stopConnection(s)}):this.transport.onclose=s=>this._stopConnection(s),this.transport.connect(e,n)}_resolveTransportOrError(e,n,s,i){const o=De[e.transport];if(o==null)return this._logger.log(p.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(Zo(n,o))if(e.transferFormats.map(c=>Oe[c]).indexOf(s)>=0){if(o===De.WebSockets&&!this._options.WebSocket||o===De.ServerSentEvents&&!this._options.EventSource)return this._logger.log(p.Debug,`Skipping transport '${De[o]}' because it is not supported in your environment.'`),new vo(`'${De[o]}' is not supported in your environment.`,o);this._logger.log(p.Debug,`Selecting transport '${De[o]}'.`);try{return this.features.reconnect=o===De.WebSockets?i:void 0,this._constructTransport(o)}catch(c){return c}}else return this._logger.log(p.Debug,`Skipping transport '${De[o]}' because it does not support the requested transfer format '${Oe[s]}'.`),new Error(`'${De[o]}' does not support ${Oe[s]}.`);else return this._logger.log(p.Debug,`Skipping transport '${De[o]}' because it was disabled by the client.`),new wo(`'${De[o]}' is disabled by the client.`,o)}_isITransport(e){return e&&typeof e=="object"&&"connect"in e}_stopConnection(e){if(this._logger.log(p.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState==="Disconnected"){this._logger.log(p.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`);return}if(this._connectionState==="Connecting")throw this._logger.log(p.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),e?this._logger.log(p.Error,`Connection disconnected with error '${e}'.`):this._logger.log(p.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(n=>{this._logger.log(p.Error,`TransportSendQueue.stop() threw error '${n}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(n){this._logger.log(p.Error,`HttpConnection.onclose(${e}) threw error '${n}'.`)}}}_resolveUrl(e){if(e.lastIndexOf("https://",0)===0||e.lastIndexOf("http://",0)===0)return e;if(!Ie.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const n=window.document.createElement("a");return n.href=e,this._logger.log(p.Information,`Normalizing '${e}' to '${n.href}'.`),n.href}_resolveNegotiateUrl(e){const n=new URL(e);n.pathname.endsWith("/")?n.pathname+="negotiate":n.pathname+="/negotiate";const s=new URLSearchParams(n.searchParams);return s.has("negotiateVersion")||s.append("negotiateVersion",this._negotiateVersion.toString()),s.has("useStatefulReconnect")?s.get("useStatefulReconnect")==="true"&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&s.append("useStatefulReconnect","true"),n.search=s.toString(),n.toString()}}function Zo(t,e){return!t||(e&t)!==0}class _n{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new nn,this._transportResult=new nn,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new nn),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}_sendLoop(){return v(this,null,function*(){for(;;){if(yield this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new nn;const e=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):_n._concatBuffers(this._buffer);this._buffer.length=0;try{yield this._transport.send(n),e.resolve()}catch(s){e.reject(s)}}})}static _concatBuffers(e){const n=e.map(o=>o.byteLength).reduce((o,r)=>o+r),s=new Uint8Array(n);let i=0;for(const o of e)s.set(new Uint8Array(o),i),i+=o.byteLength;return s.buffer}}class nn{constructor(){this.promise=new Promise((e,n)=>[this._resolver,this._rejecter]=[e,n])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}const Yo="json";class Xo{constructor(){this.name=Yo,this.version=2,this.transferFormat=Oe.Text}parseMessages(e,n){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];n===null&&(n=Ot.instance);const s=We.parse(e),i=[];for(const o of s){const r=JSON.parse(o);if(typeof r.type!="number")throw new Error("Invalid payload.");switch(r.type){case Y.Invocation:this._isInvocationMessage(r);break;case Y.StreamItem:this._isStreamItemMessage(r);break;case Y.Completion:this._isCompletionMessage(r);break;case Y.Ping:break;case Y.Close:break;case Y.Ack:this._isAckMessage(r);break;case Y.Sequence:this._isSequenceMessage(r);break;default:n.log(p.Information,"Unknown message type '"+r.type+"' ignored.");continue}i.push(r)}return i}writeMessage(e){return We.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),e.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_isAckMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(e,n){if(typeof e!="string"||e==="")throw new Error(n)}}const Qo={trace:p.Trace,debug:p.Debug,info:p.Information,information:p.Information,warn:p.Warning,warning:p.Warning,error:p.Error,critical:p.Critical,none:p.None};function Go(t){const e=Qo[t.toLowerCase()];if(typeof e!="undefined")return e;throw new Error(`Unknown log level: ${t}`)}class Ko{configureLogging(e){if(Re.isRequired(e,"logging"),Jo(e))this.logger=e;else if(typeof e=="string"){const n=Go(e);this.logger=new tn(n)}else this.logger=new tn(e);return this}withUrl(e,n){return Re.isRequired(e,"url"),Re.isNotEmpty(e,"url"),this.url=e,typeof n=="object"?this.httpConnectionOptions=j(j({},this.httpConnectionOptions),n):this.httpConnectionOptions=oe(j({},this.httpConnectionOptions),{transport:n}),this}withHubProtocol(e){return Re.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new Kn(e):this.reconnectPolicy=e:this.reconnectPolicy=new Kn,this}withServerTimeout(e){return Re.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return Re.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=e==null?void 0:e.bufferSize,this}build(){const e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const n=new qo(this.url,e);return bn.create(n,this.logger||Ot.instance,this.protocol||new Xo,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}function Jo(t){return t.log!==void 0}function Be(t,e={}){var c;const{popupRequestInfo:n}=window;t=$t(t);const s=(c=n==null?void 0:n.credentialType)==null?void 0:c.toUpperCase(),i=n==null?void 0:n.accessToken,r=j(j({},{method:"GET",headers:{}}),e);switch(r.body&&typeof r.body=="object"&&(r.body instanceof FormData?r.headers=oe(j({},r.headers),{"Content-Type":"multipart/form-data"}):(r.headers=oe(j({},r.headers),{"Content-Type":"application/json"}),r.body=JSON.stringify(r.body))),s){case"COOKIE":r.credentials="include";break;case"QUERY":break;default:i&&(r.headers=oe(j({},r.headers),{Authorization:`Bearer ${i}`}));break}return fetch(t,r).then(a=>{if(!a.ok){console.error(`HTTP error! status: ${a.status}`);return}return a.json()}).then(a=>{if(a&&a.code){if(a.code!=="0"){console.error(`API error! code: ${a.code}, message: ${a.message}`);return}return a.data}return a}).catch(a=>{console.error("Error fetching data:",a)})}function Nt(t,e){if(!e)return t;let n="";for(let s in e){const i=e[s];i!=null&&(n.length>0&&(n+="&"),n+=`${encodeURIComponent(s)}=${encodeURIComponent(i)}`)}return t.indexOf("?")===-1?t+="?"+n:t+="&"+n,t}function ts(t){return v(this,null,function*(){if(!t||t.length===0)return[];const s=yield Be("user/batch/get",{method:"POST",body:{ids:t}});return!s||!Array.isArray(s)?[]:s.map(i=>({id:i.id,username:i.username,fullName:i.fullName,avatarUrl:i.avatarUrl}))})}const Ut=window,er=Ut.indexedDB||Ut.mozIndexedDB||Ut.webkitIndexedDB||Ut.msIndexedDB||Ut.shimIndexedDB,tr="chatPopupDb",nr=1,sn="users";function sr(t){if(!t.objectStoreNames.contains(sn)){const e=t.createObjectStore(sn,{keyPath:"id",autoIncrement:!1});["username","fullName","avatarUrl"].forEach(n=>e.createIndex(n,n,{unique:!1}))}}let on;function ir(){return new Promise((t,e)=>{if(on)t(on);else{const n=er.open(tr,nr);n.onerror=s=>e(s.target.error),n.onsuccess=s=>{on=s.target.result,t(on)},n.onupgradeneeded=s=>{const i=s.target.result;sr(i)}}})}function ns(t,e){return v(this,null,function*(){const n=yield ir();return n?n.transaction(sn,t,e).objectStore(sn):void 0})}function or(t){return new Promise((e,n)=>v(null,null,function*(){if(t==="SYSTEM"){e({id:"SYSTEM",username:"system",fullName:"Hệ thống"});return}const s=yield ns("readonly");if(!s){n(new Error("User object store not found"));return}const i=s.get(t);i.onsuccess=o=>v(null,null,function*(){const r=o.target.result;e(r)}),i.onerror=o=>n(o.target.error)}))}function rr(t){return v(this,null,function*(){const e=yield ns("readwrite");if(!e)throw new Error("User object store not found");return new Promise((n,s)=>{const i=e.put(t);i.onsuccess=o=>n(o.target.result),i.onerror=o=>s(o.target.error)})})}function ar(t){return v(this,null,function*(){const e=t.map(s=>or(s));return(yield Promise.all(e)).filter(s=>s!==void 0)})}function kt(t){return v(this,null,function*(){const e=Array.from(new Set(t.filter(r=>typeof r=="string"&&r.length>0))),n=yield ar(e),s=e.filter(r=>!n.some(c=>c.id===r)),i=yield ts(s);yield Promise.all(i.map(r=>rr(r)));const o=[...n,...i];return new Map(o.map(r=>[r.id,r]))})}function rn(t){return{id:t.id||t.conversationId,name:t.name,lastMessage:t.lastMessage,updatedAt:t.updatedAt||t.dateTime,type:t.type,membersCount:t.membersCount,status:t.status,isPinned:t.isPinned,isRead:t.isRead,traceId:t.traceId}}function rt(t,e){if(!t)return;let n;e||t.quotedMessage&&(n=rt(t.quotedMessage,!0));const s=t.body;return s&&Array.isArray(s.files)&&(s.files=s.files.map(i=>{const o=i.thumbId?$t(`file/${i.thumbId}`):void 0,r=$t(`file/${i.id||i.fileId}`);return{id:i.id||i.fileId,thumbId:i.thumbId,url:r,name:i.name,contentType:i.contentType,thumbUrl:o}})),{id:t.id||t.messageId,conversationId:t.conversationId,senderId:t.senderId||t.editedBy,sender:t.sender,body:s,sentAt:t.sentAt,deleted:t.deleted,edited:t.edited,mentions:t.mentions,deletedFor:t.deletedFor,quotedMessage:n,traceId:t.traceId}}function an(t){return v(this,null,function*(){const e=t.lastMessage?[t.lastMessage.senderId]:[],n=yield kt(e);if(t.lastMessage){const s=n.get(t.lastMessage.senderId);s&&(t.lastMessage.sender=s,t.lastMessage.sentAt=t.lastMessage.sentAt?new Date(t.lastMessage.sentAt):new Date)}return{id:t.id,name:t.name,lastMessage:t.lastMessage,updatedAt:new Date(t.updatedAt),type:t.type,membersCount:t.membersCount,status:t.status,isPinned:t.isPinned,isRead:t.isRead,traceId:t.traceId}})}function Mt(t,e=new Set){return t.senderId&&e.add(t.senderId),t.quotedMessage&&Mt(t.quotedMessage,e),e}function Et(t,e){const n=t.sender||e.get(t.senderId),s=t.quotedMessage?Et(t.quotedMessage,e):void 0;return t.sender=n,s&&(t.quotedMessage=s),t}function Tt(t){if(!t)return;const e=t.quotedMessage?Tt(t.quotedMessage):void 0,n={id:t.id,conversationId:t.conversationId,sender:t.sender,body:t.body,sentAt:t.sentAt?new Date(t.sentAt):new Date,deleted:t.deleted,edited:t.edited,mentions:t.mentions,deletedFor:t.deletedFor,traceId:t.traceId};return e&&(n.quotedMessage=e),n}function ss(t,e){var c;if(!t)return console.error("URL base is not defined."),"";e=e?e.startsWith("/")?e.slice(1):e:"";let n=t.endsWith("/")?`${t}${e}`:`${t}/${e}`;n.endsWith("/")&&(n=n.slice(0,-1));const{popupRequestInfo:s}=window,i=(c=s==null?void 0:s.credentialType)==null?void 0:c.toUpperCase(),o=s==null?void 0:s.credentialName,r=s==null?void 0:s.accessToken;switch(i){case"COOKIE":const a=new URL(n);a.searchParams.append("credentialType",i),a.searchParams.append("credentialName",o||""),n=a.toString();break;case"QUERY":if(r){const d=new URL(n);d.searchParams.append("access_token",r),n=d.toString()}break}return n}function $t(t){const{popupRequestInfo:e}=window,n=e==null?void 0:e.apiUrlBase;return ss(n,t)}function cr(t){const{popupRequestInfo:e}=window,n=t||(e==null?void 0:e.hubUrlBase);return ss(n)}function lr(t){var i;let e=cr(t);const{popupRequestInfo:n}=window,s=(i=n==null?void 0:n.credentialType)==null?void 0:i.toUpperCase();if(s!="COOKIE"&&s!="QUERY"){const o=n==null?void 0:n.accessToken;if(o){const r=new URL(e);r.searchParams.append("access_token",o),e=r.toString()}}return new Ko().withUrl(e).configureLogging(p.Information).withAutomaticReconnect().build()}const Sn=window;Sn.messagesCache={};function dr(t,e,n,s){return v(this,null,function*(){const i=Nt(`message/conversation/${t}/user`,{direction:e,messageId:n,top:s}),o=yield Be(i);return!o||!Array.isArray(o)?[]:o.filter(r=>!!r).map(r=>rt(r))})}function ur(t){return v(this,null,function*(){const e="message";let n;t.quotedMessage&&(n=t.quotedMessage.id,n&&(Sn.messagesCache[n]=t.quotedMessage));const s={conversationId:t.conversationId,body:t.body,quotedId:n,traceId:t.traceId},i=yield Be(e,{method:"POST",body:s});return i.quotedMessage=t.quotedMessage,rt(i)})}function hr(t){return v(this,null,function*(){if(!t||!t.id)return;const e=`message/${t.id}`;let n;t.quotedMessage&&(n=t.quotedMessage.id,n&&(Sn.messagesCache[n]=t.quotedMessage));const s={body:t.body,quotedId:n,mentions:t.mentions},i=yield Be(e,{method:"POST",body:s});return i.quotedMessage=t.quotedMessage,rt(i)})}function fr(t,e){return v(this,null,function*(){if(!t)return!1;e||(e="Recall");const n=`message/${t}/delete`;return!!(yield Be(n,{method:"POST",body:{type:e}}))})}function is(t){return v(this,null,function*(){if(!t)return;const e=`message/${t}`,n=yield Be(e);if(n)return rt(n)})}function gr(t){return v(this,null,function*(){if(!t||t.length===0)return[];const s=yield Be("message/batch/get",{method:"POST",body:{ids:t}});return!s||!Array.isArray(s)?[]:s.map(i=>rt(i))})}function pr(t,e,n,s){return v(this,null,function*(){var c;const i=Nt("aggregate/search",{conversationId:t,keyword:e,from:n,top:s,type:"MESSAGE"}),r=(c=(yield Be(i)).filter(a=>a.type==="MESSAGE").at(0))==null?void 0:c.items;return r?r.map(a=>rt(a)):[]})}const cn=window;function Cr(t,e){return v(this,null,function*(){if(!e||!t)return;if(!t.quotedMessage&&t.quotedId){const c=cn.messagesCache[t.quotedId];c?(t.quotedMessage=c,delete cn.messagesCache[t.quotedId]):t.quotedMessage=yield is(t.quotedId)}const n=rt(t);if(!n)return;const s=Mt(n),i=yield kt(Array.from(s)),o=Et(n,i),r=Tt(o);e(r)})}function mr(t,e){return v(this,null,function*(){if(!e||!t)return;const n=rn(t);if(!n)return;const s=yield an(n);e(s)})}function vr(t,e){if(!e||!t)return;const{conversationId:n,name:s}=t;!n||!s||e(n,s)}function wr(t,e){if(!e||!t)return;const{conversationId:n}=t;n&&e(n)}function yr(t,e){return v(this,null,function*(){if(!e||!t)return;if(!t.quotedMessage&&t.quotedId){const c=cn.messagesCache[t.quotedId];c?(t.quotedMessage=c,delete cn.messagesCache[t.quotedId]):t.quotedMessage=yield is(t.quotedId)}const n=rt(t);if(!n)return;const s=Mt(n),i=yield kt(Array.from(s)),o=Et(n,i),r=Tt(o);e(r)})}function br(t,e){if(!e||!t)return;const{messageId:n,conversationId:s,type:i,deletedBy:o}=t;!n||!s||e({messageId:n,conversationId:s,deleteType:i||"Recall",deletedBy:o||""})}let ze;function _r(t){return ze&&ze.stop(),ze=lr(t),ze?(ze.on("UserStatusChanged",n=>console.log("UserStatusChanged",n)),{onConnected(n){ze.on("Connected",n)},onMessageSent(n){ze.on("MessageSent",s=>v(null,null,function*(){yield Cr(s,n)}))},onMessageEdited(n){ze.on("MessageEdited",s=>v(null,null,function*(){yield yr(s,n)}))},onMessageDeleted(n){ze.on("MessageDeleted",s=>{br(s,n)})},onConversationCreated(n){ze.on("ConversationCreated",s=>v(null,null,function*(){yield mr(s,n)}))},onConversationBasicInfoChanged(n){ze.on("ConversationBasicInfoChanged",s=>{vr(s,n)})},onConversationDeleted(n){ze.on("ConversationDeleted",s=>{wr(s,n)})},start:()=>ze.start(),stop:()=>ze.stop()}):void 0}function Sr(){return new Promise(t=>{t([{name:"Khiếu nại và hỗ trợ",description:"Tạo khiếu nại của khách hàng và được trợ giúp bởi hỗ trợ viên",conversationType:"HELP",icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABGCAYAAABbnhMrAAAAAXNSR0IArs4c6QAAG/hJREFUeF7tXHk8lNv/n2HGPggRcVEporihuvJttVaylW6khlJdKfuaJbJlK2QZVBSVdlFp0WZJkmgh5ep+lSWSyBIGv9fnMcd3cmds6d7++D2v1zTT85xzPue8z2f/nAce9//XdyGA/67eP7jzwMAACw6HY8XhcH14PL7/B5Ob0PD/OoCvXr0iNTY2ylVXV8s0NDRIf/z4Uby5uVmgvb19Sk9PDyesioWFhcrFxdXNx8fXws/P/1FYWPidpKTkWxERkYrffvutHI/H901o9ZPQ6V8BsLq6WuTevXuaJSUl/6mqqlJpaWmZ8enTJ1JXVxdwGw6PxwNo2Ad+DwwM4Pr7+3F9fX3YB+7x8PDgSCTSZ3Fx8VIFBYUiNTW13NmzZ9+SkZHpngRcxjzEPwpgTk7O0uvXr+vn5eWta2homAWgEAiEHlFR0XczZsx4Pn369LfAXSIiIvX8/Pyfubm5O9jY2Pp6enpYgSM/ffok8PHjx2m1tbWS1dXVc2tra+Wam5unwjisrKw4KSmpEi0trQs6OjqZ8+fPfz5mFL6j4T8CYHp6ul5mZqbp06dPdVpaWviFhITalZSUcuXk5O4vWrSoWEhIqGT+/Pkt413Hs2fPZl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v33t4ZBXkF2hAGgrCOThKi6piEJ2gI7q0cO6roKDgi9mzZV4oq6o+k5WVLZ4zZ87zsbzq/z0bzajvTwEgTCyJQjGNij4S0tTUNB1q0vTHdSFBAWBCqZVAIPRtMt10xIa854C43MQjiMkC8qcBEBaUceHCurPnLlgWlzxZ1tXZyY/iXnQiVUpKqszYeH3Kot8WHVFRURk8xPMvXz8VgIAFJCbu3Lyj9t93b+Xq6z9M7+ntIXBzcjfJzpF9M3f+3KJZs2Y1/suYfUP+pwPwZwJnLHP5P2JCPxnrY2whAAAAAElFTkSuQmCC"},{name:"Tư vấn đầu tư",description:"Tạo một cuộc hội thoại để bắt đầu nhận được các tư vấn đầu tư",botId:"BOT~rasaconnector",isDefault:!0,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABZCAYAAACpHqNlAAAAAXNSR0IArs4c6QAAG71JREFUeF7tXAlYU0fXnpuQBAgCURFRqQvwsbhABUGgoihFoAhal7pUxaVaQVvr8nXRPvWrUpdafxcEra0VFVwQRRG1LqAoS63WBRcgAQSV1QbByBIg+f8zNxNuYoDEBfX7e5+HhyR3ljPvnG3OnBkK/fO8EALUi9SOjY3tW1paOlRGydhyOUtOIZlMJqfkzDZZlFzlu1ztvab+KblqnbZolFOUyjgoSo6/y+T07yy17/AbRckouZzV1M3cvMLCwiK/c+fOOY6Ojk/b6kv9vc4ALl669ItLly4uKyoq6lRWVobbY46X+VltXLrS1i7l5U0y1KlTJ9StW7eKvn37Jvv7+x9ydnY+1q9fP6k2BOgEoLGpSUF1VVUv0jCLzQaeo7/qxjTa0NY+ZeTAjZSSCYyMOyCHvn3zJk6cFL7o889/a4sIrQC0sbHpIxQJ7xjy+byamhoMFkePgxoaGhDSqoW2yHh977kcLmpqasJ/zKdLV3Pk5up2/Nvly0NdXV3vt0Rhm8PndzC6+/Tp038huZwFjXC4dIeyRrpDis1SEeHXB8Vz9ixTUdGIw+Hg8TQ2NeIGXQa5in5YtSrE19c3TaO+bqnbk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kSMTU86njC4rLTVRbmMydKD6+hWuv7Pva5/uH+Af/8HoDxJcB7jmtwe9uvTxSjlQEyHpV9Otjx85MSY5+dx4kUjkVCN5yiGcB4eyQe9ZWFjk+fr6Hvfz8zsUFBR0SZcBtXfZdgeQOcALGRfs7+fdtxKLxRa1tbVUx44dq6ytrfMsLCxy7OzsnrQ3GM/T32sF8HkIftPq/C/BcWIskM+NvgAAAABJRU5ErkJggg=="}])})}function Ar(t,e){return v(this,null,function*(){var a,d;const n=Nt("conversation/user/pinned",{top:t,type:e,ignoredFields:"members"}),s=Nt("conversation/user",{top:t,type:e,ignoredFields:"members"}),i=yield Promise.all([Be(n),Be(s)]);let o=(a=i[0])==null?void 0:a.items,r=(d=i[1])==null?void 0:d.items;return o||(o=[]),r||(r=[]),[...o,...r].map(u=>rn(u))})}function xr(t){return v(this,null,function*(){const e=`conversation/${t}?ignoredFields=members`,n=yield Be(e);if(n)return rn(n)})}function Ir(t){return v(this,null,function*(){const e=t.type?t.type:"BOT";let n="conversation";const s={name:t.name,traceId:t.traceId};switch(e){case"BOT":n+="/bot",s.botId=t.members?t.members.filter(f=>{var N;return(N=f.userId)==null?void 0:N.startsWith("BOT~")}).map(f=>f.userId)[0]:null;break;case"SURVEY":n+="/survey",s.botId=t.members?t.members.filter(f=>{var N;return(N=f.userId)==null?void 0:N.startsWith("BOT~")}).map(f=>f.userId)[0]:null;break;case"GROUP":n+="/group",s.memberIds=t.members?t.members.filter(f=>f.id!=="me").map(f=>f.userId):[];break;case"HELP":n+="/help";break}const i=yield Be(n,{method:"POST",body:s}),{conversationId:o,name:r,type:c,membersCount:a,updatedAt:d,traceId:u}=i;return{id:o,name:r,type:c,membersCount:a,updatedAt:d,traceId:u}})}function kr(t,e){return v(this,null,function*(){let n="conversation";return e?n+=`/${t}/pin`:n+=`/${t}/unpin`,yield Be(n,{method:"POST",body:{}}),!0})}function Mr(t,e){return v(this,null,function*(){const n=`conversation/${t}`;return yield Be(n,{method:"PATCH",body:{name:e}}),!0})}function Er(t){return v(this,null,function*(){const e=`conversation/${t}/delete`;return yield Be(e,{method:"POST",body:{}}),!0})}function Tr(t,e,n){return v(this,null,function*(){var c;const s=Nt("aggregate/search",{keyword:t,from:e,top:n,type:"CONVERSATION"}),o=(c=(yield Be(s)).filter(a=>a.type==="CONVERSATION").at(0))==null?void 0:c.items;if(!o)return[];const r=[...new Set(o.map(a=>a.lastMessageId))];if(r.length>0){const a=yield gr(r),d={};a.forEach(u=>{u&&(d[u.id]=u)}),o.forEach(u=>{u.lastMessageId&&(u.lastMessage=d[u.lastMessageId])})}return o.map(a=>rn(a))})}function $r(){return v(this,null,function*(){return yield Be("/survey/progress")})}function Rr(){return v(this,null,function*(){return yield Be("/survey/question-section")})}function Pr(t){return v(this,null,function*(){const e="survey/conversation",n={name:t.name,traceId:t.traceId,botId:t.members?t.members.filter(i=>{var o;return(o=i.userId)==null?void 0:o.startsWith("BOT~")}).map(i=>i.userId)[0]:null};return yield Be(e,{method:"POST",body:n})})}function Dr(t,e){return v(this,null,function*(){const n=yield Ar(t,e);return yield Promise.all(n.map(an))})}function Br(t){return v(this,null,function*(){const e=yield xr(t);return e?yield an(e):void 0})}function Hr(t,e,n){return v(this,null,function*(){const s=yield Tr(t,e,n);return yield Promise.all(s.map(an))})}function Lr(t){return v(this,null,function*(){const e=yield Ir(t);return{id:e.id,name:e.name,type:e.type,membersCount:e.membersCount,updatedAt:new Date(e.updatedAt)}})}function Or(t,e){return kr(t,e)}function Fr(t,e){return Mr(t,e)}function Nr(t){return Er(t)}function Ur(t){return v(this,null,function*(){return yield Pr(t)})}function jr(t,e){var a;if(!t)return;const{popupRequestInfo:n}=window,s=$t("file"),i=new XMLHttpRequest,o=(a=n==null?void 0:n.credentialType)==null?void 0:a.toUpperCase(),r=n==null?void 0:n.accessToken;switch(o){case"COOKIE":i.withCredentials=!0;break;case"QUERY":break;default:i.setRequestHeader("Authorization",`Bearer ${r}`);break}const c=new FormData;c.append("file",t),e&&(i.upload.onprogress=function(d){if(d.lengthComputable){const u=d.loaded/d.total*80;e({loaded:d.loaded,total:d.total,percent:u,status:"uploading"})}}),i.onload=function(){if(i.status===200){const d=JSON.parse(i.responseText);if(e){const u=d.thumbId?$t(`file/${d.thumbId}`):void 0,f=$t(`file/${d.fileId}`);e({loaded:d.size,total:d.size,percent:100,status:"done",httpCode:i.status,fileItem:{id:d.fileId,name:d.fileName,contentType:d.contentType,thumbId:d.thumbId,thumbUrl:u,url:f}})}}else e&&e({loaded:0,total:0,percent:0,status:"error",error:i.statusText,httpCode:i.status})},i.open("POST",s,!0),i.send(c),console.log(`------- Uploading file: ${t.name} to ${s}`)}function zr(t,e){jr(t,e)}function Vr(t,e,n,s){return v(this,null,function*(){const i=(yield dr(t,e,n,s)).filter(a=>!!a);if(!i||!Array.isArray(i))return[];const o=new Set;i.forEach(a=>Mt(a,o));const r=yield kt(Array.from(o));return i.map(a=>Et(a,r)).map(a=>Tt(a))})}function Wr(t){return v(this,null,function*(){const e=yield ur(t);if(!e)return;const n=Mt(e),s=yield kt(Array.from(n)),i=Et(e,s);return Tt(i)})}function qr(t){return v(this,null,function*(){return!!(yield hr(t))})}function Zr(t,e){return fr(t,e)}function Yr(t,e,n,s){return v(this,null,function*(){const i=yield pr(t,e,n,s);if(!i||!Array.isArray(i))return[];const o=new Set;i.forEach(a=>Mt(a,o));const r=yield kt(Array.from(o));return i.map(a=>Et(a,r)).map(a=>Tt(a))})}function Xr(t){return ts(t)}class Qr{constructor(e){Ce(this,"hubConnection");Ce(this,"onHubConnected",e=>{this.hubConnection.onConnected(n=>{window.currentUserId=n.userId,e(n)})});Ce(this,"onMessageSent",e=>{this.hubConnection.onMessageSent(n=>{n.conversationId=this.normalizeConvId(n.conversationId),this.normalizeSender(n.sender),e(n)})});Ce(this,"onMessageEdited",e=>{this.hubConnection.onMessageEdited(n=>{n.conversationId=this.normalizeConvId(n.conversationId),this.normalizeSender(n.sender),e(n)})});Ce(this,"onMessageDeleted",e=>{this.hubConnection.onMessageDeleted(e)});Ce(this,"onConversationCreated",e=>{this.hubConnection.onConversationCreated(n=>{this.normalizeConversation(n),e(n)})});Ce(this,"onConversationBasicInfoChanged",e=>{this.hubConnection.onConversationBasicInfoChanged((n,s)=>{n=this.normalizeConvId(n),e(n,s)})});Ce(this,"onConversationDeleted",e=>{this.hubConnection.onConversationDeleted(n=>{n=this.normalizeConvId(n),e(n)})});Ce(this,"getConversationAsync",e=>v(this,null,function*(){const n=this.denormalizeConvId(e),s=yield Br(n);if(s)return this.normalizeConversation(s),s}));Ce(this,"listConversationAsync",(e,n)=>v(this,null,function*(){const s=yield Dr(e,n);return s.forEach(i=>this.normalizeConversation(i)),s}));Ce(this,"searchConversationsAsync",(e,n,s)=>v(this,null,function*(){const i=yield Hr(e,n,s);return i.forEach(o=>this.normalizeConversation(o)),i}));Ce(this,"pinConversationAsync",(e,n)=>{const s=this.denormalizeConvId(e);return Or(s,n)});Ce(this,"createConversationAsync",e=>Lr(e));Ce(this,"updateConversationNameAsync",(e,n)=>{const s=this.denormalizeConvId(e);return Fr(s,n)});Ce(this,"deleteConversationAsync",e=>{const n=this.denormalizeConvId(e);return Nr(n)});Ce(this,"sendMessageAsync",e=>v(this,null,function*(){const n=j({},e);n.conversationId=this.denormalizeConvId(n.conversationId);const s=yield Wr(n);return this.normalizeSender(s.sender),s}));Ce(this,"listMessagesAsync",(e,n,s,i)=>v(this,null,function*(){const o=this.denormalizeConvId(e),r=yield Vr(o,n,s,i);return this.normalizeMessages(r),r}));Ce(this,"searchMessagesAsync",(e,n,s,i)=>v(this,null,function*(){const o=this.denormalizeConvId(e),r=yield Yr(o,n,s,i);return this.normalizeMessages(r),r}));Ce(this,"updateMessageAsync",e=>qr(e));Ce(this,"batchGetUsersAsync",e=>Xr(e));Ce(this,"deleteMessageAsync",(e,n)=>Zr(e,n));Ce(this,"uploadFile",(e,n)=>{zr(e,n)});Ce(this,"listChatTypesAsync",()=>v(null,null,function*(){return yield Sr()}));Ce(this,"getSurveyProgressAsync",()=>v(null,null,function*(){return yield $r()}));Ce(this,"getSurveyQuestionSectionAsync",()=>v(null,null,function*(){return yield Rr()}));Ce(this,"createSurveyConversationAsync",e=>v(null,null,function*(){return yield Ur(e)}));const n=_r(e);if(!n)throw new Error("Connect to hub error");this.hubConnection=n,this.hubConnection.start()}get currentUserId(){return window.currentUserId}normalizeConvId(e){return e.startsWith(`${this.currentUserId}~`)?e.replace(new RegExp(`^${this.currentUserId}`),"me"):e}denormalizeConvId(e){return e.replace(/^me/,this.currentUserId)}normalizeSender(e){e&&e.id===this.currentUserId&&(e.id="me")}normalizeConversation(e){e.id=this.normalizeConvId(e.id),e.lastMessage&&this.normalizeSender(e.lastMessage.sender)}normalizeMessages(e){e.forEach(n=>this.normalizeSender(n.sender))}}var Gr=O("<div>Loading...");const[An,Kr]=L(null),[Jr,e2]=L(null),He={},os={apiUrlBase:"http://dev.eztrade.fpts.com.vn/chatapi/api",hubUrlBase:"http://dev.eztrade.fpts.com.vn/chathub/hub/notification",credentialType:"cookie",credentialName:"aspfpt_sessiontoken"};window.popupRequestInfo=os;const rs=os.hubUrlBase,as=()=>{var s;const t=window.popupRequestInfo;if(!rs)throw new Error("VITE_PUBLIC_HUB_URL is not defined");const e=(s=t==null?void 0:t.credentialType)==null?void 0:s.toLowerCase();if(e!=="cookie"&&!(t!=null&&t.accessToken))throw new Error("Missing JWT token: accessToken chưa được gán vào popupRequestInfo");if(e!=="cookie"&&!window.currentUserId)throw new Error("Missing currentUserId: chưa chọn user");const n=new Qr(rs);Kr(n),n.onHubConnected(i=>{console.log("SignalR: Hub connected",i)}),n.onMessageSent(i=>{var o;console.log("SignalR: Message sent event received",i),(o=He.appendMessage)==null||o.call(He,i)}),n.onMessageEdited(i=>{var o;console.log("SignalR: Message edited event received",i),(o=He.updateMessage)==null||o.call(He,i)}),n.onMessageDeleted(i=>{var o;console.log("SignalR: Message deleted event received",i),(o=He.deleteMessage)==null||o.call(He,i)}),n.onConversationCreated(i=>{var o;console.log("SignalR: Conversation created event received",i),(o=He.appendConversation)==null||o.call(He,i)}),n.onConversationBasicInfoChanged((i,o)=>{var r;console.log("SignalR: Conversation name changed",i,o),(r=He.updateConversationName)==null||r.call(He,i,o)}),n.onConversationDeleted(i=>{var o;console.log("SignalR: Conversation deleted",i),(o=He.deleteConversation)==null||o.call(He,i)})};function cs(t,e){const n=typeof t=="string"?document.querySelector(t):t;if(!n)throw new Error(`Element "${t}" not found.`);e!=null&&e.credentialType&&(window.popupRequestInfo.credentialType=e.credentialType),e!=null&&e.accessToken&&(window.popupRequestInfo.accessToken=e.accessToken),e!=null&&e.currentUserId&&(window.currentUserId=e.currentUserId),e2(e),as(),Is(()=>ae(Qe,{get when(){return An()},get fallback(){return Gr()},get children(){return ae(Xi,{get remoteRepository(){return An()},exportMethods:He,get children(){return ae(mo,{get remoteRepo(){return An()},get options(){return Jr()}})}})}}),n)}typeof window!="undefined"&&(window.EzChat={createPopup:cs}),window.addEventListener("startChat",()=>{as()}),Te.createPopup=cs,Object.defineProperty(Te,Symbol.toStringTag,{value:"Module"})}));
|
|
16
|
+
`);return[ie(z({},i),{text:S,type:"normal",isNormalType:!0,contents:[{content:S}]})]}}return s==="bot"&&e.body&&typeof e.body.content=="string"&&!e.body.type?[ie(z({},i),{text:e.body.content,type:"normal",isNormalType:!0,contents:[{content:e.body.content,metadata:e.body.metadata}]})]:[ie(z({},i),{type:"normal",isNormalType:!0,contents:i.text?[{content:i.text}]:[]})]}).flat().filter(e=>e.type==="choice"?!!e.question&&Array.isArray(e.options)&&e.options.length>0:e.type==="normal"?!!e.text&&e.text.trim()!=="":e.type==="form"?Array.isArray(e.fields)&&e.fields.length>0:e.type==="survey"?Array.isArray(e.options)&&e.options.length>0:!!e.text&&e.text.trim()!=="")}function Zn(t){return v(this,null,function*(){var n,s,i;if(!t)return!1;const e=yield t.listConversationAsync(100);for(const o of e)if(o.id&&o.id.endsWith("~SURVEY")){const r=yield t.listMessagesAsync(o.id);let c=1,a=6;for(let d=r.length-1;d>=0;d--){const u=r[d];if(((n=u.sender)==null?void 0:n.id)!=="me"&&((s=u.body)!=null&&s.children)){const f=(i=u.body.children.find(U=>U.metadata))==null?void 0:i.metadata;if(f){c=parseInt(f.section),a=parseInt(f.totalSections)||6;break}}}if(c<a)return!0}return!1})}function vn(t,e,n,s,i,o,r,c,a){return v(this,null,function*(){if(!t.remoteRepo)return;const u=(yield t.remoteRepo.listConversationAsync(100)).find(f=>f.id&&f.id.endsWith("~SURVEY"));if(u)e.setCurrentConversation({id:u.id,name:u.name,type:"BOT"}),n(u.id),s(u.name),i(!0),o(new Set),r(!1),yield e.listMessagesAsync(u.id),c&&c();else{const f=`${Lt()}~SURVEY`,V=yield e.createConversationAsync({id:f,name:"Tư vấn đầu tư",type:"BOT",members:[{userId:"BOT~surveybot",role:"MEMBER"}],updatedAt:new Date});e.setCurrentConversation({id:V.id,name:V.name,type:"BOT"}),n(V.id),s(V.name),i(!0),o(new Set),r(!1),yield e.listMessagesAsync(V.id),c&&c(),a&&a()}})}function Ki(t,e){if(!e||t.length===0)return!0;const n=[...t].reverse().find(s=>s.sender==="bot");return!!(n&&n.type==="normal")}function Ji(t,e,n,s,i,o,r,c,a,d,u){return v(this,null,function*(){if(yield Zn(t.remoteRepo)){alert("Bạn chưa hoàn thành khảo sát hiện tại!");return}const f=e.trim();if(!f){n("Vui lòng nhập tên cuộc hội thoại");return}if(f.length>100){n("Tên cuộc hội thoại không được quá 100 ký tự");return}n(void 0),s(!1);try{const U=Lt(),j=yield i.createConversationAsync({id:U,name:f,type:"BOT",members:[{userId:"BOT~rasaconnector",role:"MEMBER"}],updatedAt:new Date});i.setCurrentConversation({id:j.id,name:j.name,type:"BOT"}),o(j.id),r(j.name),c(!0),a(new Set),d(!1),yield i.listMessagesAsync(j.id),u&&u()}catch(U){console.error("Tạo hội thoại mới thất bại:",U)}})}function eo(t,e,n,s,i,o){return v(this,null,function*(){var f,U,V,j;const{props:r,currentConversationId:c,formattedMessages:a,popup:d,setSubmittedMessages:u}=s;if(!(!r.remoteRepo||!c))try{const N=[...a].reverse().find(b=>b.type==="choice"&&b.sender==="bot");if(!N)return;const ee=Array.isArray(N.contents)&&N.contents.length>0?N.contents[N.contents.length-1].metadata||{}:{};u(b=>new Set([...b,n]));let H={};e==="ordered"?H={type:"RANKING",content:"",ranking:{items:((f=N.rawItems)==null?void 0:f.map(y=>ie(z({},y),{rank:t.indexOf(y.label)+1})))||t.map((y,q)=>({label:y,value:y,rank:q+1})),submitted:!0},metadata:ee}:e==="selected"?H={type:"CHOICE",content:"",choice:{items:((U=N.rawItems)==null?void 0:U.map(y=>ie(z({},y),{selected:t.includes(y.label)})))||((V=N.options)==null?void 0:V.map(y=>({label:y,value:y,selected:t.includes(y)})))||[],multiple:N.multiSelect||!1,submitted:!0},metadata:ee}:e==="input"&&(H={type:"FORM",content:"",form:{fields:((j=N.fields)==null?void 0:j.map((b,y)=>ie(z({},b),{value:t[y]||""})))||[],submitted:!0},metadata:ee});const T={body:H,conversationId:c,sender:{id:"me"}};if(yield d.sendMessageAsync(T),r.remoteRepo&&o.length>0){const b=yield r.remoteRepo.getSurveyProgressAsync();let y=1;const q=o.map(h=>h.id);b!=null&&b.progress&&(y=q.findIndex(h=>!b.progress[h]||b.progress[h]<100)+1,y===0&&(y=q.length)),i(y)}}catch(N){console.error("Error sending survey response:",N)}})}function to(t,e,n,s,i,o){return v(this,null,function*(){var U,V,j,N;const{props:r,currentConversationId:c,formattedMessages:a,popup:d,setEditingMsgIdBot:u,setEditingMsgIdUser:f}=s;if(!(!r.remoteRepo||!c))try{if(!a.find(h=>h.id===n&&h.sender==="user"))return;const H=a.findIndex(h=>h.id===n);let T;for(let h=H-1;h>=0;h--){const F=a[h];if(F.sender==="bot"&&(F.type==="choice"||F.type==="survey"||F.type==="form")){T=F;break}}if(!T)return;const b=Array.isArray(T.contents)&&T.contents.length>0?T.contents[T.contents.length-1].metadata||{}:{};let y={};e==="input"?y={type:"NORMAL",content:t[0],metadata:b}:e==="ordered"?y={type:"RANKING",content:"",ranking:{items:((U=T.rawItems)==null?void 0:U.map(F=>ie(z({},F),{rank:t.indexOf(F.label)+1})))||t.map((F,Z)=>({label:F,value:F,rank:Z+1})),submitted:!0},metadata:b}:e==="selected"?y={type:"CHOICE",content:"",choice:{items:((V=T.rawItems)==null?void 0:V.map(F=>ie(z({},F),{selected:t.includes(F.label)})))||((j=T.options)==null?void 0:j.map(F=>({label:F,value:F,selected:t.includes(F)})))||[],multiple:T.multiSelect||!1,submitted:!0},metadata:b}:e==="input"&&(y={type:"FORM",content:"",form:{fields:((N=T.fields)==null?void 0:N.map((h,F)=>ie(z({},h),{value:t[F]||""})))||[],submitted:!0},metadata:b});const q={id:n,body:y,conversationId:c,sender:{id:"me"}};if(yield d.updateMessageAsync(q),r.remoteRepo&&o.length>0){const h=yield r.remoteRepo.getSurveyProgressAsync();let F=1;const Z=o.map(K=>K.id);h!=null&&h.progress&&(F=Z.findIndex(K=>!h.progress[K]||h.progress[K]<100)+1,F===0&&(F=Z.length)),i(F)}u(null),f(null)}catch(ee){console.error("Error updating survey response:",ee)}})}var no=O("<div>"),so=O("<button class=chat-popup-button><img>"),io=O("<div style=font-size:14px;margin-top:4px>"),oo=O("<div class=modal-backdrop><div class=modal-content style=background-color:white;border-radius:8px><div style=margin-bottom:12px><label style=margin-bottom:18px;font-weight:500>Tên cuộc trò chuyện mới:</label><input autofocus class=chat-popup-input></div><div style=text-align:right><button class=modal-button-delete style=margin-right:8px;background-color:#f0f0f0>Hủy bỏ</button><button class=modal-button-delete style=background-color:#1AAF74>Tạo"),ro=O("<div class=modal-backdrop><div style=background-color:white;border-radius:8px><div style=font-size:16px;font-weight:500;margin-bottom:12px>Xóa đoạn chat?</div><div style=font-size:14px;margin-bottom:16px>Hành động này sẽ xóa <b></b>?</div><div style=text-align:right><button class=modal-button-delete style=margin-right:8px>Hủy bỏ</button><button class=modal-button-delete style=background-color:#e74c3c>Xóa"),ao=O("<div class=modal-backdrop><div class=modal-content style=background-color:white;border-radius:8px><div style=font-size:16px;font-weight:500;margin-bottom:12px>Bạn chưa làm khảo sát. Vui lòng thực hiện khảo sát trước khi bắt đầu tư vấn!</div><div style=text-align:right><button class=modal-button-delete style=background-color:#1AAF74>Đã hiểu"),co=O("<div class=modal-backdrop><div class=modal-content style=background-color:white;border-radius:8px><div style=margin-bottom:12px><div style=font-size:16px;font-weight:500;margin-bottom:12px>Bắt đầu làm khảo sát đầu tư?</div><div style=font-size:14px;margin-bottom:16px>Chỉ với vài phút trả lời bảng hỏi, bạn sẽ giúp hệ thống hiểu rõ nhu cầu, khả năng tài chính và mức độ chấp nhận rủi ro của mình. Từ đó, chúng tôi có thể gửi đến bạn những gợi ý đầu tư cá nhân hóa, phù hợp nhất với mục tiêu và phong cách đầu tư của bạn</div></div><div style=text-align:right><button class=modal-button-delete style=margin-right:8px;background-color:#f0f0f0>Xem ví dụ</button><button class=modal-button-delete style=margin-right:8px;background-color:#f0f0f0>Hướng dẫn sử dụng</button><button class=modal-button-delete style=background-color:#1AAF74>Bắt đầu Khảo sát"),lo=O("<div><div style=flex-direction:row><div style=flex-direction:column;min-height:0>"),uo=O("<div class=chat-popup-header><img><div class=chat-popup-title><img style=margin-right:4px><span style=user-select:none>Ez</span><span style=margin-left:4px;user-select:none>Advise</span></div><div style=align-items:center;margin-top:4px><button><img>"),ho=O("<button><img>"),fo=O("<div><div>"),go=O("<div style=text-align:center;font-size:32px;font-weight:600;margin-bottom:32px;user-select:none>Hôm nay thị trường khiến bạn quan tâm điều gì?"),po=O("<div class=chat-popup-action-buttons>");function Co(t){var Ee;const e=Qi(),[n,s]=L(""),[i,o]=L(!1),[r,c]=L(!1),[a,d]=L(!1),[u,f]=L(!1),[U,V]=L(0),[j]=L({}),[N,ee]=L(new Set),[H,T]=L(null),[b,y]=L(!1),[q,h]=L(!0),[F,Z]=L(""),[K,E]=L(1),[S,C]=L(7),[m,w]=L(null),[I,P]=L(null),[_,D]=L(!1),[Q,me]=L(""),[ve,ue]=L(void 0);let oe=null;const[ne,M]=L(!1),[G,Ae]=L(null),[re,we]=L(!1),Ve=((Ee=t.options)==null?void 0:Ee.onlyMobile)||!1,[Ke,ct]=L([]),[g,x]=L(null),R=()=>v(null,null,function*(){yield vn(t,e,T,Z,h,ee,y,oe,()=>we(!0)),yield Ji(t,Q(),ue,D,e,T,Z,h,ee,y,oe)});nt(()=>{var ke;const X=Ke(),ge=(ke=g())==null?void 0:ke.progress;let te=0;if(X.length&&ge){const Ne=X.map(at=>at.id),lt=Ne.findIndex(at=>ge[at]!==100);lt===-1?te=Ne.length:te=lt}E(te)}),nt(()=>v(null,null,function*(){if(t.remoteRepo)try{const X=yield t.remoteRepo.listConversationAsync(10);console.log("listConversationAsync result:",X),(!X||X.length===0)&&console.warn("listConversationAsync returned empty or null");const ge=yield t.remoteRepo.getSurveyQuestionSectionAsync();ct(ge!=null?ge:[]),C(Array.isArray(ge)?ge.length:0);const te=yield t.remoteRepo.getSurveyProgressAsync();x(te),console.log("getSurveyProgressAsync result:",te);const ke=ge!=null?ge:[],Ne=te==null?void 0:te.progress;let lt=0;if(ke.length&&Ne){const at=ke.map(pe=>pe.id),ln=at.findIndex(pe=>Ne[pe]!==100);ln===-1?lt=at.length:lt=ln}E(lt)}catch(X){console.error("Error calling listConversationAsync or getSurveyProgressAsync:",X)}}));const A=()=>{const X=H();return!!X&&X.endsWith("~SURVEY")},B=()=>v(null,null,function*(){me(""),ue(void 0),D(!0)}),ye=()=>v(null,null,function*(){if(t.remoteRepo)try{const X=yield t.remoteRepo.getSurveyProgressAsync();!X||!X.progress||Object.keys(X.progress).length===0?M(!0):x(X)}catch(X){console.error("Error checking survey progress:",X),M(!0)}});return $t(()=>{const X=()=>{const te=window.innerWidth<768;f(te),a()&&te&&(d(!1),f(!0))};return window.addEventListener("resize",X),X(),()=>{window.removeEventListener("resize",X)}}),nt(()=>{var X,ge;(X=t.options)!=null&&X.onFullScreen&&t.options.onFullScreen(a()),(ge=t.options)!=null&&ge.onMobile&&t.options.onMobile(u())}),(()=>{var X=no();return k(X,(()=>{var ge=J(()=>!i());return()=>ge()&&(()=>{var te=so(),ke=te.firstChild;return te.$$click=()=>{var Ne;Ve&&f(!0),o(!0),(Ne=t.options)!=null&&Ne.onOpen&&t.options.onOpen()},l(te,"background","none"),l(te,"border","none"),l(te,"cursor","pointer"),l(te,"padding","0"),ce(ke,"src",mn),te})()})(),null),k(X,(()=>{var ge=J(()=>!!i());return()=>ge()&&(()=>{const te=st(()=>Gi(e.getCurrentMessages())),ke=()=>Ki(te(),H()),Ne=(pe,Fe,he)=>eo(pe,Fe,he,{props:t,currentConversationId:H(),formattedMessages:te(),popup:e,setSubmittedMessages:ee},E,Ke()),lt=(pe,Fe,he)=>to(pe,Fe,he,{props:t,currentConversationId:H(),formattedMessages:te(),popup:e,setEditingMsgIdBot:w,setEditingMsgIdUser:P},E,Ke()),at=()=>v(null,null,function*(){var pe,Fe;if(!(!n().trim()||!t.remoteRepo)){if(te().length===0){yield ye();return}if(yield Zn(t.remoteRepo)){alert("Bạn chưa hoàn thành khảo sát hiện tại!");return}if(!H()){yield vn(t,e,T,Z,h,ee,y,oe,()=>we(!0));try{const he=Lt(),se="BOT~rasaconnector",$=`Cuộc hội thoại mới ${he.slice(-4)}`,W=yield e.createConversationAsync({id:he,name:$,type:"BOT",members:[{userId:se,role:"MEMBER"}],updatedAt:new Date});e.setCurrentConversation({id:W.id,name:W.name,type:"BOT"}),T(W.id),Z(W.name),h(!0),ee(new Set),y(!1),yield e.listMessagesAsync(W.id),oe&&oe()}catch(he){console.error("Tạo hội thoại mới thất bại:",he);return}}try{let he={};const se=te().filter(W=>W.sender==="bot"&&Array.isArray(W.contents)&&W.contents.length>0&&W.contents[W.contents.length-1].metadata);if(se.length>0){const W=se[se.length-1];he=((Fe=(pe=W.contents)==null?void 0:pe[W.contents.length-1])==null?void 0:Fe.metadata)||{}}const $={body:{type:"NORMAL",content:n(),metadata:he},conversationId:H(),sender:{id:"me"}};yield e.sendMessageAsync($),s("")}catch(he){console.error("Error sending message:",he)}}}),ln=()=>v(null,null,function*(){var pe,Fe;if(!(!e||te().length===0||!H()||!q()))try{const he=te()[0].id,se=30,$=te().findIndex(Ue=>Ue.id===he);if($>=0&&$-se>=0)return;const W=document.querySelector(".chat-messages-container"),de=W==null?void 0:W.querySelector(`[data-message-id="${he}"]`),le=(pe=de==null?void 0:de.offsetTop)!=null?pe:0,qe=(Fe=W==null?void 0:W.scrollTop)!=null?Fe:0;yield e.listMessagesAsync("BEFORE",he,se),requestAnimationFrame(()=>{var be;const Ue=W==null?void 0:W.querySelector(`[data-message-id="${he}"]`),je=(be=Ue==null?void 0:Ue.offsetTop)!=null?be:0;W&&(W.scrollTop=je-(le-qe))})}catch(he){console.error("Error loading more messages:",he)}});return nt(()=>{te(),i()&&requestAnimationFrame(()=>{const pe=document.querySelector(".chat-messages-container");pe&&(pe.scrollTop=pe.scrollHeight)})}),(()=>{var pe=lo(),Fe=pe.firstChild,he=Fe.firstChild;return k(pe,ae(Qe,{get when(){return _()},get children(){var se=oo(),$=se.firstChild,W=$.firstChild,de=W.firstChild,le=de.nextSibling,qe=W.nextSibling,Ue=qe.firstChild,je=Ue.nextSibling;return se.$$click=()=>D(!1),$.$$click=be=>be.stopPropagation(),l($,"padding","20px"),l($,"width","400px"),l(de,"display","block"),le.$$keydown=be=>{be.key==="Enter"&&R()},le.$$input=be=>me(be.currentTarget.value),k(W,ae(Qe,{get when(){return ve()},get children(){var be=io();return l(be,"color","red"),k(be,ve),be}}),null),Ue.$$click=()=>D(!1),je.$$click=R,l(je,"color","#fff"),fe(()=>le.value=Q()),se}}),Fe),k(pe,(()=>{var se=J(()=>!a());return()=>se()&&(()=>{var $=uo(),W=$.firstChild,de=W.nextSibling,le=de.firstChild,qe=le.nextSibling,Ue=qe.nextSibling,je=de.nextSibling,be=je.firstChild,Xe=be.firstChild;return W.$$click=()=>c(!0),ce(W,"src",Ms),l(W,"width","28px"),l(W,"height","28px"),l(W,"cursor","pointer"),ce(le,"src",mn),l(le,"width","32px"),l(le,"height","32px"),l(qe,"color","#1A1D1F"),l(Ue,"color","#1AAF74"),l(je,"display","flex"),l(je,"gap","12px"),k(je,(()=>{var pt=J(()=>!u());return()=>pt()&&(()=>{var dt=ho(),xn=dt.firstChild;return dt.$$click=()=>{var ls;f(!1),d(!0),(ls=t.options)!=null&&ls.onMaximize&&t.options.onMaximize()},l(dt,"background","none"),l(dt,"border","none"),l(dt,"cursor","pointer"),l(dt,"padding","0"),ce(xn,"src",Es),l(xn,"width","20px"),l(xn,"height","20px"),dt})()})(),be),be.$$click=()=>{var pt;o(!1),setTimeout(()=>{f(!1),d(!1)},250),(pt=t.options)!=null&&pt.onClose&&t.options.onClose()},l(be,"background","none"),l(be,"border","none"),l(be,"cursor","pointer"),l(be,"padding","0"),ce(Xe,"src",Bn),l(Xe,"width","20px"),l(Xe,"height","20px"),$})()})(),Fe),l(Fe,"display","flex"),l(Fe,"height","100%"),k(Fe,(()=>{var se=J(()=>!!a());return()=>se()?ae(Fn,{onClose:()=>{var $;o(!1),setTimeout(()=>{f(!1),d(!1)},250),($=t.options)!=null&&$.onClose&&t.options.onClose()},onShrink:()=>{var $;d(!1),($=t.options)!=null&&$.onShrink&&t.options.onShrink()},open:!0,fullScreen:!0,get isMobile(){return u()},onMobile:()=>{d(!1),f(!0)},onNewConversation:B,get options(){return t.options},get remoteRepo(){var $;return($=t.remoteRepo)!=null?$:void 0},onDeleteConversation:Ae,onReloadConversations:$=>oe=$,onLoadMessages:($,W)=>v(null,null,function*(){if(e.setCurrentConversation({id:$,name:"",type:"BOT"}),T($),Z(W||""),h(!0),t.remoteRepo)try{yield e.listMessagesAsync($),ee(new Set),y(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const de=document.querySelector(".chat-messages-container");de&&(de.scrollTop=de.scrollHeight),y(!1)})})}catch(de){console.error("Error loading messages:",de),y(!1)}})}):ae(Fn,{onClose:()=>c(!1),get open(){return r()},fullScreen:!1,get isMobile(){return u()},onNewConversation:B,get options(){return t.options},get remoteRepo(){var $;return($=t.remoteRepo)!=null?$:void 0},onDeleteConversation:Ae,onReloadConversations:$=>oe=$,onLoadMessages:($,W)=>v(null,null,function*(){if(e.setCurrentConversation({id:$,name:"",type:"BOT"}),T($),Z(W||""),h(!0),t.remoteRepo)try{yield e.listMessagesAsync($);const de=e.getCurrentMessages();console.log("message data: ",de),ee(new Set),y(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const le=document.querySelector(".chat-messages-container");le&&(le.scrollTop=le.scrollHeight),y(!1)})})}catch(de){console.error("Error loading messages:",de),y(!1)}})})})(),he),l(he,"flex","1"),l(he,"display","flex"),l(he,"position","relative"),l(he,"height","100%"),k(he,(()=>{var se=J(()=>!!a());return()=>se()&&ae(ji,{get currentStep(){return K()},get totalSteps(){return S()},get title(){return F()},get isSurveyConversation(){return A()},get sections(){return Ke()},get progress(){var $;return($=g())==null?void 0:$.progress}})})(),null),k(he,ae(_i,{get messages(){return te()},get isFullScreen(){return a()},get inputHeight(){return J(()=>!!a())()?U():void 0},get isMobile(){return u()},onSubmit:Ne,onUpdateSurvey:lt,get surveyOptions(){return j()},get submittedMessages(){return N()},onLoadMoreMessages:ln,get conversationId(){return H()},get isLoadingMessages(){return b()},get editingMsgIdBot(){return m()},setEditingMsgIdBot:w,get editingMsgIdUser(){return I()},setEditingMsgIdUser:P}),null),k(he,(()=>{var se=J(()=>!!a());return()=>se()?(()=>{var $=fo(),W=$.firstChild;return k($,(()=>{var de=J(()=>te().length===0);return()=>de()&&(()=>{var le=go();return l(le,"width","100%"),l(le,"color","#1A1D1F"),le})()})(),W),l(W,"width","100%"),k(W,ae(On,{get input(){return n()},setInput:s,sendMessage:at,onHeightChange:V,get disabled(){return!ke()}})),k($,(()=>{var de=J(()=>te().length===0);return()=>de()&&(()=>{var le=po();return k(le,ae(Qt,{text:"Khảo sát đầu tư"}),null),k(le,ae(Qt,{text:"Mục tiêu tài chính"}),null),k(le,ae(Qt,{text:"Khả năng chấp nhận rủi ro"}),null),k(le,ae(Qt,{text:"Khả năng chấp nhận rủi ro"}),null),le})()})(),null),fe(()=>it($,`chat-input-floating-box${te().length>0?" chat-input-floating-box--with-messages":""}`)),$})():ae(On,{get input(){return n()},setInput:s,sendMessage:at,onHeightChange:V,get disabled(){return!ke()}})})(),null),k(pe,ae(Qe,{get when(){return!!G()},get children(){var se=ro(),$=se.firstChild,W=$.firstChild,de=W.nextSibling,le=de.firstChild,qe=le.nextSibling,Ue=de.nextSibling,je=Ue.firstChild,be=je.nextSibling;return se.$$click=()=>Ae(null),$.$$click=Xe=>Xe.stopPropagation(),l($,"padding","20px"),l($,"width","350px"),k(qe,()=>{var Xe;return(Xe=G())==null?void 0:Xe.name}),je.$$click=Xe=>{Xe.stopPropagation(),Ae(null)},be.$$click=Xe=>v(null,null,function*(){var pt;Xe.stopPropagation();try{yield(pt=t.remoteRepo)==null?void 0:pt.deleteConversationAsync(G().id),Ae(null),oe&&oe()}catch(dt){alert("Xóa hội thoại thất bại!")}}),l(be,"color","#fff"),se}}),null),k(pe,ae(Qe,{get when(){return re()},get children(){var se=ao(),$=se.firstChild,W=$.firstChild,de=W.nextSibling,le=de.firstChild;return se.$$click=()=>we(!1),$.$$click=qe=>qe.stopPropagation(),l($,"padding","20px"),l($,"width","350px"),le.$$click=()=>we(!1),l(le,"color","#fff"),se}}),null),k(pe,ae(Qe,{get when(){return ne()},get children(){var se=co(),$=se.firstChild,W=$.firstChild,de=W.firstChild;de.nextSibling;var le=W.nextSibling,qe=le.firstChild,Ue=qe.nextSibling,je=Ue.nextSibling;return se.$$click=()=>M(!1),$.$$click=be=>be.stopPropagation(),l($,"padding","20px"),l($,"width","400px"),qe.$$click=()=>M(!1),Ue.$$click=()=>M(!1),je.$$click=()=>v(null,null,function*(){M(!1),yield vn(t,e,T,Z,h,ee,y,oe,()=>we(!0))}),l(je,"color","#fff"),se}}),null),fe(se=>{var $=`chat-popup-window${i()?" chat-popup-window--open":""}${a()?" chat-popup-window--fullscreen":""}${u()?" chat-popup-window--mobile":""}`,W=a()||u()?{"--chat-input-height":`${U()}px`}:void 0;return $!==se.e&&it(pe,se.e=$),se.t=pn(pe,W,se.t),se},{e:void 0,t:void 0}),pe})()})()})(),null),X})()}yt(["click","input","keydown"]);function mo(t){return ae(Co,{get remoteRepo(){return t.remoteRepo},get options(){return t.options}})}class ht extends Error{constructor(e,n){const s=new.target.prototype;super(`${e}: Status code '${n}'`),this.statusCode=n,this.__proto__=s}}class wn extends Error{constructor(e="A timeout occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class Ge extends Error{constructor(e="An abort occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class vo extends Error{constructor(e,n){const s=new.target.prototype;super(e),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=s}}class wo extends Error{constructor(e,n){const s=new.target.prototype;super(e),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=s}}class yo extends Error{constructor(e,n){const s=new.target.prototype;super(e),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=s}}class Yn extends Error{constructor(e){const n=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class bo extends Error{constructor(e,n){const s=new.target.prototype;super(e),this.innerErrors=n,this.__proto__=s}}class Xn{constructor(e,n,s){this.statusCode=e,this.statusText=n,this.content=s}}class en{get(e,n){return this.send(ie(z({},n),{method:"GET",url:e}))}post(e,n){return this.send(ie(z({},n),{method:"POST",url:e}))}delete(e,n){return this.send(ie(z({},n),{method:"DELETE",url:e}))}getCookieString(e){return""}}var p;(function(t){t[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Information=2]="Information",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.None=6]="None"})(p||(p={}));class Ot{constructor(){}log(e,n){}}Ot.instance=new Ot;const _o="8.0.17";class $e{static isRequired(e,n){if(e==null)throw new Error(`The '${n}' argument is required.`)}static isNotEmpty(e,n){if(!e||e.match(/^\s*$/))throw new Error(`The '${n}' argument should not be empty.`)}static isIn(e,n,s){if(!(e in n))throw new Error(`Unknown ${s} value: ${e}.`)}}class Ie{static get isBrowser(){return!Ie.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!Ie.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!Ie.isNode&&typeof window=="object"&&typeof window.document=="undefined"}static get isNode(){return typeof process!="undefined"&&process.release&&process.release.name==="node"}}function Ft(t,e){let n="";return ft(t)?(n=`Binary data of length ${t.byteLength}`,e&&(n+=`. Content: '${So(t)}'`)):typeof t=="string"&&(n=`String data of length ${t.length}`,e&&(n+=`. Content: '${t}'`)),n}function So(t){const e=new Uint8Array(t);let n="";return e.forEach(s=>{const i=s<16?"0":"";n+=`0x${i}${s.toString(16)} `}),n.substr(0,n.length-1)}function ft(t){return t&&typeof ArrayBuffer!="undefined"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}function Qn(t,e,n,s,i,o){return v(this,null,function*(){const r={},[c,a]=It();r[c]=a,t.log(p.Trace,`(${e} transport) sending data. ${Ft(i,o.logMessageContent)}.`);const d=ft(i)?"arraybuffer":"text",u=yield n.post(s,{content:i,headers:z(z({},r),o.headers),responseType:d,timeout:o.timeout,withCredentials:o.withCredentials});t.log(p.Trace,`(${e} transport) request complete. Response status: ${u.statusCode}.`)})}function Ao(t){return t===void 0?new tn(p.Information):t===null?Ot.instance:t.log!==void 0?t:new tn(t)}class xo{constructor(e,n){this._subject=e,this._observer=n}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(n=>{})}}class tn{constructor(e){this._minLevel=e,this.out=console}log(e,n){if(e>=this._minLevel){const s=`[${new Date().toISOString()}] ${p[e]}: ${n}`;switch(e){case p.Critical:case p.Error:this.out.error(s);break;case p.Warning:this.out.warn(s);break;case p.Information:this.out.info(s);break;default:this.out.log(s);break}}}}function It(){let t="X-SignalR-User-Agent";return Ie.isNode&&(t="User-Agent"),[t,Io(_o,ko(),Eo(),Mo())]}function Io(t,e,n,s){let i="Microsoft SignalR/";const o=t.split(".");return i+=`${o[0]}.${o[1]}`,i+=` (${t}; `,e&&e!==""?i+=`${e}; `:i+="Unknown OS; ",i+=`${n}`,s?i+=`; ${s}`:i+="; Unknown Runtime Version",i+=")",i}function ko(){if(Ie.isNode)switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}else return""}function Mo(){if(Ie.isNode)return process.versions.node}function Eo(){return Ie.isNode?"NodeJS":"Browser"}function yn(t){return t.stack?t.stack:t.message?t.message:`${t}`}function To(){if(typeof globalThis!="undefined")return globalThis;if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw new Error("could not find global")}class Ro extends en{constructor(e){if(super(),this._logger=e,typeof fetch=="undefined"||Ie.isNode){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._jar=new(n("tough-cookie")).CookieJar,typeof fetch=="undefined"?this._fetchType=n("node-fetch"):this._fetchType=fetch,this._fetchType=n("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(To());if(typeof AbortController=="undefined"){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._abortControllerType=n("abort-controller")}else this._abortControllerType=AbortController}send(e){return v(this,null,function*(){if(e.abortSignal&&e.abortSignal.aborted)throw new Ge;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const n=new this._abortControllerType;let s;e.abortSignal&&(e.abortSignal.onabort=()=>{n.abort(),s=new Ge});let i=null;if(e.timeout){const a=e.timeout;i=setTimeout(()=>{n.abort(),this._logger.log(p.Warning,"Timeout from HTTP request."),s=new wn},a)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},ft(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");let o;try{o=yield this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:e.withCredentials===!0?"include":"same-origin",headers:z({"X-Requested-With":"XMLHttpRequest"},e.headers),method:e.method,mode:"cors",redirect:"follow",signal:n.signal})}catch(a){throw s||(this._logger.log(p.Warning,`Error from HTTP request. ${a}.`),a)}finally{i&&clearTimeout(i),e.abortSignal&&(e.abortSignal.onabort=null)}if(!o.ok){const a=yield Gn(o,"text");throw new ht(a||o.statusText,o.status)}const c=yield Gn(o,e.responseType);return new Xn(o.status,o.statusText,c)})}getCookieString(e){let n="";return Ie.isNode&&this._jar&&this._jar.getCookies(e,(s,i)=>n=i.join("; ")),n}}function Gn(t,e){let n;switch(e){case"arraybuffer":n=t.arrayBuffer();break;case"text":n=t.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`);default:n=t.text();break}return n}class $o extends en{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new Ge):e.method?e.url?new Promise((n,s)=>{const i=new XMLHttpRequest;i.open(e.method,e.url,!0),i.withCredentials=e.withCredentials===void 0?!0:e.withCredentials,i.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.content===""&&(e.content=void 0),e.content&&(ft(e.content)?i.setRequestHeader("Content-Type","application/octet-stream"):i.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const o=e.headers;o&&Object.keys(o).forEach(r=>{i.setRequestHeader(r,o[r])}),e.responseType&&(i.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{i.abort(),s(new Ge)}),e.timeout&&(i.timeout=e.timeout),i.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),i.status>=200&&i.status<300?n(new Xn(i.status,i.statusText,i.response||i.responseText)):s(new ht(i.response||i.responseText||i.statusText,i.status))},i.onerror=()=>{this._logger.log(p.Warning,`Error from HTTP request. ${i.status}: ${i.statusText}.`),s(new ht(i.statusText,i.status))},i.ontimeout=()=>{this._logger.log(p.Warning,"Timeout from HTTP request."),s(new wn)},i.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Po extends en{constructor(e){if(super(),typeof fetch!="undefined"||Ie.isNode)this._httpClient=new Ro(e);else if(typeof XMLHttpRequest!="undefined")this._httpClient=new $o(e);else throw new Error("No usable HttpClient found.")}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new Ge):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}class We{static write(e){return`${e}${We.RecordSeparator}`}static parse(e){if(e[e.length-1]!==We.RecordSeparator)throw new Error("Message is incomplete.");const n=e.split(We.RecordSeparator);return n.pop(),n}}We.RecordSeparatorCode=30,We.RecordSeparator=String.fromCharCode(We.RecordSeparatorCode);class Do{writeHandshakeRequest(e){return We.write(JSON.stringify(e))}parseHandshakeResponse(e){let n,s;if(ft(e)){const c=new Uint8Array(e),a=c.indexOf(We.RecordSeparatorCode);if(a===-1)throw new Error("Message is incomplete.");const d=a+1;n=String.fromCharCode.apply(null,Array.prototype.slice.call(c.slice(0,d))),s=c.byteLength>d?c.slice(d).buffer:null}else{const c=e,a=c.indexOf(We.RecordSeparator);if(a===-1)throw new Error("Message is incomplete.");const d=a+1;n=c.substring(0,d),s=c.length>d?c.substring(d):null}const i=We.parse(n),o=JSON.parse(i[0]);if(o.type)throw new Error("Expected a handshake response from the server.");return[s,o]}}var Y;(function(t){t[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close",t[t.Ack=8]="Ack",t[t.Sequence=9]="Sequence"})(Y||(Y={}));class Bo{constructor(){this.observers=[]}next(e){for(const n of this.observers)n.next(e)}error(e){for(const n of this.observers)n.error&&n.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new xo(this,e)}}class Ho{constructor(e,n,s){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=e,this._connection=n,this._bufferSize=s}_send(e){return v(this,null,function*(){const n=this._protocol.writeMessage(e);let s=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let i=()=>{},o=()=>{};ft(n)?this._bufferedByteCount+=n.byteLength:this._bufferedByteCount+=n.length,this._bufferedByteCount>=this._bufferSize&&(s=new Promise((r,c)=>{i=r,o=c})),this._messages.push(new Lo(n,this._totalMessageCount,i,o))}try{this._reconnectInProgress||(yield this._connection.send(n))}catch(i){this._disconnected()}yield s})}_ack(e){let n=-1;for(let s=0;s<this._messages.length;s++){const i=this._messages[s];if(i._id<=e.sequenceId)n=s,ft(i._message)?this._bufferedByteCount-=i._message.byteLength:this._bufferedByteCount-=i._message.length,i._resolver();else if(this._bufferedByteCount<this._bufferSize)i._resolver();else break}n!==-1&&(this._messages=this._messages.slice(n+1))}_shouldProcessMessage(e){if(this._waitForSequenceMessage)return e.type!==Y.Sequence?!1:(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(e))return!0;const n=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,n<=this._latestReceivedSequenceId?(n===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=n,this._ackTimer(),!0)}_resetSequence(e){if(e.sequenceId>this._nextReceivingSequenceId){this._connection.stop(new Error("Sequence ID greater than amount of messages we've received."));return}this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}_resend(){return v(this,null,function*(){const e=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;yield this._connection.send(this._protocol.writeMessage({type:Y.Sequence,sequenceId:e}));const n=this._messages;for(const s of n)yield this._connection.send(s._message);this._reconnectInProgress=!1})}_dispose(e){e!=null||(e=new Error("Unable to reconnect to server."));for(const n of this._messages)n._rejector(e)}_isInvocationMessage(e){switch(e.type){case Y.Invocation:case Y.StreamItem:case Y.Completion:case Y.StreamInvocation:case Y.CancelInvocation:return!0;case Y.Close:case Y.Sequence:case Y.Ping:case Y.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(()=>v(this,null,function*(){try{this._reconnectInProgress||(yield this._connection.send(this._protocol.writeMessage({type:Y.Ack,sequenceId:this._latestReceivedSequenceId})))}catch(e){}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0}),1e3))}}class Lo{constructor(e,n,s,i){this._message=e,this._id=n,this._resolver=s,this._rejector=i}}const Oo=30*1e3,Fo=15*1e3,No=1e5;var Se;(function(t){t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting"})(Se||(Se={}));class bn{static create(e,n,s,i,o,r,c){return new bn(e,n,s,i,o,r,c)}constructor(e,n,s,i,o,r,c){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(p.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},$e.isRequired(e,"connection"),$e.isRequired(n,"logger"),$e.isRequired(s,"protocol"),this.serverTimeoutInMilliseconds=o!=null?o:Oo,this.keepAliveIntervalInMilliseconds=r!=null?r:Fo,this._statefulReconnectBufferSize=c!=null?c:No,this._logger=n,this._protocol=s,this.connection=e,this._reconnectPolicy=i,this._handshakeProtocol=new Do,this.connection.onreceive=a=>this._processIncomingData(a),this.connection.onclose=a=>this._connectionClosed(a),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=Se.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:Y.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==Se.Disconnected&&this._connectionState!==Se.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}_startWithStateTransitions(){return v(this,null,function*(){if(this._connectionState!==Se.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=Se.Connecting,this._logger.log(p.Debug,"Starting HubConnection.");try{yield this._startInternal(),Ie.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=Se.Connected,this._connectionStarted=!0,this._logger.log(p.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=Se.Disconnected,this._logger.log(p.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}})}_startInternal(){return v(this,null,function*(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=new Promise((n,s)=>{this._handshakeResolver=n,this._handshakeRejecter=s});yield this.connection.start(this._protocol.transferFormat);try{let n=this._protocol.version;this.connection.features.reconnect||(n=1);const s={protocol:this._protocol.name,version:n};if(this._logger.log(p.Debug,"Sending handshake request."),yield this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(s)),this._logger.log(p.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),yield e,this._stopDuringStartError)throw this._stopDuringStartError;(this.connection.features.reconnect||!1)&&(this._messageBuffer=new Ho(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||(yield this._sendMessage(this._cachedPingMessage))}catch(n){throw this._logger.log(p.Debug,`Hub handshake failed with error '${n}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),yield this.connection.stop(n),n}})}stop(){return v(this,null,function*(){const e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),yield this._stopPromise;try{yield e}catch(n){}})}_stopInternal(e){if(this._connectionState===Se.Disconnected)return this._logger.log(p.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===Se.Disconnecting)return this._logger.log(p.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const n=this._connectionState;return this._connectionState=Se.Disconnecting,this._logger.log(p.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(p.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(n===Se.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new Ge("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}_sendCloseMessage(){return v(this,null,function*(){try{yield this._sendWithProtocol(this._createCloseMessage())}catch(e){}})}stream(e,...n){const[s,i]=this._replaceStreamingParams(n),o=this._createStreamInvocation(e,n,i);let r;const c=new Bo;return c.cancelCallback=()=>{const a=this._createCancelInvocation(o.invocationId);return delete this._callbacks[o.invocationId],r.then(()=>this._sendWithProtocol(a))},this._callbacks[o.invocationId]=(a,d)=>{if(d){c.error(d);return}else a&&(a.type===Y.Completion?a.error?c.error(new Error(a.error)):c.complete():c.next(a.item))},r=this._sendWithProtocol(o).catch(a=>{c.error(a),delete this._callbacks[o.invocationId]}),this._launchStreams(s,r),c}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...n){const[s,i]=this._replaceStreamingParams(n),o=this._sendWithProtocol(this._createInvocation(e,n,!0,i));return this._launchStreams(s,o),o}invoke(e,...n){const[s,i]=this._replaceStreamingParams(n),o=this._createInvocation(e,n,!1,i);return new Promise((c,a)=>{this._callbacks[o.invocationId]=(u,f)=>{if(f){a(f);return}else u&&(u.type===Y.Completion?u.error?a(new Error(u.error)):c(u.result):a(new Error(`Unexpected message type: ${u.type}`)))};const d=this._sendWithProtocol(o).catch(u=>{a(u),delete this._callbacks[o.invocationId]});this._launchStreams(s,d)})}on(e,n){!e||!n||(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(n)===-1&&this._methods[e].push(n))}off(e,n){if(!e)return;e=e.toLowerCase();const s=this._methods[e];if(s)if(n){const i=s.indexOf(n);i!==-1&&(s.splice(i,1),s.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const n=this._protocol.parseMessages(e,this._logger);for(const s of n)if(!(this._messageBuffer&&!this._messageBuffer._shouldProcessMessage(s)))switch(s.type){case Y.Invocation:this._invokeClientMethod(s).catch(i=>{this._logger.log(p.Error,`Invoke client method threw error: ${yn(i)}`)});break;case Y.StreamItem:case Y.Completion:{const i=this._callbacks[s.invocationId];if(i){s.type===Y.Completion&&delete this._callbacks[s.invocationId];try{i(s)}catch(o){this._logger.log(p.Error,`Stream callback threw error: ${yn(o)}`)}}break}case Y.Ping:break;case Y.Close:{this._logger.log(p.Information,"Close message received from server.");const i=s.error?new Error("Server returned an error on close: "+s.error):void 0;s.allowReconnect===!0?this.connection.stop(i):this._stopPromise=this._stopInternal(i);break}case Y.Ack:this._messageBuffer&&this._messageBuffer._ack(s);break;case Y.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(s);break;default:this._logger.log(p.Warning,`Invalid message type: ${s.type}.`);break}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let n,s;try{[s,n]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(i){const o="Error parsing handshake response: "+i;this._logger.log(p.Error,o);const r=new Error(o);throw this._handshakeRejecter(r),r}if(n.error){const i="Server returned handshake error: "+n.error;this._logger.log(p.Error,i);const o=new Error(i);throw this._handshakeRejecter(o),o}else this._logger.log(p.Debug,"Server handshake complete.");return this._handshakeResolver(),s}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if((!this.connection.features||!this.connection.features.inherentKeepAlive)&&(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle===void 0)){let e=this._nextKeepAlive-new Date().getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(()=>v(this,null,function*(){if(this._connectionState===Se.Connected)try{yield this._sendMessage(this._cachedPingMessage)}catch(n){this._cleanupPingTimer()}}),e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}_invokeClientMethod(e){return v(this,null,function*(){const n=e.target.toLowerCase(),s=this._methods[n];if(!s){this._logger.log(p.Warning,`No client method with the name '${n}' found.`),e.invocationId&&(this._logger.log(p.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),yield this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)));return}const i=s.slice(),o=!!e.invocationId;let r,c,a;for(const d of i)try{const u=r;r=yield d.apply(this,e.arguments),o&&r&&u&&(this._logger.log(p.Error,`Multiple results provided for '${n}'. Sending error to server.`),a=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),c=void 0}catch(u){c=u,this._logger.log(p.Error,`A callback for the method '${n}' threw error '${u}'.`)}a?yield this._sendWithProtocol(a):o?(c?a=this._createCompletionMessage(e.invocationId,`${c}`,null):r!==void 0?a=this._createCompletionMessage(e.invocationId,null,r):(this._logger.log(p.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),a=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),yield this._sendWithProtocol(a)):r&&this._logger.log(p.Error,`Result given for '${n}' method but server is not expecting a result.`)})}_connectionClosed(e){this._logger.log(p.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new Ge("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===Se.Disconnecting?this._completeClose(e):this._connectionState===Se.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===Se.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=Se.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(e!=null?e:new Error("Connection closed.")),this._messageBuffer=void 0),Ie.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(n=>n.apply(this,[e]))}catch(n){this._logger.log(p.Error,`An onclose callback called with error '${e}' threw error '${n}'.`)}}}_reconnect(e){return v(this,null,function*(){const n=Date.now();let s=0,i=e!==void 0?e:new Error("Attempting to reconnect due to a unknown error."),o=this._getNextRetryDelay(s++,0,i);if(o===null){this._logger.log(p.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),this._completeClose(e);return}if(this._connectionState=Se.Reconnecting,e?this._logger.log(p.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(p.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(r=>r.apply(this,[e]))}catch(r){this._logger.log(p.Error,`An onreconnecting callback called with error '${e}' threw error '${r}'.`)}if(this._connectionState!==Se.Reconnecting){this._logger.log(p.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.");return}}for(;o!==null;){if(this._logger.log(p.Information,`Reconnect attempt number ${s} will start in ${o} ms.`),yield new Promise(r=>{this._reconnectDelayHandle=setTimeout(r,o)}),this._reconnectDelayHandle=void 0,this._connectionState!==Se.Reconnecting){this._logger.log(p.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");return}try{if(yield this._startInternal(),this._connectionState=Se.Connected,this._logger.log(p.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(r=>r.apply(this,[this.connection.connectionId]))}catch(r){this._logger.log(p.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${r}'.`)}return}catch(r){if(this._logger.log(p.Information,`Reconnect attempt failed because of error '${r}'.`),this._connectionState!==Se.Reconnecting){this._logger.log(p.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),this._connectionState===Se.Disconnecting&&this._completeClose();return}i=r instanceof Error?r:new Error(r.toString()),o=this._getNextRetryDelay(s++,Date.now()-n,i)}}this._logger.log(p.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${s} failed attempts. Connection disconnecting.`),this._completeClose()})}_getNextRetryDelay(e,n,s){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:e,retryReason:s})}catch(i){return this._logger.log(p.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${n}) threw error '${i}'.`),null}}_cancelCallbacksWithError(e){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(s=>{const i=n[s];try{i(null,e)}catch(o){this._logger.log(p.Error,`Stream 'error' callback called with '${e}' threw error: ${yn(o)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,n,s,i){if(s)return i.length!==0?{arguments:n,streamIds:i,target:e,type:Y.Invocation}:{arguments:n,target:e,type:Y.Invocation};{const o=this._invocationId;return this._invocationId++,i.length!==0?{arguments:n,invocationId:o.toString(),streamIds:i,target:e,type:Y.Invocation}:{arguments:n,invocationId:o.toString(),target:e,type:Y.Invocation}}}_launchStreams(e,n){if(e.length!==0){n||(n=Promise.resolve());for(const s in e)e[s].subscribe({complete:()=>{n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(s)))},error:i=>{let o;i instanceof Error?o=i.message:i&&i.toString?o=i.toString():o="Unknown error",n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(s,o)))},next:i=>{n=n.then(()=>this._sendWithProtocol(this._createStreamItemMessage(s,i)))}})}}_replaceStreamingParams(e){const n=[],s=[];for(let i=0;i<e.length;i++){const o=e[i];if(this._isObservable(o)){const r=this._invocationId;this._invocationId++,n[r]=o,s.push(r.toString()),e.splice(i,1)}}return[n,s]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,n,s){const i=this._invocationId;return this._invocationId++,s.length!==0?{arguments:n,invocationId:i.toString(),streamIds:s,target:e,type:Y.StreamInvocation}:{arguments:n,invocationId:i.toString(),target:e,type:Y.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:Y.CancelInvocation}}_createStreamItemMessage(e,n){return{invocationId:e,item:n,type:Y.StreamItem}}_createCompletionMessage(e,n,s){return n?{error:n,invocationId:e,type:Y.Completion}:{invocationId:e,result:s,type:Y.Completion}}_createCloseMessage(){return{type:Y.Close}}}const Uo=[0,2e3,1e4,3e4,null];class Kn{constructor(e){this._retryDelays=e!==void 0?[...e,null]:Uo}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class gt{}gt.Authorization="Authorization",gt.Cookie="Cookie";class jo extends en{constructor(e,n){super(),this._innerClient=e,this._accessTokenFactory=n}send(e){return v(this,null,function*(){let n=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(n=!1,this._accessToken=yield this._accessTokenFactory()),this._setAuthorizationHeader(e);const s=yield this._innerClient.send(e);return n&&s.statusCode===401&&this._accessTokenFactory?(this._accessToken=yield this._accessTokenFactory(),this._setAuthorizationHeader(e),yield this._innerClient.send(e)):s})}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[gt.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[gt.Authorization]&&delete e.headers[gt.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}var De;(function(t){t[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling"})(De||(De={}));var Oe;(function(t){t[t.Text=1]="Text",t[t.Binary=2]="Binary"})(Oe||(Oe={}));let zo=class{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}};class Jn{get pollAborted(){return this._pollAbort.aborted}constructor(e,n,s){this._httpClient=e,this._logger=n,this._pollAbort=new zo,this._options=s,this._running=!1,this.onreceive=null,this.onclose=null}connect(e,n){return v(this,null,function*(){if($e.isRequired(e,"url"),$e.isRequired(n,"transferFormat"),$e.isIn(n,Oe,"transferFormat"),this._url=e,this._logger.log(p.Trace,"(LongPolling transport) Connecting."),n===Oe.Binary&&typeof XMLHttpRequest!="undefined"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[s,i]=It(),o=z({[s]:i},this._options.headers),r={abortSignal:this._pollAbort.signal,headers:o,timeout:1e5,withCredentials:this._options.withCredentials};n===Oe.Binary&&(r.responseType="arraybuffer");const c=`${e}&_=${Date.now()}`;this._logger.log(p.Trace,`(LongPolling transport) polling: ${c}.`);const a=yield this._httpClient.get(c,r);a.statusCode!==200?(this._logger.log(p.Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new ht(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,r)})}_poll(e,n){return v(this,null,function*(){try{for(;this._running;)try{const s=`${e}&_=${Date.now()}`;this._logger.log(p.Trace,`(LongPolling transport) polling: ${s}.`);const i=yield this._httpClient.get(s,n);i.statusCode===204?(this._logger.log(p.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):i.statusCode!==200?(this._logger.log(p.Error,`(LongPolling transport) Unexpected response code: ${i.statusCode}.`),this._closeError=new ht(i.statusText||"",i.statusCode),this._running=!1):i.content?(this._logger.log(p.Trace,`(LongPolling transport) data received. ${Ft(i.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(i.content)):this._logger.log(p.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(s){this._running?s instanceof wn?this._logger.log(p.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=s,this._running=!1):this._logger.log(p.Trace,`(LongPolling transport) Poll errored after shutdown: ${s.message}`)}}finally{this._logger.log(p.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}})}send(e){return v(this,null,function*(){return this._running?Qn(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return v(this,null,function*(){this._logger.log(p.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{yield this._receiving,this._logger.log(p.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[n,s]=It();e[n]=s;const i={headers:z(z({},e),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials};let o;try{yield this._httpClient.delete(this._url,i)}catch(r){o=r}o?o instanceof ht&&(o.statusCode===404?this._logger.log(p.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(p.Trace,`(LongPolling transport) Error sending a DELETE request: ${o}`)):this._logger.log(p.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(p.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}})}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(p.Trace,e),this.onclose(this._closeError)}}}class Vo{constructor(e,n,s,i){this._httpClient=e,this._accessToken=n,this._logger=s,this._options=i,this.onreceive=null,this.onclose=null}connect(e,n){return v(this,null,function*(){return $e.isRequired(e,"url"),$e.isRequired(n,"transferFormat"),$e.isIn(n,Oe,"transferFormat"),this._logger.log(p.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((s,i)=>{let o=!1;if(n!==Oe.Text){i(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));return}let r;if(Ie.isBrowser||Ie.isWebWorker)r=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const c=this._httpClient.getCookieString(e),a={};a.Cookie=c;const[d,u]=It();a[d]=u,r=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:z(z({},a),this._options.headers)})}try{r.onmessage=c=>{if(this.onreceive)try{this._logger.log(p.Trace,`(SSE transport) data received. ${Ft(c.data,this._options.logMessageContent)}.`),this.onreceive(c.data)}catch(a){this._close(a);return}},r.onerror=c=>{o?this._close():i(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},r.onopen=()=>{this._logger.log(p.Information,`SSE connected to ${this._url}`),this._eventSource=r,o=!0,s()}}catch(c){i(c);return}})})}send(e){return v(this,null,function*(){return this._eventSource?Qn(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class Wo{constructor(e,n,s,i,o,r){this._logger=s,this._accessTokenFactory=n,this._logMessageContent=i,this._webSocketConstructor=o,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=r}connect(e,n){return v(this,null,function*(){$e.isRequired(e,"url"),$e.isRequired(n,"transferFormat"),$e.isIn(n,Oe,"transferFormat"),this._logger.log(p.Trace,"(WebSockets transport) Connecting.");let s;return this._accessTokenFactory&&(s=yield this._accessTokenFactory()),new Promise((i,o)=>{e=e.replace(/^http/,"ws");let r;const c=this._httpClient.getCookieString(e);let a=!1;if(Ie.isNode||Ie.isReactNative){const d={},[u,f]=It();d[u]=f,s&&(d[gt.Authorization]=`Bearer ${s}`),c&&(d[gt.Cookie]=c),r=new this._webSocketConstructor(e,void 0,{headers:z(z({},d),this._headers)})}else s&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(s)}`);r||(r=new this._webSocketConstructor(e)),n===Oe.Binary&&(r.binaryType="arraybuffer"),r.onopen=d=>{this._logger.log(p.Information,`WebSocket connected to ${e}.`),this._webSocket=r,a=!0,i()},r.onerror=d=>{let u=null;typeof ErrorEvent!="undefined"&&d instanceof ErrorEvent?u=d.error:u="There was an error with the transport",this._logger.log(p.Information,`(WebSockets transport) ${u}.`)},r.onmessage=d=>{if(this._logger.log(p.Trace,`(WebSockets transport) data received. ${Ft(d.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(d.data)}catch(u){this._close(u);return}},r.onclose=d=>{if(a)this._close(d);else{let u=null;typeof ErrorEvent!="undefined"&&d instanceof ErrorEvent?u=d.error:u="WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",o(new Error(u))}}})})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(p.Trace,`(WebSockets transport) sending data. ${Ft(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(p.Trace,"(WebSockets transport) socket closed."),this.onclose&&(this._isCloseEvent(e)&&(e.wasClean===!1||e.code!==1e3)?this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)):e instanceof Error?this.onclose(e):this.onclose())}_isCloseEvent(e){return e&&typeof e.wasClean=="boolean"&&typeof e.code=="number"}}const es=100;class qo{constructor(e,n={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,$e.isRequired(e,"url"),this._logger=Ao(n.logger),this.baseUrl=this._resolveUrl(e),n=n||{},n.logMessageContent=n.logMessageContent===void 0?!1:n.logMessageContent,typeof n.withCredentials=="boolean"||n.withCredentials===void 0)n.withCredentials=n.withCredentials===void 0?!0:n.withCredentials;else throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");n.timeout=n.timeout===void 0?100*1e3:n.timeout;let s=null,i=null;if(Ie.isNode&&typeof require!="undefined"){const o=typeof __webpack_require__=="function"?__non_webpack_require__:require;s=o("ws"),i=o("eventsource")}!Ie.isNode&&typeof WebSocket!="undefined"&&!n.WebSocket?n.WebSocket=WebSocket:Ie.isNode&&!n.WebSocket&&s&&(n.WebSocket=s),!Ie.isNode&&typeof EventSource!="undefined"&&!n.EventSource?n.EventSource=EventSource:Ie.isNode&&!n.EventSource&&typeof i!="undefined"&&(n.EventSource=i),this._httpClient=new jo(n.httpClient||new Po(this._logger),n.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=n,this.onreceive=null,this.onclose=null}start(e){return v(this,null,function*(){if(e=e||Oe.Binary,$e.isIn(e,Oe,"transferFormat"),this._logger.log(p.Debug,`Starting connection with transfer format '${Oe[e]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),yield this._startInternalPromise,this._connectionState==="Disconnecting"){const n="Failed to start the HttpConnection before stop() was called.";return this._logger.log(p.Error,n),yield this._stopPromise,Promise.reject(new Ge(n))}else if(this._connectionState!=="Connected"){const n="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(p.Error,n),Promise.reject(new Ge(n))}this._connectionStarted=!0})}send(e){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new _n(this.transport)),this._sendQueue.send(e))}stop(e){return v(this,null,function*(){if(this._connectionState==="Disconnected")return this._logger.log(p.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve();if(this._connectionState==="Disconnecting")return this._logger.log(p.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;this._connectionState="Disconnecting",this._stopPromise=new Promise(n=>{this._stopPromiseResolver=n}),yield this._stopInternal(e),yield this._stopPromise})}_stopInternal(e){return v(this,null,function*(){this._stopError=e;try{yield this._startInternalPromise}catch(n){}if(this.transport){try{yield this.transport.stop()}catch(n){this._logger.log(p.Error,`HttpConnection.transport.stop() threw error '${n}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(p.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")})}_startInternal(e){return v(this,null,function*(){let n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation)if(this._options.transport===De.WebSockets)this.transport=this._constructTransport(De.WebSockets),yield this._startTransport(n,e);else throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");else{let s=null,i=0;do{if(s=yield this._getNegotiationResponse(n),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new Ge("The connection was stopped during negotiation.");if(s.error)throw new Error(s.error);if(s.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(s.url&&(n=s.url),s.accessToken){const o=s.accessToken;this._accessTokenFactory=()=>o,this._httpClient._accessToken=o,this._httpClient._accessTokenFactory=void 0}i++}while(s.url&&i<es);if(i===es&&s.url)throw new Error("Negotiate redirection limit exceeded.");yield this._createTransport(n,this._options.transport,s,e)}this.transport instanceof Jn&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(p.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(s){return this._logger.log(p.Error,"Failed to start the connection: "+s),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(s)}})}_getNegotiationResponse(e){return v(this,null,function*(){const n={},[s,i]=It();n[s]=i;const o=this._resolveNegotiateUrl(e);this._logger.log(p.Debug,`Sending negotiation request: ${o}.`);try{const r=yield this._httpClient.post(o,{content:"",headers:z(z({},n),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(r.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${r.statusCode}'`));const c=JSON.parse(r.content);return(!c.negotiateVersion||c.negotiateVersion<1)&&(c.connectionToken=c.connectionId),c.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new Yn("Client didn't negotiate Stateful Reconnect but the server did.")):c}catch(r){let c="Failed to complete negotiation with the server: "+r;return r instanceof ht&&r.statusCode===404&&(c=c+" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(p.Error,c),Promise.reject(new Yn(c))}})}_createConnectUrl(e,n){return n?e+(e.indexOf("?")===-1?"?":"&")+`id=${n}`:e}_createTransport(e,n,s,i){return v(this,null,function*(){let o=this._createConnectUrl(e,s.connectionToken);if(this._isITransport(n)){this._logger.log(p.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=n,yield this._startTransport(o,i),this.connectionId=s.connectionId;return}const r=[],c=s.availableTransports||[];let a=s;for(const d of c){const u=this._resolveTransportOrError(d,n,i,(a==null?void 0:a.useStatefulReconnect)===!0);if(u instanceof Error)r.push(`${d.transport} failed:`),r.push(u);else if(this._isITransport(u)){if(this.transport=u,!a){try{a=yield this._getNegotiationResponse(e)}catch(f){return Promise.reject(f)}o=this._createConnectUrl(e,a.connectionToken)}try{yield this._startTransport(o,i),this.connectionId=a.connectionId;return}catch(f){if(this._logger.log(p.Error,`Failed to start the transport '${d.transport}': ${f}`),a=void 0,r.push(new yo(`${d.transport} failed: ${f}`,De[d.transport])),this._connectionState!=="Connecting"){const U="Failed to select transport before stop() was called.";return this._logger.log(p.Debug,U),Promise.reject(new Ge(U))}}}}return r.length>0?Promise.reject(new bo(`Unable to connect to the server with any of the available transports. ${r.join(" ")}`,r)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))})}_constructTransport(e){switch(e){case De.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Wo(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case De.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Vo(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case De.LongPolling:return new Jn(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,n){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=s=>v(this,null,function*(){let i=!1;if(this.features.reconnect)try{this.features.disconnected(),yield this.transport.connect(e,n),yield this.features.resend()}catch(o){i=!0}else{this._stopConnection(s);return}i&&this._stopConnection(s)}):this.transport.onclose=s=>this._stopConnection(s),this.transport.connect(e,n)}_resolveTransportOrError(e,n,s,i){const o=De[e.transport];if(o==null)return this._logger.log(p.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(Zo(n,o))if(e.transferFormats.map(c=>Oe[c]).indexOf(s)>=0){if(o===De.WebSockets&&!this._options.WebSocket||o===De.ServerSentEvents&&!this._options.EventSource)return this._logger.log(p.Debug,`Skipping transport '${De[o]}' because it is not supported in your environment.'`),new vo(`'${De[o]}' is not supported in your environment.`,o);this._logger.log(p.Debug,`Selecting transport '${De[o]}'.`);try{return this.features.reconnect=o===De.WebSockets?i:void 0,this._constructTransport(o)}catch(c){return c}}else return this._logger.log(p.Debug,`Skipping transport '${De[o]}' because it does not support the requested transfer format '${Oe[s]}'.`),new Error(`'${De[o]}' does not support ${Oe[s]}.`);else return this._logger.log(p.Debug,`Skipping transport '${De[o]}' because it was disabled by the client.`),new wo(`'${De[o]}' is disabled by the client.`,o)}_isITransport(e){return e&&typeof e=="object"&&"connect"in e}_stopConnection(e){if(this._logger.log(p.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState==="Disconnected"){this._logger.log(p.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`);return}if(this._connectionState==="Connecting")throw this._logger.log(p.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),e?this._logger.log(p.Error,`Connection disconnected with error '${e}'.`):this._logger.log(p.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(n=>{this._logger.log(p.Error,`TransportSendQueue.stop() threw error '${n}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(n){this._logger.log(p.Error,`HttpConnection.onclose(${e}) threw error '${n}'.`)}}}_resolveUrl(e){if(e.lastIndexOf("https://",0)===0||e.lastIndexOf("http://",0)===0)return e;if(!Ie.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const n=window.document.createElement("a");return n.href=e,this._logger.log(p.Information,`Normalizing '${e}' to '${n.href}'.`),n.href}_resolveNegotiateUrl(e){const n=new URL(e);n.pathname.endsWith("/")?n.pathname+="negotiate":n.pathname+="/negotiate";const s=new URLSearchParams(n.searchParams);return s.has("negotiateVersion")||s.append("negotiateVersion",this._negotiateVersion.toString()),s.has("useStatefulReconnect")?s.get("useStatefulReconnect")==="true"&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&s.append("useStatefulReconnect","true"),n.search=s.toString(),n.toString()}}function Zo(t,e){return!t||(e&t)!==0}class _n{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new nn,this._transportResult=new nn,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new nn),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}_sendLoop(){return v(this,null,function*(){for(;;){if(yield this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new nn;const e=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):_n._concatBuffers(this._buffer);this._buffer.length=0;try{yield this._transport.send(n),e.resolve()}catch(s){e.reject(s)}}})}static _concatBuffers(e){const n=e.map(o=>o.byteLength).reduce((o,r)=>o+r),s=new Uint8Array(n);let i=0;for(const o of e)s.set(new Uint8Array(o),i),i+=o.byteLength;return s.buffer}}class nn{constructor(){this.promise=new Promise((e,n)=>[this._resolver,this._rejecter]=[e,n])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}const Yo="json";class Xo{constructor(){this.name=Yo,this.version=2,this.transferFormat=Oe.Text}parseMessages(e,n){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];n===null&&(n=Ot.instance);const s=We.parse(e),i=[];for(const o of s){const r=JSON.parse(o);if(typeof r.type!="number")throw new Error("Invalid payload.");switch(r.type){case Y.Invocation:this._isInvocationMessage(r);break;case Y.StreamItem:this._isStreamItemMessage(r);break;case Y.Completion:this._isCompletionMessage(r);break;case Y.Ping:break;case Y.Close:break;case Y.Ack:this._isAckMessage(r);break;case Y.Sequence:this._isSequenceMessage(r);break;default:n.log(p.Information,"Unknown message type '"+r.type+"' ignored.");continue}i.push(r)}return i}writeMessage(e){return We.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),e.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_isAckMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(e,n){if(typeof e!="string"||e==="")throw new Error(n)}}const Qo={trace:p.Trace,debug:p.Debug,info:p.Information,information:p.Information,warn:p.Warning,warning:p.Warning,error:p.Error,critical:p.Critical,none:p.None};function Go(t){const e=Qo[t.toLowerCase()];if(typeof e!="undefined")return e;throw new Error(`Unknown log level: ${t}`)}class Ko{configureLogging(e){if($e.isRequired(e,"logging"),Jo(e))this.logger=e;else if(typeof e=="string"){const n=Go(e);this.logger=new tn(n)}else this.logger=new tn(e);return this}withUrl(e,n){return $e.isRequired(e,"url"),$e.isNotEmpty(e,"url"),this.url=e,typeof n=="object"?this.httpConnectionOptions=z(z({},this.httpConnectionOptions),n):this.httpConnectionOptions=ie(z({},this.httpConnectionOptions),{transport:n}),this}withHubProtocol(e){return $e.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new Kn(e):this.reconnectPolicy=e:this.reconnectPolicy=new Kn,this}withServerTimeout(e){return $e.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return $e.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=e==null?void 0:e.bufferSize,this}build(){const e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const n=new qo(this.url,e);return bn.create(n,this.logger||Ot.instance,this.protocol||new Xo,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}function Jo(t){return t.log!==void 0}function Be(t,e={}){var c;const{popupRequestInfo:n}=window;t=Rt(t);const s=(c=n==null?void 0:n.credentialType)==null?void 0:c.toUpperCase(),i=n==null?void 0:n.accessToken,r=z(z({},{method:"GET",headers:{}}),e);switch(r.body&&typeof r.body=="object"&&(r.body instanceof FormData?r.headers=ie(z({},r.headers),{"Content-Type":"multipart/form-data"}):(r.headers=ie(z({},r.headers),{"Content-Type":"application/json"}),r.body=JSON.stringify(r.body))),s){case"COOKIE":r.credentials="include";break;case"QUERY":break;default:i&&(r.headers=ie(z({},r.headers),{Authorization:`Bearer ${i}`}));break}return fetch(t,r).then(a=>{if(!a.ok){console.error(`HTTP error! status: ${a.status}`);return}return a.json()}).then(a=>{if(a&&a.code){if(a.code!=="0"){console.error(`API error! code: ${a.code}, message: ${a.message}`);return}return a.data}return a}).catch(a=>{console.error("Error fetching data:",a)})}function Nt(t,e){if(!e)return t;let n="";for(let s in e){const i=e[s];i!=null&&(n.length>0&&(n+="&"),n+=`${encodeURIComponent(s)}=${encodeURIComponent(i)}`)}return t.indexOf("?")===-1?t+="?"+n:t+="&"+n,t}function ts(t){return v(this,null,function*(){if(!t||t.length===0)return[];const s=yield Be("user/batch/get",{method:"POST",body:{ids:t}});return!s||!Array.isArray(s)?[]:s.map(i=>({id:i.id,username:i.username,fullName:i.fullName,avatarUrl:i.avatarUrl}))})}const Ut=window,er=Ut.indexedDB||Ut.mozIndexedDB||Ut.webkitIndexedDB||Ut.msIndexedDB||Ut.shimIndexedDB,tr="chatPopupDb",nr=1,sn="users";function sr(t){if(!t.objectStoreNames.contains(sn)){const e=t.createObjectStore(sn,{keyPath:"id",autoIncrement:!1});["username","fullName","avatarUrl"].forEach(n=>e.createIndex(n,n,{unique:!1}))}}let on;function ir(){return new Promise((t,e)=>{if(on)t(on);else{const n=er.open(tr,nr);n.onerror=s=>e(s.target.error),n.onsuccess=s=>{on=s.target.result,t(on)},n.onupgradeneeded=s=>{const i=s.target.result;sr(i)}}})}function ns(t,e){return v(this,null,function*(){const n=yield ir();return n?n.transaction(sn,t,e).objectStore(sn):void 0})}function or(t){return new Promise((e,n)=>v(null,null,function*(){if(t==="SYSTEM"){e({id:"SYSTEM",username:"system",fullName:"Hệ thống"});return}const s=yield ns("readonly");if(!s){n(new Error("User object store not found"));return}const i=s.get(t);i.onsuccess=o=>v(null,null,function*(){const r=o.target.result;e(r)}),i.onerror=o=>n(o.target.error)}))}function rr(t){return v(this,null,function*(){const e=yield ns("readwrite");if(!e)throw new Error("User object store not found");return new Promise((n,s)=>{const i=e.put(t);i.onsuccess=o=>n(o.target.result),i.onerror=o=>s(o.target.error)})})}function ar(t){return v(this,null,function*(){const e=t.map(s=>or(s));return(yield Promise.all(e)).filter(s=>s!==void 0)})}function kt(t){return v(this,null,function*(){const e=Array.from(new Set(t.filter(r=>typeof r=="string"&&r.length>0))),n=yield ar(e),s=e.filter(r=>!n.some(c=>c.id===r)),i=yield ts(s);yield Promise.all(i.map(r=>rr(r)));const o=[...n,...i];return new Map(o.map(r=>[r.id,r]))})}function rn(t){return{id:t.id||t.conversationId,name:t.name,lastMessage:t.lastMessage,updatedAt:t.updatedAt||t.dateTime,type:t.type,membersCount:t.membersCount,status:t.status,isPinned:t.isPinned,isRead:t.isRead,traceId:t.traceId}}function rt(t,e){if(!t)return;let n;e||t.quotedMessage&&(n=rt(t.quotedMessage,!0));const s=t.body;return s&&Array.isArray(s.files)&&(s.files=s.files.map(i=>{const o=i.thumbId?Rt(`file/${i.thumbId}`):void 0,r=Rt(`file/${i.id||i.fileId}`);return{id:i.id||i.fileId,thumbId:i.thumbId,url:r,name:i.name,contentType:i.contentType,thumbUrl:o}})),{id:t.id||t.messageId,conversationId:t.conversationId,senderId:t.senderId||t.editedBy,sender:t.sender,body:s,sentAt:t.sentAt,deleted:t.deleted,edited:t.edited,mentions:t.mentions,deletedFor:t.deletedFor,quotedMessage:n,traceId:t.traceId}}function an(t){return v(this,null,function*(){const e=t.lastMessage?[t.lastMessage.senderId]:[],n=yield kt(e);if(t.lastMessage){const s=n.get(t.lastMessage.senderId);s&&(t.lastMessage.sender=s,t.lastMessage.sentAt=t.lastMessage.sentAt?new Date(t.lastMessage.sentAt):new Date)}return{id:t.id,name:t.name,lastMessage:t.lastMessage,updatedAt:new Date(t.updatedAt),type:t.type,membersCount:t.membersCount,status:t.status,isPinned:t.isPinned,isRead:t.isRead,traceId:t.traceId}})}function Mt(t,e=new Set){return t.senderId&&e.add(t.senderId),t.quotedMessage&&Mt(t.quotedMessage,e),e}function Et(t,e){const n=t.sender||e.get(t.senderId),s=t.quotedMessage?Et(t.quotedMessage,e):void 0;return t.sender=n,s&&(t.quotedMessage=s),t}function Tt(t){if(!t)return;const e=t.quotedMessage?Tt(t.quotedMessage):void 0,n={id:t.id,conversationId:t.conversationId,sender:t.sender,body:t.body,sentAt:t.sentAt?new Date(t.sentAt):new Date,deleted:t.deleted,edited:t.edited,mentions:t.mentions,deletedFor:t.deletedFor,traceId:t.traceId};return e&&(n.quotedMessage=e),n}function ss(t,e){var c;if(!t)return console.error("URL base is not defined."),"";e=e?e.startsWith("/")?e.slice(1):e:"";let n=t.endsWith("/")?`${t}${e}`:`${t}/${e}`;n.endsWith("/")&&(n=n.slice(0,-1));const{popupRequestInfo:s}=window,i=(c=s==null?void 0:s.credentialType)==null?void 0:c.toUpperCase(),o=s==null?void 0:s.credentialName,r=s==null?void 0:s.accessToken;switch(i){case"COOKIE":const a=new URL(n);a.searchParams.append("credentialType",i),a.searchParams.append("credentialName",o||""),n=a.toString();break;case"QUERY":if(r){const d=new URL(n);d.searchParams.append("access_token",r),n=d.toString()}break}return n}function Rt(t){const{popupRequestInfo:e}=window,n=e==null?void 0:e.apiUrlBase;return ss(n,t)}function cr(t){const{popupRequestInfo:e}=window,n=t||(e==null?void 0:e.hubUrlBase);return ss(n)}function lr(t){var i;let e=cr(t);const{popupRequestInfo:n}=window,s=(i=n==null?void 0:n.credentialType)==null?void 0:i.toUpperCase();if(s!="COOKIE"&&s!="QUERY"){const o=n==null?void 0:n.accessToken;if(o){const r=new URL(e);r.searchParams.append("access_token",o),e=r.toString()}}return new Ko().withUrl(e).configureLogging(p.Information).withAutomaticReconnect().build()}const Sn=window;Sn.messagesCache={};function dr(t,e,n,s){return v(this,null,function*(){const i=Nt(`message/conversation/${t}/user`,{direction:e,messageId:n,top:s}),o=yield Be(i);return!o||!Array.isArray(o)?[]:o.filter(r=>!!r).map(r=>rt(r))})}function ur(t){return v(this,null,function*(){const e="message";let n;t.quotedMessage&&(n=t.quotedMessage.id,n&&(Sn.messagesCache[n]=t.quotedMessage));const s={conversationId:t.conversationId,body:t.body,quotedId:n,traceId:t.traceId},i=yield Be(e,{method:"POST",body:s});return i.quotedMessage=t.quotedMessage,rt(i)})}function hr(t){return v(this,null,function*(){if(!t||!t.id)return;const e=`message/${t.id}`;let n;t.quotedMessage&&(n=t.quotedMessage.id,n&&(Sn.messagesCache[n]=t.quotedMessage));const s={body:t.body,quotedId:n,mentions:t.mentions},i=yield Be(e,{method:"POST",body:s});return i.quotedMessage=t.quotedMessage,rt(i)})}function fr(t,e){return v(this,null,function*(){if(!t)return!1;e||(e="Recall");const n=`message/${t}/delete`;return!!(yield Be(n,{method:"POST",body:{type:e}}))})}function is(t){return v(this,null,function*(){if(!t)return;const e=`message/${t}`,n=yield Be(e);if(n)return rt(n)})}function gr(t){return v(this,null,function*(){if(!t||t.length===0)return[];const s=yield Be("message/batch/get",{method:"POST",body:{ids:t}});return!s||!Array.isArray(s)?[]:s.map(i=>rt(i))})}function pr(t,e,n,s){return v(this,null,function*(){var c;const i=Nt("aggregate/search",{conversationId:t,keyword:e,from:n,top:s,type:"MESSAGE"}),r=(c=(yield Be(i)).filter(a=>a.type==="MESSAGE").at(0))==null?void 0:c.items;return r?r.map(a=>rt(a)):[]})}const cn=window;function Cr(t,e){return v(this,null,function*(){if(!e||!t)return;if(!t.quotedMessage&&t.quotedId){const c=cn.messagesCache[t.quotedId];c?(t.quotedMessage=c,delete cn.messagesCache[t.quotedId]):t.quotedMessage=yield is(t.quotedId)}const n=rt(t);if(!n)return;const s=Mt(n),i=yield kt(Array.from(s)),o=Et(n,i),r=Tt(o);e(r)})}function mr(t,e){return v(this,null,function*(){if(!e||!t)return;const n=rn(t);if(!n)return;const s=yield an(n);e(s)})}function vr(t,e){if(!e||!t)return;const{conversationId:n,name:s}=t;!n||!s||e(n,s)}function wr(t,e){if(!e||!t)return;const{conversationId:n}=t;n&&e(n)}function yr(t,e){return v(this,null,function*(){if(!e||!t)return;if(!t.quotedMessage&&t.quotedId){const c=cn.messagesCache[t.quotedId];c?(t.quotedMessage=c,delete cn.messagesCache[t.quotedId]):t.quotedMessage=yield is(t.quotedId)}const n=rt(t);if(!n)return;const s=Mt(n),i=yield kt(Array.from(s)),o=Et(n,i),r=Tt(o);e(r)})}function br(t,e){if(!e||!t)return;const{messageId:n,conversationId:s,type:i,deletedBy:o}=t;!n||!s||e({messageId:n,conversationId:s,deleteType:i||"Recall",deletedBy:o||""})}let ze;function _r(t){return ze&&ze.stop(),ze=lr(t),ze?(ze.on("UserStatusChanged",n=>console.log("UserStatusChanged",n)),{onConnected(n){ze.on("Connected",n)},onMessageSent(n){ze.on("MessageSent",s=>v(null,null,function*(){yield Cr(s,n)}))},onMessageEdited(n){ze.on("MessageEdited",s=>v(null,null,function*(){yield yr(s,n)}))},onMessageDeleted(n){ze.on("MessageDeleted",s=>{br(s,n)})},onConversationCreated(n){ze.on("ConversationCreated",s=>v(null,null,function*(){yield mr(s,n)}))},onConversationBasicInfoChanged(n){ze.on("ConversationBasicInfoChanged",s=>{vr(s,n)})},onConversationDeleted(n){ze.on("ConversationDeleted",s=>{wr(s,n)})},start:()=>ze.start(),stop:()=>ze.stop()}):void 0}function Sr(){return new Promise(t=>{t([{name:"Khiếu nại và hỗ trợ",description:"Tạo khiếu nại của khách hàng và được trợ giúp bởi hỗ trợ viên",conversationType:"HELP",icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABGCAYAAABbnhMrAAAAAXNSR0IArs4c6QAAG/hJREFUeF7tXHk8lNv/n2HGPggRcVEporihuvJttVaylW6khlJdKfuaJbJlK2QZVBSVdlFp0WZJkmgh5ep+lSWSyBIGv9fnMcd3cmds6d7++D2v1zTT85xzPue8z2f/nAce9//XdyGA/67eP7jzwMAACw6HY8XhcH14PL7/B5Ob0PD/OoCvXr0iNTY2ylVXV8s0NDRIf/z4Uby5uVmgvb19Sk9PDyesioWFhcrFxdXNx8fXws/P/1FYWPidpKTkWxERkYrffvutHI/H901o9ZPQ6V8BsLq6WuTevXuaJSUl/6mqqlJpaWmZ8enTJ1JXVxdwGw6PxwNo2Ad+DwwM4Pr7+3F9fX3YB+7x8PDgSCTSZ3Fx8VIFBYUiNTW13NmzZ9+SkZHpngRcxjzEPw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SdahO/4xHnDG0vanATA5Odnk8OHDlObmZn50uAm9gA3hGVTWaCcl+jdt2hSlqal5qr6+XrqsrEyptLR0cXV1tVJvby8XiUT6oKysfM/Q0PCioaFh5kT/dsNYwJvUSGSsBBm1gwOeBnr62c+eP9NAZ2noD0WCgw2gQhgHIPLw8LRzcnE1trW2inb39uBJJFKrlJTUU/g7CsuWLburoaGR/095Az8FB2Kv33t4ZBXkF2hAGgrCOThKi6piEJ2gI7q0cO6roKDgi9mzZV4oq6o+k5WVLZ4zZ87zsbzq/z0bzajvTwEgTCyJQjGNij4S0tTUNB1q0vTHdSFBAWBCqZVAIPRtMt10xIa854C43MQjiMkC8qcBEBaUceHCurPnLlgWlzxZ1tXZyY/iXnQiVUpKqszYeH3Kot8WHVFRURk8xPMvXz8VgIAFJCbu3Lyj9t93b+Xq6z9M7+ntIXBzcjfJzpF9M3f+3KJZs2Y1/suYfUP+pwPwZwJnLHP5P2JCPxnrY2whAAAAAElFTkSuQmCC"},{name:"Tư vấn đầu tư",description:"Tạo một cuộc hội thoại để bắt đầu nhận được các tư vấn đầu tư",botId:"BOT~rasaconnector",isDefault:!0,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABZCAYAAACpHqNlAAAAAXNSR0IArs4c6QAAG71JREFUeF7tXAlYU0fXnpuQBAgCURFRqQvwsbhABUGgoihFoAhal7pUxaVaQVvr8nXRPvWrUpdafxcEra0VFVwQRRG1LqAoS63WBRcgAQSV1QbByBIg+f8zNxNuYoDEBfX7e5+HhyR3ljPvnG3OnBkK/fO8EALUi9SOjY3tW1paOlRGydhyOUtOIZlMJqfkzDZZlFzlu1ztvab+KblqnbZolFOUyjgoSo6/y+T07yy17/AbRckouZzV1M3cvMLCwiK/c+fOOY6Ojk/b6kv9vc4ALl669ItLly4uKyoq6lRWVobbY46X+VltXLrS1i7l5U0y1KlTJ9StW7eKvn37Jvv7+x9ydnY+1q9fP6k2BOgEoLGpSUF1VVUv0jCLzQaeo7/qxjT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5uPzfoLfqFHHXfr1K9IVgBct/9IAJIRAtCbheMLw+IOHJySnJAcWFxd3I2JNgg8kEEpWEsxBPLP8IhQqDBJwWx+rPnc+CAhMDBjld8jXm74943U9Lx1A5kAu37zc5+TR38ecOXN6fGZmphsAxtydI8dlweAAqPgOa8WqgOzdwsXXYKEFAoF4iJfX6fEfjo339PQ827t378evCzSVCW8PIiCrIC4uzvfwkSMTU86njC4rLTVRbmMydKD6+hWuv7Pva5/uH+Af/8HoDxJcB7jmtwe9uvTxSjlQEyHpV9Otjx85MSY5+dx4kUjkVCN5yiGcB4eyQe9ZWFjk+fr6Hvfz8zsUFBR0SZcBtXfZdgeQOcALGRfs7+fdtxKLxRa1tbVUx44dq6ytrfMsLCxy7OzsnrQ3GM/T32sF8HkIftPq/C/BcWIskM+NvgAAAABJRU5ErkJggg=="}])})}function Ar(t,e){return v(this,null,function*(){var a,d;const n=Nt("conversation/user/pinned",{top:t,type:e,ignoredFields:"members"}),s=Nt("conversation/user",{top:t,type:e,ignoredFields:"members"}),i=yield Promise.all([Be(n),Be(s)]);let o=(a=i[0])==null?void 0:a.items,r=(d=i[1])==null?void 0:d.items;return o||(o=[]),r||(r=[]),[...o,...r].map(u=>rn(u))})}function xr(t){return v(this,null,function*(){const e=`conversation/${t}?ignoredFields=members`,n=yield Be(e);if(n)return rn(n)})}function Ir(t){return v(this,null,function*(){const e=t.type?t.type:"BOT";let n="conversation";const s={name:t.name,traceId:t.traceId};switch(e){case"BOT":n+="/bot",s.botId=t.members?t.members.filter(f=>{var U;return(U=f.userId)==null?void 0:U.startsWith("BOT~")}).map(f=>f.userId)[0]:null;break;case"SURVEY":n+="/survey",s.botId=t.members?t.members.filter(f=>{var U;return(U=f.userId)==null?void 0:U.startsWith("BOT~")}).map(f=>f.userId)[0]:null;break;case"GROUP":n+="/group",s.memberIds=t.members?t.members.filter(f=>f.id!=="me").map(f=>f.userId):[];break;case"HELP":n+="/help";break}const i=yield Be(n,{method:"POST",body:s}),{conversationId:o,name:r,type:c,membersCount:a,updatedAt:d,traceId:u}=i;return{id:o,name:r,type:c,membersCount:a,updatedAt:d,traceId:u}})}function kr(t,e){return v(this,null,function*(){let n="conversation";return e?n+=`/${t}/pin`:n+=`/${t}/unpin`,yield Be(n,{method:"POST",body:{}}),!0})}function Mr(t,e){return v(this,null,function*(){const n=`conversation/${t}`;return yield Be(n,{method:"PATCH",body:{name:e}}),!0})}function Er(t){return v(this,null,function*(){const e=`conversation/${t}/delete`;return yield Be(e,{method:"POST",body:{}}),!0})}function Tr(t,e,n){return v(this,null,function*(){var c;const s=Nt("aggregate/search",{keyword:t,from:e,top:n,type:"CONVERSATION"}),o=(c=(yield Be(s)).filter(a=>a.type==="CONVERSATION").at(0))==null?void 0:c.items;if(!o)return[];const r=[...new Set(o.map(a=>a.lastMessageId))];if(r.length>0){const a=yield gr(r),d={};a.forEach(u=>{u&&(d[u.id]=u)}),o.forEach(u=>{u.lastMessageId&&(u.lastMessage=d[u.lastMessageId])})}return o.map(a=>rn(a))})}function Rr(){return v(this,null,function*(){return yield Be("/survey/progress")})}function $r(){return v(this,null,function*(){return yield Be("/survey/question-section")})}function Pr(t){return v(this,null,function*(){const e="survey/conversation",n={name:t.name,traceId:t.traceId,botId:t.members?t.members.filter(i=>{var o;return(o=i.userId)==null?void 0:o.startsWith("BOT~")}).map(i=>i.userId)[0]:null};return yield Be(e,{method:"POST",body:n})})}function Dr(t,e){return v(this,null,function*(){const n=yield Ar(t,e);return yield Promise.all(n.map(an))})}function Br(t){return v(this,null,function*(){const e=yield xr(t);return e?yield an(e):void 0})}function Hr(t,e,n){return v(this,null,function*(){const s=yield Tr(t,e,n);return yield Promise.all(s.map(an))})}function Lr(t){return v(this,null,function*(){const e=yield Ir(t);return{id:e.id,name:e.name,type:e.type,membersCount:e.membersCount,updatedAt:new Date(e.updatedAt)}})}function Or(t,e){return kr(t,e)}function Fr(t,e){return Mr(t,e)}function Nr(t){return Er(t)}function Ur(t){return v(this,null,function*(){return yield Pr(t)})}function jr(t,e){var a;if(!t)return;const{popupRequestInfo:n}=window,s=Rt("file"),i=new XMLHttpRequest,o=(a=n==null?void 0:n.credentialType)==null?void 0:a.toUpperCase(),r=n==null?void 0:n.accessToken;switch(o){case"COOKIE":i.withCredentials=!0;break;case"QUERY":break;default:i.setRequestHeader("Authorization",`Bearer ${r}`);break}const c=new FormData;c.append("file",t),e&&(i.upload.onprogress=function(d){if(d.lengthComputable){const u=d.loaded/d.total*80;e({loaded:d.loaded,total:d.total,percent:u,status:"uploading"})}}),i.onload=function(){if(i.status===200){const d=JSON.parse(i.responseText);if(e){const u=d.thumbId?Rt(`file/${d.thumbId}`):void 0,f=Rt(`file/${d.fileId}`);e({loaded:d.size,total:d.size,percent:100,status:"done",httpCode:i.status,fileItem:{id:d.fileId,name:d.fileName,contentType:d.contentType,thumbId:d.thumbId,thumbUrl:u,url:f}})}}else e&&e({loaded:0,total:0,percent:0,status:"error",error:i.statusText,httpCode:i.status})},i.open("POST",s,!0),i.send(c),console.log(`------- Uploading file: ${t.name} to ${s}`)}function zr(t,e){jr(t,e)}function Vr(t,e,n,s){return v(this,null,function*(){const i=(yield dr(t,e,n,s)).filter(a=>!!a);if(!i||!Array.isArray(i))return[];const o=new Set;i.forEach(a=>Mt(a,o));const r=yield kt(Array.from(o));return i.map(a=>Et(a,r)).map(a=>Tt(a))})}function Wr(t){return v(this,null,function*(){const e=yield ur(t);if(!e)return;const n=Mt(e),s=yield kt(Array.from(n)),i=Et(e,s);return Tt(i)})}function qr(t){return v(this,null,function*(){return!!(yield hr(t))})}function Zr(t,e){return fr(t,e)}function Yr(t,e,n,s){return v(this,null,function*(){const i=yield pr(t,e,n,s);if(!i||!Array.isArray(i))return[];const o=new Set;i.forEach(a=>Mt(a,o));const r=yield kt(Array.from(o));return i.map(a=>Et(a,r)).map(a=>Tt(a))})}function Xr(t){return ts(t)}class Qr{constructor(e){Ce(this,"hubConnection");Ce(this,"onHubConnected",e=>{this.hubConnection.onConnected(n=>{window.currentUserId=n.userId,e(n)})});Ce(this,"onMessageSent",e=>{this.hubConnection.onMessageSent(n=>{n.conversationId=this.normalizeConvId(n.conversationId),this.normalizeSender(n.sender),e(n)})});Ce(this,"onMessageEdited",e=>{this.hubConnection.onMessageEdited(n=>{n.conversationId=this.normalizeConvId(n.conversationId),this.normalizeSender(n.sender),e(n)})});Ce(this,"onMessageDeleted",e=>{this.hubConnection.onMessageDeleted(e)});Ce(this,"onConversationCreated",e=>{this.hubConnection.onConversationCreated(n=>{this.normalizeConversation(n),e(n)})});Ce(this,"onConversationBasicInfoChanged",e=>{this.hubConnection.onConversationBasicInfoChanged((n,s)=>{n=this.normalizeConvId(n),e(n,s)})});Ce(this,"onConversationDeleted",e=>{this.hubConnection.onConversationDeleted(n=>{n=this.normalizeConvId(n),e(n)})});Ce(this,"getConversationAsync",e=>v(this,null,function*(){const n=this.denormalizeConvId(e),s=yield Br(n);if(s)return this.normalizeConversation(s),s}));Ce(this,"listConversationAsync",(e,n)=>v(this,null,function*(){const s=yield Dr(e,n);return s.forEach(i=>this.normalizeConversation(i)),s}));Ce(this,"searchConversationsAsync",(e,n,s)=>v(this,null,function*(){const i=yield Hr(e,n,s);return i.forEach(o=>this.normalizeConversation(o)),i}));Ce(this,"pinConversationAsync",(e,n)=>{const s=this.denormalizeConvId(e);return Or(s,n)});Ce(this,"createConversationAsync",e=>Lr(e));Ce(this,"updateConversationNameAsync",(e,n)=>{const s=this.denormalizeConvId(e);return Fr(s,n)});Ce(this,"deleteConversationAsync",e=>{const n=this.denormalizeConvId(e);return Nr(n)});Ce(this,"sendMessageAsync",e=>v(this,null,function*(){const n=z({},e);n.conversationId=this.denormalizeConvId(n.conversationId);const s=yield Wr(n);return this.normalizeSender(s.sender),s}));Ce(this,"listMessagesAsync",(e,n,s,i)=>v(this,null,function*(){const o=this.denormalizeConvId(e),r=yield Vr(o,n,s,i);return this.normalizeMessages(r),r}));Ce(this,"searchMessagesAsync",(e,n,s,i)=>v(this,null,function*(){const o=this.denormalizeConvId(e),r=yield Yr(o,n,s,i);return this.normalizeMessages(r),r}));Ce(this,"updateMessageAsync",e=>qr(e));Ce(this,"batchGetUsersAsync",e=>Xr(e));Ce(this,"deleteMessageAsync",(e,n)=>Zr(e,n));Ce(this,"uploadFile",(e,n)=>{zr(e,n)});Ce(this,"listChatTypesAsync",()=>v(null,null,function*(){return yield Sr()}));Ce(this,"getSurveyProgressAsync",()=>v(null,null,function*(){return yield Rr()}));Ce(this,"getSurveyQuestionSectionAsync",()=>v(null,null,function*(){return yield $r()}));Ce(this,"createSurveyConversationAsync",e=>v(null,null,function*(){return yield Ur(e)}));const n=_r(e);if(!n)throw new Error("Connect to hub error");this.hubConnection=n,this.hubConnection.start()}get currentUserId(){return window.currentUserId}normalizeConvId(e){return e.startsWith(`${this.currentUserId}~`)?e.replace(new RegExp(`^${this.currentUserId}`),"me"):e}denormalizeConvId(e){return e.replace(/^me/,this.currentUserId)}normalizeSender(e){e&&e.id===this.currentUserId&&(e.id="me")}normalizeConversation(e){e.id=this.normalizeConvId(e.id),e.lastMessage&&this.normalizeSender(e.lastMessage.sender)}normalizeMessages(e){e.forEach(n=>this.normalizeSender(n.sender))}}var Gr=O("<div>Loading...");const[An,Kr]=L(null),[Jr,e2]=L(null),He={},os={apiUrlBase:"http://dev.eztrade.fpts.com.vn/chatapi/api",hubUrlBase:"http://dev.eztrade.fpts.com.vn/chathub/hub/notification",credentialType:"cookie",credentialName:"aspfpt_sessiontoken"};window.popupRequestInfo=os;const rs=os.hubUrlBase,as=()=>{var s;const t=window.popupRequestInfo;if(!rs)throw new Error("VITE_PUBLIC_HUB_URL is not defined");const e=(s=t==null?void 0:t.credentialType)==null?void 0:s.toLowerCase();if(e!=="cookie"&&!(t!=null&&t.accessToken))throw new Error("Missing JWT token: accessToken chưa được gán vào popupRequestInfo");if(e!=="cookie"&&!window.currentUserId)throw new Error("Missing currentUserId: chưa chọn user");const n=new Qr(rs);Kr(n),n.onHubConnected(i=>{console.log("SignalR: Hub connected",i)}),n.onMessageSent(i=>{var o;console.log("SignalR: Message sent event received",i),(o=He.appendMessage)==null||o.call(He,i)}),n.onMessageEdited(i=>{var o;console.log("SignalR: Message edited event received",i),(o=He.updateMessage)==null||o.call(He,i)}),n.onMessageDeleted(i=>{var o;console.log("SignalR: Message deleted event received",i),(o=He.deleteMessage)==null||o.call(He,i)}),n.onConversationCreated(i=>{var o;console.log("SignalR: Conversation created event received",i),(o=He.appendConversation)==null||o.call(He,i)}),n.onConversationBasicInfoChanged((i,o)=>{var r;console.log("SignalR: Conversation name changed",i,o),(r=He.updateConversationName)==null||r.call(He,i,o)}),n.onConversationDeleted(i=>{var o;console.log("SignalR: Conversation deleted",i),(o=He.deleteConversation)==null||o.call(He,i)})};function cs(t,e){const n=typeof t=="string"?document.querySelector(t):t;if(!n)throw new Error(`Element "${t}" not found.`);e!=null&&e.credentialType&&(window.popupRequestInfo.credentialType=e.credentialType),e!=null&&e.accessToken&&(window.popupRequestInfo.accessToken=e.accessToken),e!=null&&e.currentUserId&&(window.currentUserId=e.currentUserId),e2(e),as(),Is(()=>ae(Qe,{get when(){return An()},get fallback(){return Gr()},get children(){return ae(Xi,{get remoteRepository(){return An()},exportMethods:He,get children(){return ae(mo,{get remoteRepo(){return An()},get options(){return Jr()}})}})}}),n)}typeof window!="undefined"&&(window.EzChat={createPopup:cs}),window.addEventListener("startChat",()=>{as()}),Te.createPopup=cs,Object.defineProperty(Te,Symbol.toStringTag,{value:"Module"})}));
|
|
17
17
|
//# sourceMappingURL=ezchat.umd.js.map
|