@_solaris/messenger-widget 0.5.3 → 0.5.5

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.
@@ -2,19 +2,19 @@
2
2
  * @vue/shared v3.5.34
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
- **/function Os(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const fe={},Nt=[],tt=()=>{},Gr=()=>!1,Dn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),jn=e=>e.startsWith("onUpdate:"),Ae=Object.assign,Is=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},wo=Object.prototype.hasOwnProperty,oe=(e,t)=>wo.call(e,t),V=Array.isArray,Pt=e=>_n(e)==="[object Map]",$t=e=>_n(e)==="[object Set]",Xs=e=>_n(e)==="[object Date]",J=e=>typeof e=="function",ve=e=>typeof e=="string",qe=e=>typeof e=="symbol",ae=e=>e!==null&&typeof e=="object",Yr=e=>(ae(e)||J(e))&&J(e.then)&&J(e.catch),Jr=Object.prototype.toString,_n=e=>Jr.call(e),ko=e=>_n(e).slice(8,-1),Qr=e=>_n(e)==="[object Object]",Ls=e=>ve(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Zt=Os(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Un=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Co=/-\w/g,Pe=Un(e=>e.replace(Co,t=>t.slice(1).toUpperCase())),Ao=/\B([A-Z])/g,kt=Un(e=>e.replace(Ao,"-$1").toLowerCase()),Hn=Un(e=>e.charAt(0).toUpperCase()+e.slice(1)),ts=Un(e=>e?`on${Hn(e)}`:""),at=(e,t)=>!Object.is(e,t),xn=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Xr=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},$n=e=>{const t=parseFloat(e);return isNaN(t)?e:t},So=e=>{const t=ve(e)?Number(e):NaN;return isNaN(t)?e:t};let Zs;const Vn=()=>Zs||(Zs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function je(e){if(V(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=ve(r)?Eo(r):je(r);if(i)for(const s in i)t[s]=i[s]}return t}else if(ve(e)||ae(e))return e}const xo=/;(?![^(]*\))/g,To=/:([^]+)/,Mo=/\/\*[^]*?\*\//g;function Eo(e){const t={};return e.replace(Mo,"").split(xo).forEach(n=>{if(n){const r=n.split(To);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function re(e){let t="";if(ve(e))t=e;else if(V(e))for(let n=0;n<e.length;n++){const r=re(e[n]);r&&(t+=r+" ")}else if(ae(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Oo="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Io=Os(Oo);function Zr(e){return!!e||e===""}function Lo(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Vt(e[r],t[r]);return n}function Vt(e,t){if(e===t)return!0;let n=Xs(e),r=Xs(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=qe(e),r=qe(t),n||r)return e===t;if(n=V(e),r=V(t),n||r)return n&&r?Lo(e,t):!1;if(n=ae(e),r=ae(t),n||r){if(!n||!r)return!1;const i=Object.keys(e).length,s=Object.keys(t).length;if(i!==s)return!1;for(const o in e){const a=e.hasOwnProperty(o),l=t.hasOwnProperty(o);if(a&&!l||!a&&l||!Vt(e[o],t[o]))return!1}}return String(e)===String(t)}function Rs(e,t){return e.findIndex(n=>Vt(n,t))}const ei=e=>!!(e&&e.__v_isRef===!0),O=e=>ve(e)?e:e==null?"":V(e)||ae(e)&&(e.toString===Jr||!J(e.toString))?ei(e)?O(e.value):JSON.stringify(e,ti,2):String(e),ti=(e,t)=>ei(t)?ti(e,t.value):Pt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,i],s)=>(n[ns(r,s)+" =>"]=i,n),{})}:$t(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ns(n))}:qe(t)?ns(t):ae(t)&&!V(t)&&!Qr(t)?String(t):t,ns=(e,t="")=>{var n;return qe(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
5
+ **/function Os(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const fe={},Bt=[],tt=()=>{},Yr=()=>!1,Dn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),jn=e=>e.startsWith("onUpdate:"),Ae=Object.assign,Is=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},ko=Object.prototype.hasOwnProperty,oe=(e,t)=>ko.call(e,t),V=Array.isArray,Pt=e=>_n(e)==="[object Map]",$t=e=>_n(e)==="[object Set]",Xs=e=>_n(e)==="[object Date]",J=e=>typeof e=="function",ve=e=>typeof e=="string",qe=e=>typeof e=="symbol",ae=e=>e!==null&&typeof e=="object",Jr=e=>(ae(e)||J(e))&&J(e.then)&&J(e.catch),Qr=Object.prototype.toString,_n=e=>Qr.call(e),Co=e=>_n(e).slice(8,-1),Xr=e=>_n(e)==="[object Object]",Ls=e=>ve(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Zt=Os(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Un=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Ao=/-\w/g,Pe=Un(e=>e.replace(Ao,t=>t.slice(1).toUpperCase())),So=/\B([A-Z])/g,kt=Un(e=>e.replace(So,"-$1").toLowerCase()),Hn=Un(e=>e.charAt(0).toUpperCase()+e.slice(1)),ts=Un(e=>e?`on${Hn(e)}`:""),at=(e,t)=>!Object.is(e,t),xn=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Zr=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},$n=e=>{const t=parseFloat(e);return isNaN(t)?e:t},xo=e=>{const t=ve(e)?Number(e):NaN;return isNaN(t)?e:t};let Zs;const Vn=()=>Zs||(Zs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function je(e){if(V(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=ve(r)?Oo(r):je(r);if(i)for(const s in i)t[s]=i[s]}return t}else if(ve(e)||ae(e))return e}const To=/;(?![^(]*\))/g,Mo=/:([^]+)/,Eo=/\/\*[^]*?\*\//g;function Oo(e){const t={};return e.replace(Eo,"").split(To).forEach(n=>{if(n){const r=n.split(Mo);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function re(e){let t="";if(ve(e))t=e;else if(V(e))for(let n=0;n<e.length;n++){const r=re(e[n]);r&&(t+=r+" ")}else if(ae(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Io="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Lo=Os(Io);function ei(e){return!!e||e===""}function Ro(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Vt(e[r],t[r]);return n}function Vt(e,t){if(e===t)return!0;let n=Xs(e),r=Xs(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=qe(e),r=qe(t),n||r)return e===t;if(n=V(e),r=V(t),n||r)return n&&r?Ro(e,t):!1;if(n=ae(e),r=ae(t),n||r){if(!n||!r)return!1;const i=Object.keys(e).length,s=Object.keys(t).length;if(i!==s)return!1;for(const o in e){const a=e.hasOwnProperty(o),l=t.hasOwnProperty(o);if(a&&!l||!a&&l||!Vt(e[o],t[o]))return!1}}return String(e)===String(t)}function Rs(e,t){return e.findIndex(n=>Vt(n,t))}const ti=e=>!!(e&&e.__v_isRef===!0),O=e=>ve(e)?e:e==null?"":V(e)||ae(e)&&(e.toString===Qr||!J(e.toString))?ti(e)?O(e.value):JSON.stringify(e,ni,2):String(e),ni=(e,t)=>ti(t)?ni(e,t.value):Pt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,i],s)=>(n[ns(r,s)+" =>"]=i,n),{})}:$t(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ns(n))}:qe(t)?ns(t):ae(t)&&!V(t)&&!Xr(t)?String(t):t,ns=(e,t="")=>{var n;return qe(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
6
  * @vue/reactivity v3.5.34
7
7
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
8
  * @license MIT
9
- **/let xe;class Ro{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&xe&&(xe.active?(this.parent=xe,this.index=(xe.scopes||(xe.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=xe;try{return xe=this,t()}finally{xe=n}}}on(){++this._on===1&&(this.prevScope=xe,xe=this)}off(){if(this._on>0&&--this._on===0){if(xe===this)xe=this.prevScope;else{let t=xe;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function Bo(){return xe}let pe;const ss=new WeakSet;class ni{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,xe&&(xe.active?xe.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ss.has(this)&&(ss.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ri(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,er(this),ii(this);const t=pe,n=Ve;pe=this,Ve=!0;try{return this.fn()}finally{oi(this),pe=t,Ve=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ps(t);this.deps=this.depsTail=void 0,er(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ss.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){_s(this)&&this.run()}get dirty(){return _s(this)}}let si=0,en,tn;function ri(e,t=!1){if(e.flags|=8,t){e.next=tn,tn=e;return}e.next=en,en=e}function Bs(){si++}function Ns(){if(--si>0)return;if(tn){let t=tn;for(tn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;en;){let t=en;for(en=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function ii(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function oi(e){let t,n=e.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),Ps(r),No(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function _s(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ai(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ai(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===on)||(e.globalVersion=on,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!_s(e))))return;e.flags|=2;const t=e.dep,n=pe,r=Ve;pe=e,Ve=!0;try{ii(e);const i=e.fn(e._value);(t.version===0||at(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{pe=n,Ve=r,oi(e),e.flags&=-3}}function Ps(e,t=!1){const{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)Ps(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function No(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ve=!0;const li=[];function dt(){li.push(Ve),Ve=!1}function ft(){const e=li.pop();Ve=e===void 0?!0:e}function er(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=pe;pe=void 0;try{t()}finally{pe=n}}}let on=0;class Po{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ci{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!pe||!Ve||pe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==pe)n=this.activeLink=new Po(pe,this),pe.deps?(n.prevDep=pe.depsTail,pe.depsTail.nextDep=n,pe.depsTail=n):pe.deps=pe.depsTail=n,ui(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=pe.depsTail,n.nextDep=void 0,pe.depsTail.nextDep=n,pe.depsTail=n,pe.deps===n&&(pe.deps=r)}return n}trigger(t){this.version++,on++,this.notify(t)}notify(t){Bs();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ns()}}}function ui(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)ui(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ys=new WeakMap,It=Symbol(""),vs=Symbol(""),an=Symbol("");function Oe(e,t,n){if(Ve&&pe){let r=ys.get(e);r||ys.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new ci),i.map=r,i.key=n),i.track()}}function lt(e,t,n,r,i,s){const o=ys.get(e);if(!o){on++;return}const a=l=>{l&&l.trigger()};if(Bs(),t==="clear")o.forEach(a);else{const l=V(e),f=l&&Ls(n);if(l&&n==="length"){const c=Number(r);o.forEach((g,S)=>{(S==="length"||S===an||!qe(S)&&S>=c)&&a(g)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),f&&a(o.get(an)),t){case"add":l?f&&a(o.get("length")):(a(o.get(It)),Pt(e)&&a(o.get(vs)));break;case"delete":l||(a(o.get(It)),Pt(e)&&a(o.get(vs)));break;case"set":Pt(e)&&a(o.get(It));break}}Ns()}function Rt(e){const t=ce(e);return t===e?t:(Oe(t,"iterate",an),Ke(e)?t:t.map(ht))}function Kn(e){return Oe(e=ce(e),"iterate",an),e}function Ze(e,t){return bt(e)?Ut(Lt(e)?ht(t):t):ht(t)}const Fo={__proto__:null,[Symbol.iterator](){return rs(this,Symbol.iterator,e=>Ze(this,e))},concat(...e){return Rt(this).concat(...e.map(t=>V(t)?Rt(t):t))},entries(){return rs(this,"entries",e=>(e[1]=Ze(this,e[1]),e))},every(e,t){return nt(this,"every",e,t,void 0,arguments)},filter(e,t){return nt(this,"filter",e,t,n=>n.map(r=>Ze(this,r)),arguments)},find(e,t){return nt(this,"find",e,t,n=>Ze(this,n),arguments)},findIndex(e,t){return nt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return nt(this,"findLast",e,t,n=>Ze(this,n),arguments)},findLastIndex(e,t){return nt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return nt(this,"forEach",e,t,void 0,arguments)},includes(...e){return is(this,"includes",e)},indexOf(...e){return is(this,"indexOf",e)},join(e){return Rt(this).join(e)},lastIndexOf(...e){return is(this,"lastIndexOf",e)},map(e,t){return nt(this,"map",e,t,void 0,arguments)},pop(){return zt(this,"pop")},push(...e){return zt(this,"push",e)},reduce(e,...t){return tr(this,"reduce",e,t)},reduceRight(e,...t){return tr(this,"reduceRight",e,t)},shift(){return zt(this,"shift")},some(e,t){return nt(this,"some",e,t,void 0,arguments)},splice(...e){return zt(this,"splice",e)},toReversed(){return Rt(this).toReversed()},toSorted(e){return Rt(this).toSorted(e)},toSpliced(...e){return Rt(this).toSpliced(...e)},unshift(...e){return zt(this,"unshift",e)},values(){return rs(this,"values",e=>Ze(this,e))}};function rs(e,t,n){const r=Kn(e),i=r[t]();return r!==e&&!Ke(e)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.done||(s.value=n(s.value)),s}),i}const Do=Array.prototype;function nt(e,t,n,r,i,s){const o=Kn(e),a=o!==e&&!Ke(e),l=o[t];if(l!==Do[t]){const g=l.apply(e,s);return a?ht(g):g}let f=n;o!==e&&(a?f=function(g,S){return n.call(this,Ze(e,g),S,e)}:n.length>2&&(f=function(g,S){return n.call(this,g,S,e)}));const c=l.call(o,f,r);return a&&i?i(c):c}function tr(e,t,n,r){const i=Kn(e),s=i!==e&&!Ke(e);let o=n,a=!1;i!==e&&(s?(a=r.length===0,o=function(f,c,g){return a&&(a=!1,f=Ze(e,f)),n.call(this,f,Ze(e,c),g,e)}):n.length>3&&(o=function(f,c,g){return n.call(this,f,c,g,e)}));const l=i[t](o,...r);return a?Ze(e,l):l}function is(e,t,n){const r=ce(e);Oe(r,"iterate",an);const i=r[t](...n);return(i===-1||i===!1)&&js(n[0])?(n[0]=ce(n[0]),r[t](...n)):i}function zt(e,t,n=[]){dt(),Bs();const r=ce(e)[t].apply(e,n);return Ns(),ft(),r}const jo=Os("__proto__,__v_isRef,__isVue"),di=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(qe));function Uo(e){qe(e)||(e=String(e));const t=ce(this);return Oe(t,"has",e),t.hasOwnProperty(e)}class fi{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const i=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(i?s?Jo:gi:s?pi:mi).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const o=V(t);if(!i){let l;if(o&&(l=Fo[n]))return l;if(n==="hasOwnProperty")return Uo}const a=Reflect.get(t,n,Fe(t)?t:r);if((qe(n)?di.has(n):jo(n))||(i||Oe(t,"get",n),s))return a;if(Fe(a)){const l=o&&Ls(n)?a:a.value;return i&&ae(l)?ws(l):l}return ae(a)?i?ws(a):qn(a):a}}class hi extends fi{constructor(t=!1){super(!1,t)}set(t,n,r,i){let s=t[n];const o=V(t)&&Ls(n);if(!this._isShallow){const f=bt(s);if(!Ke(r)&&!bt(r)&&(s=ce(s),r=ce(r)),!o&&Fe(s)&&!Fe(r))return f||(s.value=r),!0}const a=o?Number(n)<t.length:oe(t,n),l=Reflect.set(t,n,r,Fe(t)?t:i);return t===ce(i)&&(a?at(r,s)&&lt(t,"set",n,r):lt(t,"add",n,r)),l}deleteProperty(t,n){const r=oe(t,n);t[n];const i=Reflect.deleteProperty(t,n);return i&&r&&lt(t,"delete",n,void 0),i}has(t,n){const r=Reflect.has(t,n);return(!qe(n)||!di.has(n))&&Oe(t,"has",n),r}ownKeys(t){return Oe(t,"iterate",V(t)?"length":It),Reflect.ownKeys(t)}}class Ho extends fi{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const $o=new hi,Vo=new Ho,Ko=new hi(!0);const bs=e=>e,Cn=e=>Reflect.getPrototypeOf(e);function qo(e,t,n){return function(...r){const i=this.__v_raw,s=ce(i),o=Pt(s),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,f=i[e](...r),c=n?bs:t?Ut:ht;return!t&&Oe(s,"iterate",l?vs:It),Ae(Object.create(f),{next(){const{value:g,done:S}=f.next();return S?{value:g,done:S}:{value:a?[c(g[0]),c(g[1])]:c(g),done:S}}})}}function An(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Wo(e,t){const n={get(i){const s=this.__v_raw,o=ce(s),a=ce(i);e||(at(i,a)&&Oe(o,"get",i),Oe(o,"get",a));const{has:l}=Cn(o),f=t?bs:e?Ut:ht;if(l.call(o,i))return f(s.get(i));if(l.call(o,a))return f(s.get(a));s!==o&&s.get(i)},get size(){const i=this.__v_raw;return!e&&Oe(ce(i),"iterate",It),i.size},has(i){const s=this.__v_raw,o=ce(s),a=ce(i);return e||(at(i,a)&&Oe(o,"has",i),Oe(o,"has",a)),i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){const o=this,a=o.__v_raw,l=ce(a),f=t?bs:e?Ut:ht;return!e&&Oe(l,"iterate",It),a.forEach((c,g)=>i.call(s,f(c),f(g),o))}};return Ae(n,e?{add:An("add"),set:An("set"),delete:An("delete"),clear:An("clear")}:{add(i){const s=ce(this),o=Cn(s),a=ce(i),l=!t&&!Ke(i)&&!bt(i)?a:i;return o.has.call(s,l)||at(i,l)&&o.has.call(s,i)||at(a,l)&&o.has.call(s,a)||(s.add(l),lt(s,"add",l,l)),this},set(i,s){!t&&!Ke(s)&&!bt(s)&&(s=ce(s));const o=ce(this),{has:a,get:l}=Cn(o);let f=a.call(o,i);f||(i=ce(i),f=a.call(o,i));const c=l.call(o,i);return o.set(i,s),f?at(s,c)&&lt(o,"set",i,s):lt(o,"add",i,s),this},delete(i){const s=ce(this),{has:o,get:a}=Cn(s);let l=o.call(s,i);l||(i=ce(i),l=o.call(s,i)),a&&a.call(s,i);const f=s.delete(i);return l&&lt(s,"delete",i,void 0),f},clear(){const i=ce(this),s=i.size!==0,o=i.clear();return s&&lt(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=qo(i,e,t)}),n}function Fs(e,t){const n=Wo(e,t);return(r,i,s)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?r:Reflect.get(oe(n,i)&&i in r?n:r,i,s)}const zo={get:Fs(!1,!1)},Go={get:Fs(!1,!0)},Yo={get:Fs(!0,!1)};const mi=new WeakMap,pi=new WeakMap,gi=new WeakMap,Jo=new WeakMap;function Qo(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Xo(e){return e.__v_skip||!Object.isExtensible(e)?0:Qo(ko(e))}function qn(e){return bt(e)?e:Ds(e,!1,$o,zo,mi)}function Zo(e){return Ds(e,!1,Ko,Go,pi)}function ws(e){return Ds(e,!0,Vo,Yo,gi)}function Ds(e,t,n,r,i){if(!ae(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=Xo(e);if(s===0)return e;const o=i.get(e);if(o)return o;const a=new Proxy(e,s===2?r:n);return i.set(e,a),a}function Lt(e){return bt(e)?Lt(e.__v_raw):!!(e&&e.__v_isReactive)}function bt(e){return!!(e&&e.__v_isReadonly)}function Ke(e){return!!(e&&e.__v_isShallow)}function js(e){return e?!!e.__v_raw:!1}function ce(e){const t=e&&e.__v_raw;return t?ce(t):e}function ks(e){return!oe(e,"__v_skip")&&Object.isExtensible(e)&&Xr(e,"__v_skip",!0),e}const ht=e=>ae(e)?qn(e):e,Ut=e=>ae(e)?ws(e):e;function Fe(e){return e?e.__v_isRef===!0:!1}function ea(e){return Fe(e)?e.value:e}const ta={get:(e,t,n)=>t==="__v_raw"?e:ea(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return Fe(i)&&!Fe(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function _i(e){return Lt(e)?e:new Proxy(e,ta)}class na{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ci(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=on-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&pe!==this)return ri(this,!0),!0}get value(){const t=this.dep.track();return ai(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function sa(e,t,n=!1){let r,i;return J(e)?r=e:(r=e.get,i=e.set),new na(r,i,n)}const Sn={},En=new WeakMap;let Mt;function ra(e,t=!1,n=Mt){if(n){let r=En.get(n);r||En.set(n,r=[]),r.push(e)}}function ia(e,t,n=fe){const{immediate:r,deep:i,once:s,scheduler:o,augmentJob:a,call:l}=n,f=U=>i?U:Ke(U)||i===!1||i===0?ct(U,1):ct(U);let c,g,S,A,K=!1,I=!1;if(Fe(e)?(g=()=>e.value,K=Ke(e)):Lt(e)?(g=()=>f(e),K=!0):V(e)?(I=!0,K=e.some(U=>Lt(U)||Ke(U)),g=()=>e.map(U=>{if(Fe(U))return U.value;if(Lt(U))return f(U);if(J(U))return l?l(U,2):U()})):J(e)?t?g=l?()=>l(e,2):e:g=()=>{if(S){dt();try{S()}finally{ft()}}const U=Mt;Mt=c;try{return l?l(e,3,[A]):e(A)}finally{Mt=U}}:g=tt,t&&i){const U=g,ne=i===!0?1/0:i;g=()=>ct(U(),ne)}const Q=Bo(),z=()=>{c.stop(),Q&&Q.active&&Is(Q.effects,c)};if(s&&t){const U=t;t=(...ne)=>{U(...ne),z()}}let q=I?new Array(e.length).fill(Sn):Sn;const X=U=>{if(!(!(c.flags&1)||!c.dirty&&!U))if(t){const ne=c.run();if(i||K||(I?ne.some((ge,he)=>at(ge,q[he])):at(ne,q))){S&&S();const ge=Mt;Mt=c;try{const he=[ne,q===Sn?void 0:I&&q[0]===Sn?[]:q,A];q=ne,l?l(t,3,he):t(...he)}finally{Mt=ge}}}else c.run()};return a&&a(X),c=new ni(g),c.scheduler=o?()=>o(X,!1):X,A=U=>ra(U,!1,c),S=c.onStop=()=>{const U=En.get(c);if(U){if(l)l(U,4);else for(const ne of U)ne();En.delete(c)}},t?r?X(!0):q=c.run():o?o(X.bind(null,!0),!0):c.run(),z.pause=c.pause.bind(c),z.resume=c.resume.bind(c),z.stop=z,z}function ct(e,t=1/0,n){if(t<=0||!ae(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Fe(e))ct(e.value,t,n);else if(V(e))for(let r=0;r<e.length;r++)ct(e[r],t,n);else if($t(e)||Pt(e))e.forEach(r=>{ct(r,t,n)});else if(Qr(e)){for(const r in e)ct(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&ct(e[r],t,n)}return e}/**
9
+ **/let xe;class No{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&xe&&(xe.active?(this.parent=xe,this.index=(xe.scopes||(xe.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=xe;try{return xe=this,t()}finally{xe=n}}}on(){++this._on===1&&(this.prevScope=xe,xe=this)}off(){if(this._on>0&&--this._on===0){if(xe===this)xe=this.prevScope;else{let t=xe;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function Bo(){return xe}let pe;const ss=new WeakSet;class si{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,xe&&(xe.active?xe.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ss.has(this)&&(ss.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ii(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,er(this),oi(this);const t=pe,n=Ve;pe=this,Ve=!0;try{return this.fn()}finally{ai(this),pe=t,Ve=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ps(t);this.deps=this.depsTail=void 0,er(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ss.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){_s(this)&&this.run()}get dirty(){return _s(this)}}let ri=0,en,tn;function ii(e,t=!1){if(e.flags|=8,t){e.next=tn,tn=e;return}e.next=en,en=e}function Ns(){ri++}function Bs(){if(--ri>0)return;if(tn){let t=tn;for(tn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;en;){let t=en;for(en=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function oi(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ai(e){let t,n=e.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),Ps(r),Po(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function _s(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(li(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function li(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===on)||(e.globalVersion=on,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!_s(e))))return;e.flags|=2;const t=e.dep,n=pe,r=Ve;pe=e,Ve=!0;try{oi(e);const i=e.fn(e._value);(t.version===0||at(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{pe=n,Ve=r,ai(e),e.flags&=-3}}function Ps(e,t=!1){const{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)Ps(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Po(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ve=!0;const ci=[];function dt(){ci.push(Ve),Ve=!1}function ft(){const e=ci.pop();Ve=e===void 0?!0:e}function er(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=pe;pe=void 0;try{t()}finally{pe=n}}}let on=0;class Fo{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ui{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!pe||!Ve||pe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==pe)n=this.activeLink=new Fo(pe,this),pe.deps?(n.prevDep=pe.depsTail,pe.depsTail.nextDep=n,pe.depsTail=n):pe.deps=pe.depsTail=n,di(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=pe.depsTail,n.nextDep=void 0,pe.depsTail.nextDep=n,pe.depsTail=n,pe.deps===n&&(pe.deps=r)}return n}trigger(t){this.version++,on++,this.notify(t)}notify(t){Ns();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Bs()}}}function di(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)di(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ys=new WeakMap,It=Symbol(""),vs=Symbol(""),an=Symbol("");function Oe(e,t,n){if(Ve&&pe){let r=ys.get(e);r||ys.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new ui),i.map=r,i.key=n),i.track()}}function lt(e,t,n,r,i,s){const o=ys.get(e);if(!o){on++;return}const a=l=>{l&&l.trigger()};if(Ns(),t==="clear")o.forEach(a);else{const l=V(e),f=l&&Ls(n);if(l&&n==="length"){const c=Number(r);o.forEach((g,S)=>{(S==="length"||S===an||!qe(S)&&S>=c)&&a(g)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),f&&a(o.get(an)),t){case"add":l?f&&a(o.get("length")):(a(o.get(It)),Pt(e)&&a(o.get(vs)));break;case"delete":l||(a(o.get(It)),Pt(e)&&a(o.get(vs)));break;case"set":Pt(e)&&a(o.get(It));break}}Bs()}function Rt(e){const t=ce(e);return t===e?t:(Oe(t,"iterate",an),Ke(e)?t:t.map(ht))}function Kn(e){return Oe(e=ce(e),"iterate",an),e}function Ze(e,t){return bt(e)?Ut(Lt(e)?ht(t):t):ht(t)}const Do={__proto__:null,[Symbol.iterator](){return rs(this,Symbol.iterator,e=>Ze(this,e))},concat(...e){return Rt(this).concat(...e.map(t=>V(t)?Rt(t):t))},entries(){return rs(this,"entries",e=>(e[1]=Ze(this,e[1]),e))},every(e,t){return nt(this,"every",e,t,void 0,arguments)},filter(e,t){return nt(this,"filter",e,t,n=>n.map(r=>Ze(this,r)),arguments)},find(e,t){return nt(this,"find",e,t,n=>Ze(this,n),arguments)},findIndex(e,t){return nt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return nt(this,"findLast",e,t,n=>Ze(this,n),arguments)},findLastIndex(e,t){return nt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return nt(this,"forEach",e,t,void 0,arguments)},includes(...e){return is(this,"includes",e)},indexOf(...e){return is(this,"indexOf",e)},join(e){return Rt(this).join(e)},lastIndexOf(...e){return is(this,"lastIndexOf",e)},map(e,t){return nt(this,"map",e,t,void 0,arguments)},pop(){return zt(this,"pop")},push(...e){return zt(this,"push",e)},reduce(e,...t){return tr(this,"reduce",e,t)},reduceRight(e,...t){return tr(this,"reduceRight",e,t)},shift(){return zt(this,"shift")},some(e,t){return nt(this,"some",e,t,void 0,arguments)},splice(...e){return zt(this,"splice",e)},toReversed(){return Rt(this).toReversed()},toSorted(e){return Rt(this).toSorted(e)},toSpliced(...e){return Rt(this).toSpliced(...e)},unshift(...e){return zt(this,"unshift",e)},values(){return rs(this,"values",e=>Ze(this,e))}};function rs(e,t,n){const r=Kn(e),i=r[t]();return r!==e&&!Ke(e)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.done||(s.value=n(s.value)),s}),i}const jo=Array.prototype;function nt(e,t,n,r,i,s){const o=Kn(e),a=o!==e&&!Ke(e),l=o[t];if(l!==jo[t]){const g=l.apply(e,s);return a?ht(g):g}let f=n;o!==e&&(a?f=function(g,S){return n.call(this,Ze(e,g),S,e)}:n.length>2&&(f=function(g,S){return n.call(this,g,S,e)}));const c=l.call(o,f,r);return a&&i?i(c):c}function tr(e,t,n,r){const i=Kn(e),s=i!==e&&!Ke(e);let o=n,a=!1;i!==e&&(s?(a=r.length===0,o=function(f,c,g){return a&&(a=!1,f=Ze(e,f)),n.call(this,f,Ze(e,c),g,e)}):n.length>3&&(o=function(f,c,g){return n.call(this,f,c,g,e)}));const l=i[t](o,...r);return a?Ze(e,l):l}function is(e,t,n){const r=ce(e);Oe(r,"iterate",an);const i=r[t](...n);return(i===-1||i===!1)&&js(n[0])?(n[0]=ce(n[0]),r[t](...n)):i}function zt(e,t,n=[]){dt(),Ns();const r=ce(e)[t].apply(e,n);return Bs(),ft(),r}const Uo=Os("__proto__,__v_isRef,__isVue"),fi=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(qe));function Ho(e){qe(e)||(e=String(e));const t=ce(this);return Oe(t,"has",e),t.hasOwnProperty(e)}class hi{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const i=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(i?s?Qo:_i:s?gi:pi).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const o=V(t);if(!i){let l;if(o&&(l=Do[n]))return l;if(n==="hasOwnProperty")return Ho}const a=Reflect.get(t,n,Fe(t)?t:r);if((qe(n)?fi.has(n):Uo(n))||(i||Oe(t,"get",n),s))return a;if(Fe(a)){const l=o&&Ls(n)?a:a.value;return i&&ae(l)?ws(l):l}return ae(a)?i?ws(a):qn(a):a}}class mi extends hi{constructor(t=!1){super(!1,t)}set(t,n,r,i){let s=t[n];const o=V(t)&&Ls(n);if(!this._isShallow){const f=bt(s);if(!Ke(r)&&!bt(r)&&(s=ce(s),r=ce(r)),!o&&Fe(s)&&!Fe(r))return f||(s.value=r),!0}const a=o?Number(n)<t.length:oe(t,n),l=Reflect.set(t,n,r,Fe(t)?t:i);return t===ce(i)&&(a?at(r,s)&&lt(t,"set",n,r):lt(t,"add",n,r)),l}deleteProperty(t,n){const r=oe(t,n);t[n];const i=Reflect.deleteProperty(t,n);return i&&r&&lt(t,"delete",n,void 0),i}has(t,n){const r=Reflect.has(t,n);return(!qe(n)||!fi.has(n))&&Oe(t,"has",n),r}ownKeys(t){return Oe(t,"iterate",V(t)?"length":It),Reflect.ownKeys(t)}}class $o extends hi{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Vo=new mi,Ko=new $o,qo=new mi(!0);const bs=e=>e,Cn=e=>Reflect.getPrototypeOf(e);function Wo(e,t,n){return function(...r){const i=this.__v_raw,s=ce(i),o=Pt(s),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,f=i[e](...r),c=n?bs:t?Ut:ht;return!t&&Oe(s,"iterate",l?vs:It),Ae(Object.create(f),{next(){const{value:g,done:S}=f.next();return S?{value:g,done:S}:{value:a?[c(g[0]),c(g[1])]:c(g),done:S}}})}}function An(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function zo(e,t){const n={get(i){const s=this.__v_raw,o=ce(s),a=ce(i);e||(at(i,a)&&Oe(o,"get",i),Oe(o,"get",a));const{has:l}=Cn(o),f=t?bs:e?Ut:ht;if(l.call(o,i))return f(s.get(i));if(l.call(o,a))return f(s.get(a));s!==o&&s.get(i)},get size(){const i=this.__v_raw;return!e&&Oe(ce(i),"iterate",It),i.size},has(i){const s=this.__v_raw,o=ce(s),a=ce(i);return e||(at(i,a)&&Oe(o,"has",i),Oe(o,"has",a)),i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){const o=this,a=o.__v_raw,l=ce(a),f=t?bs:e?Ut:ht;return!e&&Oe(l,"iterate",It),a.forEach((c,g)=>i.call(s,f(c),f(g),o))}};return Ae(n,e?{add:An("add"),set:An("set"),delete:An("delete"),clear:An("clear")}:{add(i){const s=ce(this),o=Cn(s),a=ce(i),l=!t&&!Ke(i)&&!bt(i)?a:i;return o.has.call(s,l)||at(i,l)&&o.has.call(s,i)||at(a,l)&&o.has.call(s,a)||(s.add(l),lt(s,"add",l,l)),this},set(i,s){!t&&!Ke(s)&&!bt(s)&&(s=ce(s));const o=ce(this),{has:a,get:l}=Cn(o);let f=a.call(o,i);f||(i=ce(i),f=a.call(o,i));const c=l.call(o,i);return o.set(i,s),f?at(s,c)&&lt(o,"set",i,s):lt(o,"add",i,s),this},delete(i){const s=ce(this),{has:o,get:a}=Cn(s);let l=o.call(s,i);l||(i=ce(i),l=o.call(s,i)),a&&a.call(s,i);const f=s.delete(i);return l&&lt(s,"delete",i,void 0),f},clear(){const i=ce(this),s=i.size!==0,o=i.clear();return s&&lt(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=Wo(i,e,t)}),n}function Fs(e,t){const n=zo(e,t);return(r,i,s)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?r:Reflect.get(oe(n,i)&&i in r?n:r,i,s)}const Go={get:Fs(!1,!1)},Yo={get:Fs(!1,!0)},Jo={get:Fs(!0,!1)};const pi=new WeakMap,gi=new WeakMap,_i=new WeakMap,Qo=new WeakMap;function Xo(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Zo(e){return e.__v_skip||!Object.isExtensible(e)?0:Xo(Co(e))}function qn(e){return bt(e)?e:Ds(e,!1,Vo,Go,pi)}function ea(e){return Ds(e,!1,qo,Yo,gi)}function ws(e){return Ds(e,!0,Ko,Jo,_i)}function Ds(e,t,n,r,i){if(!ae(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=Zo(e);if(s===0)return e;const o=i.get(e);if(o)return o;const a=new Proxy(e,s===2?r:n);return i.set(e,a),a}function Lt(e){return bt(e)?Lt(e.__v_raw):!!(e&&e.__v_isReactive)}function bt(e){return!!(e&&e.__v_isReadonly)}function Ke(e){return!!(e&&e.__v_isShallow)}function js(e){return e?!!e.__v_raw:!1}function ce(e){const t=e&&e.__v_raw;return t?ce(t):e}function ks(e){return!oe(e,"__v_skip")&&Object.isExtensible(e)&&Zr(e,"__v_skip",!0),e}const ht=e=>ae(e)?qn(e):e,Ut=e=>ae(e)?ws(e):e;function Fe(e){return e?e.__v_isRef===!0:!1}function ta(e){return Fe(e)?e.value:e}const na={get:(e,t,n)=>t==="__v_raw"?e:ta(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return Fe(i)&&!Fe(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function yi(e){return Lt(e)?e:new Proxy(e,na)}class sa{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ui(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=on-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&pe!==this)return ii(this,!0),!0}get value(){const t=this.dep.track();return li(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function ra(e,t,n=!1){let r,i;return J(e)?r=e:(r=e.get,i=e.set),new sa(r,i,n)}const Sn={},En=new WeakMap;let Mt;function ia(e,t=!1,n=Mt){if(n){let r=En.get(n);r||En.set(n,r=[]),r.push(e)}}function oa(e,t,n=fe){const{immediate:r,deep:i,once:s,scheduler:o,augmentJob:a,call:l}=n,f=U=>i?U:Ke(U)||i===!1||i===0?ct(U,1):ct(U);let c,g,S,A,K=!1,I=!1;if(Fe(e)?(g=()=>e.value,K=Ke(e)):Lt(e)?(g=()=>f(e),K=!0):V(e)?(I=!0,K=e.some(U=>Lt(U)||Ke(U)),g=()=>e.map(U=>{if(Fe(U))return U.value;if(Lt(U))return f(U);if(J(U))return l?l(U,2):U()})):J(e)?t?g=l?()=>l(e,2):e:g=()=>{if(S){dt();try{S()}finally{ft()}}const U=Mt;Mt=c;try{return l?l(e,3,[A]):e(A)}finally{Mt=U}}:g=tt,t&&i){const U=g,ne=i===!0?1/0:i;g=()=>ct(U(),ne)}const Q=Bo(),z=()=>{c.stop(),Q&&Q.active&&Is(Q.effects,c)};if(s&&t){const U=t;t=(...ne)=>{U(...ne),z()}}let q=I?new Array(e.length).fill(Sn):Sn;const X=U=>{if(!(!(c.flags&1)||!c.dirty&&!U))if(t){const ne=c.run();if(i||K||(I?ne.some((ge,he)=>at(ge,q[he])):at(ne,q))){S&&S();const ge=Mt;Mt=c;try{const he=[ne,q===Sn?void 0:I&&q[0]===Sn?[]:q,A];q=ne,l?l(t,3,he):t(...he)}finally{Mt=ge}}}else c.run()};return a&&a(X),c=new si(g),c.scheduler=o?()=>o(X,!1):X,A=U=>ia(U,!1,c),S=c.onStop=()=>{const U=En.get(c);if(U){if(l)l(U,4);else for(const ne of U)ne();En.delete(c)}},t?r?X(!0):q=c.run():o?o(X.bind(null,!0),!0):c.run(),z.pause=c.pause.bind(c),z.resume=c.resume.bind(c),z.stop=z,z}function ct(e,t=1/0,n){if(t<=0||!ae(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Fe(e))ct(e.value,t,n);else if(V(e))for(let r=0;r<e.length;r++)ct(e[r],t,n);else if($t(e)||Pt(e))e.forEach(r=>{ct(r,t,n)});else if(Xr(e)){for(const r in e)ct(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&ct(e[r],t,n)}return e}/**
10
10
  * @vue/runtime-core v3.5.34
11
11
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
12
  * @license MIT
13
- **/function yn(e,t,n,r){try{return r?e(...r):e()}catch(i){Wn(i,t,n)}}function We(e,t,n,r){if(J(e)){const i=yn(e,t,n,r);return i&&Yr(i)&&i.catch(s=>{Wn(s,t,n)}),i}if(V(e)){const i=[];for(let s=0;s<e.length;s++)i.push(We(e[s],t,n,r));return i}}function Wn(e,t,n,r=!0){const i=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||fe;if(t){let a=t.parent;const l=t.proxy,f=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let g=0;g<c.length;g++)if(c[g](e,l,f)===!1)return}a=a.parent}if(s){dt(),yn(s,null,10,[e,l,f]),ft();return}}oa(e,n,i,r,o)}function oa(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}const Ne=[];let Qe=-1;const Ft=[];let gt=null,Bt=0;const yi=Promise.resolve();let On=null;function vi(e){const t=On||yi;return e?t.then(this?e.bind(this):e):t}function aa(e){let t=Qe+1,n=Ne.length;for(;t<n;){const r=t+n>>>1,i=Ne[r],s=ln(i);s<e||s===e&&i.flags&2?t=r+1:n=r}return t}function Us(e){if(!(e.flags&1)){const t=ln(e),n=Ne[Ne.length-1];!n||!(e.flags&2)&&t>=ln(n)?Ne.push(e):Ne.splice(aa(t),0,e),e.flags|=1,bi()}}function bi(){On||(On=yi.then(ki))}function la(e){V(e)?Ft.push(...e):gt&&e.id===-1?gt.splice(Bt+1,0,e):e.flags&1||(Ft.push(e),e.flags|=1),bi()}function nr(e,t,n=Qe+1){for(;n<Ne.length;n++){const r=Ne[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Ne.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function wi(e){if(Ft.length){const t=[...new Set(Ft)].sort((n,r)=>ln(n)-ln(r));if(Ft.length=0,gt){gt.push(...t);return}for(gt=t,Bt=0;Bt<gt.length;Bt++){const n=gt[Bt];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}gt=null,Bt=0}}const ln=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ki(e){try{for(Qe=0;Qe<Ne.length;Qe++){const t=Ne[Qe];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),yn(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Qe<Ne.length;Qe++){const t=Ne[Qe];t&&(t.flags&=-2)}Qe=-1,Ne.length=0,wi(),On=null,(Ne.length||Ft.length)&&ki()}}let Te=null,Ci=null;function In(e){const t=Te;return Te=e,Ci=e&&e.type.__scopeId||null,t}function Ai(e,t=Te,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&Bn(-1);const s=In(t);let o;try{o=e(...i)}finally{In(s),r._d&&Bn(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function it(e,t){if(Te===null)return e;const n=Xn(Te),r=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[s,o,a,l=fe]=t[i];s&&(J(s)&&(s={mounted:s,updated:s}),s.deep&&ct(o),r.push({dir:s,instance:n,value:o,oldValue:void 0,arg:a,modifiers:l}))}return e}function Ct(e,t,n,r){const i=e.dirs,s=t&&t.dirs;for(let o=0;o<i.length;o++){const a=i[o];s&&(a.oldValue=s[o].value);let l=a.dir[r];l&&(dt(),We(l,n,8,[e.el,a,e,t]),ft())}}function ca(e,t){if(Le){let n=Le.provides;const r=Le.parent&&Le.parent.provides;r===n&&(n=Le.provides=Object.create(r)),n[e]=t}}function Tn(e,t,n=!1){const r=ao();if(r||jt){let i=jt?jt._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&J(t)?t.call(r&&r.proxy):t}}const ua=Symbol.for("v-scx"),da=()=>Tn(ua);function os(e,t,n){return Si(e,t,n)}function Si(e,t,n=fe){const{immediate:r,deep:i,flush:s,once:o}=n,a=Ae({},n),l=t&&r||!t&&s!=="post";let f;if(fn){if(s==="sync"){const A=da();f=A.__watcherHandles||(A.__watcherHandles=[])}else if(!l){const A=()=>{};return A.stop=tt,A.resume=tt,A.pause=tt,A}}const c=Le;a.call=(A,K,I)=>We(A,c,K,I);let g=!1;s==="post"?a.scheduler=A=>{De(A,c&&c.suspense)}:s!=="sync"&&(g=!0,a.scheduler=(A,K)=>{K?A():Us(A)}),a.augmentJob=A=>{t&&(A.flags|=4),g&&(A.flags|=2,c&&(A.id=c.uid,A.i=c))};const S=ia(e,t,a);return fn&&(f?f.push(S):l&&S()),S}function fa(e,t,n){const r=this.proxy,i=ve(e)?e.includes(".")?xi(r,e):()=>r[e]:e.bind(r,r);let s;J(t)?s=t:(s=t.handler,n=t);const o=vn(this),a=Si(i,s.bind(r),n);return o(),a}function xi(e,t){const n=t.split(".");return()=>{let r=e;for(let i=0;i<n.length&&r;i++)r=r[n[i]];return r}}const ha=Symbol("_vte"),Ti=e=>e.__isTeleport,Xe=Symbol("_leaveCb"),Gt=Symbol("_enterCb");function ma(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ni(()=>{e.isMounted=!0}),Pi(()=>{e.isUnmounting=!0}),e}const $e=[Function,Array],Mi={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:$e,onEnter:$e,onAfterEnter:$e,onEnterCancelled:$e,onBeforeLeave:$e,onLeave:$e,onAfterLeave:$e,onLeaveCancelled:$e,onBeforeAppear:$e,onAppear:$e,onAfterAppear:$e,onAppearCancelled:$e},Ei=e=>{const t=e.subTree;return t.component?Ei(t.component):t},pa={name:"BaseTransition",props:Mi,setup(e,{slots:t}){const n=ao(),r=ma();return()=>{const i=t.default&&Li(t.default(),!0),s=i&&i.length?Oi(i):n.subTree?D():void 0;if(!s)return;const o=ce(e),{mode:a}=o;if(r.isLeaving)return as(s);const l=sr(s);if(!l)return as(s);let f=Cs(l,o,r,n,g=>f=g);l.type!==Ie&&cn(l,f);let c=n.subTree&&sr(n.subTree);if(c&&c.type!==Ie&&!Et(c,l)&&Ei(n).type!==Ie){let g=Cs(c,o,r,n);if(cn(c,g),a==="out-in"&&l.type!==Ie)return r.isLeaving=!0,g.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete g.afterLeave,c=void 0},as(s);a==="in-out"&&l.type!==Ie?g.delayLeave=(S,A,K)=>{const I=Ii(r,c);I[String(c.key)]=c,S[Xe]=()=>{A(),S[Xe]=void 0,delete f.delayedLeave,c=void 0},f.delayedLeave=()=>{K(),delete f.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return s}}};function Oi(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Ie){t=n;break}}return t}const ga=pa;function Ii(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Cs(e,t,n,r,i){const{appear:s,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:f,onAfterEnter:c,onEnterCancelled:g,onBeforeLeave:S,onLeave:A,onAfterLeave:K,onLeaveCancelled:I,onBeforeAppear:Q,onAppear:z,onAfterAppear:q,onAppearCancelled:X}=t,U=String(e.key),ne=Ii(n,e),ge=(G,ee)=>{G&&We(G,r,9,ee)},he=(G,ee)=>{const ue=ee[1];ge(G,ee),V(G)?G.every(j=>j.length<=1)&&ue():G.length<=1&&ue()},ke={mode:o,persisted:a,beforeEnter(G){let ee=l;if(!n.isMounted)if(s)ee=Q||l;else return;G[Xe]&&G[Xe](!0);const ue=ne[U];ue&&Et(e,ue)&&ue.el[Xe]&&ue.el[Xe](),ge(ee,[G])},enter(G){if(ne[U]===e)return;let ee=f,ue=c,j=g;if(!n.isMounted)if(s)ee=z||f,ue=q||c,j=X||g;else return;let le=!1;G[Gt]=b=>{le||(le=!0,b?ge(j,[G]):ge(ue,[G]),ke.delayedLeave&&ke.delayedLeave(),G[Gt]=void 0)};const y=G[Gt].bind(null,!1);ee?he(ee,[G,y]):y()},leave(G,ee){const ue=String(e.key);if(G[Gt]&&G[Gt](!0),n.isUnmounting)return ee();ge(S,[G]);let j=!1;G[Xe]=y=>{j||(j=!0,ee(),y?ge(I,[G]):ge(K,[G]),G[Xe]=void 0,ne[ue]===e&&delete ne[ue])};const le=G[Xe].bind(null,!1);ne[ue]=e,A?he(A,[G,le]):le()},clone(G){const ee=Cs(G,t,n,r,i);return i&&i(ee),ee}};return ke}function as(e){if(zn(e))return e=wt(e),e.children=null,e}function sr(e){if(!zn(e))return Ti(e.type)&&e.children?Oi(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&J(n.default))return n.default()}}function cn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,cn(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Li(e,t=!1,n){let r=[],i=0;for(let s=0;s<e.length;s++){let o=e[s];const a=n==null?o.key:String(n)+String(o.key!=null?o.key:s);o.type===Z?(o.patchFlag&128&&i++,r=r.concat(Li(o.children,t,a))):(t||o.type!==Ie)&&r.push(a!=null?wt(o,{key:a}):o)}if(i>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function Ri(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function rr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Ln=new WeakMap;function nn(e,t,n,r,i=!1){if(V(e)){e.forEach((I,Q)=>nn(I,t&&(V(t)?t[Q]:t),n,r,i));return}if(Dt(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&nn(e,t,n,r.component.subTree);return}const s=r.shapeFlag&4?Xn(r.component):r.el,o=i?null:s,{i:a,r:l}=e,f=t&&t.r,c=a.refs===fe?a.refs={}:a.refs,g=a.setupState,S=ce(g),A=g===fe?Gr:I=>rr(c,I)?!1:oe(S,I),K=(I,Q)=>!(Q&&rr(c,Q));if(f!=null&&f!==l){if(ir(t),ve(f))c[f]=null,A(f)&&(g[f]=null);else if(Fe(f)){const I=t;K(f,I.k)&&(f.value=null),I.k&&(c[I.k]=null)}}if(J(l))yn(l,a,12,[o,c]);else{const I=ve(l),Q=Fe(l);if(I||Q){const z=()=>{if(e.f){const q=I?A(l)?g[l]:c[l]:K()||!e.k?l.value:c[e.k];if(i)V(q)&&Is(q,s);else if(V(q))q.includes(s)||q.push(s);else if(I)c[l]=[s],A(l)&&(g[l]=c[l]);else{const X=[s];K(l,e.k)&&(l.value=X),e.k&&(c[e.k]=X)}}else I?(c[l]=o,A(l)&&(g[l]=o)):Q&&(K(l,e.k)&&(l.value=o),e.k&&(c[e.k]=o))};if(o){const q=()=>{z(),Ln.delete(e)};q.id=-1,Ln.set(e,q),De(q,n)}else ir(e),z()}}}function ir(e){const t=Ln.get(e);t&&(t.flags|=8,Ln.delete(e))}Vn().requestIdleCallback;Vn().cancelIdleCallback;const Dt=e=>!!e.type.__asyncLoader,zn=e=>e.type.__isKeepAlive;function _a(e,t){Bi(e,"a",t)}function ya(e,t){Bi(e,"da",t)}function Bi(e,t,n=Le){const r=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(Gn(t,r,n),n){let i=n.parent;for(;i&&i.parent;)zn(i.parent.vnode)&&va(r,t,n,i),i=i.parent}}function va(e,t,n,r){const i=Gn(t,e,r,!0);Fi(()=>{Is(r[t],i)},n)}function Gn(e,t,n=Le,r=!1){if(n){const i=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...o)=>{dt();const a=vn(n),l=We(t,n,e,o);return a(),ft(),l});return r?i.unshift(s):i.push(s),s}}const mt=e=>(t,n=Le)=>{(!fn||e==="sp")&&Gn(e,(...r)=>t(...r),n)},ba=mt("bm"),Ni=mt("m"),wa=mt("bu"),ka=mt("u"),Pi=mt("bum"),Fi=mt("um"),Ca=mt("sp"),Aa=mt("rtg"),Sa=mt("rtc");function xa(e,t=Le){Gn("ec",e,t)}const Di="components";function _e(e,t){return Ui(Di,e,!0,t)||e}const ji=Symbol.for("v-ndc");function Ta(e){return ve(e)?Ui(Di,e,!1)||e:e||ji}function Ui(e,t,n=!0,r=!1){const i=Te||Le;if(i){const s=i.type;{const a=fl(s,!1);if(a&&(a===t||a===Pe(t)||a===Hn(Pe(t))))return s}const o=or(i[e]||s[e],t)||or(i.appContext[e],t);return!o&&r?s:o}}function or(e,t){return e&&(e[t]||e[Pe(t)]||e[Hn(Pe(t))])}function Me(e,t,n,r){let i;const s=n,o=V(e);if(o||ve(e)){const a=o&&Lt(e);let l=!1,f=!1;a&&(l=!Ke(e),f=bt(e),e=Kn(e)),i=new Array(e.length);for(let c=0,g=e.length;c<g;c++)i[c]=t(l?f?Ut(ht(e[c])):ht(e[c]):e[c],c,void 0,s)}else if(typeof e=="number"){i=new Array(e);for(let a=0;a<e;a++)i[a]=t(a+1,a,void 0,s)}else if(ae(e))if(e[Symbol.iterator])i=Array.from(e,(a,l)=>t(a,l,void 0,s));else{const a=Object.keys(e);i=new Array(a.length);for(let l=0,f=a.length;l<f;l++){const c=a[l];i[l]=t(e[c],c,l,s)}}else i=[];return i}function Ma(e,t,n={},r,i){if(Te.ce||Te.parent&&Dt(Te.parent)&&Te.parent.ce){const f=Object.keys(n).length>0;return p(),be(Z,null,[ye("slot",n,r&&r())],f?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),p();const o=s&&Hi(s(n)),a=n.key||o&&o.key,l=be(Z,{key:(a&&!qe(a)?a:`_${t}`)+(!o&&r?"_fb":"")},o||(r?r():[]),o&&e._===1?64:-2);return s&&s._c&&(s._d=!0),l}function Hi(e){return e.some(t=>dn(t)?!(t.type===Ie||t.type===Z&&!Hi(t.children)):!0)?e:null}const As=e=>e?lo(e)?Xn(e):As(e.parent):null,sn=Ae(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>As(e.parent),$root:e=>As(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Vi(e),$forceUpdate:e=>e.f||(e.f=()=>{Us(e.update)}),$nextTick:e=>e.n||(e.n=vi.bind(e.proxy)),$watch:e=>fa.bind(e)}),ls=(e,t)=>e!==fe&&!e.__isScriptSetup&&oe(e,t),Ea={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:i,props:s,accessCache:o,type:a,appContext:l}=e;if(t[0]!=="$"){const S=o[t];if(S!==void 0)switch(S){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return s[t]}else{if(ls(r,t))return o[t]=1,r[t];if(i!==fe&&oe(i,t))return o[t]=2,i[t];if(oe(s,t))return o[t]=3,s[t];if(n!==fe&&oe(n,t))return o[t]=4,n[t];Ss&&(o[t]=0)}}const f=sn[t];let c,g;if(f)return t==="$attrs"&&Oe(e.attrs,"get",""),f(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==fe&&oe(n,t))return o[t]=4,n[t];if(g=l.config.globalProperties,oe(g,t))return g[t]},set({_:e},t,n){const{data:r,setupState:i,ctx:s}=e;return ls(i,t)?(i[t]=n,!0):r!==fe&&oe(r,t)?(r[t]=n,!0):oe(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:s,type:o}},a){let l;return!!(n[a]||e!==fe&&a[0]!=="$"&&oe(e,a)||ls(t,a)||oe(s,a)||oe(r,a)||oe(sn,a)||oe(i.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:oe(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function ar(e){return V(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Ss=!0;function Oa(e){const t=Vi(e),n=e.proxy,r=e.ctx;Ss=!1,t.beforeCreate&&lr(t.beforeCreate,e,"bc");const{data:i,computed:s,methods:o,watch:a,provide:l,inject:f,created:c,beforeMount:g,mounted:S,beforeUpdate:A,updated:K,activated:I,deactivated:Q,beforeDestroy:z,beforeUnmount:q,destroyed:X,unmounted:U,render:ne,renderTracked:ge,renderTriggered:he,errorCaptured:ke,serverPrefetch:G,expose:ee,inheritAttrs:ue,components:j,directives:le,filters:y}=t;if(f&&Ia(f,r,null),o)for(const h in o){const v=o[h];J(v)&&(r[h]=v.bind(n))}if(i){const h=i.call(n,n);ae(h)&&(e.data=qn(h))}if(Ss=!0,s)for(const h in s){const v=s[h],C=J(v)?v.bind(n,n):J(v.get)?v.get.bind(n,n):tt,B=!J(v)&&J(v.set)?v.set.bind(n):tt,N=ml({get:C,set:B});Object.defineProperty(r,h,{enumerable:!0,configurable:!0,get:()=>N.value,set:H=>N.value=H})}if(a)for(const h in a)$i(a[h],r,n,h);if(l){const h=J(l)?l.call(n):l;Reflect.ownKeys(h).forEach(v=>{ca(v,h[v])})}c&&lr(c,e,"c");function w(h,v){V(v)?v.forEach(C=>h(C.bind(n))):v&&h(v.bind(n))}if(w(ba,g),w(Ni,S),w(wa,A),w(ka,K),w(_a,I),w(ya,Q),w(xa,ke),w(Sa,ge),w(Aa,he),w(Pi,q),w(Fi,U),w(Ca,G),V(ee))if(ee.length){const h=e.exposed||(e.exposed={});ee.forEach(v=>{Object.defineProperty(h,v,{get:()=>n[v],set:C=>n[v]=C,enumerable:!0})})}else e.exposed||(e.exposed={});ne&&e.render===tt&&(e.render=ne),ue!=null&&(e.inheritAttrs=ue),j&&(e.components=j),le&&(e.directives=le),G&&Ri(e)}function Ia(e,t,n=tt){V(e)&&(e=xs(e));for(const r in e){const i=e[r];let s;ae(i)?"default"in i?s=Tn(i.from||r,i.default,!0):s=Tn(i.from||r):s=Tn(i),Fe(s)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):t[r]=s}}function lr(e,t,n){We(V(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function $i(e,t,n,r){let i=r.includes(".")?xi(n,r):()=>n[r];if(ve(e)){const s=t[e];J(s)&&os(i,s)}else if(J(e))os(i,e.bind(n));else if(ae(e))if(V(e))e.forEach(s=>$i(s,t,n,r));else{const s=J(e.handler)?e.handler.bind(n):t[e.handler];J(s)&&os(i,s,e)}}function Vi(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(t);let l;return a?l=a:!i.length&&!n&&!r?l=t:(l={},i.length&&i.forEach(f=>Rn(l,f,o,!0)),Rn(l,t,o)),ae(t)&&s.set(t,l),l}function Rn(e,t,n,r=!1){const{mixins:i,extends:s}=t;s&&Rn(e,s,n,!0),i&&i.forEach(o=>Rn(e,o,n,!0));for(const o in t)if(!(r&&o==="expose")){const a=La[o]||n&&n[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const La={data:cr,props:ur,emits:ur,methods:Jt,computed:Jt,beforeCreate:Be,created:Be,beforeMount:Be,mounted:Be,beforeUpdate:Be,updated:Be,beforeDestroy:Be,beforeUnmount:Be,destroyed:Be,unmounted:Be,activated:Be,deactivated:Be,errorCaptured:Be,serverPrefetch:Be,components:Jt,directives:Jt,watch:Ba,provide:cr,inject:Ra};function cr(e,t){return t?e?function(){return Ae(J(e)?e.call(this,this):e,J(t)?t.call(this,this):t)}:t:e}function Ra(e,t){return Jt(xs(e),xs(t))}function xs(e){if(V(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Be(e,t){return e?[...new Set([].concat(e,t))]:t}function Jt(e,t){return e?Ae(Object.create(null),e,t):t}function ur(e,t){return e?V(e)&&V(t)?[...new Set([...e,...t])]:Ae(Object.create(null),ar(e),ar(t??{})):t}function Ba(e,t){if(!e)return t;if(!t)return e;const n=Ae(Object.create(null),e);for(const r in t)n[r]=Be(e[r],t[r]);return n}function Ki(){return{app:null,config:{isNativeTag:Gr,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Na=0;function Pa(e,t){return function(r,i=null){J(r)||(r=Ae({},r)),i!=null&&!ae(i)&&(i=null);const s=Ki(),o=new WeakSet,a=[];let l=!1;const f=s.app={_uid:Na++,_component:r,_props:i,_container:null,_context:s,_instance:null,version:pl,get config(){return s.config},set config(c){},use(c,...g){return o.has(c)||(c&&J(c.install)?(o.add(c),c.install(f,...g)):J(c)&&(o.add(c),c(f,...g))),f},mixin(c){return s.mixins.includes(c)||s.mixins.push(c),f},component(c,g){return g?(s.components[c]=g,f):s.components[c]},directive(c,g){return g?(s.directives[c]=g,f):s.directives[c]},mount(c,g,S){if(!l){const A=f._ceVNode||ye(r,i);return A.appContext=s,S===!0?S="svg":S===!1&&(S=void 0),e(A,c,S),l=!0,f._container=c,c.__vue_app__=f,Xn(A.component)}},onUnmount(c){a.push(c)},unmount(){l&&(We(a,f._instance,16),e(null,f._container),delete f._container.__vue_app__)},provide(c,g){return s.provides[c]=g,f},runWithContext(c){const g=jt;jt=f;try{return c()}finally{jt=g}}};return f}}let jt=null;const Fa=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Pe(t)}Modifiers`]||e[`${kt(t)}Modifiers`];function Da(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||fe;let i=n;const s=t.startsWith("update:"),o=s&&Fa(r,t.slice(7));o&&(o.trim&&(i=n.map(c=>ve(c)?c.trim():c)),o.number&&(i=n.map($n)));let a,l=r[a=ts(t)]||r[a=ts(Pe(t))];!l&&s&&(l=r[a=ts(kt(t))]),l&&We(l,e,6,i);const f=r[a+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,We(f,e,6,i)}}const ja=new WeakMap;function qi(e,t,n=!1){const r=n?ja:t.emitsCache,i=r.get(e);if(i!==void 0)return i;const s=e.emits;let o={},a=!1;if(!J(e)){const l=f=>{const c=qi(f,t,!0);c&&(a=!0,Ae(o,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!s&&!a?(ae(e)&&r.set(e,null),null):(V(s)?s.forEach(l=>o[l]=null):Ae(o,s),ae(e)&&r.set(e,o),o)}function Yn(e,t){return!e||!Dn(t)?!1:(t=t.slice(2).replace(/Once$/,""),oe(e,t[0].toLowerCase()+t.slice(1))||oe(e,kt(t))||oe(e,t))}function dr(e){const{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[s],slots:o,attrs:a,emit:l,render:f,renderCache:c,props:g,data:S,setupState:A,ctx:K,inheritAttrs:I}=e,Q=In(e);let z,q;try{if(n.shapeFlag&4){const U=i||r,ne=U;z=et(f.call(ne,U,c,g,A,S,K)),q=a}else{const U=t;z=et(U.length>1?U(g,{attrs:a,slots:o,emit:l}):U(g,null)),q=t.props?a:Ua(a)}}catch(U){rn.length=0,Wn(U,e,1),z=ye(Ie)}let X=z;if(q&&I!==!1){const U=Object.keys(q),{shapeFlag:ne}=X;U.length&&ne&7&&(s&&U.some(jn)&&(q=Ha(q,s)),X=wt(X,q,!1,!0))}return n.dirs&&(X=wt(X,null,!1,!0),X.dirs=X.dirs?X.dirs.concat(n.dirs):n.dirs),n.transition&&cn(X,n.transition),z=X,In(Q),z}const Ua=e=>{let t;for(const n in e)(n==="class"||n==="style"||Dn(n))&&((t||(t={}))[n]=e[n]);return t},Ha=(e,t)=>{const n={};for(const r in e)(!jn(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function $a(e,t,n){const{props:r,children:i,component:s}=e,{props:o,children:a,patchFlag:l}=t,f=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?fr(r,o,f):!!o;if(l&8){const c=t.dynamicProps;for(let g=0;g<c.length;g++){const S=c[g];if(Wi(o,r,S)&&!Yn(f,S))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:r===o?!1:r?o?fr(r,o,f):!0:!!o;return!1}function fr(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){const s=r[i];if(Wi(t,e,s)&&!Yn(n,s))return!0}return!1}function Wi(e,t,n){const r=e[n],i=t[n];return n==="style"&&ae(r)&&ae(i)?!Vt(r,i):r!==i}function Va({vnode:e,parent:t,suspense:n},r){for(;t;){const i=t.subTree;if(i.suspense&&i.suspense.activeBranch===e&&(i.suspense.vnode.el=i.el=r,e=i),i===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const zi={},Gi=()=>Object.create(zi),Yi=e=>Object.getPrototypeOf(e)===zi;function Ka(e,t,n,r=!1){const i={},s=Gi();e.propsDefaults=Object.create(null),Ji(e,t,i,s);for(const o in e.propsOptions[0])o in i||(i[o]=void 0);n?e.props=r?i:Zo(i):e.type.props?e.props=i:e.props=s,e.attrs=s}function qa(e,t,n,r){const{props:i,attrs:s,vnode:{patchFlag:o}}=e,a=ce(i),[l]=e.propsOptions;let f=!1;if((r||o>0)&&!(o&16)){if(o&8){const c=e.vnode.dynamicProps;for(let g=0;g<c.length;g++){let S=c[g];if(Yn(e.emitsOptions,S))continue;const A=t[S];if(l)if(oe(s,S))A!==s[S]&&(s[S]=A,f=!0);else{const K=Pe(S);i[K]=Ts(l,a,K,A,e,!1)}else A!==s[S]&&(s[S]=A,f=!0)}}}else{Ji(e,t,i,s)&&(f=!0);let c;for(const g in a)(!t||!oe(t,g)&&((c=kt(g))===g||!oe(t,c)))&&(l?n&&(n[g]!==void 0||n[c]!==void 0)&&(i[g]=Ts(l,a,g,void 0,e,!0)):delete i[g]);if(s!==a)for(const g in s)(!t||!oe(t,g))&&(delete s[g],f=!0)}f&&lt(e.attrs,"set","")}function Ji(e,t,n,r){const[i,s]=e.propsOptions;let o=!1,a;if(t)for(let l in t){if(Zt(l))continue;const f=t[l];let c;i&&oe(i,c=Pe(l))?!s||!s.includes(c)?n[c]=f:(a||(a={}))[c]=f:Yn(e.emitsOptions,l)||(!(l in r)||f!==r[l])&&(r[l]=f,o=!0)}if(s){const l=ce(n),f=a||fe;for(let c=0;c<s.length;c++){const g=s[c];n[g]=Ts(i,l,g,f[g],e,!oe(f,g))}}return o}function Ts(e,t,n,r,i,s){const o=e[n];if(o!=null){const a=oe(o,"default");if(a&&r===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&J(l)){const{propsDefaults:f}=i;if(n in f)r=f[n];else{const c=vn(i);r=f[n]=l.call(null,t),c()}}else r=l;i.ce&&i.ce._setProp(n,r)}o[0]&&(s&&!a?r=!1:o[1]&&(r===""||r===kt(n))&&(r=!0))}return r}const Wa=new WeakMap;function Qi(e,t,n=!1){const r=n?Wa:t.propsCache,i=r.get(e);if(i)return i;const s=e.props,o={},a=[];let l=!1;if(!J(e)){const c=g=>{l=!0;const[S,A]=Qi(g,t,!0);Ae(o,S),A&&a.push(...A)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!s&&!l)return ae(e)&&r.set(e,Nt),Nt;if(V(s))for(let c=0;c<s.length;c++){const g=Pe(s[c]);hr(g)&&(o[g]=fe)}else if(s)for(const c in s){const g=Pe(c);if(hr(g)){const S=s[c],A=o[g]=V(S)||J(S)?{type:S}:Ae({},S),K=A.type;let I=!1,Q=!0;if(V(K))for(let z=0;z<K.length;++z){const q=K[z],X=J(q)&&q.name;if(X==="Boolean"){I=!0;break}else X==="String"&&(Q=!1)}else I=J(K)&&K.name==="Boolean";A[0]=I,A[1]=Q,(I||oe(A,"default"))&&a.push(g)}}const f=[o,a];return ae(e)&&r.set(e,f),f}function hr(e){return e[0]!=="$"&&!Zt(e)}const Hs=e=>e==="_"||e==="_ctx"||e==="$stable",$s=e=>V(e)?e.map(et):[et(e)],za=(e,t,n)=>{if(t._n)return t;const r=Ai((...i)=>$s(t(...i)),n);return r._c=!1,r},Xi=(e,t,n)=>{const r=e._ctx;for(const i in e){if(Hs(i))continue;const s=e[i];if(J(s))t[i]=za(i,s,r);else if(s!=null){const o=$s(s);t[i]=()=>o}}},Zi=(e,t)=>{const n=$s(t);e.slots.default=()=>n},eo=(e,t,n)=>{for(const r in t)(n||!Hs(r))&&(e[r]=t[r])},Ga=(e,t,n)=>{const r=e.slots=Gi();if(e.vnode.shapeFlag&32){const i=t._;i?(eo(r,t,n),n&&Xr(r,"_",i,!0)):Xi(t,r)}else t&&Zi(e,t)},Ya=(e,t,n)=>{const{vnode:r,slots:i}=e;let s=!0,o=fe;if(r.shapeFlag&32){const a=t._;a?n&&a===1?s=!1:eo(i,t,n):(s=!t.$stable,Xi(t,i)),o=t}else t&&(Zi(e,t),o={default:1});if(s)for(const a in i)!Hs(a)&&o[a]==null&&delete i[a]},De=el;function Ja(e){return Qa(e)}function Qa(e,t){const n=Vn();n.__VUE__=!0;const{insert:r,remove:i,patchProp:s,createElement:o,createText:a,createComment:l,setText:f,setElementText:c,parentNode:g,nextSibling:S,setScopeId:A=tt,insertStaticContent:K}=e,I=(d,m,k,E=null,x=null,T=null,P=void 0,R=null,L=!!m.dynamicChildren)=>{if(d===m)return;d&&!Et(d,m)&&(E=kn(d),H(d,x,T,!0),d=null),m.patchFlag===-2&&(L=!1,m.dynamicChildren=null);const{type:M,ref:W,shapeFlag:F}=m;switch(M){case Jn:Q(d,m,k,E);break;case Ie:z(d,m,k,E);break;case us:d==null&&q(m,k,E,P);break;case Z:j(d,m,k,E,x,T,P,R,L);break;default:F&1?ne(d,m,k,E,x,T,P,R,L):F&6?le(d,m,k,E,x,T,P,R,L):(F&64||F&128)&&M.process(d,m,k,E,x,T,P,R,L,qt)}W!=null&&x?nn(W,d&&d.ref,T,m||d,!m):W==null&&d&&d.ref!=null&&nn(d.ref,null,T,d,!0)},Q=(d,m,k,E)=>{if(d==null)r(m.el=a(m.children),k,E);else{const x=m.el=d.el;m.children!==d.children&&f(x,m.children)}},z=(d,m,k,E)=>{d==null?r(m.el=l(m.children||""),k,E):m.el=d.el},q=(d,m,k,E)=>{[d.el,d.anchor]=K(d.children,m,k,E,d.el,d.anchor)},X=({el:d,anchor:m},k,E)=>{let x;for(;d&&d!==m;)x=S(d),r(d,k,E),d=x;r(m,k,E)},U=({el:d,anchor:m})=>{let k;for(;d&&d!==m;)k=S(d),i(d),d=k;i(m)},ne=(d,m,k,E,x,T,P,R,L)=>{if(m.type==="svg"?P="svg":m.type==="math"&&(P="mathml"),d==null)ge(m,k,E,x,T,P,R,L);else{const M=d.el&&d.el._isVueCE?d.el:null;try{M&&M._beginPatch(),G(d,m,x,T,P,R,L)}finally{M&&M._endPatch()}}},ge=(d,m,k,E,x,T,P,R)=>{let L,M;const{props:W,shapeFlag:F,transition:$,dirs:Y}=d;if(L=d.el=o(d.type,T,W&&W.is,W),F&8?c(L,d.children):F&16&&ke(d.children,L,null,E,x,cs(d,T),P,R),Y&&Ct(d,null,E,"created"),he(L,d,d.scopeId,P,E),W){for(const de in W)de!=="value"&&!Zt(de)&&s(L,de,null,W[de],T,E);"value"in W&&s(L,"value",null,W.value,T),(M=W.onVnodeBeforeMount)&&Je(M,E,d)}Y&&Ct(d,null,E,"beforeMount");const se=Xa(x,$);se&&$.beforeEnter(L),r(L,m,k),((M=W&&W.onVnodeMounted)||se||Y)&&De(()=>{try{M&&Je(M,E,d),se&&$.enter(L),Y&&Ct(d,null,E,"mounted")}finally{}},x)},he=(d,m,k,E,x)=>{if(k&&A(d,k),E)for(let T=0;T<E.length;T++)A(d,E[T]);if(x){let T=x.subTree;if(m===T||ro(T.type)&&(T.ssContent===m||T.ssFallback===m)){const P=x.vnode;he(d,P,P.scopeId,P.slotScopeIds,x.parent)}}},ke=(d,m,k,E,x,T,P,R,L=0)=>{for(let M=L;M<d.length;M++){const W=d[M]=R?ot(d[M]):et(d[M]);I(null,W,m,k,E,x,T,P,R)}},G=(d,m,k,E,x,T,P)=>{const R=m.el=d.el;let{patchFlag:L,dynamicChildren:M,dirs:W}=m;L|=d.patchFlag&16;const F=d.props||fe,$=m.props||fe;let Y;if(k&&At(k,!1),(Y=$.onVnodeBeforeUpdate)&&Je(Y,k,m,d),W&&Ct(m,d,k,"beforeUpdate"),k&&At(k,!0),(F.innerHTML&&$.innerHTML==null||F.textContent&&$.textContent==null)&&c(R,""),M?ee(d.dynamicChildren,M,R,k,E,cs(m,x),T):P||v(d,m,R,null,k,E,cs(m,x),T,!1),L>0){if(L&16)ue(R,F,$,k,x);else if(L&2&&F.class!==$.class&&s(R,"class",null,$.class,x),L&4&&s(R,"style",F.style,$.style,x),L&8){const se=m.dynamicProps;for(let de=0;de<se.length;de++){const me=se[de],Ce=F[me],Se=$[me];(Se!==Ce||me==="value")&&s(R,me,Ce,Se,x,k)}}L&1&&d.children!==m.children&&c(R,m.children)}else!P&&M==null&&ue(R,F,$,k,x);((Y=$.onVnodeUpdated)||W)&&De(()=>{Y&&Je(Y,k,m,d),W&&Ct(m,d,k,"updated")},E)},ee=(d,m,k,E,x,T,P)=>{for(let R=0;R<m.length;R++){const L=d[R],M=m[R],W=L.el&&(L.type===Z||!Et(L,M)||L.shapeFlag&198)?g(L.el):k;I(L,M,W,null,E,x,T,P,!0)}},ue=(d,m,k,E,x)=>{if(m!==k){if(m!==fe)for(const T in m)!Zt(T)&&!(T in k)&&s(d,T,m[T],null,x,E);for(const T in k){if(Zt(T))continue;const P=k[T],R=m[T];P!==R&&T!=="value"&&s(d,T,R,P,x,E)}"value"in k&&s(d,"value",m.value,k.value,x)}},j=(d,m,k,E,x,T,P,R,L)=>{const M=m.el=d?d.el:a(""),W=m.anchor=d?d.anchor:a("");let{patchFlag:F,dynamicChildren:$,slotScopeIds:Y}=m;Y&&(R=R?R.concat(Y):Y),d==null?(r(M,k,E),r(W,k,E),ke(m.children||[],k,W,x,T,P,R,L)):F>0&&F&64&&$&&d.dynamicChildren&&d.dynamicChildren.length===$.length?(ee(d.dynamicChildren,$,k,x,T,P,R),(m.key!=null||x&&m===x.subTree)&&to(d,m,!0)):v(d,m,k,W,x,T,P,R,L)},le=(d,m,k,E,x,T,P,R,L)=>{m.slotScopeIds=R,d==null?m.shapeFlag&512?x.ctx.activate(m,k,E,P,L):y(m,k,E,x,T,P,L):b(d,m,L)},y=(d,m,k,E,x,T,P)=>{const R=d.component=al(d,E,x);if(zn(d)&&(R.ctx.renderer=qt),ll(R,!1,P),R.asyncDep){if(x&&x.registerDep(R,w,P),!d.el){const L=R.subTree=ye(Ie);z(null,L,m,k),d.placeholder=L.el}}else w(R,d,m,k,x,T,P)},b=(d,m,k)=>{const E=m.component=d.component;if($a(d,m,k))if(E.asyncDep&&!E.asyncResolved){h(E,m,k);return}else E.next=m,E.update();else m.el=d.el,E.vnode=m},w=(d,m,k,E,x,T,P)=>{const R=()=>{if(d.isMounted){let{next:F,bu:$,u:Y,parent:se,vnode:de}=d;{const Ge=no(d);if(Ge){F&&(F.el=de.el,h(d,F,P)),Ge.asyncDep.then(()=>{De(()=>{d.isUnmounted||M()},x)});return}}let me=F,Ce;At(d,!1),F?(F.el=de.el,h(d,F,P)):F=de,$&&xn($),(Ce=F.props&&F.props.onVnodeBeforeUpdate)&&Je(Ce,se,F,de),At(d,!0);const Se=dr(d),ze=d.subTree;d.subTree=Se,I(ze,Se,g(ze.el),kn(ze),d,x,T),F.el=Se.el,me===null&&Va(d,Se.el),Y&&De(Y,x),(Ce=F.props&&F.props.onVnodeUpdated)&&De(()=>Je(Ce,se,F,de),x)}else{let F;const{el:$,props:Y}=m,{bm:se,m:de,parent:me,root:Ce,type:Se}=d,ze=Dt(m);At(d,!1),se&&xn(se),!ze&&(F=Y&&Y.onVnodeBeforeMount)&&Je(F,me,m),At(d,!0);{Ce.ce&&Ce.ce._hasShadowRoot()&&Ce.ce._injectChildStyle(Se,d.parent?d.parent.type:void 0);const Ge=d.subTree=dr(d);I(null,Ge,k,E,d,x,T),m.el=Ge.el}if(de&&De(de,x),!ze&&(F=Y&&Y.onVnodeMounted)){const Ge=m;De(()=>Je(F,me,Ge),x)}(m.shapeFlag&256||me&&Dt(me.vnode)&&me.vnode.shapeFlag&256)&&d.a&&De(d.a,x),d.isMounted=!0,m=k=E=null}};d.scope.on();const L=d.effect=new ni(R);d.scope.off();const M=d.update=L.run.bind(L),W=d.job=L.runIfDirty.bind(L);W.i=d,W.id=d.uid,L.scheduler=()=>Us(W),At(d,!0),M()},h=(d,m,k)=>{m.component=d;const E=d.vnode.props;d.vnode=m,d.next=null,qa(d,m.props,E,k),Ya(d,m.children,k),dt(),nr(d),ft()},v=(d,m,k,E,x,T,P,R,L=!1)=>{const M=d&&d.children,W=d?d.shapeFlag:0,F=m.children,{patchFlag:$,shapeFlag:Y}=m;if($>0){if($&128){B(M,F,k,E,x,T,P,R,L);return}else if($&256){C(M,F,k,E,x,T,P,R,L);return}}Y&8?(W&16&&Kt(M,x,T),F!==M&&c(k,F)):W&16?Y&16?B(M,F,k,E,x,T,P,R,L):Kt(M,x,T,!0):(W&8&&c(k,""),Y&16&&ke(F,k,E,x,T,P,R,L))},C=(d,m,k,E,x,T,P,R,L)=>{d=d||Nt,m=m||Nt;const M=d.length,W=m.length,F=Math.min(M,W);let $;for($=0;$<F;$++){const Y=m[$]=L?ot(m[$]):et(m[$]);I(d[$],Y,k,null,x,T,P,R,L)}M>W?Kt(d,x,T,!0,!1,F):ke(m,k,E,x,T,P,R,L,F)},B=(d,m,k,E,x,T,P,R,L)=>{let M=0;const W=m.length;let F=d.length-1,$=W-1;for(;M<=F&&M<=$;){const Y=d[M],se=m[M]=L?ot(m[M]):et(m[M]);if(Et(Y,se))I(Y,se,k,null,x,T,P,R,L);else break;M++}for(;M<=F&&M<=$;){const Y=d[F],se=m[$]=L?ot(m[$]):et(m[$]);if(Et(Y,se))I(Y,se,k,null,x,T,P,R,L);else break;F--,$--}if(M>F){if(M<=$){const Y=$+1,se=Y<W?m[Y].el:E;for(;M<=$;)I(null,m[M]=L?ot(m[M]):et(m[M]),k,se,x,T,P,R,L),M++}}else if(M>$)for(;M<=F;)H(d[M],x,T,!0),M++;else{const Y=M,se=M,de=new Map;for(M=se;M<=$;M++){const Ue=m[M]=L?ot(m[M]):et(m[M]);Ue.key!=null&&de.set(Ue.key,M)}let me,Ce=0;const Se=$-se+1;let ze=!1,Ge=0;const Wt=new Array(Se);for(M=0;M<Se;M++)Wt[M]=0;for(M=Y;M<=F;M++){const Ue=d[M];if(Ce>=Se){H(Ue,x,T,!0);continue}let Ye;if(Ue.key!=null)Ye=de.get(Ue.key);else for(me=se;me<=$;me++)if(Wt[me-se]===0&&Et(Ue,m[me])){Ye=me;break}Ye===void 0?H(Ue,x,T,!0):(Wt[Ye-se]=M+1,Ye>=Ge?Ge=Ye:ze=!0,I(Ue,m[Ye],k,null,x,T,P,R,L),Ce++)}const Ys=ze?Za(Wt):Nt;for(me=Ys.length-1,M=Se-1;M>=0;M--){const Ue=se+M,Ye=m[Ue],Js=m[Ue+1],Qs=Ue+1<W?Js.el||so(Js):E;Wt[M]===0?I(null,Ye,k,Qs,x,T,P,R,L):ze&&(me<0||M!==Ys[me]?N(Ye,k,Qs,2):me--)}}},N=(d,m,k,E,x=null)=>{const{el:T,type:P,transition:R,children:L,shapeFlag:M}=d;if(M&6){N(d.component.subTree,m,k,E);return}if(M&128){d.suspense.move(m,k,E);return}if(M&64){P.move(d,m,k,qt);return}if(P===Z){r(T,m,k);for(let F=0;F<L.length;F++)N(L[F],m,k,E);r(d.anchor,m,k);return}if(P===us){X(d,m,k);return}if(E!==2&&M&1&&R)if(E===0)R.beforeEnter(T),r(T,m,k),De(()=>R.enter(T),x);else{const{leave:F,delayLeave:$,afterLeave:Y}=R,se=()=>{d.ctx.isUnmounted?i(T):r(T,m,k)},de=()=>{T._isLeaving&&T[Xe](!0),F(T,()=>{se(),Y&&Y()})};$?$(T,se,de):de()}else r(T,m,k)},H=(d,m,k,E=!1,x=!1)=>{const{type:T,props:P,ref:R,children:L,dynamicChildren:M,shapeFlag:W,patchFlag:F,dirs:$,cacheIndex:Y,memo:se}=d;if(F===-2&&(x=!1),R!=null&&(dt(),nn(R,null,k,d,!0),ft()),Y!=null&&(m.renderCache[Y]=void 0),W&256){m.ctx.deactivate(d);return}const de=W&1&&$,me=!Dt(d);let Ce;if(me&&(Ce=P&&P.onVnodeBeforeUnmount)&&Je(Ce,m,d),W&6)Zn(d.component,k,E);else{if(W&128){d.suspense.unmount(k,E);return}de&&Ct(d,null,m,"beforeUnmount"),W&64?d.type.remove(d,m,k,qt,E):M&&!M.hasOnce&&(T!==Z||F>0&&F&64)?Kt(M,m,k,!1,!0):(T===Z&&F&384||!x&&W&16)&&Kt(L,m,k),E&&ie(d)}const Se=se!=null&&Y==null;(me&&(Ce=P&&P.onVnodeUnmounted)||de||Se)&&De(()=>{Ce&&Je(Ce,m,d),de&&Ct(d,null,m,"unmounted"),Se&&(d.el=null)},k)},ie=d=>{const{type:m,el:k,anchor:E,transition:x}=d;if(m===Z){te(k,E);return}if(m===us){U(d);return}const T=()=>{i(k),x&&!x.persisted&&x.afterLeave&&x.afterLeave()};if(d.shapeFlag&1&&x&&!x.persisted){const{leave:P,delayLeave:R}=x,L=()=>P(k,T);R?R(d.el,T,L):L()}else T()},te=(d,m)=>{let k;for(;d!==m;)k=S(d),i(d),d=k;i(m)},Zn=(d,m,k)=>{const{bum:E,scope:x,job:T,subTree:P,um:R,m:L,a:M}=d;mr(L),mr(M),E&&xn(E),x.stop(),T&&(T.flags|=8,H(P,d,m,k)),R&&De(R,m),De(()=>{d.isUnmounted=!0},m)},Kt=(d,m,k,E=!1,x=!1,T=0)=>{for(let P=T;P<d.length;P++)H(d[P],m,k,E,x)},kn=d=>{if(d.shapeFlag&6)return kn(d.component.subTree);if(d.shapeFlag&128)return d.suspense.next();const m=S(d.anchor||d.el),k=m&&m[ha];return k?S(k):m};let es=!1;const Gs=(d,m,k)=>{let E;d==null?m._vnode&&(H(m._vnode,null,null,!0),E=m._vnode.component):I(m._vnode||null,d,m,null,null,null,k),m._vnode=d,es||(es=!0,nr(E),wi(),es=!1)},qt={p:I,um:H,m:N,r:ie,mt:y,mc:ke,pc:v,pbc:ee,n:kn,o:e};return{render:Gs,hydrate:void 0,createApp:Pa(Gs)}}function cs({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function At({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Xa(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function to(e,t,n=!1){const r=e.children,i=t.children;if(V(r)&&V(i))for(let s=0;s<r.length;s++){const o=r[s];let a=i[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[s]=ot(i[s]),a.el=o.el),!n&&a.patchFlag!==-2&&to(o,a)),a.type===Jn&&(a.patchFlag===-1&&(a=i[s]=ot(a)),a.el=o.el),a.type===Ie&&!a.el&&(a.el=o.el)}}function Za(e){const t=e.slice(),n=[0];let r,i,s,o,a;const l=e.length;for(r=0;r<l;r++){const f=e[r];if(f!==0){if(i=n[n.length-1],e[i]<f){t[r]=i,n.push(r);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,e[n[a]]<f?s=a+1:o=a;f<e[n[s]]&&(s>0&&(t[r]=n[s-1]),n[s]=r)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=t[o];return n}function no(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:no(t)}function mr(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function so(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?so(t.subTree):null}const ro=e=>e.__isSuspense;function el(e,t){t&&t.pendingBranch?V(e)?t.effects.push(...e):t.effects.push(e):la(e)}const Z=Symbol.for("v-fgt"),Jn=Symbol.for("v-txt"),Ie=Symbol.for("v-cmt"),us=Symbol.for("v-stc"),rn=[];let He=null;function p(e=!1){rn.push(He=e?null:[])}function tl(){rn.pop(),He=rn[rn.length-1]||null}let un=1;function Bn(e,t=!1){un+=e,e<0&&He&&t&&(He.hasOnce=!0)}function io(e){return e.dynamicChildren=un>0?He||Nt:null,tl(),un>0&&He&&He.push(e),e}function _(e,t,n,r,i,s){return io(u(e,t,n,r,i,s,!0))}function be(e,t,n,r,i){return io(ye(e,t,n,r,i,!0))}function dn(e){return e?e.__v_isVNode===!0:!1}function Et(e,t){return e.type===t.type&&e.key===t.key}const oo=({key:e})=>e??null,Mn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?ve(e)||Fe(e)||J(e)?{i:Te,r:e,k:t,f:!!n}:e:null);function u(e,t=null,n=null,r=0,i=null,s=e===Z?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&oo(t),ref:t&&Mn(t),scopeId:Ci,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Te};return a?(Vs(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=ve(n)?8:16),un>0&&!o&&He&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&He.push(l),l}const ye=nl;function nl(e,t=null,n=null,r=0,i=null,s=!1){if((!e||e===ji)&&(e=Ie),dn(e)){const a=wt(e,t,!0);return n&&Vs(a,n),un>0&&!s&&He&&(a.shapeFlag&6?He[He.indexOf(e)]=a:He.push(a)),a.patchFlag=-2,a}if(hl(e)&&(e=e.__vccOpts),t){t=sl(t);let{class:a,style:l}=t;a&&!ve(a)&&(t.class=re(a)),ae(l)&&(js(l)&&!V(l)&&(l=Ae({},l)),t.style=je(l))}const o=ve(e)?1:ro(e)?128:Ti(e)?64:ae(e)?4:J(e)?2:0;return u(e,t,n,r,i,o,s,!0)}function sl(e){return e?js(e)||Yi(e)?Ae({},e):e:null}function wt(e,t,n=!1,r=!1){const{props:i,ref:s,patchFlag:o,children:a,transition:l}=e,f=t?rl(i||{},t):i,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&oo(f),ref:t&&t.ref?n&&s?V(s)?s.concat(Mn(t)):[s,Mn(t)]:Mn(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Z?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&wt(e.ssContent),ssFallback:e.ssFallback&&wt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&cn(c,l.clone(c)),c}function Qn(e=" ",t=0){return ye(Jn,null,e,t)}function D(e="",t=!1){return t?(p(),be(Ie,null,e)):ye(Ie,null,e)}function et(e){return e==null||typeof e=="boolean"?ye(Ie):V(e)?ye(Z,null,e.slice()):dn(e)?ot(e):ye(Jn,null,String(e))}function ot(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:wt(e)}function Vs(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(V(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),Vs(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!Yi(t)?t._ctx=Te:i===3&&Te&&(Te.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else J(t)?(t={default:t,_ctx:Te},n=32):(t=String(t),r&64?(n=16,t=[Qn(t)]):n=8);e.children=t,e.shapeFlag|=n}function rl(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const i in r)if(i==="class")t.class!==r.class&&(t.class=re([t.class,r.class]));else if(i==="style")t.style=je([t.style,r.style]);else if(Dn(i)){const s=t[i],o=r[i];o&&s!==o&&!(V(s)&&s.includes(o))?t[i]=s?[].concat(s,o):o:o==null&&s==null&&!jn(i)&&(t[i]=o)}else i!==""&&(t[i]=r[i])}return t}function Je(e,t,n,r=null){We(e,t,7,[n,r])}const il=Ki();let ol=0;function al(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||il,s={uid:ol++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ro(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Qi(r,i),emitsOptions:qi(r,i),emit:null,emitted:null,propsDefaults:fe,inheritAttrs:r.inheritAttrs,ctx:fe,data:fe,props:fe,attrs:fe,slots:fe,refs:fe,setupState:fe,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=t?t.root:s,s.emit=Da.bind(null,s),e.ce&&e.ce(s),s}let Le=null;const ao=()=>Le||Te;let Nn,Ms;{const e=Vn(),t=(n,r)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(r),s=>{i.length>1?i.forEach(o=>o(s)):i[0](s)}};Nn=t("__VUE_INSTANCE_SETTERS__",n=>Le=n),Ms=t("__VUE_SSR_SETTERS__",n=>fn=n)}const vn=e=>{const t=Le;return Nn(e),e.scope.on(),()=>{e.scope.off(),Nn(t)}},pr=()=>{Le&&Le.scope.off(),Nn(null)};function lo(e){return e.vnode.shapeFlag&4}let fn=!1;function ll(e,t=!1,n=!1){t&&Ms(t);const{props:r,children:i}=e.vnode,s=lo(e);Ka(e,r,s,t),Ga(e,i,n||t);const o=s?cl(e,t):void 0;return t&&Ms(!1),o}function cl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ea);const{setup:r}=n;if(r){dt();const i=e.setupContext=r.length>1?dl(e):null,s=vn(e),o=yn(r,e,0,[e.props,i]),a=Yr(o);if(ft(),s(),(a||e.sp)&&!Dt(e)&&Ri(e),a){if(o.then(pr,pr),t)return o.then(l=>{gr(e,l)}).catch(l=>{Wn(l,e,0)});e.asyncDep=o}else gr(e,o)}else co(e)}function gr(e,t,n){J(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ae(t)&&(e.setupState=_i(t)),co(e)}function co(e,t,n){const r=e.type;e.render||(e.render=r.render||tt);{const i=vn(e);dt();try{Oa(e)}finally{ft(),i()}}}const ul={get(e,t){return Oe(e,"get",""),e[t]}};function dl(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,ul),slots:e.slots,emit:e.emit,expose:t}}function Xn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(_i(ks(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in sn)return sn[n](e)},has(t,n){return n in t||n in sn}})):e.proxy}function fl(e,t=!0){return J(e)?e.displayName||e.name:e.name||t&&e.__name}function hl(e){return J(e)&&"__vccOpts"in e}const ml=(e,t)=>sa(e,t,fn);function uo(e,t,n){try{Bn(-1);const r=arguments.length;return r===2?ae(t)&&!V(t)?dn(t)?ye(e,null,[t]):ye(e,t):ye(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&dn(n)&&(n=[n]),ye(e,t,n))}finally{Bn(1)}}const pl="3.5.34";/**
13
+ **/function yn(e,t,n,r){try{return r?e(...r):e()}catch(i){Wn(i,t,n)}}function We(e,t,n,r){if(J(e)){const i=yn(e,t,n,r);return i&&Jr(i)&&i.catch(s=>{Wn(s,t,n)}),i}if(V(e)){const i=[];for(let s=0;s<e.length;s++)i.push(We(e[s],t,n,r));return i}}function Wn(e,t,n,r=!0){const i=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||fe;if(t){let a=t.parent;const l=t.proxy,f=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let g=0;g<c.length;g++)if(c[g](e,l,f)===!1)return}a=a.parent}if(s){dt(),yn(s,null,10,[e,l,f]),ft();return}}aa(e,n,i,r,o)}function aa(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}const Be=[];let Qe=-1;const Ft=[];let gt=null,Nt=0;const vi=Promise.resolve();let On=null;function bi(e){const t=On||vi;return e?t.then(this?e.bind(this):e):t}function la(e){let t=Qe+1,n=Be.length;for(;t<n;){const r=t+n>>>1,i=Be[r],s=ln(i);s<e||s===e&&i.flags&2?t=r+1:n=r}return t}function Us(e){if(!(e.flags&1)){const t=ln(e),n=Be[Be.length-1];!n||!(e.flags&2)&&t>=ln(n)?Be.push(e):Be.splice(la(t),0,e),e.flags|=1,wi()}}function wi(){On||(On=vi.then(Ci))}function ca(e){V(e)?Ft.push(...e):gt&&e.id===-1?gt.splice(Nt+1,0,e):e.flags&1||(Ft.push(e),e.flags|=1),wi()}function nr(e,t,n=Qe+1){for(;n<Be.length;n++){const r=Be[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Be.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function ki(e){if(Ft.length){const t=[...new Set(Ft)].sort((n,r)=>ln(n)-ln(r));if(Ft.length=0,gt){gt.push(...t);return}for(gt=t,Nt=0;Nt<gt.length;Nt++){const n=gt[Nt];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}gt=null,Nt=0}}const ln=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ci(e){try{for(Qe=0;Qe<Be.length;Qe++){const t=Be[Qe];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),yn(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Qe<Be.length;Qe++){const t=Be[Qe];t&&(t.flags&=-2)}Qe=-1,Be.length=0,ki(),On=null,(Be.length||Ft.length)&&Ci()}}let Te=null,Ai=null;function In(e){const t=Te;return Te=e,Ai=e&&e.type.__scopeId||null,t}function Si(e,t=Te,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&Nn(-1);const s=In(t);let o;try{o=e(...i)}finally{In(s),r._d&&Nn(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function it(e,t){if(Te===null)return e;const n=Xn(Te),r=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[s,o,a,l=fe]=t[i];s&&(J(s)&&(s={mounted:s,updated:s}),s.deep&&ct(o),r.push({dir:s,instance:n,value:o,oldValue:void 0,arg:a,modifiers:l}))}return e}function Ct(e,t,n,r){const i=e.dirs,s=t&&t.dirs;for(let o=0;o<i.length;o++){const a=i[o];s&&(a.oldValue=s[o].value);let l=a.dir[r];l&&(dt(),We(l,n,8,[e.el,a,e,t]),ft())}}function ua(e,t){if(Le){let n=Le.provides;const r=Le.parent&&Le.parent.provides;r===n&&(n=Le.provides=Object.create(r)),n[e]=t}}function Tn(e,t,n=!1){const r=lo();if(r||jt){let i=jt?jt._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&J(t)?t.call(r&&r.proxy):t}}const da=Symbol.for("v-scx"),fa=()=>Tn(da);function os(e,t,n){return xi(e,t,n)}function xi(e,t,n=fe){const{immediate:r,deep:i,flush:s,once:o}=n,a=Ae({},n),l=t&&r||!t&&s!=="post";let f;if(fn){if(s==="sync"){const A=fa();f=A.__watcherHandles||(A.__watcherHandles=[])}else if(!l){const A=()=>{};return A.stop=tt,A.resume=tt,A.pause=tt,A}}const c=Le;a.call=(A,K,I)=>We(A,c,K,I);let g=!1;s==="post"?a.scheduler=A=>{De(A,c&&c.suspense)}:s!=="sync"&&(g=!0,a.scheduler=(A,K)=>{K?A():Us(A)}),a.augmentJob=A=>{t&&(A.flags|=4),g&&(A.flags|=2,c&&(A.id=c.uid,A.i=c))};const S=oa(e,t,a);return fn&&(f?f.push(S):l&&S()),S}function ha(e,t,n){const r=this.proxy,i=ve(e)?e.includes(".")?Ti(r,e):()=>r[e]:e.bind(r,r);let s;J(t)?s=t:(s=t.handler,n=t);const o=vn(this),a=xi(i,s.bind(r),n);return o(),a}function Ti(e,t){const n=t.split(".");return()=>{let r=e;for(let i=0;i<n.length&&r;i++)r=r[n[i]];return r}}const ma=Symbol("_vte"),Mi=e=>e.__isTeleport,Xe=Symbol("_leaveCb"),Gt=Symbol("_enterCb");function pa(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Pi(()=>{e.isMounted=!0}),Fi(()=>{e.isUnmounting=!0}),e}const $e=[Function,Array],Ei={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:$e,onEnter:$e,onAfterEnter:$e,onEnterCancelled:$e,onBeforeLeave:$e,onLeave:$e,onAfterLeave:$e,onLeaveCancelled:$e,onBeforeAppear:$e,onAppear:$e,onAfterAppear:$e,onAppearCancelled:$e},Oi=e=>{const t=e.subTree;return t.component?Oi(t.component):t},ga={name:"BaseTransition",props:Ei,setup(e,{slots:t}){const n=lo(),r=pa();return()=>{const i=t.default&&Ri(t.default(),!0),s=i&&i.length?Ii(i):n.subTree?D():void 0;if(!s)return;const o=ce(e),{mode:a}=o;if(r.isLeaving)return as(s);const l=sr(s);if(!l)return as(s);let f=Cs(l,o,r,n,g=>f=g);l.type!==Ie&&cn(l,f);let c=n.subTree&&sr(n.subTree);if(c&&c.type!==Ie&&!Et(c,l)&&Oi(n).type!==Ie){let g=Cs(c,o,r,n);if(cn(c,g),a==="out-in"&&l.type!==Ie)return r.isLeaving=!0,g.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete g.afterLeave,c=void 0},as(s);a==="in-out"&&l.type!==Ie?g.delayLeave=(S,A,K)=>{const I=Li(r,c);I[String(c.key)]=c,S[Xe]=()=>{A(),S[Xe]=void 0,delete f.delayedLeave,c=void 0},f.delayedLeave=()=>{K(),delete f.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return s}}};function Ii(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Ie){t=n;break}}return t}const _a=ga;function Li(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Cs(e,t,n,r,i){const{appear:s,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:f,onAfterEnter:c,onEnterCancelled:g,onBeforeLeave:S,onLeave:A,onAfterLeave:K,onLeaveCancelled:I,onBeforeAppear:Q,onAppear:z,onAfterAppear:q,onAppearCancelled:X}=t,U=String(e.key),ne=Li(n,e),ge=(G,ee)=>{G&&We(G,r,9,ee)},he=(G,ee)=>{const ue=ee[1];ge(G,ee),V(G)?G.every(j=>j.length<=1)&&ue():G.length<=1&&ue()},ke={mode:o,persisted:a,beforeEnter(G){let ee=l;if(!n.isMounted)if(s)ee=Q||l;else return;G[Xe]&&G[Xe](!0);const ue=ne[U];ue&&Et(e,ue)&&ue.el[Xe]&&ue.el[Xe](),ge(ee,[G])},enter(G){if(ne[U]===e)return;let ee=f,ue=c,j=g;if(!n.isMounted)if(s)ee=z||f,ue=q||c,j=X||g;else return;let le=!1;G[Gt]=b=>{le||(le=!0,b?ge(j,[G]):ge(ue,[G]),ke.delayedLeave&&ke.delayedLeave(),G[Gt]=void 0)};const y=G[Gt].bind(null,!1);ee?he(ee,[G,y]):y()},leave(G,ee){const ue=String(e.key);if(G[Gt]&&G[Gt](!0),n.isUnmounting)return ee();ge(S,[G]);let j=!1;G[Xe]=y=>{j||(j=!0,ee(),y?ge(I,[G]):ge(K,[G]),G[Xe]=void 0,ne[ue]===e&&delete ne[ue])};const le=G[Xe].bind(null,!1);ne[ue]=e,A?he(A,[G,le]):le()},clone(G){const ee=Cs(G,t,n,r,i);return i&&i(ee),ee}};return ke}function as(e){if(zn(e))return e=wt(e),e.children=null,e}function sr(e){if(!zn(e))return Mi(e.type)&&e.children?Ii(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&J(n.default))return n.default()}}function cn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,cn(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Ri(e,t=!1,n){let r=[],i=0;for(let s=0;s<e.length;s++){let o=e[s];const a=n==null?o.key:String(n)+String(o.key!=null?o.key:s);o.type===Z?(o.patchFlag&128&&i++,r=r.concat(Ri(o.children,t,a))):(t||o.type!==Ie)&&r.push(a!=null?wt(o,{key:a}):o)}if(i>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function Ni(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function rr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Ln=new WeakMap;function nn(e,t,n,r,i=!1){if(V(e)){e.forEach((I,Q)=>nn(I,t&&(V(t)?t[Q]:t),n,r,i));return}if(Dt(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&nn(e,t,n,r.component.subTree);return}const s=r.shapeFlag&4?Xn(r.component):r.el,o=i?null:s,{i:a,r:l}=e,f=t&&t.r,c=a.refs===fe?a.refs={}:a.refs,g=a.setupState,S=ce(g),A=g===fe?Yr:I=>rr(c,I)?!1:oe(S,I),K=(I,Q)=>!(Q&&rr(c,Q));if(f!=null&&f!==l){if(ir(t),ve(f))c[f]=null,A(f)&&(g[f]=null);else if(Fe(f)){const I=t;K(f,I.k)&&(f.value=null),I.k&&(c[I.k]=null)}}if(J(l))yn(l,a,12,[o,c]);else{const I=ve(l),Q=Fe(l);if(I||Q){const z=()=>{if(e.f){const q=I?A(l)?g[l]:c[l]:K()||!e.k?l.value:c[e.k];if(i)V(q)&&Is(q,s);else if(V(q))q.includes(s)||q.push(s);else if(I)c[l]=[s],A(l)&&(g[l]=c[l]);else{const X=[s];K(l,e.k)&&(l.value=X),e.k&&(c[e.k]=X)}}else I?(c[l]=o,A(l)&&(g[l]=o)):Q&&(K(l,e.k)&&(l.value=o),e.k&&(c[e.k]=o))};if(o){const q=()=>{z(),Ln.delete(e)};q.id=-1,Ln.set(e,q),De(q,n)}else ir(e),z()}}}function ir(e){const t=Ln.get(e);t&&(t.flags|=8,Ln.delete(e))}Vn().requestIdleCallback;Vn().cancelIdleCallback;const Dt=e=>!!e.type.__asyncLoader,zn=e=>e.type.__isKeepAlive;function ya(e,t){Bi(e,"a",t)}function va(e,t){Bi(e,"da",t)}function Bi(e,t,n=Le){const r=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(Gn(t,r,n),n){let i=n.parent;for(;i&&i.parent;)zn(i.parent.vnode)&&ba(r,t,n,i),i=i.parent}}function ba(e,t,n,r){const i=Gn(t,e,r,!0);Di(()=>{Is(r[t],i)},n)}function Gn(e,t,n=Le,r=!1){if(n){const i=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...o)=>{dt();const a=vn(n),l=We(t,n,e,o);return a(),ft(),l});return r?i.unshift(s):i.push(s),s}}const mt=e=>(t,n=Le)=>{(!fn||e==="sp")&&Gn(e,(...r)=>t(...r),n)},wa=mt("bm"),Pi=mt("m"),ka=mt("bu"),Ca=mt("u"),Fi=mt("bum"),Di=mt("um"),Aa=mt("sp"),Sa=mt("rtg"),xa=mt("rtc");function Ta(e,t=Le){Gn("ec",e,t)}const ji="components";function _e(e,t){return Hi(ji,e,!0,t)||e}const Ui=Symbol.for("v-ndc");function Ma(e){return ve(e)?Hi(ji,e,!1)||e:e||Ui}function Hi(e,t,n=!0,r=!1){const i=Te||Le;if(i){const s=i.type;{const a=hl(s,!1);if(a&&(a===t||a===Pe(t)||a===Hn(Pe(t))))return s}const o=or(i[e]||s[e],t)||or(i.appContext[e],t);return!o&&r?s:o}}function or(e,t){return e&&(e[t]||e[Pe(t)]||e[Hn(Pe(t))])}function Me(e,t,n,r){let i;const s=n,o=V(e);if(o||ve(e)){const a=o&&Lt(e);let l=!1,f=!1;a&&(l=!Ke(e),f=bt(e),e=Kn(e)),i=new Array(e.length);for(let c=0,g=e.length;c<g;c++)i[c]=t(l?f?Ut(ht(e[c])):ht(e[c]):e[c],c,void 0,s)}else if(typeof e=="number"){i=new Array(e);for(let a=0;a<e;a++)i[a]=t(a+1,a,void 0,s)}else if(ae(e))if(e[Symbol.iterator])i=Array.from(e,(a,l)=>t(a,l,void 0,s));else{const a=Object.keys(e);i=new Array(a.length);for(let l=0,f=a.length;l<f;l++){const c=a[l];i[l]=t(e[c],c,l,s)}}else i=[];return i}function Ea(e,t,n={},r,i){if(Te.ce||Te.parent&&Dt(Te.parent)&&Te.parent.ce){const f=Object.keys(n).length>0;return p(),be(Z,null,[ye("slot",n,r&&r())],f?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),p();const o=s&&$i(s(n)),a=n.key||o&&o.key,l=be(Z,{key:(a&&!qe(a)?a:`_${t}`)+(!o&&r?"_fb":"")},o||(r?r():[]),o&&e._===1?64:-2);return s&&s._c&&(s._d=!0),l}function $i(e){return e.some(t=>dn(t)?!(t.type===Ie||t.type===Z&&!$i(t.children)):!0)?e:null}const As=e=>e?co(e)?Xn(e):As(e.parent):null,sn=Ae(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>As(e.parent),$root:e=>As(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ki(e),$forceUpdate:e=>e.f||(e.f=()=>{Us(e.update)}),$nextTick:e=>e.n||(e.n=bi.bind(e.proxy)),$watch:e=>ha.bind(e)}),ls=(e,t)=>e!==fe&&!e.__isScriptSetup&&oe(e,t),Oa={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:i,props:s,accessCache:o,type:a,appContext:l}=e;if(t[0]!=="$"){const S=o[t];if(S!==void 0)switch(S){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return s[t]}else{if(ls(r,t))return o[t]=1,r[t];if(i!==fe&&oe(i,t))return o[t]=2,i[t];if(oe(s,t))return o[t]=3,s[t];if(n!==fe&&oe(n,t))return o[t]=4,n[t];Ss&&(o[t]=0)}}const f=sn[t];let c,g;if(f)return t==="$attrs"&&Oe(e.attrs,"get",""),f(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==fe&&oe(n,t))return o[t]=4,n[t];if(g=l.config.globalProperties,oe(g,t))return g[t]},set({_:e},t,n){const{data:r,setupState:i,ctx:s}=e;return ls(i,t)?(i[t]=n,!0):r!==fe&&oe(r,t)?(r[t]=n,!0):oe(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:s,type:o}},a){let l;return!!(n[a]||e!==fe&&a[0]!=="$"&&oe(e,a)||ls(t,a)||oe(s,a)||oe(r,a)||oe(sn,a)||oe(i.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:oe(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function ar(e){return V(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Ss=!0;function Ia(e){const t=Ki(e),n=e.proxy,r=e.ctx;Ss=!1,t.beforeCreate&&lr(t.beforeCreate,e,"bc");const{data:i,computed:s,methods:o,watch:a,provide:l,inject:f,created:c,beforeMount:g,mounted:S,beforeUpdate:A,updated:K,activated:I,deactivated:Q,beforeDestroy:z,beforeUnmount:q,destroyed:X,unmounted:U,render:ne,renderTracked:ge,renderTriggered:he,errorCaptured:ke,serverPrefetch:G,expose:ee,inheritAttrs:ue,components:j,directives:le,filters:y}=t;if(f&&La(f,r,null),o)for(const h in o){const v=o[h];J(v)&&(r[h]=v.bind(n))}if(i){const h=i.call(n,n);ae(h)&&(e.data=qn(h))}if(Ss=!0,s)for(const h in s){const v=s[h],C=J(v)?v.bind(n,n):J(v.get)?v.get.bind(n,n):tt,N=!J(v)&&J(v.set)?v.set.bind(n):tt,B=pl({get:C,set:N});Object.defineProperty(r,h,{enumerable:!0,configurable:!0,get:()=>B.value,set:H=>B.value=H})}if(a)for(const h in a)Vi(a[h],r,n,h);if(l){const h=J(l)?l.call(n):l;Reflect.ownKeys(h).forEach(v=>{ua(v,h[v])})}c&&lr(c,e,"c");function w(h,v){V(v)?v.forEach(C=>h(C.bind(n))):v&&h(v.bind(n))}if(w(wa,g),w(Pi,S),w(ka,A),w(Ca,K),w(ya,I),w(va,Q),w(Ta,ke),w(xa,ge),w(Sa,he),w(Fi,q),w(Di,U),w(Aa,G),V(ee))if(ee.length){const h=e.exposed||(e.exposed={});ee.forEach(v=>{Object.defineProperty(h,v,{get:()=>n[v],set:C=>n[v]=C,enumerable:!0})})}else e.exposed||(e.exposed={});ne&&e.render===tt&&(e.render=ne),ue!=null&&(e.inheritAttrs=ue),j&&(e.components=j),le&&(e.directives=le),G&&Ni(e)}function La(e,t,n=tt){V(e)&&(e=xs(e));for(const r in e){const i=e[r];let s;ae(i)?"default"in i?s=Tn(i.from||r,i.default,!0):s=Tn(i.from||r):s=Tn(i),Fe(s)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):t[r]=s}}function lr(e,t,n){We(V(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Vi(e,t,n,r){let i=r.includes(".")?Ti(n,r):()=>n[r];if(ve(e)){const s=t[e];J(s)&&os(i,s)}else if(J(e))os(i,e.bind(n));else if(ae(e))if(V(e))e.forEach(s=>Vi(s,t,n,r));else{const s=J(e.handler)?e.handler.bind(n):t[e.handler];J(s)&&os(i,s,e)}}function Ki(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(t);let l;return a?l=a:!i.length&&!n&&!r?l=t:(l={},i.length&&i.forEach(f=>Rn(l,f,o,!0)),Rn(l,t,o)),ae(t)&&s.set(t,l),l}function Rn(e,t,n,r=!1){const{mixins:i,extends:s}=t;s&&Rn(e,s,n,!0),i&&i.forEach(o=>Rn(e,o,n,!0));for(const o in t)if(!(r&&o==="expose")){const a=Ra[o]||n&&n[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const Ra={data:cr,props:ur,emits:ur,methods:Jt,computed:Jt,beforeCreate:Ne,created:Ne,beforeMount:Ne,mounted:Ne,beforeUpdate:Ne,updated:Ne,beforeDestroy:Ne,beforeUnmount:Ne,destroyed:Ne,unmounted:Ne,activated:Ne,deactivated:Ne,errorCaptured:Ne,serverPrefetch:Ne,components:Jt,directives:Jt,watch:Ba,provide:cr,inject:Na};function cr(e,t){return t?e?function(){return Ae(J(e)?e.call(this,this):e,J(t)?t.call(this,this):t)}:t:e}function Na(e,t){return Jt(xs(e),xs(t))}function xs(e){if(V(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ne(e,t){return e?[...new Set([].concat(e,t))]:t}function Jt(e,t){return e?Ae(Object.create(null),e,t):t}function ur(e,t){return e?V(e)&&V(t)?[...new Set([...e,...t])]:Ae(Object.create(null),ar(e),ar(t??{})):t}function Ba(e,t){if(!e)return t;if(!t)return e;const n=Ae(Object.create(null),e);for(const r in t)n[r]=Ne(e[r],t[r]);return n}function qi(){return{app:null,config:{isNativeTag:Yr,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Pa=0;function Fa(e,t){return function(r,i=null){J(r)||(r=Ae({},r)),i!=null&&!ae(i)&&(i=null);const s=qi(),o=new WeakSet,a=[];let l=!1;const f=s.app={_uid:Pa++,_component:r,_props:i,_container:null,_context:s,_instance:null,version:gl,get config(){return s.config},set config(c){},use(c,...g){return o.has(c)||(c&&J(c.install)?(o.add(c),c.install(f,...g)):J(c)&&(o.add(c),c(f,...g))),f},mixin(c){return s.mixins.includes(c)||s.mixins.push(c),f},component(c,g){return g?(s.components[c]=g,f):s.components[c]},directive(c,g){return g?(s.directives[c]=g,f):s.directives[c]},mount(c,g,S){if(!l){const A=f._ceVNode||ye(r,i);return A.appContext=s,S===!0?S="svg":S===!1&&(S=void 0),e(A,c,S),l=!0,f._container=c,c.__vue_app__=f,Xn(A.component)}},onUnmount(c){a.push(c)},unmount(){l&&(We(a,f._instance,16),e(null,f._container),delete f._container.__vue_app__)},provide(c,g){return s.provides[c]=g,f},runWithContext(c){const g=jt;jt=f;try{return c()}finally{jt=g}}};return f}}let jt=null;const Da=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Pe(t)}Modifiers`]||e[`${kt(t)}Modifiers`];function ja(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||fe;let i=n;const s=t.startsWith("update:"),o=s&&Da(r,t.slice(7));o&&(o.trim&&(i=n.map(c=>ve(c)?c.trim():c)),o.number&&(i=n.map($n)));let a,l=r[a=ts(t)]||r[a=ts(Pe(t))];!l&&s&&(l=r[a=ts(kt(t))]),l&&We(l,e,6,i);const f=r[a+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,We(f,e,6,i)}}const Ua=new WeakMap;function Wi(e,t,n=!1){const r=n?Ua:t.emitsCache,i=r.get(e);if(i!==void 0)return i;const s=e.emits;let o={},a=!1;if(!J(e)){const l=f=>{const c=Wi(f,t,!0);c&&(a=!0,Ae(o,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!s&&!a?(ae(e)&&r.set(e,null),null):(V(s)?s.forEach(l=>o[l]=null):Ae(o,s),ae(e)&&r.set(e,o),o)}function Yn(e,t){return!e||!Dn(t)?!1:(t=t.slice(2).replace(/Once$/,""),oe(e,t[0].toLowerCase()+t.slice(1))||oe(e,kt(t))||oe(e,t))}function dr(e){const{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[s],slots:o,attrs:a,emit:l,render:f,renderCache:c,props:g,data:S,setupState:A,ctx:K,inheritAttrs:I}=e,Q=In(e);let z,q;try{if(n.shapeFlag&4){const U=i||r,ne=U;z=et(f.call(ne,U,c,g,A,S,K)),q=a}else{const U=t;z=et(U.length>1?U(g,{attrs:a,slots:o,emit:l}):U(g,null)),q=t.props?a:Ha(a)}}catch(U){rn.length=0,Wn(U,e,1),z=ye(Ie)}let X=z;if(q&&I!==!1){const U=Object.keys(q),{shapeFlag:ne}=X;U.length&&ne&7&&(s&&U.some(jn)&&(q=$a(q,s)),X=wt(X,q,!1,!0))}return n.dirs&&(X=wt(X,null,!1,!0),X.dirs=X.dirs?X.dirs.concat(n.dirs):n.dirs),n.transition&&cn(X,n.transition),z=X,In(Q),z}const Ha=e=>{let t;for(const n in e)(n==="class"||n==="style"||Dn(n))&&((t||(t={}))[n]=e[n]);return t},$a=(e,t)=>{const n={};for(const r in e)(!jn(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Va(e,t,n){const{props:r,children:i,component:s}=e,{props:o,children:a,patchFlag:l}=t,f=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?fr(r,o,f):!!o;if(l&8){const c=t.dynamicProps;for(let g=0;g<c.length;g++){const S=c[g];if(zi(o,r,S)&&!Yn(f,S))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:r===o?!1:r?o?fr(r,o,f):!0:!!o;return!1}function fr(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){const s=r[i];if(zi(t,e,s)&&!Yn(n,s))return!0}return!1}function zi(e,t,n){const r=e[n],i=t[n];return n==="style"&&ae(r)&&ae(i)?!Vt(r,i):r!==i}function Ka({vnode:e,parent:t,suspense:n},r){for(;t;){const i=t.subTree;if(i.suspense&&i.suspense.activeBranch===e&&(i.suspense.vnode.el=i.el=r,e=i),i===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const Gi={},Yi=()=>Object.create(Gi),Ji=e=>Object.getPrototypeOf(e)===Gi;function qa(e,t,n,r=!1){const i={},s=Yi();e.propsDefaults=Object.create(null),Qi(e,t,i,s);for(const o in e.propsOptions[0])o in i||(i[o]=void 0);n?e.props=r?i:ea(i):e.type.props?e.props=i:e.props=s,e.attrs=s}function Wa(e,t,n,r){const{props:i,attrs:s,vnode:{patchFlag:o}}=e,a=ce(i),[l]=e.propsOptions;let f=!1;if((r||o>0)&&!(o&16)){if(o&8){const c=e.vnode.dynamicProps;for(let g=0;g<c.length;g++){let S=c[g];if(Yn(e.emitsOptions,S))continue;const A=t[S];if(l)if(oe(s,S))A!==s[S]&&(s[S]=A,f=!0);else{const K=Pe(S);i[K]=Ts(l,a,K,A,e,!1)}else A!==s[S]&&(s[S]=A,f=!0)}}}else{Qi(e,t,i,s)&&(f=!0);let c;for(const g in a)(!t||!oe(t,g)&&((c=kt(g))===g||!oe(t,c)))&&(l?n&&(n[g]!==void 0||n[c]!==void 0)&&(i[g]=Ts(l,a,g,void 0,e,!0)):delete i[g]);if(s!==a)for(const g in s)(!t||!oe(t,g))&&(delete s[g],f=!0)}f&&lt(e.attrs,"set","")}function Qi(e,t,n,r){const[i,s]=e.propsOptions;let o=!1,a;if(t)for(let l in t){if(Zt(l))continue;const f=t[l];let c;i&&oe(i,c=Pe(l))?!s||!s.includes(c)?n[c]=f:(a||(a={}))[c]=f:Yn(e.emitsOptions,l)||(!(l in r)||f!==r[l])&&(r[l]=f,o=!0)}if(s){const l=ce(n),f=a||fe;for(let c=0;c<s.length;c++){const g=s[c];n[g]=Ts(i,l,g,f[g],e,!oe(f,g))}}return o}function Ts(e,t,n,r,i,s){const o=e[n];if(o!=null){const a=oe(o,"default");if(a&&r===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&J(l)){const{propsDefaults:f}=i;if(n in f)r=f[n];else{const c=vn(i);r=f[n]=l.call(null,t),c()}}else r=l;i.ce&&i.ce._setProp(n,r)}o[0]&&(s&&!a?r=!1:o[1]&&(r===""||r===kt(n))&&(r=!0))}return r}const za=new WeakMap;function Xi(e,t,n=!1){const r=n?za:t.propsCache,i=r.get(e);if(i)return i;const s=e.props,o={},a=[];let l=!1;if(!J(e)){const c=g=>{l=!0;const[S,A]=Xi(g,t,!0);Ae(o,S),A&&a.push(...A)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!s&&!l)return ae(e)&&r.set(e,Bt),Bt;if(V(s))for(let c=0;c<s.length;c++){const g=Pe(s[c]);hr(g)&&(o[g]=fe)}else if(s)for(const c in s){const g=Pe(c);if(hr(g)){const S=s[c],A=o[g]=V(S)||J(S)?{type:S}:Ae({},S),K=A.type;let I=!1,Q=!0;if(V(K))for(let z=0;z<K.length;++z){const q=K[z],X=J(q)&&q.name;if(X==="Boolean"){I=!0;break}else X==="String"&&(Q=!1)}else I=J(K)&&K.name==="Boolean";A[0]=I,A[1]=Q,(I||oe(A,"default"))&&a.push(g)}}const f=[o,a];return ae(e)&&r.set(e,f),f}function hr(e){return e[0]!=="$"&&!Zt(e)}const Hs=e=>e==="_"||e==="_ctx"||e==="$stable",$s=e=>V(e)?e.map(et):[et(e)],Ga=(e,t,n)=>{if(t._n)return t;const r=Si((...i)=>$s(t(...i)),n);return r._c=!1,r},Zi=(e,t,n)=>{const r=e._ctx;for(const i in e){if(Hs(i))continue;const s=e[i];if(J(s))t[i]=Ga(i,s,r);else if(s!=null){const o=$s(s);t[i]=()=>o}}},eo=(e,t)=>{const n=$s(t);e.slots.default=()=>n},to=(e,t,n)=>{for(const r in t)(n||!Hs(r))&&(e[r]=t[r])},Ya=(e,t,n)=>{const r=e.slots=Yi();if(e.vnode.shapeFlag&32){const i=t._;i?(to(r,t,n),n&&Zr(r,"_",i,!0)):Zi(t,r)}else t&&eo(e,t)},Ja=(e,t,n)=>{const{vnode:r,slots:i}=e;let s=!0,o=fe;if(r.shapeFlag&32){const a=t._;a?n&&a===1?s=!1:to(i,t,n):(s=!t.$stable,Zi(t,i)),o=t}else t&&(eo(e,t),o={default:1});if(s)for(const a in i)!Hs(a)&&o[a]==null&&delete i[a]},De=tl;function Qa(e){return Xa(e)}function Xa(e,t){const n=Vn();n.__VUE__=!0;const{insert:r,remove:i,patchProp:s,createElement:o,createText:a,createComment:l,setText:f,setElementText:c,parentNode:g,nextSibling:S,setScopeId:A=tt,insertStaticContent:K}=e,I=(d,m,k,E=null,x=null,T=null,P=void 0,R=null,L=!!m.dynamicChildren)=>{if(d===m)return;d&&!Et(d,m)&&(E=kn(d),H(d,x,T,!0),d=null),m.patchFlag===-2&&(L=!1,m.dynamicChildren=null);const{type:M,ref:W,shapeFlag:F}=m;switch(M){case Jn:Q(d,m,k,E);break;case Ie:z(d,m,k,E);break;case us:d==null&&q(m,k,E,P);break;case Z:j(d,m,k,E,x,T,P,R,L);break;default:F&1?ne(d,m,k,E,x,T,P,R,L):F&6?le(d,m,k,E,x,T,P,R,L):(F&64||F&128)&&M.process(d,m,k,E,x,T,P,R,L,qt)}W!=null&&x?nn(W,d&&d.ref,T,m||d,!m):W==null&&d&&d.ref!=null&&nn(d.ref,null,T,d,!0)},Q=(d,m,k,E)=>{if(d==null)r(m.el=a(m.children),k,E);else{const x=m.el=d.el;m.children!==d.children&&f(x,m.children)}},z=(d,m,k,E)=>{d==null?r(m.el=l(m.children||""),k,E):m.el=d.el},q=(d,m,k,E)=>{[d.el,d.anchor]=K(d.children,m,k,E,d.el,d.anchor)},X=({el:d,anchor:m},k,E)=>{let x;for(;d&&d!==m;)x=S(d),r(d,k,E),d=x;r(m,k,E)},U=({el:d,anchor:m})=>{let k;for(;d&&d!==m;)k=S(d),i(d),d=k;i(m)},ne=(d,m,k,E,x,T,P,R,L)=>{if(m.type==="svg"?P="svg":m.type==="math"&&(P="mathml"),d==null)ge(m,k,E,x,T,P,R,L);else{const M=d.el&&d.el._isVueCE?d.el:null;try{M&&M._beginPatch(),G(d,m,x,T,P,R,L)}finally{M&&M._endPatch()}}},ge=(d,m,k,E,x,T,P,R)=>{let L,M;const{props:W,shapeFlag:F,transition:$,dirs:Y}=d;if(L=d.el=o(d.type,T,W&&W.is,W),F&8?c(L,d.children):F&16&&ke(d.children,L,null,E,x,cs(d,T),P,R),Y&&Ct(d,null,E,"created"),he(L,d,d.scopeId,P,E),W){for(const de in W)de!=="value"&&!Zt(de)&&s(L,de,null,W[de],T,E);"value"in W&&s(L,"value",null,W.value,T),(M=W.onVnodeBeforeMount)&&Je(M,E,d)}Y&&Ct(d,null,E,"beforeMount");const se=Za(x,$);se&&$.beforeEnter(L),r(L,m,k),((M=W&&W.onVnodeMounted)||se||Y)&&De(()=>{try{M&&Je(M,E,d),se&&$.enter(L),Y&&Ct(d,null,E,"mounted")}finally{}},x)},he=(d,m,k,E,x)=>{if(k&&A(d,k),E)for(let T=0;T<E.length;T++)A(d,E[T]);if(x){let T=x.subTree;if(m===T||io(T.type)&&(T.ssContent===m||T.ssFallback===m)){const P=x.vnode;he(d,P,P.scopeId,P.slotScopeIds,x.parent)}}},ke=(d,m,k,E,x,T,P,R,L=0)=>{for(let M=L;M<d.length;M++){const W=d[M]=R?ot(d[M]):et(d[M]);I(null,W,m,k,E,x,T,P,R)}},G=(d,m,k,E,x,T,P)=>{const R=m.el=d.el;let{patchFlag:L,dynamicChildren:M,dirs:W}=m;L|=d.patchFlag&16;const F=d.props||fe,$=m.props||fe;let Y;if(k&&At(k,!1),(Y=$.onVnodeBeforeUpdate)&&Je(Y,k,m,d),W&&Ct(m,d,k,"beforeUpdate"),k&&At(k,!0),(F.innerHTML&&$.innerHTML==null||F.textContent&&$.textContent==null)&&c(R,""),M?ee(d.dynamicChildren,M,R,k,E,cs(m,x),T):P||v(d,m,R,null,k,E,cs(m,x),T,!1),L>0){if(L&16)ue(R,F,$,k,x);else if(L&2&&F.class!==$.class&&s(R,"class",null,$.class,x),L&4&&s(R,"style",F.style,$.style,x),L&8){const se=m.dynamicProps;for(let de=0;de<se.length;de++){const me=se[de],Ce=F[me],Se=$[me];(Se!==Ce||me==="value")&&s(R,me,Ce,Se,x,k)}}L&1&&d.children!==m.children&&c(R,m.children)}else!P&&M==null&&ue(R,F,$,k,x);((Y=$.onVnodeUpdated)||W)&&De(()=>{Y&&Je(Y,k,m,d),W&&Ct(m,d,k,"updated")},E)},ee=(d,m,k,E,x,T,P)=>{for(let R=0;R<m.length;R++){const L=d[R],M=m[R],W=L.el&&(L.type===Z||!Et(L,M)||L.shapeFlag&198)?g(L.el):k;I(L,M,W,null,E,x,T,P,!0)}},ue=(d,m,k,E,x)=>{if(m!==k){if(m!==fe)for(const T in m)!Zt(T)&&!(T in k)&&s(d,T,m[T],null,x,E);for(const T in k){if(Zt(T))continue;const P=k[T],R=m[T];P!==R&&T!=="value"&&s(d,T,R,P,x,E)}"value"in k&&s(d,"value",m.value,k.value,x)}},j=(d,m,k,E,x,T,P,R,L)=>{const M=m.el=d?d.el:a(""),W=m.anchor=d?d.anchor:a("");let{patchFlag:F,dynamicChildren:$,slotScopeIds:Y}=m;Y&&(R=R?R.concat(Y):Y),d==null?(r(M,k,E),r(W,k,E),ke(m.children||[],k,W,x,T,P,R,L)):F>0&&F&64&&$&&d.dynamicChildren&&d.dynamicChildren.length===$.length?(ee(d.dynamicChildren,$,k,x,T,P,R),(m.key!=null||x&&m===x.subTree)&&no(d,m,!0)):v(d,m,k,W,x,T,P,R,L)},le=(d,m,k,E,x,T,P,R,L)=>{m.slotScopeIds=R,d==null?m.shapeFlag&512?x.ctx.activate(m,k,E,P,L):y(m,k,E,x,T,P,L):b(d,m,L)},y=(d,m,k,E,x,T,P)=>{const R=d.component=ll(d,E,x);if(zn(d)&&(R.ctx.renderer=qt),cl(R,!1,P),R.asyncDep){if(x&&x.registerDep(R,w,P),!d.el){const L=R.subTree=ye(Ie);z(null,L,m,k),d.placeholder=L.el}}else w(R,d,m,k,x,T,P)},b=(d,m,k)=>{const E=m.component=d.component;if(Va(d,m,k))if(E.asyncDep&&!E.asyncResolved){h(E,m,k);return}else E.next=m,E.update();else m.el=d.el,E.vnode=m},w=(d,m,k,E,x,T,P)=>{const R=()=>{if(d.isMounted){let{next:F,bu:$,u:Y,parent:se,vnode:de}=d;{const Ge=so(d);if(Ge){F&&(F.el=de.el,h(d,F,P)),Ge.asyncDep.then(()=>{De(()=>{d.isUnmounted||M()},x)});return}}let me=F,Ce;At(d,!1),F?(F.el=de.el,h(d,F,P)):F=de,$&&xn($),(Ce=F.props&&F.props.onVnodeBeforeUpdate)&&Je(Ce,se,F,de),At(d,!0);const Se=dr(d),ze=d.subTree;d.subTree=Se,I(ze,Se,g(ze.el),kn(ze),d,x,T),F.el=Se.el,me===null&&Ka(d,Se.el),Y&&De(Y,x),(Ce=F.props&&F.props.onVnodeUpdated)&&De(()=>Je(Ce,se,F,de),x)}else{let F;const{el:$,props:Y}=m,{bm:se,m:de,parent:me,root:Ce,type:Se}=d,ze=Dt(m);At(d,!1),se&&xn(se),!ze&&(F=Y&&Y.onVnodeBeforeMount)&&Je(F,me,m),At(d,!0);{Ce.ce&&Ce.ce._hasShadowRoot()&&Ce.ce._injectChildStyle(Se,d.parent?d.parent.type:void 0);const Ge=d.subTree=dr(d);I(null,Ge,k,E,d,x,T),m.el=Ge.el}if(de&&De(de,x),!ze&&(F=Y&&Y.onVnodeMounted)){const Ge=m;De(()=>Je(F,me,Ge),x)}(m.shapeFlag&256||me&&Dt(me.vnode)&&me.vnode.shapeFlag&256)&&d.a&&De(d.a,x),d.isMounted=!0,m=k=E=null}};d.scope.on();const L=d.effect=new si(R);d.scope.off();const M=d.update=L.run.bind(L),W=d.job=L.runIfDirty.bind(L);W.i=d,W.id=d.uid,L.scheduler=()=>Us(W),At(d,!0),M()},h=(d,m,k)=>{m.component=d;const E=d.vnode.props;d.vnode=m,d.next=null,Wa(d,m.props,E,k),Ja(d,m.children,k),dt(),nr(d),ft()},v=(d,m,k,E,x,T,P,R,L=!1)=>{const M=d&&d.children,W=d?d.shapeFlag:0,F=m.children,{patchFlag:$,shapeFlag:Y}=m;if($>0){if($&128){N(M,F,k,E,x,T,P,R,L);return}else if($&256){C(M,F,k,E,x,T,P,R,L);return}}Y&8?(W&16&&Kt(M,x,T),F!==M&&c(k,F)):W&16?Y&16?N(M,F,k,E,x,T,P,R,L):Kt(M,x,T,!0):(W&8&&c(k,""),Y&16&&ke(F,k,E,x,T,P,R,L))},C=(d,m,k,E,x,T,P,R,L)=>{d=d||Bt,m=m||Bt;const M=d.length,W=m.length,F=Math.min(M,W);let $;for($=0;$<F;$++){const Y=m[$]=L?ot(m[$]):et(m[$]);I(d[$],Y,k,null,x,T,P,R,L)}M>W?Kt(d,x,T,!0,!1,F):ke(m,k,E,x,T,P,R,L,F)},N=(d,m,k,E,x,T,P,R,L)=>{let M=0;const W=m.length;let F=d.length-1,$=W-1;for(;M<=F&&M<=$;){const Y=d[M],se=m[M]=L?ot(m[M]):et(m[M]);if(Et(Y,se))I(Y,se,k,null,x,T,P,R,L);else break;M++}for(;M<=F&&M<=$;){const Y=d[F],se=m[$]=L?ot(m[$]):et(m[$]);if(Et(Y,se))I(Y,se,k,null,x,T,P,R,L);else break;F--,$--}if(M>F){if(M<=$){const Y=$+1,se=Y<W?m[Y].el:E;for(;M<=$;)I(null,m[M]=L?ot(m[M]):et(m[M]),k,se,x,T,P,R,L),M++}}else if(M>$)for(;M<=F;)H(d[M],x,T,!0),M++;else{const Y=M,se=M,de=new Map;for(M=se;M<=$;M++){const Ue=m[M]=L?ot(m[M]):et(m[M]);Ue.key!=null&&de.set(Ue.key,M)}let me,Ce=0;const Se=$-se+1;let ze=!1,Ge=0;const Wt=new Array(Se);for(M=0;M<Se;M++)Wt[M]=0;for(M=Y;M<=F;M++){const Ue=d[M];if(Ce>=Se){H(Ue,x,T,!0);continue}let Ye;if(Ue.key!=null)Ye=de.get(Ue.key);else for(me=se;me<=$;me++)if(Wt[me-se]===0&&Et(Ue,m[me])){Ye=me;break}Ye===void 0?H(Ue,x,T,!0):(Wt[Ye-se]=M+1,Ye>=Ge?Ge=Ye:ze=!0,I(Ue,m[Ye],k,null,x,T,P,R,L),Ce++)}const Ys=ze?el(Wt):Bt;for(me=Ys.length-1,M=Se-1;M>=0;M--){const Ue=se+M,Ye=m[Ue],Js=m[Ue+1],Qs=Ue+1<W?Js.el||ro(Js):E;Wt[M]===0?I(null,Ye,k,Qs,x,T,P,R,L):ze&&(me<0||M!==Ys[me]?B(Ye,k,Qs,2):me--)}}},B=(d,m,k,E,x=null)=>{const{el:T,type:P,transition:R,children:L,shapeFlag:M}=d;if(M&6){B(d.component.subTree,m,k,E);return}if(M&128){d.suspense.move(m,k,E);return}if(M&64){P.move(d,m,k,qt);return}if(P===Z){r(T,m,k);for(let F=0;F<L.length;F++)B(L[F],m,k,E);r(d.anchor,m,k);return}if(P===us){X(d,m,k);return}if(E!==2&&M&1&&R)if(E===0)R.beforeEnter(T),r(T,m,k),De(()=>R.enter(T),x);else{const{leave:F,delayLeave:$,afterLeave:Y}=R,se=()=>{d.ctx.isUnmounted?i(T):r(T,m,k)},de=()=>{T._isLeaving&&T[Xe](!0),F(T,()=>{se(),Y&&Y()})};$?$(T,se,de):de()}else r(T,m,k)},H=(d,m,k,E=!1,x=!1)=>{const{type:T,props:P,ref:R,children:L,dynamicChildren:M,shapeFlag:W,patchFlag:F,dirs:$,cacheIndex:Y,memo:se}=d;if(F===-2&&(x=!1),R!=null&&(dt(),nn(R,null,k,d,!0),ft()),Y!=null&&(m.renderCache[Y]=void 0),W&256){m.ctx.deactivate(d);return}const de=W&1&&$,me=!Dt(d);let Ce;if(me&&(Ce=P&&P.onVnodeBeforeUnmount)&&Je(Ce,m,d),W&6)Zn(d.component,k,E);else{if(W&128){d.suspense.unmount(k,E);return}de&&Ct(d,null,m,"beforeUnmount"),W&64?d.type.remove(d,m,k,qt,E):M&&!M.hasOnce&&(T!==Z||F>0&&F&64)?Kt(M,m,k,!1,!0):(T===Z&&F&384||!x&&W&16)&&Kt(L,m,k),E&&ie(d)}const Se=se!=null&&Y==null;(me&&(Ce=P&&P.onVnodeUnmounted)||de||Se)&&De(()=>{Ce&&Je(Ce,m,d),de&&Ct(d,null,m,"unmounted"),Se&&(d.el=null)},k)},ie=d=>{const{type:m,el:k,anchor:E,transition:x}=d;if(m===Z){te(k,E);return}if(m===us){U(d);return}const T=()=>{i(k),x&&!x.persisted&&x.afterLeave&&x.afterLeave()};if(d.shapeFlag&1&&x&&!x.persisted){const{leave:P,delayLeave:R}=x,L=()=>P(k,T);R?R(d.el,T,L):L()}else T()},te=(d,m)=>{let k;for(;d!==m;)k=S(d),i(d),d=k;i(m)},Zn=(d,m,k)=>{const{bum:E,scope:x,job:T,subTree:P,um:R,m:L,a:M}=d;mr(L),mr(M),E&&xn(E),x.stop(),T&&(T.flags|=8,H(P,d,m,k)),R&&De(R,m),De(()=>{d.isUnmounted=!0},m)},Kt=(d,m,k,E=!1,x=!1,T=0)=>{for(let P=T;P<d.length;P++)H(d[P],m,k,E,x)},kn=d=>{if(d.shapeFlag&6)return kn(d.component.subTree);if(d.shapeFlag&128)return d.suspense.next();const m=S(d.anchor||d.el),k=m&&m[ma];return k?S(k):m};let es=!1;const Gs=(d,m,k)=>{let E;d==null?m._vnode&&(H(m._vnode,null,null,!0),E=m._vnode.component):I(m._vnode||null,d,m,null,null,null,k),m._vnode=d,es||(es=!0,nr(E),ki(),es=!1)},qt={p:I,um:H,m:B,r:ie,mt:y,mc:ke,pc:v,pbc:ee,n:kn,o:e};return{render:Gs,hydrate:void 0,createApp:Fa(Gs)}}function cs({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function At({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Za(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function no(e,t,n=!1){const r=e.children,i=t.children;if(V(r)&&V(i))for(let s=0;s<r.length;s++){const o=r[s];let a=i[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[s]=ot(i[s]),a.el=o.el),!n&&a.patchFlag!==-2&&no(o,a)),a.type===Jn&&(a.patchFlag===-1&&(a=i[s]=ot(a)),a.el=o.el),a.type===Ie&&!a.el&&(a.el=o.el)}}function el(e){const t=e.slice(),n=[0];let r,i,s,o,a;const l=e.length;for(r=0;r<l;r++){const f=e[r];if(f!==0){if(i=n[n.length-1],e[i]<f){t[r]=i,n.push(r);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,e[n[a]]<f?s=a+1:o=a;f<e[n[s]]&&(s>0&&(t[r]=n[s-1]),n[s]=r)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=t[o];return n}function so(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:so(t)}function mr(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function ro(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?ro(t.subTree):null}const io=e=>e.__isSuspense;function tl(e,t){t&&t.pendingBranch?V(e)?t.effects.push(...e):t.effects.push(e):ca(e)}const Z=Symbol.for("v-fgt"),Jn=Symbol.for("v-txt"),Ie=Symbol.for("v-cmt"),us=Symbol.for("v-stc"),rn=[];let He=null;function p(e=!1){rn.push(He=e?null:[])}function nl(){rn.pop(),He=rn[rn.length-1]||null}let un=1;function Nn(e,t=!1){un+=e,e<0&&He&&t&&(He.hasOnce=!0)}function oo(e){return e.dynamicChildren=un>0?He||Bt:null,nl(),un>0&&He&&He.push(e),e}function _(e,t,n,r,i,s){return oo(u(e,t,n,r,i,s,!0))}function be(e,t,n,r,i){return oo(ye(e,t,n,r,i,!0))}function dn(e){return e?e.__v_isVNode===!0:!1}function Et(e,t){return e.type===t.type&&e.key===t.key}const ao=({key:e})=>e??null,Mn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?ve(e)||Fe(e)||J(e)?{i:Te,r:e,k:t,f:!!n}:e:null);function u(e,t=null,n=null,r=0,i=null,s=e===Z?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ao(t),ref:t&&Mn(t),scopeId:Ai,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Te};return a?(Vs(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=ve(n)?8:16),un>0&&!o&&He&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&He.push(l),l}const ye=sl;function sl(e,t=null,n=null,r=0,i=null,s=!1){if((!e||e===Ui)&&(e=Ie),dn(e)){const a=wt(e,t,!0);return n&&Vs(a,n),un>0&&!s&&He&&(a.shapeFlag&6?He[He.indexOf(e)]=a:He.push(a)),a.patchFlag=-2,a}if(ml(e)&&(e=e.__vccOpts),t){t=rl(t);let{class:a,style:l}=t;a&&!ve(a)&&(t.class=re(a)),ae(l)&&(js(l)&&!V(l)&&(l=Ae({},l)),t.style=je(l))}const o=ve(e)?1:io(e)?128:Mi(e)?64:ae(e)?4:J(e)?2:0;return u(e,t,n,r,i,o,s,!0)}function rl(e){return e?js(e)||Ji(e)?Ae({},e):e:null}function wt(e,t,n=!1,r=!1){const{props:i,ref:s,patchFlag:o,children:a,transition:l}=e,f=t?il(i||{},t):i,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&ao(f),ref:t&&t.ref?n&&s?V(s)?s.concat(Mn(t)):[s,Mn(t)]:Mn(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Z?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&wt(e.ssContent),ssFallback:e.ssFallback&&wt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&cn(c,l.clone(c)),c}function Qn(e=" ",t=0){return ye(Jn,null,e,t)}function D(e="",t=!1){return t?(p(),be(Ie,null,e)):ye(Ie,null,e)}function et(e){return e==null||typeof e=="boolean"?ye(Ie):V(e)?ye(Z,null,e.slice()):dn(e)?ot(e):ye(Jn,null,String(e))}function ot(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:wt(e)}function Vs(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(V(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),Vs(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!Ji(t)?t._ctx=Te:i===3&&Te&&(Te.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else J(t)?(t={default:t,_ctx:Te},n=32):(t=String(t),r&64?(n=16,t=[Qn(t)]):n=8);e.children=t,e.shapeFlag|=n}function il(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const i in r)if(i==="class")t.class!==r.class&&(t.class=re([t.class,r.class]));else if(i==="style")t.style=je([t.style,r.style]);else if(Dn(i)){const s=t[i],o=r[i];o&&s!==o&&!(V(s)&&s.includes(o))?t[i]=s?[].concat(s,o):o:o==null&&s==null&&!jn(i)&&(t[i]=o)}else i!==""&&(t[i]=r[i])}return t}function Je(e,t,n,r=null){We(e,t,7,[n,r])}const ol=qi();let al=0;function ll(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||ol,s={uid:al++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new No(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Xi(r,i),emitsOptions:Wi(r,i),emit:null,emitted:null,propsDefaults:fe,inheritAttrs:r.inheritAttrs,ctx:fe,data:fe,props:fe,attrs:fe,slots:fe,refs:fe,setupState:fe,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=t?t.root:s,s.emit=ja.bind(null,s),e.ce&&e.ce(s),s}let Le=null;const lo=()=>Le||Te;let Bn,Ms;{const e=Vn(),t=(n,r)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(r),s=>{i.length>1?i.forEach(o=>o(s)):i[0](s)}};Bn=t("__VUE_INSTANCE_SETTERS__",n=>Le=n),Ms=t("__VUE_SSR_SETTERS__",n=>fn=n)}const vn=e=>{const t=Le;return Bn(e),e.scope.on(),()=>{e.scope.off(),Bn(t)}},pr=()=>{Le&&Le.scope.off(),Bn(null)};function co(e){return e.vnode.shapeFlag&4}let fn=!1;function cl(e,t=!1,n=!1){t&&Ms(t);const{props:r,children:i}=e.vnode,s=co(e);qa(e,r,s,t),Ya(e,i,n||t);const o=s?ul(e,t):void 0;return t&&Ms(!1),o}function ul(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Oa);const{setup:r}=n;if(r){dt();const i=e.setupContext=r.length>1?fl(e):null,s=vn(e),o=yn(r,e,0,[e.props,i]),a=Jr(o);if(ft(),s(),(a||e.sp)&&!Dt(e)&&Ni(e),a){if(o.then(pr,pr),t)return o.then(l=>{gr(e,l)}).catch(l=>{Wn(l,e,0)});e.asyncDep=o}else gr(e,o)}else uo(e)}function gr(e,t,n){J(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ae(t)&&(e.setupState=yi(t)),uo(e)}function uo(e,t,n){const r=e.type;e.render||(e.render=r.render||tt);{const i=vn(e);dt();try{Ia(e)}finally{ft(),i()}}}const dl={get(e,t){return Oe(e,"get",""),e[t]}};function fl(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,dl),slots:e.slots,emit:e.emit,expose:t}}function Xn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(yi(ks(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in sn)return sn[n](e)},has(t,n){return n in t||n in sn}})):e.proxy}function hl(e,t=!0){return J(e)?e.displayName||e.name:e.name||t&&e.__name}function ml(e){return J(e)&&"__vccOpts"in e}const pl=(e,t)=>ra(e,t,fn);function fo(e,t,n){try{Nn(-1);const r=arguments.length;return r===2?ae(t)&&!V(t)?dn(t)?ye(e,null,[t]):ye(e,t):ye(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&dn(n)&&(n=[n]),ye(e,t,n))}finally{Nn(1)}}const gl="3.5.34";/**
14
14
  * @vue/runtime-dom v3.5.34
15
15
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
16
  * @license MIT
17
- **/let Es;const _r=typeof window<"u"&&window.trustedTypes;if(_r)try{Es=_r.createPolicy("vue",{createHTML:e=>e})}catch{}const fo=Es?e=>Es.createHTML(e):e=>e,gl="http://www.w3.org/2000/svg",_l="http://www.w3.org/1998/Math/MathML",rt=typeof document<"u"?document:null,yr=rt&&rt.createElement("template"),yl={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const i=t==="svg"?rt.createElementNS(gl,e):t==="mathml"?rt.createElementNS(_l,e):n?rt.createElement(e,{is:n}):rt.createElement(e);return e==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:e=>rt.createTextNode(e),createComment:e=>rt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>rt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,s){const o=n?n.previousSibling:t.lastChild;if(i&&(i===s||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===s||!(i=i.nextSibling)););else{yr.innerHTML=fo(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=yr.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},pt="transition",Yt="animation",hn=Symbol("_vtc"),ho={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},vl=Ae({},Mi,ho),bl=e=>(e.displayName="Transition",e.props=vl,e),wl=bl((e,{slots:t})=>uo(ga,kl(e),t)),St=(e,t=[])=>{V(e)?e.forEach(n=>n(...t)):e&&e(...t)},vr=e=>e?V(e)?e.some(t=>t.length>1):e.length>1:!1;function kl(e){const t={};for(const j in e)j in ho||(t[j]=e[j]);if(e.css===!1)return t;const{name:n="v",type:r,duration:i,enterFromClass:s=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:f=o,appearToClass:c=a,leaveFromClass:g=`${n}-leave-from`,leaveActiveClass:S=`${n}-leave-active`,leaveToClass:A=`${n}-leave-to`}=e,K=Cl(i),I=K&&K[0],Q=K&&K[1],{onBeforeEnter:z,onEnter:q,onEnterCancelled:X,onLeave:U,onLeaveCancelled:ne,onBeforeAppear:ge=z,onAppear:he=q,onAppearCancelled:ke=X}=t,G=(j,le,y,b)=>{j._enterCancelled=b,xt(j,le?c:a),xt(j,le?f:o),y&&y()},ee=(j,le)=>{j._isLeaving=!1,xt(j,g),xt(j,A),xt(j,S),le&&le()},ue=j=>(le,y)=>{const b=j?he:q,w=()=>G(le,j,y);St(b,[le,w]),br(()=>{xt(le,j?l:s),st(le,j?c:a),vr(b)||wr(le,r,I,w)})};return Ae(t,{onBeforeEnter(j){St(z,[j]),st(j,s),st(j,o)},onBeforeAppear(j){St(ge,[j]),st(j,l),st(j,f)},onEnter:ue(!1),onAppear:ue(!0),onLeave(j,le){j._isLeaving=!0;const y=()=>ee(j,le);st(j,g),j._enterCancelled?(st(j,S),Ar(j)):(Ar(j),st(j,S)),br(()=>{j._isLeaving&&(xt(j,g),st(j,A),vr(U)||wr(j,r,Q,y))}),St(U,[j,y])},onEnterCancelled(j){G(j,!1,void 0,!0),St(X,[j])},onAppearCancelled(j){G(j,!0,void 0,!0),St(ke,[j])},onLeaveCancelled(j){ee(j),St(ne,[j])}})}function Cl(e){if(e==null)return null;if(ae(e))return[ds(e.enter),ds(e.leave)];{const t=ds(e);return[t,t]}}function ds(e){return So(e)}function st(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[hn]||(e[hn]=new Set)).add(t)}function xt(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[hn];n&&(n.delete(t),n.size||(e[hn]=void 0))}function br(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Al=0;function wr(e,t,n,r){const i=e._endId=++Al,s=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:o,timeout:a,propCount:l}=Sl(e,t);if(!o)return r();const f=o+"end";let c=0;const g=()=>{e.removeEventListener(f,S),s()},S=A=>{A.target===e&&++c>=l&&g()};setTimeout(()=>{c<l&&g()},a+1),e.addEventListener(f,S)}function Sl(e,t){const n=window.getComputedStyle(e),r=K=>(n[K]||"").split(", "),i=r(`${pt}Delay`),s=r(`${pt}Duration`),o=kr(i,s),a=r(`${Yt}Delay`),l=r(`${Yt}Duration`),f=kr(a,l);let c=null,g=0,S=0;t===pt?o>0&&(c=pt,g=o,S=s.length):t===Yt?f>0&&(c=Yt,g=f,S=l.length):(g=Math.max(o,f),c=g>0?o>f?pt:Yt:null,S=c?c===pt?s.length:l.length:0);const A=c===pt&&/\b(?:transform|all)(?:,|$)/.test(r(`${pt}Property`).toString());return{type:c,timeout:g,propCount:S,hasTransform:A}}function kr(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Cr(n)+Cr(e[r])))}function Cr(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Ar(e){return(e?e.ownerDocument:document).body.offsetHeight}function xl(e,t,n){const r=e[hn];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Sr=Symbol("_vod"),Tl=Symbol("_vsh"),Ml=Symbol(""),El=/(?:^|;)\s*display\s*:/;function Ol(e,t,n){const r=e.style,i=ve(n);let s=!1;if(n&&!i){if(t)if(ve(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&Qt(r,a,"")}else for(const o in t)n[o]==null&&Qt(r,o,"");for(const o in n){o==="display"&&(s=!0);const a=n[o];a!=null?Ll(e,o,!ve(t)&&t?t[o]:void 0,a)||Qt(r,o,a):Qt(r,o,"")}}else if(i){if(t!==n){const o=r[Ml];o&&(n+=";"+o),r.cssText=n,s=El.test(n)}}else t&&e.removeAttribute("style");Sr in e&&(e[Sr]=s?r.display:"",e[Tl]&&(r.display="none"))}const xr=/\s*!important$/;function Qt(e,t,n){if(V(n))n.forEach(r=>Qt(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Il(e,t);xr.test(n)?e.setProperty(kt(r),n.replace(xr,""),"important"):e[r]=n}}const Tr=["Webkit","Moz","ms"],fs={};function Il(e,t){const n=fs[t];if(n)return n;let r=Pe(t);if(r!=="filter"&&r in e)return fs[t]=r;r=Hn(r);for(let i=0;i<Tr.length;i++){const s=Tr[i]+r;if(s in e)return fs[t]=s}return t}function Ll(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&ve(r)&&n===r}const Mr="http://www.w3.org/1999/xlink";function Er(e,t,n,r,i,s=Io(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Mr,t.slice(6,t.length)):e.setAttributeNS(Mr,t,n):n==null||s&&!Zr(n)?e.removeAttribute(t):e.setAttribute(t,s?"":qe(n)?String(n):n)}function Or(e,t,n,r,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?fo(n):n);return}const s=e.tagName;if(t==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let o=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=Zr(n):n==null&&a==="string"?(n="",o=!0):a==="number"&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function _t(e,t,n,r){e.addEventListener(t,n,r)}function Rl(e,t,n,r){e.removeEventListener(t,n,r)}const Ir=Symbol("_vei");function Bl(e,t,n,r,i=null){const s=e[Ir]||(e[Ir]={}),o=s[t];if(r&&o)o.value=r;else{const[a,l]=Nl(t);if(r){const f=s[t]=Dl(r,i);_t(e,a,f,l)}else o&&(Rl(e,a,o,l),s[t]=void 0)}}const Lr=/(?:Once|Passive|Capture)$/;function Nl(e){let t;if(Lr.test(e)){t={};let r;for(;r=e.match(Lr);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):kt(e.slice(2)),t]}let hs=0;const Pl=Promise.resolve(),Fl=()=>hs||(Pl.then(()=>hs=0),hs=Date.now());function Dl(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;We(jl(r,n.value),t,5,[r])};return n.value=e,n.attached=Fl(),n}function jl(e,t){if(V(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>i=>!i._stopped&&r&&r(i))}else return t}const Rr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ul=(e,t,n,r,i,s)=>{const o=i==="svg";t==="class"?xl(e,r,o):t==="style"?Ol(e,n,r):Dn(t)?jn(t)||Bl(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Hl(e,t,r,o))?(Or(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Er(e,t,r,o,s,t!=="value")):e._isVueCE&&($l(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!ve(r)))?Or(e,Pe(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Er(e,t,r,o))};function Hl(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Rr(t)&&J(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Rr(t)&&ve(n)?!1:t in e}function $l(e,t){const n=e._def.props;if(!n)return!1;const r=Pe(t);return Array.isArray(n)?n.some(i=>Pe(i)===r):Object.keys(n).some(i=>Pe(i)===r)}const Ht=e=>{const t=e.props["onUpdate:modelValue"]||!1;return V(t)?n=>xn(t,n):t};function Vl(e){e.target.composing=!0}function Br(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ut=Symbol("_assign");function Nr(e,t,n){return t&&(e=e.trim()),n&&(e=$n(e)),e}const Ot={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[ut]=Ht(i);const s=r||i.props&&i.props.type==="number";_t(e,t?"change":"input",o=>{o.target.composing||e[ut](Nr(e.value,n,s))}),(n||s)&&_t(e,"change",()=>{e.value=Nr(e.value,n,s)}),t||(_t(e,"compositionstart",Vl),_t(e,"compositionend",Br),_t(e,"change",Br))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:s}},o){if(e[ut]=Ht(o),e.composing)return;const a=(s||e.type==="number")&&!/^0\d/.test(e.value)?$n(e.value):e.value,l=t??"";if(a===l)return;const f=e.getRootNode();(f instanceof Document||f instanceof ShadowRoot)&&f.activeElement===e&&e.type!=="range"&&(r&&t===n||i&&e.value.trim()===l)||(e.value=l)}},Kl={deep:!0,created(e,t,n){e[ut]=Ht(n),_t(e,"change",()=>{const r=e._modelValue,i=mn(e),s=e.checked,o=e[ut];if(V(r)){const a=Rs(r,i),l=a!==-1;if(s&&!l)o(r.concat(i));else if(!s&&l){const f=[...r];f.splice(a,1),o(f)}}else if($t(r)){const a=new Set(r);s?a.add(i):a.delete(i),o(a)}else o(mo(e,s))})},mounted:Pr,beforeUpdate(e,t,n){e[ut]=Ht(n),Pr(e,t,n)}};function Pr(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(V(t))i=Rs(t,r.props.value)>-1;else if($t(t))i=t.has(r.props.value);else{if(t===n)return;i=Vt(t,mo(e,!0))}e.checked!==i&&(e.checked=i)}const ql={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const i=$t(t);_t(e,"change",()=>{const s=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?$n(mn(o)):mn(o));e[ut](e.multiple?i?new Set(s):s:s[0]),e._assigning=!0,vi(()=>{e._assigning=!1})}),e[ut]=Ht(r)},mounted(e,{value:t}){Fr(e,t)},beforeUpdate(e,t,n){e[ut]=Ht(n)},updated(e,{value:t}){e._assigning||Fr(e,t)}};function Fr(e,t){const n=e.multiple,r=V(t);if(!(n&&!r&&!$t(t))){for(let i=0,s=e.options.length;i<s;i++){const o=e.options[i],a=mn(o);if(n)if(r){const l=typeof a;l==="string"||l==="number"?o.selected=t.some(f=>String(f)===String(a)):o.selected=Rs(t,a)>-1}else o.selected=t.has(a);else if(Vt(mn(o),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function mn(e){return"_value"in e?e._value:e.value}function mo(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Wl=["ctrl","shift","alt","meta"],zl={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Wl.some(n=>e[`${n}Key`]&&!t.includes(n))},yt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(i,...s)=>{for(let o=0;o<t.length;o++){const a=zl[t[o]];if(a&&a(i,t))return}return e(i,...s)})},Gl={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Pn=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=i=>{if(!("key"in i))return;const s=kt(i.key);if(t.some(o=>o===s||Gl[o]===s))return e(i)})},Yl=Ae({patchProp:Ul},yl);let Dr;function Jl(){return Dr||(Dr=Ja(Yl))}const Ql=(...e)=>{const t=Jl().createApp(...e),{mount:n}=t;return t.mount=r=>{const i=Zl(r);if(!i)return;const s=t._component;!J(s)&&!s.render&&!s.template&&(s.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=n(i,!1,Xl(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},t};function Xl(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Zl(e){return ve(e)?document.querySelector(e):e}const ec=["connected","message","message_stream","conversation_updated","config_updated","action_status"],ms="/client",tc=5*60*1e3,nc=10*60*1e3,sc=5*60*1e3;function rc(e){const t={baseUrl:ic(e.baseUrl||""),widgetId:e.widgetId||"",userId:"",origin:"",token:"",listeners:new Map,eventSource:null,connection:"idle",visibilityHandler:null,started:!1,panelOpen:!1,pollTimer:null,burstTimer:null,hiddenGraceTimer:null,lastActivityAt:null};if(!t.baseUrl||!t.widgetId)throw new Error("[transport] baseUrl and widgetId are required");function n(h,v){return t.listeners.has(h)||t.listeners.set(h,new Set),t.listeners.get(h).add(v),()=>t.listeners.get(h).delete(v)}function r(h,v){const C=t.listeners.get(h);C&&C.forEach(B=>{try{B(v)}catch(N){console.error("[transport] listener",h,N)}})}function i(h){t.connection!==h&&(t.connection=h,r("connection",h))}function s(){return{"Content-Type":"application/json","X-Widget-Id":t.widgetId}}async function o(h,v,C){const B=await fetch(`${t.baseUrl}${ms}${v}`,{method:h,credentials:"include",headers:s(),body:C!==void 0?JSON.stringify(C):void 0});if(!B.ok){const N=await a(B),H=new Error(`HTTP ${B.status} ${h} ${v} :: ${(N==null?void 0:N.error)||B.statusText}`);throw H.status=B.status,H.body=N,H}return B.status===204?null:B.json()}async function a(h){try{return await h.json()}catch{return null}}async function l(h){if(t.started)return t.lastBootstrap;if(!(h!=null&&h.origin))throw new Error("[transport] start requires origin");t.started=!0,t.origin=h.origin,t.token=h.token||"";const v=await fetch(`${t.baseUrl}${ms}/session`,{method:"POST",credentials:"include",headers:s(),body:JSON.stringify({origin:t.origin,...t.token?{token:t.token}:{}})});if(!v.ok){const ie=await a(v),te=new Error(`Session bootstrap failed: HTTP ${v.status} :: ${(ie==null?void 0:ie.error)||v.statusText}`);throw te.status=v.status,te.body=ie,te}const C=await v.json();t.userId=C.external_id;const[B,N]=await Promise.all([fetch(`${t.baseUrl}/widgets/${encodeURIComponent(t.widgetId)}/config`,{credentials:"include"}).then(async ie=>{if(!ie.ok){const te=await a(ie);throw new Error(`HTTP ${ie.status} GET /widgets/:id/config :: ${(te==null?void 0:te.error)||ie.statusText}`)}return ie.json()}),o("GET","/customers/me")]),H={config:B,customer:(N==null?void 0:N.customer)??null};return t.lastBootstrap=H,await f(),typeof document<"u"&&(t.visibilityHandler=b,document.addEventListener("visibilitychange",t.visibilityHandler)),le(),H}async function f(){try{const h=await S();t.lastActivityAt=h.reduce((v,C)=>{const B=C==null?void 0:C.last_message_at;return B&&(!v||B>v)?B:v},null)}catch(h){console.error("[transport] initial /conversations failed",h)}}async function c(){const h=await o("GET","/customers/me");return(h==null?void 0:h.customer)??null}async function g(h){const v=await o("PATCH","/customers/me",h);return(v==null?void 0:v.customer)??null}async function S(){const h=await o("GET","/conversations");return(h==null?void 0:h.conversations)??[]}async function A(h={}){return(await o("POST","/conversations",h)).conversation}async function K(h){return(await o("GET",`/conversations/${encodeURIComponent(h)}`)).conversation}async function I(h,v){return(await o("PATCH",`/conversations/${encodeURIComponent(h)}`,v)).conversation}async function Q(h,v){return o("PATCH",`/conversations/${encodeURIComponent(h)}/read`,{message_id:v})}async function z(h,v={}){const C=new URLSearchParams;v.before&&C.set("before",v.before),v.since&&C.set("since",v.since),v.limit&&C.set("limit",String(v.limit));const B=C.toString()?`?${C.toString()}`:"";return o("GET",`/conversations/${encodeURIComponent(h)}/messages${B}`)}async function q(h,v){ee();const C={client_msg_id:v.client_msg_id,type:"content",text_md:v.text_md,author:{id:t.userId,type:"user"},created_at:v.created_at||new Date().toISOString()};return Array.isArray(v.attachments)&&v.attachments.length&&(C.payload={type:"content",attachments:v.attachments}),v.metadata&&typeof v.metadata=="object"&&(C.metadata=v.metadata),o("POST",`/conversations/${encodeURIComponent(h)}/messages`,C)}async function X(h,v,C){return ee(),o("POST",`/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(v)}`,C?{inputs:C}:{})}async function U(h){const v=h.name||"attachment",C=h.type||"application/octet-stream",B=h.size||0,N=await o("POST","/attachments",{mime_type:C,size_bytes:B,name:v}),H=await fetch(N.upload_url,{method:"PUT",headers:{"Content-Type":C},body:h});if(!H.ok)throw new Error(`HTTP ${H.status} PUT signed upload`);return{type:oc(C),path:N.path,mime_type:C,size_bytes:B}}async function ne(h){return o("GET",`/attachments/sign?path=${encodeURIComponent(h)}`)}function ge(){const h=new URLSearchParams({widgetId:t.widgetId}).toString();return`${t.baseUrl}${ms}/stream?${h}`}function he(){if(!t.eventSource&&!(typeof document<"u"&&document.hidden)&&t.started)try{const h=new EventSource(ge(),{withCredentials:!0});for(const v of ec)h.addEventListener(v,C=>ke(v,C.data));h.addEventListener("error",()=>r("error",new Error("SSE error"))),t.eventSource=h,i("open")}catch(h){console.error("[transport] SSE open failed",h),r("error",h)}}function ke(h,v){try{const C=JSON.parse(v),B=C&&typeof C=="object"&&"data"in C?C.data:C;r(h,B)}catch(C){console.error("[transport] bad SSE payload",h,C)}}function G(){t.eventSource&&(t.eventSource.close(),t.eventSource=null),t.connection!=="paused"&&i("idle")}function ee(){clearTimeout(t.burstTimer),he(),t.panelOpen||(t.burstTimer=setTimeout(()=>{t.panelOpen||G()},nc))}function ue(h){t.panelOpen=!!h,t.panelOpen?(clearTimeout(t.burstTimer),he()):ee()}async function j(){try{const h=await S(),v=h.reduce((B,N)=>{const H=N==null?void 0:N.last_message_at;return H&&(!B||H>B)?H:B},null);v&&(!t.lastActivityAt||v>t.lastActivityAt)&&(t.lastActivityAt=v,r("activity",{conversations:h,latestAt:v}),ee())}catch(h){console.error("[transport] poll failed",h)}}function le(){y(),!(typeof document<"u"&&document.hidden)&&(t.pollTimer=setInterval(j,tc))}function y(){t.pollTimer&&(clearInterval(t.pollTimer),t.pollTimer=null)}function b(){if(document.hidden)clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=setTimeout(()=>{t.hiddenGraceTimer=null,document.hidden&&(y(),G(),i("paused"))},sc);else{if(t.hiddenGraceTimer){clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=null;return}i("idle"),le(),t.panelOpen&&he()}}function w(){y(),clearTimeout(t.burstTimer),clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=null,G(),t.visibilityHandler&&(document.removeEventListener("visibilitychange",t.visibilityHandler),t.visibilityHandler=null),t.started=!1}return{on:n,start:l,stop:w,setPanelOpen:ue,getCustomer:c,patchCustomer:g,listConversations:S,createConversation:A,getConversation:K,patchConversation:I,markConversationRead:Q,listMessages:z,postMessage:q,postCallback:X,uploadAttachment:U,signAttachment:ne,get connection(){return t.connection}}}function ic(e){return e.endsWith("/")?e.slice(0,-1):e}function oc(e){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e.startsWith("audio/")?"audio":"file"}function ac(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let n=0;n<16;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=[...e].map(n=>n.toString(16).padStart(2,"0"));return t.slice(0,4).join("")+"-"+t.slice(4,6).join("")+"-"+t.slice(6,8).join("")+"-"+t.slice(8,10).join("")+"-"+t.slice(10,16).join("")}function lc(e){const t=qn({ready:!1,error:null,config:null,customer:null,conversations:[],messagesByConv:{},paginationByConv:{},streamingByMsgId:{},awaitingCallback:{},runningActionsByConv:{},connection:"idle"}),n=[];n.push(e.on("connection",y=>{t.connection=y})),n.push(e.on("message",y=>{const b=y==null?void 0:y.conversation_id,w=y==null?void 0:y.message;!b||!(w!=null&&w.id)||(he(b,w),w.client_msg_id&&delete t.streamingByMsgId[w.client_msg_id],ee(b,w.created_at))})),n.push(e.on("message_stream",y=>{const b=y==null?void 0:y.message_id,w=y==null?void 0:y.token;!b||typeof w!="string"||(t.streamingByMsgId[b]=(t.streamingByMsgId[b]||"")+w)})),n.push(e.on("conversation_updated",y=>{const b=y==null?void 0:y.conversation_id,w=y==null?void 0:y.changes;if(!b||!w)return;const h=t.conversations.findIndex(v=>v.id===b);h!==-1&&(t.conversations[h]={...t.conversations[h],...w})})),n.push(e.on("config_updated",y=>{y!=null&&y.config&&(t.config=y.config)})),n.push(e.on("action_status",y=>{const b=y==null?void 0:y.conversation_id,w=y==null?void 0:y.action_id,h=y==null?void 0:y.action_name;if(!b||!w)return;const v=t.runningActionsByConv[b]||{};y.state==="running"?(v[w]=h||w,t.runningActionsByConv[b]={...v}):y.state==="done"&&(delete v[w],t.runningActionsByConv[b]={...v})})),n.push(e.on("activity",y=>{Array.isArray(y==null?void 0:y.conversations)&&(t.conversations=y.conversations)}));async function r(y){try{const b=new Promise((h,v)=>setTimeout(()=>v(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")),15e3)),w=await Promise.race([e.start(y),b]);t.config=w.config,t.customer=w.customer,t.conversations=await Promise.race([e.listConversations(),b]),t.ready=!0}catch(b){console.error("[store] start failed",b),t.error=(b==null?void 0:b.message)||String(b)}}function i(){for(const y of n)try{y()}catch{}e.stop()}async function s(y){const b=j(y);if(!b)return t.customer;try{const w=await e.patchCustomer(b);w&&(t.customer=w)}catch(w){console.error("[store] applyCustomer failed",w)}return t.customer}async function o(y={}){const b=await e.createConversation(y),w=t.conversations.findIndex(h=>h.id===b.id);return w===-1?t.conversations=[b,...t.conversations]:t.conversations[w]=b,b}const a=50;async function l(y){const b=t.paginationByConv[y];if(!(b!=null&&b.loaded||b!=null&&b.loading)){c(y,{nextCursor:null,loading:!0,loaded:!1});try{const w=await e.listMessages(y,{limit:a}),h=(w==null?void 0:w.messages)??[],v=t.messagesByConv[y]||[],C=new Set;for(const N of h)(N==null?void 0:N.id)!=null&&C.add(`id:${String(N.id)}`),N!=null&&N.client_msg_id&&C.add(`c:${N.client_msg_id}`);const B=v.filter(N=>!((N==null?void 0:N.id)!=null&&C.has(`id:${String(N.id)}`)||N!=null&&N.client_msg_id&&C.has(`c:${N.client_msg_id}`)));t.messagesByConv[y]=[...h,...B].sort(ue),c(y,{nextCursor:(w==null?void 0:w.next_cursor)??null,loading:!1,loaded:!0})}catch(w){console.error("[store] openConversation failed",w),c(y,{nextCursor:null,loading:!1,loaded:!1})}}}async function f(y){var v;const b=t.paginationByConv[y];if(!b||b.loading||!b.nextCursor)return;const h=(v=(t.messagesByConv[y]||[]).find(C=>C==null?void 0:C.created_at))==null?void 0:v.created_at;if(h){c(y,{...b,loading:!0});try{const C=await e.listMessages(y,{before:h,limit:a}),B=(C==null?void 0:C.messages)??[],N=t.messagesByConv[y]||[],H=new Set;for(const te of N)(te==null?void 0:te.id)!=null&&H.add(`id:${String(te.id)}`),te!=null&&te.client_msg_id&&H.add(`c:${te.client_msg_id}`);const ie=B.filter(te=>!((te==null?void 0:te.id)!=null&&H.has(`id:${String(te.id)}`)||te!=null&&te.client_msg_id&&H.has(`c:${te.client_msg_id}`)));t.messagesByConv[y]=[...ie,...N],c(y,{nextCursor:(C==null?void 0:C.next_cursor)??null,loading:!1,loaded:!0})}catch(C){console.error("[store] loadMore failed",C),c(y,{...b,loading:!1})}}}function c(y,b){t.paginationByConv={...t.paginationByConv,[y]:b}}async function g(y,b){const w=await e.patchConversation(y,b),h=t.conversations.findIndex(v=>v.id===y);h!==-1&&(t.conversations[h]=w)}async function S(y){if(!y)return[];const b=t.messagesByConv[y]||[];let w="";for(const h of b)h!=null&&h.created_at&&h.created_at>w&&(w=h.created_at);try{const h=await e.listMessages(y,w?{since:w}:{}),v=(h==null?void 0:h.messages)||[];if(!v.length)return[];const C=new Set,B=new Set;for(const H of b)(H==null?void 0:H.id)!=null&&C.add(String(H.id)),H!=null&&H.client_msg_id&&B.add(H.client_msg_id);const N=[];for(const H of v){const ie=(H==null?void 0:H.id)!=null&&C.has(String(H.id))||(H==null?void 0:H.client_msg_id)&&B.has(H.client_msg_id);he(y,H),ie||N.push(H)}return N}catch(h){return console.error("[store] fetchSinceLast failed",h),[]}}async function A(y,b){if(!(!y||b==null))try{const w=await e.markConversationRead(y,b),h=(w==null?void 0:w.last_read_message_id)??b,v=t.conversations.findIndex(C=>(C==null?void 0:C.id)===y);v!==-1&&(t.conversations[v]={...t.conversations[v],last_read_message_id:h})}catch(w){console.error("[store] markConversationRead failed",w)}}async function K(y,b,{attachments:w,metadata:h}={}){var ie;const v=(b||"").trim(),C=Array.isArray(w)&&w.length>0;if(!y||!v&&!C)return;const B=ac(),N=le(y),H={id:B,client_msg_id:B,conversation_id:y,type:"content",text_md:v,author:{type:"user",id:((ie=t.customer)==null?void 0:ie.external_id)||null},created_at:N,_pending:!0,...C?{payload:{type:"content",attachments:w}}:{},...h&&typeof h=="object"?{metadata:h}:{}};he(y,H);try{await e.postMessage(y,{client_msg_id:B,text_md:v,created_at:N,...C?{attachments:w}:{},...h&&typeof h=="object"?{metadata:h}:{}})}catch(te){console.error("[store] send failed",te),G(y,B,{_failed:!0,_pending:!1})}}async function I(y,b,w){y!=null&&(t.awaitingCallback[y]=!0);try{await e.postCallback(y,b,w)}catch(h){console.error("[store] callback failed",h),y!=null&&delete t.awaitingCallback[y]}}const Q=new Map;async function z(y){if(!y)return null;const b=Q.get(y);if(b!=null&&b.url){const w=b.expires_at?Date.parse(b.expires_at):0;if(!w||w-Date.now()>6e4)return b.url}try{const w=await e.signAttachment(y);if(w!=null&&w.signed_url)return Q.set(y,{url:w.signed_url,expires_at:w.expires_at}),w.signed_url}catch(w){console.error("[store] sign attachment failed",w)}return null}async function q(y,{rating:b,comment:w}={}){const h=t.conversations.find(B=>B.id===y),C={...(h==null?void 0:h.metadata)||{},feedback:{rating:b,comment:w||null,submitted_at:new Date().toISOString()}};await g(y,{metadata:C})}function X(y){var w,h;const b=t.messagesByConv[y]||[];for(let v=b.length-1;v>=0;v--){const C=b[v];if((C==null?void 0:C.type)==="action"&&((w=C==null?void 0:C.payload)==null?void 0:w.type)==="action"&&((h=C==null?void 0:C.payload)==null?void 0:h.state)==="pending"&&Array.isArray(C==null?void 0:C.callbacks)&&C.callbacks.length>0&&!t.awaitingCallback[C.id])return C}return null}function U(y){var w,h,v;const b=t.messagesByConv[y]||[];for(let C=b.length-1;C>=0;C--){const B=b[C];if(((w=B==null?void 0:B.author)==null?void 0:w.type)==="user"||(B==null?void 0:B.type)==="action"&&((h=B==null?void 0:B.payload)==null?void 0:h.state)==="pending")return null;const N=(v=B==null?void 0:B.metadata)==null?void 0:v.form;if(N&&Array.isArray(N.fields)&&N.fields.length>0)return{message:B,form:N}}return null}function ne(y){const b=t.runningActionsByConv[y];if(!b)return null;const w=Object.keys(b);if(w.length===0)return null;const h=w[0];return{id:h,payload:{name:b[h]}}}function ge(y){var w,h,v,C;const b=t.messagesByConv[y]||[];for(let B=b.length-1;B>=0;B--){const N=b[B];if(((w=N==null?void 0:N.author)==null?void 0:w.type)==="user")return[];if((N==null?void 0:N.type)==="action"&&((h=N==null?void 0:N.payload)==null?void 0:h.state)==="pending")return[];if(((v=N==null?void 0:N.author)==null?void 0:v.type)!=="agent_ia")continue;const H=(C=N==null?void 0:N.metadata)==null?void 0:C.suggested_replies;return Array.isArray(H)&&H.length?H.map(ie=>{if(typeof ie=="string"){const te=ie.trim();return te?{label:te,kind:null}:null}if(ie&&typeof ie=="object"&&typeof ie.label=="string"){const te=ie.label.trim();if(!te)return null;const Zn=ie.kind==="cta"||ie.kind==="choice"||ie.kind==="followup"?ie.kind:null;return{label:te,kind:Zn}}return null}).filter(Boolean).slice(0,4):[]}return[]}function he(y,b){var C;const w=t.messagesByConv[y]||[];let h=-1;b!=null&&b.client_msg_id&&(h=w.findIndex(B=>(B==null?void 0:B.client_msg_id)&&B.client_msg_id===b.client_msg_id)),h===-1&&(b==null?void 0:b.id)!==void 0&&(b==null?void 0:b.id)!==null&&(h=w.findIndex(B=>ke(B==null?void 0:B.id,b.id)));let v;h===-1?v=[...w,b].sort(ue):(v=w.slice(),v[h]={...w[h],...b,_pending:!1,_failed:!1}),t.messagesByConv[y]=v,(b==null?void 0:b.type)==="action"&&((C=b==null?void 0:b.payload)!=null&&C.state)&&b.payload.state!=="pending"&&(b==null?void 0:b.id)!=null&&t.awaitingCallback[b.id]&&delete t.awaitingCallback[b.id]}function ke(y,b){return y===b?!0:y==null||b==null?!1:String(y)===String(b)}function G(y,b,w){const h=t.messagesByConv[y];if(!h)return;const v=h.findIndex(B=>B.id===b);if(v===-1)return;const C=h.slice();C[v]={...h[v],...w},t.messagesByConv[y]=C}function ee(y,b){const w=t.conversations.findIndex(v=>v.id===y);if(w===-1)return;const h=t.conversations[w];if(b&&(!h.last_message_at||b>h.last_message_at)){const v=t.conversations.slice();v[w]={...h,last_message_at:b},v.sort((C,B)=>(B.last_message_at||"").localeCompare(C.last_message_at||"")),t.conversations=v}}function ue(y,b){return(y.created_at||"").localeCompare(b.created_at||"")}function j(y){if(!y||typeof y!="object")return null;const b={},w={};for(const[h,v]of Object.entries(y))v!==void 0&&(h==="name"||h==="email"?v!=null&&String(v).trim()!==""&&(b[h]=v):(h==="values"||h==="metadata")&&v&&typeof v=="object"?Object.assign(w,v):w[h]=v);return Object.keys(w).length&&(b.values=w),Object.keys(b).length?b:null}function le(y){const b=t.messagesByConv[y]||[];let w="";for(const C of b)C!=null&&C.created_at&&C.created_at>w&&(w=C.created_at);const h=new Date().toISOString();return!w||h>w?h:new Date(Date.parse(w)+1).toISOString()}return{state:t,start:r,destroy:i,applyCustomer:s,createConversation:o,openConversation:l,loadMore:f,fetchSinceLast:S,patchConversation:g,markConversationRead:A,send:K,clickCallback:I,signAttachment:z,submitFeedback:q,getPendingApproval:X,getActionInFlight:ne,getLatestSuggestions:ge,getLatestForm:U,setPanelOpen:e.setPanelOpen}}const Re={w:"#ffffff",g50:"#F9F9F7",g100:"#F2F1EE",g150:"#E8E6E2",g200:"#D9D6CF",g300:"#B4B0A8",g400:"#888480",g500:"#5A5753",g700:"#2B2926",g900:"#17161A",accent:"#5B5FEF",accentLight:"#EEEFFE",green:"#22C55E",red:"#B91C1C",redBg:"#FDECEC"},ps=["#5B5FEF","#7C3AED","#DB2777","#0891B2","#D97706","#059669"];function Ks(e=""){return e?ps[e.charCodeAt(0)%ps.length]:ps[0]}function qs(e=""){return e.split(" ").map(t=>t[0]||"").join("").toUpperCase().slice(0,2)}function po(e=new Date,t="fr-FR"){return e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"})}const go=`
17
+ **/let Es;const _r=typeof window<"u"&&window.trustedTypes;if(_r)try{Es=_r.createPolicy("vue",{createHTML:e=>e})}catch{}const ho=Es?e=>Es.createHTML(e):e=>e,_l="http://www.w3.org/2000/svg",yl="http://www.w3.org/1998/Math/MathML",rt=typeof document<"u"?document:null,yr=rt&&rt.createElement("template"),vl={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const i=t==="svg"?rt.createElementNS(_l,e):t==="mathml"?rt.createElementNS(yl,e):n?rt.createElement(e,{is:n}):rt.createElement(e);return e==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:e=>rt.createTextNode(e),createComment:e=>rt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>rt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,s){const o=n?n.previousSibling:t.lastChild;if(i&&(i===s||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===s||!(i=i.nextSibling)););else{yr.innerHTML=ho(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=yr.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},pt="transition",Yt="animation",hn=Symbol("_vtc"),mo={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},bl=Ae({},Ei,mo),wl=e=>(e.displayName="Transition",e.props=bl,e),kl=wl((e,{slots:t})=>fo(_a,Cl(e),t)),St=(e,t=[])=>{V(e)?e.forEach(n=>n(...t)):e&&e(...t)},vr=e=>e?V(e)?e.some(t=>t.length>1):e.length>1:!1;function Cl(e){const t={};for(const j in e)j in mo||(t[j]=e[j]);if(e.css===!1)return t;const{name:n="v",type:r,duration:i,enterFromClass:s=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:f=o,appearToClass:c=a,leaveFromClass:g=`${n}-leave-from`,leaveActiveClass:S=`${n}-leave-active`,leaveToClass:A=`${n}-leave-to`}=e,K=Al(i),I=K&&K[0],Q=K&&K[1],{onBeforeEnter:z,onEnter:q,onEnterCancelled:X,onLeave:U,onLeaveCancelled:ne,onBeforeAppear:ge=z,onAppear:he=q,onAppearCancelled:ke=X}=t,G=(j,le,y,b)=>{j._enterCancelled=b,xt(j,le?c:a),xt(j,le?f:o),y&&y()},ee=(j,le)=>{j._isLeaving=!1,xt(j,g),xt(j,A),xt(j,S),le&&le()},ue=j=>(le,y)=>{const b=j?he:q,w=()=>G(le,j,y);St(b,[le,w]),br(()=>{xt(le,j?l:s),st(le,j?c:a),vr(b)||wr(le,r,I,w)})};return Ae(t,{onBeforeEnter(j){St(z,[j]),st(j,s),st(j,o)},onBeforeAppear(j){St(ge,[j]),st(j,l),st(j,f)},onEnter:ue(!1),onAppear:ue(!0),onLeave(j,le){j._isLeaving=!0;const y=()=>ee(j,le);st(j,g),j._enterCancelled?(st(j,S),Ar(j)):(Ar(j),st(j,S)),br(()=>{j._isLeaving&&(xt(j,g),st(j,A),vr(U)||wr(j,r,Q,y))}),St(U,[j,y])},onEnterCancelled(j){G(j,!1,void 0,!0),St(X,[j])},onAppearCancelled(j){G(j,!0,void 0,!0),St(ke,[j])},onLeaveCancelled(j){ee(j),St(ne,[j])}})}function Al(e){if(e==null)return null;if(ae(e))return[ds(e.enter),ds(e.leave)];{const t=ds(e);return[t,t]}}function ds(e){return xo(e)}function st(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[hn]||(e[hn]=new Set)).add(t)}function xt(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[hn];n&&(n.delete(t),n.size||(e[hn]=void 0))}function br(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Sl=0;function wr(e,t,n,r){const i=e._endId=++Sl,s=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:o,timeout:a,propCount:l}=xl(e,t);if(!o)return r();const f=o+"end";let c=0;const g=()=>{e.removeEventListener(f,S),s()},S=A=>{A.target===e&&++c>=l&&g()};setTimeout(()=>{c<l&&g()},a+1),e.addEventListener(f,S)}function xl(e,t){const n=window.getComputedStyle(e),r=K=>(n[K]||"").split(", "),i=r(`${pt}Delay`),s=r(`${pt}Duration`),o=kr(i,s),a=r(`${Yt}Delay`),l=r(`${Yt}Duration`),f=kr(a,l);let c=null,g=0,S=0;t===pt?o>0&&(c=pt,g=o,S=s.length):t===Yt?f>0&&(c=Yt,g=f,S=l.length):(g=Math.max(o,f),c=g>0?o>f?pt:Yt:null,S=c?c===pt?s.length:l.length:0);const A=c===pt&&/\b(?:transform|all)(?:,|$)/.test(r(`${pt}Property`).toString());return{type:c,timeout:g,propCount:S,hasTransform:A}}function kr(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Cr(n)+Cr(e[r])))}function Cr(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Ar(e){return(e?e.ownerDocument:document).body.offsetHeight}function Tl(e,t,n){const r=e[hn];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Sr=Symbol("_vod"),Ml=Symbol("_vsh"),El=Symbol(""),Ol=/(?:^|;)\s*display\s*:/;function Il(e,t,n){const r=e.style,i=ve(n);let s=!1;if(n&&!i){if(t)if(ve(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&Qt(r,a,"")}else for(const o in t)n[o]==null&&Qt(r,o,"");for(const o in n){o==="display"&&(s=!0);const a=n[o];a!=null?Rl(e,o,!ve(t)&&t?t[o]:void 0,a)||Qt(r,o,a):Qt(r,o,"")}}else if(i){if(t!==n){const o=r[El];o&&(n+=";"+o),r.cssText=n,s=Ol.test(n)}}else t&&e.removeAttribute("style");Sr in e&&(e[Sr]=s?r.display:"",e[Ml]&&(r.display="none"))}const xr=/\s*!important$/;function Qt(e,t,n){if(V(n))n.forEach(r=>Qt(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Ll(e,t);xr.test(n)?e.setProperty(kt(r),n.replace(xr,""),"important"):e[r]=n}}const Tr=["Webkit","Moz","ms"],fs={};function Ll(e,t){const n=fs[t];if(n)return n;let r=Pe(t);if(r!=="filter"&&r in e)return fs[t]=r;r=Hn(r);for(let i=0;i<Tr.length;i++){const s=Tr[i]+r;if(s in e)return fs[t]=s}return t}function Rl(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&ve(r)&&n===r}const Mr="http://www.w3.org/1999/xlink";function Er(e,t,n,r,i,s=Lo(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Mr,t.slice(6,t.length)):e.setAttributeNS(Mr,t,n):n==null||s&&!ei(n)?e.removeAttribute(t):e.setAttribute(t,s?"":qe(n)?String(n):n)}function Or(e,t,n,r,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?ho(n):n);return}const s=e.tagName;if(t==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let o=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=ei(n):n==null&&a==="string"?(n="",o=!0):a==="number"&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function _t(e,t,n,r){e.addEventListener(t,n,r)}function Nl(e,t,n,r){e.removeEventListener(t,n,r)}const Ir=Symbol("_vei");function Bl(e,t,n,r,i=null){const s=e[Ir]||(e[Ir]={}),o=s[t];if(r&&o)o.value=r;else{const[a,l]=Pl(t);if(r){const f=s[t]=jl(r,i);_t(e,a,f,l)}else o&&(Nl(e,a,o,l),s[t]=void 0)}}const Lr=/(?:Once|Passive|Capture)$/;function Pl(e){let t;if(Lr.test(e)){t={};let r;for(;r=e.match(Lr);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):kt(e.slice(2)),t]}let hs=0;const Fl=Promise.resolve(),Dl=()=>hs||(Fl.then(()=>hs=0),hs=Date.now());function jl(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;We(Ul(r,n.value),t,5,[r])};return n.value=e,n.attached=Dl(),n}function Ul(e,t){if(V(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>i=>!i._stopped&&r&&r(i))}else return t}const Rr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Hl=(e,t,n,r,i,s)=>{const o=i==="svg";t==="class"?Tl(e,r,o):t==="style"?Il(e,n,r):Dn(t)?jn(t)||Bl(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):$l(e,t,r,o))?(Or(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Er(e,t,r,o,s,t!=="value")):e._isVueCE&&(Vl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!ve(r)))?Or(e,Pe(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Er(e,t,r,o))};function $l(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Rr(t)&&J(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Rr(t)&&ve(n)?!1:t in e}function Vl(e,t){const n=e._def.props;if(!n)return!1;const r=Pe(t);return Array.isArray(n)?n.some(i=>Pe(i)===r):Object.keys(n).some(i=>Pe(i)===r)}const Ht=e=>{const t=e.props["onUpdate:modelValue"]||!1;return V(t)?n=>xn(t,n):t};function Kl(e){e.target.composing=!0}function Nr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ut=Symbol("_assign");function Br(e,t,n){return t&&(e=e.trim()),n&&(e=$n(e)),e}const Ot={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[ut]=Ht(i);const s=r||i.props&&i.props.type==="number";_t(e,t?"change":"input",o=>{o.target.composing||e[ut](Br(e.value,n,s))}),(n||s)&&_t(e,"change",()=>{e.value=Br(e.value,n,s)}),t||(_t(e,"compositionstart",Kl),_t(e,"compositionend",Nr),_t(e,"change",Nr))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:s}},o){if(e[ut]=Ht(o),e.composing)return;const a=(s||e.type==="number")&&!/^0\d/.test(e.value)?$n(e.value):e.value,l=t??"";if(a===l)return;const f=e.getRootNode();(f instanceof Document||f instanceof ShadowRoot)&&f.activeElement===e&&e.type!=="range"&&(r&&t===n||i&&e.value.trim()===l)||(e.value=l)}},ql={deep:!0,created(e,t,n){e[ut]=Ht(n),_t(e,"change",()=>{const r=e._modelValue,i=mn(e),s=e.checked,o=e[ut];if(V(r)){const a=Rs(r,i),l=a!==-1;if(s&&!l)o(r.concat(i));else if(!s&&l){const f=[...r];f.splice(a,1),o(f)}}else if($t(r)){const a=new Set(r);s?a.add(i):a.delete(i),o(a)}else o(po(e,s))})},mounted:Pr,beforeUpdate(e,t,n){e[ut]=Ht(n),Pr(e,t,n)}};function Pr(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(V(t))i=Rs(t,r.props.value)>-1;else if($t(t))i=t.has(r.props.value);else{if(t===n)return;i=Vt(t,po(e,!0))}e.checked!==i&&(e.checked=i)}const Wl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const i=$t(t);_t(e,"change",()=>{const s=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?$n(mn(o)):mn(o));e[ut](e.multiple?i?new Set(s):s:s[0]),e._assigning=!0,bi(()=>{e._assigning=!1})}),e[ut]=Ht(r)},mounted(e,{value:t}){Fr(e,t)},beforeUpdate(e,t,n){e[ut]=Ht(n)},updated(e,{value:t}){e._assigning||Fr(e,t)}};function Fr(e,t){const n=e.multiple,r=V(t);if(!(n&&!r&&!$t(t))){for(let i=0,s=e.options.length;i<s;i++){const o=e.options[i],a=mn(o);if(n)if(r){const l=typeof a;l==="string"||l==="number"?o.selected=t.some(f=>String(f)===String(a)):o.selected=Rs(t,a)>-1}else o.selected=t.has(a);else if(Vt(mn(o),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function mn(e){return"_value"in e?e._value:e.value}function po(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const zl=["ctrl","shift","alt","meta"],Gl={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>zl.some(n=>e[`${n}Key`]&&!t.includes(n))},yt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(i,...s)=>{for(let o=0;o<t.length;o++){const a=Gl[t[o]];if(a&&a(i,t))return}return e(i,...s)})},Yl={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Pn=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=i=>{if(!("key"in i))return;const s=kt(i.key);if(t.some(o=>o===s||Yl[o]===s))return e(i)})},Jl=Ae({patchProp:Hl},vl);let Dr;function Ql(){return Dr||(Dr=Qa(Jl))}const Xl=(...e)=>{const t=Ql().createApp(...e),{mount:n}=t;return t.mount=r=>{const i=ec(r);if(!i)return;const s=t._component;!J(s)&&!s.render&&!s.template&&(s.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=n(i,!1,Zl(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},t};function Zl(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ec(e){return ve(e)?document.querySelector(e):e}const tc=["connected","message","message_stream","conversation_updated","config_updated","action_status"],ms="/client",nc=5*60*1e3,sc=10*60*1e3,rc=5*60*1e3;function ic(e){const t={baseUrl:oc(e.baseUrl||""),widgetId:e.widgetId||"",userId:"",origin:"",token:"",listeners:new Map,eventSource:null,connection:"idle",visibilityHandler:null,started:!1,panelOpen:!1,pollTimer:null,burstTimer:null,hiddenGraceTimer:null,lastActivityAt:null};if(!t.baseUrl||!t.widgetId)throw new Error("[transport] baseUrl and widgetId are required");function n(h,v){return t.listeners.has(h)||t.listeners.set(h,new Set),t.listeners.get(h).add(v),()=>t.listeners.get(h).delete(v)}function r(h,v){const C=t.listeners.get(h);C&&C.forEach(N=>{try{N(v)}catch(B){console.error("[transport] listener",h,B)}})}function i(h){t.connection!==h&&(t.connection=h,r("connection",h))}function s(){return{"Content-Type":"application/json","X-Widget-Id":t.widgetId}}async function o(h,v,C){const N=await fetch(`${t.baseUrl}${ms}${v}`,{method:h,credentials:"include",headers:s(),body:C!==void 0?JSON.stringify(C):void 0});if(!N.ok){const B=await a(N),H=new Error(`HTTP ${N.status} ${h} ${v} :: ${(B==null?void 0:B.error)||N.statusText}`);throw H.status=N.status,H.body=B,H}return N.status===204?null:N.json()}async function a(h){try{return await h.json()}catch{return null}}async function l(h){if(t.started)return t.lastBootstrap;if(!(h!=null&&h.origin))throw new Error("[transport] start requires origin");t.started=!0,t.origin=h.origin,t.token=h.token||"";const v=await fetch(`${t.baseUrl}${ms}/session`,{method:"POST",credentials:"include",headers:s(),body:JSON.stringify({origin:t.origin,...t.token?{token:t.token}:{}})});if(!v.ok){const ie=await a(v),te=new Error(`Session bootstrap failed: HTTP ${v.status} :: ${(ie==null?void 0:ie.error)||v.statusText}`);throw te.status=v.status,te.body=ie,te}const C=await v.json();t.userId=C.external_id;const[N,B]=await Promise.all([fetch(`${t.baseUrl}/widgets/${encodeURIComponent(t.widgetId)}/config`,{credentials:"include"}).then(async ie=>{if(!ie.ok){const te=await a(ie);throw new Error(`HTTP ${ie.status} GET /widgets/:id/config :: ${(te==null?void 0:te.error)||ie.statusText}`)}return ie.json()}),o("GET","/customers/me")]),H={config:N,customer:(B==null?void 0:B.customer)??null};return t.lastBootstrap=H,await f(),typeof document<"u"&&(t.visibilityHandler=b,document.addEventListener("visibilitychange",t.visibilityHandler)),le(),H}async function f(){try{const h=await S();t.lastActivityAt=h.reduce((v,C)=>{const N=C==null?void 0:C.last_message_at;return N&&(!v||N>v)?N:v},null)}catch(h){console.error("[transport] initial /conversations failed",h)}}async function c(){const h=await o("GET","/customers/me");return(h==null?void 0:h.customer)??null}async function g(h){const v=await o("PATCH","/customers/me",h);return(v==null?void 0:v.customer)??null}async function S(){const h=await o("GET","/conversations");return(h==null?void 0:h.conversations)??[]}async function A(h={}){return(await o("POST","/conversations",h)).conversation}async function K(h){return(await o("GET",`/conversations/${encodeURIComponent(h)}`)).conversation}async function I(h,v){return(await o("PATCH",`/conversations/${encodeURIComponent(h)}`,v)).conversation}async function Q(h,v){return o("PATCH",`/conversations/${encodeURIComponent(h)}/read`,{message_id:v})}async function z(h,v={}){const C=new URLSearchParams;v.before&&C.set("before",v.before),v.since&&C.set("since",v.since),v.limit&&C.set("limit",String(v.limit));const N=C.toString()?`?${C.toString()}`:"";return o("GET",`/conversations/${encodeURIComponent(h)}/messages${N}`)}async function q(h,v){ee();const C={client_msg_id:v.client_msg_id,type:"content",text_md:v.text_md,author:{id:t.userId,type:"user"},created_at:v.created_at||new Date().toISOString()};return Array.isArray(v.attachments)&&v.attachments.length&&(C.payload={type:"content",attachments:v.attachments}),v.metadata&&typeof v.metadata=="object"&&(C.metadata=v.metadata),o("POST",`/conversations/${encodeURIComponent(h)}/messages`,C)}async function X(h,v,C){return ee(),o("POST",`/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(v)}`,C?{inputs:C}:{})}async function U(h){const v=h.name||"attachment",C=h.type||"application/octet-stream",N=h.size||0,B=await o("POST","/attachments",{mime_type:C,size_bytes:N,name:v}),H=await fetch(B.upload_url,{method:"PUT",headers:{"Content-Type":C},body:h});if(!H.ok)throw new Error(`HTTP ${H.status} PUT signed upload`);return{type:ac(C),path:B.path,mime_type:C,size_bytes:N}}async function ne(h){return o("GET",`/attachments/sign?path=${encodeURIComponent(h)}`)}function ge(){const h=new URLSearchParams({widgetId:t.widgetId}).toString();return`${t.baseUrl}${ms}/stream?${h}`}function he(){if(!t.eventSource&&!(typeof document<"u"&&document.hidden)&&t.started)try{const h=new EventSource(ge(),{withCredentials:!0});for(const v of tc)h.addEventListener(v,C=>ke(v,C.data));h.addEventListener("error",()=>r("error",new Error("SSE error"))),t.eventSource=h,i("open")}catch(h){console.error("[transport] SSE open failed",h),r("error",h)}}function ke(h,v){try{const C=JSON.parse(v),N=C&&typeof C=="object"&&"data"in C?C.data:C;r(h,N)}catch(C){console.error("[transport] bad SSE payload",h,C)}}function G(){t.eventSource&&(t.eventSource.close(),t.eventSource=null),t.connection!=="paused"&&i("idle")}function ee(){clearTimeout(t.burstTimer),he(),t.panelOpen||(t.burstTimer=setTimeout(()=>{t.panelOpen||G()},sc))}function ue(h){t.panelOpen=!!h,t.panelOpen?(clearTimeout(t.burstTimer),he()):ee()}async function j(){try{const h=await S(),v=h.reduce((N,B)=>{const H=B==null?void 0:B.last_message_at;return H&&(!N||H>N)?H:N},null);v&&(!t.lastActivityAt||v>t.lastActivityAt)&&(t.lastActivityAt=v,r("activity",{conversations:h,latestAt:v}),ee())}catch(h){console.error("[transport] poll failed",h)}}function le(){y(),!(typeof document<"u"&&document.hidden)&&(t.pollTimer=setInterval(j,nc))}function y(){t.pollTimer&&(clearInterval(t.pollTimer),t.pollTimer=null)}function b(){if(document.hidden)clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=setTimeout(()=>{t.hiddenGraceTimer=null,document.hidden&&(y(),G(),i("paused"))},rc);else{if(t.hiddenGraceTimer){clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=null;return}i("idle"),le(),t.panelOpen&&he()}}function w(){y(),clearTimeout(t.burstTimer),clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=null,G(),t.visibilityHandler&&(document.removeEventListener("visibilitychange",t.visibilityHandler),t.visibilityHandler=null),t.started=!1}return{on:n,start:l,stop:w,setPanelOpen:ue,getCustomer:c,patchCustomer:g,listConversations:S,createConversation:A,getConversation:K,patchConversation:I,markConversationRead:Q,listMessages:z,postMessage:q,postCallback:X,uploadAttachment:U,signAttachment:ne,get connection(){return t.connection}}}function oc(e){return e.endsWith("/")?e.slice(0,-1):e}function ac(e){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e.startsWith("audio/")?"audio":"file"}function lc(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let n=0;n<16;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=[...e].map(n=>n.toString(16).padStart(2,"0"));return t.slice(0,4).join("")+"-"+t.slice(4,6).join("")+"-"+t.slice(6,8).join("")+"-"+t.slice(8,10).join("")+"-"+t.slice(10,16).join("")}function cc(e){const t=qn({ready:!1,error:null,config:null,customer:null,conversations:[],messagesByConv:{},paginationByConv:{},streamingByMsgId:{},awaitingCallback:{},runningActionsByConv:{},connection:"idle"}),n=[];n.push(e.on("connection",y=>{t.connection=y})),n.push(e.on("message",y=>{const b=y==null?void 0:y.conversation_id,w=y==null?void 0:y.message;!b||!(w!=null&&w.id)||(he(b,w),w.client_msg_id&&delete t.streamingByMsgId[w.client_msg_id],ee(b,w.created_at))})),n.push(e.on("message_stream",y=>{const b=y==null?void 0:y.message_id,w=y==null?void 0:y.token;!b||typeof w!="string"||(t.streamingByMsgId[b]=(t.streamingByMsgId[b]||"")+w)})),n.push(e.on("conversation_updated",y=>{const b=y==null?void 0:y.conversation_id,w=y==null?void 0:y.changes;if(!b||!w)return;const h=t.conversations.findIndex(v=>v.id===b);h!==-1&&(t.conversations[h]={...t.conversations[h],...w})})),n.push(e.on("config_updated",y=>{y!=null&&y.config&&(t.config=y.config)})),n.push(e.on("action_status",y=>{const b=y==null?void 0:y.conversation_id,w=y==null?void 0:y.action_id,h=y==null?void 0:y.action_name;if(!b||!w)return;const v=t.runningActionsByConv[b]||{};y.state==="running"?(v[w]=h||w,t.runningActionsByConv[b]={...v}):y.state==="done"&&(delete v[w],t.runningActionsByConv[b]={...v})})),n.push(e.on("activity",y=>{Array.isArray(y==null?void 0:y.conversations)&&(t.conversations=y.conversations)}));async function r(y){try{const b=new Promise((h,v)=>setTimeout(()=>v(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")),15e3)),w=await Promise.race([e.start(y),b]);t.config=w.config,t.customer=w.customer,t.conversations=await Promise.race([e.listConversations(),b]),t.ready=!0}catch(b){console.error("[store] start failed",b),t.error=(b==null?void 0:b.message)||String(b)}}function i(){for(const y of n)try{y()}catch{}e.stop()}async function s(y){const b=j(y);if(!b)return t.customer;try{const w=await e.patchCustomer(b);w&&(t.customer=w)}catch(w){console.error("[store] applyCustomer failed",w)}return t.customer}async function o(y={}){const b=await e.createConversation(y),w=t.conversations.findIndex(h=>h.id===b.id);return w===-1?t.conversations=[b,...t.conversations]:t.conversations[w]=b,b}const a=50;async function l(y){const b=t.paginationByConv[y];if(!(b!=null&&b.loaded||b!=null&&b.loading)){c(y,{nextCursor:null,loading:!0,loaded:!1});try{const w=await e.listMessages(y,{limit:a}),h=(w==null?void 0:w.messages)??[],v=t.messagesByConv[y]||[],C=new Set;for(const B of h)(B==null?void 0:B.id)!=null&&C.add(`id:${String(B.id)}`),B!=null&&B.client_msg_id&&C.add(`c:${B.client_msg_id}`);const N=v.filter(B=>!((B==null?void 0:B.id)!=null&&C.has(`id:${String(B.id)}`)||B!=null&&B.client_msg_id&&C.has(`c:${B.client_msg_id}`)));t.messagesByConv[y]=[...h,...N].sort(ue),c(y,{nextCursor:(w==null?void 0:w.next_cursor)??null,loading:!1,loaded:!0})}catch(w){console.error("[store] openConversation failed",w),c(y,{nextCursor:null,loading:!1,loaded:!1})}}}async function f(y){var v;const b=t.paginationByConv[y];if(!b||b.loading||!b.nextCursor)return;const h=(v=(t.messagesByConv[y]||[]).find(C=>C==null?void 0:C.created_at))==null?void 0:v.created_at;if(h){c(y,{...b,loading:!0});try{const C=await e.listMessages(y,{before:h,limit:a}),N=(C==null?void 0:C.messages)??[],B=t.messagesByConv[y]||[],H=new Set;for(const te of B)(te==null?void 0:te.id)!=null&&H.add(`id:${String(te.id)}`),te!=null&&te.client_msg_id&&H.add(`c:${te.client_msg_id}`);const ie=N.filter(te=>!((te==null?void 0:te.id)!=null&&H.has(`id:${String(te.id)}`)||te!=null&&te.client_msg_id&&H.has(`c:${te.client_msg_id}`)));t.messagesByConv[y]=[...ie,...B],c(y,{nextCursor:(C==null?void 0:C.next_cursor)??null,loading:!1,loaded:!0})}catch(C){console.error("[store] loadMore failed",C),c(y,{...b,loading:!1})}}}function c(y,b){t.paginationByConv={...t.paginationByConv,[y]:b}}async function g(y,b){const w=await e.patchConversation(y,b),h=t.conversations.findIndex(v=>v.id===y);h!==-1&&(t.conversations[h]=w)}async function S(y){if(!y)return[];const b=t.messagesByConv[y]||[];let w="";for(const h of b)h!=null&&h.created_at&&h.created_at>w&&(w=h.created_at);try{const h=await e.listMessages(y,w?{since:w}:{}),v=(h==null?void 0:h.messages)||[];if(!v.length)return[];const C=new Set,N=new Set;for(const H of b)(H==null?void 0:H.id)!=null&&C.add(String(H.id)),H!=null&&H.client_msg_id&&N.add(H.client_msg_id);const B=[];for(const H of v){const ie=(H==null?void 0:H.id)!=null&&C.has(String(H.id))||(H==null?void 0:H.client_msg_id)&&N.has(H.client_msg_id);he(y,H),ie||B.push(H)}return B}catch(h){return console.error("[store] fetchSinceLast failed",h),[]}}async function A(y,b){if(!(!y||b==null))try{const w=await e.markConversationRead(y,b),h=(w==null?void 0:w.last_read_message_id)??b,v=t.conversations.findIndex(C=>(C==null?void 0:C.id)===y);v!==-1&&(t.conversations[v]={...t.conversations[v],last_read_message_id:h})}catch(w){console.error("[store] markConversationRead failed",w)}}async function K(y,b,{attachments:w,metadata:h}={}){var ie;const v=(b||"").trim(),C=Array.isArray(w)&&w.length>0;if(!y||!v&&!C)return;const N=lc(),B=le(y),H={id:N,client_msg_id:N,conversation_id:y,type:"content",text_md:v,author:{type:"user",id:((ie=t.customer)==null?void 0:ie.external_id)||null},created_at:B,_pending:!0,...C?{payload:{type:"content",attachments:w}}:{},...h&&typeof h=="object"?{metadata:h}:{}};he(y,H);try{await e.postMessage(y,{client_msg_id:N,text_md:v,created_at:B,...C?{attachments:w}:{},...h&&typeof h=="object"?{metadata:h}:{}})}catch(te){console.error("[store] send failed",te),G(y,N,{_failed:!0,_pending:!1})}}async function I(y,b,w){y!=null&&(t.awaitingCallback[y]=!0);try{await e.postCallback(y,b,w)}catch(h){console.error("[store] callback failed",h),y!=null&&delete t.awaitingCallback[y]}}const Q=new Map;async function z(y){if(!y)return null;const b=Q.get(y);if(b!=null&&b.url){const w=b.expires_at?Date.parse(b.expires_at):0;if(!w||w-Date.now()>6e4)return b.url}try{const w=await e.signAttachment(y);if(w!=null&&w.signed_url)return Q.set(y,{url:w.signed_url,expires_at:w.expires_at}),w.signed_url}catch(w){console.error("[store] sign attachment failed",w)}return null}async function q(y,{rating:b,comment:w}={}){const h=t.conversations.find(N=>N.id===y),C={...(h==null?void 0:h.metadata)||{},feedback:{rating:b,comment:w||null,submitted_at:new Date().toISOString()}};await g(y,{metadata:C})}function X(y){var w,h;const b=t.messagesByConv[y]||[];for(let v=b.length-1;v>=0;v--){const C=b[v];if((C==null?void 0:C.type)==="action"&&((w=C==null?void 0:C.payload)==null?void 0:w.type)==="action"&&((h=C==null?void 0:C.payload)==null?void 0:h.state)==="pending"&&Array.isArray(C==null?void 0:C.callbacks)&&C.callbacks.length>0&&!t.awaitingCallback[C.id])return C}return null}function U(y){var w,h,v;const b=t.messagesByConv[y]||[];for(let C=b.length-1;C>=0;C--){const N=b[C];if(((w=N==null?void 0:N.author)==null?void 0:w.type)==="user"||(N==null?void 0:N.type)==="action"&&((h=N==null?void 0:N.payload)==null?void 0:h.state)==="pending")return null;const B=(v=N==null?void 0:N.metadata)==null?void 0:v.form;if(B&&Array.isArray(B.fields)&&B.fields.length>0)return{message:N,form:B}}return null}function ne(y){const b=t.runningActionsByConv[y];if(!b)return null;const w=Object.keys(b);if(w.length===0)return null;const h=w[0];return{id:h,payload:{name:b[h]}}}function ge(y){var w,h,v,C;const b=t.messagesByConv[y]||[];for(let N=b.length-1;N>=0;N--){const B=b[N];if(((w=B==null?void 0:B.author)==null?void 0:w.type)==="user")return[];if((B==null?void 0:B.type)==="action"&&((h=B==null?void 0:B.payload)==null?void 0:h.state)==="pending")return[];if(((v=B==null?void 0:B.author)==null?void 0:v.type)!=="agent_ia")continue;const H=(C=B==null?void 0:B.metadata)==null?void 0:C.suggested_replies;return Array.isArray(H)&&H.length?H.map(ie=>{if(typeof ie=="string"){const te=ie.trim();return te?{label:te,kind:null}:null}if(ie&&typeof ie=="object"&&typeof ie.label=="string"){const te=ie.label.trim();if(!te)return null;const Zn=ie.kind==="cta"||ie.kind==="choice"||ie.kind==="followup"?ie.kind:null;return{label:te,kind:Zn}}return null}).filter(Boolean).slice(0,4):[]}return[]}function he(y,b){var C;const w=t.messagesByConv[y]||[];let h=-1;b!=null&&b.client_msg_id&&(h=w.findIndex(N=>(N==null?void 0:N.client_msg_id)&&N.client_msg_id===b.client_msg_id)),h===-1&&(b==null?void 0:b.id)!==void 0&&(b==null?void 0:b.id)!==null&&(h=w.findIndex(N=>ke(N==null?void 0:N.id,b.id)));let v;h===-1?v=[...w,b].sort(ue):(v=w.slice(),v[h]={...w[h],...b,_pending:!1,_failed:!1}),t.messagesByConv[y]=v,(b==null?void 0:b.type)==="action"&&((C=b==null?void 0:b.payload)!=null&&C.state)&&b.payload.state!=="pending"&&(b==null?void 0:b.id)!=null&&t.awaitingCallback[b.id]&&delete t.awaitingCallback[b.id]}function ke(y,b){return y===b?!0:y==null||b==null?!1:String(y)===String(b)}function G(y,b,w){const h=t.messagesByConv[y];if(!h)return;const v=h.findIndex(N=>N.id===b);if(v===-1)return;const C=h.slice();C[v]={...h[v],...w},t.messagesByConv[y]=C}function ee(y,b){const w=t.conversations.findIndex(v=>v.id===y);if(w===-1)return;const h=t.conversations[w];if(b&&(!h.last_message_at||b>h.last_message_at)){const v=t.conversations.slice();v[w]={...h,last_message_at:b},v.sort((C,N)=>(N.last_message_at||"").localeCompare(C.last_message_at||"")),t.conversations=v}}function ue(y,b){return(y.created_at||"").localeCompare(b.created_at||"")}function j(y){if(!y||typeof y!="object")return null;const b={},w={};for(const[h,v]of Object.entries(y))v!==void 0&&(h==="name"||h==="email"?v!=null&&String(v).trim()!==""&&(b[h]=v):(h==="values"||h==="metadata")&&v&&typeof v=="object"?Object.assign(w,v):w[h]=v);return Object.keys(w).length&&(b.values=w),Object.keys(b).length?b:null}function le(y){const b=t.messagesByConv[y]||[];let w="";for(const C of b)C!=null&&C.created_at&&C.created_at>w&&(w=C.created_at);const h=new Date().toISOString();return!w||h>w?h:new Date(Date.parse(w)+1).toISOString()}return{state:t,start:r,destroy:i,applyCustomer:s,createConversation:o,openConversation:l,loadMore:f,fetchSinceLast:S,patchConversation:g,markConversationRead:A,send:K,clickCallback:I,signAttachment:z,submitFeedback:q,getPendingApproval:X,getActionInFlight:ne,getLatestSuggestions:ge,getLatestForm:U,setPanelOpen:e.setPanelOpen}}const Re={w:"#ffffff",g50:"#F9F9F7",g100:"#F2F1EE",g150:"#E8E6E2",g200:"#D9D6CF",g300:"#B4B0A8",g400:"#888480",g500:"#5A5753",g700:"#2B2926",g900:"#17161A",accent:"#5B5FEF",accentLight:"#EEEFFE",green:"#22C55E",red:"#B91C1C",redBg:"#FDECEC"},ps=["#5B5FEF","#7C3AED","#DB2777","#0891B2","#D97706","#059669"];function Ks(e=""){return e?ps[e.charCodeAt(0)%ps.length]:ps[0]}function qs(e=""){return e.split(" ").map(t=>t[0]||"").join("").toUpperCase().slice(0,2)}function go(e=new Date,t="fr-FR"){return e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"})}const _o=`
18
18
  @import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');
19
19
 
20
20
  .wm-root {
@@ -60,14 +60,14 @@
60
60
  0% { transform: translateX(110%); opacity: 0; }
61
61
  100% { transform: translateX(0); opacity: 1; }
62
62
  }
63
- `,cc="https://api.messenger.victorc.fr",pn="fr",uc=["fr","en"],jr={fr:"fr-FR",en:"en-US"},gs={fr:{"common.newConversation":"Nouvelle conversation","common.conversation":"Conversation","common.agent":"Agent","common.aiAssistant":"Assistant IA","common.system":"Système","common.you":"Vous","common.action":"Action","common.yes":"Oui","common.no":"Non","common.send":"Envoyer","common.sending":"Envoi…","common.cancel":"Annuler","common.save":"Enregistrer","common.close":"Fermer","common.open":"Ouvrir","loading.minimize":"Réduire","error.connectionFailed":"Connexion impossible","header.backToHome":"Retour à l'accueil","header.moreOptions":"Plus d'options","header.closeWidget":"Fermer le widget","launcher.open":"Ouvrir le messenger","launcher.openConversationWith":"Ouvrir la conversation avec {name}","launcher.theAgent":"l'agent","launcher.dismiss":"Ignorer","launcher.repliedToYou":" vous a répondu","launcher.unreadMessages":"{count} messages non lus","launcher.unreadConversationsOne":"{count} conversation non lue","launcher.unreadConversationsMany":"{count} conversations non lues","onboarding.start":"Commencer une conversation","onboarding.quickAccess":"Accès rapide","onboarding.recentConversations":"Conversations récentes","onboarding.search":"Rechercher dans vos messages","onboarding.unread":"Non lu","onboarding.noResults":"Aucun résultat pour « {query} ».","onboarding.greetingNamed":"Bonjour, je suis {name}","onboarding.greeting":"Bonjour, je suis votre assistant","onboarding.heroSub":`Posez-moi n'importe quelle question.
63
+ `,uc="https://api.messenger.victorc.fr",pn="fr",dc=["fr","en"],jr={fr:"fr-FR",en:"en-US"},gs={fr:{"common.newConversation":"Nouvelle conversation","common.conversation":"Conversation","common.agent":"Agent","common.aiAssistant":"Assistant IA","common.system":"Système","common.you":"Vous","common.action":"Action","common.yes":"Oui","common.no":"Non","common.send":"Envoyer","common.sending":"Envoi…","common.cancel":"Annuler","common.save":"Enregistrer","common.close":"Fermer","common.open":"Ouvrir","loading.minimize":"Réduire","error.connectionFailed":"Connexion impossible","header.backToHome":"Retour à l'accueil","header.moreOptions":"Plus d'options","header.closeWidget":"Fermer le widget","launcher.open":"Ouvrir le messenger","launcher.openConversationWith":"Ouvrir la conversation avec {name}","launcher.theAgent":"l'agent","launcher.dismiss":"Ignorer","launcher.repliedToYou":" vous a répondu","launcher.unreadMessages":"{count} messages non lus","launcher.unreadConversationsOne":"{count} conversation non lue","launcher.unreadConversationsMany":"{count} conversations non lues","onboarding.start":"Commencer une conversation","onboarding.quickAccess":"Accès rapide","onboarding.recentConversations":"Conversations récentes","onboarding.search":"Rechercher dans vos messages","onboarding.unread":"Non lu","onboarding.noResults":"Aucun résultat pour « {query} ».","onboarding.greetingNamed":"Bonjour, je suis {name}","onboarding.greeting":"Bonjour, je suis votre assistant","onboarding.heroSub":`Posez-moi n'importe quelle question.
64
64
  Je réponds en quelques secondes.`,"onboarding.newMessage":"Nouveau message","composer.placeholder":"Écrivez votre message…","composer.replyTo":"Répondre à {name}…","composer.agentTakingOver":"Un agent prend le relais…","composer.send":"Envoyer","composer.attach":"Joindre","composer.attachFile":"Joindre un fichier","composer.screenshot":"Capture d'écran","composer.recordScreen":"Enregistrer l'écran","composer.recording":"Enregistrement · {time}","composer.stop":"Arrêter","messageList.loadingHistory":"Chargement de l'historique…","messageList.conversationStart":"Début de la conversation","messageList.unread":"Non lus","messageList.today":"Aujourd'hui · {time}","messageList.approvalRequestSent":"Demande d'approbation envoyée","messageList.conversationUpdate":"Mise à jour de la conversation","messageList.anAgent":"Un agent","system.transferredToHuman":"Conversation transférée à un humain","system.assigned":"{name} a rejoint la conversation","system.unassigned":"L'agent a quitté la conversation","system.resolved":"Conversation résolue","system.reopened":"Conversation rouverte","system.idle":"Conversation en pause","action.title":"Confirmer l'action","action.inProgress":"{name} en cours, veuillez patienter…","action.rejectedByUser":"Action annulée par l'utilisateur.","approval.approve":"Autoriser","approval.reject":"Refuser","moreMenu.editTitle":"Modifier le titre","moreMenu.exportTranscript":"Exporter la transcription","moreMenu.sound":"Son","moreMenu.browserNotifications":"Notifications navigateur","moreMenu.serviceStatus":"Statut des services","moreMenu.helpCenter":"Centre d'aide","feedback.question":"Comment s'est passée cette conversation ?","feedback.subtitle":"Votre avis nous aide à améliorer l'assistant.","feedback.rating1":"Pas bien","feedback.rating2":"Moyen","feedback.rating3":"Bien","feedback.rating4":"Super","feedback.rating5":"Excellent","feedback.submit":"Envoyer mon avis","feedback.doneTitle":"Merci pour votre retour !","feedback.doneSubtitle":"Votre avis a bien été pris en compte.","rename.dialogTitle":"Modifier le titre de la conversation","rename.title":"Modifier le titre","rename.placeholder":"Titre de la conversation","form.title":"Formulaire","form.choose":"Choisir…","form.responseSent":"Réponse envoyée","form.sent":"Envoyé","form.fieldRequired":"« {label} » est requis.","ticket.dateAt":" à ","attachment.fallbackName":"Pièce jointe","attachment.remove":"Retirer","attachment.fileFallbackName":"fichier","attachment.bytes":"{size} o","attachment.kilobytes":"{size} ko","attachment.megabytes":"{size} Mo","notification.newMessage":"Nouveau message","notification.youHaveNewMessage":"Vous avez un nouveau message","export.createdOn":"Créée le : {date}"},en:{"common.newConversation":"New conversation","common.conversation":"Conversation","common.agent":"Agent","common.aiAssistant":"AI Assistant","common.system":"System","common.you":"You","common.action":"Action","common.yes":"Yes","common.no":"No","common.send":"Send","common.sending":"Sending…","common.cancel":"Cancel","common.save":"Save","common.close":"Close","common.open":"Open","loading.minimize":"Minimize","error.connectionFailed":"Connection failed","header.backToHome":"Back to home","header.moreOptions":"More options","header.closeWidget":"Close widget","launcher.open":"Open the messenger","launcher.openConversationWith":"Open the conversation with {name}","launcher.theAgent":"the agent","launcher.dismiss":"Dismiss","launcher.repliedToYou":" replied to you","launcher.unreadMessages":"{count} unread messages","launcher.unreadConversationsOne":"{count} unread conversation","launcher.unreadConversationsMany":"{count} unread conversations","onboarding.start":"Start a conversation","onboarding.quickAccess":"Quick access","onboarding.recentConversations":"Recent conversations","onboarding.search":"Search your messages","onboarding.unread":"Unread","onboarding.noResults":"No results for “{query}”.","onboarding.greetingNamed":"Hi, I'm {name}","onboarding.greeting":"Hi, I'm your assistant","onboarding.heroSub":`Ask me anything.
65
- I reply within seconds.`,"onboarding.newMessage":"New message","composer.placeholder":"Type your message…","composer.replyTo":"Reply to {name}…","composer.agentTakingOver":"An agent is taking over…","composer.send":"Send","composer.attach":"Attach","composer.attachFile":"Attach a file","composer.screenshot":"Screenshot","composer.recordScreen":"Record screen","composer.recording":"Recording · {time}","composer.stop":"Stop","messageList.loadingHistory":"Loading history…","messageList.conversationStart":"Start of the conversation","messageList.unread":"Unread","messageList.today":"Today · {time}","messageList.approvalRequestSent":"Approval request sent","messageList.conversationUpdate":"Conversation update","messageList.anAgent":"An agent","system.transferredToHuman":"Conversation transferred to a human","system.assigned":"{name} joined the conversation","system.unassigned":"The agent left the conversation","system.resolved":"Conversation resolved","system.reopened":"Conversation reopened","system.idle":"Conversation paused","action.title":"Confirm the action","action.inProgress":"{name} in progress, please wait…","action.rejectedByUser":"Action cancelled by the user.","approval.approve":"Approve","approval.reject":"Decline","moreMenu.editTitle":"Edit title","moreMenu.exportTranscript":"Export transcript","moreMenu.sound":"Sound","moreMenu.browserNotifications":"Browser notifications","moreMenu.serviceStatus":"Service status","moreMenu.helpCenter":"Help center","feedback.question":"How was this conversation?","feedback.subtitle":"Your feedback helps us improve the assistant.","feedback.rating1":"Poor","feedback.rating2":"Okay","feedback.rating3":"Good","feedback.rating4":"Great","feedback.rating5":"Excellent","feedback.submit":"Send my feedback","feedback.doneTitle":"Thanks for your feedback!","feedback.doneSubtitle":"Your feedback has been recorded.","rename.dialogTitle":"Edit conversation title","rename.title":"Edit title","rename.placeholder":"Conversation title","form.title":"Form","form.choose":"Choose…","form.responseSent":"Response sent","form.sent":"Sent","form.fieldRequired":"“{label}” is required.","ticket.dateAt":" at ","attachment.fallbackName":"Attachment","attachment.remove":"Remove","attachment.fileFallbackName":"file","attachment.bytes":"{size} B","attachment.kilobytes":"{size} KB","attachment.megabytes":"{size} MB","notification.newMessage":"New message","notification.youHaveNewMessage":"You have a new message","export.createdOn":"Created on: {date}"}};function Ws(e){if(typeof e!="string")return pn;const t=e.trim().toLowerCase().slice(0,2);return uc.includes(t)?t:pn}function bn(e){return jr[Ws(e)]||jr[pn]}function Ee(e){const t=Ws(e),n=gs[t]||gs[pn],r=gs[pn];return function(s,o){let a=n[s];return a==null&&(a=r[s]),a==null?s:(o&&(a=a.replace(/\{(\w+)\}/g,(l,f)=>o[f]!=null?String(o[f]):l)),a)}}function Ur(e,t){if(!Array.isArray(e==null?void 0:e.options))return t;const n=e.options.find(r=>(r==null?void 0:r.value)===t);return(n==null?void 0:n.label)||t}function _o(e,t,n){return Array.isArray(t)?t.map(r=>Ur(e,String(r))).join(", "):typeof t=="boolean"?n(t?"common.yes":"common.no"):Ur(e,String(t))}function dc(e,t,n=Ee()){if(!e||!t)return"";const r=Array.isArray(e.fields)?e.fields:[],i=[];for(const s of r){if(!(s!=null&&s.key)||!(s!=null&&s.label))continue;const o=t[s.key];if(o==null||o==="")continue;const a=_o(s,o,n);a&&i.push(`${s.label} :
65
+ I reply within seconds.`,"onboarding.newMessage":"New message","composer.placeholder":"Type your message…","composer.replyTo":"Reply to {name}…","composer.agentTakingOver":"An agent is taking over…","composer.send":"Send","composer.attach":"Attach","composer.attachFile":"Attach a file","composer.screenshot":"Screenshot","composer.recordScreen":"Record screen","composer.recording":"Recording · {time}","composer.stop":"Stop","messageList.loadingHistory":"Loading history…","messageList.conversationStart":"Start of the conversation","messageList.unread":"Unread","messageList.today":"Today · {time}","messageList.approvalRequestSent":"Approval request sent","messageList.conversationUpdate":"Conversation update","messageList.anAgent":"An agent","system.transferredToHuman":"Conversation transferred to a human","system.assigned":"{name} joined the conversation","system.unassigned":"The agent left the conversation","system.resolved":"Conversation resolved","system.reopened":"Conversation reopened","system.idle":"Conversation paused","action.title":"Confirm the action","action.inProgress":"{name} in progress, please wait…","action.rejectedByUser":"Action cancelled by the user.","approval.approve":"Approve","approval.reject":"Decline","moreMenu.editTitle":"Edit title","moreMenu.exportTranscript":"Export transcript","moreMenu.sound":"Sound","moreMenu.browserNotifications":"Browser notifications","moreMenu.serviceStatus":"Service status","moreMenu.helpCenter":"Help center","feedback.question":"How was this conversation?","feedback.subtitle":"Your feedback helps us improve the assistant.","feedback.rating1":"Poor","feedback.rating2":"Okay","feedback.rating3":"Good","feedback.rating4":"Great","feedback.rating5":"Excellent","feedback.submit":"Send my feedback","feedback.doneTitle":"Thanks for your feedback!","feedback.doneSubtitle":"Your feedback has been recorded.","rename.dialogTitle":"Edit conversation title","rename.title":"Edit title","rename.placeholder":"Conversation title","form.title":"Form","form.choose":"Choose…","form.responseSent":"Response sent","form.sent":"Sent","form.fieldRequired":"“{label}” is required.","ticket.dateAt":" at ","attachment.fallbackName":"Attachment","attachment.remove":"Remove","attachment.fileFallbackName":"file","attachment.bytes":"{size} B","attachment.kilobytes":"{size} KB","attachment.megabytes":"{size} MB","notification.newMessage":"New message","notification.youHaveNewMessage":"You have a new message","export.createdOn":"Created on: {date}"}};function Ws(e){if(typeof e!="string")return pn;const t=e.trim().toLowerCase().slice(0,2);return dc.includes(t)?t:pn}function bn(e){return jr[Ws(e)]||jr[pn]}function Ee(e){const t=Ws(e),n=gs[t]||gs[pn],r=gs[pn];return function(s,o){let a=n[s];return a==null&&(a=r[s]),a==null?s:(o&&(a=a.replace(/\{(\w+)\}/g,(l,f)=>o[f]!=null?String(o[f]):l)),a)}}function Ur(e,t){if(!Array.isArray(e==null?void 0:e.options))return t;const n=e.options.find(r=>(r==null?void 0:r.value)===t);return(n==null?void 0:n.label)||t}function yo(e,t,n){return Array.isArray(t)?t.map(r=>Ur(e,String(r))).join(", "):typeof t=="boolean"?n(t?"common.yes":"common.no"):Ur(e,String(t))}function fc(e,t,n=Ee()){if(!e||!t)return"";const r=Array.isArray(e.fields)?e.fields:[],i=[];for(const s of r){if(!(s!=null&&s.key)||!(s!=null&&s.label))continue;const o=t[s.key];if(o==null||o==="")continue;const a=yo(s,o,n);a&&i.push(`${s.label} :
66
66
  ${a}`)}return i.join(`
67
67
 
68
- `)}function fc(e,t,n=Ee()){const r=[],i=Array.isArray(e==null?void 0:e.fields)?e.fields:[];for(const s of i){if(!(s!=null&&s.key)||!(s!=null&&s.label))continue;const o=t==null?void 0:t[s.key];if(o==null||o==="")continue;const a=_o(s,o,n);if(!a)continue;const l=s.type==="textarea"||typeof a=="string"&&(a.length>60||a.includes(`
69
- `));r.push({label:s.label,value:a,multiline:l})}return{kind:"form_response",data:{title:(e==null?void 0:e.title)||n("form.title"),fields:r}}}function gn(e){var n;const t=(n=e==null?void 0:e.author)==null?void 0:n.type;return t==="agent_ia"||t==="agent_human"}function vt(e){if(e==null)return null;const t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null}function Hr(e,t){let n=(e==null?void 0:e.last_message_at)||(e==null?void 0:e.updated_at)||(e==null?void 0:e.created_at)||"";for(const r of t)r!=null&&r.created_at&&r.created_at>n&&(n=r.created_at);return n}function hc(e,t){var n,r,i;for(let s=t.length-1;s>=0;s--){const o=t[s];if(!o)continue;const a=typeof o.text_md=="string"?o.text_md.trim():"";if(a)return(((n=o.author)==null?void 0:n.type)==="user"?"Vous : ":"")+a.replace(/\s+/g," ");const l=(r=o.payload)==null?void 0:r.attachments;if(Array.isArray(l)&&l.length)return"📎 Pièce jointe"}return(e==null?void 0:e.last_message_preview)||(e==null?void 0:e.preview)||((i=e==null?void 0:e.metadata)==null?void 0:i.last_preview)||""}function mc(e,t){return(e==null?void 0:e.name)||((e==null?void 0:e.type)==="user"?t("common.you"):(e==null?void 0:e.type)==="agent_human"?t("common.agent"):(e==null?void 0:e.type)==="agent_ia"?t("common.aiAssistant"):t("common.system"))}function pc(e,t,n,r){const i=[`# ${e.name||n("common.conversation")}`,e.created_at?n("export.createdOn",{date:new Date(e.created_at).toLocaleString(r)}):"",""];for(const s of t){if(!s)continue;const o=(s.text_md||"").trim();if(!o)continue;const a=mc(s.author,n),l=s.created_at?new Date(s.created_at).toLocaleString(r):"";i.push(`[${l}] ${a} :`),i.push(o),i.push("")}return i.join(`
70
- `)}function gc(e,t,n=Ee(),r){if(!e)return;const i=pc(e,t||[],n,bn(r)),s=new Blob([i],{type:"text/plain;charset=utf-8"});try{const o=URL.createObjectURL(s),a=document.createElement("a");a.href=o,a.download=`${(e.name||"conversation").replace(/[^a-z0-9-_]+/gi,"_")}.txt`,document.body.appendChild(a),a.click(),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(o),1e3)}catch(o){console.error("[ww-messenger] export failed",o)}}const _c={data(){const e=typeof Notification<"u";return{notifPermission:e?Notification.permission:"denied",soundEnabled:!0,browserNotifEnabled:e&&Notification.permission==="granted",_audioCtx:null}},methods:{teardownNotifications(){var e,t;if(this._audioCtx){try{(t=(e=this._audioCtx).close)==null||t.call(e)}catch{}this._audioCtx=null}},soundStorageKey(){return`wm:notif:sound:${this.widgetId||""}`},browserNotifStorageKey(){return`wm:notif:browser:${this.widgetId||""}`},hydrateNotifPref(){try{if(typeof localStorage>"u")return;const e=localStorage.getItem(this.soundStorageKey());e==="0"?this.soundEnabled=!1:e==="1"&&(this.soundEnabled=!0);const t=localStorage.getItem(this.browserNotifStorageKey());t==="0"?this.browserNotifEnabled=!1:t==="1"&&(this.browserNotifEnabled=typeof Notification<"u"&&Notification.permission==="granted")}catch{}},persistSoundPref(){try{if(typeof localStorage>"u")return;localStorage.setItem(this.soundStorageKey(),this.soundEnabled?"1":"0")}catch{}},persistBrowserNotifPref(){try{if(typeof localStorage>"u")return;localStorage.setItem(this.browserNotifStorageKey(),this.browserNotifEnabled?"1":"0")}catch{}},onSoundToggle(e){this.soundEnabled=!!e,this.persistSoundPref()},async onBrowserNotifToggle(e){if(typeof Notification>"u"){this.browserNotifEnabled=!1,this.persistBrowserNotifPref();return}if(!e){this.browserNotifEnabled=!1,this.persistBrowserNotifPref();return}let t=Notification.permission;if(t==="default"){try{t=await Notification.requestPermission()}catch(n){console.warn("[ww-messenger] notif permission request failed",n),t="denied"}this.notifPermission=t}this.browserNotifEnabled=t==="granted",this.persistBrowserNotifPref()},onMessageRevealed(e,t){var i;if(!this.soundEnabled&&!this.browserNotifEnabled||!t||!e||!gn(e))return;const n=typeof document<"u"&&document.hidden;this.isOpen&&!n&&((i=this.currentConv)==null?void 0:i.id)===t||(this.soundEnabled&&this.playNotificationSound(),this.browserNotifEnabled&&this.showBrowserNotification(t,e))},playNotificationSound(){if(typeof window>"u")return;const e=window.AudioContext||window.webkitAudioContext;if(e)try{this._audioCtx||(this._audioCtx=new e);const t=this._audioCtx;if(t.state==="suspended")try{t.resume()}catch{}const n=t.currentTime,r=t.createOscillator(),i=t.createGain();r.connect(i),i.connect(t.destination),r.type="sine",r.frequency.setValueAtTime(880,n),r.frequency.exponentialRampToValueAtTime(1320,n+.08),i.gain.setValueAtTime(0,n),i.gain.linearRampToValueAtTime(.12,n+.02),i.gain.exponentialRampToValueAtTime(1e-4,n+.28),r.start(n),r.stop(n+.32)}catch{}},showBrowserNotification(e,t){if(typeof Notification>"u"||Notification.permission!=="granted")return;const n=t==null?void 0:t.author,r=!n||n.type==="agent_ia",s=((n==null?void 0:n.name)||(r?this.agentName:"")||this.t("launcher.theAgent"))+this.t("launcher.repliedToYou"),o=typeof(t==null?void 0:t.text_md)=="string"?t.text_md.trim():"",a=o?o.slice(0,140):this.t("notification.youHaveNewMessage");try{const l=new Notification(s,{body:a,tag:`wm-${e}`,renotify:!1,silent:!0});l.onclick=()=>{try{window.focus()}catch{}this.draftConv=null,this.showOnboarding=!1,this.activeConvId=e,this.isOpen=!0,this.store&&this.store.setPanelOpen(!0);try{l.close()}catch{}}}catch(l){console.warn("[ww-messenger] notification failed",l)}}}},yc=450,vc=50,bc=900,wc=12e3,kc=300,Cc={data(){return{revealedAt:{},nextRevealAt:0,revealTimers:[],_liveRevealOff:null,_liveRevealConvSnapshot:null}},methods:{cancelReveals(){for(const e of this.revealTimers)clearTimeout(e);this.revealTimers=[]},resetRevealQueue(){this.cancelReveals(),this.revealedAt={},this.nextRevealAt=0},setupLiveReveal(){var n;if(!this.transport)return;this.teardownLiveReveal();const e=this.transport.on("message",r=>{const i=r==null?void 0:r.conversation_id,s=r==null?void 0:r.message;i&&s&&this.paceLiveMessage(s,i)});this._liveRevealConvSnapshot=new Map((((n=this.s)==null?void 0:n.conversations)||[]).map(r=>[r.id,(r==null?void 0:r.last_message_at)||""]));const t=this.transport.on("activity",r=>{this.handleLiveActivity(r)});this._liveRevealOff=()=>{try{e()}catch{}try{t()}catch{}}},teardownLiveReveal(){if(this._liveRevealOff){try{this._liveRevealOff()}catch{}this._liveRevealOff=null}this._liveRevealConvSnapshot=null},async handleLiveActivity(e){var i,s;const t=e==null?void 0:e.conversations;if(!Array.isArray(t)||!this.store)return;const n=this._liveRevealConvSnapshot||new Map,r=[];for(const o of t){if(!(o!=null&&o.id))continue;const a=o.last_message_at||"";if(!a)continue;const l=n.get(o.id)||"";a>l&&r.push(o.id)}this._liveRevealConvSnapshot=new Map(t.map(o=>[o.id,(o==null?void 0:o.last_message_at)||""]));for(const o of r)try{const a=await((s=(i=this.store).fetchSinceLast)==null?void 0:s.call(i,o));if(!Array.isArray(a))continue;for(const l of a)this.paceLiveMessage(l,o)}catch(a){console.error("[ww-messenger] activity delta fetch failed",a)}},scheduleReveal(e,t){const n=Date.now(),r=((e==null?void 0:e.text_md)||"").length,i=Math.min(wc,Math.max(bc,r*vc)),o=Math.max(n+yc,this.nextRevealAt+kc)+i;this.nextRevealAt=o;const a=Math.max(0,o-n),l=e.id,f=setTimeout(()=>{this.revealedAt={...this.revealedAt,[l]:Date.now()},this.revealTimers=this.revealTimers.filter(c=>c!==f),typeof this.onMessageRevealed=="function"&&this.onMessageRevealed(e,t)},a);this.revealTimers.push(f)},paceMessages(e,t){var i;if(!Array.isArray(e)||!e.length)return;const n=Date.now(),r={...this.revealedAt};for(const s of e){if((s==null?void 0:s.id)==null||r[s.id]!==void 0)continue;if(!gn(s)){r[s.id]=n;continue}const o=s!=null&&s.created_at?Date.parse(s.created_at):NaN;if(!Number.isFinite(o)||o<this.convOpenedAt){r[s.id]=n;continue}const a=typeof(s==null?void 0:s.text_md)=="string"&&s.text_md.trim().length>0,l=Array.isArray((i=s==null?void 0:s.payload)==null?void 0:i.attachments)&&s.payload.attachments.length>0;if(!a&&!l){r[s.id]=n;continue}r[s.id]=0,this.scheduleReveal(s,t)}this.revealedAt=r},paceLiveMessage(e,t){var i;if(!(e!=null&&e.id)||this.revealedAt[e.id]!==void 0)return;if(!gn(e)){this.revealedAt={...this.revealedAt,[e.id]:Date.now()};return}const n=typeof(e==null?void 0:e.text_md)=="string"&&e.text_md.trim().length>0,r=Array.isArray((i=e==null?void 0:e.payload)==null?void 0:i.attachments)&&e.payload.attachments.length>0;if(!n&&!r){this.revealedAt={...this.revealedAt,[e.id]:Date.now()};return}this.revealedAt={...this.revealedAt,[e.id]:0},this.scheduleReveal(e,t)}}},Ac={data(){return{approvalSettled:!0,approvalSettleTimer:null,approvalLatchId:null}},methods:{resetApprovalPacing(){this.approvalSettleTimer&&(clearTimeout(this.approvalSettleTimer),this.approvalSettleTimer=null),this.approvalSettled=!0,this.approvalLatchId=null},bumpApprovalSettle(e=800){this.approvalSettled=!1,this.approvalSettleTimer&&clearTimeout(this.approvalSettleTimer),this.approvalSettleTimer=setTimeout(()=>{this.approvalSettled=!0,this.approvalSettleTimer=null},e)}}},Sc=300,xc={data(){return{unreadAnchorId:null,unreadBoundaryTs:""}},created(){this._readMarkerTimer=null,this._readMarkerPending=null},beforeUnmount(){this._readMarkerTimer&&(clearTimeout(this._readMarkerTimer),this._readMarkerTimer=null),this._readMarkerPending=null},methods:{markConvRead(e){var s,o;if(!(e!=null&&e.id)||e._draft||!this.store)return;const t=((o=(s=this.s)==null?void 0:s.messagesByConv)==null?void 0:o[e.id])||[],n=Tc(t);if(n==null)return;const r=vt(e.last_read_message_id),i=vt(n);i!=null&&(r!=null&&i<=r||(this._readMarkerPending={convId:e.id,messageId:n},!this._readMarkerTimer&&(this._readMarkerTimer=setTimeout(()=>{const a=this._readMarkerPending;this._readMarkerPending=null,this._readMarkerTimer=null,a&&this.store&&this.store.markConversationRead(a.convId,a.messageId)},Sc))))}}};function Tc(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(!(!n||n._pending)&&vt(n.id)!=null)return n.id}return null}const we=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Mc={name:"WmHumanAvatar",props:{name:{type:String,default:""},avatarUrl:{type:String,default:null},size:{type:Number,default:26},tail:{type:Boolean,default:!1}},computed:{bg(){return this.avatarUrl?"transparent":Ks(this.name)},initials(){return qs(this.name)}}},Ec=["src","alt"];function Oc(e,t,n,r,i,s){return p(),_("div",{class:re(["wm-huav",{"wm-huav--tail":n.tail}]),style:je({width:n.size+"px",height:n.size+"px","--wm-avr":Math.round(n.size*.32)+"px",background:s.bg})},[n.avatarUrl?(p(),_("img",{key:0,src:n.avatarUrl,alt:n.name||""},null,8,Ec)):(p(),_("span",{key:1,style:je({fontSize:n.size*.36+"px"})},O(s.initials),5))],6)}const yo=we(Mc,[["render",Oc],["__scopeId","data-v-14e10c0d"]]),Ic=3,Lc={name:"WmLauncher",components:{HumanAvatar:yo},inject:{t:{default:()=>Ee()}},props:{unreadCount:{type:Number,default:0},peeks:{type:Array,default:()=>[]}},emits:["open","dismiss"],computed:{visiblePeeks(){return this.peeks.slice(0,Ic).reverse()}}},Rc={class:"wm-launcherWrap"},Bc=["aria-label","onClick","onKeydown"],Nc=["aria-label","onClick"],Pc={class:"wm-peek__avatar"},Fc=["aria-label"],Dc={class:"wm-peek__body"},jc={class:"wm-peek__head"},Uc={class:"wm-peek__name"},Hc={class:"wm-peek__action"},$c={class:"wm-peek__text"},Vc=["onClick"],Kc=["aria-label"],qc=["aria-label"];function Wc(e,t,n,r,i,s){const o=_e("HumanAvatar");return p(),_("div",Rc,[ye(wl,{name:"wm-peek"},{default:Ai(()=>[s.visiblePeeks.length?(p(),_("div",{key:0,class:re(["wm-peekStack",{"wm-peekStack--multi":s.visiblePeeks.length>1}])},[(p(!0),_(Z,null,Me(s.visiblePeeks,(a,l)=>(p(),_("div",{key:a.convId,class:"wm-peek",style:je({"--depth":s.visiblePeeks.length-1-l,zIndex:l+1}),role:"button",tabindex:"0","aria-label":s.t("launcher.openConversationWith",{name:a.senderName||s.t("launcher.theAgent")}),onClick:f=>e.$emit("open",a.convId),onKeydown:[Pn(yt(f=>e.$emit("open",a.convId),["prevent"]),["enter"]),Pn(yt(f=>e.$emit("open",a.convId),["prevent"]),["space"])]},[u("button",{type:"button",class:"wm-peek__close","aria-label":s.t("launcher.dismiss"),onClick:yt(f=>e.$emit("dismiss",a.convId),["stop"])},[...t[1]||(t[1]=[u("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Nc),u("div",Pc,[ye(o,{name:a.senderName,"avatar-url":a.senderAvatarUrl,size:34},null,8,["name","avatar-url"]),a.count>1?(p(),_("span",{key:0,class:"wm-peek__avatarBadge","aria-label":s.t("launcher.unreadMessages",{count:a.count})},O(a.count>9?"9+":a.count),9,Fc)):D("",!0)]),u("div",Dc,[u("div",jc,[u("span",Uc,O(a.senderName||s.t("common.agent")),1),u("span",Hc,O(s.t("launcher.repliedToYou")),1)]),u("p",$c,O(a.preview),1)]),u("button",{type:"button",class:"wm-peek__open",onClick:yt(f=>e.$emit("open",a.convId),["stop"])},O(s.t("common.open")),9,Vc)],44,Bc))),128))],2)):D("",!0)]),_:1}),u("button",{type:"button",class:"wm-launcher","aria-label":s.t("launcher.open"),onClick:t[0]||(t[0]=a=>e.$emit("open"))},[t[2]||(t[2]=u("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),n.unreadCount>0?(p(),_("span",{key:0,class:"wm-launcher__badge","aria-label":n.unreadCount>1?s.t("launcher.unreadConversationsMany",{count:n.unreadCount}):s.t("launcher.unreadConversationsOne",{count:n.unreadCount})},O(n.unreadCount>9?"9+":n.unreadCount),9,qc)):D("",!0)],8,Kc)])}const zc=we(Lc,[["render",Wc],["__scopeId","data-v-5193a529"]]),Gc={name:"WmAIAvatar",props:{size:{type:Number,default:26},pulse:{type:Boolean,default:!1},tail:{type:Boolean,default:!1},name:{type:String,default:""},imageUrl:{type:String,default:null}},computed:{initials(){return qs(this.name)},bgColor(){return Ks(this.name)}}},Yc={key:0,class:"wm-aiav__pulse"},Jc=["src","alt"],Qc=["width","height"];function Xc(e,t,n,r,i,s){return p(),_("div",{class:re(["wm-aiav",{"wm-aiav--tail":n.tail}]),style:je({width:n.size+"px",height:n.size+"px","--wm-avr":n.size*.32+"px"})},[n.pulse?(p(),_("div",Yc)):D("",!0),u("div",{class:re(["wm-aiav__inner",{"wm-aiav__inner--glow":n.pulse,"wm-aiav__inner--img":!!n.imageUrl,"wm-aiav__inner--initials":!n.imageUrl&&!!s.initials}]),style:je(!n.imageUrl&&s.initials?{background:s.bgColor}:null)},[n.imageUrl?(p(),_("img",{key:0,src:n.imageUrl,alt:n.name||""},null,8,Jc)):s.initials?(p(),_("span",{key:1,style:je({fontSize:n.size*.36+"px"})},O(s.initials),5)):(p(),_("svg",{key:2,width:n.size*.5,height:n.size*.5,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[...t[0]||(t[0]=[u("path",{d:"M12 2 L13.5 9 L20 10.5 L13.5 12 L12 19 L10.5 12 L4 10.5 L10.5 9 Z",fill:"white",opacity:"0.92"},null,-1),u("circle",{cx:"19",cy:"5",r:"1.5",fill:"white",opacity:"0.55"},null,-1),u("circle",{cx:"5",cy:"18",r:"1",fill:"white",opacity:"0.38"},null,-1)])],8,Qc))],6)],6)}const wn=we(Gc,[["render",Xc],["__scopeId","data-v-6f7f685d"]]),Zc={name:"WmTeamAvatars",props:{members:{type:Array,default:()=>[]},responseLabel:{type:String,default:""}},computed:{visible(){return Array.isArray(this.members)&&this.members.length>0},stackWidth(){return Math.min(this.members.length,3)===1?20:16+Math.min(this.members.length,3)*13}},methods:{colorFor(e){return e.avatar_url?"transparent":Ks(e.name||"")},initialsFor(e){return qs(e.name||"")}}},eu={key:0,class:"wm-team"},tu=["src","alt"],nu={key:1},su={key:0,class:"wm-team__label"};function ru(e,t,n,r,i,s){return s.visible?(p(),_("div",eu,[u("div",{class:"wm-team__stack",style:je({width:s.stackWidth+"px"})},[(p(!0),_(Z,null,Me(n.members.slice(0,3),(o,a)=>(p(),_("div",{key:a,class:"wm-team__pill",style:je({left:a*13+"px",zIndex:3-a,background:s.colorFor(o)})},[o.avatar_url?(p(),_("img",{key:0,src:o.avatar_url,alt:o.name||""},null,8,tu)):(p(),_("span",nu,O(s.initialsFor(o)),1))],4))),128))],4),n.responseLabel?(p(),_("span",su,O(n.responseLabel),1)):D("",!0)])):D("",!0)}const iu=we(Zc,[["render",ru],["__scopeId","data-v-e49a9063"]]),ou={name:"WmHeader",components:{AIAvatar:wn,TeamAvatars:iu},inject:{t:{default:()=>Ee()}},props:{title:{type:String,default:"Nouvelle conversation"},showBack:{type:Boolean,default:!1},teamMembers:{type:Array,default:()=>[]},responseLabel:{type:String,default:""},showClose:{type:Boolean,default:!0},showMore:{type:Boolean,default:!0},moreActive:{type:Boolean,default:!1},showIdentity:{type:Boolean,default:!0},agentName:{type:String,default:""},agentAvatarUrl:{type:String,default:null}},emits:["back","close","more"],computed:{hasTeam(){return Array.isArray(this.teamMembers)&&this.teamMembers.length>0},displayedTeamMembers(){const e=Array.isArray(this.teamMembers)?this.teamMembers:[];if(e.length<=3)return e;const t=new Date().getHours()%e.length,n=[];for(let r=0;r<3;r++)n.push(e[(t+r)%e.length]);return n}}},au={class:"wm-header"},lu=["aria-label"],cu={key:1,style:{width:"30px",height:"30px","flex-shrink":"0"}},uu={class:"wm-header__avatar"},du={class:"wm-header__main"},fu={class:"wm-header__title"},hu={key:3,class:"wm-header__fill"},mu={class:"wm-header__actions"},pu=["aria-label","title"],gu=["aria-label","title"];function _u(e,t,n,r,i,s){const o=_e("AIAvatar"),a=_e("TeamAvatars");return p(),_("div",au,[n.showBack?(p(),_("button",{key:0,type:"button",class:"wm-header__icon","aria-label":s.t("header.backToHome"),onClick:t[0]||(t[0]=l=>e.$emit("back"))},[...t[3]||(t[3]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M19 12H5M12 5l-7 7 7 7"})],-1)])],8,lu)):(p(),_("div",cu)),n.showIdentity?(p(),_(Z,{key:2},[u("div",uu,[ye(o,{size:30,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",du,[u("div",fu,O(n.title),1)]),s.hasTeam?(p(),be(a,{key:0,members:s.displayedTeamMembers,"response-label":""},null,8,["members"])):D("",!0)],64)):(p(),_("div",hu)),u("div",mu,[n.showMore?(p(),_("button",{key:0,type:"button",class:re(["wm-header__icon",{"wm-header__icon--active":n.moreActive}]),"aria-label":s.t("header.moreOptions"),title:s.t("header.moreOptions"),onClick:t[1]||(t[1]=l=>e.$emit("more"))},[...t[4]||(t[4]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[u("circle",{cx:"12",cy:"5",r:"1.6"}),u("circle",{cx:"12",cy:"12",r:"1.6"}),u("circle",{cx:"12",cy:"19",r:"1.6"})],-1)])],10,pu)):D("",!0),n.showClose?(p(),_("button",{key:1,type:"button",class:"wm-header__icon","aria-label":s.t("header.closeWidget"),title:s.t("header.closeWidget"),onClick:t[2]||(t[2]=l=>e.$emit("close"))},[...t[5]||(t[5]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,gu)):D("",!0)])])}const yu=we(ou,[["render",_u],["__scopeId","data-v-925c9e94"]]);function vo(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function vu(e){return/^(https?:\/\/|mailto:|tel:)/i.test(String(e).trim())}const $r="";function Xt(e){let t=e;const n=[];return t=t.replace(/`([^`\n]+)`/g,(r,i)=>{const s=n.length;return n.push(i),`${$r}CODE${s}${$r}`}),t=t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g,(r,i,s)=>vu(s)?`<a href="${s}" target="_blank" rel="noopener noreferrer">${i}</a>`:i),t=t.replace(/\*\*([^\n*][^\n]*?)\*\*/g,"<strong>$1</strong>"),t=t.replace(/__([^\n_][^\n]*?)__/g,"<u>$1</u>"),t=t.replace(/~~([^\n~][^\n]*?)~~/g,"<s>$1</s>"),t=t.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g,"$1<em>$2</em>"),t=t.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g,"$1<em>$2</em>"),t=t.replace(/CODE(\d+)/g,(r,i)=>`<code class="wm-md-code">${n[+i]}</code>`),t}function bu(e){if(!e)return"";const t=String(e).replace(/\[([^\]\n]+)\]\([^)\s]+\)/g,"$1");return Xt(vo(t))}function wu(e){if(!e)return"";const t=vo(e).split(`
68
+ `)}function hc(e,t,n=Ee()){const r=[],i=Array.isArray(e==null?void 0:e.fields)?e.fields:[];for(const s of i){if(!(s!=null&&s.key)||!(s!=null&&s.label))continue;const o=t==null?void 0:t[s.key];if(o==null||o==="")continue;const a=yo(s,o,n);if(!a)continue;const l=s.type==="textarea"||typeof a=="string"&&(a.length>60||a.includes(`
69
+ `));r.push({label:s.label,value:a,multiline:l})}return{kind:"form_response",data:{title:(e==null?void 0:e.title)||n("form.title"),fields:r}}}function gn(e){var n;const t=(n=e==null?void 0:e.author)==null?void 0:n.type;return t==="agent_ia"||t==="agent_human"}function vt(e){if(e==null)return null;const t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null}function Hr(e,t){let n=(e==null?void 0:e.last_message_at)||(e==null?void 0:e.updated_at)||(e==null?void 0:e.created_at)||"";for(const r of t)r!=null&&r.created_at&&r.created_at>n&&(n=r.created_at);return n}function mc(e,t){var n,r,i;for(let s=t.length-1;s>=0;s--){const o=t[s];if(!o)continue;const a=typeof o.text_md=="string"?o.text_md.trim():"";if(a)return(((n=o.author)==null?void 0:n.type)==="user"?"Vous : ":"")+a.replace(/\s+/g," ");const l=(r=o.payload)==null?void 0:r.attachments;if(Array.isArray(l)&&l.length)return"📎 Pièce jointe"}return(e==null?void 0:e.last_message_preview)||(e==null?void 0:e.preview)||((i=e==null?void 0:e.metadata)==null?void 0:i.last_preview)||""}function pc(e,t){return(e==null?void 0:e.name)||((e==null?void 0:e.type)==="user"?t("common.you"):(e==null?void 0:e.type)==="agent_human"?t("common.agent"):(e==null?void 0:e.type)==="agent_ia"?t("common.aiAssistant"):t("common.system"))}function gc(e,t,n,r){const i=[`# ${e.name||n("common.conversation")}`,e.created_at?n("export.createdOn",{date:new Date(e.created_at).toLocaleString(r)}):"",""];for(const s of t){if(!s)continue;const o=(s.text_md||"").trim();if(!o)continue;const a=pc(s.author,n),l=s.created_at?new Date(s.created_at).toLocaleString(r):"";i.push(`[${l}] ${a} :`),i.push(o),i.push("")}return i.join(`
70
+ `)}function _c(e,t,n=Ee(),r){if(!e)return;const i=gc(e,t||[],n,bn(r)),s=new Blob([i],{type:"text/plain;charset=utf-8"});try{const o=URL.createObjectURL(s),a=document.createElement("a");a.href=o,a.download=`${(e.name||"conversation").replace(/[^a-z0-9-_]+/gi,"_")}.txt`,document.body.appendChild(a),a.click(),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(o),1e3)}catch(o){console.error("[ww-messenger] export failed",o)}}const yc={data(){const e=typeof Notification<"u";return{notifPermission:e?Notification.permission:"denied",soundEnabled:!0,browserNotifEnabled:e&&Notification.permission==="granted",_audioCtx:null}},methods:{teardownNotifications(){var e,t;if(this._audioCtx){try{(t=(e=this._audioCtx).close)==null||t.call(e)}catch{}this._audioCtx=null}},soundStorageKey(){return`wm:notif:sound:${this.widgetId||""}`},browserNotifStorageKey(){return`wm:notif:browser:${this.widgetId||""}`},hydrateNotifPref(){try{if(typeof localStorage>"u")return;const e=localStorage.getItem(this.soundStorageKey());e==="0"?this.soundEnabled=!1:e==="1"&&(this.soundEnabled=!0);const t=localStorage.getItem(this.browserNotifStorageKey());t==="0"?this.browserNotifEnabled=!1:t==="1"&&(this.browserNotifEnabled=typeof Notification<"u"&&Notification.permission==="granted")}catch{}},persistSoundPref(){try{if(typeof localStorage>"u")return;localStorage.setItem(this.soundStorageKey(),this.soundEnabled?"1":"0")}catch{}},persistBrowserNotifPref(){try{if(typeof localStorage>"u")return;localStorage.setItem(this.browserNotifStorageKey(),this.browserNotifEnabled?"1":"0")}catch{}},onSoundToggle(e){this.soundEnabled=!!e,this.persistSoundPref()},async onBrowserNotifToggle(e){if(typeof Notification>"u"){this.browserNotifEnabled=!1,this.persistBrowserNotifPref();return}if(!e){this.browserNotifEnabled=!1,this.persistBrowserNotifPref();return}let t=Notification.permission;if(t==="default"){try{t=await Notification.requestPermission()}catch(n){console.warn("[ww-messenger] notif permission request failed",n),t="denied"}this.notifPermission=t}this.browserNotifEnabled=t==="granted",this.persistBrowserNotifPref()},onMessageRevealed(e,t){var i;if(!this.soundEnabled&&!this.browserNotifEnabled||!t||!e||!gn(e))return;const n=typeof document<"u"&&document.hidden;this.isOpen&&!n&&((i=this.currentConv)==null?void 0:i.id)===t||(this.soundEnabled&&this.playNotificationSound(),this.browserNotifEnabled&&this.showBrowserNotification(t,e))},playNotificationSound(){if(typeof window>"u")return;const e=window.AudioContext||window.webkitAudioContext;if(e)try{this._audioCtx||(this._audioCtx=new e);const t=this._audioCtx;if(t.state==="suspended")try{t.resume()}catch{}const n=t.currentTime,r=t.createOscillator(),i=t.createGain();r.connect(i),i.connect(t.destination),r.type="sine",r.frequency.setValueAtTime(880,n),r.frequency.exponentialRampToValueAtTime(1320,n+.08),i.gain.setValueAtTime(0,n),i.gain.linearRampToValueAtTime(.12,n+.02),i.gain.exponentialRampToValueAtTime(1e-4,n+.28),r.start(n),r.stop(n+.32)}catch{}},showBrowserNotification(e,t){if(typeof Notification>"u"||Notification.permission!=="granted")return;const n=t==null?void 0:t.author,r=!n||n.type==="agent_ia",s=((n==null?void 0:n.name)||(r?this.agentName:"")||this.t("launcher.theAgent"))+this.t("launcher.repliedToYou"),o=typeof(t==null?void 0:t.text_md)=="string"?t.text_md.trim():"",a=o?o.slice(0,140):this.t("notification.youHaveNewMessage");try{const l=new Notification(s,{body:a,tag:`wm-${e}`,renotify:!1,silent:!0});l.onclick=()=>{try{window.focus()}catch{}this.draftConv=null,this.showOnboarding=!1,this.activeConvId=e,this.isOpen=!0,this.store&&this.store.setPanelOpen(!0);try{l.close()}catch{}}}catch(l){console.warn("[ww-messenger] notification failed",l)}}}},vc=450,bc=50,wc=900,kc=12e3,Cc=300,Ac={data(){return{revealedAt:{},nextRevealAt:0,revealTimers:[],_liveRevealOff:null,_liveRevealConvSnapshot:null}},methods:{cancelReveals(){for(const e of this.revealTimers)clearTimeout(e);this.revealTimers=[]},resetRevealQueue(){this.cancelReveals(),this.revealedAt={},this.nextRevealAt=0},setupLiveReveal(){var n;if(!this.transport)return;this.teardownLiveReveal();const e=this.transport.on("message",r=>{const i=r==null?void 0:r.conversation_id,s=r==null?void 0:r.message;i&&s&&this.paceLiveMessage(s,i)});this._liveRevealConvSnapshot=new Map((((n=this.s)==null?void 0:n.conversations)||[]).map(r=>[r.id,(r==null?void 0:r.last_message_at)||""]));const t=this.transport.on("activity",r=>{this.handleLiveActivity(r)});this._liveRevealOff=()=>{try{e()}catch{}try{t()}catch{}}},teardownLiveReveal(){if(this._liveRevealOff){try{this._liveRevealOff()}catch{}this._liveRevealOff=null}this._liveRevealConvSnapshot=null},async handleLiveActivity(e){var i,s;const t=e==null?void 0:e.conversations;if(!Array.isArray(t)||!this.store)return;const n=this._liveRevealConvSnapshot||new Map,r=[];for(const o of t){if(!(o!=null&&o.id))continue;const a=o.last_message_at||"";if(!a)continue;const l=n.get(o.id)||"";a>l&&r.push(o.id)}this._liveRevealConvSnapshot=new Map(t.map(o=>[o.id,(o==null?void 0:o.last_message_at)||""]));for(const o of r)try{const a=await((s=(i=this.store).fetchSinceLast)==null?void 0:s.call(i,o));if(!Array.isArray(a))continue;for(const l of a)this.paceLiveMessage(l,o)}catch(a){console.error("[ww-messenger] activity delta fetch failed",a)}},scheduleReveal(e,t){const n=Date.now(),r=((e==null?void 0:e.text_md)||"").length,i=Math.min(kc,Math.max(wc,r*bc)),o=Math.max(n+vc,this.nextRevealAt+Cc)+i;this.nextRevealAt=o;const a=Math.max(0,o-n),l=e.id,f=setTimeout(()=>{this.revealedAt={...this.revealedAt,[l]:Date.now()},this.revealTimers=this.revealTimers.filter(c=>c!==f),typeof this.onMessageRevealed=="function"&&this.onMessageRevealed(e,t)},a);this.revealTimers.push(f)},paceMessages(e,t){var i;if(!Array.isArray(e)||!e.length)return;const n=Date.now(),r={...this.revealedAt};for(const s of e){if((s==null?void 0:s.id)==null||r[s.id]!==void 0)continue;if(!gn(s)){r[s.id]=n;continue}const o=s!=null&&s.created_at?Date.parse(s.created_at):NaN;if(!Number.isFinite(o)||o<this.convOpenedAt){r[s.id]=n;continue}const a=typeof(s==null?void 0:s.text_md)=="string"&&s.text_md.trim().length>0,l=Array.isArray((i=s==null?void 0:s.payload)==null?void 0:i.attachments)&&s.payload.attachments.length>0;if(!a&&!l){r[s.id]=n;continue}r[s.id]=0,this.scheduleReveal(s,t)}this.revealedAt=r},paceLiveMessage(e,t){var i;if(!(e!=null&&e.id)||this.revealedAt[e.id]!==void 0)return;if(!gn(e)){this.revealedAt={...this.revealedAt,[e.id]:Date.now()};return}const n=typeof(e==null?void 0:e.text_md)=="string"&&e.text_md.trim().length>0,r=Array.isArray((i=e==null?void 0:e.payload)==null?void 0:i.attachments)&&e.payload.attachments.length>0;if(!n&&!r){this.revealedAt={...this.revealedAt,[e.id]:Date.now()};return}this.revealedAt={...this.revealedAt,[e.id]:0},this.scheduleReveal(e,t)}}},Sc={data(){return{approvalSettled:!0,approvalSettleTimer:null,approvalLatchId:null}},methods:{resetApprovalPacing(){this.approvalSettleTimer&&(clearTimeout(this.approvalSettleTimer),this.approvalSettleTimer=null),this.approvalSettled=!0,this.approvalLatchId=null},bumpApprovalSettle(e=800){this.approvalSettled=!1,this.approvalSettleTimer&&clearTimeout(this.approvalSettleTimer),this.approvalSettleTimer=setTimeout(()=>{this.approvalSettled=!0,this.approvalSettleTimer=null},e)}}},xc=300,Tc={data(){return{unreadAnchorId:null,unreadBoundaryTs:""}},created(){this._readMarkerTimer=null,this._readMarkerPending=null},beforeUnmount(){this._readMarkerTimer&&(clearTimeout(this._readMarkerTimer),this._readMarkerTimer=null),this._readMarkerPending=null},methods:{markConvRead(e){var s,o;if(!(e!=null&&e.id)||e._draft||!this.store)return;const t=((o=(s=this.s)==null?void 0:s.messagesByConv)==null?void 0:o[e.id])||[],n=Mc(t);if(n==null)return;const r=vt(e.last_read_message_id),i=vt(n);i!=null&&(r!=null&&i<=r||(this._readMarkerPending={convId:e.id,messageId:n},!this._readMarkerTimer&&(this._readMarkerTimer=setTimeout(()=>{const a=this._readMarkerPending;this._readMarkerPending=null,this._readMarkerTimer=null,a&&this.store&&this.store.markConversationRead(a.convId,a.messageId)},xc))))}}};function Mc(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(!(!n||n._pending)&&vt(n.id)!=null)return n.id}return null}const we=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Ec={name:"WmHumanAvatar",props:{name:{type:String,default:""},avatarUrl:{type:String,default:null},size:{type:Number,default:26},tail:{type:Boolean,default:!1}},computed:{bg(){return this.avatarUrl?"transparent":Ks(this.name)},initials(){return qs(this.name)}}},Oc=["src","alt"];function Ic(e,t,n,r,i,s){return p(),_("div",{class:re(["wm-huav",{"wm-huav--tail":n.tail}]),style:je({width:n.size+"px",height:n.size+"px","--wm-avr":Math.round(n.size*.32)+"px",background:s.bg})},[n.avatarUrl?(p(),_("img",{key:0,src:n.avatarUrl,alt:n.name||""},null,8,Oc)):(p(),_("span",{key:1,style:je({fontSize:n.size*.36+"px"})},O(s.initials),5))],6)}const vo=we(Ec,[["render",Ic],["__scopeId","data-v-14e10c0d"]]),Lc=3,Rc={name:"WmLauncher",components:{HumanAvatar:vo},inject:{t:{default:()=>Ee()}},props:{unreadCount:{type:Number,default:0},peeks:{type:Array,default:()=>[]}},emits:["open","dismiss"],computed:{visiblePeeks(){return this.peeks.slice(0,Lc).reverse()}}},Nc={class:"wm-launcherWrap"},Bc=["aria-label","onClick","onKeydown"],Pc=["aria-label","onClick"],Fc={class:"wm-peek__avatar"},Dc=["aria-label"],jc={class:"wm-peek__body"},Uc={class:"wm-peek__head"},Hc={class:"wm-peek__name"},$c={class:"wm-peek__action"},Vc={class:"wm-peek__text"},Kc=["onClick"],qc=["aria-label"],Wc=["aria-label"];function zc(e,t,n,r,i,s){const o=_e("HumanAvatar");return p(),_("div",Nc,[ye(kl,{name:"wm-peek"},{default:Si(()=>[s.visiblePeeks.length?(p(),_("div",{key:0,class:re(["wm-peekStack",{"wm-peekStack--multi":s.visiblePeeks.length>1}])},[(p(!0),_(Z,null,Me(s.visiblePeeks,(a,l)=>(p(),_("div",{key:a.convId,class:"wm-peek",style:je({"--depth":s.visiblePeeks.length-1-l,zIndex:l+1}),role:"button",tabindex:"0","aria-label":s.t("launcher.openConversationWith",{name:a.senderName||s.t("launcher.theAgent")}),onClick:f=>e.$emit("open",a.convId),onKeydown:[Pn(yt(f=>e.$emit("open",a.convId),["prevent"]),["enter"]),Pn(yt(f=>e.$emit("open",a.convId),["prevent"]),["space"])]},[u("button",{type:"button",class:"wm-peek__close","aria-label":s.t("launcher.dismiss"),onClick:yt(f=>e.$emit("dismiss",a.convId),["stop"])},[...t[1]||(t[1]=[u("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Pc),u("div",Fc,[ye(o,{name:a.senderName,"avatar-url":a.senderAvatarUrl,size:34},null,8,["name","avatar-url"]),a.count>1?(p(),_("span",{key:0,class:"wm-peek__avatarBadge","aria-label":s.t("launcher.unreadMessages",{count:a.count})},O(a.count>9?"9+":a.count),9,Dc)):D("",!0)]),u("div",jc,[u("div",Uc,[u("span",Hc,O(a.senderName||s.t("common.agent")),1),u("span",$c,O(s.t("launcher.repliedToYou")),1)]),u("p",Vc,O(a.preview),1)]),u("button",{type:"button",class:"wm-peek__open",onClick:yt(f=>e.$emit("open",a.convId),["stop"])},O(s.t("common.open")),9,Kc)],44,Bc))),128))],2)):D("",!0)]),_:1}),u("button",{type:"button",class:"wm-launcher","aria-label":s.t("launcher.open"),onClick:t[0]||(t[0]=a=>e.$emit("open"))},[t[2]||(t[2]=u("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),n.unreadCount>0?(p(),_("span",{key:0,class:"wm-launcher__badge","aria-label":n.unreadCount>1?s.t("launcher.unreadConversationsMany",{count:n.unreadCount}):s.t("launcher.unreadConversationsOne",{count:n.unreadCount})},O(n.unreadCount>9?"9+":n.unreadCount),9,Wc)):D("",!0)],8,qc)])}const Gc=we(Rc,[["render",zc],["__scopeId","data-v-5193a529"]]),Yc={name:"WmAIAvatar",props:{size:{type:Number,default:26},pulse:{type:Boolean,default:!1},tail:{type:Boolean,default:!1},name:{type:String,default:""},imageUrl:{type:String,default:null}},computed:{initials(){return qs(this.name)},bgColor(){return Ks(this.name)}}},Jc={key:0,class:"wm-aiav__pulse"},Qc=["src","alt"],Xc=["width","height"];function Zc(e,t,n,r,i,s){return p(),_("div",{class:re(["wm-aiav",{"wm-aiav--tail":n.tail}]),style:je({width:n.size+"px",height:n.size+"px","--wm-avr":n.size*.32+"px"})},[n.pulse?(p(),_("div",Jc)):D("",!0),u("div",{class:re(["wm-aiav__inner",{"wm-aiav__inner--glow":n.pulse,"wm-aiav__inner--img":!!n.imageUrl,"wm-aiav__inner--initials":!n.imageUrl&&!!s.initials}]),style:je(!n.imageUrl&&s.initials?{background:s.bgColor}:null)},[n.imageUrl?(p(),_("img",{key:0,src:n.imageUrl,alt:n.name||""},null,8,Qc)):s.initials?(p(),_("span",{key:1,style:je({fontSize:n.size*.36+"px"})},O(s.initials),5)):(p(),_("svg",{key:2,width:n.size*.5,height:n.size*.5,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[...t[0]||(t[0]=[u("path",{d:"M12 2 L13.5 9 L20 10.5 L13.5 12 L12 19 L10.5 12 L4 10.5 L10.5 9 Z",fill:"white",opacity:"0.92"},null,-1),u("circle",{cx:"19",cy:"5",r:"1.5",fill:"white",opacity:"0.55"},null,-1),u("circle",{cx:"5",cy:"18",r:"1",fill:"white",opacity:"0.38"},null,-1)])],8,Xc))],6)],6)}const wn=we(Yc,[["render",Zc],["__scopeId","data-v-6f7f685d"]]),eu={name:"WmTeamAvatars",props:{members:{type:Array,default:()=>[]},responseLabel:{type:String,default:""}},computed:{visible(){return Array.isArray(this.members)&&this.members.length>0},stackWidth(){return Math.min(this.members.length,3)===1?20:16+Math.min(this.members.length,3)*13}},methods:{colorFor(e){return e.avatar_url?"transparent":Ks(e.name||"")},initialsFor(e){return qs(e.name||"")}}},tu={key:0,class:"wm-team"},nu=["src","alt"],su={key:1},ru={key:0,class:"wm-team__label"};function iu(e,t,n,r,i,s){return s.visible?(p(),_("div",tu,[u("div",{class:"wm-team__stack",style:je({width:s.stackWidth+"px"})},[(p(!0),_(Z,null,Me(n.members.slice(0,3),(o,a)=>(p(),_("div",{key:a,class:"wm-team__pill",style:je({left:a*13+"px",zIndex:3-a,background:s.colorFor(o)})},[o.avatar_url?(p(),_("img",{key:0,src:o.avatar_url,alt:o.name||""},null,8,nu)):(p(),_("span",su,O(s.initialsFor(o)),1))],4))),128))],4),n.responseLabel?(p(),_("span",ru,O(n.responseLabel),1)):D("",!0)])):D("",!0)}const ou=we(eu,[["render",iu],["__scopeId","data-v-e49a9063"]]),au={name:"WmHeader",components:{AIAvatar:wn,TeamAvatars:ou},inject:{t:{default:()=>Ee()}},props:{title:{type:String,default:"Nouvelle conversation"},showBack:{type:Boolean,default:!1},teamMembers:{type:Array,default:()=>[]},responseLabel:{type:String,default:""},showClose:{type:Boolean,default:!0},showMore:{type:Boolean,default:!0},moreActive:{type:Boolean,default:!1},showIdentity:{type:Boolean,default:!0},agentName:{type:String,default:""},agentAvatarUrl:{type:String,default:null}},emits:["back","close","more"],computed:{hasTeam(){return Array.isArray(this.teamMembers)&&this.teamMembers.length>0},displayedTeamMembers(){const e=Array.isArray(this.teamMembers)?this.teamMembers:[];if(e.length<=3)return e;const t=new Date().getHours()%e.length,n=[];for(let r=0;r<3;r++)n.push(e[(t+r)%e.length]);return n}}},lu={class:"wm-header"},cu=["aria-label"],uu={key:1,style:{width:"30px",height:"30px","flex-shrink":"0"}},du={class:"wm-header__avatar"},fu={class:"wm-header__main"},hu={class:"wm-header__title"},mu={key:3,class:"wm-header__fill"},pu={class:"wm-header__actions"},gu=["aria-label","title"],_u=["aria-label","title"];function yu(e,t,n,r,i,s){const o=_e("AIAvatar"),a=_e("TeamAvatars");return p(),_("div",lu,[n.showBack?(p(),_("button",{key:0,type:"button",class:"wm-header__icon","aria-label":s.t("header.backToHome"),onClick:t[0]||(t[0]=l=>e.$emit("back"))},[...t[3]||(t[3]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M19 12H5M12 5l-7 7 7 7"})],-1)])],8,cu)):(p(),_("div",uu)),n.showIdentity?(p(),_(Z,{key:2},[u("div",du,[ye(o,{size:30,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",fu,[u("div",hu,O(n.title),1)]),s.hasTeam?(p(),be(a,{key:0,members:s.displayedTeamMembers,"response-label":""},null,8,["members"])):D("",!0)],64)):(p(),_("div",mu)),u("div",pu,[n.showMore?(p(),_("button",{key:0,type:"button",class:re(["wm-header__icon",{"wm-header__icon--active":n.moreActive}]),"aria-label":s.t("header.moreOptions"),title:s.t("header.moreOptions"),onClick:t[1]||(t[1]=l=>e.$emit("more"))},[...t[4]||(t[4]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[u("circle",{cx:"12",cy:"5",r:"1.6"}),u("circle",{cx:"12",cy:"12",r:"1.6"}),u("circle",{cx:"12",cy:"19",r:"1.6"})],-1)])],10,gu)):D("",!0),n.showClose?(p(),_("button",{key:1,type:"button",class:"wm-header__icon","aria-label":s.t("header.closeWidget"),title:s.t("header.closeWidget"),onClick:t[2]||(t[2]=l=>e.$emit("close"))},[...t[5]||(t[5]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,_u)):D("",!0)])])}const vu=we(au,[["render",yu],["__scopeId","data-v-925c9e94"]]);function bo(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function bu(e){return/^(https?:\/\/|mailto:|tel:)/i.test(String(e).trim())}const $r="";function Xt(e){let t=e;const n=[];return t=t.replace(/`([^`\n]+)`/g,(r,i)=>{const s=n.length;return n.push(i),`${$r}CODE${s}${$r}`}),t=t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g,(r,i,s)=>bu(s)?`<a href="${s}" target="_blank" rel="noopener noreferrer">${i}</a>`:i),t=t.replace(/\*\*([^\n*][^\n]*?)\*\*/g,"<strong>$1</strong>"),t=t.replace(/__([^\n_][^\n]*?)__/g,"<u>$1</u>"),t=t.replace(/~~([^\n~][^\n]*?)~~/g,"<s>$1</s>"),t=t.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g,"$1<em>$2</em>"),t=t.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g,"$1<em>$2</em>"),t=t.replace(/CODE(\d+)/g,(r,i)=>`<code class="wm-md-code">${n[+i]}</code>`),t}function wu(e){if(!e)return"";const t=String(e).replace(/\[([^\]\n]+)\]\([^)\s]+\)/g,"$1");return Xt(bo(t))}function ku(e){if(!e)return"";const t=bo(e).split(`
71
71
  `),n=[];let r=0;for(;r<t.length;){const s=t[r];if(/^\s*```([\w-]*)\s*$/.exec(s)){r++;const f=[];for(;r<t.length&&!/^\s*```\s*$/.test(t[r]);)f.push(t[r]),r++;r<t.length&&r++,n.push({type:"block",html:`<pre class="wm-md-pre"><code>${f.join(`
72
72
  `)}</code></pre>`});continue}if(/^\s*[-*]\s+/.test(s)){const f=[];for(;r<t.length;){const g=/^\s*[-*]\s+(.*)$/.exec(t[r]);if(!g)break;f.push(g[1]),r++}const c=f.map(g=>`<li>${Xt(g)}</li>`).join("");n.push({type:"block",html:`<ul class="wm-md-ul">${c}</ul>`});continue}const a=/^\s*(\d+)\.\s+(.*)$/.exec(s);if(a){const f=parseInt(a[1],10),c=[a[2]];for(r++;r<t.length;){const A=/^\s*\d+\.\s+(.*)$/.exec(t[r]);if(!A)break;c.push(A[1]),r++}const g=c.map(A=>`<li>${Xt(A)}</li>`).join(""),S=f!==1?` start="${f}"`:"";n.push({type:"block",html:`<ol class="wm-md-ol"${S}>${g}</ol>`});continue}const l=/^(#{1,6})\s+(.*)$/.exec(s);if(l){const f=l[1].length;n.push({type:"block",html:`<h${f} class="wm-md-h wm-md-h${f}">${Xt(l[2])}</h${f}>`}),r++;continue}n.push({type:"text",html:Xt(s)}),r++}let i="";for(let s=0;s<n.length;s++){const o=n[s];i+=o.html;const a=n[s+1];a&&o.type!=="block"&&a.type!=="block"&&(i+=`
73
- `)}return i}const Vr={book:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253",changelog:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",status:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",chat:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",link:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"},ku={name:"WmOnboarding",components:{AIAvatar:wn},inject:{t:{default:()=>Ee()},wmLocale:{default:()=>()=>"fr"}},props:{welcomeMessage:{type:String,default:""},subtitle:{type:String,default:""},agentName:{type:String,default:""},defaultIconUrl:{type:String,default:null},quickLinks:{type:Array,default:()=>[]},openThreads:{type:Array,default:()=>[]},busy:{type:Boolean,default:!1}},emits:["start","select","resume"],data(){return{query:""}},computed:{heroTitle(){return this.welcomeMessage?this.welcomeMessage:this.agentName?this.t("onboarding.greetingNamed",{name:this.agentName}):this.t("onboarding.greeting")},heroSub(){return this.subtitle||this.t("onboarding.heroSub")},isOddQuickLinks(){return this.quickLinks.length%2===1},quickLinksLayout(){return this.isOddQuickLinks?"wm-onb__qlist":"wm-onb__grid"},filteredThreads(){const e=this.query.trim().toLowerCase();return e?this.openThreads.filter(t=>(t.title||"").toLowerCase().includes(e)||(t.preview||"").toLowerCase().includes(e)):this.openThreads}},methods:{iconPath(e){return Vr[e]||Vr.link},renderPreview(e){return bu(e)},formatTs(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=bn(this.wmLocale()),r=new Date;if(t.toDateString()===r.toDateString())return t.toLocaleTimeString(n,{hour:"2-digit",minute:"2-digit"});if(r.getTime()-t.getTime()<7*864e5){const o=t.toLocaleDateString(n,{weekday:"short"});return o.charAt(0).toUpperCase()+o.slice(1)}return t.toLocaleDateString(n,{day:"2-digit",month:"2-digit"})}}},Cu={class:"wm-onb"},Au={class:"wm-onb__hero"},Su={class:"wm-onb__hero-text"},xu={class:"wm-onb__title"},Tu={class:"wm-onb__sub"},Mu={class:"wm-onb__cta"},Eu=["disabled"],Ou={key:0,class:"wm-onb__section"},Iu={class:"wm-onb__section-title"},Lu=["onClick"],Ru={class:"wm-onb__card-icon"},Bu={width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Nu=["d"],Pu={class:"wm-onb__card-body"},Fu={class:"wm-onb__card-title"},Du={key:0,class:"wm-onb__card-sub"},ju={key:1,class:"wm-onb__section"},Uu={class:"wm-onb__section-title"},Hu={class:"wm-onb__search"},$u=["placeholder","aria-label"],Vu={class:"wm-onb__list"},Ku=["onClick"],qu=["aria-label"],Wu={class:"wm-onb__thread-body"},zu={class:"wm-onb__thread-title"},Gu=["innerHTML"],Yu={class:"wm-onb__thread-meta"},Ju={key:0,class:"wm-onb__thread-time"},Qu={key:0,class:"wm-onb__empty"};function Xu(e,t,n,r,i,s){const o=_e("AIAvatar");return p(),_("div",Cu,[u("div",Au,[t[2]||(t[2]=u("svg",{class:"wm-onb__hero-deco",width:"180",height:"180",viewBox:"0 0 180 180",fill:"none","aria-hidden":"true"},[u("circle",{cx:"170",cy:"10",r:"105",stroke:"#5B5FEF","stroke-width":"1","stroke-dasharray":"1 5",opacity:"0.35"}),u("circle",{cx:"170",cy:"10",r:"72",stroke:"#5B5FEF","stroke-width":"1","stroke-dasharray":"1 5",opacity:"0.5"}),u("circle",{cx:"152",cy:"34",r:"2.5",fill:"#5B5FEF",opacity:"0.65"})],-1)),ye(o,{size:52,"image-url":n.defaultIconUrl},null,8,["image-url"]),u("div",Su,[u("div",xu,O(s.heroTitle),1),u("div",Tu,O(s.heroSub),1)])]),u("div",Mu,[u("button",{type:"button",class:"wm-onb__startBtn",disabled:n.busy,onClick:t[0]||(t[0]=a=>e.$emit("start"))},[t[3]||(t[3]=u("span",{class:"wm-onb__startIcon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M12 5v14M5 12h14"})])],-1)),u("span",null,O(n.busy?"…":s.t("onboarding.start")),1)],8,Eu)]),n.quickLinks.length?(p(),_("div",Ou,[u("div",Iu,O(s.t("onboarding.quickAccess")),1),u("div",{class:re(s.quickLinksLayout)},[(p(!0),_(Z,null,Me(n.quickLinks,(a,l)=>(p(),_("button",{key:l,type:"button",class:re(["wm-onb__card",{"wm-onb__card--row":s.isOddQuickLinks}]),onClick:f=>e.$emit("select",a)},[u("span",Ru,[(p(),_("svg",Bu,[u("path",{d:s.iconPath(a.icon)},null,8,Nu)]))]),u("span",Pu,[u("span",Fu,O(a.label),1),a.description?(p(),_("span",Du,O(a.description),1)):D("",!0)])],10,Lu))),128))],2)])):D("",!0),n.openThreads.length?(p(),_("div",ju,[u("div",Uu,O(s.t("onboarding.recentConversations")),1),u("div",Hu,[t[4]||(t[4]=u("span",{class:"wm-onb__searchIcon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z"})])],-1)),it(u("input",{"onUpdate:modelValue":t[1]||(t[1]=a=>i.query=a),type:"text",placeholder:s.t("onboarding.search"),"aria-label":s.t("onboarding.search")},null,8,$u),[[Ot,i.query]])]),u("div",Vu,[(p(!0),_(Z,null,Me(s.filteredThreads,a=>(p(),_("button",{key:a.id,type:"button",class:"wm-onb__thread",onClick:l=>e.$emit("resume",a)},[u("span",{class:re(["wm-onb__thread-icon",{"wm-onb__thread-icon--inverted":!a.unread}])},[t[5]||(t[5]=u("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[u("path",{d:"M12 2 L13.5 9 L20 10.5 L13.5 12 L12 19 L10.5 12 L4 10.5 L10.5 9 Z",fill:"currentColor",opacity:"0.92"})],-1)),a.unread?(p(),_("span",{key:0,class:"wm-onb__thread-dot","aria-label":s.t("onboarding.unread")},null,8,qu)):D("",!0)],2),u("span",Wu,[u("span",zu,O(a.title),1),u("span",{class:"wm-onb__thread-preview",innerHTML:s.renderPreview(a.preview)},null,8,Gu)]),u("span",Yu,[s.formatTs(a._ts)?(p(),_("span",Ju,O(s.formatTs(a._ts)),1)):D("",!0),t[6]||(t[6]=u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round",class:"wm-onb__thread-chev","aria-hidden":"true"},[u("path",{d:"M5 12h14M13 5l7 7-7 7"})],-1))])],8,Ku))),128)),s.filteredThreads.length?D("",!0):(p(),_("div",Qu,O(s.t("onboarding.noResults",{query:i.query})),1))])])):D("",!0)])}const Zu=we(ku,[["render",Xu],["__scopeId","data-v-28c0780b"]]);function ed(e){return typeof e!="string"?"":e.replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)","g"),"$1").replace(/__([^_]+)__/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\s+/g," ").trim()}const td={name:"WmActionResult",props:{state:{type:String,default:"success"},label:{type:String,required:!0},detail:{type:String,default:""}},computed:{detailText(){return ed(this.detail)}}},nd={class:"wm-result__icon","aria-hidden":"true"},sd={key:0,width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.8","stroke-linecap":"round","stroke-linejoin":"round"},rd={key:1,width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.6","stroke-linecap":"round","stroke-linejoin":"round"},id={key:2,width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round"},od={key:3,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},ad={class:"wm-result__body"},ld={class:"wm-result__label"},cd={class:"wm-result__detail"};function ud(e,t,n,r,i,s){return p(),_("div",{class:re(["wm-result",`wm-result--${n.state}`])},[u("span",nd,[n.state==="success"?(p(),_("svg",sd,[...t[0]||(t[0]=[u("path",{d:"M20 6L9 17l-5-5"},null,-1)])])):n.state==="rejected"?(p(),_("svg",rd,[...t[1]||(t[1]=[u("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])):n.state==="awaiting"?(p(),_("svg",id,[...t[2]||(t[2]=[u("circle",{cx:"12",cy:"12",r:"10"},null,-1),u("polyline",{points:"12 7 12 12 15 14"},null,-1)])])):(p(),_("svg",od,[...t[3]||(t[3]=[u("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"},null,-1),u("line",{x1:"12",y1:"9",x2:"12",y2:"13"},null,-1),u("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"},null,-1)])]))]),u("span",ad,[u("span",ld,O(n.label),1),s.detailText?(p(),_(Z,{key:0},[t[4]||(t[4]=u("span",{class:"wm-result__sep","aria-hidden":"true"}," · ",-1)),u("span",cd,O(s.detailText),1)],64)):D("",!0)])],2)}const dd=we(td,[["render",ud],["__scopeId","data-v-7284acd0"]]),fd={name:"WmArtifactFormResponse",inject:{t:{default:()=>Ee()}},props:{data:{type:Object,required:!0}},computed:{fields(){var e;return Array.isArray((e=this.data)==null?void 0:e.fields)?this.data.fields:[]}}},hd={class:"wm-art wm-art--formResponse"},md={class:"wm-art__head"},pd={class:"wm-art__title"},gd={class:"wm-art__badge wm-art__badge--success"},_d={class:"wm-art__body"},yd={class:"wm-art__fieldLabel"};function vd(e,t,n,r,i,s){return p(),_("div",hd,[u("div",md,[u("div",pd,O(n.data.title||s.t("form.title")),1),u("span",gd,[t[0]||(t[0]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("polyline",{points:"20 6 9 17 4 12"})],-1)),Qn(" "+O(s.t("form.sent")),1)])]),u("div",_d,[(p(!0),_(Z,null,Me(s.fields,(o,a)=>(p(),_("div",{key:a,class:"wm-art__field"},[u("div",yd,O(o.label),1),u("div",{class:re(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},O(o.value),3)]))),128))])])}const bd=we(fd,[["render",vd],["__scopeId","data-v-713aecf1"]]),wd={name:"WmArtifactInfoCard",props:{data:{type:Object,required:!0}},computed:{fields(){var e;return Array.isArray((e=this.data)==null?void 0:e.fields)?this.data.fields:[]},hasBody(){var e;return!!((e=this.data)!=null&&e.body)||this.fields.length>0}}},kd={class:"wm-art wm-art--infoCard"},Cd={key:0,class:"wm-art__image"},Ad=["src","alt"],Sd={class:"wm-art__head"},xd={class:"wm-art__headMain"},Td={class:"wm-art__title"},Md={key:0,class:"wm-art__subtitle"},Ed={key:1,class:"wm-art__body"},Od={key:0,class:"wm-art__text"},Id={class:"wm-art__fieldLabel"};function Ld(e,t,n,r,i,s){return p(),_("div",kd,[n.data.image_url?(p(),_("figure",Cd,[u("img",{src:n.data.image_url,alt:n.data.title||"",loading:"lazy"},null,8,Ad)])):D("",!0),u("div",Sd,[u("div",xd,[u("div",Td,O(n.data.title),1),n.data.subtitle?(p(),_("div",Md,O(n.data.subtitle),1)):D("",!0)]),n.data.badge&&n.data.badge.label?(p(),_("span",{key:0,class:re(["wm-art__badge",`wm-art__badge--${n.data.badge.tone||"neutral"}`])},O(n.data.badge.label),3)):D("",!0)]),s.hasBody?(p(),_("div",Ed,[n.data.body?(p(),_("div",Od,O(n.data.body),1)):D("",!0),s.fields.length?(p(!0),_(Z,{key:1},Me(s.fields,(o,a)=>(p(),_("div",{key:a,class:"wm-art__field"},[u("div",Id,O(o.label),1),u("div",{class:re(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},O(o.value),3)]))),128)):D("",!0)])):D("",!0)])}const Rd=we(wd,[["render",Ld],["__scopeId","data-v-7eae0e4a"]]);function Bd(e,t,n){if(!e)return"";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const i=r.toLocaleDateString(t,{day:"numeric",month:"long",year:"numeric"}),s=r.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"});return`${i}${n}${s}`}const Nd={name:"WmArtifactTicket",inject:{t:{default:()=>Ee()},wmLocale:{default:()=>()=>"fr"}},props:{data:{type:Object,required:!0}},computed:{fields(){var e;return Array.isArray((e=this.data)==null?void 0:e.fields)?this.data.fields:[]},formattedDate(){var e;return Bd((e=this.data)==null?void 0:e.created_at,bn(this.wmLocale()),this.t("ticket.dateAt"))}},methods:{isPriority(e){return/priorit|^prio$/i.test(String(e||"").trim())},isDate(e){return/date|échéanc|echeanc|deadline|due|créé|cree/i.test(String(e||"").trim())},priorityLevel(e){const t=String(e||"").toLowerCase();return/high|haute|élev|elev|critic|critiq|urgent/.test(t)?3:/low|basse|faible|minor/.test(t)?1:2}}},Pd={class:"wm-art wm-art--ticket"},Fd={class:"wm-art__head wm-tk__head"},Dd={class:"wm-art__title wm-tk__title"},jd={class:"wm-tk__sub"},Ud={class:"wm-tk__ref"},Hd={key:0,class:"wm-tk__text"},$d={key:0,class:"wm-art__body"},Vd={class:"wm-art__fieldLabel"},Kd=["data-level"],qd={key:1,class:"wm-tk__date",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Wd={key:1,class:"wm-art__footer wm-tk__footer"};function zd(e,t,n,r,i,s){return p(),_("div",Pd,[u("div",Fd,[u("div",Dd,O(n.data.title),1),u("div",jd,[u("div",Ud,[t[0]||(t[0]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M20 12a2 2 0 0 1 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v4a2 2 0 0 1 0 4v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 1-2-2z"}),u("path",{d:"M13 5v2M13 17v2M13 11v2"})],-1)),u("span",null,O(n.data.reference),1)]),u("span",{class:re(["wm-art__badge","wm-tk__badge",`wm-art__badge--${n.data.status.tone||"neutral"}`])},[t[1]||(t[1]=u("span",{class:"wm-tk__dot","aria-hidden":"true"},null,-1)),Qn(" "+O(n.data.status.label),1)],2)]),n.data.body?(p(),_("div",Hd,O(n.data.body),1)):D("",!0)]),s.fields.length?(p(),_("div",$d,[(p(!0),_(Z,null,Me(s.fields,(o,a)=>(p(),_("div",{key:a,class:"wm-art__field"},[u("div",Vd,O(o.label),1),u("div",{class:re(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},[s.isPriority(o.label)?(p(),_("svg",{key:0,class:"wm-tk__prio","data-level":s.priorityLevel(o.value),width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true"},[...t[2]||(t[2]=[u("rect",{x:"1",y:"8",width:"2",height:"3",rx:"0.5"},null,-1),u("rect",{x:"5",y:"5",width:"2",height:"6",rx:"0.5"},null,-1),u("rect",{x:"9",y:"2",width:"2",height:"9",rx:"0.5"},null,-1)])],8,Kd)):s.isDate(o.label)?(p(),_("svg",qd,[...t[3]||(t[3]=[u("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"},null,-1),u("path",{d:"M16 2v4M8 2v4M3 10h18"},null,-1)])])):D("",!0),u("span",null,O(o.value),1)],2)]))),128))])):D("",!0),n.data.created_at?(p(),_("div",Wd,[t[4]||(t[4]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),u("path",{d:"M16 2v4M8 2v4M3 10h18"})],-1)),u("span",null,O(s.formattedDate),1)])):D("",!0)])}const Gd=we(Nd,[["render",zd],["__scopeId","data-v-5f30c914"]]),Yd={form_response:bd,info_card:Rd,ticket:Gd},Jd={name:"WmArtifactRenderer",props:{artifact:{type:Object,required:!0}},computed:{component(){var t;const e=(t=this.artifact)==null?void 0:t.kind;return e&&Yd[e]||null}}};function Qd(e,t,n,r,i,s){return s.component?(p(),be(Ta(s.component),{key:0,data:n.artifact.data},null,8,["data"])):D("",!0)}const Xd=we(Jd,[["render",Qd]]),Zd={name:"WmAttachmentPreview",inject:{signAttachmentFn:{default:null},t:{default:()=>Ee()}},props:{attachment:{type:Object,required:!0}},data(){return{url:null,loading:!1}},computed:{kind(){var n,r;const e=(n=this.attachment)==null?void 0:n.type;if(e)return e;const t=(((r=this.attachment)==null?void 0:r.mime_type)||"").toLowerCase();return t.startsWith("image/")?"image":t.startsWith("audio/")?"audio":t.startsWith("video/")?"video":"file"},displayName(){var e,t,n;return((t=(e=this.attachment)==null?void 0:e.metadata)==null?void 0:t.name)||((n=this.attachment)==null?void 0:n.name)||this.guessNameFromPath()||this.t("attachment.fallbackName")},safeHref(){const e=String(this.url||"").trim();return/^(https?:\/\/|blob:|data:image\/)/i.test(e)?e:"#"},sizeLabel(){var t;const e=(t=this.attachment)==null?void 0:t.size_bytes;return e?e<1024?this.t("attachment.bytes",{size:e}):e<1024*1024?this.t("attachment.kilobytes",{size:(e/1024).toFixed(0)}):this.t("attachment.megabytes",{size:(e/(1024*1024)).toFixed(1)}):""}},watch:{"attachment.path":{handler(){this.refresh()},immediate:!0}},methods:{guessNameFromPath(){var n;return((((n=this.attachment)==null?void 0:n.path)||"").split("/").pop()||"").replace(/^[0-9a-f-]{8,}-/,"")},async refresh(){var e;if(!(!((e=this.attachment)!=null&&e.path)||!this.signAttachmentFn)){this.loading=!0;try{this.url=await this.signAttachmentFn(this.attachment.path)}finally{this.loading=!1}}},onFileClick(e){this.safeHref==="#"&&e.preventDefault()}}},ef=["href"],tf=["src","alt"],nf=["src"],sf=["src"],rf=["href","download"],of={class:"wm-att__main"},af={class:"wm-att__name"},lf={key:0,class:"wm-att__meta"},cf={key:0,class:"wm-att__spin","aria-hidden":"true"};function uf(e,t,n,r,i,s){return p(),_("div",{class:re(["wm-att",["wm-att--"+(s.kind||"file")]])},[s.kind==="image"&&i.url?(p(),_("a",{key:0,href:s.safeHref,target:"_blank",rel:"noopener",class:"wm-att__imgWrap"},[u("img",{src:i.url,alt:s.displayName,loading:"lazy"},null,8,tf)],8,ef)):s.kind==="audio"&&i.url?(p(),_("audio",{key:1,src:i.url,controls:"",preload:"metadata"},null,8,nf)):s.kind==="video"&&i.url?(p(),_("video",{key:2,src:i.url,controls:"",preload:"metadata"},null,8,sf)):(p(),_("a",{key:3,class:"wm-att__file",href:s.safeHref,download:s.displayName,target:"_blank",rel:"noopener",onClick:t[0]||(t[0]=(...o)=>s.onFileClick&&s.onFileClick(...o))},[t[1]||(t[1]=u("span",{class:"wm-att__icon"},[u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),u("path",{d:"M14 2v6h6"})])],-1)),u("span",of,[u("span",af,O(s.displayName),1),s.sizeLabel?(p(),_("span",lf,O(s.sizeLabel),1)):D("",!0)]),i.loading?(p(),_("span",cf)):D("",!0)],8,rf))],2)}const df=we(Zd,[["render",uf],["__scopeId","data-v-0c877a62"]]),ff={name:"WmBubble",props:{role:{type:String,default:"ai"},text:{type:String,default:""}},computed:{rendered(){return wu(this.text)}}},hf=["innerHTML"];function mf(e,t,n,r,i,s){return p(),_("div",{class:re(["wm-bubble","wm-bubble--"+n.role])},[Ma(e.$slots,"default",{},()=>[u("span",{innerHTML:s.rendered},null,8,hf)])],2)}const pf=we(ff,[["render",mf],["__scopeId","data-v-7ab13147"]]),gf={name:"WmTyping"},_f={class:"wm-typing"};function yf(e,t,n,r,i,s){return p(),_("div",_f,[...t[0]||(t[0]=[u("span",{style:{"animation-delay":"0s"}},null,-1),u("span",{style:{"animation-delay":"0.2s"}},null,-1),u("span",{style:{"animation-delay":"0.4s"}},null,-1)])])}const vf=we(gf,[["render",yf],["__scopeId","data-v-df2447fd"]]);function Tt(e){return e?e.client_msg_id||e.id:""}const bf={transferred_to_human:"system.transferredToHuman",assigned:"system.assigned",unassigned:"system.unassigned",resolved:"system.resolved",reopened:"system.reopened",idle:"system.idle"},wf=80,kf=200,Cf={name:"WmMessageList",components:{AIAvatar:wn,HumanAvatar:yo,Bubble:pf,Typing:vf,ActionResult:dd,AttachmentPreview:df,ArtifactRenderer:Xd},inject:{t:{default:()=>Ee()},wmLocale:{default:()=>()=>"fr"}},props:{messages:{type:Array,default:()=>[]},streamingActive:{type:Boolean,default:!1},dateLabel:{type:String,default:""},conversationId:{type:[String,Number],default:null},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},unreadAnchorId:{type:Number,default:null},unreadBoundaryTs:{type:String,default:""},aiAgentName:{type:String,default:""},aiAgentAvatarUrl:{type:String,default:null}},emits:["load-more"],data(){return{silentFades:!1,widthByKey:Object.freeze({})}},computed:{historyExhausted(){return!this.hasMore&&!this.loadingMore&&this.messages.length>=20},groups(){var n,r,i,s;const e=[];for(const o of this.messages){const a=this.roleOf(o);if(a==="system"){if(((n=o==null?void 0:o.payload)==null?void 0:n.event)==="action_admin_pending"){const c=e[e.length-1];c&&c.role==="ai"?c.messages.push(o):e.push({key:`g-${Tt(o)}`,role:"ai",agentName:"",agentAvatarUrl:null,messages:[o],items:[]});continue}e.push({key:`sys-${Tt(o)}`,role:a,messages:[o],items:[],systemLabel:this.systemLabel(o)});continue}const l=e[e.length-1];l&&l.role===a&&(a==="ai"||l.agentName===(((r=o==null?void 0:o.author)==null?void 0:r.name)||""))?l.messages.push(o):e.push({key:`g-${Tt(o)}`,role:a,agentName:((i=o==null?void 0:o.author)==null?void 0:i.name)||"",agentAvatarUrl:((s=o==null?void 0:o.author)==null?void 0:s.avatar_url)||null,messages:[o],items:[]})}for(const o of e){if(o.role==="system")continue;const a=[];for(const l of o.messages)for(const f of this.itemsOf(l))a.push(f);o.items=a}const t=[];for(const o of e){if(o.role!=="system"&&!o.items.length)continue;const a=t[t.length-1];if(a&&a.role!=="system"&&a.role===o.role&&(o.role==="ai"||a.agentName===o.agentName)){a.messages.push(...o.messages),a.items.push(...o.items);continue}t.push(o)}for(const o of t)o.role!=="system"&&(o.key=this.stableGroupKey(o.messages));return t},unreadGroupKey(){if(this.unreadAnchorId==null)return null;const e=this.unreadAnchorId,t=this.unreadBoundaryTs;for(const n of this.groups){if(n.role==="user"||n.role==="system"||!n.items.length)continue;const r=n.messages[0];if(!r)continue;const i=vt(r.id);if(i!=null&&!(i<=e)&&!(t&&r.created_at&&r.created_at>t))return n.key}return null}},watch:{messages:{handler:"snapshotAndRestore",deep:!0},conversationId(e,t){e!==t&&(this._groupIdByMsgKey=null,this.silentFades=!1)},loadingMore(e){e||(this._pendingLoadMore=!1),e&&(this.silentFades=!0),this.snapshotAndRestore()},streamingActive:"snapshotAndRestore"},mounted(){this._lastSeenConvId=this.conversationId,this.scrollToBottom(),this._measureFrame=null,this._ro=new ResizeObserver(()=>this.scheduleMeasure()),this.$refs.scrollEl&&this._ro.observe(this.$refs.scrollEl),this.$nextTick(()=>this.measureRows())},beforeUnmount(){var e;(e=this._ro)==null||e.disconnect(),this._measureFrame&&cancelAnimationFrame(this._measureFrame)},updated(){this.scheduleMeasure()},methods:{messageKey:Tt,stableGroupKey(e){this._groupIdByMsgKey||(this._groupIdByMsgKey=new Map,this._groupIdCounter=0);const t=this._groupIdByMsgKey;let n=null;for(const r of e){const i=Tt(r);if(i&&t.has(i)){n=t.get(i);break}}n==null&&(n=++this._groupIdCounter);for(const r of e){const i=Tt(r);i&&t.set(i,n)}return`g-${n}`},isAtBottom(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=wf},onScroll(){const e=this.$refs.scrollEl;e&&(this.loadingMore||!this.hasMore||this._pendingLoadMore||e.scrollTop<=kf&&(this._pendingLoadMore=!0,this.$emit("load-more")))},snapshotAndRestore(){const e=this.$refs.scrollEl;if(!e||this._scrollSnap)return;const t=this._lastSeenConvId!==this.conversationId;this._lastSeenConvId=this.conversationId;const n=this.isAtBottom(e);let r=null;if(!t&&!n){const s=this.pickAnchor(e);if(s!=null&&s.rowKey){const o=this.findRowByKey(e,s.rowKey);if(o){const a=e.getBoundingClientRect().top;r={rowKey:s.rowKey,relY:o.getBoundingClientRect().top-a}}}}const i={forceBottom:t,wasPinned:n,anchor:r};this._scrollSnap=i,this.$nextTick(()=>{if(this._scrollSnap=null,i.forceBottom||i.wasPinned){e.scrollTop=e.scrollHeight;return}if(!i.anchor)return;const s=()=>{const o=i.anchor,a=this.findRowByKey(e,o.rowKey);if(!a)return;const f=a.getBoundingClientRect().top-e.getBoundingClientRect().top-o.relY;Math.abs(f)>.5&&(e.scrollTop+=f)};s(),requestAnimationFrame(()=>{s(),requestAnimationFrame(s)})})},pickAnchor(e){const t=e.getBoundingClientRect().top,n=e.querySelectorAll(".wm-list__row[data-row-key]");let r=null;for(const i of n)if(r||(r=i),i.getBoundingClientRect().bottom>=t)return{rowKey:i.dataset.rowKey};return r?{rowKey:r.dataset.rowKey}:null},findRowByKey(e,t){if(!t)return null;const n=typeof CSS<"u"&&CSS.escape?CSS.escape(t):t.replace(/["\\]/g,"\\$&");return e.querySelector(`.wm-list__row[data-row-key="${n}"]`)},roleOf(e){var n,r;if((e==null?void 0:e.type)==="system"||((n=e==null?void 0:e.payload)==null?void 0:n.type)==="system")return"system";const t=(r=e==null?void 0:e.author)==null?void 0:r.type;return t==="user"?"user":t==="agent_human"?"human":"ai"},roleLabel(e){if(e.role==="human")return e.agentName||this.t("common.agent");const t=this.t("common.aiAssistant");return this.aiAgentName?`${this.aiAgentName} • ${t}`:t},itemsOf(e){var t;if(!e)return[];if(e.type==="system"&&((t=e==null?void 0:e.payload)==null?void 0:t.event)==="action_admin_pending")return[{message:e,partKey:"main",renderAs:"admin-pending",kind:{top:"bubble",bottom:"bubble"}}];if(e.type==="action"&&e.payload&&e.payload.state!=="pending"){const n=[{message:e,partKey:"main",renderAs:"action",kind:{top:"bubble",bottom:"bubble"}}];return this.actionArtifact(e)&&n.push({message:e,partKey:"artifact",renderAs:"artifact-of-action",kind:{top:"card",bottom:"card"}}),n}return this.artifactOf(e)?[{message:e,partKey:"main",renderAs:"artifact",kind:{top:"card",bottom:"card"}}]:e.text_md||this.attachmentsOf(e).length?[{message:e,partKey:"main",renderAs:"bubble",kind:{top:"bubble",bottom:"bubble"}}]:[]},cornersFor(e,t){var U,ne,ge;const n=e.items,r=(U=n[t])==null?void 0:U.kind,i=(ne=n[t-1])==null?void 0:ne.kind,s=(ge=n[t+1])==null?void 0:ge.kind,o=e.role==="user",a=14,l=4,f=i==null?void 0:i.bottom,c=s==null?void 0:s.top,g=this.widthByKey[this.rowKeyOf(e,t)],S=this.widthByKey[this.rowKeyOf(e,t-1)],A=this.widthByKey[this.rowKeyOf(e,t+1)],K=.5,I=(he,ke,G)=>he!=null&&g!=null?he+K>=g:ke===G||ke==="card"&&G==="bubble";let Q=a,z=a,q=a,X=a;return o?(f&&(z=l),(c||!s)&&(q=l),f&&I(S,f,r==null?void 0:r.top)&&(Q=l),c&&I(A,c,r==null?void 0:r.bottom)&&(X=l)):(f&&(Q=l),(c||!s)&&(X=l),f&&I(S,f,r==null?void 0:r.top)&&(z=l),c&&I(A,c,r==null?void 0:r.bottom)&&(q=l)),{tl:Q,tr:z,br:q,bl:X}},cornersStyle(e,t){if(e.items.length<2)return null;const n=this.cornersFor(e,t);return{"--wm-r-tl":`${n.tl}px`,"--wm-r-tr":`${n.tr}px`,"--wm-r-br":`${n.br}px`,"--wm-r-bl":`${n.bl}px`}},rowKeyOf(e,t){var r;const n=(r=e==null?void 0:e.items)==null?void 0:r[t];return n?`${Tt(n.message)}-${n.partKey}`:""},scheduleMeasure(){this._measureFrame||(this._measureFrame=requestAnimationFrame(()=>{this._measureFrame=null,this.measureRows()}))},measureRows(){const e=this.$refs.scrollEl;if(!e)return;const t={};for(const s of e.querySelectorAll(".wm-list__row[data-row-key]")){const o=s.dataset.rowKey;if(!o)continue;const a=s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");if(!a)continue;const l=a.getBoundingClientRect().width;l>0&&(t[o]=l)}const n=this.widthByKey,r=Object.keys(n),i=Object.keys(t);if(r.length===i.length){let s=!0;for(const o of i)if(Math.abs((n[o]??0)-t[o])>.5){s=!1;break}if(s)return}this.widthByKey=Object.freeze(t)},lastTimeOf(e){const t=e.items[e.items.length-1],n=(t==null?void 0:t.message)||e.messages[e.messages.length-1];if(!(n!=null&&n.created_at))return"";try{return po(new Date(n.created_at),bn(this.wmLocale()))}catch{return""}},hasTrailingOverlay(e){if(!e.messages.length)return!1;const t=e.messages[e.messages.length-1],n=e.items[e.items.length-1];return!!t&&(n==null?void 0:n.message)!==t},attachmentsOf(e){var n;const t=(n=e==null?void 0:e.payload)==null?void 0:n.attachments;return Array.isArray(t)?t:[]},artifactOf(e){var n;const t=(n=e==null?void 0:e.metadata)==null?void 0:n.artifact;return!t||typeof t!="object"||typeof t.kind!="string"?null:t},actionLabel(e){var t;return((t=e==null?void 0:e.payload)==null?void 0:t.name)||(e==null?void 0:e.text_md)||this.t("common.action")},actionDetail(e){var n,r,i,s,o,a;const t=e==null?void 0:e.payload;return t?t.state==="success"?((n=t.success)==null?void 0:n.summary)||((i=(r=t.success)==null?void 0:r.metadata)==null?void 0:i.description)||"":t.state==="rejected"?((s=t.rejected)==null?void 0:s.reason)||this.t("action.rejectedByUser"):t.state==="failure"&&(((o=t.failure)==null?void 0:o.summary)||((a=t.failure)==null?void 0:a.error))||"":""},actionArtifact(e){var n,r;const t=(r=(n=e==null?void 0:e.payload)==null?void 0:n.success)==null?void 0:r.artifact;return!t||typeof t!="object"||typeof t.kind!="string"?null:t},systemLabel(e){var i,s,o;const t=(i=e==null?void 0:e.payload)==null?void 0:i.event,n=bf[t],r=((s=e==null?void 0:e.metadata)==null?void 0:s.agent_name)||((o=e==null?void 0:e.author)==null?void 0:o.name)||this.t("messageList.anAgent");return n?this.t(n,{name:r}):(e==null?void 0:e.text_md)||this.t("messageList.conversationUpdate")},scrollToBottom(){const e=this.$refs.scrollEl;e&&(e.scrollTop=e.scrollHeight)}}},Af={key:0,class:"wm-list__loadMore",role:"status","aria-live":"polite"},Sf={class:"wm-list__loadMore-lbl"},xf={key:1,class:"wm-list__historyEnd"},Tf={key:2,class:"wm-list__sep"},Mf={class:"wm-list__sep-label"},Ef={key:0,class:"wm-list__sep wm-list__sep--unread"},Of={class:"wm-list__sep-label wm-list__sep-label--unread"},If={key:0,class:"wm-list__sysep"},Lf={class:"wm-list__sysep-label"},Rf=["data-row-key"],Bf={key:0,class:"wm-list__avatarSlot"},Nf={key:5,class:"wm-list__body"},Pf={key:0},Ff={key:1,"aria-hidden":"true"},Df={key:2},jf={key:3,class:"wm-list__row wm-list__row--ai fade-up"},Uf={class:"wm-list__avatarSlot"};function Hf(e,t,n,r,i,s){const o=_e("AIAvatar"),a=_e("HumanAvatar"),l=_e("ActionResult"),f=_e("ArtifactRenderer"),c=_e("Bubble"),g=_e("AttachmentPreview"),S=_e("Typing");return p(),_("div",{ref:"scrollEl",class:re(["wm-list",{"wm-list--silent":i.silentFades}]),onScrollPassive:t[0]||(t[0]=(...A)=>s.onScroll&&s.onScroll(...A))},[n.loadingMore?(p(),_("div",Af,[t[1]||(t[1]=u("span",{class:"wm-list__loadMore-spinner","aria-hidden":"true"},null,-1)),u("span",Sf,O(s.t("messageList.loadingHistory")),1)])):s.historyExhausted?(p(),_("div",xf,O(s.t("messageList.conversationStart")),1)):D("",!0),n.dateLabel?(p(),_("div",Tf,[t[2]||(t[2]=u("div",{class:"wm-list__line"},null,-1)),u("span",Mf,O(n.dateLabel),1),t[3]||(t[3]=u("div",{class:"wm-list__line"},null,-1))])):D("",!0),(p(!0),_(Z,null,Me(s.groups,(A,K)=>(p(),_(Z,{key:A.key},[A.key===s.unreadGroupKey?(p(),_("div",Ef,[t[4]||(t[4]=u("div",{class:"wm-list__line wm-list__line--unread"},null,-1)),u("span",Of,O(s.t("messageList.unread")),1),t[5]||(t[5]=u("div",{class:"wm-list__line wm-list__line--unread"},null,-1))])):D("",!0),A.role==="system"||A.items.length?(p(),_("div",{key:1,class:re(["wm-list__group","wm-list__group--"+A.role])},[A.role==="system"?(p(),_("div",If,[t[6]||(t[6]=u("div",{class:"wm-list__line wm-list__line--strong"},null,-1)),u("span",Lf,O(A.systemLabel),1),t[7]||(t[7]=u("div",{class:"wm-list__line wm-list__line--strong"},null,-1))])):(p(),_(Z,{key:1},[(p(!0),_(Z,null,Me(A.items,(I,Q)=>(p(),_("div",{key:`${s.messageKey(I.message)}-${I.partKey}`,"data-row-key":`${s.messageKey(I.message)}-${I.partKey}`,class:re(["wm-list__row fade-up",["wm-list__row--"+A.role,{"is-pending":I.message._pending,"is-failed":I.message._failed}]]),style:je(s.cornersStyle(A,Q))},[A.role!=="user"?(p(),_("div",Bf,[Q===A.items.length-1?(p(),_(Z,{key:0},[A.role==="ai"?(p(),be(o,{key:0,size:26,tail:!0,name:n.aiAgentName,"image-url":n.aiAgentAvatarUrl},null,8,["name","image-url"])):(p(),be(a,{key:1,name:A.agentName,"avatar-url":A.agentAvatarUrl,size:26,tail:!0},null,8,["name","avatar-url"]))],64)):D("",!0)])):D("",!0),I.renderAs==="action"?(p(),be(l,{key:1,state:I.message.payload.state,label:s.actionLabel(I.message),detail:s.actionDetail(I.message)},null,8,["state","label","detail"])):I.renderAs==="admin-pending"?(p(),be(l,{key:2,state:"awaiting",label:s.t("messageList.approvalRequestSent"),detail:I.message.text_md||""},null,8,["label","detail"])):I.renderAs==="artifact-of-action"?(p(),be(f,{key:3,artifact:s.actionArtifact(I.message)},null,8,["artifact"])):I.renderAs==="artifact"?(p(),be(f,{key:4,artifact:s.artifactOf(I.message)},null,8,["artifact"])):(p(),_("div",Nf,[I.message.text_md?(p(),be(c,{key:0,role:A.role,text:I.message.text_md},null,8,["role","text"])):D("",!0),s.attachmentsOf(I.message).length?(p(),_("div",{key:1,class:re(["wm-list__atts",{"wm-list__atts--align-end":A.role==="user"}])},[(p(!0),_(Z,null,Me(s.attachmentsOf(I.message),(z,q)=>(p(),be(g,{key:`${s.messageKey(I.message)}-att-${q}`,attachment:z},null,8,["attachment"]))),128))],2)):D("",!0)]))],14,Rf))),128)),(A.role!=="user"||s.lastTimeOf(A))&&!s.hasTrailingOverlay(A)?(p(),_("div",{key:0,class:re(["wm-list__meta",{"wm-list__meta--right":A.role==="user"}])},[A.role!=="user"?(p(),_("span",Pf,O(s.roleLabel(A)),1)):D("",!0),A.role!=="user"&&s.lastTimeOf(A)?(p(),_("span",Ff,"·")):D("",!0),s.lastTimeOf(A)?(p(),_("span",Df,O(s.lastTimeOf(A)),1)):D("",!0)],2)):D("",!0)],64))],2)):D("",!0)],64))),128)),n.streamingActive?(p(),_("div",jf,[u("div",Uf,[ye(o,{size:26,tail:!0,name:n.aiAgentName,"image-url":n.aiAgentAvatarUrl},null,8,["name","image-url"])]),ye(S)])):D("",!0)],34)}const $f=we(Cf,[["render",Hf],["__scopeId","data-v-d769b193"]]),Fn=typeof navigator<"u"&&!!navigator.mediaDevices&&typeof navigator.mediaDevices.getDisplayMedia=="function",zs=typeof window<"u"&&typeof window.MediaRecorder<"u";function Vf(){return zs&&["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm","video/mp4"].find(t=>{var n,r;return(r=(n=window.MediaRecorder).isTypeSupported)==null?void 0:r.call(n,t)})||""}function bo({audio:e}){return{video:!0,audio:!!e,selfBrowserSurface:"include",surfaceSwitching:"include",systemAudio:e?"include":"exclude"}}async function Kf(){if(!Fn)return null;let e;try{e=await navigator.mediaDevices.getDisplayMedia(bo({audio:!1}))}catch(t){return(t==null?void 0:t.name)!=="NotAllowedError"&&console.error("[media] screenshot picker",t),null}try{return await qf(e)}catch(t){return console.error("[media] screenshot capture",t),null}finally{e.getTracks().forEach(t=>{t.stop()})}}async function qf(e){const t=document.createElement("video");t.muted=!0,t.playsInline=!0,t.srcObject=e,await t.play(),await new Promise(a=>requestAnimationFrame(a));const n=t.videoWidth||1280,r=t.videoHeight||720,i=document.createElement("canvas");i.width=n,i.height=r,i.getContext("2d").drawImage(t,0,0,n,r);const s=await new Promise((a,l)=>{i.toBlob(f=>f?a(f):l(new Error("toBlob failed")),"image/png")}),o=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19);return new File([s],`capture-${o}.png`,{type:"image/png"})}async function Wf(e={}){var f;if(!Fn||!zs)return null;let t;try{t=await navigator.mediaDevices.getDisplayMedia(bo({audio:!0}))}catch(c){return(c==null?void 0:c.name)!=="NotAllowedError"&&console.error("[media] record picker",c),null}const n=Vf();let r;try{r=n?new window.MediaRecorder(t,{mimeType:n}):new window.MediaRecorder(t)}catch(c){return console.error("[media] recorder init",c),t.getTracks().forEach(g=>{g.stop()}),null}const i=[];let s=null,o=!1;r.addEventListener("dataavailable",c=>{c.data&&c.data.size>0&&i.push(c.data)}),r.addEventListener("stop",()=>{var c,g;if(s&&clearInterval(s),t.getTracks().forEach(S=>{S.stop()}),i.length){const S=r.mimeType||n||"video/webm",A=new Blob(i,{type:S}),K=/mp4/.test(S)?"mp4":"webm",I=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),Q=new File([A],`ecran-${I}.${K}`,{type:S});(c=e.onfinalize)==null||c.call(e,Q)}else(g=e.oncancel)==null||g.call(e)}),t.getVideoTracks().forEach(c=>{c.addEventListener("ended",()=>a(),{once:!0})});function a(){if(!o&&(o=!0,r.state!=="inactive"))try{r.stop()}catch(c){console.error("[media] recorder stop",c)}}try{r.start(1e3)}catch(c){return console.error("[media] recorder start",c),t.getTracks().forEach(g=>{g.stop()}),null}(f=e.onstart)==null||f.call(e);const l=Date.now();return s=setInterval(()=>{var c;(c=e.ontick)==null||c.call(e,Date.now()-l)},500),{stop:a,get state(){return r.state}}}const zf=[{action:"file",labelKey:"composer.attachFile",path:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"},{action:"screenshot",labelKey:"composer.screenshot",path:"M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z M12 17a4 4 0 100-8 4 4 0 000 8z"},{action:"record",labelKey:"composer.recordScreen",path:"M23 7l-7 5 7 5V7z M1 5a2 2 0 012-2h12a2 2 0 012 2v14a2 2 0 01-2 2H3a2 2 0 01-2-2V5z"}],Gf={name:"WmComposer",inject:{t:{default:()=>Ee()}},props:{modelValue:{type:String,default:""},placeholder:{type:String,default:"Écrivez votre message…"},disabled:{type:Boolean,default:!1},attachLabel:{type:String,default:"Joindre"}},emits:["update:modelValue","send","attach"],data(){return{local:this.modelValue,attachOpen:!1,recording:!1,recordingElapsed:0,recorder:null}},computed:{canSend(){return!this.disabled&&!!this.local.trim()},attachItems(){return zf.map(e=>({...e,label:this.t(e.labelKey),disabled:e.action==="screenshot"&&!Fn||e.action==="record"&&(!Fn||!zs)}))},recordingElapsedLabel(){const e=Math.floor(this.recordingElapsed/1e3),t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`}},watch:{modelValue(e){e!==this.local&&(this.local=e,this.$nextTick(()=>this.autosize()))},local(e){this.$emit("update:modelValue",e)}},mounted(){this.autosize()},beforeUnmount(){if(this.recorder)try{this.recorder.stop()}catch{}},methods:{focus(){const e=this.$refs.inputEl;if(!(!e||this.disabled))try{e.focus({preventScroll:!0})}catch{e.focus()}},onSubmit(){if(!this.canSend)return;const e=this.local.trim();this.local="",this.$emit("send",e),this.$nextTick(()=>this.autosize())},onKeydown(e){e.key==="Enter"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&!e.isComposing&&(e.preventDefault(),this.onSubmit())},autosize(){const e=this.$refs.inputEl;e&&(e.style.height="auto",e.style.height=`${e.scrollHeight}px`)},onFile(e){const t=Array.from(e.target.files||[]);for(const n of t)this.$emit("attach",n);e.target.value=""},onAttachAction(e){this.attachOpen=!1,e==="file"?this.pickFile():e==="screenshot"?this.captureScreenshot():e==="record"&&this.startRecording()},pickFile(){var e;(e=this.$refs.fileEl)==null||e.click()},async captureScreenshot(){if(this.disabled)return;const e=await Kf();e&&this.$emit("attach",e)},async startRecording(){if(this.recording||this.disabled)return;this.recordingElapsed=0;const e=await Wf({onstart:()=>{this.recording=!0},ontick:t=>{this.recordingElapsed=t},onfinalize:t=>{this.$emit("attach",t),this.recording=!1,this.recordingElapsed=0,this.recorder=null},oncancel:()=>{this.recording=!1,this.recordingElapsed=0,this.recorder=null}});e&&(this.recorder=e)},stopRecording(){if(this.recorder)try{this.recorder.stop()}catch(e){console.error("[composer] stop recording",e)}}}},Yf={class:"wm-compose-wrap"},Jf={key:0,class:"wm-rec"},Qf={class:"wm-rec__lbl"},Xf={key:1,class:"wm-compose__menu",role:"menu"},Zf=["disabled","onClick"],eh={class:"wm-compose__menuIcon"},th={viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},nh=["d"],sh=["placeholder","disabled"],rh={class:"wm-compose__actions"},ih=["title","aria-label","disabled"],oh=["disabled","aria-label"];function ah(e,t,n,r,i,s){return p(),_("div",Yf,[i.recording?(p(),_("div",Jf,[t[8]||(t[8]=u("span",{class:"wm-rec__dot","aria-hidden":"true"},null,-1)),u("span",Qf,O(s.t("composer.recording",{time:s.recordingElapsedLabel})),1),u("button",{type:"button",class:"wm-rec__stop",onClick:t[0]||(t[0]=(...o)=>s.stopRecording&&s.stopRecording(...o))},O(s.t("composer.stop")),1)])):D("",!0),u("form",{class:re(["wm-compose",{"has-attach":i.attachOpen}]),onSubmit:t[7]||(t[7]=yt((...o)=>s.onSubmit&&s.onSubmit(...o),["prevent"]))},[u("input",{ref:"fileEl",type:"file",hidden:"",multiple:"",onChange:t[1]||(t[1]=(...o)=>s.onFile&&s.onFile(...o))},null,544),i.attachOpen?(p(),_("div",{key:0,class:"wm-compose__overlay",onClick:t[2]||(t[2]=o=>i.attachOpen=!1)})):D("",!0),i.attachOpen?(p(),_("div",Xf,[(p(!0),_(Z,null,Me(s.attachItems,o=>(p(),_("button",{key:o.action,type:"button",class:"wm-compose__menuItem",disabled:o.disabled,onClick:a=>s.onAttachAction(o.action)},[u("span",eh,[(p(),_("svg",th,[u("path",{d:o.path,stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,nh)]))]),u("span",null,O(o.label),1)],8,Zf))),128))])):D("",!0),it(u("textarea",{ref:"inputEl","onUpdate:modelValue":t[3]||(t[3]=o=>i.local=o),class:"wm-compose__input",rows:"3",placeholder:n.placeholder,disabled:n.disabled,onKeydown:t[4]||(t[4]=(...o)=>s.onKeydown&&s.onKeydown(...o)),onInput:t[5]||(t[5]=(...o)=>s.autosize&&s.autosize(...o))},null,40,sh),[[Ot,i.local]]),u("div",rh,[u("button",{type:"button",class:re(["wm-compose__icon",{"is-open":i.attachOpen}]),title:n.attachLabel,"aria-label":n.attachLabel,disabled:i.recording,onClick:t[6]||(t[6]=o=>i.attachOpen=!i.attachOpen)},[...t[9]||(t[9]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})],-1)])],10,ih),u("button",{type:"submit",class:re(["wm-compose__send",{"is-empty":!s.canSend}]),disabled:!s.canSend,"aria-label":s.t("composer.send")},[...t[10]||(t[10]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"})],-1)])],10,oh)])],34)])}const lh=we(Gf,[["render",ah],["__scopeId","data-v-aa81dbb8"]]),ch={name:"WmSuggestionChips",props:{items:{type:Array,default:()=>[]},baseDelay:{type:Number,default:360},stepDelay:{type:Number,default:90}},emits:["select"],computed:{batchKey(){return this.items.map(e=>(e==null?void 0:e.label)||(e==null?void 0:e.text)||"").join("§")}}},uh=["onClick"];function dh(e,t,n,r,i,s){return n.items.length?(p(),_("div",{key:s.batchKey,class:"wm-chips"},[(p(!0),_(Z,null,Me(n.items,(o,a)=>(p(),_("button",{key:a,type:"button",class:"wm-chip",style:je({animationDelay:n.baseDelay+a*n.stepDelay+"ms"}),onClick:l=>e.$emit("select",o)},O(o.label),13,uh))),128))])):D("",!0)}const fh=we(ch,[["render",dh],["__scopeId","data-v-47ad8085"]]),hh={name:"WmApprovalCard",components:{AIAvatar:wn},inject:{t:{default:()=>Ee()}},props:{action:{type:String,required:!0},detail:{type:String,default:""},callbacks:{type:Array,default:()=>[]},agentName:{type:String,default:""},agentAvatarUrl:{type:String,default:null}},emits:["callback"],computed:{approveCallback(){return this.callbacks.find(e=>e.id==="approve"||e.style==="primary")||this.callbacks[0]},rejectCallback(){return this.callbacks.find(e=>e.id==="reject"||e.style==="danger"||e.style==="neutral")||(this.callbacks.length>1?this.callbacks[1]:null)},approveId(){var e;return(e=this.approveCallback)==null?void 0:e.id},rejectId(){var e;return(e=this.rejectCallback)==null?void 0:e.id},approveLabel(){var e;return((e=this.approveCallback)==null?void 0:e.label)||this.t("approval.approve")},rejectLabel(){var e;return((e=this.rejectCallback)==null?void 0:e.label)||this.t("approval.reject")}}},mh={class:"wm-approval"},ph={class:"wm-approval__head"},gh={class:"wm-approval__icon"},_h={class:"wm-approval__main"},yh={class:"wm-approval__title"},vh={key:0,class:"wm-approval__detail"},bh={class:"wm-approval__actions"};function wh(e,t,n,r,i,s){const o=_e("AIAvatar");return p(),_("div",mh,[u("div",ph,[u("div",gh,[ye(o,{size:24,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",_h,[u("div",yh,O(n.action),1),n.detail?(p(),_("div",vh,O(n.detail),1)):D("",!0)])]),u("div",bh,[s.rejectId?(p(),_("button",{key:0,type:"button",class:"wm-approval__btn wm-approval__btn--neutral",onClick:t[0]||(t[0]=a=>e.$emit("callback",s.rejectId))},O(s.rejectLabel),1)):D("",!0),s.approveId?(p(),_("button",{key:1,type:"button",class:"wm-approval__btn wm-approval__btn--primary",onClick:t[1]||(t[1]=a=>e.$emit("callback",s.approveId))},O(s.approveLabel),1)):D("",!0)])])}const kh=we(hh,[["render",wh],["__scopeId","data-v-a2bed37e"]]);let Kr=0;const Ch=new Set(["text","textarea","number","boolean","select","multiselect","date"]),Ah={name:"WmFormCard",components:{AIAvatar:wn},inject:{t:{default:()=>Ee()}},props:{form:{type:Object,required:!0},readOnly:{type:Boolean,default:!1},initialValues:{type:Object,default:null},agentName:{type:String,default:""},agentAvatarUrl:{type:String,default:null}},emits:["submit"],data(){return Kr+=1,{_uid:Kr,values:{},busy:!1,error:""}},computed:{normalizedFields(){var t;return(Array.isArray((t=this.form)==null?void 0:t.fields)?this.form.fields:[]).filter(n=>!(!(n!=null&&n.key)||!(n!=null&&n.label)||!Ch.has(n==null?void 0:n.type)||(n.type==="select"||n.type==="multiselect")&&(!Array.isArray(n.options)||n.options.length===0)))}},created(){this.resetValues()},methods:{resetValues(){const e=this.initialValues&&typeof this.initialValues=="object"?this.initialValues:{},t={};for(const n of this.normalizedFields){if(e[n.key]!==void 0){t[n.key]=e[n.key];continue}n.type==="boolean"?t[n.key]=!1:n.type==="multiselect"?t[n.key]=[]:t[n.key]=""}this.values=t,this.error=""},toggleMulti(e,t,n){const r=Array.isArray(this.values[e])?this.values[e].slice():[],i=r.indexOf(t);n&&i===-1?r.push(t):!n&&i!==-1&&r.splice(i,1),this.values={...this.values,[e]:r}},validate(){for(const e of this.normalizedFields){if(!e.required)continue;const t=this.values[e.key];if(e.type!=="boolean"){if(e.type==="multiselect"){if(!Array.isArray(t)||t.length===0)return this.t("form.fieldRequired",{label:e.label});continue}if(t==null||t==="")return this.t("form.fieldRequired",{label:e.label})}}return""},async onSubmit(){if(this.readOnly||this.busy)return;const e=this.validate();if(e){this.error=e;return}this.error="",this.busy=!0;try{await this.$emit("submit",{values:this.values})}finally{this.busy=!1}}}},Sh={class:"wm-form"},xh={class:"wm-form__head"},Th={class:"wm-form__icon"},Mh={class:"wm-form__main"},Eh={class:"wm-form__title"},Oh={key:0,class:"wm-form__detail"},Ih=["for"],Lh={key:0,class:"wm-form__req","aria-hidden":"true"},Rh=["id","onUpdate:modelValue","placeholder","required","disabled"],Bh=["id","onUpdate:modelValue","placeholder","required","disabled"],Nh=["id","onUpdate:modelValue","placeholder","required","disabled"],Ph=["id","onUpdate:modelValue","required","disabled"],Fh={key:4,class:"wm-form__bool"},Dh=["id","onUpdate:modelValue","disabled"],jh=["id","onUpdate:modelValue","required","disabled"],Uh={value:"",disabled:""},Hh=["value"],$h={key:6,class:"wm-form__multi"},Vh=["value","checked","disabled","onChange"],Kh={key:0,class:"wm-form__err"},qh=["disabled"],Wh={key:0,class:"wm-form__spinner","aria-hidden":"true"},zh={key:2,class:"wm-form__doneLbl"};function Gh(e,t,n,r,i,s){const o=_e("AIAvatar");return p(),_("div",Sh,[u("div",xh,[u("div",Th,[ye(o,{size:24,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",Mh,[u("div",Eh,O(n.form.title||s.t("form.title")),1),n.form.description?(p(),_("div",Oh,O(n.form.description),1)):D("",!0)])]),u("form",{class:"wm-form__body",onSubmit:t[0]||(t[0]=yt((...a)=>s.onSubmit&&s.onSubmit(...a),["prevent"]))},[(p(!0),_(Z,null,Me(s.normalizedFields,a=>(p(),_("div",{key:a.key,class:"wm-form__field"},[u("label",{for:`wm-f-${i._uid}-${a.key}`,class:"wm-form__label"},[Qn(O(a.label),1),a.required?(p(),_("span",Lh,"*")):D("",!0)],8,Ih),a.type==="text"?it((p(),_("input",{key:0,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,type:"text",class:"wm-form__input",placeholder:a.placeholder||"",required:a.required,disabled:n.readOnly||i.busy},null,8,Rh)),[[Ot,i.values[a.key]]]):a.type==="textarea"?it((p(),_("textarea",{key:1,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,class:"wm-form__textarea",rows:"3",placeholder:a.placeholder||"",required:a.required,disabled:n.readOnly||i.busy},null,8,Bh)),[[Ot,i.values[a.key]]]):a.type==="number"?it((p(),_("input",{key:2,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,type:"number",class:"wm-form__input",placeholder:a.placeholder||"",required:a.required,disabled:n.readOnly||i.busy},null,8,Nh)),[[Ot,i.values[a.key],void 0,{number:!0}]]):a.type==="date"?it((p(),_("input",{key:3,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,type:"date",class:"wm-form__input",required:a.required,disabled:n.readOnly||i.busy},null,8,Ph)),[[Ot,i.values[a.key]]]):a.type==="boolean"?(p(),_("label",Fh,[it(u("input",{id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,type:"checkbox",disabled:n.readOnly||i.busy},null,8,Dh),[[Kl,i.values[a.key]]]),u("span",null,O(a.placeholder||s.t("common.yes")),1)])):a.type==="select"?it((p(),_("select",{key:5,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,class:"wm-form__select",required:a.required,disabled:n.readOnly||i.busy},[u("option",Uh,O(a.placeholder||s.t("form.choose")),1),(p(!0),_(Z,null,Me(a.options,l=>(p(),_("option",{key:l.value,value:l.value},O(l.label),9,Hh))),128))],8,jh)),[[ql,i.values[a.key]]]):a.type==="multiselect"?(p(),_("div",$h,[(p(!0),_(Z,null,Me(a.options,l=>(p(),_("label",{key:l.value,class:"wm-form__multiItem"},[u("input",{type:"checkbox",value:l.value,checked:Array.isArray(i.values[a.key])&&i.values[a.key].includes(l.value),disabled:n.readOnly||i.busy,onChange:f=>s.toggleMulti(a.key,l.value,f.target.checked)},null,40,Vh),u("span",null,O(l.label),1)]))),128))])):D("",!0)]))),128)),i.error?(p(),_("div",Kh,O(i.error),1)):D("",!0),n.readOnly?(p(),_("div",zh,O(s.t("form.responseSent")),1)):(p(),_("button",{key:1,type:"submit",class:"wm-form__submit",disabled:i.busy},[i.busy?(p(),_("span",Wh)):D("",!0),u("span",null,O(i.busy?s.t("common.sending"):n.form.submit_label||s.t("common.send")),1)],8,qh))],32)])}const Yh=we(Ah,[["render",Gh],["__scopeId","data-v-fe65cc56"]]),Jh={name:"WmFeedback",inject:{t:{default:()=>Ee()}},props:{busy:{type:Boolean,default:!1},done:{type:Boolean,default:!1}},emits:["submit"],data(){return{sel:null}},computed:{options(){return[{v:1,e:"😞",l:this.t("feedback.rating1")},{v:2,e:"😐",l:this.t("feedback.rating2")},{v:3,e:"🙂",l:this.t("feedback.rating3")},{v:4,e:"😄",l:this.t("feedback.rating4")},{v:5,e:"🤩",l:this.t("feedback.rating5")}]}},methods:{onSend(){!this.sel||this.busy||this.$emit("submit",{rating:this.sel})}}},Qh={class:"wm-fb"},Xh={class:"wm-fb__title"},Zh={class:"wm-fb__sub"},em={class:"wm-fb__row"},tm=["onClick"],nm={class:"wm-fb__emoji"},sm={class:"wm-fb__label"},rm=["disabled"],im={key:1,class:"wm-fb__done"},om={class:"wm-fb__doneTitle"},am={class:"wm-fb__doneSub"};function lm(e,t,n,r,i,s){return p(),_("div",Qh,[n.done?(p(),_("div",im,[t[1]||(t[1]=u("div",{class:"wm-fb__check"},[u("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#fff","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M20 6L9 17l-5-5"})])],-1)),u("div",om,O(s.t("feedback.doneTitle")),1),u("div",am,O(s.t("feedback.doneSubtitle")),1)])):(p(),_(Z,{key:0},[u("div",Xh,O(s.t("feedback.question")),1),u("div",Zh,O(s.t("feedback.subtitle")),1),u("div",em,[(p(!0),_(Z,null,Me(s.options,o=>(p(),_("button",{key:o.v,type:"button",class:re(["wm-fb__opt",{"is-selected":i.sel===o.v}]),onClick:a=>i.sel=o.v},[u("span",nm,O(o.e),1),u("span",sm,O(o.l),1)],10,tm))),128))]),u("button",{type:"button",class:"wm-fb__send",disabled:!i.sel||n.busy,onClick:t[0]||(t[0]=(...o)=>s.onSend&&s.onSend(...o))},O(n.busy?s.t("common.sending"):s.t("feedback.submit")),9,rm)],64))])}const cm=we(Jh,[["render",lm],["__scopeId","data-v-9b630564"]]),um={name:"WmMoreMenu",inject:{t:{default:()=>Ee()}},props:{canRename:{type:Boolean,default:!0},canExport:{type:Boolean,default:!0},soundEnabled:{type:Boolean,default:!0},browserNotifEnabled:{type:Boolean,default:!1},statusUrl:{type:String,default:""},helpUrl:{type:String,default:""}},emits:["close","action","sound-toggle","browser-notif-toggle"],data(){return{soundOn:this.soundEnabled,browserNotifOn:this.browserNotifEnabled}},watch:{soundEnabled(e){this.soundOn=!!e},browserNotifEnabled(e){this.browserNotifOn=!!e}},methods:{emit(e){this.$emit("action",e)},toggleSound(){this.soundOn=!this.soundOn,this.$emit("sound-toggle",this.soundOn)},toggleBrowserNotif(){this.browserNotifOn=!this.browserNotifOn,this.$emit("browser-notif-toggle",this.browserNotifOn)}}},dm={class:"wm-mm"},fm={class:"wm-mm__pop",role:"menu"},hm={key:0,class:"wm-mm__section"},mm={class:"wm-mm__label"},pm={class:"wm-mm__label"},gm={key:1,class:"wm-mm__sep"},_m={class:"wm-mm__section"},ym={class:"wm-mm__label"},vm={class:"wm-mm__label"},bm={class:"wm-mm__section"},wm={class:"wm-mm__label"},km={class:"wm-mm__label"};function Cm(e,t,n,r,i,s){return p(),_("div",dm,[u("div",{class:"wm-mm__scrim",onClick:t[0]||(t[0]=o=>e.$emit("close"))}),u("div",fm,[n.canRename||n.canExport?(p(),_("div",hm,[n.canRename?(p(),_("button",{key:0,type:"button",class:"wm-mm__item",onClick:t[1]||(t[1]=o=>s.emit("rename"))},[t[7]||(t[7]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M12 20h9"}),u("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"})])],-1)),u("span",mm,O(s.t("moreMenu.editTitle")),1)])):D("",!0),n.canExport?(p(),_("button",{key:1,type:"button",class:"wm-mm__item",onClick:t[2]||(t[2]=o=>s.emit("export"))},[t[8]||(t[8]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13"})])],-1)),u("span",pm,O(s.t("moreMenu.exportTranscript")),1),t[9]||(t[9]=u("span",{class:"wm-mm__hint"},".txt",-1))])):D("",!0)])):D("",!0),n.canRename||n.canExport?(p(),_("div",gm)):D("",!0),u("div",_m,[u("button",{type:"button",class:"wm-mm__item",onClick:t[3]||(t[3]=(...o)=>s.toggleSound&&s.toggleSound(...o))},[t[11]||(t[11]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M11 5L6 9H2v6h4l5 4V5z"}),u("path",{d:"M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14"})])],-1)),u("span",ym,O(s.t("moreMenu.sound")),1),u("span",{class:re(["wm-mm__toggle",{"wm-mm__toggle--on":i.soundOn}])},[...t[10]||(t[10]=[u("span",{class:"wm-mm__knob"},null,-1)])],2)]),u("button",{type:"button",class:"wm-mm__item",onClick:t[4]||(t[4]=(...o)=>s.toggleBrowserNotif&&s.toggleBrowserNotif(...o))},[t[13]||(t[13]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0118 14.2V11a6 6 0 10-12 0v3.2c0 .5-.2 1-.6 1.4L4 17h5m6 0a3 3 0 11-6 0"})])],-1)),u("span",vm,O(s.t("moreMenu.browserNotifications")),1),u("span",{class:re(["wm-mm__toggle",{"wm-mm__toggle--on":i.browserNotifOn}])},[...t[12]||(t[12]=[u("span",{class:"wm-mm__knob"},null,-1)])],2)])]),t[16]||(t[16]=u("div",{class:"wm-mm__sep"},null,-1)),u("div",bm,[n.statusUrl?(p(),_("button",{key:0,type:"button",class:"wm-mm__item",onClick:t[5]||(t[5]=o=>s.emit("status"))},[t[14]||(t[14]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM10 6v4l3 2"})])],-1)),u("span",wm,O(s.t("moreMenu.serviceStatus")),1)])):D("",!0),n.helpUrl?(p(),_("button",{key:1,type:"button",class:"wm-mm__item",onClick:t[6]||(t[6]=o=>s.emit("help"))},[t[15]||(t[15]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M9 11a3 3 0 116 0c0 2-3 2-3 5M12 19h.01M12 22a10 10 0 110-20 10 10 0 010 20z"})])],-1)),u("span",km,O(s.t("moreMenu.helpCenter")),1)])):D("",!0)])])])}const Am=we(um,[["render",Cm],["__scopeId","data-v-76281e95"]]),Sm={name:"WmRenameDialog",inject:{t:{default:()=>Ee()}},props:{title:{type:String,default:""},initialValue:{type:String,default:""},placeholder:{type:String,default:""}},emits:["close","submit"],data(){return{value:this.initialValue||""}},computed:{canSubmit(){const e=(this.value||"").trim();return!!e&&e!==(this.initialValue||"").trim()}},mounted(){this.$nextTick(()=>{const e=this.$refs.input;if(e){e.focus();try{e.select()}catch{}}})},methods:{onSubmit(){this.canSubmit&&this.$emit("submit",this.value.trim())}}},xm={class:"wm-dialog"},Tm={class:"wm-dialog__card",role:"dialog","aria-modal":"true"},Mm={class:"wm-dialog__head"},Em={class:"wm-dialog__title"},Om=["aria-label"],Im={class:"wm-dialog__body"},Lm=["placeholder"],Rm={class:"wm-dialog__actions"},Bm=["disabled"];function Nm(e,t,n,r,i,s){return p(),_("div",xm,[u("div",{class:"wm-dialog__scrim",onClick:t[0]||(t[0]=o=>e.$emit("close"))}),u("div",Tm,[u("div",Mm,[u("div",Em,O(n.title||s.t("rename.title")),1),u("button",{type:"button",class:"wm-dialog__close","aria-label":s.t("common.close"),onClick:t[1]||(t[1]=o=>e.$emit("close"))},[...t[7]||(t[7]=[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Om)]),u("div",Im,[it(u("input",{ref:"input","onUpdate:modelValue":t[2]||(t[2]=o=>i.value=o),type:"text",class:"wm-dialog__input",placeholder:n.placeholder||s.t("rename.placeholder"),maxlength:120,onKeydown:[t[3]||(t[3]=Pn(yt((...o)=>s.onSubmit&&s.onSubmit(...o),["prevent"]),["enter"])),t[4]||(t[4]=Pn(yt(o=>e.$emit("close"),["prevent"]),["esc"]))]},null,40,Lm),[[Ot,i.value]])]),u("div",Rm,[u("button",{type:"button",class:"wm-dialog__btn",onClick:t[5]||(t[5]=o=>e.$emit("close"))},O(s.t("common.cancel")),1),u("button",{type:"button",class:"wm-dialog__btn wm-dialog__btn--primary",disabled:!s.canSubmit,onClick:t[6]||(t[6]=(...o)=>s.onSubmit&&s.onSubmit(...o))},O(s.t("common.save")),9,Bm)])])])}const Pm=we(Sm,[["render",Nm],["__scopeId","data-v-6d5f94a8"]]),qr="ww-messenger-tokens",Fm={name:"Messenger",components:{Launcher:zc,Header:yu,Onboarding:Zu,MessageList:$f,Composer:lh,SuggestionChips:fh,ApprovalCard:kh,FormCard:Yh,Feedback:cm,MoreMenu:Am,RenameDialog:Pm},mixins:[_c,Cc,Ac,xc],provide(){return{signAttachmentFn:e=>{var t,n;return((n=(t=this.store)==null?void 0:t.signAttachment)==null?void 0:n.call(t,e))||null},t:(e,t)=>this.t(e,t),wmLocale:()=>this.locale}},props:{baseUrl:{type:String,default:cc},widgetId:{type:String,default:""},context:{type:Object,default:null},displayMode:{type:String,default:"floating"},devtools:{type:Boolean,default:!1},language:{type:String,default:""}},data(){return{transport:null,store:null,isOpen:!1,draft:"",busy:!1,bootError:null,pendingAttachments:[],feedbackBusy:!1,feedbackDone:!1,convOpenedAt:0,moreOpen:!1,renameDialogOpen:!1,draftConv:null,activeConvId:null,showOnboarding:!1,dismissedPeeks:{},floatHeight:0,floatRO:null,parentOrigin:"",parentToken:"",parentInitReceived:!1,parentInitDeferred:null}},computed:{isEditor(){return!!this.devtools},isEmbedded(){return this.displayMode==="embedded"},customerLanguage(){var n,r,i,s;const e=(n=this.s)==null?void 0:n.customer,t=e&&(e.language||((r=e.values)==null?void 0:r.language));return t||((s=(i=this.context)==null?void 0:i.customer)==null?void 0:s.language)||""},locale(){var e;return Ws(this.language||this.customerLanguage||((e=this.widget)==null?void 0:e.default_language)||"")},translator(){return Ee(this.locale)},error(){var e;return this.bootError||((e=this.s)==null?void 0:e.error)||null},canBoot(){return!!(this.baseUrl&&this.widgetId)},s(){var e;return((e=this.store)==null?void 0:e.state)||null},ready(){var e;return!!((e=this.s)!=null&&e.ready)},allConversations(){var t;const e=(t=this.s)==null?void 0:t.conversations;return Array.isArray(e)?e:[]},drawerConversations(){var n;const e=((n=this.s)==null?void 0:n.messagesByConv)||{},t=this.revealedAt;return this.allConversations.map(r=>{var f;const i=e[r.id]||[],s=vt(r.last_read_message_id);let o=0,a=null;for(let c=i.length-1;c>=0;c--){const g=i[c];if(!g)continue;if(((f=g.author)==null?void 0:f.type)==="user")break;const S=vt(g.id);if(S!=null){if(s!=null&&S<=s)break;t[g.id]!==0&&(!a&&g.author&&(a=g.author),o++)}}const l=i.filter(c=>!((c==null?void 0:c.id)!=null&&t[c.id]===0));return{...r,_preview:hc(r,l),_unread:o>0,_unreadCount:o,_lastAuthor:a}})},unreadCount(){return this.drawerConversations.filter(e=>e._unread).length},openThreads(){var t;const e=((t=this.s)==null?void 0:t.messagesByConv)||{};return this.drawerConversations.filter(n=>n.status!=="resolved").map(n=>({id:n.id,title:n.name||this.t("common.newConversation"),preview:n._preview||this.t("onboarding.newMessage"),unread:!!n._unread,_ts:Hr(n,e[n.id]||[])})).sort((n,r)=>n._ts<r._ts?1:n._ts>r._ts?-1:0)},latestUnreads(){var n;const e=((n=this.s)==null?void 0:n.messagesByConv)||{},t=[];for(const r of this.drawerConversations){if(!r._unread)continue;const i=Hr(r,e[r.id]||[]),s=r._lastAuthor,o=!s||s.type==="agent_ia",a=(s==null?void 0:s.name)||(o?this.agentName:"")||"",l=(s==null?void 0:s.avatar_url)||(o?this.agentAvatarUrl:null);t.push({convId:r.id,preview:r._preview||this.t("notification.youHaveNewMessage"),ts:i,count:r._unreadCount||1,senderName:a,senderAvatarUrl:l})}return t.sort((r,i)=>r.ts<i.ts?1:r.ts>i.ts?-1:0),t},launcherPeeks(){if(this.isOpen||this.isEmbedded)return[];const e=this.dismissedPeeks||{};return this.latestUnreads.filter(t=>e[t.convId]!==t.ts)},isViewingThread(){return(this.isOpen||this.isEmbedded)&&!!this.currentConv},currentConv(){if(this.draftConv)return this.draftConv;if(this.showOnboarding)return null;const e=this.allConversations;if(!e.length)return null;if(this.activeConvId!=null){const t=e.find(n=>n.id===this.activeConvId);if(t)return t}return e[0]||null},canBack(){return!!this.currentConv},statusUrl(){var n;const e=(n=this.widget)==null?void 0:n.quick_links;if(!Array.isArray(e))return"";const t=e.find(r=>r.icon==="status"&&r.url);return(t==null?void 0:t.url)||""},helpUrl(){var n;const e=(n=this.widget)==null?void 0:n.quick_links;if(!Array.isArray(e))return"";const t=e.find(r=>(r.icon==="chat"||r.icon==="help")&&r.url);return(t==null?void 0:t.url)||""},widget(){var e,t;return((t=(e=this.s)==null?void 0:e.config)==null?void 0:t.widget)||null},widgetWelcomeMessage(){var e;return((e=this.widget)==null?void 0:e.welcome_message)||""},widgetSubtitle(){var e;return((e=this.widget)==null?void 0:e.subtitle)||""},defaultIconUrl(){var e;return((e=this.widget)==null?void 0:e.default_icon_url)||null},agentName(){var e,t,n;return((n=(t=(e=this.s)==null?void 0:e.config)==null?void 0:t.agent)==null?void 0:n.name)||""},agentAvatarUrl(){var e,t,n;return((n=(t=(e=this.s)==null?void 0:e.config)==null?void 0:t.agent)==null?void 0:n.avatar_url)||null},quickLinks(){var t;const e=(t=this.widget)==null?void 0:t.quick_links;return Array.isArray(e)?e:[]},teamMembers(){var t;const e=(t=this.widget)==null?void 0:t.team_members;return Array.isArray(e)?e:[]},responseLabel(){var e;return((e=this.widget)==null?void 0:e.response_time_label)||""},humanMessageAuthor(){var t,n,r;if(!this.currentConv)return null;const e=((t=this.s.messagesByConv)==null?void 0:t[this.currentConv.id])||[];for(let i=e.length-1;i>=0;i--)if(((r=(n=e[i])==null?void 0:n.author)==null?void 0:r.type)==="agent_human")return e[i].author;return null},humanAgentName(){var e;return((e=this.humanMessageAuthor)==null?void 0:e.name)||""},humanAgentAvatarUrl(){var e;return((e=this.humanMessageAuthor)==null?void 0:e.avatar_url)||null},isEscalated(){return!!this.humanMessageAuthor},isWaitingHuman(){var t;const e=(t=this.currentConv)==null?void 0:t.status;return e==="waiting"||e==="handled"},headerTitle(){var e,t;return((e=this.currentConv)==null?void 0:e.name)||((t=this.widget)==null?void 0:t.name)||this.t("common.newConversation")},composerPlaceholder(){return this.isEscalated&&this.humanAgentName?this.t("composer.replyTo",{name:this.humanAgentName.split(" ")[0]}):this.isWaitingHuman?this.t("composer.agentTakingOver"):this.t("composer.placeholder")},displayedMessages(){var n,r;const e=this.currentConv;if(!e)return[];if(!e._draft){const i=(r=(n=this.s)==null?void 0:n.paginationByConv)==null?void 0:r[e.id];if(!(i!=null&&i.loaded))return[]}const t=this.revealedAt;return(this.s.messagesByConv[e.id]||[]).filter(i=>{var s,o,a,l,f;return(i==null?void 0:i.type)==="action"&&((s=i==null?void 0:i.payload)==null?void 0:s.state)==="pending"||gn(i)&&!(t[i.id]>0)?!1:(i==null?void 0:i.type)==="action"||(i==null?void 0:i.type)==="system"||((o=i==null?void 0:i.payload)==null?void 0:o.type)==="system"||Array.isArray((a=i==null?void 0:i.payload)==null?void 0:a.attachments)&&i.payload.attachments.length||(l=i==null?void 0:i.metadata)!=null&&l.artifact||(f=i==null?void 0:i.metadata)!=null&&f.form?!0:typeof(i==null?void 0:i.text_md)=="string"&&i.text_md.trim().length>0})},streamingActive(){var n,r,i;const e=this.currentConv;return e?Object.keys(((n=this.s)==null?void 0:n.streamingByMsgId)||{}).length>0?!0:this.actionInFlight?!1:(((i=(r=this.s)==null?void 0:r.messagesByConv)==null?void 0:i[e.id])||[]).some(s=>gn(s)&&!(this.revealedAt[s.id]>0)):!1},currentConvMessages(){var t,n,r;const e=(t=this.currentConv)==null?void 0:t.id;return e?((r=(n=this.s)==null?void 0:n.messagesByConv)==null?void 0:r[e])||[]:[]},pendingApproval(){return!this.currentConv||!this.store||this.actionInFlight?null:this.store.getPendingApproval(this.currentConv.id)},approvalReady(){return this.pendingApproval?this.pendingApproval.id===this.approvalLatchId?!0:!(this.streamingActive||!this.approvalSettled):!1},approvalTitle(){var e,t,n;return((t=(e=this.pendingApproval)==null?void 0:e.payload)==null?void 0:t.name)||((n=this.pendingApproval)==null?void 0:n.text_md)||this.t("action.title")},approvalDetail(){var r,i,s,o,a,l;const e=(s=(i=(r=this.pendingApproval)==null?void 0:r.payload)==null?void 0:i.pending)==null?void 0:s.user_explanation;if(typeof e=="string"&&e.trim())return e.trim();const t=(l=(a=(o=this.pendingApproval)==null?void 0:o.payload)==null?void 0:a.pending)==null?void 0:l.prepared_params;if(!t||typeof t!="object")return"";const n=Object.entries(t);return n.length?n.slice(0,2).map(([f,c])=>`${f}: ${c}`).join(" · "):""},actionInFlight(){var e,t;return!this.currentConv||!this.store?null:((t=(e=this.store).getActionInFlight)==null?void 0:t.call(e,this.currentConv.id))||null},actionInFlightName(){var t;const e=this.actionInFlight;return e?((t=e.payload)==null?void 0:t.name)||e.text_md||this.t("common.action"):""},suggestions(){return!this.currentConv||!this.store?[]:this.streamingActive?[]:this.pendingForm?[]:this.store.getLatestSuggestions(this.currentConv.id)},pendingForm(){var e,t;return!this.currentConv||!this.store||this.pendingApproval||this.actionInFlight||this.streamingActive||!this.approvalSettled?null:((t=(e=this.store).getLatestForm)==null?void 0:t.call(e,this.currentConv.id))||null},showFeedback(){var t;const e=this.currentConv;return e?this.feedbackDone?!0:e.status!=="resolved"?!1:!((t=e.metadata)!=null&&t.feedback):!1},floatVisible(){return this.approvalReady||!!this.pendingForm||this.showFeedback||this.suggestions.length>0},dateLabel(){var n,r,i;const e=this.currentConv;let t=new Date;if(e){const o=((i=(((r=(n=this.s)==null?void 0:n.messagesByConv)==null?void 0:r[e.id])||[]).find(a=>a==null?void 0:a.created_at))==null?void 0:i.created_at)||e.created_at;if(o){const a=new Date(o);Number.isNaN(a.getTime())||(t=a)}}return this.t("messageList.today",{time:po(t,bn(this.locale))})},paginationState(){var n,r,i;const e=(n=this.currentConv)==null?void 0:n.id,t=e?(i=(r=this.s)==null?void 0:r.paginationByConv)==null?void 0:i[e]:null;return{loading:!!(t!=null&&t.loading),hasMore:!!(t!=null&&t.nextCursor)}}},watch:{latestUnreads:{handler(e){const t=new Set(e.map(o=>o.convId)),n=this.dismissedPeeks||{},r=Object.keys(n);if(!r.length)return;const i={};let s=!1;for(const o of r)t.has(o)?i[o]=n[o]:s=!0;s&&(this.dismissedPeeks=i)},deep:!0},"currentConv.id":{handler(e){var t;this.resetRevealQueue(),this.convOpenedAt=Date.now(),this.moreOpen=!1,this.renameDialogOpen=!1,this.resetApprovalPacing(),this.isViewingThread&&(this.unreadAnchorId=vt((t=this.currentConv)==null?void 0:t.last_read_message_id),this.unreadBoundaryTs=e?new Date().toISOString():"")},immediate:!0},isViewingThread(e,t){var n;e&&!t?(this.unreadAnchorId=vt((n=this.currentConv)==null?void 0:n.last_read_message_id),this.unreadBoundaryTs=new Date().toISOString()):e||(this.unreadAnchorId=null,this.unreadBoundaryTs="")},pendingApproval:{handler(e,t){if(e&&!t){const n=e!=null&&e.created_at?Date.parse(e.created_at):NaN;if(!(Number.isFinite(n)&&n>=this.convOpenedAt)){this.resetApprovalPacing();return}this.bumpApprovalSettle(2600)}else!e&&t&&this.resetApprovalPacing()},immediate:!1},streamingActive(e,t){e!==t&&this.pendingApproval&&this.pendingApproval.id!==this.approvalLatchId&&this.bumpApprovalSettle()},approvalReady(e){e&&this.pendingApproval&&(this.approvalLatchId=this.pendingApproval.id)},floatVisible:{handler(e){this.$nextTick(()=>this.syncFloatObserver(e))},immediate:!0},currentConvMessages(e){var t;this.paceMessages(e,(t=this.currentConv)==null?void 0:t.id),(this.isOpen||this.isEmbedded)&&this.currentConv&&this.markConvRead(this.currentConv)}},async mounted(){if(typeof document<"u"&&!document.getElementById(qr)){const e=document.createElement("style");e.id=qr,e.textContent=go,document.head.appendChild(e)}this._parentMessageHandler=this.onParentMessage.bind(this),window.addEventListener("message",this._parentMessageHandler),window.parent&&window.parent!==window&&window.parent.postMessage({type:"READY"},"*"),this.isEmbedded&&(await this.boot(),this.store&&await this.open())},beforeUnmount(){this._parentMessageHandler&&(window.removeEventListener("message",this._parentMessageHandler),this._parentMessageHandler=null),this.cancelReveals(),this.teardownLiveReveal(),this.disconnectFloatRO(),this.resetApprovalPacing(),this.teardownNotifications(),this.store&&this.store.destroy()},methods:{t(e,t){return this.translator(e,t)},waitForParentInit(){if(this.parentInitReceived)return Promise.resolve();if(!this.parentInitDeferred){let e;this.parentInitDeferred=new Promise(t=>{e=t}),this.parentInitDeferred._resolve=e}return this.parentInitDeferred},onParentMessage(e){var n;const t=e==null?void 0:e.data;!t||typeof t!="object"||t.type!=="INIT"||(this.parentOrigin=e.origin,this.parentToken=typeof t.token=="string"?t.token:"",this.parentInitReceived=!0,(n=this.parentInitDeferred)!=null&&n._resolve&&this.parentInitDeferred._resolve())},async boot(){var e;if(!this.canBoot){console.warn("[messenger] boot skipped — missing creds");return}try{await this.waitForParentInit(),this.transport=ks(rc({baseUrl:this.baseUrl,widgetId:this.widgetId})),this.store=ks(lc(this.transport)),this.hydrateNotifPref();const t=(e=this.context)==null?void 0:e.customer;t&&typeof t=="object"&&await this.store.applyCustomer(t),await this.store.start({origin:this.parentOrigin,token:this.parentToken||void 0}),this.setupLiveReveal()}catch(t){console.error("[ww-messenger] bootstrap failed",t),this.bootError=(t==null?void 0:t.message)||String(t)}},async refresh(){this.store&&this.store.destroy(),this.cancelReveals(),this.teardownLiveReveal(),this.teardownNotifications(),this.convOpenedAt=0,this.transport=null,this.store=null,this.isOpen=!1,this.draft="",this.busy=!1,this.bootError=null,this.pendingAttachments=[],this.feedbackBusy=!1,this.feedbackDone=!1,this.moreOpen=!1,this.renameDialogOpen=!1,this.draftConv=null,this.activeConvId=null,this.showOnboarding=!1,await this.boot(),this.isEmbedded&&this.store&&await this.open()},syncFloatObserver(e){if(this.disconnectFloatRO(),!e){this.floatHeight=0;return}const t=this.$refs.floatEl;if(t){if(typeof ResizeObserver>"u"){this.floatHeight=Math.ceil(t.getBoundingClientRect().height+8);return}this.floatRO=new ResizeObserver(n=>{const r=n[0];if(!r)return;const i=Math.ceil(r.contentRect.height+8);i!==this.floatHeight&&(this.floatHeight=i,this.$nextTick(()=>{var s,o;(o=(s=this.$refs.messageList)==null?void 0:s.scrollToBottom)==null||o.call(s)}))}),this.floatRO.observe(t)}},disconnectFloatRO(){if(this.floatRO){try{this.floatRO.disconnect()}catch{}this.floatRO=null}},async open(){this.isOpen=!0,this.store||await this.boot(),this.store&&this.store.setPanelOpen(!0);const e=this.currentConv;if(e&&!e._draft){this.activeConvId==null&&(this.activeConvId=e.id);try{await this.store.openConversation(e.id)}catch(t){console.error("[ww-messenger] load messages failed",t)}this.markConvRead(e)}},close(){this.isOpen=!1,this.store&&this.store.setPanelOpen(!1)},async openFromPeek(e){var n,r;const t=e||((n=this.latestUnreads[0])==null?void 0:n.convId);t&&t!==((r=this.currentConv)==null?void 0:r.id)&&(this.draftConv=null,this.activeConvId=t,this.showOnboarding=!1),await this.open()},dismissPeek(e){const t=this.latestUnreads.find(n=>n.convId===e);t&&(this.dismissedPeeks={...this.dismissedPeeks,[e]:t.ts})},startConv(){this.draftConv={id:"__draft__",_draft:!0,name:"",created_at:new Date().toISOString()},this.activeConvId=null,this.showOnboarding=!1,this.focusComposer()},async ensureRealConv(){const e=this.currentConv;if(!e)return null;if(!e._draft)return e;if(this.busy)return null;this.busy=!0;try{const t=await this.store.createConversation({});return this.draftConv=null,this.activeConvId=t.id,await this.store.openConversation(t.id),this.markConvRead(t),t}catch(t){return console.error("[ww-messenger] create conv failed",t),this.bootError=(t==null?void 0:t.message)||String(t),null}finally{this.busy=!1}},focusComposer(){this.$nextTick(()=>{var e;return(e=this.$refs.composer)==null?void 0:e.focus()})},toggleMore(){this.moreOpen=!this.moreOpen},goHome(){this.moreOpen=!1,this.draftConv=null,this.activeConvId=null,this.showOnboarding=!0},async onDrawerPick(e){if(!(e!=null&&e.id)||!this.store)return;this.draftConv=null,this.activeConvId=e.id,this.showOnboarding=!1;try{await this.store.openConversation(e.id)}catch(n){console.error("[ww-messenger] open conv failed",n)}const t=this.allConversations.find(n=>n.id===e.id);t&&this.markConvRead(t)},async onMoreAction(e){var t,n;switch(this.moreOpen=!1,e){case"rename":this.openRenameDialog();break;case"export":gc(this.currentConv,this.currentConv?(n=(t=this.s)==null?void 0:t.messagesByConv)==null?void 0:n[this.currentConv.id]:[],this.translator,this.locale);break;case"status":if(this.statusUrl)try{window.open(this.statusUrl,"_blank","noopener")}catch{}break;case"help":if(this.helpUrl)try{window.open(this.helpUrl,"_blank","noopener")}catch{}break}},openRenameDialog(){const e=this.currentConv;!e||e._draft||(this.renameDialogOpen=!0)},async onRenameSubmit(e){const t=this.currentConv;if(this.renameDialogOpen=!1,!t||t._draft||!this.store)return;const n=(e||"").trim();if(!(!n||n===t.name))try{await this.store.patchConversation(t.id,{name:n})}catch(r){console.error("[ww-messenger] rename failed",r)}},async onSend(e){let t=this.currentConv;if(!t&&(this.startConv(),t=this.currentConv,!t)||t._draft&&(t=await this.ensureRealConv(),!t))return;const n=t.id,r=this.pendingAttachments.slice();this.pendingAttachments=[],this.unreadAnchorId=null,this.unreadBoundaryTs="",await this.store.send(n,e,{attachments:r.length?r:void 0})},async onSuggestion(e){const t=e==null?void 0:e.label;t&&await this.onSend(t)},async onLoadMore(){var t;const e=(t=this.currentConv)==null?void 0:t.id;!e||!this.store||await this.store.loadMore(e)},async onApprovalCallback(e){const t=this.pendingApproval;t&&await this.store.clickCallback(t.id,e)},async onFormSubmit({values:e}){const t=this.pendingForm;if(!(t!=null&&t.form))return;const n=dc(t.form,e,this.translator);if(!n)return;let r=this.currentConv;r&&(r._draft&&(r=await this.ensureRealConv(),!r)||await this.store.send(r.id,n,{metadata:{artifact:fc(t.form,e,this.translator)}}))},async onAttach(e){if(!(!e||!this.transport))try{const t=await this.transport.uploadAttachment(e);this.pendingAttachments.push({type:t.type||"file",path:t.path,name:e.name||this.t("attachment.fileFallbackName"),mime_type:e.type,size_bytes:e.size})}catch(t){console.error("[ww-messenger] attachment upload failed",t)}},async onQuickLink(e){if(e){if(e.url){try{window.open(e.url,"_blank","noopener")}catch{}return}this.currentConv||this.startConv(),await this.onSend(e.label)}},async onFeedback({rating:e,comment:t}){if(this.currentConv){this.feedbackBusy=!0;try{await this.store.submitFeedback(this.currentConv.id,{rating:e,comment:t}),this.feedbackDone=!0}catch(n){console.error("[ww-messenger] feedback failed",n)}finally{this.feedbackBusy=!1}}}}},Dm={key:0,class:"wm-loading","aria-busy":"true","aria-live":"polite"},jm=["aria-label"],Um={key:0,class:"wm-state"},Hm={class:"wm-state__err"},$m={class:"wm-state__errTitle"},Vm={class:"wm-state__errSub"},Km={class:"wm-bottom"},qm={key:0,ref:"floatEl",class:"wm-float"},Wm={key:1,class:"wm-actionWait",role:"status","aria-live":"polite"},zm={class:"wm-actionWait__lbl"},Gm={key:2,class:"wm-attached"},Ym=["aria-label","onClick"];function Jm(e,t,n,r,i,s){const o=_e("Launcher"),a=_e("Header"),l=_e("Onboarding"),f=_e("MessageList"),c=_e("ApprovalCard"),g=_e("FormCard"),S=_e("Feedback"),A=_e("SuggestionChips"),K=_e("Composer"),I=_e("MoreMenu"),Q=_e("RenameDialog");return p(),_("div",{class:re(["wm-root",`wm-root--${n.displayMode}`])},[!i.isOpen&&!s.isEmbedded?(p(),be(o,{key:0,"unread-count":s.unreadCount,peeks:s.launcherPeeks,onOpen:s.openFromPeek,onDismiss:s.dismissPeek},null,8,["unread-count","peeks","onOpen","onDismiss"])):D("",!0),i.isOpen||s.isEmbedded?(p(),_("section",{key:1,class:re(["wm-panel",`wm-panel--${n.displayMode}`,{"wm-panel--welcome":s.ready&&!s.error&&!s.currentConv}]),style:je(i.floatHeight?{"--wm-float-h":i.floatHeight+"px"}:null),role:"dialog","aria-label":"Messenger"},[!s.ready&&!s.error?(p(),_("div",Dm,[s.isEmbedded?D("",!0):(p(),_("button",{key:0,type:"button",class:"wm-loading__close","aria-label":s.t("loading.minimize"),onClick:t[0]||(t[0]=(...z)=>s.close&&s.close(...z))},[...t[5]||(t[5]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,jm)),t[6]||(t[6]=u("div",{class:"wm-loading__spinner","aria-hidden":"true"},null,-1))])):(p(),_(Z,{key:1},[ye(a,{title:s.headerTitle,"team-members":s.teamMembers,"response-label":s.responseLabel,"show-identity":!!s.currentConv,"show-back":s.canBack,"show-close":!s.isEmbedded,"more-active":i.moreOpen,"agent-name":s.agentName,"agent-avatar-url":s.agentAvatarUrl,onBack:s.goHome,onMore:s.toggleMore,onClose:s.close},null,8,["title","team-members","response-label","show-identity","show-back","show-close","more-active","agent-name","agent-avatar-url","onBack","onMore","onClose"]),s.error?(p(),_("div",Um,[u("div",Hm,[t[7]||(t[7]=u("div",{class:"wm-state__errIcon"},[u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})])],-1)),u("div",null,[u("div",$m,O(s.t("error.connectionFailed")),1),u("div",Vm,O(s.error),1)])])])):s.currentConv?(p(),_(Z,{key:2},[ye(f,{ref:"messageList",messages:s.displayedMessages,"streaming-active":s.streamingActive,"date-label":s.dateLabel,"conversation-id":s.currentConv?s.currentConv.id:null,"loading-more":s.paginationState.loading,"has-more":s.paginationState.hasMore,"unread-anchor-id":e.unreadAnchorId,"unread-boundary-ts":e.unreadBoundaryTs,"ai-agent-name":s.agentName,"ai-agent-avatar-url":s.agentAvatarUrl,onLoadMore:s.onLoadMore},null,8,["messages","streaming-active","date-label","conversation-id","loading-more","has-more","unread-anchor-id","unread-boundary-ts","ai-agent-name","ai-agent-avatar-url","onLoadMore"]),u("div",Km,[s.floatVisible?(p(),_("div",qm,[s.approvalReady?(p(),be(c,{key:0,action:s.approvalTitle,detail:s.approvalDetail,callbacks:s.pendingApproval.callbacks,"agent-name":s.agentName,"agent-avatar-url":s.agentAvatarUrl,onCallback:s.onApprovalCallback},null,8,["action","detail","callbacks","agent-name","agent-avatar-url","onCallback"])):s.pendingForm?(p(),be(g,{key:s.pendingForm.message&&s.pendingForm.message.id,form:s.pendingForm.form,"agent-name":s.agentName,"agent-avatar-url":s.agentAvatarUrl,onSubmit:s.onFormSubmit},null,8,["form","agent-name","agent-avatar-url","onSubmit"])):s.showFeedback?(p(),be(S,{key:2,busy:i.feedbackBusy,done:i.feedbackDone,onSubmit:s.onFeedback},null,8,["busy","done","onSubmit"])):(p(),be(A,{key:3,items:s.suggestions,onSelect:s.onSuggestion},null,8,["items","onSelect"]))],512)):D("",!0),s.actionInFlight?(p(),_("div",Wm,[t[8]||(t[8]=u("span",{class:"wm-actionWait__spinner","aria-hidden":"true"},null,-1)),u("span",zm,O(s.t("action.inProgress",{name:s.actionInFlightName})),1)])):(p(),be(K,{key:2,ref:"composer",modelValue:i.draft,"onUpdate:modelValue":t[1]||(t[1]=z=>i.draft=z),placeholder:s.composerPlaceholder,disabled:!!s.pendingApproval,"attach-label":s.t("composer.attachFile"),onSend:s.onSend,onAttach:s.onAttach},null,8,["modelValue","placeholder","disabled","attach-label","onSend","onAttach"]))]),i.moreOpen?(p(),be(I,{key:0,"can-rename":!!s.currentConv&&!s.currentConv._draft,"can-export":!!s.currentConv&&!s.currentConv._draft,"sound-enabled":e.soundEnabled,"browser-notif-enabled":e.browserNotifEnabled,"status-url":s.statusUrl,"help-url":s.helpUrl,onClose:t[2]||(t[2]=z=>i.moreOpen=!1),onSoundToggle:e.onSoundToggle,onBrowserNotifToggle:e.onBrowserNotifToggle,onAction:s.onMoreAction},null,8,["can-rename","can-export","sound-enabled","browser-notif-enabled","status-url","help-url","onSoundToggle","onBrowserNotifToggle","onAction"])):D("",!0),i.renameDialogOpen&&s.currentConv&&!s.currentConv._draft?(p(),be(Q,{key:1,"initial-value":s.currentConv.name||"",title:s.t("rename.dialogTitle"),onClose:t[3]||(t[3]=z=>i.renameDialogOpen=!1),onSubmit:s.onRenameSubmit},null,8,["initial-value","title","onSubmit"])):D("",!0),i.pendingAttachments.length?(p(),_("div",Gm,[(p(!0),_(Z,null,Me(i.pendingAttachments,(z,q)=>(p(),_("div",{key:q,class:"wm-attached__chip"},[t[10]||(t[10]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})],-1)),u("span",null,O(z.name),1),u("button",{type:"button","aria-label":s.t("attachment.remove"),onClick:X=>i.pendingAttachments.splice(q,1)},[...t[9]||(t[9]=[u("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Ym)]))),128))])):D("",!0)],64)):(p(),be(l,{key:1,"welcome-message":s.widgetWelcomeMessage,subtitle:s.widgetSubtitle,"agent-name":s.agentName,"default-icon-url":s.defaultIconUrl,"quick-links":s.quickLinks,"open-threads":s.openThreads,busy:i.busy,onStart:s.startConv,onSelect:s.onQuickLink,onResume:s.onDrawerPick},null,8,["welcome-message","subtitle","agent-name","default-icon-url","quick-links","open-threads","busy","onStart","onSelect","onResume"])),i.moreOpen&&!s.currentConv?(p(),be(I,{key:3,"can-rename":!1,"can-export":!1,"sound-enabled":e.soundEnabled,"browser-notif-enabled":e.browserNotifEnabled,"status-url":s.statusUrl,"help-url":s.helpUrl,onClose:t[4]||(t[4]=z=>i.moreOpen=!1),onSoundToggle:e.onSoundToggle,onBrowserNotifToggle:e.onBrowserNotifToggle,onAction:s.onMoreAction},null,8,["sound-enabled","browser-notif-enabled","status-url","help-url","onSoundToggle","onBrowserNotifToggle","onAction"])):D("",!0)],64))],6)):D("",!0)],2)}const Qm=we(Fm,[["render",Jm],["__scopeId","data-v-a4158e01"]]),Wr=window.__WIDGET_ID,zr=window.__BASE_URL;if(!Wr||!zr)console.error("[messenger-iframe] missing __WIDGET_ID or __BASE_URL globals");else{if(!document.getElementById("wm-tokens")){const e=document.createElement("style");e.id="wm-tokens",e.textContent=go,document.head.appendChild(e)}Ql({render:()=>uo(Qm,{baseUrl:zr,widgetId:Wr,displayMode:"embedded"})}).mount("#app")}
73
+ `)}return i}const Vr={book:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253",changelog:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",status:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",chat:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",link:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"},Cu={name:"WmOnboarding",components:{AIAvatar:wn},inject:{t:{default:()=>Ee()},wmLocale:{default:()=>()=>"fr"}},props:{welcomeMessage:{type:String,default:""},subtitle:{type:String,default:""},agentName:{type:String,default:""},defaultIconUrl:{type:String,default:null},quickLinks:{type:Array,default:()=>[]},openThreads:{type:Array,default:()=>[]},busy:{type:Boolean,default:!1}},emits:["start","select","resume"],data(){return{query:""}},computed:{heroTitle(){return this.welcomeMessage?this.welcomeMessage:this.agentName?this.t("onboarding.greetingNamed",{name:this.agentName}):this.t("onboarding.greeting")},heroSub(){return this.subtitle||this.t("onboarding.heroSub")},isOddQuickLinks(){return this.quickLinks.length%2===1},quickLinksLayout(){return this.isOddQuickLinks?"wm-onb__qlist":"wm-onb__grid"},filteredThreads(){const e=this.query.trim().toLowerCase();return e?this.openThreads.filter(t=>(t.title||"").toLowerCase().includes(e)||(t.preview||"").toLowerCase().includes(e)):this.openThreads}},methods:{iconPath(e){return Vr[e]||Vr.link},renderPreview(e){return wu(e)},formatTs(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=bn(this.wmLocale()),r=new Date;if(t.toDateString()===r.toDateString())return t.toLocaleTimeString(n,{hour:"2-digit",minute:"2-digit"});if(r.getTime()-t.getTime()<7*864e5){const o=t.toLocaleDateString(n,{weekday:"short"});return o.charAt(0).toUpperCase()+o.slice(1)}return t.toLocaleDateString(n,{day:"2-digit",month:"2-digit"})}}},Au={class:"wm-onb"},Su={class:"wm-onb__hero"},xu={class:"wm-onb__hero-text"},Tu={class:"wm-onb__title"},Mu={class:"wm-onb__sub"},Eu={class:"wm-onb__cta"},Ou=["disabled"],Iu={key:0,class:"wm-onb__section"},Lu={class:"wm-onb__section-title"},Ru=["onClick"],Nu={class:"wm-onb__card-icon"},Bu={width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Pu=["d"],Fu={class:"wm-onb__card-body"},Du={class:"wm-onb__card-title"},ju={key:0,class:"wm-onb__card-sub"},Uu={key:1,class:"wm-onb__section"},Hu={class:"wm-onb__section-title"},$u={class:"wm-onb__search"},Vu=["placeholder","aria-label"],Ku={class:"wm-onb__list"},qu=["onClick"],Wu=["aria-label"],zu={class:"wm-onb__thread-body"},Gu={class:"wm-onb__thread-title"},Yu=["innerHTML"],Ju={class:"wm-onb__thread-meta"},Qu={key:0,class:"wm-onb__thread-time"},Xu={key:0,class:"wm-onb__empty"};function Zu(e,t,n,r,i,s){const o=_e("AIAvatar");return p(),_("div",Au,[u("div",Su,[t[2]||(t[2]=u("svg",{class:"wm-onb__hero-deco",width:"180",height:"180",viewBox:"0 0 180 180",fill:"none","aria-hidden":"true"},[u("circle",{cx:"170",cy:"10",r:"105",stroke:"#5B5FEF","stroke-width":"1","stroke-dasharray":"1 5",opacity:"0.35"}),u("circle",{cx:"170",cy:"10",r:"72",stroke:"#5B5FEF","stroke-width":"1","stroke-dasharray":"1 5",opacity:"0.5"}),u("circle",{cx:"152",cy:"34",r:"2.5",fill:"#5B5FEF",opacity:"0.65"})],-1)),ye(o,{size:52,"image-url":n.defaultIconUrl},null,8,["image-url"]),u("div",xu,[u("div",Tu,O(s.heroTitle),1),u("div",Mu,O(s.heroSub),1)])]),u("div",Eu,[u("button",{type:"button",class:"wm-onb__startBtn",disabled:n.busy,onClick:t[0]||(t[0]=a=>e.$emit("start"))},[t[3]||(t[3]=u("span",{class:"wm-onb__startIcon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M12 5v14M5 12h14"})])],-1)),u("span",null,O(n.busy?"…":s.t("onboarding.start")),1)],8,Ou)]),n.quickLinks.length?(p(),_("div",Iu,[u("div",Lu,O(s.t("onboarding.quickAccess")),1),u("div",{class:re(s.quickLinksLayout)},[(p(!0),_(Z,null,Me(n.quickLinks,(a,l)=>(p(),_("button",{key:l,type:"button",class:re(["wm-onb__card",{"wm-onb__card--row":s.isOddQuickLinks}]),onClick:f=>e.$emit("select",a)},[u("span",Nu,[(p(),_("svg",Bu,[u("path",{d:s.iconPath(a.icon)},null,8,Pu)]))]),u("span",Fu,[u("span",Du,O(a.label),1),a.description?(p(),_("span",ju,O(a.description),1)):D("",!0)])],10,Ru))),128))],2)])):D("",!0),n.openThreads.length?(p(),_("div",Uu,[u("div",Hu,O(s.t("onboarding.recentConversations")),1),u("div",$u,[t[4]||(t[4]=u("span",{class:"wm-onb__searchIcon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z"})])],-1)),it(u("input",{"onUpdate:modelValue":t[1]||(t[1]=a=>i.query=a),type:"text",placeholder:s.t("onboarding.search"),"aria-label":s.t("onboarding.search")},null,8,Vu),[[Ot,i.query]])]),u("div",Ku,[(p(!0),_(Z,null,Me(s.filteredThreads,a=>(p(),_("button",{key:a.id,type:"button",class:"wm-onb__thread",onClick:l=>e.$emit("resume",a)},[u("span",{class:re(["wm-onb__thread-icon",{"wm-onb__thread-icon--inverted":!a.unread}])},[t[5]||(t[5]=u("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[u("path",{d:"M12 2 L13.5 9 L20 10.5 L13.5 12 L12 19 L10.5 12 L4 10.5 L10.5 9 Z",fill:"currentColor",opacity:"0.92"})],-1)),a.unread?(p(),_("span",{key:0,class:"wm-onb__thread-dot","aria-label":s.t("onboarding.unread")},null,8,Wu)):D("",!0)],2),u("span",zu,[u("span",Gu,O(a.title),1),u("span",{class:"wm-onb__thread-preview",innerHTML:s.renderPreview(a.preview)},null,8,Yu)]),u("span",Ju,[s.formatTs(a._ts)?(p(),_("span",Qu,O(s.formatTs(a._ts)),1)):D("",!0),t[6]||(t[6]=u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round",class:"wm-onb__thread-chev","aria-hidden":"true"},[u("path",{d:"M5 12h14M13 5l7 7-7 7"})],-1))])],8,qu))),128)),s.filteredThreads.length?D("",!0):(p(),_("div",Xu,O(s.t("onboarding.noResults",{query:i.query})),1))])])):D("",!0)])}const ed=we(Cu,[["render",Zu],["__scopeId","data-v-28c0780b"]]);function td(e){return typeof e!="string"?"":e.replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)","g"),"$1").replace(/__([^_]+)__/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\s+/g," ").trim()}const nd={name:"WmActionResult",props:{state:{type:String,default:"success"},label:{type:String,required:!0},detail:{type:String,default:""}},computed:{detailText(){return td(this.detail)}}},sd={class:"wm-result__icon","aria-hidden":"true"},rd={key:0,width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.8","stroke-linecap":"round","stroke-linejoin":"round"},id={key:1,width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.6","stroke-linecap":"round","stroke-linejoin":"round"},od={key:2,width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round"},ad={key:3,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},ld={class:"wm-result__body"},cd={class:"wm-result__label"},ud={class:"wm-result__detail"};function dd(e,t,n,r,i,s){return p(),_("div",{class:re(["wm-result",`wm-result--${n.state}`])},[u("span",sd,[n.state==="success"?(p(),_("svg",rd,[...t[0]||(t[0]=[u("path",{d:"M20 6L9 17l-5-5"},null,-1)])])):n.state==="rejected"?(p(),_("svg",id,[...t[1]||(t[1]=[u("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])):n.state==="awaiting"?(p(),_("svg",od,[...t[2]||(t[2]=[u("circle",{cx:"12",cy:"12",r:"10"},null,-1),u("polyline",{points:"12 7 12 12 15 14"},null,-1)])])):(p(),_("svg",ad,[...t[3]||(t[3]=[u("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"},null,-1),u("line",{x1:"12",y1:"9",x2:"12",y2:"13"},null,-1),u("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"},null,-1)])]))]),u("span",ld,[u("span",cd,O(n.label),1),s.detailText?(p(),_(Z,{key:0},[t[4]||(t[4]=u("span",{class:"wm-result__sep","aria-hidden":"true"}," · ",-1)),u("span",ud,O(s.detailText),1)],64)):D("",!0)])],2)}const fd=we(nd,[["render",dd],["__scopeId","data-v-7284acd0"]]),hd={name:"WmArtifactFormResponse",inject:{t:{default:()=>Ee()}},props:{data:{type:Object,required:!0}},computed:{fields(){var e;return Array.isArray((e=this.data)==null?void 0:e.fields)?this.data.fields:[]}}},md={class:"wm-art wm-art--formResponse"},pd={class:"wm-art__head"},gd={class:"wm-art__title"},_d={class:"wm-art__badge wm-art__badge--success"},yd={class:"wm-art__body"},vd={class:"wm-art__fieldLabel"};function bd(e,t,n,r,i,s){return p(),_("div",md,[u("div",pd,[u("div",gd,O(n.data.title||s.t("form.title")),1),u("span",_d,[t[0]||(t[0]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("polyline",{points:"20 6 9 17 4 12"})],-1)),Qn(" "+O(s.t("form.sent")),1)])]),u("div",yd,[(p(!0),_(Z,null,Me(s.fields,(o,a)=>(p(),_("div",{key:a,class:"wm-art__field"},[u("div",vd,O(o.label),1),u("div",{class:re(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},O(o.value),3)]))),128))])])}const wd=we(hd,[["render",bd],["__scopeId","data-v-713aecf1"]]),kd={name:"WmArtifactInfoCard",props:{data:{type:Object,required:!0}},computed:{fields(){var e;return Array.isArray((e=this.data)==null?void 0:e.fields)?this.data.fields:[]},hasBody(){var e;return!!((e=this.data)!=null&&e.body)||this.fields.length>0}}},Cd={class:"wm-art wm-art--infoCard"},Ad={key:0,class:"wm-art__image"},Sd=["src","alt"],xd={class:"wm-art__head"},Td={class:"wm-art__headMain"},Md={class:"wm-art__title"},Ed={key:0,class:"wm-art__subtitle"},Od={key:1,class:"wm-art__body"},Id={key:0,class:"wm-art__text"},Ld={class:"wm-art__fieldLabel"};function Rd(e,t,n,r,i,s){return p(),_("div",Cd,[n.data.image_url?(p(),_("figure",Ad,[u("img",{src:n.data.image_url,alt:n.data.title||"",loading:"lazy"},null,8,Sd)])):D("",!0),u("div",xd,[u("div",Td,[u("div",Md,O(n.data.title),1),n.data.subtitle?(p(),_("div",Ed,O(n.data.subtitle),1)):D("",!0)]),n.data.badge&&n.data.badge.label?(p(),_("span",{key:0,class:re(["wm-art__badge",`wm-art__badge--${n.data.badge.tone||"neutral"}`])},O(n.data.badge.label),3)):D("",!0)]),s.hasBody?(p(),_("div",Od,[n.data.body?(p(),_("div",Id,O(n.data.body),1)):D("",!0),s.fields.length?(p(!0),_(Z,{key:1},Me(s.fields,(o,a)=>(p(),_("div",{key:a,class:"wm-art__field"},[u("div",Ld,O(o.label),1),u("div",{class:re(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},O(o.value),3)]))),128)):D("",!0)])):D("",!0)])}const Nd=we(kd,[["render",Rd],["__scopeId","data-v-7eae0e4a"]]);function Bd(e,t,n){if(!e)return"";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const i=r.toLocaleDateString(t,{day:"numeric",month:"long",year:"numeric"}),s=r.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"});return`${i}${n}${s}`}const Pd={name:"WmArtifactTicket",inject:{t:{default:()=>Ee()},wmLocale:{default:()=>()=>"fr"}},props:{data:{type:Object,required:!0}},computed:{fields(){var e;return Array.isArray((e=this.data)==null?void 0:e.fields)?this.data.fields:[]},formattedDate(){var e;return Bd((e=this.data)==null?void 0:e.created_at,bn(this.wmLocale()),this.t("ticket.dateAt"))}},methods:{isPriority(e){return/priorit|^prio$/i.test(String(e||"").trim())},isDate(e){return/date|échéanc|echeanc|deadline|due|créé|cree/i.test(String(e||"").trim())},priorityLevel(e){const t=String(e||"").toLowerCase();return/high|haute|élev|elev|critic|critiq|urgent/.test(t)?3:/low|basse|faible|minor/.test(t)?1:2}}},Fd={class:"wm-art wm-art--ticket"},Dd={class:"wm-art__head wm-tk__head"},jd={class:"wm-art__title wm-tk__title"},Ud={class:"wm-tk__sub"},Hd={class:"wm-tk__ref"},$d={key:0,class:"wm-tk__text"},Vd={key:0,class:"wm-art__body"},Kd={class:"wm-art__fieldLabel"},qd=["data-level"],Wd={key:1,class:"wm-tk__date",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},zd={key:1,class:"wm-art__footer wm-tk__footer"};function Gd(e,t,n,r,i,s){return p(),_("div",Fd,[u("div",Dd,[u("div",jd,O(n.data.title),1),u("div",Ud,[u("div",Hd,[t[0]||(t[0]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M20 12a2 2 0 0 1 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v4a2 2 0 0 1 0 4v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 1-2-2z"}),u("path",{d:"M13 5v2M13 17v2M13 11v2"})],-1)),u("span",null,O(n.data.reference),1)]),u("span",{class:re(["wm-art__badge","wm-tk__badge",`wm-art__badge--${n.data.status.tone||"neutral"}`])},[t[1]||(t[1]=u("span",{class:"wm-tk__dot","aria-hidden":"true"},null,-1)),Qn(" "+O(n.data.status.label),1)],2)]),n.data.body?(p(),_("div",$d,O(n.data.body),1)):D("",!0)]),s.fields.length?(p(),_("div",Vd,[(p(!0),_(Z,null,Me(s.fields,(o,a)=>(p(),_("div",{key:a,class:"wm-art__field"},[u("div",Kd,O(o.label),1),u("div",{class:re(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},[s.isPriority(o.label)?(p(),_("svg",{key:0,class:"wm-tk__prio","data-level":s.priorityLevel(o.value),width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true"},[...t[2]||(t[2]=[u("rect",{x:"1",y:"8",width:"2",height:"3",rx:"0.5"},null,-1),u("rect",{x:"5",y:"5",width:"2",height:"6",rx:"0.5"},null,-1),u("rect",{x:"9",y:"2",width:"2",height:"9",rx:"0.5"},null,-1)])],8,qd)):s.isDate(o.label)?(p(),_("svg",Wd,[...t[3]||(t[3]=[u("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"},null,-1),u("path",{d:"M16 2v4M8 2v4M3 10h18"},null,-1)])])):D("",!0),u("span",null,O(o.value),1)],2)]))),128))])):D("",!0),n.data.created_at?(p(),_("div",zd,[t[4]||(t[4]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),u("path",{d:"M16 2v4M8 2v4M3 10h18"})],-1)),u("span",null,O(s.formattedDate),1)])):D("",!0)])}const Yd=we(Pd,[["render",Gd],["__scopeId","data-v-5f30c914"]]),Jd={form_response:wd,info_card:Nd,ticket:Yd},Qd={name:"WmArtifactRenderer",props:{artifact:{type:Object,required:!0}},computed:{component(){var t;const e=(t=this.artifact)==null?void 0:t.kind;return e&&Jd[e]||null}}};function Xd(e,t,n,r,i,s){return s.component?(p(),be(Ma(s.component),{key:0,data:n.artifact.data},null,8,["data"])):D("",!0)}const Zd=we(Qd,[["render",Xd]]),ef={name:"WmAttachmentPreview",inject:{signAttachmentFn:{default:null},t:{default:()=>Ee()}},props:{attachment:{type:Object,required:!0}},data(){return{url:null,loading:!1}},computed:{kind(){var n,r;const e=(n=this.attachment)==null?void 0:n.type;if(e)return e;const t=(((r=this.attachment)==null?void 0:r.mime_type)||"").toLowerCase();return t.startsWith("image/")?"image":t.startsWith("audio/")?"audio":t.startsWith("video/")?"video":"file"},displayName(){var e,t,n;return((t=(e=this.attachment)==null?void 0:e.metadata)==null?void 0:t.name)||((n=this.attachment)==null?void 0:n.name)||this.guessNameFromPath()||this.t("attachment.fallbackName")},safeHref(){const e=String(this.url||"").trim();return/^(https?:\/\/|blob:|data:image\/)/i.test(e)?e:"#"},sizeLabel(){var t;const e=(t=this.attachment)==null?void 0:t.size_bytes;return e?e<1024?this.t("attachment.bytes",{size:e}):e<1024*1024?this.t("attachment.kilobytes",{size:(e/1024).toFixed(0)}):this.t("attachment.megabytes",{size:(e/(1024*1024)).toFixed(1)}):""}},watch:{"attachment.path":{handler(){this.refresh()},immediate:!0}},methods:{guessNameFromPath(){var n;return((((n=this.attachment)==null?void 0:n.path)||"").split("/").pop()||"").replace(/^[0-9a-f-]{8,}-/,"")},async refresh(){var e;if(!(!((e=this.attachment)!=null&&e.path)||!this.signAttachmentFn)){this.loading=!0;try{this.url=await this.signAttachmentFn(this.attachment.path)}finally{this.loading=!1}}},onFileClick(e){this.safeHref==="#"&&e.preventDefault()}}},tf=["href"],nf=["src","alt"],sf=["src"],rf=["src"],of=["href","download"],af={class:"wm-att__main"},lf={class:"wm-att__name"},cf={key:0,class:"wm-att__meta"},uf={key:0,class:"wm-att__spin","aria-hidden":"true"};function df(e,t,n,r,i,s){return p(),_("div",{class:re(["wm-att",["wm-att--"+(s.kind||"file")]])},[s.kind==="image"&&i.url?(p(),_("a",{key:0,href:s.safeHref,target:"_blank",rel:"noopener",class:"wm-att__imgWrap"},[u("img",{src:i.url,alt:s.displayName,loading:"lazy"},null,8,nf)],8,tf)):s.kind==="audio"&&i.url?(p(),_("audio",{key:1,src:i.url,controls:"",preload:"metadata"},null,8,sf)):s.kind==="video"&&i.url?(p(),_("video",{key:2,src:i.url,controls:"",preload:"metadata"},null,8,rf)):(p(),_("a",{key:3,class:"wm-att__file",href:s.safeHref,download:s.displayName,target:"_blank",rel:"noopener",onClick:t[0]||(t[0]=(...o)=>s.onFileClick&&s.onFileClick(...o))},[t[1]||(t[1]=u("span",{class:"wm-att__icon"},[u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),u("path",{d:"M14 2v6h6"})])],-1)),u("span",af,[u("span",lf,O(s.displayName),1),s.sizeLabel?(p(),_("span",cf,O(s.sizeLabel),1)):D("",!0)]),i.loading?(p(),_("span",uf)):D("",!0)],8,of))],2)}const ff=we(ef,[["render",df],["__scopeId","data-v-0c877a62"]]),hf={name:"WmBubble",props:{role:{type:String,default:"ai"},text:{type:String,default:""}},computed:{rendered(){return ku(this.text)}}},mf=["innerHTML"];function pf(e,t,n,r,i,s){return p(),_("div",{class:re(["wm-bubble","wm-bubble--"+n.role])},[Ea(e.$slots,"default",{},()=>[u("span",{innerHTML:s.rendered},null,8,mf)])],2)}const gf=we(hf,[["render",pf],["__scopeId","data-v-7ab13147"]]),_f={name:"WmTyping"},yf={class:"wm-typing"};function vf(e,t,n,r,i,s){return p(),_("div",yf,[...t[0]||(t[0]=[u("span",{style:{"animation-delay":"0s"}},null,-1),u("span",{style:{"animation-delay":"0.2s"}},null,-1),u("span",{style:{"animation-delay":"0.4s"}},null,-1)])])}const bf=we(_f,[["render",vf],["__scopeId","data-v-df2447fd"]]);function Tt(e){return e?e.client_msg_id||e.id:""}const wf={transferred_to_human:"system.transferredToHuman",assigned:"system.assigned",unassigned:"system.unassigned",resolved:"system.resolved",reopened:"system.reopened",idle:"system.idle"},kf=80,Cf=200,Af={name:"WmMessageList",components:{AIAvatar:wn,HumanAvatar:vo,Bubble:gf,Typing:bf,ActionResult:fd,AttachmentPreview:ff,ArtifactRenderer:Zd},inject:{t:{default:()=>Ee()},wmLocale:{default:()=>()=>"fr"}},props:{messages:{type:Array,default:()=>[]},streamingActive:{type:Boolean,default:!1},dateLabel:{type:String,default:""},conversationId:{type:[String,Number],default:null},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},unreadAnchorId:{type:Number,default:null},unreadBoundaryTs:{type:String,default:""},aiAgentName:{type:String,default:""},aiAgentAvatarUrl:{type:String,default:null}},emits:["load-more"],data(){return{silentFades:!1,widthByKey:Object.freeze({})}},computed:{historyExhausted(){return!this.hasMore&&!this.loadingMore&&this.messages.length>=20},groups(){var n,r,i,s;const e=[];for(const o of this.messages){const a=this.roleOf(o);if(a==="system"){if(((n=o==null?void 0:o.payload)==null?void 0:n.event)==="action_admin_pending"){const c=e[e.length-1];c&&c.role==="ai"?c.messages.push(o):e.push({key:`g-${Tt(o)}`,role:"ai",agentName:"",agentAvatarUrl:null,messages:[o],items:[]});continue}e.push({key:`sys-${Tt(o)}`,role:a,messages:[o],items:[],systemLabel:this.systemLabel(o)});continue}const l=e[e.length-1];l&&l.role===a&&(a==="ai"||l.agentName===(((r=o==null?void 0:o.author)==null?void 0:r.name)||""))?l.messages.push(o):e.push({key:`g-${Tt(o)}`,role:a,agentName:((i=o==null?void 0:o.author)==null?void 0:i.name)||"",agentAvatarUrl:((s=o==null?void 0:o.author)==null?void 0:s.avatar_url)||null,messages:[o],items:[]})}for(const o of e){if(o.role==="system")continue;const a=[];for(const l of o.messages)for(const f of this.itemsOf(l))a.push(f);o.items=a}const t=[];for(const o of e){if(o.role!=="system"&&!o.items.length)continue;const a=t[t.length-1];if(a&&a.role!=="system"&&a.role===o.role&&(o.role==="ai"||a.agentName===o.agentName)){a.messages.push(...o.messages),a.items.push(...o.items);continue}t.push(o)}for(const o of t)o.role!=="system"&&(o.key=this.stableGroupKey(o.messages));return t},unreadGroupKey(){if(this.unreadAnchorId==null)return null;const e=this.unreadAnchorId,t=this.unreadBoundaryTs;for(const n of this.groups){if(n.role==="user"||n.role==="system"||!n.items.length)continue;const r=n.messages[0];if(!r)continue;const i=vt(r.id);if(i!=null&&!(i<=e)&&!(t&&r.created_at&&r.created_at>t))return n.key}return null}},watch:{messages:{handler:"snapshotAndRestore",deep:!0},conversationId(e,t){e!==t&&(this._groupIdByMsgKey=null,this.silentFades=!1)},loadingMore(e){e||(this._pendingLoadMore=!1),e&&(this.silentFades=!0),this.snapshotAndRestore()},streamingActive:"snapshotAndRestore"},mounted(){this._lastSeenConvId=this.conversationId,this.scrollToBottom(),this._measureFrame=null,this._ro=new ResizeObserver(()=>this.scheduleMeasure()),this.$refs.scrollEl&&this._ro.observe(this.$refs.scrollEl),this.$nextTick(()=>this.measureRows())},beforeUnmount(){var e;(e=this._ro)==null||e.disconnect(),this._measureFrame&&cancelAnimationFrame(this._measureFrame)},updated(){this.scheduleMeasure()},methods:{messageKey:Tt,stableGroupKey(e){this._groupIdByMsgKey||(this._groupIdByMsgKey=new Map,this._groupIdCounter=0);const t=this._groupIdByMsgKey;let n=null;for(const r of e){const i=Tt(r);if(i&&t.has(i)){n=t.get(i);break}}n==null&&(n=++this._groupIdCounter);for(const r of e){const i=Tt(r);i&&t.set(i,n)}return`g-${n}`},isAtBottom(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=kf},onScroll(){const e=this.$refs.scrollEl;e&&(this.loadingMore||!this.hasMore||this._pendingLoadMore||e.scrollTop<=Cf&&(this._pendingLoadMore=!0,this.$emit("load-more")))},snapshotAndRestore(){const e=this.$refs.scrollEl;if(!e||this._scrollSnap)return;const t=this._lastSeenConvId!==this.conversationId;this._lastSeenConvId=this.conversationId;const n=this.isAtBottom(e);let r=null;if(!t&&!n){const s=this.pickAnchor(e);if(s!=null&&s.rowKey){const o=this.findRowByKey(e,s.rowKey);if(o){const a=e.getBoundingClientRect().top;r={rowKey:s.rowKey,relY:o.getBoundingClientRect().top-a}}}}const i={forceBottom:t,wasPinned:n,anchor:r};this._scrollSnap=i,this.$nextTick(()=>{if(this._scrollSnap=null,i.forceBottom||i.wasPinned){e.scrollTop=e.scrollHeight;return}if(!i.anchor)return;const s=()=>{const o=i.anchor,a=this.findRowByKey(e,o.rowKey);if(!a)return;const f=a.getBoundingClientRect().top-e.getBoundingClientRect().top-o.relY;Math.abs(f)>.5&&(e.scrollTop+=f)};s(),requestAnimationFrame(()=>{s(),requestAnimationFrame(s)})})},pickAnchor(e){const t=e.getBoundingClientRect().top,n=e.querySelectorAll(".wm-list__row[data-row-key]");let r=null;for(const i of n)if(r||(r=i),i.getBoundingClientRect().bottom>=t)return{rowKey:i.dataset.rowKey};return r?{rowKey:r.dataset.rowKey}:null},findRowByKey(e,t){if(!t)return null;const n=typeof CSS<"u"&&CSS.escape?CSS.escape(t):t.replace(/["\\]/g,"\\$&");return e.querySelector(`.wm-list__row[data-row-key="${n}"]`)},roleOf(e){var n,r;if((e==null?void 0:e.type)==="system"||((n=e==null?void 0:e.payload)==null?void 0:n.type)==="system")return"system";const t=(r=e==null?void 0:e.author)==null?void 0:r.type;return t==="user"?"user":t==="agent_human"?"human":"ai"},roleLabel(e){if(e.role==="human")return e.agentName||this.t("common.agent");const t=this.t("common.aiAssistant");return this.aiAgentName?`${this.aiAgentName} • ${t}`:t},itemsOf(e){var t;if(!e)return[];if(e.type==="system"&&((t=e==null?void 0:e.payload)==null?void 0:t.event)==="action_admin_pending")return[{message:e,partKey:"main",renderAs:"admin-pending",kind:{top:"bubble",bottom:"bubble"}}];if(e.type==="action"&&e.payload&&e.payload.state!=="pending"){const n=[{message:e,partKey:"main",renderAs:"action",kind:{top:"bubble",bottom:"bubble"}}];return this.actionArtifact(e)&&n.push({message:e,partKey:"artifact",renderAs:"artifact-of-action",kind:{top:"card",bottom:"card"}}),n}return this.artifactOf(e)?[{message:e,partKey:"main",renderAs:"artifact",kind:{top:"card",bottom:"card"}}]:e.text_md||this.attachmentsOf(e).length?[{message:e,partKey:"main",renderAs:"bubble",kind:{top:"bubble",bottom:"bubble"}}]:[]},cornersFor(e,t){var U,ne,ge;const n=e.items,r=(U=n[t])==null?void 0:U.kind,i=(ne=n[t-1])==null?void 0:ne.kind,s=(ge=n[t+1])==null?void 0:ge.kind,o=e.role==="user",a=14,l=4,f=i==null?void 0:i.bottom,c=s==null?void 0:s.top,g=this.widthByKey[this.rowKeyOf(e,t)],S=this.widthByKey[this.rowKeyOf(e,t-1)],A=this.widthByKey[this.rowKeyOf(e,t+1)],K=.5,I=(he,ke,G)=>he!=null&&g!=null?he+K>=g:ke===G||ke==="card"&&G==="bubble";let Q=a,z=a,q=a,X=a;return o?(f&&(z=l),(c||!s)&&(q=l),f&&I(S,f,r==null?void 0:r.top)&&(Q=l),c&&I(A,c,r==null?void 0:r.bottom)&&(X=l)):(f&&(Q=l),(c||!s)&&(X=l),f&&I(S,f,r==null?void 0:r.top)&&(z=l),c&&I(A,c,r==null?void 0:r.bottom)&&(q=l)),{tl:Q,tr:z,br:q,bl:X}},cornersStyle(e,t){if(e.items.length<2)return null;const n=this.cornersFor(e,t);return{"--wm-r-tl":`${n.tl}px`,"--wm-r-tr":`${n.tr}px`,"--wm-r-br":`${n.br}px`,"--wm-r-bl":`${n.bl}px`}},rowKeyOf(e,t){var r;const n=(r=e==null?void 0:e.items)==null?void 0:r[t];return n?`${Tt(n.message)}-${n.partKey}`:""},scheduleMeasure(){this._measureFrame||(this._measureFrame=requestAnimationFrame(()=>{this._measureFrame=null,this.measureRows()}))},measureRows(){const e=this.$refs.scrollEl;if(!e)return;const t={};for(const s of e.querySelectorAll(".wm-list__row[data-row-key]")){const o=s.dataset.rowKey;if(!o)continue;const a=s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");if(!a)continue;const l=a.getBoundingClientRect().width;l>0&&(t[o]=l)}const n=this.widthByKey,r=Object.keys(n),i=Object.keys(t);if(r.length===i.length){let s=!0;for(const o of i)if(Math.abs((n[o]??0)-t[o])>.5){s=!1;break}if(s)return}this.widthByKey=Object.freeze(t)},lastTimeOf(e){const t=e.items[e.items.length-1],n=(t==null?void 0:t.message)||e.messages[e.messages.length-1];if(!(n!=null&&n.created_at))return"";try{return go(new Date(n.created_at),bn(this.wmLocale()))}catch{return""}},hasTrailingOverlay(e){if(!e.messages.length)return!1;const t=e.messages[e.messages.length-1],n=e.items[e.items.length-1];return!!t&&(n==null?void 0:n.message)!==t},attachmentsOf(e){var n;const t=(n=e==null?void 0:e.payload)==null?void 0:n.attachments;return Array.isArray(t)?t:[]},artifactOf(e){var n;const t=(n=e==null?void 0:e.metadata)==null?void 0:n.artifact;return!t||typeof t!="object"||typeof t.kind!="string"?null:t},actionLabel(e){var t;return((t=e==null?void 0:e.payload)==null?void 0:t.name)||(e==null?void 0:e.text_md)||this.t("common.action")},actionDetail(e){var n,r,i,s,o,a;const t=e==null?void 0:e.payload;return t?t.state==="success"?((n=t.success)==null?void 0:n.summary)||((i=(r=t.success)==null?void 0:r.metadata)==null?void 0:i.description)||"":t.state==="rejected"?((s=t.rejected)==null?void 0:s.reason)||this.t("action.rejectedByUser"):t.state==="failure"&&(((o=t.failure)==null?void 0:o.summary)||((a=t.failure)==null?void 0:a.error))||"":""},actionArtifact(e){var n,r;const t=(r=(n=e==null?void 0:e.payload)==null?void 0:n.success)==null?void 0:r.artifact;return!t||typeof t!="object"||typeof t.kind!="string"?null:t},systemLabel(e){var i,s,o;const t=(i=e==null?void 0:e.payload)==null?void 0:i.event,n=wf[t],r=((s=e==null?void 0:e.metadata)==null?void 0:s.agent_name)||((o=e==null?void 0:e.author)==null?void 0:o.name)||this.t("messageList.anAgent");return n?this.t(n,{name:r}):(e==null?void 0:e.text_md)||this.t("messageList.conversationUpdate")},scrollToBottom(){const e=this.$refs.scrollEl;e&&(e.scrollTop=e.scrollHeight)}}},Sf={key:0,class:"wm-list__loadMore",role:"status","aria-live":"polite"},xf={class:"wm-list__loadMore-lbl"},Tf={key:1,class:"wm-list__historyEnd"},Mf={key:2,class:"wm-list__sep"},Ef={class:"wm-list__sep-label"},Of={key:0,class:"wm-list__sep wm-list__sep--unread"},If={class:"wm-list__sep-label wm-list__sep-label--unread"},Lf={key:0,class:"wm-list__sysep"},Rf={class:"wm-list__sysep-label"},Nf=["data-row-key"],Bf={key:0,class:"wm-list__avatarSlot"},Pf={key:5,class:"wm-list__body"},Ff={key:0},Df={key:1,"aria-hidden":"true"},jf={key:2},Uf={key:3,class:"wm-list__row wm-list__row--ai fade-up"},Hf={class:"wm-list__avatarSlot"};function $f(e,t,n,r,i,s){const o=_e("AIAvatar"),a=_e("HumanAvatar"),l=_e("ActionResult"),f=_e("ArtifactRenderer"),c=_e("Bubble"),g=_e("AttachmentPreview"),S=_e("Typing");return p(),_("div",{ref:"scrollEl",class:re(["wm-list",{"wm-list--silent":i.silentFades}]),onScrollPassive:t[0]||(t[0]=(...A)=>s.onScroll&&s.onScroll(...A))},[n.loadingMore?(p(),_("div",Sf,[t[1]||(t[1]=u("span",{class:"wm-list__loadMore-spinner","aria-hidden":"true"},null,-1)),u("span",xf,O(s.t("messageList.loadingHistory")),1)])):s.historyExhausted?(p(),_("div",Tf,O(s.t("messageList.conversationStart")),1)):D("",!0),n.dateLabel?(p(),_("div",Mf,[t[2]||(t[2]=u("div",{class:"wm-list__line"},null,-1)),u("span",Ef,O(n.dateLabel),1),t[3]||(t[3]=u("div",{class:"wm-list__line"},null,-1))])):D("",!0),(p(!0),_(Z,null,Me(s.groups,(A,K)=>(p(),_(Z,{key:A.key},[A.key===s.unreadGroupKey?(p(),_("div",Of,[t[4]||(t[4]=u("div",{class:"wm-list__line wm-list__line--unread"},null,-1)),u("span",If,O(s.t("messageList.unread")),1),t[5]||(t[5]=u("div",{class:"wm-list__line wm-list__line--unread"},null,-1))])):D("",!0),A.role==="system"||A.items.length?(p(),_("div",{key:1,class:re(["wm-list__group","wm-list__group--"+A.role])},[A.role==="system"?(p(),_("div",Lf,[t[6]||(t[6]=u("div",{class:"wm-list__line wm-list__line--strong"},null,-1)),u("span",Rf,O(A.systemLabel),1),t[7]||(t[7]=u("div",{class:"wm-list__line wm-list__line--strong"},null,-1))])):(p(),_(Z,{key:1},[(p(!0),_(Z,null,Me(A.items,(I,Q)=>(p(),_("div",{key:`${s.messageKey(I.message)}-${I.partKey}`,"data-row-key":`${s.messageKey(I.message)}-${I.partKey}`,class:re(["wm-list__row fade-up",["wm-list__row--"+A.role,{"is-pending":I.message._pending,"is-failed":I.message._failed}]]),style:je(s.cornersStyle(A,Q))},[A.role!=="user"?(p(),_("div",Bf,[Q===A.items.length-1?(p(),_(Z,{key:0},[A.role==="ai"?(p(),be(o,{key:0,size:26,tail:!0,name:n.aiAgentName,"image-url":n.aiAgentAvatarUrl},null,8,["name","image-url"])):(p(),be(a,{key:1,name:A.agentName,"avatar-url":A.agentAvatarUrl,size:26,tail:!0},null,8,["name","avatar-url"]))],64)):D("",!0)])):D("",!0),I.renderAs==="action"?(p(),be(l,{key:1,state:I.message.payload.state,label:s.actionLabel(I.message),detail:s.actionDetail(I.message)},null,8,["state","label","detail"])):I.renderAs==="admin-pending"?(p(),be(l,{key:2,state:"awaiting",label:s.t("messageList.approvalRequestSent"),detail:I.message.text_md||""},null,8,["label","detail"])):I.renderAs==="artifact-of-action"?(p(),be(f,{key:3,artifact:s.actionArtifact(I.message)},null,8,["artifact"])):I.renderAs==="artifact"?(p(),be(f,{key:4,artifact:s.artifactOf(I.message)},null,8,["artifact"])):(p(),_("div",Pf,[I.message.text_md?(p(),be(c,{key:0,role:A.role,text:I.message.text_md},null,8,["role","text"])):D("",!0),s.attachmentsOf(I.message).length?(p(),_("div",{key:1,class:re(["wm-list__atts",{"wm-list__atts--align-end":A.role==="user"}])},[(p(!0),_(Z,null,Me(s.attachmentsOf(I.message),(z,q)=>(p(),be(g,{key:`${s.messageKey(I.message)}-att-${q}`,attachment:z},null,8,["attachment"]))),128))],2)):D("",!0)]))],14,Nf))),128)),(A.role!=="user"||s.lastTimeOf(A))&&!s.hasTrailingOverlay(A)?(p(),_("div",{key:0,class:re(["wm-list__meta",{"wm-list__meta--right":A.role==="user"}])},[A.role!=="user"?(p(),_("span",Ff,O(s.roleLabel(A)),1)):D("",!0),A.role!=="user"&&s.lastTimeOf(A)?(p(),_("span",Df,"·")):D("",!0),s.lastTimeOf(A)?(p(),_("span",jf,O(s.lastTimeOf(A)),1)):D("",!0)],2)):D("",!0)],64))],2)):D("",!0)],64))),128)),n.streamingActive?(p(),_("div",Uf,[u("div",Hf,[ye(o,{size:26,tail:!0,name:n.aiAgentName,"image-url":n.aiAgentAvatarUrl},null,8,["name","image-url"])]),ye(S)])):D("",!0)],34)}const Vf=we(Af,[["render",$f],["__scopeId","data-v-d769b193"]]),Fn=typeof navigator<"u"&&!!navigator.mediaDevices&&typeof navigator.mediaDevices.getDisplayMedia=="function",zs=typeof window<"u"&&typeof window.MediaRecorder<"u";function Kf(){return zs&&["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm","video/mp4"].find(t=>{var n,r;return(r=(n=window.MediaRecorder).isTypeSupported)==null?void 0:r.call(n,t)})||""}function wo({audio:e}){return{video:!0,audio:!!e,selfBrowserSurface:"include",surfaceSwitching:"include",systemAudio:e?"include":"exclude"}}async function qf(){if(!Fn)return null;let e;try{e=await navigator.mediaDevices.getDisplayMedia(wo({audio:!1}))}catch(t){return(t==null?void 0:t.name)!=="NotAllowedError"&&console.error("[media] screenshot picker",t),null}try{return await Wf(e)}catch(t){return console.error("[media] screenshot capture",t),null}finally{e.getTracks().forEach(t=>{t.stop()})}}async function Wf(e){const t=document.createElement("video");t.muted=!0,t.playsInline=!0,t.srcObject=e,await t.play(),await new Promise(a=>requestAnimationFrame(a));const n=t.videoWidth||1280,r=t.videoHeight||720,i=document.createElement("canvas");i.width=n,i.height=r,i.getContext("2d").drawImage(t,0,0,n,r);const s=await new Promise((a,l)=>{i.toBlob(f=>f?a(f):l(new Error("toBlob failed")),"image/png")}),o=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19);return new File([s],`capture-${o}.png`,{type:"image/png"})}async function zf(e={}){var f;if(!Fn||!zs)return null;let t;try{t=await navigator.mediaDevices.getDisplayMedia(wo({audio:!0}))}catch(c){return(c==null?void 0:c.name)!=="NotAllowedError"&&console.error("[media] record picker",c),null}const n=Kf();let r;try{r=n?new window.MediaRecorder(t,{mimeType:n}):new window.MediaRecorder(t)}catch(c){return console.error("[media] recorder init",c),t.getTracks().forEach(g=>{g.stop()}),null}const i=[];let s=null,o=!1;r.addEventListener("dataavailable",c=>{c.data&&c.data.size>0&&i.push(c.data)}),r.addEventListener("stop",()=>{var c,g;if(s&&clearInterval(s),t.getTracks().forEach(S=>{S.stop()}),i.length){const S=r.mimeType||n||"video/webm",A=new Blob(i,{type:S}),K=/mp4/.test(S)?"mp4":"webm",I=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),Q=new File([A],`ecran-${I}.${K}`,{type:S});(c=e.onfinalize)==null||c.call(e,Q)}else(g=e.oncancel)==null||g.call(e)}),t.getVideoTracks().forEach(c=>{c.addEventListener("ended",()=>a(),{once:!0})});function a(){if(!o&&(o=!0,r.state!=="inactive"))try{r.stop()}catch(c){console.error("[media] recorder stop",c)}}try{r.start(1e3)}catch(c){return console.error("[media] recorder start",c),t.getTracks().forEach(g=>{g.stop()}),null}(f=e.onstart)==null||f.call(e);const l=Date.now();return s=setInterval(()=>{var c;(c=e.ontick)==null||c.call(e,Date.now()-l)},500),{stop:a,get state(){return r.state}}}const Gf=[{action:"file",labelKey:"composer.attachFile",path:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"},{action:"screenshot",labelKey:"composer.screenshot",path:"M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z M12 17a4 4 0 100-8 4 4 0 000 8z"},{action:"record",labelKey:"composer.recordScreen",path:"M23 7l-7 5 7 5V7z M1 5a2 2 0 012-2h12a2 2 0 012 2v14a2 2 0 01-2 2H3a2 2 0 01-2-2V5z"}],Yf={name:"WmComposer",inject:{t:{default:()=>Ee()}},props:{modelValue:{type:String,default:""},placeholder:{type:String,default:"Écrivez votre message…"},disabled:{type:Boolean,default:!1},attachLabel:{type:String,default:"Joindre"}},emits:["update:modelValue","send","attach"],data(){return{local:this.modelValue,attachOpen:!1,recording:!1,recordingElapsed:0,recorder:null}},computed:{canSend(){return!this.disabled&&!!this.local.trim()},attachItems(){return Gf.map(e=>({...e,label:this.t(e.labelKey),disabled:e.action==="screenshot"&&!Fn||e.action==="record"&&(!Fn||!zs)}))},recordingElapsedLabel(){const e=Math.floor(this.recordingElapsed/1e3),t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`}},watch:{modelValue(e){e!==this.local&&(this.local=e,this.$nextTick(()=>this.autosize()))},local(e){this.$emit("update:modelValue",e)}},mounted(){this.autosize()},beforeUnmount(){if(this.recorder)try{this.recorder.stop()}catch{}},methods:{focus(){const e=this.$refs.inputEl;if(!(!e||this.disabled))try{e.focus({preventScroll:!0})}catch{e.focus()}},onSubmit(){if(!this.canSend)return;const e=this.local.trim();this.local="",this.$emit("send",e),this.$nextTick(()=>this.autosize())},onKeydown(e){e.key==="Enter"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&!e.isComposing&&(e.preventDefault(),this.onSubmit())},autosize(){const e=this.$refs.inputEl;e&&(e.style.height="auto",e.style.height=`${e.scrollHeight}px`)},onFile(e){const t=Array.from(e.target.files||[]);for(const n of t)this.$emit("attach",n);e.target.value=""},onAttachAction(e){this.attachOpen=!1,e==="file"?this.pickFile():e==="screenshot"?this.captureScreenshot():e==="record"&&this.startRecording()},pickFile(){var e;(e=this.$refs.fileEl)==null||e.click()},async captureScreenshot(){if(this.disabled)return;const e=await qf();e&&this.$emit("attach",e)},async startRecording(){if(this.recording||this.disabled)return;this.recordingElapsed=0;const e=await zf({onstart:()=>{this.recording=!0},ontick:t=>{this.recordingElapsed=t},onfinalize:t=>{this.$emit("attach",t),this.recording=!1,this.recordingElapsed=0,this.recorder=null},oncancel:()=>{this.recording=!1,this.recordingElapsed=0,this.recorder=null}});e&&(this.recorder=e)},stopRecording(){if(this.recorder)try{this.recorder.stop()}catch(e){console.error("[composer] stop recording",e)}}}},Jf={class:"wm-compose-wrap"},Qf={key:0,class:"wm-rec"},Xf={class:"wm-rec__lbl"},Zf={key:1,class:"wm-compose__menu",role:"menu"},eh=["disabled","onClick"],th={class:"wm-compose__menuIcon"},nh={viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},sh=["d"],rh=["placeholder","disabled"],ih={class:"wm-compose__actions"},oh=["title","aria-label","disabled"],ah=["disabled","aria-label"];function lh(e,t,n,r,i,s){return p(),_("div",Jf,[i.recording?(p(),_("div",Qf,[t[8]||(t[8]=u("span",{class:"wm-rec__dot","aria-hidden":"true"},null,-1)),u("span",Xf,O(s.t("composer.recording",{time:s.recordingElapsedLabel})),1),u("button",{type:"button",class:"wm-rec__stop",onClick:t[0]||(t[0]=(...o)=>s.stopRecording&&s.stopRecording(...o))},O(s.t("composer.stop")),1)])):D("",!0),u("form",{class:re(["wm-compose",{"has-attach":i.attachOpen}]),onSubmit:t[7]||(t[7]=yt((...o)=>s.onSubmit&&s.onSubmit(...o),["prevent"]))},[u("input",{ref:"fileEl",type:"file",hidden:"",multiple:"",onChange:t[1]||(t[1]=(...o)=>s.onFile&&s.onFile(...o))},null,544),i.attachOpen?(p(),_("div",{key:0,class:"wm-compose__overlay",onClick:t[2]||(t[2]=o=>i.attachOpen=!1)})):D("",!0),i.attachOpen?(p(),_("div",Zf,[(p(!0),_(Z,null,Me(s.attachItems,o=>(p(),_("button",{key:o.action,type:"button",class:"wm-compose__menuItem",disabled:o.disabled,onClick:a=>s.onAttachAction(o.action)},[u("span",th,[(p(),_("svg",nh,[u("path",{d:o.path,stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,sh)]))]),u("span",null,O(o.label),1)],8,eh))),128))])):D("",!0),it(u("textarea",{ref:"inputEl","onUpdate:modelValue":t[3]||(t[3]=o=>i.local=o),class:"wm-compose__input",rows:"3",placeholder:n.placeholder,disabled:n.disabled,onKeydown:t[4]||(t[4]=(...o)=>s.onKeydown&&s.onKeydown(...o)),onInput:t[5]||(t[5]=(...o)=>s.autosize&&s.autosize(...o))},null,40,rh),[[Ot,i.local]]),u("div",ih,[u("button",{type:"button",class:re(["wm-compose__icon",{"is-open":i.attachOpen}]),title:n.attachLabel,"aria-label":n.attachLabel,disabled:i.recording,onClick:t[6]||(t[6]=o=>i.attachOpen=!i.attachOpen)},[...t[9]||(t[9]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})],-1)])],10,oh),u("button",{type:"submit",class:re(["wm-compose__send",{"is-empty":!s.canSend}]),disabled:!s.canSend,"aria-label":s.t("composer.send")},[...t[10]||(t[10]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"})],-1)])],10,ah)])],34)])}const ch=we(Yf,[["render",lh],["__scopeId","data-v-aa81dbb8"]]),uh={name:"WmSuggestionChips",props:{items:{type:Array,default:()=>[]},baseDelay:{type:Number,default:360},stepDelay:{type:Number,default:90}},emits:["select"],computed:{batchKey(){return this.items.map(e=>(e==null?void 0:e.label)||(e==null?void 0:e.text)||"").join("§")}}},dh=["onClick"];function fh(e,t,n,r,i,s){return n.items.length?(p(),_("div",{key:s.batchKey,class:"wm-chips"},[(p(!0),_(Z,null,Me(n.items,(o,a)=>(p(),_("button",{key:a,type:"button",class:"wm-chip",style:je({animationDelay:n.baseDelay+a*n.stepDelay+"ms"}),onClick:l=>e.$emit("select",o)},O(o.label),13,dh))),128))])):D("",!0)}const hh=we(uh,[["render",fh],["__scopeId","data-v-47ad8085"]]),mh={name:"WmApprovalCard",components:{AIAvatar:wn},inject:{t:{default:()=>Ee()}},props:{action:{type:String,required:!0},detail:{type:String,default:""},callbacks:{type:Array,default:()=>[]},agentName:{type:String,default:""},agentAvatarUrl:{type:String,default:null}},emits:["callback"],computed:{approveCallback(){return this.callbacks.find(e=>e.id==="approve"||e.style==="primary")||this.callbacks[0]},rejectCallback(){return this.callbacks.find(e=>e.id==="reject"||e.style==="danger"||e.style==="neutral")||(this.callbacks.length>1?this.callbacks[1]:null)},approveId(){var e;return(e=this.approveCallback)==null?void 0:e.id},rejectId(){var e;return(e=this.rejectCallback)==null?void 0:e.id},approveLabel(){var e;return((e=this.approveCallback)==null?void 0:e.label)||this.t("approval.approve")},rejectLabel(){var e;return((e=this.rejectCallback)==null?void 0:e.label)||this.t("approval.reject")}}},ph={class:"wm-approval"},gh={class:"wm-approval__head"},_h={class:"wm-approval__icon"},yh={class:"wm-approval__main"},vh={class:"wm-approval__title"},bh={key:0,class:"wm-approval__detail"},wh={class:"wm-approval__actions"};function kh(e,t,n,r,i,s){const o=_e("AIAvatar");return p(),_("div",ph,[u("div",gh,[u("div",_h,[ye(o,{size:24,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",yh,[u("div",vh,O(n.action),1),n.detail?(p(),_("div",bh,O(n.detail),1)):D("",!0)])]),u("div",wh,[s.rejectId?(p(),_("button",{key:0,type:"button",class:"wm-approval__btn wm-approval__btn--neutral",onClick:t[0]||(t[0]=a=>e.$emit("callback",s.rejectId))},O(s.rejectLabel),1)):D("",!0),s.approveId?(p(),_("button",{key:1,type:"button",class:"wm-approval__btn wm-approval__btn--primary",onClick:t[1]||(t[1]=a=>e.$emit("callback",s.approveId))},O(s.approveLabel),1)):D("",!0)])])}const Ch=we(mh,[["render",kh],["__scopeId","data-v-a2bed37e"]]);let Kr=0;const Ah=new Set(["text","textarea","number","boolean","select","multiselect","date"]),Sh={name:"WmFormCard",components:{AIAvatar:wn},inject:{t:{default:()=>Ee()}},props:{form:{type:Object,required:!0},readOnly:{type:Boolean,default:!1},initialValues:{type:Object,default:null},agentName:{type:String,default:""},agentAvatarUrl:{type:String,default:null}},emits:["submit"],data(){return Kr+=1,{_uid:Kr,values:{},busy:!1,error:""}},computed:{normalizedFields(){var t;return(Array.isArray((t=this.form)==null?void 0:t.fields)?this.form.fields:[]).filter(n=>!(!(n!=null&&n.key)||!(n!=null&&n.label)||!Ah.has(n==null?void 0:n.type)||(n.type==="select"||n.type==="multiselect")&&(!Array.isArray(n.options)||n.options.length===0)))}},created(){this.resetValues()},methods:{resetValues(){const e=this.initialValues&&typeof this.initialValues=="object"?this.initialValues:{},t={};for(const n of this.normalizedFields){if(e[n.key]!==void 0){t[n.key]=e[n.key];continue}n.type==="boolean"?t[n.key]=!1:n.type==="multiselect"?t[n.key]=[]:t[n.key]=""}this.values=t,this.error=""},toggleMulti(e,t,n){const r=Array.isArray(this.values[e])?this.values[e].slice():[],i=r.indexOf(t);n&&i===-1?r.push(t):!n&&i!==-1&&r.splice(i,1),this.values={...this.values,[e]:r}},validate(){for(const e of this.normalizedFields){if(!e.required)continue;const t=this.values[e.key];if(e.type!=="boolean"){if(e.type==="multiselect"){if(!Array.isArray(t)||t.length===0)return this.t("form.fieldRequired",{label:e.label});continue}if(t==null||t==="")return this.t("form.fieldRequired",{label:e.label})}}return""},async onSubmit(){if(this.readOnly||this.busy)return;const e=this.validate();if(e){this.error=e;return}this.error="",this.busy=!0;try{await this.$emit("submit",{values:this.values})}finally{this.busy=!1}}}},xh={class:"wm-form"},Th={class:"wm-form__head"},Mh={class:"wm-form__icon"},Eh={class:"wm-form__main"},Oh={class:"wm-form__title"},Ih={key:0,class:"wm-form__detail"},Lh=["for"],Rh={key:0,class:"wm-form__req","aria-hidden":"true"},Nh=["id","onUpdate:modelValue","placeholder","required","disabled"],Bh=["id","onUpdate:modelValue","placeholder","required","disabled"],Ph=["id","onUpdate:modelValue","placeholder","required","disabled"],Fh=["id","onUpdate:modelValue","required","disabled"],Dh={key:4,class:"wm-form__bool"},jh=["id","onUpdate:modelValue","disabled"],Uh=["id","onUpdate:modelValue","required","disabled"],Hh={value:"",disabled:""},$h=["value"],Vh={key:6,class:"wm-form__multi"},Kh=["value","checked","disabled","onChange"],qh={key:0,class:"wm-form__err"},Wh=["disabled"],zh={key:0,class:"wm-form__spinner","aria-hidden":"true"},Gh={key:2,class:"wm-form__doneLbl"};function Yh(e,t,n,r,i,s){const o=_e("AIAvatar");return p(),_("div",xh,[u("div",Th,[u("div",Mh,[ye(o,{size:24,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",Eh,[u("div",Oh,O(n.form.title||s.t("form.title")),1),n.form.description?(p(),_("div",Ih,O(n.form.description),1)):D("",!0)])]),u("form",{class:"wm-form__body",onSubmit:t[0]||(t[0]=yt((...a)=>s.onSubmit&&s.onSubmit(...a),["prevent"]))},[(p(!0),_(Z,null,Me(s.normalizedFields,a=>(p(),_("div",{key:a.key,class:"wm-form__field"},[u("label",{for:`wm-f-${i._uid}-${a.key}`,class:"wm-form__label"},[Qn(O(a.label),1),a.required?(p(),_("span",Rh,"*")):D("",!0)],8,Lh),a.type==="text"?it((p(),_("input",{key:0,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,type:"text",class:"wm-form__input",placeholder:a.placeholder||"",required:a.required,disabled:n.readOnly||i.busy},null,8,Nh)),[[Ot,i.values[a.key]]]):a.type==="textarea"?it((p(),_("textarea",{key:1,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,class:"wm-form__textarea",rows:"3",placeholder:a.placeholder||"",required:a.required,disabled:n.readOnly||i.busy},null,8,Bh)),[[Ot,i.values[a.key]]]):a.type==="number"?it((p(),_("input",{key:2,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,type:"number",class:"wm-form__input",placeholder:a.placeholder||"",required:a.required,disabled:n.readOnly||i.busy},null,8,Ph)),[[Ot,i.values[a.key],void 0,{number:!0}]]):a.type==="date"?it((p(),_("input",{key:3,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,type:"date",class:"wm-form__input",required:a.required,disabled:n.readOnly||i.busy},null,8,Fh)),[[Ot,i.values[a.key]]]):a.type==="boolean"?(p(),_("label",Dh,[it(u("input",{id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,type:"checkbox",disabled:n.readOnly||i.busy},null,8,jh),[[ql,i.values[a.key]]]),u("span",null,O(a.placeholder||s.t("common.yes")),1)])):a.type==="select"?it((p(),_("select",{key:5,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,class:"wm-form__select",required:a.required,disabled:n.readOnly||i.busy},[u("option",Hh,O(a.placeholder||s.t("form.choose")),1),(p(!0),_(Z,null,Me(a.options,l=>(p(),_("option",{key:l.value,value:l.value},O(l.label),9,$h))),128))],8,Uh)),[[Wl,i.values[a.key]]]):a.type==="multiselect"?(p(),_("div",Vh,[(p(!0),_(Z,null,Me(a.options,l=>(p(),_("label",{key:l.value,class:"wm-form__multiItem"},[u("input",{type:"checkbox",value:l.value,checked:Array.isArray(i.values[a.key])&&i.values[a.key].includes(l.value),disabled:n.readOnly||i.busy,onChange:f=>s.toggleMulti(a.key,l.value,f.target.checked)},null,40,Kh),u("span",null,O(l.label),1)]))),128))])):D("",!0)]))),128)),i.error?(p(),_("div",qh,O(i.error),1)):D("",!0),n.readOnly?(p(),_("div",Gh,O(s.t("form.responseSent")),1)):(p(),_("button",{key:1,type:"submit",class:"wm-form__submit",disabled:i.busy},[i.busy?(p(),_("span",zh)):D("",!0),u("span",null,O(i.busy?s.t("common.sending"):n.form.submit_label||s.t("common.send")),1)],8,Wh))],32)])}const Jh=we(Sh,[["render",Yh],["__scopeId","data-v-fe65cc56"]]),Qh={name:"WmFeedback",inject:{t:{default:()=>Ee()}},props:{busy:{type:Boolean,default:!1},done:{type:Boolean,default:!1}},emits:["submit"],data(){return{sel:null}},computed:{options(){return[{v:1,e:"😞",l:this.t("feedback.rating1")},{v:2,e:"😐",l:this.t("feedback.rating2")},{v:3,e:"🙂",l:this.t("feedback.rating3")},{v:4,e:"😄",l:this.t("feedback.rating4")},{v:5,e:"🤩",l:this.t("feedback.rating5")}]}},methods:{onSend(){!this.sel||this.busy||this.$emit("submit",{rating:this.sel})}}},Xh={class:"wm-fb"},Zh={class:"wm-fb__title"},em={class:"wm-fb__sub"},tm={class:"wm-fb__row"},nm=["onClick"],sm={class:"wm-fb__emoji"},rm={class:"wm-fb__label"},im=["disabled"],om={key:1,class:"wm-fb__done"},am={class:"wm-fb__doneTitle"},lm={class:"wm-fb__doneSub"};function cm(e,t,n,r,i,s){return p(),_("div",Xh,[n.done?(p(),_("div",om,[t[1]||(t[1]=u("div",{class:"wm-fb__check"},[u("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#fff","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M20 6L9 17l-5-5"})])],-1)),u("div",am,O(s.t("feedback.doneTitle")),1),u("div",lm,O(s.t("feedback.doneSubtitle")),1)])):(p(),_(Z,{key:0},[u("div",Zh,O(s.t("feedback.question")),1),u("div",em,O(s.t("feedback.subtitle")),1),u("div",tm,[(p(!0),_(Z,null,Me(s.options,o=>(p(),_("button",{key:o.v,type:"button",class:re(["wm-fb__opt",{"is-selected":i.sel===o.v}]),onClick:a=>i.sel=o.v},[u("span",sm,O(o.e),1),u("span",rm,O(o.l),1)],10,nm))),128))]),u("button",{type:"button",class:"wm-fb__send",disabled:!i.sel||n.busy,onClick:t[0]||(t[0]=(...o)=>s.onSend&&s.onSend(...o))},O(n.busy?s.t("common.sending"):s.t("feedback.submit")),9,im)],64))])}const um=we(Qh,[["render",cm],["__scopeId","data-v-9b630564"]]),dm={name:"WmMoreMenu",inject:{t:{default:()=>Ee()}},props:{canRename:{type:Boolean,default:!0},canExport:{type:Boolean,default:!0},soundEnabled:{type:Boolean,default:!0},browserNotifEnabled:{type:Boolean,default:!1},statusUrl:{type:String,default:""},helpUrl:{type:String,default:""}},emits:["close","action","sound-toggle","browser-notif-toggle"],data(){return{soundOn:this.soundEnabled,browserNotifOn:this.browserNotifEnabled}},watch:{soundEnabled(e){this.soundOn=!!e},browserNotifEnabled(e){this.browserNotifOn=!!e}},methods:{emit(e){this.$emit("action",e)},toggleSound(){this.soundOn=!this.soundOn,this.$emit("sound-toggle",this.soundOn)},toggleBrowserNotif(){this.browserNotifOn=!this.browserNotifOn,this.$emit("browser-notif-toggle",this.browserNotifOn)}}},fm={class:"wm-mm"},hm={class:"wm-mm__pop",role:"menu"},mm={key:0,class:"wm-mm__section"},pm={class:"wm-mm__label"},gm={class:"wm-mm__label"},_m={key:1,class:"wm-mm__sep"},ym={class:"wm-mm__section"},vm={class:"wm-mm__label"},bm={class:"wm-mm__label"},wm={class:"wm-mm__section"},km={class:"wm-mm__label"},Cm={class:"wm-mm__label"};function Am(e,t,n,r,i,s){return p(),_("div",fm,[u("div",{class:"wm-mm__scrim",onClick:t[0]||(t[0]=o=>e.$emit("close"))}),u("div",hm,[n.canRename||n.canExport?(p(),_("div",mm,[n.canRename?(p(),_("button",{key:0,type:"button",class:"wm-mm__item",onClick:t[1]||(t[1]=o=>s.emit("rename"))},[t[7]||(t[7]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M12 20h9"}),u("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"})])],-1)),u("span",pm,O(s.t("moreMenu.editTitle")),1)])):D("",!0),n.canExport?(p(),_("button",{key:1,type:"button",class:"wm-mm__item",onClick:t[2]||(t[2]=o=>s.emit("export"))},[t[8]||(t[8]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13"})])],-1)),u("span",gm,O(s.t("moreMenu.exportTranscript")),1),t[9]||(t[9]=u("span",{class:"wm-mm__hint"},".txt",-1))])):D("",!0)])):D("",!0),n.canRename||n.canExport?(p(),_("div",_m)):D("",!0),u("div",ym,[u("button",{type:"button",class:"wm-mm__item",onClick:t[3]||(t[3]=(...o)=>s.toggleSound&&s.toggleSound(...o))},[t[11]||(t[11]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M11 5L6 9H2v6h4l5 4V5z"}),u("path",{d:"M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14"})])],-1)),u("span",vm,O(s.t("moreMenu.sound")),1),u("span",{class:re(["wm-mm__toggle",{"wm-mm__toggle--on":i.soundOn}])},[...t[10]||(t[10]=[u("span",{class:"wm-mm__knob"},null,-1)])],2)]),u("button",{type:"button",class:"wm-mm__item",onClick:t[4]||(t[4]=(...o)=>s.toggleBrowserNotif&&s.toggleBrowserNotif(...o))},[t[13]||(t[13]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0118 14.2V11a6 6 0 10-12 0v3.2c0 .5-.2 1-.6 1.4L4 17h5m6 0a3 3 0 11-6 0"})])],-1)),u("span",bm,O(s.t("moreMenu.browserNotifications")),1),u("span",{class:re(["wm-mm__toggle",{"wm-mm__toggle--on":i.browserNotifOn}])},[...t[12]||(t[12]=[u("span",{class:"wm-mm__knob"},null,-1)])],2)])]),t[16]||(t[16]=u("div",{class:"wm-mm__sep"},null,-1)),u("div",wm,[n.statusUrl?(p(),_("button",{key:0,type:"button",class:"wm-mm__item",onClick:t[5]||(t[5]=o=>s.emit("status"))},[t[14]||(t[14]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM10 6v4l3 2"})])],-1)),u("span",km,O(s.t("moreMenu.serviceStatus")),1)])):D("",!0),n.helpUrl?(p(),_("button",{key:1,type:"button",class:"wm-mm__item",onClick:t[6]||(t[6]=o=>s.emit("help"))},[t[15]||(t[15]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M9 11a3 3 0 116 0c0 2-3 2-3 5M12 19h.01M12 22a10 10 0 110-20 10 10 0 010 20z"})])],-1)),u("span",Cm,O(s.t("moreMenu.helpCenter")),1)])):D("",!0)])])])}const Sm=we(dm,[["render",Am],["__scopeId","data-v-76281e95"]]),xm={name:"WmRenameDialog",inject:{t:{default:()=>Ee()}},props:{title:{type:String,default:""},initialValue:{type:String,default:""},placeholder:{type:String,default:""}},emits:["close","submit"],data(){return{value:this.initialValue||""}},computed:{canSubmit(){const e=(this.value||"").trim();return!!e&&e!==(this.initialValue||"").trim()}},mounted(){this.$nextTick(()=>{const e=this.$refs.input;if(e){e.focus();try{e.select()}catch{}}})},methods:{onSubmit(){this.canSubmit&&this.$emit("submit",this.value.trim())}}},Tm={class:"wm-dialog"},Mm={class:"wm-dialog__card",role:"dialog","aria-modal":"true"},Em={class:"wm-dialog__head"},Om={class:"wm-dialog__title"},Im=["aria-label"],Lm={class:"wm-dialog__body"},Rm=["placeholder"],Nm={class:"wm-dialog__actions"},Bm=["disabled"];function Pm(e,t,n,r,i,s){return p(),_("div",Tm,[u("div",{class:"wm-dialog__scrim",onClick:t[0]||(t[0]=o=>e.$emit("close"))}),u("div",Mm,[u("div",Em,[u("div",Om,O(n.title||s.t("rename.title")),1),u("button",{type:"button",class:"wm-dialog__close","aria-label":s.t("common.close"),onClick:t[1]||(t[1]=o=>e.$emit("close"))},[...t[7]||(t[7]=[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Im)]),u("div",Lm,[it(u("input",{ref:"input","onUpdate:modelValue":t[2]||(t[2]=o=>i.value=o),type:"text",class:"wm-dialog__input",placeholder:n.placeholder||s.t("rename.placeholder"),maxlength:120,onKeydown:[t[3]||(t[3]=Pn(yt((...o)=>s.onSubmit&&s.onSubmit(...o),["prevent"]),["enter"])),t[4]||(t[4]=Pn(yt(o=>e.$emit("close"),["prevent"]),["esc"]))]},null,40,Rm),[[Ot,i.value]])]),u("div",Nm,[u("button",{type:"button",class:"wm-dialog__btn",onClick:t[5]||(t[5]=o=>e.$emit("close"))},O(s.t("common.cancel")),1),u("button",{type:"button",class:"wm-dialog__btn wm-dialog__btn--primary",disabled:!s.canSubmit,onClick:t[6]||(t[6]=(...o)=>s.onSubmit&&s.onSubmit(...o))},O(s.t("common.save")),9,Bm)])])])}const Fm=we(xm,[["render",Pm],["__scopeId","data-v-6d5f94a8"]]),qr="ww-messenger-tokens",Dm={name:"Messenger",components:{Launcher:Gc,Header:vu,Onboarding:ed,MessageList:Vf,Composer:ch,SuggestionChips:hh,ApprovalCard:Ch,FormCard:Jh,Feedback:um,MoreMenu:Sm,RenameDialog:Fm},mixins:[yc,Ac,Sc,Tc],provide(){return{signAttachmentFn:e=>{var t,n;return((n=(t=this.store)==null?void 0:t.signAttachment)==null?void 0:n.call(t,e))||null},t:(e,t)=>this.t(e,t),wmLocale:()=>this.locale}},props:{baseUrl:{type:String,default:uc},widgetId:{type:String,default:""},context:{type:Object,default:null},displayMode:{type:String,default:"floating"},devtools:{type:Boolean,default:!1},language:{type:String,default:""}},data(){return{transport:null,store:null,isOpen:!1,draft:"",busy:!1,bootError:null,pendingAttachments:[],feedbackBusy:!1,feedbackDone:!1,convOpenedAt:0,moreOpen:!1,renameDialogOpen:!1,draftConv:null,activeConvId:null,showOnboarding:!1,dismissedPeeks:{},floatHeight:0,floatRO:null,parentOrigin:"",parentToken:"",parentContext:null,parentInitReceived:!1,parentInitDeferred:null}},computed:{isEditor(){return!!this.devtools},isEmbedded(){return this.displayMode==="embedded"},customerLanguage(){var n,r,i,s;const e=(n=this.s)==null?void 0:n.customer,t=e&&(e.language||((r=e.values)==null?void 0:r.language));return t||((s=(i=this.context)==null?void 0:i.customer)==null?void 0:s.language)||""},locale(){var e;return Ws(this.language||this.customerLanguage||((e=this.widget)==null?void 0:e.default_language)||"")},translator(){return Ee(this.locale)},error(){var e;return this.bootError||((e=this.s)==null?void 0:e.error)||null},canBoot(){return!!(this.baseUrl&&this.widgetId)},s(){var e;return((e=this.store)==null?void 0:e.state)||null},ready(){var e;return!!((e=this.s)!=null&&e.ready)},allConversations(){var t;const e=(t=this.s)==null?void 0:t.conversations;return Array.isArray(e)?e:[]},drawerConversations(){var n;const e=((n=this.s)==null?void 0:n.messagesByConv)||{},t=this.revealedAt;return this.allConversations.map(r=>{var f;const i=e[r.id]||[],s=vt(r.last_read_message_id);let o=0,a=null;for(let c=i.length-1;c>=0;c--){const g=i[c];if(!g)continue;if(((f=g.author)==null?void 0:f.type)==="user")break;const S=vt(g.id);if(S!=null){if(s!=null&&S<=s)break;t[g.id]!==0&&(!a&&g.author&&(a=g.author),o++)}}const l=i.filter(c=>!((c==null?void 0:c.id)!=null&&t[c.id]===0));return{...r,_preview:mc(r,l),_unread:o>0,_unreadCount:o,_lastAuthor:a}})},unreadCount(){return this.drawerConversations.filter(e=>e._unread).length},openThreads(){var t;const e=((t=this.s)==null?void 0:t.messagesByConv)||{};return this.drawerConversations.filter(n=>n.status!=="resolved").map(n=>({id:n.id,title:n.name||this.t("common.newConversation"),preview:n._preview||this.t("onboarding.newMessage"),unread:!!n._unread,_ts:Hr(n,e[n.id]||[])})).sort((n,r)=>n._ts<r._ts?1:n._ts>r._ts?-1:0)},latestUnreads(){var n;const e=((n=this.s)==null?void 0:n.messagesByConv)||{},t=[];for(const r of this.drawerConversations){if(!r._unread)continue;const i=Hr(r,e[r.id]||[]),s=r._lastAuthor,o=!s||s.type==="agent_ia",a=(s==null?void 0:s.name)||(o?this.agentName:"")||"",l=(s==null?void 0:s.avatar_url)||(o?this.agentAvatarUrl:null);t.push({convId:r.id,preview:r._preview||this.t("notification.youHaveNewMessage"),ts:i,count:r._unreadCount||1,senderName:a,senderAvatarUrl:l})}return t.sort((r,i)=>r.ts<i.ts?1:r.ts>i.ts?-1:0),t},launcherPeeks(){if(this.isOpen||this.isEmbedded)return[];const e=this.dismissedPeeks||{};return this.latestUnreads.filter(t=>e[t.convId]!==t.ts)},isViewingThread(){return(this.isOpen||this.isEmbedded)&&!!this.currentConv},currentConv(){if(this.draftConv)return this.draftConv;if(this.showOnboarding)return null;const e=this.allConversations;if(!e.length)return null;if(this.activeConvId!=null){const t=e.find(n=>n.id===this.activeConvId);if(t)return t}return e[0]||null},canBack(){return!!this.currentConv},statusUrl(){var n;const e=(n=this.widget)==null?void 0:n.quick_links;if(!Array.isArray(e))return"";const t=e.find(r=>r.icon==="status"&&r.url);return(t==null?void 0:t.url)||""},helpUrl(){var n;const e=(n=this.widget)==null?void 0:n.quick_links;if(!Array.isArray(e))return"";const t=e.find(r=>(r.icon==="chat"||r.icon==="help")&&r.url);return(t==null?void 0:t.url)||""},widget(){var e,t;return((t=(e=this.s)==null?void 0:e.config)==null?void 0:t.widget)||null},widgetWelcomeMessage(){var e;return((e=this.widget)==null?void 0:e.welcome_message)||""},widgetSubtitle(){var e;return((e=this.widget)==null?void 0:e.subtitle)||""},defaultIconUrl(){var e;return((e=this.widget)==null?void 0:e.default_icon_url)||null},agentName(){var e,t,n;return((n=(t=(e=this.s)==null?void 0:e.config)==null?void 0:t.agent)==null?void 0:n.name)||""},agentAvatarUrl(){var e,t,n;return((n=(t=(e=this.s)==null?void 0:e.config)==null?void 0:t.agent)==null?void 0:n.avatar_url)||null},quickLinks(){var t;const e=(t=this.widget)==null?void 0:t.quick_links;return Array.isArray(e)?e:[]},teamMembers(){var t;const e=(t=this.widget)==null?void 0:t.team_members;return Array.isArray(e)?e:[]},responseLabel(){var e;return((e=this.widget)==null?void 0:e.response_time_label)||""},humanMessageAuthor(){var t,n,r;if(!this.currentConv)return null;const e=((t=this.s.messagesByConv)==null?void 0:t[this.currentConv.id])||[];for(let i=e.length-1;i>=0;i--)if(((r=(n=e[i])==null?void 0:n.author)==null?void 0:r.type)==="agent_human")return e[i].author;return null},humanAgentName(){var e;return((e=this.humanMessageAuthor)==null?void 0:e.name)||""},humanAgentAvatarUrl(){var e;return((e=this.humanMessageAuthor)==null?void 0:e.avatar_url)||null},isEscalated(){return!!this.humanMessageAuthor},isWaitingHuman(){var t;const e=(t=this.currentConv)==null?void 0:t.status;return e==="waiting"||e==="handled"},headerTitle(){var e,t;return((e=this.currentConv)==null?void 0:e.name)||((t=this.widget)==null?void 0:t.name)||this.t("common.newConversation")},composerPlaceholder(){return this.isEscalated&&this.humanAgentName?this.t("composer.replyTo",{name:this.humanAgentName.split(" ")[0]}):this.isWaitingHuman?this.t("composer.agentTakingOver"):this.t("composer.placeholder")},displayedMessages(){var n,r;const e=this.currentConv;if(!e)return[];if(!e._draft){const i=(r=(n=this.s)==null?void 0:n.paginationByConv)==null?void 0:r[e.id];if(!(i!=null&&i.loaded))return[]}const t=this.revealedAt;return(this.s.messagesByConv[e.id]||[]).filter(i=>{var s,o,a,l,f;return(i==null?void 0:i.type)==="action"&&((s=i==null?void 0:i.payload)==null?void 0:s.state)==="pending"||gn(i)&&!(t[i.id]>0)?!1:(i==null?void 0:i.type)==="action"||(i==null?void 0:i.type)==="system"||((o=i==null?void 0:i.payload)==null?void 0:o.type)==="system"||Array.isArray((a=i==null?void 0:i.payload)==null?void 0:a.attachments)&&i.payload.attachments.length||(l=i==null?void 0:i.metadata)!=null&&l.artifact||(f=i==null?void 0:i.metadata)!=null&&f.form?!0:typeof(i==null?void 0:i.text_md)=="string"&&i.text_md.trim().length>0})},streamingActive(){var n,r,i;const e=this.currentConv;return e?Object.keys(((n=this.s)==null?void 0:n.streamingByMsgId)||{}).length>0?!0:this.actionInFlight?!1:(((i=(r=this.s)==null?void 0:r.messagesByConv)==null?void 0:i[e.id])||[]).some(s=>gn(s)&&!(this.revealedAt[s.id]>0)):!1},currentConvMessages(){var t,n,r;const e=(t=this.currentConv)==null?void 0:t.id;return e?((r=(n=this.s)==null?void 0:n.messagesByConv)==null?void 0:r[e])||[]:[]},pendingApproval(){return!this.currentConv||!this.store||this.actionInFlight?null:this.store.getPendingApproval(this.currentConv.id)},approvalReady(){return this.pendingApproval?this.pendingApproval.id===this.approvalLatchId?!0:!(this.streamingActive||!this.approvalSettled):!1},approvalTitle(){var e,t,n;return((t=(e=this.pendingApproval)==null?void 0:e.payload)==null?void 0:t.name)||((n=this.pendingApproval)==null?void 0:n.text_md)||this.t("action.title")},approvalDetail(){var r,i,s,o,a,l;const e=(s=(i=(r=this.pendingApproval)==null?void 0:r.payload)==null?void 0:i.pending)==null?void 0:s.user_explanation;if(typeof e=="string"&&e.trim())return e.trim();const t=(l=(a=(o=this.pendingApproval)==null?void 0:o.payload)==null?void 0:a.pending)==null?void 0:l.prepared_params;if(!t||typeof t!="object")return"";const n=Object.entries(t);return n.length?n.slice(0,2).map(([f,c])=>`${f}: ${c}`).join(" · "):""},actionInFlight(){var e,t;return!this.currentConv||!this.store?null:((t=(e=this.store).getActionInFlight)==null?void 0:t.call(e,this.currentConv.id))||null},actionInFlightName(){var t;const e=this.actionInFlight;return e?((t=e.payload)==null?void 0:t.name)||e.text_md||this.t("common.action"):""},suggestions(){return!this.currentConv||!this.store?[]:this.streamingActive?[]:this.pendingForm?[]:this.store.getLatestSuggestions(this.currentConv.id)},pendingForm(){var e,t;return!this.currentConv||!this.store||this.pendingApproval||this.actionInFlight||this.streamingActive||!this.approvalSettled?null:((t=(e=this.store).getLatestForm)==null?void 0:t.call(e,this.currentConv.id))||null},showFeedback(){var t;const e=this.currentConv;return e?this.feedbackDone?!0:e.status!=="resolved"?!1:!((t=e.metadata)!=null&&t.feedback):!1},floatVisible(){return this.approvalReady||!!this.pendingForm||this.showFeedback||this.suggestions.length>0},dateLabel(){var n,r,i;const e=this.currentConv;let t=new Date;if(e){const o=((i=(((r=(n=this.s)==null?void 0:n.messagesByConv)==null?void 0:r[e.id])||[]).find(a=>a==null?void 0:a.created_at))==null?void 0:i.created_at)||e.created_at;if(o){const a=new Date(o);Number.isNaN(a.getTime())||(t=a)}}return this.t("messageList.today",{time:go(t,bn(this.locale))})},paginationState(){var n,r,i;const e=(n=this.currentConv)==null?void 0:n.id,t=e?(i=(r=this.s)==null?void 0:r.paginationByConv)==null?void 0:i[e]:null;return{loading:!!(t!=null&&t.loading),hasMore:!!(t!=null&&t.nextCursor)}}},watch:{isOpen(e){window.parent&&window.parent!==window&&window.parent.postMessage({type:"RESIZE",state:e?"open":"closed",displayMode:this.displayMode},"*")},latestUnreads:{handler(e){const t=new Set(e.map(o=>o.convId)),n=this.dismissedPeeks||{},r=Object.keys(n);if(!r.length)return;const i={};let s=!1;for(const o of r)t.has(o)?i[o]=n[o]:s=!0;s&&(this.dismissedPeeks=i)},deep:!0},"currentConv.id":{handler(e){var t;this.resetRevealQueue(),this.convOpenedAt=Date.now(),this.moreOpen=!1,this.renameDialogOpen=!1,this.resetApprovalPacing(),this.isViewingThread&&(this.unreadAnchorId=vt((t=this.currentConv)==null?void 0:t.last_read_message_id),this.unreadBoundaryTs=e?new Date().toISOString():"")},immediate:!0},isViewingThread(e,t){var n;e&&!t?(this.unreadAnchorId=vt((n=this.currentConv)==null?void 0:n.last_read_message_id),this.unreadBoundaryTs=new Date().toISOString()):e||(this.unreadAnchorId=null,this.unreadBoundaryTs="")},pendingApproval:{handler(e,t){if(e&&!t){const n=e!=null&&e.created_at?Date.parse(e.created_at):NaN;if(!(Number.isFinite(n)&&n>=this.convOpenedAt)){this.resetApprovalPacing();return}this.bumpApprovalSettle(2600)}else!e&&t&&this.resetApprovalPacing()},immediate:!1},streamingActive(e,t){e!==t&&this.pendingApproval&&this.pendingApproval.id!==this.approvalLatchId&&this.bumpApprovalSettle()},approvalReady(e){e&&this.pendingApproval&&(this.approvalLatchId=this.pendingApproval.id)},floatVisible:{handler(e){this.$nextTick(()=>this.syncFloatObserver(e))},immediate:!0},currentConvMessages(e){var t;this.paceMessages(e,(t=this.currentConv)==null?void 0:t.id),(this.isOpen||this.isEmbedded)&&this.currentConv&&this.markConvRead(this.currentConv)}},async mounted(){if(typeof document<"u"&&!document.getElementById(qr)){const e=document.createElement("style");e.id=qr,e.textContent=_o,document.head.appendChild(e)}this._parentMessageHandler=this.onParentMessage.bind(this),window.addEventListener("message",this._parentMessageHandler),window.parent&&window.parent!==window&&window.parent.postMessage({type:"READY"},"*"),this.isEmbedded&&(await this.boot(),this.store&&await this.open())},beforeUnmount(){this._parentMessageHandler&&(window.removeEventListener("message",this._parentMessageHandler),this._parentMessageHandler=null),this.cancelReveals(),this.teardownLiveReveal(),this.disconnectFloatRO(),this.resetApprovalPacing(),this.teardownNotifications(),this.store&&this.store.destroy()},methods:{t(e,t){return this.translator(e,t)},waitForParentInit(){if(this.parentInitReceived)return Promise.resolve();if(!this.parentInitDeferred){let e;this.parentInitDeferred=new Promise(t=>{e=t}),this.parentInitDeferred._resolve=e}return this.parentInitDeferred},onParentMessage(e){var n;const t=e==null?void 0:e.data;!t||typeof t!="object"||t.type!=="INIT"||(this.parentOrigin=e.origin,this.parentToken=typeof t.token=="string"?t.token:"",this.parentContext=t.context&&typeof t.context=="object"?t.context:null,this.parentInitReceived=!0,(n=this.parentInitDeferred)!=null&&n._resolve&&this.parentInitDeferred._resolve())},async boot(){var e,t;if(!this.canBoot){console.warn("[messenger] boot skipped — missing creds");return}try{await this.waitForParentInit(),this.transport=ks(ic({baseUrl:this.baseUrl,widgetId:this.widgetId})),this.store=ks(cc(this.transport)),this.hydrateNotifPref();const n=((e=this.parentContext)==null?void 0:e.customer)||((t=this.context)==null?void 0:t.customer);n&&typeof n=="object"&&await this.store.applyCustomer(n),await this.store.start({origin:this.parentOrigin,token:this.parentToken||void 0}),this.setupLiveReveal()}catch(n){console.error("[ww-messenger] bootstrap failed",n),this.bootError=(n==null?void 0:n.message)||String(n)}},async refresh(){this.store&&this.store.destroy(),this.cancelReveals(),this.teardownLiveReveal(),this.teardownNotifications(),this.convOpenedAt=0,this.transport=null,this.store=null,this.isOpen=!1,this.draft="",this.busy=!1,this.bootError=null,this.pendingAttachments=[],this.feedbackBusy=!1,this.feedbackDone=!1,this.moreOpen=!1,this.renameDialogOpen=!1,this.draftConv=null,this.activeConvId=null,this.showOnboarding=!1,await this.boot(),this.isEmbedded&&this.store&&await this.open()},syncFloatObserver(e){if(this.disconnectFloatRO(),!e){this.floatHeight=0;return}const t=this.$refs.floatEl;if(t){if(typeof ResizeObserver>"u"){this.floatHeight=Math.ceil(t.getBoundingClientRect().height+8);return}this.floatRO=new ResizeObserver(n=>{const r=n[0];if(!r)return;const i=Math.ceil(r.contentRect.height+8);i!==this.floatHeight&&(this.floatHeight=i,this.$nextTick(()=>{var s,o;(o=(s=this.$refs.messageList)==null?void 0:s.scrollToBottom)==null||o.call(s)}))}),this.floatRO.observe(t)}},disconnectFloatRO(){if(this.floatRO){try{this.floatRO.disconnect()}catch{}this.floatRO=null}},async open(){this.isOpen=!0,this.store||await this.boot(),this.store&&this.store.setPanelOpen(!0);const e=this.currentConv;if(e&&!e._draft){this.activeConvId==null&&(this.activeConvId=e.id);try{await this.store.openConversation(e.id)}catch(t){console.error("[ww-messenger] load messages failed",t)}this.markConvRead(e)}},close(){this.isOpen=!1,this.store&&this.store.setPanelOpen(!1)},async openFromPeek(e){var n,r;const t=e||((n=this.latestUnreads[0])==null?void 0:n.convId);t&&t!==((r=this.currentConv)==null?void 0:r.id)&&(this.draftConv=null,this.activeConvId=t,this.showOnboarding=!1),await this.open()},dismissPeek(e){const t=this.latestUnreads.find(n=>n.convId===e);t&&(this.dismissedPeeks={...this.dismissedPeeks,[e]:t.ts})},startConv(){this.draftConv={id:"__draft__",_draft:!0,name:"",created_at:new Date().toISOString()},this.activeConvId=null,this.showOnboarding=!1,this.focusComposer()},async ensureRealConv(){const e=this.currentConv;if(!e)return null;if(!e._draft)return e;if(this.busy)return null;this.busy=!0;try{const t=await this.store.createConversation({});return this.draftConv=null,this.activeConvId=t.id,await this.store.openConversation(t.id),this.markConvRead(t),t}catch(t){return console.error("[ww-messenger] create conv failed",t),this.bootError=(t==null?void 0:t.message)||String(t),null}finally{this.busy=!1}},focusComposer(){this.$nextTick(()=>{var e;return(e=this.$refs.composer)==null?void 0:e.focus()})},toggleMore(){this.moreOpen=!this.moreOpen},goHome(){this.moreOpen=!1,this.draftConv=null,this.activeConvId=null,this.showOnboarding=!0},async onDrawerPick(e){if(!(e!=null&&e.id)||!this.store)return;this.draftConv=null,this.activeConvId=e.id,this.showOnboarding=!1;try{await this.store.openConversation(e.id)}catch(n){console.error("[ww-messenger] open conv failed",n)}const t=this.allConversations.find(n=>n.id===e.id);t&&this.markConvRead(t)},async onMoreAction(e){var t,n;switch(this.moreOpen=!1,e){case"rename":this.openRenameDialog();break;case"export":_c(this.currentConv,this.currentConv?(n=(t=this.s)==null?void 0:t.messagesByConv)==null?void 0:n[this.currentConv.id]:[],this.translator,this.locale);break;case"status":if(this.statusUrl)try{window.open(this.statusUrl,"_blank","noopener")}catch{}break;case"help":if(this.helpUrl)try{window.open(this.helpUrl,"_blank","noopener")}catch{}break}},openRenameDialog(){const e=this.currentConv;!e||e._draft||(this.renameDialogOpen=!0)},async onRenameSubmit(e){const t=this.currentConv;if(this.renameDialogOpen=!1,!t||t._draft||!this.store)return;const n=(e||"").trim();if(!(!n||n===t.name))try{await this.store.patchConversation(t.id,{name:n})}catch(r){console.error("[ww-messenger] rename failed",r)}},async onSend(e){let t=this.currentConv;if(!t&&(this.startConv(),t=this.currentConv,!t)||t._draft&&(t=await this.ensureRealConv(),!t))return;const n=t.id,r=this.pendingAttachments.slice();this.pendingAttachments=[],this.unreadAnchorId=null,this.unreadBoundaryTs="",await this.store.send(n,e,{attachments:r.length?r:void 0})},async onSuggestion(e){const t=e==null?void 0:e.label;t&&await this.onSend(t)},async onLoadMore(){var t;const e=(t=this.currentConv)==null?void 0:t.id;!e||!this.store||await this.store.loadMore(e)},async onApprovalCallback(e){const t=this.pendingApproval;t&&await this.store.clickCallback(t.id,e)},async onFormSubmit({values:e}){const t=this.pendingForm;if(!(t!=null&&t.form))return;const n=fc(t.form,e,this.translator);if(!n)return;let r=this.currentConv;r&&(r._draft&&(r=await this.ensureRealConv(),!r)||await this.store.send(r.id,n,{metadata:{artifact:hc(t.form,e,this.translator)}}))},async onAttach(e){if(!(!e||!this.transport))try{const t=await this.transport.uploadAttachment(e);this.pendingAttachments.push({type:t.type||"file",path:t.path,name:e.name||this.t("attachment.fileFallbackName"),mime_type:e.type,size_bytes:e.size})}catch(t){console.error("[ww-messenger] attachment upload failed",t)}},async onQuickLink(e){if(e){if(e.url){try{window.open(e.url,"_blank","noopener")}catch{}return}this.currentConv||this.startConv(),await this.onSend(e.label)}},async onFeedback({rating:e,comment:t}){if(this.currentConv){this.feedbackBusy=!0;try{await this.store.submitFeedback(this.currentConv.id,{rating:e,comment:t}),this.feedbackDone=!0}catch(n){console.error("[ww-messenger] feedback failed",n)}finally{this.feedbackBusy=!1}}}}},jm={key:0,class:"wm-loading","aria-busy":"true","aria-live":"polite"},Um=["aria-label"],Hm={key:0,class:"wm-state"},$m={class:"wm-state__err"},Vm={class:"wm-state__errTitle"},Km={class:"wm-state__errSub"},qm={class:"wm-bottom"},Wm={key:0,ref:"floatEl",class:"wm-float"},zm={key:1,class:"wm-actionWait",role:"status","aria-live":"polite"},Gm={class:"wm-actionWait__lbl"},Ym={key:2,class:"wm-attached"},Jm=["aria-label","onClick"];function Qm(e,t,n,r,i,s){const o=_e("Launcher"),a=_e("Header"),l=_e("Onboarding"),f=_e("MessageList"),c=_e("ApprovalCard"),g=_e("FormCard"),S=_e("Feedback"),A=_e("SuggestionChips"),K=_e("Composer"),I=_e("MoreMenu"),Q=_e("RenameDialog");return p(),_("div",{class:re(["wm-root",`wm-root--${n.displayMode}`])},[!i.isOpen&&!s.isEmbedded?(p(),be(o,{key:0,"unread-count":s.unreadCount,peeks:s.launcherPeeks,onOpen:s.openFromPeek,onDismiss:s.dismissPeek},null,8,["unread-count","peeks","onOpen","onDismiss"])):D("",!0),i.isOpen||s.isEmbedded?(p(),_("section",{key:1,class:re(["wm-panel",`wm-panel--${n.displayMode}`,{"wm-panel--welcome":s.ready&&!s.error&&!s.currentConv}]),style:je(i.floatHeight?{"--wm-float-h":i.floatHeight+"px"}:null),role:"dialog","aria-label":"Messenger"},[!s.ready&&!s.error?(p(),_("div",jm,[s.isEmbedded?D("",!0):(p(),_("button",{key:0,type:"button",class:"wm-loading__close","aria-label":s.t("loading.minimize"),onClick:t[0]||(t[0]=(...z)=>s.close&&s.close(...z))},[...t[5]||(t[5]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Um)),t[6]||(t[6]=u("div",{class:"wm-loading__spinner","aria-hidden":"true"},null,-1))])):(p(),_(Z,{key:1},[ye(a,{title:s.headerTitle,"team-members":s.teamMembers,"response-label":s.responseLabel,"show-identity":!!s.currentConv,"show-back":s.canBack,"show-close":!s.isEmbedded,"more-active":i.moreOpen,"agent-name":s.agentName,"agent-avatar-url":s.agentAvatarUrl,onBack:s.goHome,onMore:s.toggleMore,onClose:s.close},null,8,["title","team-members","response-label","show-identity","show-back","show-close","more-active","agent-name","agent-avatar-url","onBack","onMore","onClose"]),s.error?(p(),_("div",Hm,[u("div",$m,[t[7]||(t[7]=u("div",{class:"wm-state__errIcon"},[u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})])],-1)),u("div",null,[u("div",Vm,O(s.t("error.connectionFailed")),1),u("div",Km,O(s.error),1)])])])):s.currentConv?(p(),_(Z,{key:2},[ye(f,{ref:"messageList",messages:s.displayedMessages,"streaming-active":s.streamingActive,"date-label":s.dateLabel,"conversation-id":s.currentConv?s.currentConv.id:null,"loading-more":s.paginationState.loading,"has-more":s.paginationState.hasMore,"unread-anchor-id":e.unreadAnchorId,"unread-boundary-ts":e.unreadBoundaryTs,"ai-agent-name":s.agentName,"ai-agent-avatar-url":s.agentAvatarUrl,onLoadMore:s.onLoadMore},null,8,["messages","streaming-active","date-label","conversation-id","loading-more","has-more","unread-anchor-id","unread-boundary-ts","ai-agent-name","ai-agent-avatar-url","onLoadMore"]),u("div",qm,[s.floatVisible?(p(),_("div",Wm,[s.approvalReady?(p(),be(c,{key:0,action:s.approvalTitle,detail:s.approvalDetail,callbacks:s.pendingApproval.callbacks,"agent-name":s.agentName,"agent-avatar-url":s.agentAvatarUrl,onCallback:s.onApprovalCallback},null,8,["action","detail","callbacks","agent-name","agent-avatar-url","onCallback"])):s.pendingForm?(p(),be(g,{key:s.pendingForm.message&&s.pendingForm.message.id,form:s.pendingForm.form,"agent-name":s.agentName,"agent-avatar-url":s.agentAvatarUrl,onSubmit:s.onFormSubmit},null,8,["form","agent-name","agent-avatar-url","onSubmit"])):s.showFeedback?(p(),be(S,{key:2,busy:i.feedbackBusy,done:i.feedbackDone,onSubmit:s.onFeedback},null,8,["busy","done","onSubmit"])):(p(),be(A,{key:3,items:s.suggestions,onSelect:s.onSuggestion},null,8,["items","onSelect"]))],512)):D("",!0),s.actionInFlight?(p(),_("div",zm,[t[8]||(t[8]=u("span",{class:"wm-actionWait__spinner","aria-hidden":"true"},null,-1)),u("span",Gm,O(s.t("action.inProgress",{name:s.actionInFlightName})),1)])):(p(),be(K,{key:2,ref:"composer",modelValue:i.draft,"onUpdate:modelValue":t[1]||(t[1]=z=>i.draft=z),placeholder:s.composerPlaceholder,disabled:!!s.pendingApproval,"attach-label":s.t("composer.attachFile"),onSend:s.onSend,onAttach:s.onAttach},null,8,["modelValue","placeholder","disabled","attach-label","onSend","onAttach"]))]),i.moreOpen?(p(),be(I,{key:0,"can-rename":!!s.currentConv&&!s.currentConv._draft,"can-export":!!s.currentConv&&!s.currentConv._draft,"sound-enabled":e.soundEnabled,"browser-notif-enabled":e.browserNotifEnabled,"status-url":s.statusUrl,"help-url":s.helpUrl,onClose:t[2]||(t[2]=z=>i.moreOpen=!1),onSoundToggle:e.onSoundToggle,onBrowserNotifToggle:e.onBrowserNotifToggle,onAction:s.onMoreAction},null,8,["can-rename","can-export","sound-enabled","browser-notif-enabled","status-url","help-url","onSoundToggle","onBrowserNotifToggle","onAction"])):D("",!0),i.renameDialogOpen&&s.currentConv&&!s.currentConv._draft?(p(),be(Q,{key:1,"initial-value":s.currentConv.name||"",title:s.t("rename.dialogTitle"),onClose:t[3]||(t[3]=z=>i.renameDialogOpen=!1),onSubmit:s.onRenameSubmit},null,8,["initial-value","title","onSubmit"])):D("",!0),i.pendingAttachments.length?(p(),_("div",Ym,[(p(!0),_(Z,null,Me(i.pendingAttachments,(z,q)=>(p(),_("div",{key:q,class:"wm-attached__chip"},[t[10]||(t[10]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})],-1)),u("span",null,O(z.name),1),u("button",{type:"button","aria-label":s.t("attachment.remove"),onClick:X=>i.pendingAttachments.splice(q,1)},[...t[9]||(t[9]=[u("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Jm)]))),128))])):D("",!0)],64)):(p(),be(l,{key:1,"welcome-message":s.widgetWelcomeMessage,subtitle:s.widgetSubtitle,"agent-name":s.agentName,"default-icon-url":s.defaultIconUrl,"quick-links":s.quickLinks,"open-threads":s.openThreads,busy:i.busy,onStart:s.startConv,onSelect:s.onQuickLink,onResume:s.onDrawerPick},null,8,["welcome-message","subtitle","agent-name","default-icon-url","quick-links","open-threads","busy","onStart","onSelect","onResume"])),i.moreOpen&&!s.currentConv?(p(),be(I,{key:3,"can-rename":!1,"can-export":!1,"sound-enabled":e.soundEnabled,"browser-notif-enabled":e.browserNotifEnabled,"status-url":s.statusUrl,"help-url":s.helpUrl,onClose:t[4]||(t[4]=z=>i.moreOpen=!1),onSoundToggle:e.onSoundToggle,onBrowserNotifToggle:e.onBrowserNotifToggle,onAction:s.onMoreAction},null,8,["sound-enabled","browser-notif-enabled","status-url","help-url","onSoundToggle","onBrowserNotifToggle","onAction"])):D("",!0)],64))],6)):D("",!0)],2)}const Xm=we(Dm,[["render",Qm],["__scopeId","data-v-1c840488"]]),Wr=window.__WIDGET_ID,zr=window.__BASE_URL,Zm=window.__DISPLAY_MODE||"floating",Gr=window.__LANGUAGE||"";if(!Wr||!zr)console.error("[messenger-iframe] missing __WIDGET_ID or __BASE_URL globals");else{if(!document.getElementById("wm-tokens")){const e=document.createElement("style");e.id="wm-tokens",e.textContent=_o,document.head.appendChild(e)}Xl({render:()=>fo(Xm,{baseUrl:zr,widgetId:Wr,displayMode:Zm,...Gr?{language:Gr}:{}})}).mount("#app")}