langchat-widget 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).LangChatWidget={})}(this,function(e){"use strict";
2
+ /**
3
+ * @vue/shared v3.5.20
4
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
5
+ * @license MIT
6
+ **/
7
+ /*! #__NO_SIDE_EFFECTS__ */function t(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}const n={},s=[],r=()=>{},o=()=>!1,i=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),a=e=>e.startsWith("onUpdate:"),l=Object.assign,c=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},u=Object.prototype.hasOwnProperty,h=(e,t)=>u.call(e,t),d=Array.isArray,p=e=>"[object Map]"===w(e),f=e=>"[object Set]"===w(e),m=e=>"function"==typeof e,g=e=>"string"==typeof e,y=e=>"symbol"==typeof e,_=e=>null!==e&&"object"==typeof e,b=e=>(_(e)||m(e))&&m(e.then)&&m(e.catch),v=Object.prototype.toString,w=e=>v.call(e),x=e=>"[object Object]"===w(e),k=e=>g(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,C=t(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),A=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},E=/-(\w)/g,D=A(e=>e.replace(E,(e,t)=>t?t.toUpperCase():"")),S=/\B([A-Z])/g,F=A(e=>e.replace(S,"-$1").toLowerCase()),I=A(e=>e.charAt(0).toUpperCase()+e.slice(1)),R=A(e=>e?`on${I(e)}`:""),T=(e,t)=>!Object.is(e,t),M=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},O=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},P=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let L;const $=()=>L||(L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function B(e){if(d(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=g(s)?j(s):B(s);if(r)for(const e in r)t[e]=r[e]}return t}if(g(e)||_(e))return e}const z=/;(?![^(]*\))/g,N=/:([^]+)/,q=/\/\*[^]*?\*\//g;function j(e){const t={};return e.replace(q,"").split(z).forEach(e=>{if(e){const n=e.split(N);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function U(e){let t="";if(g(e))t=e;else if(d(e))for(let n=0;n<e.length;n++){const s=U(e[n]);s&&(t+=s+" ")}else if(_(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const H=t("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function W(e){return!!e||""===e}const V=e=>!(!e||!0!==e.__v_isRef),Q=e=>g(e)?e:null==e?"":d(e)||_(e)&&(e.toString===v||!m(e.toString))?V(e)?Q(e.value):JSON.stringify(e,J,2):String(e),J=(e,t)=>V(t)?J(e,t.value):p(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],s)=>(e[Z(t,s)+" =>"]=n,e),{})}:f(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Z(e))}:y(t)?Z(t):!_(t)||d(t)||x(t)?t:String(t),Z=(e,t="")=>{var n;return y(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};
8
+ /**
9
+ * @vue/reactivity v3.5.20
10
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
11
+ * @license MIT
12
+ **/
13
+ let G,K;class X{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=G,!e&&G&&(this.index=(G.scopes||(G.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=G;try{return G=this,e()}finally{G=t}}}on(){1===++this._on&&(this.prevScope=G,G=this)}off(){this._on>0&&0===--this._on&&(G=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){let t,n;for(this._active=!1,t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}const Y=new WeakSet;class ee{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,G&&G.active&&G.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,Y.has(this)&&(Y.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||re(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,ye(this),ae(this);const e=K,t=pe;K=this,pe=!0;try{return this.fn()}finally{le(this),K=e,pe=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)he(e);this.deps=this.depsTail=void 0,ye(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?Y.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ce(this)&&this.run()}get dirty(){return ce(this)}}let te,ne,se=0;function re(e,t=!1){if(e.flags|=8,t)return e.next=ne,void(ne=e);e.next=te,te=e}function oe(){se++}function ie(){if(--se>0)return;if(ne){let e=ne;for(ne=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;te;){let n=te;for(te=void 0;n;){const s=n.next;if(n.next=void 0,n.flags&=-9,1&n.flags)try{n.trigger()}catch(t){e||(e=t)}n=s}}if(e)throw e}function ae(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function le(e){let t,n=e.depsTail,s=n;for(;s;){const e=s.prevDep;-1===s.version?(s===n&&(n=e),he(s),de(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=e}e.deps=t,e.depsTail=n}function ce(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ue(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ue(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===_e)return;if(e.globalVersion=_e,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!ce(e)))return;e.flags|=2;const t=e.dep,n=K,s=pe;K=e,pe=!0;try{ae(e);const n=e.fn(e._value);(0===t.version||T(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(r){throw t.version++,r}finally{K=n,pe=s,le(e),e.flags&=-3}}function he(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)he(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function de(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let pe=!0;const fe=[];function me(){fe.push(pe),pe=!1}function ge(){const e=fe.pop();pe=void 0===e||e}function ye(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=K;K=void 0;try{t()}finally{K=e}}}let _e=0;class be{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ve{constructor(e){this.computed=e,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(e){if(!K||!pe||K===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==K)t=this.activeLink=new be(K,this),K.deps?(t.prevDep=K.depsTail,K.depsTail.nextDep=t,K.depsTail=t):K.deps=K.depsTail=t,we(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){const e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=K.depsTail,t.nextDep=void 0,K.depsTail.nextDep=t,K.depsTail=t,K.deps===t&&(K.deps=e)}return t}trigger(e){this.version++,_e++,this.notify(e)}notify(e){oe();try{0;for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{ie()}}}function we(e){if(e.dep.sc++,4&e.sub.flags){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)we(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const xe=new WeakMap,ke=Symbol(""),Ce=Symbol(""),Ae=Symbol("");function Ee(e,t,n){if(pe&&K){let t=xe.get(e);t||xe.set(e,t=new Map);let s=t.get(n);s||(t.set(n,s=new ve),s.map=t,s.key=n),s.track()}}function De(e,t,n,s,r,o){const i=xe.get(e);if(!i)return void _e++;const a=e=>{e&&e.trigger()};if(oe(),"clear"===t)i.forEach(a);else{const r=d(e),o=r&&k(n);if(r&&"length"===n){const e=Number(s);i.forEach((t,n)=>{("length"===n||n===Ae||!y(n)&&n>=e)&&a(t)})}else switch((void 0!==n||i.has(void 0))&&a(i.get(n)),o&&a(i.get(Ae)),t){case"add":r?o&&a(i.get("length")):(a(i.get(ke)),p(e)&&a(i.get(Ce)));break;case"delete":r||(a(i.get(ke)),p(e)&&a(i.get(Ce)));break;case"set":p(e)&&a(i.get(ke))}}ie()}function Se(e){const t=dt(e);return t===e?t:(Ee(t,0,Ae),ut(e)?t:t.map(pt))}function Fe(e){return Ee(e=dt(e),0,Ae),e}const Ie={__proto__:null,[Symbol.iterator](){return Re(this,Symbol.iterator,pt)},concat(...e){return Se(this).concat(...e.map(e=>d(e)?Se(e):e))},entries(){return Re(this,"entries",e=>(e[1]=pt(e[1]),e))},every(e,t){return Me(this,"every",e,t,void 0,arguments)},filter(e,t){return Me(this,"filter",e,t,e=>e.map(pt),arguments)},find(e,t){return Me(this,"find",e,t,pt,arguments)},findIndex(e,t){return Me(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Me(this,"findLast",e,t,pt,arguments)},findLastIndex(e,t){return Me(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Me(this,"forEach",e,t,void 0,arguments)},includes(...e){return Pe(this,"includes",e)},indexOf(...e){return Pe(this,"indexOf",e)},join(e){return Se(this).join(e)},lastIndexOf(...e){return Pe(this,"lastIndexOf",e)},map(e,t){return Me(this,"map",e,t,void 0,arguments)},pop(){return Le(this,"pop")},push(...e){return Le(this,"push",e)},reduce(e,...t){return Oe(this,"reduce",e,t)},reduceRight(e,...t){return Oe(this,"reduceRight",e,t)},shift(){return Le(this,"shift")},some(e,t){return Me(this,"some",e,t,void 0,arguments)},splice(...e){return Le(this,"splice",e)},toReversed(){return Se(this).toReversed()},toSorted(e){return Se(this).toSorted(e)},toSpliced(...e){return Se(this).toSpliced(...e)},unshift(...e){return Le(this,"unshift",e)},values(){return Re(this,"values",pt)}};function Re(e,t,n){const s=Fe(e),r=s[t]();return s===e||ut(e)||(r._next=r.next,r.next=()=>{const e=r._next();return e.value&&(e.value=n(e.value)),e}),r}const Te=Array.prototype;function Me(e,t,n,s,r,o){const i=Fe(e),a=i!==e&&!ut(e),l=i[t];if(l!==Te[t]){const t=l.apply(e,o);return a?pt(t):t}let c=n;i!==e&&(a?c=function(t,s){return n.call(this,pt(t),s,e)}:n.length>2&&(c=function(t,s){return n.call(this,t,s,e)}));const u=l.call(i,c,s);return a&&r?r(u):u}function Oe(e,t,n,s){const r=Fe(e);let o=n;return r!==e&&(ut(e)?n.length>3&&(o=function(t,s,r){return n.call(this,t,s,r,e)}):o=function(t,s,r){return n.call(this,t,pt(s),r,e)}),r[t](o,...s)}function Pe(e,t,n){const s=dt(e);Ee(s,0,Ae);const r=s[t](...n);return-1!==r&&!1!==r||!ht(n[0])?r:(n[0]=dt(n[0]),s[t](...n))}function Le(e,t,n=[]){me(),oe();const s=dt(e)[t].apply(e,n);return ie(),ge(),s}const $e=t("__proto__,__v_isRef,__isVue"),Be=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(y));function ze(e){y(e)||(e=String(e));const t=dt(this);return Ee(t,0,e),t.hasOwnProperty(e)}class Ne{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;const s=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!s;if("__v_isReadonly"===t)return s;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(s?r?st:nt:r?tt:et).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const o=d(e);if(!s){let e;if(o&&(e=Ie[t]))return e;if("hasOwnProperty"===t)return ze}const i=Reflect.get(e,t,mt(e)?e:n);return(y(t)?Be.has(t):$e(t))?i:(s||Ee(e,0,t),r?i:mt(i)?o&&k(t)?i:i.value:_(i)?s?it(i):ot(i):i)}}class qe extends Ne{constructor(e=!1){super(!1,e)}set(e,t,n,s){let r=e[t];if(!this._isShallow){const t=ct(r);if(ut(n)||ct(n)||(r=dt(r),n=dt(n)),!d(e)&&mt(r)&&!mt(n))return t||(r.value=n),!0}const o=d(e)&&k(t)?Number(t)<e.length:h(e,t),i=Reflect.set(e,t,n,mt(e)?e:s);return e===dt(s)&&(o?T(n,r)&&De(e,"set",t,n):De(e,"add",t,n)),i}deleteProperty(e,t){const n=h(e,t);e[t];const s=Reflect.deleteProperty(e,t);return s&&n&&De(e,"delete",t,void 0),s}has(e,t){const n=Reflect.has(e,t);return y(t)&&Be.has(t)||Ee(e,0,t),n}ownKeys(e){return Ee(e,0,d(e)?"length":ke),Reflect.ownKeys(e)}}class je extends Ne{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const Ue=new qe,He=new je,We=new qe(!0),Ve=e=>e,Qe=e=>Reflect.getPrototypeOf(e);function Je(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Ze(e,t){const n={get(n){const s=this.__v_raw,r=dt(s),o=dt(n);e||(T(n,o)&&Ee(r,0,n),Ee(r,0,o));const{has:i}=Qe(r),a=t?Ve:e?ft:pt;return i.call(r,n)?a(s.get(n)):i.call(r,o)?a(s.get(o)):void(s!==r&&s.get(n))},get size(){const t=this.__v_raw;return!e&&Ee(dt(t),0,ke),t.size},has(t){const n=this.__v_raw,s=dt(n),r=dt(t);return e||(T(t,r)&&Ee(s,0,t),Ee(s,0,r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,s){const r=this,o=r.__v_raw,i=dt(o),a=t?Ve:e?ft:pt;return!e&&Ee(i,0,ke),o.forEach((e,t)=>n.call(s,a(e),a(t),r))}};l(n,e?{add:Je("add"),set:Je("set"),delete:Je("delete"),clear:Je("clear")}:{add(e){t||ut(e)||ct(e)||(e=dt(e));const n=dt(this);return Qe(n).has.call(n,e)||(n.add(e),De(n,"add",e,e)),this},set(e,n){t||ut(n)||ct(n)||(n=dt(n));const s=dt(this),{has:r,get:o}=Qe(s);let i=r.call(s,e);i||(e=dt(e),i=r.call(s,e));const a=o.call(s,e);return s.set(e,n),i?T(n,a)&&De(s,"set",e,n):De(s,"add",e,n),this},delete(e){const t=dt(this),{has:n,get:s}=Qe(t);let r=n.call(t,e);r||(e=dt(e),r=n.call(t,e)),s&&s.call(t,e);const o=t.delete(e);return r&&De(t,"delete",e,void 0),o},clear(){const e=dt(this),t=0!==e.size,n=e.clear();return t&&De(e,"clear",void 0,void 0),n}});return["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=function(e,t,n){return function(...s){const r=this.__v_raw,o=dt(r),i=p(o),a="entries"===e||e===Symbol.iterator&&i,l="keys"===e&&i,c=r[e](...s),u=n?Ve:t?ft:pt;return!t&&Ee(o,0,l?Ce:ke),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}(s,e,t)}),n}function Ge(e,t){const n=Ze(e,t);return(t,s,r)=>"__v_isReactive"===s?!e:"__v_isReadonly"===s?e:"__v_raw"===s?t:Reflect.get(h(n,s)&&s in t?n:t,s,r)}const Ke={get:Ge(!1,!1)},Xe={get:Ge(!1,!0)},Ye={get:Ge(!0,!1)},et=new WeakMap,tt=new WeakMap,nt=new WeakMap,st=new WeakMap;function rt(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>w(e).slice(8,-1))(e))}function ot(e){return ct(e)?e:at(e,!1,Ue,Ke,et)}function it(e){return at(e,!0,He,Ye,nt)}function at(e,t,n,s,r){if(!_(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const o=rt(e);if(0===o)return e;const i=r.get(e);if(i)return i;const a=new Proxy(e,2===o?s:n);return r.set(e,a),a}function lt(e){return ct(e)?lt(e.__v_raw):!(!e||!e.__v_isReactive)}function ct(e){return!(!e||!e.__v_isReadonly)}function ut(e){return!(!e||!e.__v_isShallow)}function ht(e){return!!e&&!!e.__v_raw}function dt(e){const t=e&&e.__v_raw;return t?dt(t):e}const pt=e=>_(e)?ot(e):e,ft=e=>_(e)?it(e):e;function mt(e){return!!e&&!0===e.__v_isRef}function gt(e){return function(e,t){if(mt(e))return e;return new yt(e,t)}(e,!1)}class yt{constructor(e,t){this.dep=new ve,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:dt(e),this._value=t?e:pt(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||ut(e)||ct(e);e=n?e:dt(e),T(e,t)&&(this._rawValue=e,this._value=n?e:pt(e),this.dep.trigger())}}function _t(e){return mt(e)?e.value:e}const bt={get:(e,t,n)=>"__v_raw"===t?e:_t(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return mt(r)&&!mt(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function vt(e){return lt(e)?e:new Proxy(e,bt)}class wt{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new ve(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=_e-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&K!==this)return re(this,!0),!0}get value(){const e=this.dep.track();return ue(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}const xt={},kt=new WeakMap;let Ct;function At(e,t,s=n){const{immediate:o,deep:i,once:a,scheduler:l,augmentJob:u,call:h}=s,p=e=>i?e:ut(e)||!1===i||0===i?Et(e,1):Et(e);let f,g,y,_,b=!1,v=!1;if(mt(e)?(g=()=>e.value,b=ut(e)):lt(e)?(g=()=>p(e),b=!0):d(e)?(v=!0,b=e.some(e=>lt(e)||ut(e)),g=()=>e.map(e=>mt(e)?e.value:lt(e)?p(e):m(e)?h?h(e,2):e():void 0)):g=m(e)?t?h?()=>h(e,2):e:()=>{if(y){me();try{y()}finally{ge()}}const t=Ct;Ct=f;try{return h?h(e,3,[_]):e(_)}finally{Ct=t}}:r,t&&i){const e=g,t=!0===i?1/0:i;g=()=>Et(e(),t)}const w=G,x=()=>{f.stop(),w&&w.active&&c(w.effects,f)};if(a&&t){const e=t;t=(...t)=>{e(...t),x()}}let k=v?new Array(e.length).fill(xt):xt;const C=e=>{if(1&f.flags&&(f.dirty||e))if(t){const e=f.run();if(i||b||(v?e.some((e,t)=>T(e,k[t])):T(e,k))){y&&y();const n=Ct;Ct=f;try{const n=[e,k===xt?void 0:v&&k[0]===xt?[]:k,_];k=e,h?h(t,3,n):t(...n)}finally{Ct=n}}}else f.run()};return u&&u(C),f=new ee(g),f.scheduler=l?()=>l(C,!1):C,_=e=>function(e,t=!1,n=Ct){if(n){let t=kt.get(n);t||kt.set(n,t=[]),t.push(e)}}(e,!1,f),y=f.onStop=()=>{const e=kt.get(f);if(e){if(h)h(e,4);else for(const t of e)t();kt.delete(f)}},t?o?C(!0):k=f.run():l?l(C.bind(null,!0),!0):f.run(),x.pause=f.pause.bind(f),x.resume=f.resume.bind(f),x.stop=x,x}function Et(e,t=1/0,n){if(t<=0||!_(e)||e.__v_skip)return e;if((n=n||new Set).has(e))return e;if(n.add(e),t--,mt(e))Et(e.value,t,n);else if(d(e))for(let s=0;s<e.length;s++)Et(e[s],t,n);else if(f(e)||p(e))e.forEach(e=>{Et(e,t,n)});else if(x(e)){for(const s in e)Et(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Et(e[s],t,n)}return e}
14
+ /**
15
+ * @vue/runtime-core v3.5.20
16
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
17
+ * @license MIT
18
+ **/function Dt(e,t,n,s){try{return s?e(...s):e()}catch(r){Ft(r,t,n)}}function St(e,t,n,s){if(m(e)){const r=Dt(e,t,n,s);return r&&b(r)&&r.catch(e=>{Ft(e,t,n)}),r}if(d(e)){const r=[];for(let o=0;o<e.length;o++)r.push(St(e[o],t,n,s));return r}}function Ft(e,t,s,r=!0){t&&t.vnode;const{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||n;if(t){let n=t.parent;const r=t.proxy,i=`https://vuejs.org/error-reference/#runtime-${s}`;for(;n;){const t=n.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,r,i))return;n=n.parent}if(o)return me(),Dt(o,null,10,[e,r,i]),void ge()}!function(e,t,n,s=!0,r=!1){if(r)throw e;console.error(e)}(e,0,0,r,i)}const It=[];let Rt=-1;const Tt=[];let Mt=null,Ot=0;const Pt=Promise.resolve();let Lt=null;function $t(e){const t=Lt||Pt;return e?t.then(this?e.bind(this):e):t}function Bt(e){if(!(1&e.flags)){const t=jt(e),n=It[It.length-1];!n||!(2&e.flags)&&t>=jt(n)?It.push(e):It.splice(function(e){let t=Rt+1,n=It.length;for(;t<n;){const s=t+n>>>1,r=It[s],o=jt(r);o<e||o===e&&2&r.flags?t=s+1:n=s}return t}(t),0,e),e.flags|=1,zt()}}function zt(){Lt||(Lt=Pt.then(Ut))}function Nt(e,t,n=Rt+1){for(;n<It.length;n++){const t=It[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;It.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function qt(e){if(Tt.length){const e=[...new Set(Tt)].sort((e,t)=>jt(e)-jt(t));if(Tt.length=0,Mt)return void Mt.push(...e);for(Mt=e,Ot=0;Ot<Mt.length;Ot++){const e=Mt[Ot];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}Mt=null,Ot=0}}const jt=e=>null==e.id?2&e.flags?-1:1/0:e.id;function Ut(e){try{for(Rt=0;Rt<It.length;Rt++){const e=It[Rt];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),Dt(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;Rt<It.length;Rt++){const e=It[Rt];e&&(e.flags&=-2)}Rt=-1,It.length=0,qt(),Lt=null,(It.length||Tt.length)&&Ut()}}let Ht=null,Wt=null;function Vt(e){const t=Ht;return Ht=e,Wt=e&&e.type.__scopeId||null,t}function Qt(e,t=Ht,n){if(!t)return e;if(e._n)return e;const s=(...n)=>{s._d&&is(-1);const r=Vt(t);let o;try{o=e(...n)}finally{Vt(r),s._d&&is(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function Jt(e,t){if(null===Ht)return e;const s=$s(Ht),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[e,i,a,l=n]=t[o];e&&(m(e)&&(e={mounted:e,updated:e}),e.deep&&Et(i),r.push({dir:e,instance:s,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Zt(e,t,n,s){const r=e.dirs,o=t&&t.dirs;for(let i=0;i<r.length;i++){const a=r[i];o&&(a.oldValue=o[i].value);let l=a.dir[s];l&&(me(),St(l,n,8,[e.el,a,e,t]),ge())}}const Gt=Symbol("_vte"),Kt=Symbol("_leaveCb");function Xt(e,t){6&e.shapeFlag&&e.component?(e.transition=t,Xt(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}
19
+ /*! #__NO_SIDE_EFFECTS__ */function Yt(e,t){return m(e)?(()=>l({name:e.name},t,{setup:e}))():e}function en(e,t,s,r,i=!1){if(d(e))return void e.forEach((e,n)=>en(e,t&&(d(t)?t[n]:t),s,r,i));if(tn(r)&&!i)return void(512&r.shapeFlag&&r.type.__asyncResolved&&r.component.subTree.component&&en(e,t,s,r.component.subTree));const a=4&r.shapeFlag?$s(r.component):r.el,l=i?null:a,{i:u,r:p}=e,f=t&&t.r,y=u.refs===n?u.refs={}:u.refs,_=u.setupState,b=dt(_),v=_===n?o:e=>h(b,e);if(null!=f&&f!==p)if(g(f))y[f]=null,v(f)&&(_[f]=null);else if(mt(f)){f.value=null;const e=t;e.k&&(y[e.k]=null)}if(m(p))Dt(p,u,12,[l,y]);else{const t=g(p),n=mt(p);if(t||n){const r=()=>{if(e.f){const n=t?v(p)?_[p]:y[p]:p.value;if(i)d(n)&&c(n,a);else if(d(n))n.includes(a)||n.push(a);else if(t)y[p]=[a],v(p)&&(_[p]=y[p]);else{const t=[a];p.value=t,e.k&&(y[e.k]=t)}}else t?(y[p]=l,v(p)&&(_[p]=l)):n&&(p.value=l,e.k&&(y[e.k]=l))};l?(r.id=-1,Mn(r,s)):r()}}}$().requestIdleCallback,$().cancelIdleCallback;const tn=e=>!!e.type.__asyncLoader;const nn=(sn="m",(e,t=Es)=>{Ms&&"sp"!==sn||function(e,t,n=Es,s=!1){if(n){const r=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...s)=>{me();const r=Is(n),o=St(t,n,e,s);return r(),ge(),o});s?r.unshift(o):r.push(o)}}(sn,(...t)=>e(...t),t)});var sn;const rn=Symbol.for("v-ndc");function on(e){return g(e)?function(e,t,n=!0,s=!1){const r=Ht||Es;if(r){const n=r.type;{const e=Bs(n,!1);if(e&&(e===t||e===D(t)||e===I(D(t))))return n}const o=an(r[e]||n[e],t)||an(r.appContext[e],t);return!o&&s?n:o}}("components",e,!1)||e:e||rn}function an(e,t){return e&&(e[t]||e[D(t)]||e[I(D(t))])}function ln(e,t,n,s){let r;const o=n,i=d(e);if(i||g(e)){let n=!1,s=!1;i&&lt(e)&&(n=!ut(e),s=ct(e),e=Fe(e)),r=new Array(e.length);for(let i=0,a=e.length;i<a;i++)r[i]=t(n?s?ft(pt(e[i])):pt(e[i]):e[i],i,void 0,o)}else if("number"==typeof e){r=new Array(e);for(let n=0;n<e;n++)r[n]=t(n+1,n,void 0,o)}else if(_(e))if(e[Symbol.iterator])r=Array.from(e,(e,n)=>t(e,n,void 0,o));else{const n=Object.keys(e);r=new Array(n.length);for(let s=0,i=n.length;s<i;s++){const i=n[s];r[s]=t(e[i],i,s,o)}}else r=[];return r}function cn(e,t,n={},s,r){if(Ht.ce||Ht.parent&&tn(Ht.parent)&&Ht.parent.ce)return rs(),cs(Xn,null,[ms("slot",n,s)],64);let o=e[t];o&&o._c&&(o._d=!1),rs();const i=o&&un(o(n)),a=n.key||i&&i.key,l=cs(Xn,{key:(a&&!y(a)?a:`_${t}`)+(!i&&s?"_fb":"")},i||[],i&&1===e._?64:-2);return l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),o&&o._c&&(o._d=!0),l}function un(e){return e.some(e=>!us(e)||e.type!==es&&!(e.type===Xn&&!un(e.children)))?e:null}const hn=e=>e?Ts(e)?$s(e):hn(e.parent):null,dn=l(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=>hn(e.parent),$root:e=>hn(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>e.type,$forceUpdate:e=>e.f||(e.f=()=>{Bt(e.update)}),$nextTick:e=>e.n||(e.n=$t.bind(e.proxy)),$watch:e=>r}),pn=(e,t)=>e!==n&&!e.__isScriptSetup&&h(e,t),fn={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:s,setupState:r,data:o,props:i,accessCache:a,type:l,appContext:c}=e;let u;if("$"!==t[0]){const l=a[t];if(void 0!==l)switch(l){case 1:return r[t];case 2:return o[t];case 4:return s[t];case 3:return i[t]}else{if(pn(r,t))return a[t]=1,r[t];if(o!==n&&h(o,t))return a[t]=2,o[t];if((u=e.propsOptions[0])&&h(u,t))return a[t]=3,i[t];if(s!==n&&h(s,t))return a[t]=4,s[t];a[t]=0}}const d=dn[t];let p,f;return d?("$attrs"===t&&Ee(e.attrs,0,""),d(e)):(p=l.__cssModules)&&(p=p[t])?p:s!==n&&h(s,t)?(a[t]=4,s[t]):(f=c.config.globalProperties,h(f,t)?f[t]:void 0)},set({_:e},t,s){const{data:r,setupState:o,ctx:i}=e;return pn(o,t)?(o[t]=s,!0):r!==n&&h(r,t)?(r[t]=s,!0):!h(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(i[t]=s,!0))},has({_:{data:e,setupState:t,accessCache:s,ctx:r,appContext:o,propsOptions:i,type:a}},l){let c,u;return!!(s[l]||e!==n&&"$"!==l[0]&&h(e,l)||pn(t,l)||(c=i[0])&&h(c,l)||h(r,l)||h(dn,l)||h(o.config.globalProperties,l)||(u=a.__cssModules)&&u[l])},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:h(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function mn(){return{app:null,config:{isNativeTag:o,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 gn=0;function yn(e,t){return function(t,n=null){m(t)||(t=l({},t)),null==n||_(n)||(n=null);const s=mn(),r=new WeakSet,o=[];let i=!1;const a=s.app={_uid:gn++,_component:t,_props:n,_container:null,_context:s,_instance:null,version:qs,get config(){return s.config},set config(e){},use:(e,...t)=>(r.has(e)||(e&&m(e.install)?(r.add(e),e.install(a,...t)):m(e)&&(r.add(e),e(a,...t))),a),mixin:e=>a,component:(e,t)=>t?(s.components[e]=t,a):s.components[e],directive:(e,t)=>t?(s.directives[e]=t,a):s.directives[e],mount(r,o,l){if(!i){const o=a._ceVNode||ms(t,n);return o.appContext=s,!0===l?l="svg":!1===l&&(l=void 0),e(o,r,l),i=!0,a._container=r,r.__vue_app__=a,$s(o.component)}},onUnmount(e){o.push(e)},unmount(){i&&(St(o,a._instance,16),e(null,a._container),delete a._container.__vue_app__)},provide:(e,t)=>(s.provides[e]=t,a),runWithContext(e){const t=_n;_n=a;try{return e()}finally{_n=t}}};return a}}let _n=null;const bn={},vn=()=>Object.create(bn),wn=e=>Object.getPrototypeOf(e)===bn;function xn(e,t,n,s=!1){const r={},o=vn();e.propsDefaults=Object.create(null),kn(e,t,r,o);for(const i in e.propsOptions[0])i in r||(r[i]=void 0);n?e.props=s?r:at(r,!1,We,Xe,tt):e.type.props?e.props=r:e.props=o,e.attrs=o}function kn(e,t,s,r){const[o,i]=e.propsOptions;let a,l=!1;if(t)for(let n in t){if(C(n))continue;const c=t[n];let u;o&&h(o,u=D(n))?i&&i.includes(u)?(a||(a={}))[u]=c:s[u]=c:Vn(e.emitsOptions,n)||n in r&&c===r[n]||(r[n]=c,l=!0)}if(i){const t=dt(s),r=a||n;for(let n=0;n<i.length;n++){const a=i[n];s[a]=Cn(o,t,a,r[a],e,!h(r,a))}}return l}function Cn(e,t,n,s,r,o){const i=e[n];if(null!=i){const e=h(i,"default");if(e&&void 0===s){const e=i.default;if(i.type!==Function&&!i.skipFactory&&m(e)){const{propsDefaults:o}=r;if(n in o)s=o[n];else{const i=Is(r);s=o[n]=e.call(null,t),i()}}else s=e;r.ce&&r.ce._setProp(n,s)}i[0]&&(o&&!e?s=!1:!i[1]||""!==s&&s!==F(n)||(s=!0))}return s}function An(e,t,r=!1){const o=t.propsCache,i=o.get(e);if(i)return i;const a=e.props,c={},u=[];if(!a)return _(e)&&o.set(e,s),s;if(d(a))for(let s=0;s<a.length;s++){const e=D(a[s]);En(e)&&(c[e]=n)}else if(a)for(const n in a){const e=D(n);if(En(e)){const t=a[n],s=c[e]=d(t)||m(t)?{type:t}:l({},t),r=s.type;let o=!1,i=!0;if(d(r))for(let e=0;e<r.length;++e){const t=r[e],n=m(t)&&t.name;if("Boolean"===n){o=!0;break}"String"===n&&(i=!1)}else o=m(r)&&"Boolean"===r.name;s[0]=o,s[1]=i,(o||h(s,"default"))&&u.push(e)}}const p=[c,u];return _(e)&&o.set(e,p),p}function En(e){return"$"!==e[0]&&!C(e)}const Dn=e=>"_"===e||"_ctx"===e||"$stable"===e,Sn=e=>d(e)?e.map(vs):[vs(e)],Fn=(e,t,n)=>{if(t._n)return t;const s=Qt((...e)=>Sn(t(...e)),n);return s._c=!1,s},In=(e,t,n)=>{const s=e._ctx;for(const r in e){if(Dn(r))continue;const n=e[r];if(m(n))t[r]=Fn(0,n,s);else if(null!=n){const e=Sn(n);t[r]=()=>e}}},Rn=(e,t)=>{const n=Sn(t);e.slots.default=()=>n},Tn=(e,t,n)=>{for(const s in t)!n&&Dn(s)||(e[s]=t[s])},Mn=function(e,t){t&&t.pendingBranch?d(e)?t.effects.push(...e):t.effects.push(e):(d(n=e)?Tt.push(...n):Mt&&-1===n.id?Mt.splice(Ot+1,0,n):1&n.flags||(Tt.push(n),n.flags|=1),zt());var n};function On(e){return function(e){$().__VUE__=!0;const{insert:t,remove:o,patchProp:i,createElement:a,createText:l,createComment:c,setText:u,setElementText:d,parentNode:p,nextSibling:f,setScopeId:m=r,insertStaticContent:g}=e,y=(e,t,n,s=null,r=null,o=null,i=void 0,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!hs(e,t)&&(s=Y(e),Q(e,r,o,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:u,shapeFlag:h}=t;switch(c){case Yn:_(e,t,n,s);break;case es:v(e,t,n,s);break;case ts:null==e&&w(t,n,s,i);break;case Xn:L(e,t,n,s,r,o,i,a,l);break;default:1&h?A(e,t,n,s,r,o,i,a,l):6&h?B(e,t,n,s,r,o,i,a,l):(64&h||128&h)&&c.process(e,t,n,s,r,o,i,a,l,se)}null!=u&&r?en(u,e&&e.ref,o,t||e,!t):null==u&&e&&null!=e.ref&&en(e.ref,null,o,e,!0)},_=(e,n,s,r)=>{if(null==e)t(n.el=l(n.children),s,r);else{const t=n.el=e.el;n.children!==e.children&&u(t,n.children)}},v=(e,n,s,r)=>{null==e?t(n.el=c(n.children||""),s,r):n.el=e.el},w=(e,t,n,s)=>{[e.el,e.anchor]=g(e.children,t,n,s,e.el,e.anchor)},x=({el:e,anchor:n},s,r)=>{let o;for(;e&&e!==n;)o=f(e),t(e,s,r),e=o;t(n,s,r)},k=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),o(e),e=n;o(t)},A=(e,t,n,s,r,o,i,a,l)=>{"svg"===t.type?i="svg":"math"===t.type&&(i="mathml"),null==e?E(t,n,s,r,o,i,a,l):R(e,t,r,o,i,a,l)},E=(e,n,s,r,o,l,c,u)=>{let h,p;const{props:f,shapeFlag:m,transition:g,dirs:y}=e;if(h=e.el=a(e.type,l,f&&f.is,f),8&m?d(h,e.children):16&m&&I(e.children,h,null,r,o,Pn(e,l),c,u),y&&Zt(e,null,r,"created"),S(h,e,e.scopeId,c,r),f){for(const e in f)"value"===e||C(e)||i(h,e,null,f[e],l,r);"value"in f&&i(h,"value",null,f.value,l),(p=f.onVnodeBeforeMount)&&ks(p,r,e)}y&&Zt(e,null,r,"beforeMount");const _=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(o,g);_&&g.beforeEnter(h),t(h,n,s),((p=f&&f.onVnodeMounted)||_||y)&&Mn(()=>{p&&ks(p,r,e),_&&g.enter(h),y&&Zt(e,null,r,"mounted")},o)},S=(e,t,n,s,r)=>{if(n&&m(e,n),s)for(let o=0;o<s.length;o++)m(e,s[o]);if(r){let n=r.subTree;if(t===n||Kn(n.type)&&(n.ssContent===t||n.ssFallback===t)){const t=r.vnode;S(e,t,t.scopeId,t.slotScopeIds,r.parent)}}},I=(e,t,n,s,r,o,i,a,l=0)=>{for(let c=l;c<e.length;c++){const l=e[c]=a?ws(e[c]):vs(e[c]);y(null,l,t,n,s,r,o,i,a)}},R=(e,t,s,r,o,a,l)=>{const c=t.el=e.el;let{patchFlag:u,dynamicChildren:h,dirs:p}=t;u|=16&e.patchFlag;const f=e.props||n,m=t.props||n;let g;if(s&&Ln(s,!1),(g=m.onVnodeBeforeUpdate)&&ks(g,s,t,e),p&&Zt(t,e,s,"beforeUpdate"),s&&Ln(s,!0),(f.innerHTML&&null==m.innerHTML||f.textContent&&null==m.textContent)&&d(c,""),h?T(e.dynamicChildren,h,c,s,r,Pn(t,o),a):l||U(e,t,c,null,s,r,Pn(t,o),a,!1),u>0){if(16&u)P(c,f,m,s,o);else if(2&u&&f.class!==m.class&&i(c,"class",null,m.class,o),4&u&&i(c,"style",f.style,m.style,o),8&u){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t],r=f[n],a=m[n];a===r&&"value"!==n||i(c,n,r,a,o,s)}}1&u&&e.children!==t.children&&d(c,t.children)}else l||null!=h||P(c,f,m,s,o);((g=m.onVnodeUpdated)||p)&&Mn(()=>{g&&ks(g,s,t,e),p&&Zt(t,e,s,"updated")},r)},T=(e,t,n,s,r,o,i)=>{for(let a=0;a<t.length;a++){const l=e[a],c=t[a],u=l.el&&(l.type===Xn||!hs(l,c)||198&l.shapeFlag)?p(l.el):n;y(l,c,u,null,s,r,o,i,!0)}},P=(e,t,s,r,o)=>{if(t!==s){if(t!==n)for(const n in t)C(n)||n in s||i(e,n,t[n],null,o,r);for(const n in s){if(C(n))continue;const a=s[n],l=t[n];a!==l&&"value"!==n&&i(e,n,l,a,o,r)}"value"in s&&i(e,"value",t.value,s.value,o)}},L=(e,n,s,r,o,i,a,c,u)=>{const h=n.el=e?e.el:l(""),d=n.anchor=e?e.anchor:l("");let{patchFlag:p,dynamicChildren:f,slotScopeIds:m}=n;m&&(c=c?c.concat(m):m),null==e?(t(h,s,r),t(d,s,r),I(n.children||[],s,d,o,i,a,c,u)):p>0&&64&p&&f&&e.dynamicChildren?(T(e.dynamicChildren,f,s,o,i,a,c),(null!=n.key||o&&n===o.subTree)&&$n(e,n,!0)):U(e,n,s,d,o,i,a,c,u)},B=(e,t,n,s,r,o,i,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?r.ctx.activate(t,n,s,i,l):z(t,n,s,r,o,i,l):N(e,t,l)},z=(e,t,s,r,o,i,a)=>{const l=e.component=function(e,t,s){const r=e.type,o=(t?t.appContext:e.appContext)||Cs,i={uid:As++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new X(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:An(r,o),emitsOptions:Wn(r,o),emit:null,emitted:null,propsDefaults:n,inheritAttrs:r.inheritAttrs,ctx:n,data:n,props:n,attrs:n,slots:n,refs:n,setupState:n,setupContext:null,suspense:s,suspenseId:s?s.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};i.ctx={_:i},i.root=t?t.root:i,i.emit=Hn.bind(null,i),e.ce&&e.ce(i);return i}(e,r,o);if(e.type.__isKeepAlive&&(l.ctx.renderer=se),function(e,t=!1,n=!1){t&&Fs(t);const{props:s,children:r}=e.vnode,o=Ts(e);xn(e,s,o,t),((e,t,n)=>{const s=e.slots=vn();if(32&e.vnode.shapeFlag){const e=t._;e?(Tn(s,t,n),n&&O(s,"_",e,!0)):In(t,s)}else t&&Rn(e,t)})(e,r,n||t);const i=o?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,fn);const{setup:s}=n;if(s){me();const n=e.setupContext=s.length>1?function(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,Ls),slots:e.slots,emit:e.emit,expose:t}}(e):null,r=Is(e),o=Dt(s,e,0,[e.props,n]),i=b(o);if(ge(),r(),!i&&!e.sp||tn(e)||function(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}(e),i){if(o.then(Rs,Rs),t)return o.then(t=>{Os(e,t)}).catch(t=>{Ft(t,e,0)});e.asyncDep=o}else Os(e,o)}else Ps(e)}(e,t):void 0;t&&Fs(!1)}(l,!1,a),l.asyncDep){if(o&&o.registerDep(l,q,a),!e.el){const n=l.subTree=ms(es);v(null,n,t,s),e.placeholder=n.el}}else q(l,e,t,s,o,i,a)},N=(e,t,n)=>{const s=t.component=e.component;if(function(e,t,n){const{props:s,children:r,component:o}=e,{props:i,children:a,patchFlag:l}=t,c=o.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!r&&!a||a&&a.$stable)||s!==i&&(s?!i||Gn(s,i,c):!!i);if(1024&l)return!0;if(16&l)return s?Gn(s,i,c):!!i;if(8&l){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(i[n]!==s[n]&&!Vn(c,n))return!0}}return!1}(e,t,n)){if(s.asyncDep&&!s.asyncResolved)return void j(s,t,n);s.next=t,s.update()}else t.el=e.el,s.vnode=t},q=(e,t,n,s,r,o,i)=>{const a=()=>{if(e.isMounted){let{next:t,bu:n,u:s,parent:l,vnode:c}=e;{const n=Bn(e);if(n)return t&&(t.el=c.el,j(e,t,i)),void n.asyncDep.then(()=>{e.isUnmounted||a()})}let u,h=t;Ln(e,!1),t?(t.el=c.el,j(e,t,i)):t=c,n&&M(n),(u=t.props&&t.props.onVnodeBeforeUpdate)&&ks(u,l,t,c),Ln(e,!0);const d=Qn(e),f=e.subTree;e.subTree=d,y(f,d,p(f.el),Y(f),e,r,o),t.el=d.el,null===h&&function({vnode:e,parent:t},n){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.el=e.el),s!==e)break;(e=t.vnode).el=n,t=t.parent}}(e,d.el),s&&Mn(s,r),(u=t.props&&t.props.onVnodeUpdated)&&Mn(()=>ks(u,l,t,c),r)}else{let i;const{el:a,props:l}=t,{bm:c,m:u,parent:h,root:d,type:p}=e,f=tn(t);Ln(e,!1),c&&M(c),!f&&(i=l&&l.onVnodeBeforeMount)&&ks(i,h,t),Ln(e,!0);{d.ce&&!1!==d.ce._def.shadowRoot&&d.ce._injectChildStyle(p);const i=e.subTree=Qn(e);y(null,i,n,s,e,r,o),t.el=i.el}if(u&&Mn(u,r),!f&&(i=l&&l.onVnodeMounted)){const e=t;Mn(()=>ks(i,h,e),r)}(256&t.shapeFlag||h&&tn(h.vnode)&&256&h.vnode.shapeFlag)&&e.a&&Mn(e.a,r),e.isMounted=!0,t=n=s=null}};e.scope.on();const l=e.effect=new ee(a);e.scope.off();const c=e.update=l.run.bind(l),u=e.job=l.runIfDirty.bind(l);u.i=e,u.id=e.uid,l.scheduler=()=>Bt(u),Ln(e,!0),c()},j=(e,t,s)=>{t.component=e;const r=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,s){const{props:r,attrs:o,vnode:{patchFlag:i}}=e,a=dt(r),[l]=e.propsOptions;let c=!1;if(!(s||i>0)||16&i){let s;kn(e,t,r,o)&&(c=!0);for(const o in a)t&&(h(t,o)||(s=F(o))!==o&&h(t,s))||(l?!n||void 0===n[o]&&void 0===n[s]||(r[o]=Cn(l,a,o,void 0,e,!0)):delete r[o]);if(o!==a)for(const e in o)t&&h(t,e)||(delete o[e],c=!0)}else if(8&i){const n=e.vnode.dynamicProps;for(let s=0;s<n.length;s++){let i=n[s];if(Vn(e.emitsOptions,i))continue;const u=t[i];if(l)if(h(o,i))u!==o[i]&&(o[i]=u,c=!0);else{const t=D(i);r[t]=Cn(l,a,t,u,e,!1)}else u!==o[i]&&(o[i]=u,c=!0)}}c&&De(e.attrs,"set","")}(e,t.props,r,s),((e,t,s)=>{const{vnode:r,slots:o}=e;let i=!0,a=n;if(32&r.shapeFlag){const e=t._;e?s&&1===e?i=!1:Tn(o,t,s):(i=!t.$stable,In(t,o)),a=t}else t&&(Rn(e,t),a={default:1});if(i)for(const n in o)Dn(n)||null!=a[n]||delete o[n]})(e,t.children,s),me(),Nt(e),ge()},U=(e,t,n,s,r,o,i,a,l=!1)=>{const c=e&&e.children,u=e?e.shapeFlag:0,h=t.children,{patchFlag:p,shapeFlag:f}=t;if(p>0){if(128&p)return void W(c,h,n,s,r,o,i,a,l);if(256&p)return void H(c,h,n,s,r,o,i,a,l)}8&f?(16&u&&K(c,r,o),h!==c&&d(n,h)):16&u?16&f?W(c,h,n,s,r,o,i,a,l):K(c,r,o,!0):(8&u&&d(n,""),16&f&&I(h,n,s,r,o,i,a,l))},H=(e,t,n,r,o,i,a,l,c)=>{t=t||s;const u=(e=e||s).length,h=t.length,d=Math.min(u,h);let p;for(p=0;p<d;p++){const s=t[p]=c?ws(t[p]):vs(t[p]);y(e[p],s,n,null,o,i,a,l,c)}u>h?K(e,o,i,!0,!1,d):I(t,n,r,o,i,a,l,c,d)},W=(e,t,n,r,o,i,a,l,c)=>{let u=0;const h=t.length;let d=e.length-1,p=h-1;for(;u<=d&&u<=p;){const s=e[u],r=t[u]=c?ws(t[u]):vs(t[u]);if(!hs(s,r))break;y(s,r,n,null,o,i,a,l,c),u++}for(;u<=d&&u<=p;){const s=e[d],r=t[p]=c?ws(t[p]):vs(t[p]);if(!hs(s,r))break;y(s,r,n,null,o,i,a,l,c),d--,p--}if(u>d){if(u<=p){const e=p+1,s=e<h?t[e].el:r;for(;u<=p;)y(null,t[u]=c?ws(t[u]):vs(t[u]),n,s,o,i,a,l,c),u++}}else if(u>p)for(;u<=d;)Q(e[u],o,i,!0),u++;else{const f=u,m=u,g=new Map;for(u=m;u<=p;u++){const e=t[u]=c?ws(t[u]):vs(t[u]);null!=e.key&&g.set(e.key,u)}let _,b=0;const v=p-m+1;let w=!1,x=0;const k=new Array(v);for(u=0;u<v;u++)k[u]=0;for(u=f;u<=d;u++){const s=e[u];if(b>=v){Q(s,o,i,!0);continue}let r;if(null!=s.key)r=g.get(s.key);else for(_=m;_<=p;_++)if(0===k[_-m]&&hs(s,t[_])){r=_;break}void 0===r?Q(s,o,i,!0):(k[r-m]=u+1,r>=x?x=r:w=!0,y(s,t[r],n,null,o,i,a,l,c),b++)}const C=w?function(e){const t=e.slice(),n=[0];let s,r,o,i,a;const l=e.length;for(s=0;s<l;s++){const l=e[s];if(0!==l){if(r=n[n.length-1],e[r]<l){t[s]=r,n.push(s);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<l?o=a+1:i=a;l<e[n[o]]&&(o>0&&(t[s]=n[o-1]),n[o]=s)}}o=n.length,i=n[o-1];for(;o-- >0;)n[o]=i,i=t[i];return n}(k):s;for(_=C.length-1,u=v-1;u>=0;u--){const e=m+u,s=t[e],d=t[e+1],p=e+1<h?d.el||d.placeholder:r;0===k[u]?y(null,s,n,p,o,i,a,l,c):w&&(_<0||u!==C[_]?V(s,n,p,2):_--)}}},V=(e,n,s,r,i=null)=>{const{el:a,type:l,transition:c,children:u,shapeFlag:h}=e;if(6&h)return void V(e.component.subTree,n,s,r);if(128&h)return void e.suspense.move(n,s,r);if(64&h)return void l.move(e,n,s,se);if(l===Xn){t(a,n,s);for(let e=0;e<u.length;e++)V(u[e],n,s,r);return void t(e.anchor,n,s)}if(l===ts)return void x(e,n,s);if(2!==r&&1&h&&c)if(0===r)c.beforeEnter(a),t(a,n,s),Mn(()=>c.enter(a),i);else{const{leave:r,delayLeave:i,afterLeave:l}=c,u=()=>{e.ctx.isUnmounted?o(a):t(a,n,s)},h=()=>{a._isLeaving&&a[Kt](!0),r(a,()=>{u(),l&&l()})};i?i(a,u,h):h()}else t(a,n,s)},Q=(e,t,n,s=!1,r=!1)=>{const{type:o,props:i,ref:a,children:l,dynamicChildren:c,shapeFlag:u,patchFlag:h,dirs:d,cacheIndex:p}=e;if(-2===h&&(r=!1),null!=a&&(me(),en(a,null,n,e,!0),ge()),null!=p&&(t.renderCache[p]=void 0),256&u)return void t.ctx.deactivate(e);const f=1&u&&d,m=!tn(e);let g;if(m&&(g=i&&i.onVnodeBeforeUnmount)&&ks(g,t,e),6&u)G(e.component,n,s);else{if(128&u)return void e.suspense.unmount(n,s);f&&Zt(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,se,s):c&&!c.hasOnce&&(o!==Xn||h>0&&64&h)?K(c,t,n,!1,!0):(o===Xn&&384&h||!r&&16&u)&&K(l,t,n),s&&J(e)}(m&&(g=i&&i.onVnodeUnmounted)||f)&&Mn(()=>{g&&ks(g,t,e),f&&Zt(e,null,t,"unmounted")},n)},J=e=>{const{type:t,el:n,anchor:s,transition:r}=e;if(t===Xn)return void Z(n,s);if(t===ts)return void k(e);const i=()=>{o(n),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){const{leave:t,delayLeave:s}=r,o=()=>t(n,i);s?s(e.el,i,o):o()}else i()},Z=(e,t)=>{let n;for(;e!==t;)n=f(e),o(e),e=n;o(t)},G=(e,t,n)=>{const{bum:s,scope:r,job:o,subTree:i,um:a,m:l,a:c}=e;zn(l),zn(c),s&&M(s),r.stop(),o&&(o.flags|=8,Q(i,e,t,n)),a&&Mn(a,t),Mn(()=>{e.isUnmounted=!0},t)},K=(e,t,n,s=!1,r=!1,o=0)=>{for(let i=o;i<e.length;i++)Q(e[i],t,n,s,r)},Y=e=>{if(6&e.shapeFlag)return Y(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=f(e.anchor||e.el),n=t&&t[Gt];return n?f(n):t};let te=!1;const ne=(e,t,n)=>{null==e?t._vnode&&Q(t._vnode,null,null,!0):y(t._vnode||null,e,t,null,null,null,n),t._vnode=e,te||(te=!0,Nt(),qt(),te=!1)},se={p:y,um:Q,m:V,r:J,mt:z,mc:I,pc:U,pbc:T,n:Y,o:e};let re;return{render:ne,hydrate:re,createApp:yn(ne)}}(e)}function Pn({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Ln({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function $n(e,t,n=!1){const s=e.children,r=t.children;if(d(s)&&d(r))for(let o=0;o<s.length;o++){const e=s[o];let t=r[o];1&t.shapeFlag&&!t.dynamicChildren&&((t.patchFlag<=0||32===t.patchFlag)&&(t=r[o]=ws(r[o]),t.el=e.el),n||-2===t.patchFlag||$n(e,t)),t.type===Yn&&-1!==t.patchFlag&&(t.el=e.el),t.type!==es||t.el||(t.el=e.el)}}function Bn(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Bn(t)}function zn(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const Nn=Symbol.for("v-scx"),qn=()=>{{const e=function(e,t,n=!1){const s=Ds();if(s||_n){let r=_n?_n._context.provides:s?null==s.parent||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&m(t)?t.call(s&&s.proxy):t}}(Nn);return e}};function jn(e,t,s){return function(e,t,s=n){const{immediate:o,deep:i,flush:a,once:c}=s,u=l({},s),h=t&&o||!t&&"post"!==a;let d;if(Ms)if("sync"===a){const e=qn();d=e.__watcherHandles||(e.__watcherHandles=[])}else if(!h){const e=()=>{};return e.stop=r,e.resume=r,e.pause=r,e}const p=Es;u.call=(e,t,n)=>St(e,p,t,n);let f=!1;"post"===a?u.scheduler=e=>{Mn(e,p&&p.suspense)}:"sync"!==a&&(f=!0,u.scheduler=(e,t)=>{t?e():Bt(e)});u.augmentJob=e=>{t&&(e.flags|=4),f&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};const m=At(e,t,u);Ms&&(d?d.push(m):h&&m());return m}(e,t,s)}const Un=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${D(t)}Modifiers`]||e[`${F(t)}Modifiers`];function Hn(e,t,...s){if(e.isUnmounted)return;const r=e.vnode.props||n;let o=s;const i=t.startsWith("update:"),a=i&&Un(r,t.slice(7));let l;a&&(a.trim&&(o=s.map(e=>g(e)?e.trim():e)),a.number&&(o=s.map(P)));let c=r[l=R(t)]||r[l=R(D(t))];!c&&i&&(c=r[l=R(F(t))]),c&&St(c,e,6,o);const u=r[l+"Once"];if(u){if(e.emitted){if(e.emitted[l])return}else e.emitted={};e.emitted[l]=!0,St(u,e,6,o)}}function Wn(e,t,n=!1){const s=t.emitsCache,r=s.get(e);if(void 0!==r)return r;const o=e.emits;let i={};return o?(d(o)?o.forEach(e=>i[e]=null):l(i,o),_(e)&&s.set(e,i),i):(_(e)&&s.set(e,null),null)}function Vn(e,t){return!(!e||!i(t))&&(t=t.slice(2).replace(/Once$/,""),h(e,t[0].toLowerCase()+t.slice(1))||h(e,F(t))||h(e,t))}function Qn(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[o],slots:i,attrs:l,emit:c,render:u,renderCache:h,props:d,data:p,setupState:f,ctx:m,inheritAttrs:g}=e,y=Vt(e);let _,b;try{if(4&n.shapeFlag){const e=r||s,t=e;_=vs(u.call(t,e,h,d,f,p,m)),b=l}else{const e=t;0,_=vs(e.length>1?e(d,{attrs:l,slots:i,emit:c}):e(d,null)),b=t.props?l:Jn(l)}}catch(w){ns.length=0,Ft(w,e,1),_=ms(es)}let v=_;if(b&&!1!==g){const e=Object.keys(b),{shapeFlag:t}=v;e.length&&7&t&&(o&&e.some(a)&&(b=Zn(b,o)),v=gs(v,b,!1,!0))}return n.dirs&&(v=gs(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&Xt(v,n.transition),_=v,Vt(y),_}const Jn=e=>{let t;for(const n in e)("class"===n||"style"===n||i(n))&&((t||(t={}))[n]=e[n]);return t},Zn=(e,t)=>{const n={};for(const s in e)a(s)&&s.slice(9)in t||(n[s]=e[s]);return n};function Gn(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let r=0;r<s.length;r++){const o=s[r];if(t[o]!==e[o]&&!Vn(n,o))return!0}return!1}const Kn=e=>e.__isSuspense;const Xn=Symbol.for("v-fgt"),Yn=Symbol.for("v-txt"),es=Symbol.for("v-cmt"),ts=Symbol.for("v-stc"),ns=[];let ss=null;function rs(e=!1){ns.push(ss=e?null:[])}let os=1;function is(e,t=!1){os+=e,e<0&&ss&&t&&(ss.hasOnce=!0)}function as(e){return e.dynamicChildren=os>0?ss||s:null,ns.pop(),ss=ns[ns.length-1]||null,os>0&&ss&&ss.push(e),e}function ls(e,t,n,s,r,o){return as(fs(e,t,n,s,r,o,!0))}function cs(e,t,n,s,r){return as(ms(e,t,n,s,r,!0))}function us(e){return!!e&&!0===e.__v_isVNode}function hs(e,t){return e.type===t.type&&e.key===t.key}const ds=({key:e})=>null!=e?e:null,ps=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?g(e)||mt(e)||m(e)?{i:Ht,r:e,k:t,f:!!n}:e:null);function fs(e,t=null,n=null,s=0,r=null,o=(e===Xn?0:1),i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ds(t),ref:t&&ps(t),scopeId:Wt,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:o,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Ht};return a?(xs(l,n),128&o&&e.normalize(l)):n&&(l.shapeFlag|=g(n)?8:16),os>0&&!i&&ss&&(l.patchFlag>0||6&o)&&32!==l.patchFlag&&ss.push(l),l}const ms=function(e,t=null,n=null,s=0,r=null,o=!1){e&&e!==rn||(e=es);if(us(e)){const s=gs(e,t,!0);return n&&xs(s,n),os>0&&!o&&ss&&(6&s.shapeFlag?ss[ss.indexOf(e)]=s:ss.push(s)),s.patchFlag=-2,s}i=e,m(i)&&"__vccOpts"in i&&(e=e.__vccOpts);var i;if(t){t=function(e){return e?ht(e)||wn(e)?l({},e):e:null}(t);let{class:e,style:n}=t;e&&!g(e)&&(t.class=U(e)),_(n)&&(ht(n)&&!d(n)&&(n=l({},n)),t.style=B(n))}const a=g(e)?1:Kn(e)?128:(e=>e.__isTeleport)(e)?64:_(e)?4:m(e)?2:0;return fs(e,t,n,s,r,a,o,!0)};function gs(e,t,n=!1,s=!1){const{props:r,ref:o,patchFlag:a,children:l,transition:c}=e,u=t?function(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const e in s)if("class"===e)t.class!==s.class&&(t.class=U([t.class,s.class]));else if("style"===e)t.style=B([t.style,s.style]);else if(i(e)){const n=t[e],r=s[e];!r||n===r||d(n)&&n.includes(r)||(t[e]=n?[].concat(n,r):r)}else""!==e&&(t[e]=s[e])}return t}(r||{},t):r,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&ds(u),ref:t&&t.ref?n&&o?d(o)?o.concat(ps(t)):[o,ps(t)]:ps(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Xn?-1===a?16:16|a:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&gs(e.ssContent),ssFallback:e.ssFallback&&gs(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&s&&Xt(h,c.clone(h)),h}function ys(e=" ",t=0){return ms(Yn,null,e,t)}function _s(e,t){const n=ms(ts,null,e);return n.staticCount=t,n}function bs(e="",t=!1){return t?(rs(),cs(es,null,e)):ms(es,null,e)}function vs(e){return null==e||"boolean"==typeof e?ms(es):d(e)?ms(Xn,null,e.slice()):us(e)?ws(e):ms(Yn,null,String(e))}function ws(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:gs(e)}function xs(e,t){let n=0;const{shapeFlag:s}=e;if(null==t)t=null;else if(d(t))n=16;else if("object"==typeof t){if(65&s){const n=t.default;return void(n&&(n._c&&(n._d=!1),xs(e,n()),n._c&&(n._d=!0)))}{n=32;const s=t._;s||wn(t)?3===s&&Ht&&(1===Ht.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=Ht}}else m(t)?(t={default:t,_ctx:Ht},n=32):(t=String(t),64&s?(n=16,t=[ys(t)]):n=8);e.children=t,e.shapeFlag|=n}function ks(e,t,n,s=null){St(e,t,7,[n,s])}const Cs=mn();let As=0;let Es=null;const Ds=()=>Es||Ht;let Ss,Fs;{const e=$(),t=(t,n)=>{let s;return(s=e[t])||(s=e[t]=[]),s.push(n),e=>{s.length>1?s.forEach(t=>t(e)):s[0](e)}};Ss=t("__VUE_INSTANCE_SETTERS__",e=>Es=e),Fs=t("__VUE_SSR_SETTERS__",e=>Ms=e)}const Is=e=>{const t=Es;return Ss(e),e.scope.on(),()=>{e.scope.off(),Ss(t)}},Rs=()=>{Es&&Es.scope.off(),Ss(null)};function Ts(e){return 4&e.vnode.shapeFlag}let Ms=!1;function Os(e,t,n){m(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:_(t)&&(e.setupState=vt(t)),Ps(e)}function Ps(e,t,n){const s=e.type;e.render||(e.render=s.render||r)}const Ls={get:(e,t)=>(Ee(e,0,""),e[t])};function $s(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(vt((t=e.exposed,!h(t,"__v_skip")&&Object.isExtensible(t)&&O(t,"__v_skip",!0),t)),{get:(t,n)=>n in t?t[n]:n in dn?dn[n](e):void 0,has:(e,t)=>t in e||t in dn})):e.proxy;var t}function Bs(e,t=!0){return m(e)?e.displayName||e.name:e.name||t&&e.__name}const zs=(e,t)=>{const n=function(e,t,n=!1){let s,r;return m(e)?s=e:(s=e.get,r=e.set),new wt(s,r,n)}(e,0,Ms);return n};function Ns(e,t,n){const s=arguments.length;return 2===s?_(t)&&!d(t)?us(t)?ms(e,null,[t]):ms(e,t):ms(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):3===s&&us(n)&&(n=[n]),ms(e,t,n))}const qs="3.5.20";
20
+ /**
21
+ * @vue/runtime-dom v3.5.20
22
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
23
+ * @license MIT
24
+ **/let js;const Us="undefined"!=typeof window&&window.trustedTypes;if(Us)try{js=Us.createPolicy("vue",{createHTML:e=>e})}catch(Df){}const Hs=js?e=>js.createHTML(e):e=>e,Ws="undefined"!=typeof document?document:null,Vs=Ws&&Ws.createElement("template"),Qs={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r="svg"===t?Ws.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?Ws.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?Ws.createElement(e,{is:n}):Ws.createElement(e);return"select"===e&&s&&null!=s.multiple&&r.setAttribute("multiple",s.multiple),r},createText:e=>Ws.createTextNode(e),createComment:e=>Ws.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ws.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,o){const i=n?n.previousSibling:t.lastChild;if(r&&(r===o||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==o&&(r=r.nextSibling););else{Vs.innerHTML=Hs("svg"===s?`<svg>${e}</svg>`:"mathml"===s?`<math>${e}</math>`:e);const r=Vs.content;if("svg"===s||"mathml"===s){const e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Js=Symbol("_vtc");const Zs=Symbol("_vod"),Gs=Symbol("_vsh"),Ks=Symbol(""),Xs=/(^|;)\s*display\s*:/;const Ys=/\s*!important$/;function er(e,t,n){if(d(n))n.forEach(n=>er(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=function(e,t){const n=nr[t];if(n)return n;let s=D(t);if("filter"!==s&&s in e)return nr[t]=s;s=I(s);for(let r=0;r<tr.length;r++){const n=tr[r]+s;if(n in e)return nr[t]=n}return t}(e,t);Ys.test(n)?e.setProperty(F(s),n.replace(Ys,""),"important"):e[s]=n}}const tr=["Webkit","Moz","ms"],nr={};const sr="http://www.w3.org/1999/xlink";function rr(e,t,n,s,r,o=H(t)){s&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(sr,t.slice(6,t.length)):e.setAttributeNS(sr,t,n):null==n||o&&!W(n)?e.removeAttribute(t):e.setAttribute(t,o?"":y(n)?String(n):n)}function or(e,t,n,s,r){if("innerHTML"===t||"textContent"===t)return void(null!=n&&(e[t]="innerHTML"===t?Hs(n):n));const o=e.tagName;if("value"===t&&"PROGRESS"!==o&&!o.includes("-")){const s="OPTION"===o?e.getAttribute("value")||"":e.value,r=null==n?"checkbox"===e.type?"on":"":String(n);return s===r&&"_value"in e||(e.value=r),null==n&&e.removeAttribute(t),void(e._value=n)}let i=!1;if(""===n||null==n){const s=typeof e[t];"boolean"===s?n=W(n):null==n&&"string"===s?(n="",i=!0):"number"===s&&(n=0,i=!0)}try{e[t]=n}catch(Df){}i&&e.removeAttribute(r||t)}function ir(e,t,n,s){e.addEventListener(t,n,s)}const ar=Symbol("_vei");function lr(e,t,n,s,r=null){const o=e[ar]||(e[ar]={}),i=o[t];if(s&&i)i.value=s;else{const[n,a]=function(e){let t;if(cr.test(e)){let n;for(t={};n=e.match(cr);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}const n=":"===e[2]?e.slice(3):F(e.slice(2));return[n,t]}(t);if(s){const i=o[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();St(function(e,t){if(d(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=dr(),n}(s,r);ir(e,n,i,a)}else i&&(!function(e,t,n,s){e.removeEventListener(t,n,s)}(e,n,i,a),o[t]=void 0)}}const cr=/(?:Once|Passive|Capture)$/;let ur=0;const hr=Promise.resolve(),dr=()=>ur||(hr.then(()=>ur=0),ur=Date.now());const pr=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123;const fr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return d(t)?e=>M(t,e):t};function mr(e){e.target.composing=!0}function gr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const yr=Symbol("_assign"),_r={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e[yr]=fr(r);const o=s||r.props&&"number"===r.props.type;ir(e,t?"change":"input",t=>{if(t.target.composing)return;let s=e.value;n&&(s=s.trim()),o&&(s=P(s)),e[yr](s)}),n&&ir(e,"change",()=>{e.value=e.value.trim()}),t||(ir(e,"compositionstart",mr),ir(e,"compositionend",gr),ir(e,"change",gr))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:r,number:o}},i){if(e[yr]=fr(i),e.composing)return;const a=null==t?"":t;if((!o&&"number"!==e.type||/^0\d/.test(e.value)?e.value:P(e.value))!==a){if(document.activeElement===e&&"range"!==e.type){if(s&&t===n)return;if(r&&e.value.trim()===a)return}e.value=a}}},br=l({patchProp:(e,t,n,s,r,o)=>{const l="svg"===r;"class"===t?function(e,t,n){const s=e[Js];s&&(t=(t?[t,...s]:[...s]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,s,l):"style"===t?function(e,t,n){const s=e.style,r=g(n);let o=!1;if(n&&!r){if(t)if(g(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&er(s,t,"")}else for(const e in t)null==n[e]&&er(s,e,"");for(const e in n)"display"===e&&(o=!0),er(s,e,n[e])}else if(r){if(t!==n){const e=s[Ks];e&&(n+=";"+e),s.cssText=n,o=Xs.test(n)}}else t&&e.removeAttribute("style");Zs in e&&(e[Zs]=o?s.display:"",e[Gs]&&(s.display="none"))}(e,n,s):i(t)?a(t)||lr(e,t,0,s,o):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,s){if(s)return"innerHTML"===t||"textContent"===t||!!(t in e&&pr(t)&&m(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}if(pr(t)&&g(n))return!1;return t in e}(e,t,s,l))?(or(e,t,s),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||rr(e,t,s,l,0,"value"!==t)):!e._isVueCE||!/[A-Z]/.test(t)&&g(s)?("true-value"===t?e._trueValue=s:"false-value"===t&&(e._falseValue=s),rr(e,t,s,l)):or(e,D(t),s,0,t)}},Qs);let vr;const wr=(...e)=>{const t=(vr||(vr=On(br))).createApp(...e),{mount:n}=t;return t.mount=e=>{const s=function(e){if(g(e)){return document.querySelector(e)}return e}(e);if(!s)return;const r=t._component;m(r)||r.render||r.template||(r.template=s.innerHTML),1===s.nodeType&&(s.textContent="");const o=n(s,!1,function(e){if(e instanceof SVGElement)return"svg";if("function"==typeof MathMLElement&&e instanceof MathMLElement)return"mathml"}(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},t};function xr(e){var t,n,s="";if("string"==typeof e||"number"==typeof e)s+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=xr(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function kr(){for(var e,t,n=0,s="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=xr(e))&&(s&&(s+=" "),s+=t);return s}const Cr=e=>{const t=Sr(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),Ar(n,t)||Dr(e)},getConflictingClassGroupIds:(e,t)=>{const r=n[e]||[];return t&&s[e]?[...r,...s[e]]:r}}},Ar=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),r=s?Ar(e.slice(1),s):void 0;if(r)return r;if(0===t.validators.length)return;const o=e.join("-");return t.validators.find(({validator:e})=>e(o))?.classGroupId},Er=/^\[(.+)\]$/,Dr=e=>{if(Er.test(e)){const t=Er.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Sr=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return Tr(Object.entries(e.classGroups),n).forEach(([e,n])=>{Fr(n,s,e,t)}),s},Fr=(e,t,n,s)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:Ir(t,e)).classGroupId=n)}if("function"==typeof e)return Rr(e)?void Fr(e(s),t,n,s):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach(([e,r])=>{Fr(r,Ir(t,e),n,s)})})},Ir=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},Rr=e=>e.isThemeGetter,Tr=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,Mr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const r=(r,o)=>{n.set(r,o),t++,t>e&&(t=0,s=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=s.get(e))?(r(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):r(e,t)}}},Or=e=>{const{separator:t,experimentalParseClassName:n}=e,s=1===t.length,r=t[0],o=t.length,i=e=>{const n=[];let i,a=0,l=0;for(let h=0;h<e.length;h++){let c=e[h];if(0===a){if(c===r&&(s||e.slice(h,h+o)===t)){n.push(e.slice(l,h)),l=h+o;continue}if("/"===c){i=h;continue}}"["===c?a++:"]"===c&&a--}const c=0===n.length?e:e.substring(l),u=c.startsWith("!");return{modifiers:n,hasImportantModifier:u,baseClassName:u?c.substring(1):c,maybePostfixModifierPosition:i&&i>l?i-l:void 0}};return n?e=>n({className:e,parseClassName:i}):i},Pr=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},Lr=/\s+/;function $r(){let e,t,n=0,s="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Br(e))&&(s&&(s+=" "),s+=t);return s}const Br=e=>{if("string"==typeof e)return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=Br(e[s]))&&(n&&(n+=" "),n+=t);return n};function zr(e,...t){let n,s,r,o=function(a){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:Mr(e.cacheSize),parseClassName:Or(e),...Cr(e)}))(l),s=n.cache.get,r=n.cache.set,o=i,i(a)};function i(e){const t=s(e);if(t)return t;const o=((e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:r}=t,o=[],i=e.trim().split(Lr);let a="";for(let l=i.length-1;l>=0;l-=1){const e=i[l],{modifiers:t,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:h}=n(e);let d=Boolean(h),p=s(d?u.substring(0,h):u);if(!p){if(!d){a=e+(a.length>0?" "+a:a);continue}if(p=s(u),!p){a=e+(a.length>0?" "+a:a);continue}d=!1}const f=Pr(t).join(":"),m=c?f+"!":f,g=m+p;if(o.includes(g))continue;o.push(g);const y=r(p,d);for(let n=0;n<y.length;++n){const e=y[n];o.push(m+e)}a=e+(a.length>0?" "+a:a)}return a})(e,n);return r(e,o),o}return function(){return o($r.apply(null,arguments))}}const Nr=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},qr=/^\[(?:([a-z-]+):)?(.+)\]$/i,jr=/^\d+\/\d+$/,Ur=new Set(["px","full","screen"]),Hr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Wr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Vr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Qr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Zr=e=>Kr(e)||Ur.has(e)||jr.test(e),Gr=e=>uo(e,"length",ho),Kr=e=>Boolean(e)&&!Number.isNaN(Number(e)),Xr=e=>uo(e,"number",Kr),Yr=e=>Boolean(e)&&Number.isInteger(Number(e)),eo=e=>e.endsWith("%")&&Kr(e.slice(0,-1)),to=e=>qr.test(e),no=e=>Hr.test(e),so=new Set(["length","size","percentage"]),ro=e=>uo(e,so,po),oo=e=>uo(e,"position",po),io=new Set(["image","url"]),ao=e=>uo(e,io,mo),lo=e=>uo(e,"",fo),co=()=>!0,uo=(e,t,n)=>{const s=qr.exec(e);return!!s&&(s[1]?"string"==typeof t?s[1]===t:t.has(s[1]):n(s[2]))},ho=e=>Wr.test(e)&&!Vr.test(e),po=()=>!1,fo=e=>Qr.test(e),mo=e=>Jr.test(e),go=zr(()=>{const e=Nr("colors"),t=Nr("spacing"),n=Nr("blur"),s=Nr("brightness"),r=Nr("borderColor"),o=Nr("borderRadius"),i=Nr("borderSpacing"),a=Nr("borderWidth"),l=Nr("contrast"),c=Nr("grayscale"),u=Nr("hueRotate"),h=Nr("invert"),d=Nr("gap"),p=Nr("gradientColorStops"),f=Nr("gradientColorStopPositions"),m=Nr("inset"),g=Nr("margin"),y=Nr("opacity"),_=Nr("padding"),b=Nr("saturate"),v=Nr("scale"),w=Nr("sepia"),x=Nr("skew"),k=Nr("space"),C=Nr("translate"),A=()=>["auto",to,t],E=()=>[to,t],D=()=>["",Zr,Gr],S=()=>["auto",Kr,to],F=()=>["","0",to],I=()=>[Kr,to];return{cacheSize:500,separator:":",theme:{colors:[co],spacing:[Zr,Gr],blur:["none","",no,to],brightness:I(),borderColor:[e],borderRadius:["none","","full",no,to],borderSpacing:E(),borderWidth:D(),contrast:I(),grayscale:F(),hueRotate:I(),invert:F(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[eo,Gr],inset:A(),margin:A(),opacity:I(),padding:E(),saturate:I(),scale:I(),sepia:F(),skew:I(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",to]}],container:["container"],columns:[{columns:[no]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",to]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Yr,to]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",to]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Yr,to]}],"grid-cols":[{"grid-cols":[co]}],"col-start-end":[{col:["auto",{span:["full",Yr,to]},to]}],"col-start":[{"col-start":S()}],"col-end":[{"col-end":S()}],"grid-rows":[{"grid-rows":[co]}],"row-start-end":[{row:["auto",{span:[Yr,to]},to]}],"row-start":[{"row-start":S()}],"row-end":[{"row-end":S()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",to]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",to]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",to,t]}],"min-w":[{"min-w":[to,t,"min","max","fit"]}],"max-w":[{"max-w":[to,t,"none","full","min","max","fit","prose",{screen:[no]},no]}],h:[{h:[to,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[to,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[to,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[to,t,"auto","min","max","fit"]}],"font-size":[{text:["base",no,Gr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xr]}],"font-family":[{font:[co]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",to]}],"line-clamp":[{"line-clamp":["none",Kr,Xr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Zr,to]}],"list-image":[{"list-image":["none",to]}],"list-style-type":[{list:["none","disc","decimal",to]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Zr,Gr]}],"underline-offset":[{"underline-offset":["auto",Zr,to]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",to]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",to]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",oo]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ro]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ao]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[Zr,to]}],"outline-w":[{outline:[Zr,Gr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Zr,Gr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",no,lo]}],"shadow-color":[{shadow:[co]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",no,to]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[h]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",to]}],duration:[{duration:I()}],ease:[{ease:["linear","in","out","in-out",to]}],delay:[{delay:I()}],animate:[{animate:["none","spin","ping","pulse","bounce",to]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[v]}],"scale-x":[{"scale-x":[v]}],"scale-y":[{"scale-y":[v]}],rotate:[{rotate:[Yr,to]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",to]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",to]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",to]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Zr,Gr,Xr]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function yo(...e){return go(kr(e))}const _o=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,bo=kr,vo=Yt({__name:"Button",props:{variant:{},size:{},as:{default:"button"}},setup(e){const t=(n="inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s={variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}},e=>{var t;if(null==(null==s?void 0:s.variants))return bo(n,null==e?void 0:e.class,null==e?void 0:e.className);const{variants:r,defaultVariants:o}=s,i=Object.keys(r).map(t=>{const n=null==e?void 0:e[t],s=null==o?void 0:o[t];if(null===n)return null;const i=_o(n)||_o(s);return r[t][i]}),a=e&&Object.entries(e).reduce((e,t)=>{let[n,s]=t;return void 0===s||(e[n]=s),e},{}),l=null==s||null===(t=s.compoundVariants)||void 0===t?void 0:t.reduce((e,t)=>{let{class:n,className:s,...r}=t;return Object.entries(r).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...o,...a}[t]):{...o,...a}[t]===n})?[...e,n,s]:e},[]);return bo(n,i,l,null==e?void 0:e.class,null==e?void 0:e.className)});var n,s;return(e,n)=>(rs(),cs(on(e.as),{class:U(_t(yo)(_t(t)({variant:e.variant,size:e.size}),e.$attrs.class??""))},{default:Qt(()=>[cn(e.$slots,"default")]),_:3},8,["class"]))}}),wo={class:"flex items-center gap-2"},xo={class:"text-foreground truncate text-xs font-semibold sm:text-sm"},ko=Yt({__name:"ChatHeader",props:{config:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,r=gt(!1),o=gt({x:0,y:0}),i=gt({x:0,y:0}),a=()=>{s("close")},l=e=>{n.config.header?.draggable&&(r.value=!0,o.value={x:e.clientX,y:e.clientY},document.addEventListener("mousemove",c),document.addEventListener("mouseup",u),e.preventDefault())},c=e=>{if(!r.value)return;const t=e.clientX-o.value.x,n=e.clientY-o.value.y;i.value={x:t,y:n}},u=()=>{r.value=!1,i.value={x:0,y:0},document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u)};return(e,t)=>(rs(),ls("div",{class:"border-border flex cursor-move select-none items-center justify-between border-b p-3 sm:p-4",onMousedown:l},[fs("div",wo,[t[0]||(t[0]=fs("div",{class:"bg-primary text-primary-foreground flex h-7 w-7 items-center justify-center rounded-lg sm:h-8 sm:w-8"},[fs("svg",{class:"h-3.5 w-3.5 sm:h-4 sm:w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[fs("path",{d:"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","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})])],-1)),fs("h3",xo,Q(e.config.header?.title||"聊天助手"),1)]),!1!==e.config.header?.showCloseButton?(rs(),cs(vo,{key:0,class:"h-7 w-10 p-0",size:"sm",title:"关闭聊天",variant:"ghost",onClick:a},{default:Qt(()=>[...t[1]||(t[1]=[fs("svg",{class:"size-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[fs("path",{d:"M6 18L18 6M6 6l12 12","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])]),_:1})):bs("",!0)],32))}});class Co{messages=gt([]);sessions=gt([]);currentSessionId=gt("");questions=gt([]);enableHistory=!0;constructor(e={}){this.enableHistory=!1!==e.enableHistory,this.currentSessionId.value=this.generateSessionId(),this.enableHistory&&this.loadHistory(),jn(this.messages,()=>{this.enableHistory&&this.saveHistory()},{deep:!0})}get allMessages(){return zs(()=>this.messages.value)}get currentMessages(){return zs(()=>this.messages.value)}get messageCount(){return zs(()=>this.messages.value.length)}get hasMessages(){return zs(()=>this.messages.value.length>0)}get lastMessage(){return zs(()=>this.messages.value[this.messages.value.length-1])}get userMessages(){return zs(()=>this.messages.value.filter(e=>"user"===e.type))}get aiMessages(){return zs(()=>this.messages.value.filter(e=>"ai"===e.type))}get streamingMessages(){return zs(()=>this.messages.value.filter(e=>e.isStreaming))}get errorMessages(){return zs(()=>this.messages.value.filter(e=>"error"===e.status))}get suggestedQuestions(){return zs(()=>this.questions.value)}get hasQuestions(){return zs(()=>this.questions.value.length>0)}addMessage(e){const t={...e,id:this.generateMessageId(),timestamp:new Date};return this.messages.value.push(t),"user"===e.type&&this.clearQuestions(),t}updateMessage(e,t){const n=this.messages.value.findIndex(t=>t.id===e);if(-1!==n){const e=this.messages.value[n];return e&&(this.messages.value[n]={...e,...t}),!0}return!1}removeMessage(e){const t=this.messages.value.findIndex(t=>t.id===e);return-1!==t&&(this.messages.value.splice(t,1),!0)}getMessage(e){return this.messages.value.find(t=>t.id===e)}setMessageStatus(e,t){return this.updateMessage(e,{status:t})}setMessageStreaming(e,t){return this.updateMessage(e,{isStreaming:t,status:t?"streaming":"sent"})}setMessageError(e,t){return this.updateMessage(e,{status:"error",error:t,isStreaming:!1})}updateStreamingContent(e,t){return this.updateMessage(e,{content:t,streamContent:t})}addMessages(e){const t=e.map(e=>({...e,id:this.generateMessageId(),timestamp:new Date}));return this.messages.value.push(...t),t}clearMessages(){this.messages.value=[]}setQuestions(e){this.questions.value=e}addQuestion(e){this.questions.value.push(e)}clearQuestions(){this.questions.value=[]}removeQuestion(e){const t=this.questions.value.findIndex(t=>t.id===e);return-1!==t&&(this.questions.value.splice(t,1),!0)}removeMessages(e){let t=0;return e.forEach(e=>{this.removeMessage(e)&&t++}),t}filterMessages(e){return this.messages.value.filter(e)}searchMessages(e){const t=e.toLowerCase();return this.messages.value.filter(e=>e.content.toLowerCase().includes(t))}getMessagesByType(e){return this.messages.value.filter(t=>t.type===e)}getMessagesByStatus(e){return this.messages.value.filter(t=>t.status===e)}createSession(){const e=this.generateSessionId(),t={id:e,messages:[],createdAt:new Date,updatedAt:new Date};return this.sessions.value.push(t),this.currentSessionId.value=e,e}switchSession(e){const t=this.sessions.value.find(t=>t.id===e);return!!t&&(this.currentSessionId.value=e,this.messages.value=[...t.messages],!0)}deleteSession(e){const t=this.sessions.value.findIndex(t=>t.id===e);return-1!==t&&(this.sessions.value.splice(t,1),e===this.currentSessionId.value&&(this.sessions.value.length>0?this.sessions.value[0]&&this.switchSession(this.sessions.value[0].id):this.createSession()),!0)}getSession(e){return this.sessions.value.find(t=>t.id===e)}getAllSessions(){return[...this.sessions.value]}saveHistory(){try{const e={sessions:this.sessions.value,currentSessionId:this.currentSessionId.value,timestamp:Date.now()};localStorage.setItem("langchat-history",JSON.stringify(e))}catch(e){console.warn("Failed to save history:",e)}}loadHistory(){try{const e=localStorage.getItem("langchat-history");if(e){const t=JSON.parse(e);if(t.sessions&&Array.isArray(t.sessions)&&(this.sessions.value=t.sessions.map(e=>({...e,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt),messages:e.messages.map(e=>({...e,timestamp:new Date(e.timestamp)}))}))),t.currentSessionId){this.currentSessionId.value=t.currentSessionId;const e=this.getSession(t.currentSessionId);e&&(this.messages.value=[...e.messages])}}}catch(e){console.warn("Failed to load history:",e),this.createSession()}}exportHistory(){const e={sessions:this.sessions.value,currentSessionId:this.currentSessionId.value,exportTime:(new Date).toISOString(),version:"1.0.0"};return JSON.stringify(e,null,2)}importHistory(e){try{const t=JSON.parse(e);if(t.sessions&&Array.isArray(t.sessions)){if(this.sessions.value=t.sessions.map(e=>({...e,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt),messages:e.messages.map(e=>({...e,timestamp:new Date(e.timestamp)}))})),t.currentSessionId){this.currentSessionId.value=t.currentSessionId;const e=this.getSession(t.currentSessionId);e&&(this.messages.value=[...e.messages])}return!0}return!1}catch(t){return console.error("Failed to import history:",t),!1}}getStats(){const e=this.messages.value.length;return{totalMessages:e,userMessages:this.userMessages.value.length,aiMessages:this.aiMessages.value.length,errorMessages:this.errorMessages.value.length,streamingMessages:this.streamingMessages.value.length,sessions:this.sessions.value.length,averageMessagesPerSession:e/Math.max(this.sessions.value.length,1)}}cleanup(e=30){const t=new Date;t.setDate(t.getDate()-e);let n=0;return this.sessions.value=this.sessions.value.filter(e=>!(e.updatedAt<t)||(n+=e.messages.length,!1)),this.messages.value=this.messages.value.filter(e=>!(e.timestamp<t)||(n++,!1)),n}generateMessageId(){return`msg_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}generateSessionId(){return`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}destroy(){this.messages.value=[],this.sessions.value=[],this.currentSessionId.value=""}}const Ao=new Co;const Eo={};function Do(e,t){"string"!=typeof t&&(t=Do.defaultChars);const n=function(e){let t=Eo[e];if(t)return t;t=Eo[e]=[];for(let n=0;n<128;n++){const e=String.fromCharCode(n);t.push(e)}for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);t[s]="%"+("0"+s.toString(16).toUpperCase()).slice(-2)}return t}(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t="";for(let s=0,r=e.length;s<r;s+=3){const o=parseInt(e.slice(s+1,s+3),16);if(o<128)t+=n[o];else{if(192==(224&o)&&s+3<r){const n=parseInt(e.slice(s+4,s+6),16);if(128==(192&n)){const e=o<<6&1984|63&n;t+=e<128?"��":String.fromCharCode(e),s+=3;continue}}if(224==(240&o)&&s+6<r){const n=parseInt(e.slice(s+4,s+6),16),r=parseInt(e.slice(s+7,s+9),16);if(128==(192&n)&&128==(192&r)){const e=o<<12&61440|n<<6&4032|63&r;t+=e<2048||e>=55296&&e<=57343?"���":String.fromCharCode(e),s+=6;continue}}if(240==(248&o)&&s+9<r){const n=parseInt(e.slice(s+4,s+6),16),r=parseInt(e.slice(s+7,s+9),16),i=parseInt(e.slice(s+10,s+12),16);if(128==(192&n)&&128==(192&r)&&128==(192&i)){let e=o<<18&1835008|n<<12&258048|r<<6&4032|63&i;e<65536||e>1114111?t+="����":(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(1023&e))),s+=9;continue}}t+="�"}}return t})}Do.defaultChars=";/?:@&=+$,#",Do.componentChars="";const So={};function Fo(e,t,n){"string"!=typeof t&&(n=t,t=Fo.defaultChars),void 0===n&&(n=!0);const s=function(e){let t=So[e];if(t)return t;t=So[e]=[];for(let n=0;n<128;n++){const e=String.fromCharCode(n);/^[0-9a-z]$/i.test(e)?t.push(e):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}(t);let r="";for(let o=0,i=e.length;o<i;o++){const t=e.charCodeAt(o);if(n&&37===t&&o+2<i&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3)))r+=e.slice(o,o+3),o+=2;else if(t<128)r+=s[t];else if(t>=55296&&t<=57343){if(t>=55296&&t<=56319&&o+1<i){const t=e.charCodeAt(o+1);if(t>=56320&&t<=57343){r+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}r+="%EF%BF%BD"}else r+=encodeURIComponent(e[o])}return r}function Io(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Ro(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}Fo.defaultChars=";/?:@&=+$,-_.!~*'()#",Fo.componentChars="-_.!~*'()";const To=/^([a-z0-9.+-]+:)/i,Mo=/:[0-9]*$/,Oo=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Po=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),Lo=["'"].concat(Po),$o=["%","/","?",";","#"].concat(Lo),Bo=["/","?","#"],zo=/^[+a-z0-9A-Z_-]{0,63}$/,No=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,qo={javascript:!0,"javascript:":!0},jo={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Uo(e,t){if(e&&e instanceof Ro)return e;const n=new Ro;return n.parse(e,t),n}Ro.prototype.parse=function(e,t){let n,s,r,o=e;if(o=o.trim(),!t&&1===e.split("#").length){const e=Oo.exec(o);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let i=To.exec(o);if(i&&(i=i[0],n=i.toLowerCase(),this.protocol=i,o=o.substr(i.length)),(t||i||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(r="//"===o.substr(0,2),!r||i&&qo[i]||(o=o.substr(2),this.slashes=!0)),!qo[i]&&(r||i&&!jo[i])){let e,t,n=-1;for(let a=0;a<Bo.length;a++)s=o.indexOf(Bo[a]),-1!==s&&(-1===n||s<n)&&(n=s);t=-1===n?o.lastIndexOf("@"):o.lastIndexOf("@",n),-1!==t&&(e=o.slice(0,t),o=o.slice(t+1),this.auth=e),n=-1;for(let a=0;a<$o.length;a++)s=o.indexOf($o[a]),-1!==s&&(-1===n||s<n)&&(n=s);-1===n&&(n=o.length),":"===o[n-1]&&n--;const r=o.slice(0,n);o=o.slice(n),this.parseHost(r),this.hostname=this.hostname||"";const i="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!i){const e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){const n=e[t];if(n&&!n.match(zo)){let s="";for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?s+="x":s+=n[e];if(!s.match(zo)){const s=e.slice(0,t),r=e.slice(t+1),i=n.match(No);i&&(s.push(i[1]),r.unshift(i[2])),r.length&&(o=r.join(".")+o),this.hostname=s.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),i&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=o.indexOf("#");-1!==a&&(this.hash=o.substr(a),o=o.slice(0,a));const l=o.indexOf("?");return-1!==l&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),jo[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this},Ro.prototype.parseHost=function(e){let t=Mo.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const Ho=Object.freeze(Object.defineProperty({__proto__:null,decode:Do,encode:Fo,format:Io,parse:Uo},Symbol.toStringTag,{value:"Module"})),Wo=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Vo=/[\0-\x1F\x7F-\x9F]/,Qo=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Jo=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Zo=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Go=Object.freeze(Object.defineProperty({__proto__:null,Any:Wo,Cc:Vo,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:Qo,S:Jo,Z:Zo},Symbol.toStringTag,{value:"Module"})),Ko=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),Xo=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var Yo;const ei=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),ti=null!==(Yo=String.fromCodePoint)&&void 0!==Yo?Yo:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e),t};var ni,si;(si=ni||(ni={}))[si.NUM=35]="NUM",si[si.SEMI=59]="SEMI",si[si.EQUALS=61]="EQUALS",si[si.ZERO=48]="ZERO",si[si.NINE=57]="NINE",si[si.LOWER_A=97]="LOWER_A",si[si.LOWER_F=102]="LOWER_F",si[si.LOWER_X=120]="LOWER_X",si[si.LOWER_Z=122]="LOWER_Z",si[si.UPPER_A=65]="UPPER_A",si[si.UPPER_F=70]="UPPER_F",si[si.UPPER_Z=90]="UPPER_Z";var ri,oi,ii,ai,li,ci;function ui(e){return e>=ni.ZERO&&e<=ni.NINE}function hi(e){return e>=ni.UPPER_A&&e<=ni.UPPER_F||e>=ni.LOWER_A&&e<=ni.LOWER_F}function di(e){return e===ni.EQUALS||function(e){return e>=ni.UPPER_A&&e<=ni.UPPER_Z||e>=ni.LOWER_A&&e<=ni.LOWER_Z||ui(e)}(e)}(oi=ri||(ri={}))[oi.VALUE_LENGTH=49152]="VALUE_LENGTH",oi[oi.BRANCH_LENGTH=16256]="BRANCH_LENGTH",oi[oi.JUMP_TABLE=127]="JUMP_TABLE",(ai=ii||(ii={}))[ai.EntityStart=0]="EntityStart",ai[ai.NumericStart=1]="NumericStart",ai[ai.NumericDecimal=2]="NumericDecimal",ai[ai.NumericHex=3]="NumericHex",ai[ai.NamedEntity=4]="NamedEntity",(ci=li||(li={}))[ci.Legacy=0]="Legacy",ci[ci.Strict=1]="Strict",ci[ci.Attribute=2]="Attribute";class pi{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ii.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=li.Strict}startEntity(e){this.decodeMode=e,this.state=ii.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ii.EntityStart:return e.charCodeAt(t)===ni.NUM?(this.state=ii.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ii.NamedEntity,this.stateNamedEntity(e,t));case ii.NumericStart:return this.stateNumericStart(e,t);case ii.NumericDecimal:return this.stateNumericDecimal(e,t);case ii.NumericHex:return this.stateNumericHex(e,t);case ii.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===ni.LOWER_X?(this.state=ii.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ii.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,s){if(t!==n){const r=n-t;this.result=this.result*Math.pow(s,r)+parseInt(e.substr(t,r),s),this.consumed+=r}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(!ui(s)&&!hi(s))return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(s,3);t+=1}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(!ui(s))return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(s,2);t+=1}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return null===(n=this.errors)||void 0===n||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===ni.SEMI)this.consumed+=1;else if(this.decodeMode===li.Strict)return 0;return this.emitCodePoint(function(e){var t;return e>=55296&&e<=57343||e>1114111?65533:null!==(t=ei.get(e))&&void 0!==t?t:e}(this.result),this.consumed),this.errors&&(e!==ni.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let s=n[this.treeIndex],r=(s&ri.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const o=e.charCodeAt(t);if(this.treeIndex=mi(n,s,this.treeIndex+Math.max(1,r),o),this.treeIndex<0)return 0===this.result||this.decodeMode===li.Attribute&&(0===r||di(o))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],r=(s&ri.VALUE_LENGTH)>>14,0!==r){if(o===ni.SEMI)return this.emitNamedEntityData(this.treeIndex,r,this.consumed+this.excess);this.decodeMode!==li.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,s=(n[t]&ri.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,s,this.consumed),null===(e=this.errors)||void 0===e||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:s}=this;return this.emitCodePoint(1===t?s[e]&~ri.VALUE_LENGTH:s[e+1],n),3===t&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case ii.NamedEntity:return 0===this.result||this.decodeMode===li.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case ii.NumericDecimal:return this.emitNumericEntity(0,2);case ii.NumericHex:return this.emitNumericEntity(0,3);case ii.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ii.EntityStart:return 0}}}function fi(e){let t="";const n=new pi(e,e=>t+=ti(e));return function(e,s){let r=0,o=0;for(;(o=e.indexOf("&",o))>=0;){t+=e.slice(r,o),n.startEntity(s);const i=n.write(e,o+1);if(i<0){r=o+n.end();break}r=o+i,o=0===i?r+1:r}const i=t+e.slice(r);return t="",i}}function mi(e,t,n,s){const r=(t&ri.BRANCH_LENGTH)>>7,o=t&ri.JUMP_TABLE;if(0===r)return 0!==o&&s===o?n:-1;if(o){const t=s-o;return t<0||t>=r?-1:e[n+t]-1}let i=n,a=i+r-1;for(;i<=a;){const t=i+a>>>1,n=e[t];if(n<s)i=t+1;else{if(!(n>s))return e[t+r];a=t-1}}return-1}const gi=fi(Ko);function yi(e,t=li.Legacy){return gi(e,t)}function _i(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)}fi(Xo);const bi=Object.prototype.hasOwnProperty;function vi(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function wi(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function xi(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(!!(65535&~e&&65534!=(65535&e))&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function ki(e){if(e>65535){const t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const Ci=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Ai=new RegExp(Ci.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),Ei=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Di(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(Ai,function(e,t,n){return t||function(e,t){if(35===t.charCodeAt(0)&&Ei.test(t)){const n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return xi(n)?ki(n):e}const n=yi(e);return n!==e?n:e}(e,n)})}const Si=/[&<>"]/,Fi=/[&<>"]/g,Ii={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Ri(e){return Ii[e]}function Ti(e){return Si.test(e)?e.replace(Fi,Ri):e}const Mi=/[.?*+^$[\]\\(){}|-]/g;function Oi(e){switch(e){case 9:case 32:return!0}return!1}function Pi(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Li(e){return Qo.test(e)||Jo.test(e)}function $i(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Bi(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}const zi={mdurl:Ho,ucmicro:Go},Ni=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:wi,assign:vi,escapeHtml:Ti,escapeRE:function(e){return e.replace(Mi,"\\$&")},fromCodePoint:ki,has:function(e,t){return bi.call(e,t)},isMdAsciiPunct:$i,isPunctChar:Li,isSpace:Oi,isString:_i,isValidEntityCode:xi,isWhiteSpace:Pi,lib:zi,normalizeReference:Bi,unescapeAll:Di,unescapeMd:function(e){return e.indexOf("\\")<0?e:e.replace(Ci,"$1")}},Symbol.toStringTag,{value:"Module"}));const qi=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:function(e,t,n){let s,r=t;const o={ok:!1,pos:0,str:""};if(60===e.charCodeAt(r)){for(r++;r<n;){if(s=e.charCodeAt(r),10===s)return o;if(60===s)return o;if(62===s)return o.pos=r+1,o.str=Di(e.slice(t+1,r)),o.ok=!0,o;92===s&&r+1<n?r+=2:r++}return o}let i=0;for(;r<n&&(s=e.charCodeAt(r),32!==s)&&!(s<32||127===s);)if(92===s&&r+1<n){if(32===e.charCodeAt(r+1))break;r+=2}else{if(40===s&&(i++,i>32))return o;if(41===s){if(0===i)break;i--}r++}return t===r||0!==i||(o.str=Di(e.slice(t,r)),o.pos=r,o.ok=!0),o},parseLinkLabel:function(e,t,n){let s,r,o,i;const a=e.posMax,l=e.pos;for(e.pos=t+1,s=1;e.pos<a;){if(o=e.src.charCodeAt(e.pos),93===o&&(s--,0===s)){r=!0;break}if(i=e.pos,e.md.inline.skipToken(e),91===o)if(i===e.pos-1)s++;else if(n)return e.pos=l,-1}let c=-1;return r&&(c=e.pos),e.pos=l,c},parseLinkTitle:function(e,t,n,s){let r,o=t;const i={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(s)i.str=s.str,i.marker=s.marker;else{if(o>=n)return i;let s=e.charCodeAt(o);if(34!==s&&39!==s&&40!==s)return i;t++,o++,40===s&&(s=41),i.marker=s}for(;o<n;){if(r=e.charCodeAt(o),r===i.marker)return i.pos=o+1,i.str+=Di(e.slice(t,o)),i.ok=!0,i;if(40===r&&41===i.marker)return i;92===r&&o+1<n&&o++,o++}return i.can_continue=!0,i.str+=Di(e.slice(t,o)),i}},Symbol.toStringTag,{value:"Module"})),ji={};function Ui(){this.rules=vi({},ji)}function Hi(){this.__rules__=[],this.__cache__=null}function Wi(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}function Vi(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}ji.code_inline=function(e,t,n,s,r){const o=e[t];return"<code"+r.renderAttrs(o)+">"+Ti(o.content)+"</code>"},ji.code_block=function(e,t,n,s,r){const o=e[t];return"<pre"+r.renderAttrs(o)+"><code>"+Ti(e[t].content)+"</code></pre>\n"},ji.fence=function(e,t,n,s,r){const o=e[t],i=o.info?Di(o.info).trim():"";let a,l="",c="";if(i){const e=i.split(/(\s+)/g);l=e[0],c=e.slice(2).join("")}if(a=n.highlight&&n.highlight(o.content,l,c)||Ti(o.content),0===a.indexOf("<pre"))return a+"\n";if(i){const e=o.attrIndex("class"),t=o.attrs?o.attrs.slice():[];e<0?t.push(["class",n.langPrefix+l]):(t[e]=t[e].slice(),t[e][1]+=" "+n.langPrefix+l);const s={attrs:t};return`<pre><code${r.renderAttrs(s)}>${a}</code></pre>\n`}return`<pre><code${r.renderAttrs(o)}>${a}</code></pre>\n`},ji.image=function(e,t,n,s,r){const o=e[t];return o.attrs[o.attrIndex("alt")][1]=r.renderInlineAsText(o.children,n,s),r.renderToken(e,t,n)},ji.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},ji.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},ji.text=function(e,t){return Ti(e[t].content)},ji.html_block=function(e,t){return e[t].content},ji.html_inline=function(e,t){return e[t].content},Ui.prototype.renderAttrs=function(e){let t,n,s;if(!e.attrs)return"";for(s="",t=0,n=e.attrs.length;t<n;t++)s+=" "+Ti(e.attrs[t][0])+'="'+Ti(e.attrs[t][1])+'"';return s},Ui.prototype.renderToken=function(e,t,n){const s=e[t];let r="";if(s.hidden)return"";s.block&&-1!==s.nesting&&t&&e[t-1].hidden&&(r+="\n"),r+=(-1===s.nesting?"</":"<")+s.tag,r+=this.renderAttrs(s),0===s.nesting&&n.xhtmlOut&&(r+=" /");let o=!1;if(s.block&&(o=!0,1===s.nesting&&t+1<e.length)){const n=e[t+1];("inline"===n.type||n.hidden||-1===n.nesting&&n.tag===s.tag)&&(o=!1)}return r+=o?">\n":">",r},Ui.prototype.renderInline=function(e,t,n){let s="";const r=this.rules;for(let o=0,i=e.length;o<i;o++){const i=e[o].type;void 0!==r[i]?s+=r[i](e,o,t,n,this):s+=this.renderToken(e,o,t)}return s},Ui.prototype.renderInlineAsText=function(e,t,n){let s="";for(let r=0,o=e.length;r<o;r++)switch(e[r].type){case"text":case"html_inline":case"html_block":s+=e[r].content;break;case"image":s+=this.renderInlineAsText(e[r].children,t,n);break;case"softbreak":case"hardbreak":s+="\n"}return s},Ui.prototype.render=function(e,t,n){let s="";const r=this.rules;for(let o=0,i=e.length;o<i;o++){const i=e[o].type;"inline"===i?s+=this.renderInline(e[o].children,t,n):void 0!==r[i]?s+=r[i](e,o,t,n,this):s+=this.renderToken(e,o,t,n)}return s},Hi.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},Hi.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},Hi.prototype.at=function(e,t,n){const s=this.__find__(e),r=n||{};if(-1===s)throw new Error("Parser rule not found: "+e);this.__rules__[s].fn=t,this.__rules__[s].alt=r.alt||[],this.__cache__=null},Hi.prototype.before=function(e,t,n,s){const r=this.__find__(e),o=s||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},Hi.prototype.after=function(e,t,n,s){const r=this.__find__(e),o=s||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},Hi.prototype.push=function(e,t,n){const s=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:s.alt||[]}),this.__cache__=null},Hi.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(e){const s=this.__find__(e);if(s<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[s].enabled=!0,n.push(e)},this),this.__cache__=null,n},Hi.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},Hi.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(e){const s=this.__find__(e);if(s<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[s].enabled=!1,n.push(e)},this),this.__cache__=null,n},Hi.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},Wi.prototype.attrIndex=function(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,s=t.length;n<s;n++)if(t[n][0]===e)return n;return-1},Wi.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},Wi.prototype.attrSet=function(e,t){const n=this.attrIndex(e),s=[e,t];n<0?this.attrPush(s):this.attrs[n]=s},Wi.prototype.attrGet=function(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n},Wi.prototype.attrJoin=function(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t},Vi.prototype.Token=Wi;const Qi=/\r\n?|\n/g,Ji=/\0/g;function Zi(e){return/^<a[>\s]/i.test(e)}function Gi(e){return/^<\/a\s*>/i.test(e)}const Ki=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Xi=/\((c|tm|r)\)/i,Yi=/\((c|tm|r)\)/gi,ea={c:"©",r:"®",tm:"™"};function ta(e,t){return ea[t.toLowerCase()]}function na(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];"text"!==s.type||t||(s.content=s.content.replace(Yi,ta)),"link_open"===s.type&&"auto"===s.info&&t--,"link_close"===s.type&&"auto"===s.info&&t++}}function sa(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];"text"!==s.type||t||Ki.test(s.content)&&(s.content=s.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===s.type&&"auto"===s.info&&t--,"link_close"===s.type&&"auto"===s.info&&t++}}const ra=/['"]/,oa=/['"]/g;function ia(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function aa(e,t){let n;const s=[];for(let r=0;r<e.length;r++){const o=e[r],i=e[r].level;for(n=s.length-1;n>=0&&!(s[n].level<=i);n--);if(s.length=n+1,"text"!==o.type)continue;let a=o.content,l=0,c=a.length;e:for(;l<c;){oa.lastIndex=l;const u=oa.exec(a);if(!u)break;let h=!0,d=!0;l=u.index+1;const p="'"===u[0];let f=32;if(u.index-1>=0)f=a.charCodeAt(u.index-1);else for(n=r-1;n>=0&&("softbreak"!==e[n].type&&"hardbreak"!==e[n].type);n--)if(e[n].content){f=e[n].content.charCodeAt(e[n].content.length-1);break}let m=32;if(l<c)m=a.charCodeAt(l);else for(n=r+1;n<e.length&&("softbreak"!==e[n].type&&"hardbreak"!==e[n].type);n++)if(e[n].content){m=e[n].content.charCodeAt(0);break}const g=$i(f)||Li(String.fromCharCode(f)),y=$i(m)||Li(String.fromCharCode(m)),_=Pi(f),b=Pi(m);if(b?h=!1:y&&(_||g||(h=!1)),_?d=!1:g&&(b||y||(d=!1)),34===m&&'"'===u[0]&&f>=48&&f<=57&&(d=h=!1),h&&d&&(h=g,d=y),h||d){if(d)for(n=s.length-1;n>=0;n--){let h=s[n];if(s[n].level<i)break;if(h.single===p&&s[n].level===i){let i,d;h=s[n],p?(i=t.md.options.quotes[2],d=t.md.options.quotes[3]):(i=t.md.options.quotes[0],d=t.md.options.quotes[1]),o.content=ia(o.content,u.index,d),e[h.token].content=ia(e[h.token].content,h.pos,i),l+=d.length-1,h.token===r&&(l+=i.length-1),a=o.content,c=a.length,s.length=n;continue e}}h?s.push({token:r,pos:u.index,single:p,level:i}):d&&p&&(o.content=ia(o.content,u.index,"’"))}else p&&(o.content=ia(o.content,u.index,"’"))}}}const la=[["normalize",function(e){let t;t=e.src.replace(Qi,"\n"),t=t.replace(Ji,"�"),e.src=t}],["block",function(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}],["inline",function(e){const t=e.tokens;for(let n=0,s=t.length;n<s;n++){const s=t[n];"inline"===s.type&&e.md.inline.parse(s.content,e.md,e.env,s.children)}}],["linkify",function(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,s=t.length;n<s;n++){if("inline"!==t[n].type||!e.md.linkify.pretest(t[n].content))continue;let s=t[n].children,r=0;for(let o=s.length-1;o>=0;o--){const i=s[o];if("link_close"!==i.type){if("html_inline"===i.type&&(Zi(i.content)&&r>0&&r--,Gi(i.content)&&r++),!(r>0)&&"text"===i.type&&e.md.linkify.test(i.content)){const r=i.content;let a=e.md.linkify.match(r);const l=[];let c=i.level,u=0;a.length>0&&0===a[0].index&&o>0&&"text_special"===s[o-1].type&&(a=a.slice(1));for(let t=0;t<a.length;t++){const n=a[t].url,s=e.md.normalizeLink(n);if(!e.md.validateLink(s))continue;let o=a[t].text;o=a[t].schema?"mailto:"!==a[t].schema||/^mailto:/i.test(o)?e.md.normalizeLinkText(o):e.md.normalizeLinkText("mailto:"+o).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+o).replace(/^http:\/\//,"");const i=a[t].index;if(i>u){const t=new e.Token("text","",0);t.content=r.slice(u,i),t.level=c,l.push(t)}const h=new e.Token("link_open","a",1);h.attrs=[["href",s]],h.level=c++,h.markup="linkify",h.info="auto",l.push(h);const d=new e.Token("text","",0);d.content=o,d.level=c,l.push(d);const p=new e.Token("link_close","a",-1);p.level=--c,p.markup="linkify",p.info="auto",l.push(p),u=a[t].lastIndex}if(u<r.length){const t=new e.Token("text","",0);t.content=r.slice(u),t.level=c,l.push(t)}t[n].children=s=wi(s,o,l)}}else for(o--;s[o].level!==i.level&&"link_open"!==s[o].type;)o--}}}],["replacements",function(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&(Xi.test(e.tokens[t].content)&&na(e.tokens[t].children),Ki.test(e.tokens[t].content)&&sa(e.tokens[t].children))}],["smartquotes",function(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&ra.test(e.tokens[t].content)&&aa(e.tokens[t].children,e)}],["text_join",function(e){let t,n;const s=e.tokens,r=s.length;for(let o=0;o<r;o++){if("inline"!==s[o].type)continue;const e=s[o].children,r=e.length;for(t=0;t<r;t++)"text_special"===e[t].type&&(e[t].type="text");for(t=n=0;t<r;t++)"text"===e[t].type&&t+1<r&&"text"===e[t+1].type?e[t+1].content=e[t].content+e[t+1].content:(t!==n&&(e[n]=e[t]),n++);t!==n&&(e.length=n)}}]];function ca(){this.ruler=new Hi;for(let e=0;e<la.length;e++)this.ruler.push(la[e][0],la[e][1])}function ua(e,t,n,s){this.src=e,this.md=t,this.env=n,this.tokens=s,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const r=this.src;for(let o=0,i=0,a=0,l=0,c=r.length,u=!1;i<c;i++){const e=r.charCodeAt(i);if(!u){if(Oi(e)){a++,9===e?l+=4-l%4:l++;continue}u=!0}10!==e&&i!==c-1||(10!==e&&i++,this.bMarks.push(o),this.eMarks.push(i),this.tShift.push(a),this.sCount.push(l),this.bsCount.push(0),u=!1,a=0,l=0,o=i+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}ca.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,s=t.length;n<s;n++)t[n](e)},ca.prototype.State=Vi,ua.prototype.push=function(e,t,n){const s=new Wi(e,t,n);return s.block=!0,n<0&&this.level--,s.level=this.level,n>0&&this.level++,this.tokens.push(s),s},ua.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},ua.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},ua.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t;e++){if(!Oi(this.src.charCodeAt(e)))break}return e},ua.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!Oi(this.src.charCodeAt(--e)))return e+1;return e},ua.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},ua.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},ua.prototype.getLines=function(e,t,n,s){if(e>=t)return"";const r=new Array(t-e);for(let o=0,i=e;i<t;i++,o++){let e=0;const a=this.bMarks[i];let l,c=a;for(l=i+1<t||s?this.eMarks[i]+1:this.eMarks[i];c<l&&e<n;){const t=this.src.charCodeAt(c);if(Oi(t))9===t?e+=4-(e+this.bsCount[i])%4:e++;else{if(!(c-a<this.tShift[i]))break;e++}c++}r[o]=e>n?new Array(e-n+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return r.join("")},ua.prototype.Token=Wi;function ha(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function da(e){const t=[],n=e.length;let s=0,r=e.charCodeAt(s),o=!1,i=0,a="";for(;s<n;)124===r&&(o?(a+=e.substring(i,s-1),i=s):(t.push(a+e.substring(i,s)),a="",i=s+1)),o=92===r,s++,r=e.charCodeAt(s);return t.push(a+e.substring(i)),t}function pa(e,t){const n=e.eMarks[t];let s=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(s++);if(42!==r&&45!==r&&43!==r)return-1;if(s<n){if(!Oi(e.src.charCodeAt(s)))return-1}return s}function fa(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];let r=n;if(r+1>=s)return-1;let o=e.src.charCodeAt(r++);if(o<48||o>57)return-1;for(;;){if(r>=s)return-1;if(o=e.src.charCodeAt(r++),!(o>=48&&o<=57)){if(41===o||46===o)break;return-1}if(r-n>=10)return-1}return r<s&&(o=e.src.charCodeAt(r),!Oi(o))?-1:r}const ma="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",ga="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",ya=new RegExp("^(?:"+ma+"|"+ga+"|\x3c!---?>|\x3c!--(?:[^-]|-[^-]|--[^>])*--\x3e|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),_a=new RegExp("^(?:"+ma+"|"+ga+")"),ba=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"].join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(_a.source+"\\s*$"),/^$/,!1]];const va=[["table",function(e,t,n,s){if(t+2>n)return!1;let r=t+1;if(e.sCount[r]<e.blkIndent)return!1;if(e.sCount[r]-e.blkIndent>=4)return!1;let o=e.bMarks[r]+e.tShift[r];if(o>=e.eMarks[r])return!1;const i=e.src.charCodeAt(o++);if(124!==i&&45!==i&&58!==i)return!1;if(o>=e.eMarks[r])return!1;const a=e.src.charCodeAt(o++);if(124!==a&&45!==a&&58!==a&&!Oi(a))return!1;if(45===i&&Oi(a))return!1;for(;o<e.eMarks[r];){const t=e.src.charCodeAt(o);if(124!==t&&45!==t&&58!==t&&!Oi(t))return!1;o++}let l=ha(e,t+1),c=l.split("|");const u=[];for(let y=0;y<c.length;y++){const e=c[y].trim();if(!e){if(0===y||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(e))return!1;58===e.charCodeAt(e.length-1)?u.push(58===e.charCodeAt(0)?"center":"right"):58===e.charCodeAt(0)?u.push("left"):u.push("")}if(l=ha(e,t).trim(),-1===l.indexOf("|"))return!1;if(e.sCount[t]-e.blkIndent>=4)return!1;c=da(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop();const h=c.length;if(0===h||h!==u.length)return!1;if(s)return!0;const d=e.parentType;e.parentType="table";const p=e.md.block.ruler.getRules("blockquote"),f=[t,0];e.push("table_open","table",1).map=f,e.push("thead_open","thead",1).map=[t,t+1],e.push("tr_open","tr",1).map=[t,t+1];for(let y=0;y<c.length;y++){const t=e.push("th_open","th",1);u[y]&&(t.attrs=[["style","text-align:"+u[y]]]);const n=e.push("inline","",0);n.content=c[y].trim(),n.children=[],e.push("th_close","th",-1)}let m;e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let g=0;for(r=t+2;r<n&&!(e.sCount[r]<e.blkIndent);r++){let s=!1;for(let t=0,o=p.length;t<o;t++)if(p[t](e,r,n,!0)){s=!0;break}if(s)break;if(l=ha(e,r).trim(),!l)break;if(e.sCount[r]-e.blkIndent>=4)break;if(c=da(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop(),g+=h-c.length,g>65536)break;if(r===t+2){e.push("tbody_open","tbody",1).map=m=[t+2,0]}e.push("tr_open","tr",1).map=[r,r+1];for(let t=0;t<h;t++){const n=e.push("td_open","td",1);u[t]&&(n.attrs=[["style","text-align:"+u[t]]]);const s=e.push("inline","",0);s.content=c[t]?c[t].trim():"",s.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return m&&(e.push("tbody_close","tbody",-1),m[1]=r),e.push("table_close","table",-1),f[1]=r,e.parentType=d,e.line=r,!0},["paragraph","reference"]],["code",function(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let s=t+1,r=s;for(;s<n;)if(e.isEmpty(s))s++;else{if(!(e.sCount[s]-e.blkIndent>=4))break;s++,r=s}e.line=r;const o=e.push("code_block","code",0);return o.content=e.getLines(t,r,4+e.blkIndent,!1)+"\n",o.map=[t,e.line],!0}],["fence",function(e,t,n,s){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(r+3>o)return!1;const i=e.src.charCodeAt(r);if(126!==i&&96!==i)return!1;let a=r;r=e.skipChars(r,i);let l=r-a;if(l<3)return!1;const c=e.src.slice(a,r),u=e.src.slice(r,o);if(96===i&&u.indexOf(String.fromCharCode(i))>=0)return!1;if(s)return!0;let h=t,d=!1;for(;(h++,!(h>=n))&&(r=a=e.bMarks[h]+e.tShift[h],o=e.eMarks[h],!(r<o&&e.sCount[h]<e.blkIndent));)if(e.src.charCodeAt(r)===i&&!(e.sCount[h]-e.blkIndent>=4||(r=e.skipChars(r,i),r-a<l||(r=e.skipSpaces(r),r<o)))){d=!0;break}l=e.sCount[t],e.line=h+(d?1:0);const p=e.push("fence","code",0);return p.info=u,p.content=e.getLines(t+1,h,l,!0),p.markup=c,p.map=[t,e.line],!0},["paragraph","reference","blockquote","list"]],["blockquote",function(e,t,n,s){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];const i=e.lineMax;if(e.sCount[t]-e.blkIndent>=4)return!1;if(62!==e.src.charCodeAt(r))return!1;if(s)return!0;const a=[],l=[],c=[],u=[],h=e.md.block.ruler.getRules("blockquote"),d=e.parentType;e.parentType="blockquote";let p,f=!1;for(p=t;p<n;p++){const t=e.sCount[p]<e.blkIndent;if(r=e.bMarks[p]+e.tShift[p],o=e.eMarks[p],r>=o)break;if(62===e.src.charCodeAt(r++)&&!t){let t,n,s=e.sCount[p]+1;32===e.src.charCodeAt(r)?(r++,s++,n=!1,t=!0):9===e.src.charCodeAt(r)?(t=!0,(e.bsCount[p]+s)%4==3?(r++,s++,n=!1):n=!0):t=!1;let i=s;for(a.push(e.bMarks[p]),e.bMarks[p]=r;r<o;){const t=e.src.charCodeAt(r);if(!Oi(t))break;9===t?i+=4-(i+e.bsCount[p]+(n?1:0))%4:i++,r++}f=r>=o,l.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(t?1:0),c.push(e.sCount[p]),e.sCount[p]=i-s,u.push(e.tShift[p]),e.tShift[p]=r-e.bMarks[p];continue}if(f)break;let s=!1;for(let r=0,o=h.length;r<o;r++)if(h[r](e,p,n,!0)){s=!0;break}if(s){e.lineMax=p,0!==e.blkIndent&&(a.push(e.bMarks[p]),l.push(e.bsCount[p]),u.push(e.tShift[p]),c.push(e.sCount[p]),e.sCount[p]-=e.blkIndent);break}a.push(e.bMarks[p]),l.push(e.bsCount[p]),u.push(e.tShift[p]),c.push(e.sCount[p]),e.sCount[p]=-1}const m=e.blkIndent;e.blkIndent=0;const g=e.push("blockquote_open","blockquote",1);g.markup=">";const y=[t,0];g.map=y,e.md.block.tokenize(e,t,p),e.push("blockquote_close","blockquote",-1).markup=">",e.lineMax=i,e.parentType=d,y[1]=e.line;for(let _=0;_<u.length;_++)e.bMarks[_+t]=a[_],e.tShift[_+t]=u[_],e.sCount[_+t]=c[_],e.bsCount[_+t]=l[_];return e.blkIndent=m,!0},["paragraph","reference","blockquote","list"]],["hr",function(e,t,n,s){const r=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(o++);if(42!==i&&45!==i&&95!==i)return!1;let a=1;for(;o<r;){const t=e.src.charCodeAt(o++);if(t!==i&&!Oi(t))return!1;t===i&&a++}if(a<3)return!1;if(s)return!0;e.line=t+1;const l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=Array(a+1).join(String.fromCharCode(i)),!0},["paragraph","reference","blockquote","list"]],["list",function(e,t,n,s){let r,o,i,a,l=t,c=!0;if(e.sCount[l]-e.blkIndent>=4)return!1;if(e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let u,h,d,p=!1;if(s&&"paragraph"===e.parentType&&e.sCount[l]>=e.blkIndent&&(p=!0),(d=fa(e,l))>=0){if(u=!0,i=e.bMarks[l]+e.tShift[l],h=Number(e.src.slice(i,d-1)),p&&1!==h)return!1}else{if(!((d=pa(e,l))>=0))return!1;u=!1}if(p&&e.skipSpaces(d)>=e.eMarks[l])return!1;if(s)return!0;const f=e.src.charCodeAt(d-1),m=e.tokens.length;u?(a=e.push("ordered_list_open","ol",1),1!==h&&(a.attrs=[["start",h]])):a=e.push("bullet_list_open","ul",1);const g=[l,0];a.map=g,a.markup=String.fromCharCode(f);let y=!1;const _=e.md.block.ruler.getRules("list"),b=e.parentType;for(e.parentType="list";l<n;){o=d,r=e.eMarks[l];const t=e.sCount[l]+d-(e.bMarks[l]+e.tShift[l]);let s=t;for(;o<r;){const t=e.src.charCodeAt(o);if(9===t)s+=4-(s+e.bsCount[l])%4;else{if(32!==t)break;s++}o++}const h=o;let p;p=h>=r?1:s-t,p>4&&(p=1);const m=t+p;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(f);const g=[l,0];a.map=g,u&&(a.info=e.src.slice(i,d-1));const b=e.tight,v=e.tShift[l],w=e.sCount[l],x=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=m,e.tight=!0,e.tShift[l]=h-e.bMarks[l],e.sCount[l]=s,h>=r&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),e.tight&&!y||(c=!1),y=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=x,e.tShift[l]=v,e.sCount[l]=w,e.tight=b,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(f),l=e.line,g[1]=l,l>=n)break;if(e.sCount[l]<e.blkIndent)break;if(e.sCount[l]-e.blkIndent>=4)break;let k=!1;for(let r=0,o=_.length;r<o;r++)if(_[r](e,l,n,!0)){k=!0;break}if(k)break;if(u){if(d=fa(e,l),d<0)break;i=e.bMarks[l]+e.tShift[l]}else if(d=pa(e,l),d<0)break;if(f!==e.src.charCodeAt(d-1))break}return a=u?e.push("ordered_list_close","ol",-1):e.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(f),g[1]=l,e.line=l,e.parentType=b,c&&function(e,t){const n=e.level+2;for(let s=t+2,r=e.tokens.length-2;s<r;s++)e.tokens[s].level===n&&"paragraph_open"===e.tokens[s].type&&(e.tokens[s+2].hidden=!0,e.tokens[s].hidden=!0,s+=2)}(e,m),!0},["paragraph","reference","blockquote"]],["reference",function(e,t,n,s){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],i=t+1;if(e.sCount[t]-e.blkIndent>=4)return!1;if(91!==e.src.charCodeAt(r))return!1;function a(t){const n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let s=!1;if(e.sCount[t]-e.blkIndent>3&&(s=!0),e.sCount[t]<0&&(s=!0),!s){const s=e.md.block.ruler.getRules("reference"),r=e.parentType;e.parentType="reference";let o=!1;for(let i=0,a=s.length;i<a;i++)if(s[i](e,t,n,!0)){o=!0;break}if(e.parentType=r,o)return null}const r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(r,o+1)}let l=e.src.slice(r,o+1);o=l.length;let c=-1;for(r=1;r<o;r++){const e=l.charCodeAt(r);if(91===e)return!1;if(93===e){c=r;break}if(10===e){const e=a(i);null!==e&&(l+=e,o=l.length,i++)}else if(92===e&&(r++,r<o&&10===l.charCodeAt(r))){const e=a(i);null!==e&&(l+=e,o=l.length,i++)}}if(c<0||58!==l.charCodeAt(c+1))return!1;for(r=c+2;r<o;r++){const e=l.charCodeAt(r);if(10===e){const e=a(i);null!==e&&(l+=e,o=l.length,i++)}else if(!Oi(e))break}const u=e.md.helpers.parseLinkDestination(l,r,o);if(!u.ok)return!1;const h=e.md.normalizeLink(u.str);if(!e.md.validateLink(h))return!1;r=u.pos;const d=r,p=i,f=r;for(;r<o;r++){const e=l.charCodeAt(r);if(10===e){const e=a(i);null!==e&&(l+=e,o=l.length,i++)}else if(!Oi(e))break}let m,g=e.md.helpers.parseLinkTitle(l,r,o);for(;g.can_continue;){const t=a(i);if(null===t)break;l+=t,r=o,o=l.length,i++,g=e.md.helpers.parseLinkTitle(l,r,o,g)}for(r<o&&f!==r&&g.ok?(m=g.str,r=g.pos):(m="",r=d,i=p);r<o;){if(!Oi(l.charCodeAt(r)))break;r++}if(r<o&&10!==l.charCodeAt(r)&&m)for(m="",r=d,i=p;r<o;){if(!Oi(l.charCodeAt(r)))break;r++}if(r<o&&10!==l.charCodeAt(r))return!1;const y=Bi(l.slice(1,c));return!!y&&(s||(void 0===e.env.references&&(e.env.references={}),void 0===e.env.references[y]&&(e.env.references[y]={title:m,href:h}),e.line=i),!0)}],["html_block",function(e,t,n,s){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(r))return!1;let i=e.src.slice(r,o),a=0;for(;a<ba.length&&!ba[a][0].test(i);a++);if(a===ba.length)return!1;if(s)return ba[a][2];let l=t+1;if(!ba[a][1].test(i))for(;l<n&&!(e.sCount[l]<e.blkIndent);l++)if(r=e.bMarks[l]+e.tShift[l],o=e.eMarks[l],i=e.src.slice(r,o),ba[a][1].test(i)){0!==i.length&&l++;break}e.line=l;const c=e.push("html_block","",0);return c.map=[t,l],c.content=e.getLines(t,l,e.blkIndent,!0),!0},["paragraph","reference","blockquote"]],["heading",function(e,t,n,s){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.src.charCodeAt(r);if(35!==i||r>=o)return!1;let a=1;for(i=e.src.charCodeAt(++r);35===i&&r<o&&a<=6;)a++,i=e.src.charCodeAt(++r);if(a>6||r<o&&!Oi(i))return!1;if(s)return!0;o=e.skipSpacesBack(o,r);const l=e.skipCharsBack(o,35,r);l>r&&Oi(e.src.charCodeAt(l-1))&&(o=l),e.line=t+1;const c=e.push("heading_open","h"+String(a),1);c.markup="########".slice(0,a),c.map=[t,e.line];const u=e.push("inline","",0);return u.content=e.src.slice(r,o).trim(),u.map=[t,e.line],u.children=[],e.push("heading_close","h"+String(a),-1).markup="########".slice(0,a),!0},["paragraph","reference","blockquote"]],["lheading",function(e,t,n){const s=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let o,i=0,a=t+1;for(;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3)continue;if(e.sCount[a]>=e.blkIndent){let t=e.bMarks[a]+e.tShift[a];const n=e.eMarks[a];if(t<n&&(o=e.src.charCodeAt(t),(45===o||61===o)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){i=61===o?1:2;break}}if(e.sCount[a]<0)continue;let t=!1;for(let r=0,o=s.length;r<o;r++)if(s[r](e,a,n,!0)){t=!0;break}if(t)break}if(!i)return!1;const l=e.getLines(t,a,e.blkIndent,!1).trim();e.line=a+1;const c=e.push("heading_open","h"+String(i),1);c.markup=String.fromCharCode(o),c.map=[t,e.line];const u=e.push("inline","",0);return u.content=l,u.map=[t,e.line-1],u.children=[],e.push("heading_close","h"+String(i),-1).markup=String.fromCharCode(o),e.parentType=r,!0}],["paragraph",function(e,t,n){const s=e.md.block.ruler.getRules("paragraph"),r=e.parentType;let o=t+1;for(e.parentType="paragraph";o<n&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3)continue;if(e.sCount[o]<0)continue;let t=!1;for(let r=0,i=s.length;r<i;r++)if(s[r](e,o,n,!0)){t=!0;break}if(t)break}const i=e.getLines(t,o,e.blkIndent,!1).trim();e.line=o,e.push("paragraph_open","p",1).map=[t,e.line];const a=e.push("inline","",0);return a.content=i,a.map=[t,e.line],a.children=[],e.push("paragraph_close","p",-1),e.parentType=r,!0}]];function wa(){this.ruler=new Hi;for(let e=0;e<va.length;e++)this.ruler.push(va[e][0],va[e][1],{alt:(va[e][2]||[]).slice()})}function xa(e,t,n,s){this.src=e,this.env=n,this.md=t,this.tokens=s,this.tokens_meta=Array(s.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}function ka(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}wa.prototype.tokenize=function(e,t,n){const s=this.ruler.getRules(""),r=s.length,o=e.md.options.maxNesting;let i=t,a=!1;for(;i<n&&(e.line=i=e.skipEmptyLines(i),!(i>=n))&&!(e.sCount[i]<e.blkIndent);){if(e.level>=o){e.line=n;break}const t=e.line;let l=!1;for(let o=0;o<r;o++)if(l=s[o](e,i,n,!1),l){if(t>=e.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),i=e.line,i<n&&e.isEmpty(i)&&(a=!0,i++,e.line=i)}},wa.prototype.parse=function(e,t,n,s){if(!e)return;const r=new this.State(e,t,n,s);this.tokenize(r,r.line,r.lineMax)},wa.prototype.State=ua,xa.prototype.pushPending=function(){const e=new Wi("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},xa.prototype.push=function(e,t,n){this.pending&&this.pushPending();const s=new Wi(e,t,n);let r=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),s.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(s),this.tokens_meta.push(r),s},xa.prototype.scanDelims=function(e,t){const n=this.posMax,s=this.src.charCodeAt(e),r=e>0?this.src.charCodeAt(e-1):32;let o=e;for(;o<n&&this.src.charCodeAt(o)===s;)o++;const i=o-e,a=o<n?this.src.charCodeAt(o):32,l=$i(r)||Li(String.fromCharCode(r)),c=$i(a)||Li(String.fromCharCode(a)),u=Pi(r),h=Pi(a),d=!h&&(!c||u||l),p=!u&&(!l||h||c);return{can_open:d&&(t||!p||l),can_close:p&&(t||!d||c),length:i}},xa.prototype.Token=Wi;const Ca=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;const Aa=[];for(let Sf=0;Sf<256;Sf++)Aa.push(0);function Ea(e,t){let n;const s=[],r=t.length;for(let o=0;o<r;o++){const r=t[o];if(126!==r.marker)continue;if(-1===r.end)continue;const i=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[i.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="","text"===e.tokens[i.token-1].type&&"~"===e.tokens[i.token-1].content&&s.push(i.token-1)}for(;s.length;){const t=s.pop();let r=t+1;for(;r<e.tokens.length&&"s_close"===e.tokens[r].type;)r++;r--,t!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[t],e.tokens[t]=n)}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Aa[e.charCodeAt(0)]=1});const Da={tokenize:function(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t)return!1;if(126!==s)return!1;const r=e.scanDelims(e.pos,!0);let o=r.length;const i=String.fromCharCode(s);if(o<2)return!1;let a;o%2&&(a=e.push("text","",0),a.content=i,o--);for(let l=0;l<o;l+=2)a=e.push("text","",0),a.content=i+i,e.delimiters.push({marker:s,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0},postProcess:function(e){const t=e.tokens_meta,n=e.tokens_meta.length;Ea(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&Ea(e,t[s].delimiters)}};function Sa(e,t){for(let n=t.length-1;n>=0;n--){const s=t[n];if(95!==s.marker&&42!==s.marker)continue;if(-1===s.end)continue;const r=t[s.end],o=n>0&&t[n-1].end===s.end+1&&t[n-1].marker===s.marker&&t[n-1].token===s.token-1&&t[s.end+1].token===r.token+1,i=String.fromCharCode(s.marker),a=e.tokens[s.token];a.type=o?"strong_open":"em_open",a.tag=o?"strong":"em",a.nesting=1,a.markup=o?i+i:i,a.content="";const l=e.tokens[r.token];l.type=o?"strong_close":"em_close",l.tag=o?"strong":"em",l.nesting=-1,l.markup=o?i+i:i,l.content="",o&&(e.tokens[t[n-1].token].content="",e.tokens[t[s.end+1].token].content="",n--)}}const Fa={tokenize:function(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t)return!1;if(95!==s&&42!==s)return!1;const r=e.scanDelims(e.pos,42===s);for(let o=0;o<r.length;o++){e.push("text","",0).content=String.fromCharCode(s),e.delimiters.push({marker:s,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return e.pos+=r.length,!0},postProcess:function(e){const t=e.tokens_meta,n=e.tokens_meta.length;Sa(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&Sa(e,t[s].delimiters)}};const Ia=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Ra=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;const Ta=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Ma=/^&([a-z][a-z0-9]{1,31});/i;function Oa(e){const t={},n=e.length;if(!n)return;let s=0,r=-2;const o=[];for(let i=0;i<n;i++){const n=e[i];if(o.push(0),e[s].marker===n.marker&&r===n.token-1||(s=i),r=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[n.marker][(n.open?3:0)+n.length%3];let l=s-o[s]-1,c=l;for(;l>a;l-=o[l]+1){const t=e[l];if(t.marker===n.marker&&(t.open&&t.end<0)){let s=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3==0&&n.length%3==0||(s=!0)),!s){const s=l>0&&!e[l-1].open?o[l-1]+1:0;o[i]=i-l+s,o[l]=s,n.open=!1,t.end=i,t.close=!1,c=-1,r=-2;break}}}-1!==c&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=c)}}const Pa=[["text",function(e,t){let n=e.pos;for(;n<e.posMax&&!ka(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}],["linkify",function(e,t){if(!e.md.options.linkify)return!1;if(e.linkLevel>0)return!1;const n=e.pos;if(n+3>e.posMax)return!1;if(58!==e.src.charCodeAt(n))return!1;if(47!==e.src.charCodeAt(n+1))return!1;if(47!==e.src.charCodeAt(n+2))return!1;const s=e.pending.match(Ca);if(!s)return!1;const r=s[1],o=e.md.linkify.matchAtStart(e.src.slice(n-r.length));if(!o)return!1;let i=o.url;if(i.length<=r.length)return!1;i=i.replace(/\*+$/,"");const a=e.md.normalizeLink(i);if(!e.md.validateLink(a))return!1;if(!t){e.pending=e.pending.slice(0,-r.length);const t=e.push("link_open","a",1);t.attrs=[["href",a]],t.markup="linkify",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(i);const n=e.push("link_close","a",-1);n.markup="linkify",n.info="auto"}return e.pos+=i.length-r.length,!0}],["newline",function(e,t){let n=e.pos;if(10!==e.src.charCodeAt(n))return!1;const s=e.pending.length-1,r=e.posMax;if(!t)if(s>=0&&32===e.pending.charCodeAt(s))if(s>=1&&32===e.pending.charCodeAt(s-1)){let t=s-1;for(;t>=1&&32===e.pending.charCodeAt(t-1);)t--;e.pending=e.pending.slice(0,t),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<r&&Oi(e.src.charCodeAt(n));)n++;return e.pos=n,!0}],["escape",function(e,t){let n=e.pos;const s=e.posMax;if(92!==e.src.charCodeAt(n))return!1;if(n++,n>=s)return!1;let r=e.src.charCodeAt(n);if(10===r){for(t||e.push("hardbreak","br",0),n++;n<s&&(r=e.src.charCodeAt(n),Oi(r));)n++;return e.pos=n,!0}let o=e.src[n];if(r>=55296&&r<=56319&&n+1<s){const t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(o+=e.src[n+1],n++)}const i="\\"+o;if(!t){const t=e.push("text_special","",0);r<256&&0!==Aa[r]?t.content=o:t.content=i,t.markup=i,t.info="escape"}return e.pos=n+1,!0}],["backticks",function(e,t){let n=e.pos;if(96!==e.src.charCodeAt(n))return!1;const s=n;n++;const r=e.posMax;for(;n<r&&96===e.src.charCodeAt(n);)n++;const o=e.src.slice(s,n),i=o.length;if(e.backticksScanned&&(e.backticks[i]||0)<=s)return t||(e.pending+=o),e.pos+=i,!0;let a,l=n;for(;-1!==(a=e.src.indexOf("`",l));){for(l=a+1;l<r&&96===e.src.charCodeAt(l);)l++;const s=l-a;if(s===i){if(!t){const t=e.push("code_inline","code",0);t.markup=o,t.content=e.src.slice(n,a).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=l,!0}e.backticks[s]=a}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=i,!0}],["strikethrough",Da.tokenize],["emphasis",Fa.tokenize],["link",function(e,t){let n,s,r,o,i="",a="",l=e.pos,c=!0;if(91!==e.src.charCodeAt(e.pos))return!1;const u=e.pos,h=e.posMax,d=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let f=p+1;if(f<h&&40===e.src.charCodeAt(f)){for(c=!1,f++;f<h&&(n=e.src.charCodeAt(f),Oi(n)||10===n);f++);if(f>=h)return!1;if(l=f,r=e.md.helpers.parseLinkDestination(e.src,f,e.posMax),r.ok){for(i=e.md.normalizeLink(r.str),e.md.validateLink(i)?f=r.pos:i="",l=f;f<h&&(n=e.src.charCodeAt(f),Oi(n)||10===n);f++);if(r=e.md.helpers.parseLinkTitle(e.src,f,e.posMax),f<h&&l!==f&&r.ok)for(a=r.str,f=r.pos;f<h&&(n=e.src.charCodeAt(f),Oi(n)||10===n);f++);}(f>=h||41!==e.src.charCodeAt(f))&&(c=!0),f++}if(c){if(void 0===e.env.references)return!1;if(f<h&&91===e.src.charCodeAt(f)?(l=f+1,f=e.md.helpers.parseLinkLabel(e,f),f>=0?s=e.src.slice(l,f++):f=p+1):f=p+1,s||(s=e.src.slice(d,p)),o=e.env.references[Bi(s)],!o)return e.pos=u,!1;i=o.href,a=o.title}if(!t){e.pos=d,e.posMax=p;const t=[["href",i]];e.push("link_open","a",1).attrs=t,a&&t.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=f,e.posMax=h,!0}],["image",function(e,t){let n,s,r,o,i,a,l,c,u="";const h=e.pos,d=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;const p=e.pos+2,f=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(f<0)return!1;if(o=f+1,o<d&&40===e.src.charCodeAt(o)){for(o++;o<d&&(n=e.src.charCodeAt(o),Oi(n)||10===n);o++);if(o>=d)return!1;for(c=o,a=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),a.ok&&(u=e.md.normalizeLink(a.str),e.md.validateLink(u)?o=a.pos:u=""),c=o;o<d&&(n=e.src.charCodeAt(o),Oi(n)||10===n);o++);if(a=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<d&&c!==o&&a.ok)for(l=a.str,o=a.pos;o<d&&(n=e.src.charCodeAt(o),Oi(n)||10===n);o++);else l="";if(o>=d||41!==e.src.charCodeAt(o))return e.pos=h,!1;o++}else{if(void 0===e.env.references)return!1;if(o<d&&91===e.src.charCodeAt(o)?(c=o+1,o=e.md.helpers.parseLinkLabel(e,o),o>=0?r=e.src.slice(c,o++):o=f+1):o=f+1,r||(r=e.src.slice(p,f)),i=e.env.references[Bi(r)],!i)return e.pos=h,!1;u=i.href,l=i.title}if(!t){s=e.src.slice(p,f);const t=[];e.md.inline.parse(s,e.md,e.env,t);const n=e.push("image","img",0),r=[["src",u],["alt",""]];n.attrs=r,n.children=t,n.content=s,l&&r.push(["title",l])}return e.pos=o,e.posMax=d,!0}],["autolink",function(e,t){let n=e.pos;if(60!==e.src.charCodeAt(n))return!1;const s=e.pos,r=e.posMax;for(;;){if(++n>=r)return!1;const t=e.src.charCodeAt(n);if(60===t)return!1;if(62===t)break}const o=e.src.slice(s+1,n);if(Ra.test(o)){const n=e.md.normalizeLink(o);if(!e.md.validateLink(n))return!1;if(!t){const t=e.push("link_open","a",1);t.attrs=[["href",n]],t.markup="autolink",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(o);const s=e.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return e.pos+=o.length+2,!0}if(Ia.test(o)){const n=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(n))return!1;if(!t){const t=e.push("link_open","a",1);t.attrs=[["href",n]],t.markup="autolink",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(o);const s=e.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return e.pos+=o.length+2,!0}return!1}],["html_inline",function(e,t){if(!e.md.options.html)return!1;const n=e.posMax,s=e.pos;if(60!==e.src.charCodeAt(s)||s+2>=n)return!1;const r=e.src.charCodeAt(s+1);if(33!==r&&63!==r&&47!==r&&!function(e){const t=32|e;return t>=97&&t<=122}(r))return!1;const o=e.src.slice(s).match(ya);if(!o)return!1;if(!t){const t=e.push("html_inline","",0);t.content=o[0],i=t.content,/^<a[>\s]/i.test(i)&&e.linkLevel++,function(e){return/^<\/a\s*>/i.test(e)}(t.content)&&e.linkLevel--}var i;return e.pos+=o[0].length,!0}],["entity",function(e,t){const n=e.pos,s=e.posMax;if(38!==e.src.charCodeAt(n))return!1;if(n+1>=s)return!1;if(35===e.src.charCodeAt(n+1)){const s=e.src.slice(n).match(Ta);if(s){if(!t){const t="x"===s[1][0].toLowerCase()?parseInt(s[1].slice(1),16):parseInt(s[1],10),n=e.push("text_special","",0);n.content=xi(t)?ki(t):ki(65533),n.markup=s[0],n.info="entity"}return e.pos+=s[0].length,!0}}else{const s=e.src.slice(n).match(Ma);if(s){const n=yi(s[0]);if(n!==s[0]){if(!t){const t=e.push("text_special","",0);t.content=n,t.markup=s[0],t.info="entity"}return e.pos+=s[0].length,!0}}}return!1}]],La=[["balance_pairs",function(e){const t=e.tokens_meta,n=e.tokens_meta.length;Oa(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&Oa(t[s].delimiters)}],["strikethrough",Da.postProcess],["emphasis",Fa.postProcess],["fragments_join",function(e){let t,n,s=0;const r=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++)r[t].nesting<0&&s--,r[t].level=s,r[t].nesting>0&&s++,"text"===r[t].type&&t+1<o&&"text"===r[t+1].type?r[t+1].content=r[t].content+r[t+1].content:(t!==n&&(r[n]=r[t]),n++);t!==n&&(r.length=n)}]];function $a(){this.ruler=new Hi;for(let e=0;e<Pa.length;e++)this.ruler.push(Pa[e][0],Pa[e][1]);this.ruler2=new Hi;for(let e=0;e<La.length;e++)this.ruler2.push(La[e][0],La[e][1])}function Ba(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function za(e){return Object.prototype.toString.call(e)}function Na(e){return"[object Function]"===za(e)}function qa(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}$a.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),s=n.length,r=e.md.options.maxNesting,o=e.cache;if(void 0!==o[t])return void(e.pos=o[t]);let i=!1;if(e.level<r){for(let a=0;a<s;a++)if(e.level++,i=n[a](e,!0),e.level--,i){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;i||e.pos++,o[t]=e.pos},$a.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,s=e.posMax,r=e.md.options.maxNesting;for(;e.pos<s;){const o=e.pos;let i=!1;if(e.level<r)for(let s=0;s<n;s++)if(i=t[s](e,!1),i){if(o>=e.pos)throw new Error("inline rule didn't increment state.pos");break}if(i){if(e.pos>=s)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},$a.prototype.parse=function(e,t,n,s){const r=new this.State(e,t,n,s);this.tokenize(r);const o=this.ruler2.getRules(""),i=o.length;for(let a=0;a<i;a++)o[a](r)},$a.prototype.State=xa;const ja={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};const Ua={"http:":{validate:function(e,t,n){const s=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(s)?s.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const s=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(s)?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:s.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const s=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(s)?s.match(n.re.mailto)[0].length:0}}},Ha="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Wa(e){const t=e.re=function(e){const t={};e=e||{},t.src_Any=Wo.source,t.src_Cc=Vo.source,t.src_Z=Zo.source,t.src_P=Qo.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?![><|]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><|]|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+"|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}(e.__opts__),n=e.__tlds__.slice();function s(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||n.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),n.push(t.src_xn),t.src_tlds=n.join("|"),t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");const r=[];function o(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach(function(t){const n=e.__schemas__[t];if(null===n)return;const s={validate:null,link:null};if(e.__compiled__[t]=s,"[object Object]"===za(n))return!function(e){return"[object RegExp]"===za(e)}(n.validate)?Na(n.validate)?s.validate=n.validate:o(t,n):s.validate=function(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}(n.validate),void(Na(n.normalize)?s.normalize=n.normalize:n.normalize?o(t,n):s.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===za(e)}(n)?o(t,n):r.push(t)}),r.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};const i=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(qa).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+i+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+i+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),function(e){e.__index__=-1,e.__text_cache__=""}(e)}function Va(e,t){const n=e.__index__,s=e.__last_index__,r=e.__text_cache__.slice(n,s);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=s+t,this.raw=r,this.text=r,this.url=r}function Qa(e,t){const n=new Va(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Ja(e,t){if(!(this instanceof Ja))return new Ja(e,t);var n;t||(n=e,Object.keys(n||{}).reduce(function(e,t){return e||ja.hasOwnProperty(t)},!1)&&(t=e,e={})),this.__opts__=Ba({},ja,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Ba({},Ua,e),this.__compiled__={},this.__tlds__=Ha,this.__tlds_replaced__=!1,this.re={},Wa(this)}Ja.prototype.add=function(e,t){return this.__schemas__[e]=t,Wa(this),this},Ja.prototype.set=function(e){return this.__opts__=Ba(this.__opts__,e),this},Ja.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,n,s,r,o,i,a,l,c;if(this.re.schema_test.test(e))for(a=this.re.schema_search,a.lastIndex=0;null!==(t=a.exec(e));)if(r=this.testSchemaAt(e,t[2],a.lastIndex),r){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+r;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&null!==(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(o=n.index+n[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(c=e.indexOf("@"),c>=0&&null!==(s=e.match(this.re.email_fuzzy))&&(o=s.index+s[1].length,i=s.index+s[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&i>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=i))),this.__index__>=0},Ja.prototype.pretest=function(e){return this.re.pretest.test(e)},Ja.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},Ja.prototype.match=function(e){const t=[];let n=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(Qa(this,n)),n=this.__last_index__);let s=n?e.slice(n):e;for(;this.test(s);)t.push(Qa(this,n)),s=s.slice(this.__last_index__),n+=this.__last_index__;return t.length?t:null},Ja.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const t=this.re.schema_at_start.exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);return n?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n,Qa(this,0)):null},Ja.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),Wa(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Wa(this),this)},Ja.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},Ja.prototype.onCompile=function(){};const Za=2147483647,Ga=36,Ka=/^xn--/,Xa=/[^\0-\x7F]/,Ya=/[\x2E\u3002\uFF0E\uFF61]/g,el={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},tl=Math.floor,nl=String.fromCharCode;function sl(e){throw new RangeError(el[e])}function rl(e,t){const n=e.split("@");let s="";n.length>1&&(s=n[0]+"@",e=n[1]);const r=function(e,t){const n=[];let s=e.length;for(;s--;)n[s]=t(e[s]);return n}((e=e.replace(Ya,".")).split("."),t).join(".");return s+r}function ol(e){const t=[];let n=0;const s=e.length;for(;n<s;){const r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<s){const s=e.charCodeAt(n++);56320==(64512&s)?t.push(((1023&r)<<10)+(1023&s)+65536):(t.push(r),n--)}else t.push(r)}return t}const il=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:Ga},al=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},ll=function(e,t,n){let s=0;for(e=n?tl(e/700):e>>1,e+=tl(e/t);e>455;s+=Ga)e=tl(e/35);return tl(s+36*e/(e+38))},cl=function(e){const t=[],n=e.length;let s=0,r=128,o=72,i=e.lastIndexOf("-");i<0&&(i=0);for(let a=0;a<i;++a)e.charCodeAt(a)>=128&&sl("not-basic"),t.push(e.charCodeAt(a));for(let a=i>0?i+1:0;a<n;){const i=s;for(let t=1,r=Ga;;r+=Ga){a>=n&&sl("invalid-input");const i=il(e.charCodeAt(a++));i>=Ga&&sl("invalid-input"),i>tl((Za-s)/t)&&sl("overflow"),s+=i*t;const l=r<=o?1:r>=o+26?26:r-o;if(i<l)break;const c=Ga-l;t>tl(Za/c)&&sl("overflow"),t*=c}const l=t.length+1;o=ll(s-i,l,0==i),tl(s/l)>Za-r&&sl("overflow"),r+=tl(s/l),s%=l,t.splice(s++,0,r)}return String.fromCodePoint(...t)},ul=function(e){const t=[],n=(e=ol(e)).length;let s=128,r=0,o=72;for(const l of e)l<128&&t.push(nl(l));const i=t.length;let a=i;for(i&&t.push("-");a<n;){let n=Za;for(const t of e)t>=s&&t<n&&(n=t);const l=a+1;n-s>tl((Za-r)/l)&&sl("overflow"),r+=(n-s)*l,s=n;for(const c of e)if(c<s&&++r>Za&&sl("overflow"),c===s){let e=r;for(let n=Ga;;n+=Ga){const s=n<=o?1:n>=o+26?26:n-o;if(e<s)break;const r=e-s,i=Ga-s;t.push(nl(al(s+r%i,0))),e=tl(r/i)}t.push(nl(al(e,0))),o=ll(r,l,a===i),r=0,++a}++r,++s}return t.join("")},hl=function(e){return rl(e,function(e){return Xa.test(e)?"xn--"+ul(e):e})},dl=function(e){return rl(e,function(e){return Ka.test(e)?cl(e.slice(4).toLowerCase()):e})},pl={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},fl=/^(vbscript|javascript|file|data):/,ml=/^data:image\/(gif|png|jpeg|webp);/;function gl(e){const t=e.trim().toLowerCase();return!fl.test(t)||ml.test(t)}const yl=["http:","https:","mailto:"];function _l(e){const t=Uo(e,!0);if(t.hostname&&(!t.protocol||yl.indexOf(t.protocol)>=0))try{t.hostname=hl(t.hostname)}catch(n){}return Fo(Io(t))}function bl(e){const t=Uo(e,!0);if(t.hostname&&(!t.protocol||yl.indexOf(t.protocol)>=0))try{t.hostname=dl(t.hostname)}catch(n){}return Do(Io(t),Do.defaultChars+"%")}function vl(e,t){if(!(this instanceof vl))return new vl(e,t);t||_i(e)||(t=e||{},e="default"),this.inline=new $a,this.block=new wa,this.core=new ca,this.renderer=new Ui,this.linkify=new Ja,this.validateLink=gl,this.normalizeLink=_l,this.normalizeLinkText=bl,this.utils=Ni,this.helpers=vi({},qi),this.options={},this.configure(e),t&&this.set(t)}vl.prototype.set=function(e){return vi(this.options,e),this},vl.prototype.configure=function(e){const t=this;if(_i(e)){const t=e;if(!(e=pl[t]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},vl.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const s=e.filter(function(e){return n.indexOf(e)<0});if(s.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+s);return this},vl.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const s=e.filter(function(e){return n.indexOf(e)<0});if(s.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+s);return this},vl.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},vl.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},vl.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},vl.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},vl.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const wl={key:0,class:"px-1 text-xs"},xl={key:0,class:"mb-3 text-center"},kl={class:"text-sm font-medium opacity-80"},Cl={class:"flex flex-col items-start space-y-2"},Al={class:"flex items-center gap-2 text-xs"},El=Yt({__name:"QuestionsSuggestions",props:{config:{},questions:{},title:{},showTitle:{type:Boolean},backgroundColor:{},textColor:{},buttonStyle:{},maxQuestions:{}},emits:["questionClick"],setup(e,{emit:t}){const n=e,s=t,r=zs(()=>{const e=n.maxQuestions||6;return n.questions.slice(0,e)}),o=zs(()=>{const e=["w-auto","px-4","py-2","text-sm","transition-all","duration-200","ease-in-out","focus:outline-none","focus:ring-2","focus:ring-blue-500","focus:ring-opacity-50","self-start"];switch(n.buttonStyle||"rounded"){case"filled":return[...e,"bg-white","hover:bg-gray-50","shadow-sm"];case"outlined":return[...e,"border","border-gray-300","hover:border-gray-400","hover:bg-gray-50"];default:return[...e,"bg-white","hover:bg-gray-50","rounded-lg","shadow-sm"]}}),i=zs(()=>({color:n.textColor||"#475569"}));return(e,t)=>e.questions.length>0?(rs(),ls("div",wl,[e.title&&!1!==e.showTitle?(rs(),ls("div",xl,[fs("h3",kl,Q(e.title),1)])):bs("",!0),fs("div",Cl,[(rs(!0),ls(Xn,null,ln(r.value,e=>(rs(),cs(vo,{key:e.id,class:U([o.value,"langchat-widget-question-btn"]),style:B(i.value),variant:"outline",onClick:t=>(e=>{s("questionClick",e)})(e)},{default:Qt(()=>[fs("div",Al,[fs("div",null,Q(e.text),1),t[0]||(t[0]=fs("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[fs("path",{d:"m9 18 6-6-6-6"})],-1))])]),_:2},1032,["class","style","onClick"]))),128))])])):bs("",!0)}}),Dl={class:"text-center py-6"},Sl={class:"mb-3"},Fl={class:"text-3xl"},Il={class:"text-xl font-semibold mb-2"},Rl={key:0,class:"text-sm opacity-80"},Tl=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Ml=Tl(Yt({__name:"WelcomeMessage",props:{config:{},welcomeData:{}},setup(e){const t=e,n=zs(()=>["px-4","py-2","rounded-xl","mx-4","mb-4"]),s=zs(()=>({backgroundColor:t.config.welcome?.backgroundColor||"#f0f9ff",color:t.config.welcome?.textColor||"#0369a1"}));return(e,t)=>e.config.welcome?.enabled?(rs(),ls("div",{key:0,class:U(["langchat-widget-welcome",n.value]),style:B(s.value)},[fs("div",Dl,[fs("div",Sl,[fs("span",Fl,Q(e.welcomeData.icon||"👋"),1)]),fs("h2",Il,Q(e.welcomeData.title),1),e.welcomeData.subtitle?(rs(),ls("p",Rl,Q(e.welcomeData.subtitle),1)):bs("",!0)])],6)):bs("",!0)}}),[["__scopeId","data-v-697f9b48"]]),Ol={class:"bg-background flex-1 overflow-hidden flex flex-col"},Pl=["data-theme","innerHTML"],Ll={key:1,class:"whitespace-pre-wrap"},$l={key:2,class:"ml-1 inline-block h-2 w-2 animate-pulse rounded-full bg-current"},Bl={key:4,class:"mt-1 text-xs text-red-500"},zl={key:2,class:"flex items-start space-x-3"},Nl=Tl(Yt({__name:"ChatMessages",props:{messages:{},isLoading:{type:Boolean},config:{},suggestedQuestions:{},welcomeData:{}},emits:["questionClick"],setup(e,{emit:t}){const n=e,s=t,r=gt(),o=zs(()=>n.config.welcome?.enabled&&0===n.messages.length),i=zs(()=>Ao.hasQuestions.value&&0===n.messages.length),a=zs(()=>Ao.hasQuestions.value&&n.messages.length>0),l=zs(()=>({width:`${n.config.avatars?.size||32}px`,height:`${n.config.avatars?.size||32}px`,borderRadius:n.config.avatars?.borderRadius||"50%"})),c=new vl({html:n.config.messages?.markdownOptions?.html||!1,linkify:n.config.messages?.markdownOptions?.linkify||!0,typographer:n.config.messages?.markdownOptions?.typographer||!1,breaks:n.config.messages?.markdownOptions?.breaks||!0}),u=e=>{const t=["text-sm","break-words"];return"user"===e.type?[...t,"text-right"]:[...t,"text-left"]},h=e=>"user"===e.type?{backgroundColor:n.config.messages?.userBackgroundColor||"#3b82f6",color:n.config.messages?.userTextColor||"#ffffff"}:{backgroundColor:n.config.messages?.aiBackgroundColor||"#f3f4f6",color:n.config.messages?.aiTextColor||"#1f2937"},d=e=>{try{const t=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,"").replace(/javascript:/gi,"");return c.render(t)}catch(t){return console.warn("Markdown rendering failed:",t),e}},p=e=>{const t=(new Date).getTime()-e.getTime();return t<6e4?"刚刚":t<36e5?`${Math.floor(t/6e4)}分钟前`:t<864e5?`${Math.floor(t/36e5)}小时前`:e.toLocaleDateString()},f=e=>{s("questionClick",e)},m=((e,t)=>{let n;return(...s)=>{clearTimeout(n),n=setTimeout(()=>e.apply(null,s),t)}})(async()=>{await $t(),r.value&&(r.value.scrollTop=r.value.scrollHeight)},200);return jn(()=>n.messages.length,m,{flush:"post"}),jn(()=>n.isLoading,m,{flush:"post"}),jn(()=>n.messages.map(e=>({id:e.id,content:e.content,isStreaming:e.isStreaming})),()=>{n.messages.some(e=>e.isStreaming)&&m()},{deep:!0,flush:"post"}),nn(()=>{m()}),(e,t)=>(rs(),ls("div",Ol,[fs("div",{ref_key:"messagesContainer",ref:r,class:"flex-1 space-y-3 overflow-y-auto px-3 py-2 sm:space-y-4 sm:px-4 sm:py-2",style:{"max-height":"calc(100vh - 200px)","min-height":"300px"}},[o.value?(rs(),cs(Ml,{key:0,config:e.config,"welcome-data":e.welcomeData},null,8,["config","welcome-data"])):bs("",!0),i.value?(rs(),cs(El,{key:1,config:e.config,questions:_t(Ao).suggestedQuestions.value,title:"常见问题","background-color":"#f8fafc","text-color":"#475569","button-style":"rounded","max-questions":6,onQuestionClick:f},null,8,["config","questions"])):bs("",!0),(rs(!0),ls(Xn,null,ln(e.messages,t=>(rs(),ls("div",{key:t.id,class:U(["user"===t.type?"justify-end":"justify-start","flex items-start space-x-3"])},["ai"===t.type?(rs(),ls("div",{key:0,style:B(l.value),class:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full bg-gray-200 text-sm"},Q(e.config.avatars?.ai||"🤖"),5)):bs("",!0),fs("div",{class:U([u(t),"max-w-[280px] rounded-lg px-3 py-2 transition-all duration-200 sm:max-w-xs sm:px-4 sm:py-2 lg:max-w-md"]),style:B(h(t))},["ai"===t.type&&e.config.enableMarkdown?(rs(),ls("div",{key:0,"data-theme":e.config.theme?.mode||"light",class:"markdown-body",innerHTML:d(t.content)},null,8,Pl)):(rs(),ls("div",Ll,Q(t.content),1)),t.isStreaming?(rs(),ls("div",$l)):bs("",!0),e.config.messages?.showTimestamp?(rs(),ls("div",{key:3,class:U(["user"===t.type?"text-right":"text-left","mt-1 text-xs opacity-60"])},Q(p(t.timestamp)),3)):bs("",!0),"error"===t.status?(rs(),ls("div",Bl,Q(t.error||"发送失败"),1)):bs("",!0)],6),"user"===t.type?(rs(),ls("div",{key:1,style:B(l.value),class:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full bg-blue-500 text-sm text-white"},Q(e.config.avatars?.user||"👤"),5)):bs("",!0)],2))),128)),e.isLoading?(rs(),ls("div",zl,[fs("div",{style:B(l.value),class:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full bg-gray-200 text-sm"},Q(e.config.avatars?.ai||"🤖"),5),t[0]||(t[0]=_s('<div class="rounded-2xl bg-gray-100 px-4 py-2" data-v-d706f955><div class="flex space-x-1" data-v-d706f955><div class="h-2 w-2 animate-bounce rounded-full bg-gray-400" data-v-d706f955></div><div class="h-2 w-2 animate-bounce rounded-full bg-gray-400" style="animation-delay:0.1s;" data-v-d706f955></div><div class="h-2 w-2 animate-bounce rounded-full bg-gray-400" style="animation-delay:0.2s;" data-v-d706f955></div></div></div>',1))])):bs("",!0),a.value?(rs(),cs(El,{key:3,config:e.config,questions:_t(Ao).suggestedQuestions.value,"show-title":!1,"background-color":"#f8fafc","text-color":"#475569","button-style":"rounded","max-questions":6,onQuestionClick:f},null,8,["config","questions"])):bs("",!0)],512)]))}}),[["__scopeId","data-v-d706f955"]]),ql={class:"bg-background flex items-center gap-2 p-3 px-4 pb-0"},jl=["disabled","maxlength","placeholder"],Ul={class:"flex flex-shrink-0 items-center justify-center gap-1"},Hl=Yt({__name:"ChatSender",props:{config:{},isLoading:{type:Boolean,default:!1}},emits:["send"],setup(e,{emit:t}){const n=e,s=t,r=gt(""),o=gt(),i=()=>{const e=r.value.trim();e&&!n.isLoading&&(s("send",e),r.value="",$t(()=>{o.value&&(o.value.style.height="22px",o.value.style.lineHeight="22px",c.value=!1)}))},a=e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),i())},l=()=>{$t(()=>{try{if(o.value){o.value.style.height="22px",o.value.style.lineHeight="22px";const e=o.value.scrollHeight,t=Math.max(22,e);o.value.style.height=`${t}px`,c.value=t>22}}catch(e){console.warn("AutoResize error:",e)}})},c=gt(!1);return nn(()=>{$t(()=>{o.value&&(o.value.style.height="22px",o.value.style.lineHeight="22px",c.value=!1)})}),(e,t)=>(rs(),ls("div",ql,[fs("div",{class:U([{"!items-end":c.value,"!items-center":!c.value},"border-input bg-background relative flex flex-1 items-center rounded-xl border px-4 py-3"]),style:{"min-height":"56px"}},[Jt(fs("textarea",{ref_key:"textareaRef",ref:o,"onUpdate:modelValue":t[0]||(t[0]=e=>r.value=e),disabled:e.isLoading,maxlength:e.config.messages?.maxLength||1e3,placeholder:e.config.messages?.placeholder||"输入消息...",class:"flex-1 resize-none overflow-hidden border-none bg-transparent text-sm outline-none",style:{height:"22px","line-height":"22px"},onInput:l,onKeydown:a},null,40,jl),[[_r,r.value]]),fs("div",Ul,[e.config.messages?.showAudioButton?(rs(),cs(vo,{key:0,class:"!text-primary !h-8 w-8 rounded-lg !p-0",size:"sm",variant:"ghost"},{default:Qt(()=>[...t[1]||(t[1]=[fs("svg",{"aria-hidden":"true",class:"size-4","data-icon":"audio",fill:"currentColor",focusable:"false",viewBox:"64 64 896 896"},[fs("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})],-1)])]),_:1})):bs("",!0),ms(vo,{disabled:!r.value.trim()||e.isLoading,variant:r.value.trim()?"default":"secondary",class:"!bg-primary !h-8 w-8 rounded-full !p-0 !text-white",size:"sm",onClick:i},{default:Qt(()=>[...t[2]||(t[2]=[fs("svg",{class:"size-4",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[fs("path",{d:"m5 12 7-7 7 7"}),fs("path",{d:"M12 19V5"})],-1)])]),_:1},8,["disabled","variant"])])],2)]))}}),Wl={class:"text-center text-[10px]"},Vl={class:"opacity-70"},Ql=["href"],Jl=Tl(Yt({__name:"Copyright",props:{config:{}},setup(e){const t=e,n=zs(()=>t.config.copyright?.text||t.config.copyright?.link),s=zs(()=>["px-4","p-2","text-center","border-t","border-gray-200"]),r=zs(()=>({backgroundColor:t.config.copyright?.backgroundColor||"",color:t.config.copyright?.textColor||"",borderTopColor:t.config.theme?.borderRadius?"transparent":""})),o=zs(()=>({color:t.config.copyright?.textColor||"#6b7280"}));return(e,t)=>n.value?(rs(),ls("div",{key:0,class:U([s.value,"langchat-widget-copyright"]),style:B(r.value)},[fs("div",Wl,[fs("span",Vl,Q(e.config.copyright?.text||"Powered by LangChat"),1),e.config.copyright?.link?(rs(),ls("a",{key:0,href:e.config.copyright.link,style:B(o.value),class:"ml-1 underline transition-opacity duration-200 hover:opacity-80",rel:"noopener noreferrer",target:"_blank"},Q(e.config.copyright.linkText||"LangChat"),13,Ql)):bs("",!0)])],6)):bs("",!0)}}),[["__scopeId","data-v-2955373c"]]),Zl=Yt({__name:"ChatWindow",props:{messages:{},isLoading:{type:Boolean},config:{},suggestedQuestions:{},welcomeData:{},onClose:{type:Function},onSendMessage:{type:Function},onQuestionClick:{type:Function}},setup(e){const t=e,n=zs(()=>{const e={"bottom-right":"bottom-4 right-4 sm:bottom-24 sm:right-6","bottom-left":"bottom-4 left-4 sm:bottom-24 sm:left-6","top-right":"top-4 right-4 sm:top-6 sm:right-6","top-left":"top-4 left-4 sm:top-6 sm:left-6"};return`fixed z-40 flex flex-col rounded-lg border bg-background shadow-lg transition-all duration-300 ease-in-out ${e[t.config.position||"bottom-right"]||e["bottom-right"]}`}),s=()=>{t.onClose()},r=e=>{t.onSendMessage(e)},o=e=>{t.onQuestionClick(e)};return(e,t)=>(rs(),ls("div",{class:U([n.value,"bg-background/95 animate-in slide-in-from-bottom-4 fade-in-0 fixed z-40 flex h-[calc(100vh-120px)] w-[450px] flex-col rounded-xl border shadow-2xl backdrop-blur-sm transition-all duration-300 ease-in-out"])},[ms(ko,{config:e.config,onClose:s},null,8,["config"]),ms(Nl,{config:e.config,"is-loading":e.isLoading,messages:e.messages,"suggested-questions":e.suggestedQuestions,"welcome-data":e.welcomeData,onQuestionClick:o},null,8,["config","is-loading","messages","suggested-questions","welcome-data"]),ms(Hl,{config:e.config,onSend:r},null,8,["config"]),ms(Jl,{config:e.config},null,8,["config"])],2))}}),Gl=["title"],Kl={key:0,class:"h-6 w-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Xl={key:1,class:"h-6 w-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Yl={key:2,class:"absolute inset-0 rounded-full bg-primary/20 animate-ping"},ec=Yt({__name:"WidgetButton",props:{isOpen:{type:Boolean},onClick:{type:Function},config:{}},setup(e){const t=e,n=zs(()=>{const e={"bottom-right":"bottom-4 right-4 sm:bottom-6 sm:right-6","bottom-left":"bottom-4 left-4 sm:bottom-6 sm:left-6","top-right":"top-4 right-4 sm:top-6 sm:right-6","top-left":"top-4 left-4 sm:top-6 sm:left-6"};return`fixed z-50 flex h-12 w-12 sm:h-14 sm:w-14 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg transition-all duration-300 hover:scale-110 hover:shadow-2xl focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 hover:bg-primary/90 ${e[t.config.position||"bottom-right"]||e["bottom-right"]}`}),s=()=>{t.onClick()};return(e,t)=>(rs(),ls("button",{class:U(n.value),onClick:s,title:e.isOpen?"关闭聊天":"打开聊天"},[e.isOpen?(rs(),ls("svg",Xl,[...t[1]||(t[1]=[fs("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)])])):(rs(),ls("svg",Kl,[...t[0]||(t[0]=[fs("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"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"},null,-1)])])),e.isOpen?bs("",!0):(rs(),ls("div",Yl))],10,Gl))}}),tc={apiKey:"",modelName:"",baseUrl:"https://api.openai.com/v1",organization:"",header:{title:"LangChat",className:"",backgroundColor:"#3b82f6",textColor:"#ffffff",showCloseButton:!0,draggable:!1},avatars:{ai:"🤖",user:"👤",size:32,borderRadius:"50%"},theme:{mode:"light",primaryColor:"#3b82f6",backgroundColor:"#ffffff",textColor:"#1f2937",borderRadius:"1rem",shadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1)",customCSS:""},messages:{aiBackgroundColor:"#f3f4f6",userBackgroundColor:"#3b82f6",aiTextColor:"#1f2937",userTextColor:"#ffffff",maxHeight:"400px",showTimestamp:!0,placeholder:"输入消息...",maxLength:1e3,showAudioButton:!1,markdownOptions:{html:!1,linkify:!0,typographer:!1,breaks:!0}},copyright:{text:"Powered by LangChat",link:"https://github.com/langchat/langchat-widget",linkText:"GitHub",className:"",backgroundColor:"",textColor:""},welcome:{enabled:!0,title:"欢迎使用 LangChat!",subtitle:"开始您的对话吧",backgroundColor:"#f0f9ff",textColor:"#0369a1"},questions:[{id:"1",text:"如何使用这个聊天机器人?",value:"如何使用这个聊天机器人?"},{id:"2",text:"支持哪些功能?",value:"支持哪些功能?"}],autoOpen:!1,position:"bottom-right",zIndex:9999,enableMarkdown:!0,enableHistory:!0,maxHistoryItems:100,enableStreaming:!0,enableAutoSuggestions:!1,backendAPI:{getSuggestedQuestions:async()=>[],getWelcomeMessage:async()=>({title:"欢迎使用 LangChat!",subtitle:"开始您的对话吧",icon:"👋"})},onMessageSent:()=>{},onMessageReceived:()=>{},onStreamingUpdate:()=>{},onError:()=>{},onOpen:()=>{},onClose:()=>{}},nc="RFC3986",sc={RFC1738:e=>String(e).replace(/%20/g,"+"),RFC3986:e=>String(e)},rc=Array.isArray,oc=(()=>{const e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})(),ic=1024;function ac(e,t){if(rc(e)){const n=[];for(let s=0;s<e.length;s+=1)n.push(t(e[s]));return n}return t(e)}const lc=Object.prototype.hasOwnProperty,cc={brackets:e=>String(e)+"[]",comma:"comma",indices:(e,t)=>String(e)+"["+t+"]",repeat:e=>String(e)},uc=Array.isArray,hc=Array.prototype.push,dc=function(e,t){hc.apply(e,uc(t)?t:[t])},pc=Date.prototype.toISOString,fc={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:(e,t,n,s,r)=>{if(0===e.length)return e;let o=e;if("symbol"==typeof e?o=Symbol.prototype.toString.call(e):"string"!=typeof e&&(o=String(e)),"iso-8859-1"===n)return escape(o).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});let i="";for(let a=0;a<o.length;a+=ic){const e=o.length>=ic?o.slice(a,a+ic):o,t=[];for(let n=0;n<e.length;++n){let s=e.charCodeAt(n);45===s||46===s||95===s||126===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||"RFC1738"===r&&(40===s||41===s)?t[t.length]=e.charAt(n):s<128?t[t.length]=oc[s]:s<2048?t[t.length]=oc[192|s>>6]+oc[128|63&s]:s<55296||s>=57344?t[t.length]=oc[224|s>>12]+oc[128|s>>6&63]+oc[128|63&s]:(n+=1,s=65536+((1023&s)<<10|1023&e.charCodeAt(n)),t[t.length]=oc[240|s>>18]+oc[128|s>>12&63]+oc[128|s>>6&63]+oc[128|63&s])}i+=t.join("")}return i},encodeValuesOnly:!1,format:nc,formatter:sc[nc],indices:!1,serializeDate:e=>pc.call(e),skipNulls:!1,strictNullHandling:!1};const mc={};function gc(e,t,n,s,r,o,i,a,l,c,u,h,d,p,f,m,g,y){let _=e,b=y,v=0,w=!1;for(;void 0!==(b=b.get(mc))&&!w;){const t=b.get(e);if(v+=1,void 0!==t){if(t===v)throw new RangeError("Cyclic object value");w=!0}void 0===b.get(mc)&&(v=0)}if("function"==typeof c?_=c(t,_):_ instanceof Date?_=d?.(_):"comma"===n&&uc(_)&&(_=ac(_,function(e){return e instanceof Date?d?.(e):e})),null===_){if(o)return l&&!m?l(t,fc.encoder,g,"key",p):t;_=""}if("string"==typeof(x=_)||"number"==typeof x||"boolean"==typeof x||"symbol"==typeof x||"bigint"==typeof x||function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))}(_)){if(l){const e=m?t:l(t,fc.encoder,g,"key",p);return[f?.(e)+"="+f?.(l(_,fc.encoder,g,"value",p))]}return[f?.(t)+"="+f?.(String(_))]}var x;const k=[];if(void 0===_)return k;let C;if("comma"===n&&uc(_))m&&l&&(_=ac(_,l)),C=[{value:_.length>0?_.join(",")||null:void 0}];else if(uc(c))C=c;else{const e=Object.keys(_);C=u?e.sort(u):e}const A=a?String(t).replace(/\./g,"%2E"):String(t),E=s&&uc(_)&&1===_.length?A+"[]":A;if(r&&uc(_)&&0===_.length)return E+"[]";for(let D=0;D<C.length;++D){const t=C[D],b="object"==typeof t&&void 0!==t.value?t.value:_[t];if(i&&null===b)continue;const w=h&&a?t.replace(/\./g,"%2E"):t,x=uc(_)?"function"==typeof n?n(E,w):E:E+(h?"."+w:"["+w+"]");y.set(e,v);const A=new WeakMap;A.set(mc,y),dc(k,gc(b,x,n,s,r,o,i,a,"comma"===n&&m&&uc(_)?null:l,c,u,h,d,p,f,m,g,A))}return k}function yc(e,t={}){let n=e;const s=function(e=fc){if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");const t=e.charset||fc.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let n=nc;if(void 0!==e.format){if(!lc.call(sc,e.format))throw new TypeError("Unknown format option provided.");n=e.format}const s=sc[n];let r,o=fc.filter;if(("function"==typeof e.filter||uc(e.filter))&&(o=e.filter),r=e.arrayFormat&&e.arrayFormat in cc?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":fc.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");const i=void 0===e.allowDots?1==!!e.encodeDotInKeys||fc.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:fc.addQueryPrefix,allowDots:i,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:fc.allowEmptyArrays,arrayFormat:r,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:fc.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?fc.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:fc.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:fc.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:fc.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:fc.encodeValuesOnly,filter:o,format:n,formatter:s,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:fc.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:fc.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:fc.strictNullHandling}}(t);let r,o;"function"==typeof s.filter?(o=s.filter,n=o("",n)):uc(s.filter)&&(o=s.filter,r=o);const i=[];if("object"!=typeof n||null===n)return"";const a=cc[s.arrayFormat],l="comma"===a&&s.commaRoundTrip;r||(r=Object.keys(n)),s.sort&&r.sort(s.sort);const c=new WeakMap;for(let d=0;d<r.length;++d){const e=r[d];s.skipNulls&&null===n[e]||dc(i,gc(n[e],e,a,l,s.allowEmptyArrays,s.strictNullHandling,s.skipNulls,s.encodeDotInKeys,s.encode?s.encoder:null,s.filter,s.sort,s.allowDots,s.serializeDate,s.format,s.formatter,s.encodeValuesOnly,s.charset,c))}const u=i.join(s.delimiter);let h=!0===s.addQueryPrefix?"?":"";return s.charsetSentinel&&("iso-8859-1"===s.charset?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),u.length>0?h+u:""}const _c="4.104.0";let bc,vc,wc,xc,kc,Cc,Ac,Ec,Dc,Sc=!1;class Fc{constructor(e){this.body=e}get[Symbol.toStringTag](){return"MultipartBody"}}const Ic=()=>{bc||function(e,t={auto:!1}){if(Sc)throw new Error(`you must \`import 'openai/shims/${e.kind}'\` before importing anything else from openai`);if(bc)throw new Error(`can't \`import 'openai/shims/${e.kind}'\` after \`import 'openai/shims/${bc}'\``);Sc=t.auto,bc=e.kind,vc=e.fetch,wc=e.FormData,xc=e.File,kc=e.ReadableStream,Cc=e.getMultipartRequestOptions,Ac=e.getDefaultAgent,Ec=e.fileFromPath,Dc=e.isFsReadStream}(function({manuallyImported:e}={}){const t=e?"You may need to use polyfills":"Add one of these imports before your first `import … from 'openai'`:\n- `import 'openai/shims/node'` (if you're running on Node)\n- `import 'openai/shims/web'` (otherwise)\n";let n,s,r,o;try{n=fetch,s=Request,r=Response,o=Headers}catch(i){throw new Error(`this environment is missing the following Web Fetch API type: ${i.message}. ${t}`)}return{kind:"web",fetch:n,Request:s,Response:r,Headers:o,FormData:"undefined"!=typeof FormData?FormData:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${t}`)}},Blob:"undefined"!=typeof Blob?Blob:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${t}`)}},File:"undefined"!=typeof File?File:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${t}`)}},ReadableStream:"undefined"!=typeof ReadableStream?ReadableStream:class{constructor(){throw new Error(`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${t}`)}},getMultipartRequestOptions:async(e,t)=>({...t,body:new Fc(e)}),getDefaultAgent:e=>{},fileFromPath:()=>{throw new Error("The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/openai/openai-node#file-uploads")},isFsReadStream:e=>!1}}(),{auto:!0})};Ic();class Rc extends Error{}class Tc extends Rc{constructor(e,t,n,s){super(`${Tc.makeMessage(e,t,n)}`),this.status=e,this.headers=s,this.request_id=s?.["x-request-id"],this.error=t;const r=t;this.code=r?.code,this.param=r?.param,this.type=r?.type}static makeMessage(e,t,n){const s=t?.message?"string"==typeof t.message?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&s?`${e} ${s}`:e?`${e} status code (no body)`:s||"(no status code or body)"}static generate(e,t,n,s){if(!e||!s)return new Oc({message:n,cause:Tu(t)});const r=t?.error;return 400===e?new Lc(e,r,n,s):401===e?new $c(e,r,n,s):403===e?new Bc(e,r,n,s):404===e?new zc(e,r,n,s):409===e?new Nc(e,r,n,s):422===e?new qc(e,r,n,s):429===e?new jc(e,r,n,s):e>=500?new Uc(e,r,n,s):new Tc(e,r,n,s)}}class Mc extends Tc{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class Oc extends Tc{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}}class Pc extends Oc{constructor({message:e}={}){super({message:e??"Request timed out."})}}class Lc extends Tc{}class $c extends Tc{}class Bc extends Tc{}class zc extends Tc{}class Nc extends Tc{}class qc extends Tc{}class jc extends Tc{}class Uc extends Tc{}class Hc extends Rc{constructor(){super("Could not parse response content as the length limit was reached")}}class Wc extends Rc{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}var Vc,Qc=function(e,t,n,s,r){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?r.call(e,n):r?r.value=n:t.set(e,n),n},Jc=function(e,t,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(e):s?s.value:t.get(e)};class Zc{constructor(){Vc.set(this,void 0),this.buffer=new Uint8Array,Qc(this,Vc,null,"f")}decode(e){if(null==e)return[];const t=e instanceof ArrayBuffer?new Uint8Array(e):"string"==typeof e?(new TextEncoder).encode(e):e;let n=new Uint8Array(this.buffer.length+t.length);n.set(this.buffer),n.set(t,this.buffer.length),this.buffer=n;const s=[];let r;for(;null!=(r=Gc(this.buffer,Jc(this,Vc,"f")));){if(r.carriage&&null==Jc(this,Vc,"f")){Qc(this,Vc,r.index,"f");continue}if(null!=Jc(this,Vc,"f")&&(r.index!==Jc(this,Vc,"f")+1||r.carriage)){s.push(this.decodeText(this.buffer.slice(0,Jc(this,Vc,"f")-1))),this.buffer=this.buffer.slice(Jc(this,Vc,"f")),Qc(this,Vc,null,"f");continue}const e=null!==Jc(this,Vc,"f")?r.preceding-1:r.preceding,t=this.decodeText(this.buffer.slice(0,e));s.push(t),this.buffer=this.buffer.slice(r.index),Qc(this,Vc,null,"f")}return s}decodeText(e){if(null==e)return"";if("string"==typeof e)return e;if("undefined"!=typeof Buffer){if(e instanceof Buffer)return e.toString();if(e instanceof Uint8Array)return Buffer.from(e).toString();throw new Rc(`Unexpected: received non-Uint8Array (${e.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`)}if("undefined"!=typeof TextDecoder){if(e instanceof Uint8Array||e instanceof ArrayBuffer)return this.textDecoder??(this.textDecoder=new TextDecoder("utf8")),this.textDecoder.decode(e);throw new Rc(`Unexpected: received non-Uint8Array/ArrayBuffer (${e.constructor.name}) in a web platform. Please report this error.`)}throw new Rc("Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.")}flush(){return this.buffer.length?this.decode("\n"):[]}}function Gc(e,t){for(let n=t??0;n<e.length;n++){if(10===e[n])return{preceding:n,index:n+1,carriage:!1};if(13===e[n])return{preceding:n,index:n+1,carriage:!0}}return null}function Kc(e){for(let t=0;t<e.length-1;t++){if(10===e[t]&&10===e[t+1])return t+2;if(13===e[t]&&13===e[t+1])return t+2;if(13===e[t]&&10===e[t+1]&&t+3<e.length&&13===e[t+2]&&10===e[t+3])return t+4}return-1}function Xc(e){if(e[Symbol.asyncIterator])return e;const t=e.getReader();return{async next(){try{const e=await t.read();return e?.done&&t.releaseLock(),e}catch(Df){throw t.releaseLock(),Df}},async return(){const e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}Vc=new WeakMap,Zc.NEWLINE_CHARS=new Set(["\n","\r"]),Zc.NEWLINE_REGEXP=/\r\n|[\n\r]/g;class Yc{constructor(e,t){this.iterator=e,this.controller=t}static fromSSEResponse(e,t){let n=!1;return new Yc(async function*(){if(n)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let s=!1;try{for await(const n of async function*(e,t){if(!e.body)throw t.abort(),new Rc("Attempted to iterate over a response with no body");const n=new eu,s=new Zc,r=Xc(e.body);for await(const o of async function*(e){let t=new Uint8Array;for await(const n of e){if(null==n)continue;const e=n instanceof ArrayBuffer?new Uint8Array(n):"string"==typeof n?(new TextEncoder).encode(n):n;let s,r=new Uint8Array(t.length+e.length);for(r.set(t),r.set(e,t.length),t=r;-1!==(s=Kc(t));)yield t.slice(0,s),t=t.slice(s)}t.length>0&&(yield t)}(r))for(const e of s.decode(o)){const t=n.decode(e);t&&(yield t)}for(const o of s.flush()){const e=n.decode(o);e&&(yield e)}}(e,t))if(!s)if(n.data.startsWith("[DONE]"))s=!0;else if(null===n.event||n.event.startsWith("response.")||n.event.startsWith("transcript.")){let t;try{t=JSON.parse(n.data)}catch(Df){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),Df}if(t&&t.error)throw new Tc(void 0,t.error,void 0,bu(e.headers));yield t}else{let e;try{e=JSON.parse(n.data)}catch(Df){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),Df}if("error"==n.event)throw new Tc(void 0,e.error,e.message,void 0);yield{event:n.event,data:e}}s=!0}catch(Df){if(Df instanceof Error&&"AbortError"===Df.name)return;throw Df}finally{s||t.abort()}},t)}static fromReadableStream(e,t){let n=!1;return new Yc(async function*(){if(n)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let s=!1;try{for await(const t of async function*(){const t=new Zc,n=Xc(e);for await(const e of n)for(const n of t.decode(e))yield n;for(const e of t.flush())yield e}())s||t&&(yield JSON.parse(t));s=!0}catch(Df){if(Df instanceof Error&&"AbortError"===Df.name)return;throw Df}finally{s||t.abort()}},t)}[Symbol.asyncIterator](){return this.iterator()}tee(){const e=[],t=[],n=this.iterator(),s=s=>({next:()=>{if(0===s.length){const s=n.next();e.push(s),t.push(s)}return s.shift()}});return[new Yc(()=>s(e),this.controller),new Yc(()=>s(t),this.controller)]}toReadableStream(){const e=this;let t;const n=new TextEncoder;return new kc({async start(){t=e[Symbol.asyncIterator]()},async pull(e){try{const{value:s,done:r}=await t.next();if(r)return e.close();const o=n.encode(JSON.stringify(s)+"\n");e.enqueue(o)}catch(s){e.error(s)}},async cancel(){await(t.return?.())}})}}class eu{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;const e={event:this.event,data:this.data.join("\n"),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],e}if(this.chunks.push(e),e.startsWith(":"))return null;let[t,n,s]=function(e,t){const n=e.indexOf(t);if(-1!==n)return[e.substring(0,n),t,e.substring(n+t.length)];return[e,"",""]}(e,":");return s.startsWith(" ")&&(s=s.substring(1)),"event"===t?this.event=s:"data"===t&&this.data.push(s),null}}const tu=e=>null!=e&&"object"==typeof e&&"string"==typeof e.url&&"function"==typeof e.blob,nu=e=>null!=e&&"object"==typeof e&&"string"==typeof e.name&&"number"==typeof e.lastModified&&su(e),su=e=>null!=e&&"object"==typeof e&&"number"==typeof e.size&&"string"==typeof e.type&&"function"==typeof e.text&&"function"==typeof e.slice&&"function"==typeof e.arrayBuffer;async function ru(e,t,n){if(e=await e,nu(e))return e;if(tu(e)){const s=await e.blob();t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()??"unknown_file");const r=su(s)?[await s.arrayBuffer()]:[s];return new xc(r,t,n)}const s=await async function(e){let t=[];if("string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(su(e))t.push(await e.arrayBuffer());else{if(!iu(e))throw new Error(`Unexpected data type: ${typeof e}; constructor: ${e?.constructor?.name}; props: ${function(e){const t=Object.getOwnPropertyNames(e);return`[${t.map(e=>`"${e}"`).join(", ")}]`}(e)}`);for await(const n of e)t.push(n)}return t}(e);if(t||(t=function(e){return ou(e.name)||ou(e.filename)||ou(e.path)?.split(/[\\/]/).pop()}(e)??"unknown_file"),!n?.type){const e=s[0]?.type;"string"==typeof e&&(n={...n,type:e})}return new xc(s,t,n)}const ou=e=>"string"==typeof e?e:"undefined"!=typeof Buffer&&e instanceof Buffer?String(e):void 0,iu=e=>null!=e&&"object"==typeof e&&"function"==typeof e[Symbol.asyncIterator],au=e=>e&&"object"==typeof e&&e.body&&"MultipartBody"===e[Symbol.toStringTag],lu=async e=>{const t=await cu(e.body);return Cc(t,e)},cu=async e=>{const t=new wc;return await Promise.all(Object.entries(e||{}).map(([e,n])=>uu(t,e,n))),t},uu=async(e,t,n)=>{if(void 0!==n){if(null==n)throw new TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if("string"==typeof n||"number"==typeof n||"boolean"==typeof n)e.append(t,String(n));else if((e=>nu(e)||tu(e)||Dc(e))(n)){const s=await ru(n);e.append(t,s)}else if(Array.isArray(n))await Promise.all(n.map(n=>uu(e,t+"[]",n)));else{if("object"!=typeof n)throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`);await Promise.all(Object.entries(n).map(([n,s])=>uu(e,`${t}[${n}]`,s)))}}};var hu,du={};async function pu(e){const{response:t}=e;if(e.options.stream)return Bu("response",t.status,t.url,t.headers,t.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(t,e.controller):Yc.fromSSEResponse(t,e.controller);if(204===t.status)return null;if(e.options.__binaryResponse)return t;const n=t.headers.get("content-type"),s=n?.split(";")[0]?.trim();if(s?.includes("application/json")||s?.endsWith("+json")){const e=await t.json();return Bu("response",t.status,t.url,t.headers,e),fu(e,t)}const r=await t.text();return Bu("response",t.status,t.url,t.headers,r),r}function fu(e,t){return!e||"object"!=typeof e||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("x-request-id"),enumerable:!1})}Ic();class mu extends Promise{constructor(e,t=pu){super(e=>{e(null)}),this.responsePromise=e,this.parseResponse=t}_thenUnwrap(e){return new mu(this.responsePromise,async t=>fu(e(await this.parseResponse(t),t),t.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){const[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(this.parseResponse)),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}class gu{constructor({baseURL:e,maxRetries:t=2,timeout:n=6e5,httpAgent:s,fetch:r}){this.baseURL=e,this.maxRetries=Ru("maxRetries",t),this.timeout=Ru("timeout",n),this.httpAgent=s,this.fetch=r??vc}authHeaders(e){return{}}defaultHeaders(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":this.getUserAgent(),...Eu(),...this.authHeaders(e)}}validateHeaders(e,t){}defaultIdempotencyKey(){return`stainless-node-retry-${zu()}`}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,n){return this.request(Promise.resolve(n).then(async n=>{const s=n&&su(n?.body)?new DataView(await n.body.arrayBuffer()):n?.body instanceof DataView?n.body:n?.body instanceof ArrayBuffer?new DataView(n.body):n&&ArrayBuffer.isView(n?.body)?new DataView(n.body.buffer):n?.body;return{method:e,path:t,...n,body:s}}))}getAPIList(e,t,n){return this.requestAPIList(t,{method:"get",path:e,...n})}calculateContentLength(e){if("string"==typeof e){if("undefined"!=typeof Buffer)return Buffer.byteLength(e,"utf8").toString();if("undefined"!=typeof TextEncoder){return(new TextEncoder).encode(e).length.toString()}}else if(ArrayBuffer.isView(e))return e.byteLength.toString();return null}buildRequest(e,{retryCount:t=0}={}){const n={...e},{method:s,path:r,query:o,headers:i={}}=n,a=ArrayBuffer.isView(n.body)||n.__binaryRequest&&"string"==typeof n.body?n.body:au(n.body)?n.body.body:n.body?JSON.stringify(n.body,null,2):null,l=this.calculateContentLength(a),c=this.buildURL(r,o);"timeout"in n&&Ru("timeout",n.timeout),n.timeout=n.timeout??this.timeout;const u=n.httpAgent??this.httpAgent??Ac(c),h=n.timeout+1e3;"number"==typeof u?.options?.timeout&&h>(u.options.timeout??0)&&(u.options.timeout=h),this.idempotencyHeader&&"get"!==s&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=e.idempotencyKey);return{req:{method:s,...a&&{body:a},headers:this.buildHeaders({options:n,headers:i,contentLength:l,retryCount:t}),...u&&{agent:u},signal:n.signal??null},url:c,timeout:n.timeout}}buildHeaders({options:e,headers:t,contentLength:n,retryCount:s}){const r={};n&&(r["content-length"]=n);const o=this.defaultHeaders(e);return Lu(r,o),Lu(r,t),au(e.body)&&"node"!==bc&&delete r["content-type"],void 0===Nu(o,"x-stainless-retry-count")&&void 0===Nu(t,"x-stainless-retry-count")&&(r["x-stainless-retry-count"]=String(s)),void 0===Nu(o,"x-stainless-timeout")&&void 0===Nu(t,"x-stainless-timeout")&&e.timeout&&(r["x-stainless-timeout"]=String(Math.trunc(e.timeout/1e3))),this.validateHeaders(r,t),r}async prepareOptions(e){}async prepareRequest(e,{url:t,options:n}){}parseHeaders(e){return e?Symbol.iterator in e?Object.fromEntries(Array.from(e).map(e=>[...e])):{...e}:{}}makeStatusError(e,t,n,s){return Tc.generate(e,t,n,s)}request(e,t=null){return new mu(this.makeRequest(e,t))}async makeRequest(e,t){const n=await e,s=n.maxRetries??this.maxRetries;null==t&&(t=s),await this.prepareOptions(n);const{req:r,url:o,timeout:i}=this.buildRequest(n,{retryCount:s-t});if(await this.prepareRequest(r,{url:o,options:n}),Bu("request",o,n,r.headers),n.signal?.aborted)throw new Mc;const a=new AbortController,l=await this.fetchWithTimeout(o,r,i,a).catch(Tu);if(l instanceof Error){if(n.signal?.aborted)throw new Mc;if(t)return this.retryRequest(n,t);if("AbortError"===l.name)throw new Pc;throw new Oc({cause:l})}const c=bu(l.headers);if(!l.ok){if(t&&this.shouldRetry(l)){return Bu(`response (error; ${`retrying, ${t} attempts remaining`})`,l.status,o,c),this.retryRequest(n,t,c)}const e=await l.text().catch(e=>Tu(e).message),s=Du(e),r=s?void 0:e;Bu(`response (error; ${t?"(error; no more retries left)":"(error; not retryable)"})`,l.status,o,c,r);throw this.makeStatusError(l.status,s,r,c)}return{response:l,options:n,controller:a}}requestAPIList(e,t){const n=this.makeRequest(t,null);return new _u(this,n,e)}buildURL(e,t){const n=Fu(e)?new URL(e):new URL(this.baseURL+(this.baseURL.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),s=this.defaultQuery();return Ou(s)||(t={...s,...t}),"object"==typeof t&&t&&!Array.isArray(t)&&(n.search=this.stringifyQuery(t)),n.toString()}stringifyQuery(e){return Object.entries(e).filter(([e,t])=>void 0!==t).map(([e,t])=>{if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(null===t)return`${encodeURIComponent(e)}=`;throw new Rc(`Cannot stringify type ${typeof t}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}async fetchWithTimeout(e,t,n,s){const{signal:r,...o}=t||{};r&&r.addEventListener("abort",()=>s.abort());const i=setTimeout(()=>s.abort(),n),a={signal:s.signal,...o};return a.method&&(a.method=a.method.toUpperCase()),this.fetch.call(void 0,e,a).finally(()=>{clearTimeout(i)})}shouldRetry(e){const t=e.headers.get("x-should-retry");return"true"===t||"false"!==t&&(408===e.status||(409===e.status||(429===e.status||e.status>=500)))}async retryRequest(e,t,n){let s;const r=n?.["retry-after-ms"];if(r){const e=parseFloat(r);Number.isNaN(e)||(s=e)}const o=n?.["retry-after"];if(o&&!s){const e=parseFloat(o);s=Number.isNaN(e)?Date.parse(o)-Date.now():1e3*e}if(!(s&&0<=s&&s<6e4)){const n=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(t,n)}return await Iu(s),this.makeRequest(e,t-1)}calculateDefaultRetryTimeoutMillis(e,t){const n=t-e;return Math.min(.5*Math.pow(2,n),8)*(1-.25*Math.random())*1e3}getUserAgent(){return`${this.constructor.name}/JS ${_c}`}}class yu{constructor(e,t,n,s){hu.set(this,void 0),function(e,t,n){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");t.set(e,n)}(this,hu,e),this.options=s,this.response=t,this.body=n}hasNextPage(){return!!this.getPaginatedItems().length&&null!=this.nextPageInfo()}async getNextPage(){const e=this.nextPageInfo();if(!e)throw new Rc("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");const t={...this.options};if("params"in e&&"object"==typeof t.query)t.query={...t.query,...e.params};else if("url"in e){const n=[...Object.entries(t.query||{}),...e.url.searchParams.entries()];for(const[t,s]of n)e.url.searchParams.set(t,s);t.query=void 0,t.path=e.url.toString()}return await function(e,t,n,s){if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(e):s?s.value:t.get(e)}(this,hu,"f").requestAPIList(this.constructor,t)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(hu=new WeakMap,Symbol.asyncIterator)](){for await(const e of this.iterPages())for(const t of e.getPaginatedItems())yield t}}class _u extends mu{constructor(e,t,n){super(t,async t=>new n(e,t.response,await pu(t),t.options))}async*[Symbol.asyncIterator](){const e=await(this);for await(const t of e)yield t}}const bu=e=>new Proxy(Object.fromEntries(e.entries()),{get(e,t){const n=t.toString();return e[n.toLowerCase()]||e[n]}}),vu={method:!0,path:!0,query:!0,body:!0,headers:!0,maxRetries:!0,stream:!0,timeout:!0,httpAgent:!0,signal:!0,idempotencyKey:!0,__metadata:!0,__binaryRequest:!0,__binaryResponse:!0,__streamClass:!0},wu=e=>"object"==typeof e&&null!==e&&!Ou(e)&&Object.keys(e).every(e=>Pu(vu,e)),xu=()=>{if("undefined"!=typeof Deno&&null!=Deno.build)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":_c,"X-Stainless-OS":Cu(Deno.build.os),"X-Stainless-Arch":ku(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("undefined"!=typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":_c,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":process.version};if("[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0))return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":_c,"X-Stainless-OS":Cu(process.platform),"X-Stainless-Arch":ku(process.arch),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":process.version};const e=function(){if("undefined"==typeof navigator||!navigator)return null;const e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:t,pattern:n}of e){const e=n.exec(navigator.userAgent);if(e){return{browser:t,version:`${e[1]||0}.${e[2]||0}.${e[3]||0}`}}}return null}();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":_c,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":_c,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};const ku=e=>"x32"===e?"x32":"x86_64"===e||"x64"===e?"x64":"arm"===e?"arm":"aarch64"===e||"arm64"===e?"arm64":e?`other:${e}`:"unknown",Cu=e=>(e=e.toLowerCase()).includes("ios")?"iOS":"android"===e?"Android":"darwin"===e?"MacOS":"win32"===e?"Windows":"freebsd"===e?"FreeBSD":"openbsd"===e?"OpenBSD":"linux"===e?"Linux":e?`Other:${e}`:"Unknown";let Au;const Eu=()=>Au??(Au=xu()),Du=e=>{try{return JSON.parse(e)}catch(t){return}},Su=/^[a-z][a-z0-9+.-]*:/i,Fu=e=>Su.test(e),Iu=e=>new Promise(t=>setTimeout(t,e)),Ru=(e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new Rc(`${e} must be an integer`);if(t<0)throw new Rc(`${e} must be a positive integer`);return t},Tu=e=>{if(e instanceof Error)return e;if("object"==typeof e&&null!==e)try{return new Error(JSON.stringify(e))}catch{}return new Error(e)},Mu=e=>"undefined"!=typeof process?du?.[e]?.trim()??void 0:"undefined"!=typeof Deno?Deno.env?.get?.(e)?.trim():void 0;function Ou(e){if(!e)return!0;for(const t in e)return!1;return!0}function Pu(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Lu(e,t){for(const n in t){if(!Pu(t,n))continue;const s=n.toLowerCase();if(!s)continue;const r=t[n];null===r?delete e[s]:void 0!==r&&(e[s]=r)}}const $u=new Set(["authorization","api-key"]);function Bu(e,...t){if("undefined"!=typeof process&&"true"===du?.DEBUG){const n=t.map(e=>{if(!e)return e;if(e.headers){const t={...e,headers:{...e.headers}};for(const n in e.headers)$u.has(n.toLowerCase())&&(t.headers[n]="REDACTED");return t}let t=null;for(const n in e)$u.has(n.toLowerCase())&&(t??(t={...e}),t[n]="REDACTED");return t??e});console.log(`OpenAI:DEBUG:${e}`,...n)}}const zu=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}),Nu=(e,t)=>{const n=t.toLowerCase();if((e=>"function"==typeof e?.get)(e)){const s=t[0]?.toUpperCase()+t.substring(1).replace(/([^\w])(\w)/g,(e,t,n)=>t+n.toUpperCase());for(const r of[t,n,t.toUpperCase(),s]){const t=e.get(r);if(t)return t}}for(const[s,r]of Object.entries(e))if(s.toLowerCase()===n)return Array.isArray(r)?(r.length<=1||console.warn(`Received ${r.length} entries for the ${t} header, using the first entry.`),r[0]):r};function qu(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}class ju extends yu{constructor(e,t,n,s){super(e,t,n,s),this.data=n.data||[],this.object=n.object}getPaginatedItems(){return this.data??[]}nextPageParams(){return null}nextPageInfo(){return null}}class Uu extends yu{constructor(e,t,n,s){super(e,t,n,s),this.data=n.data||[],this.has_more=n.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return!1!==this.has_more&&super.hasNextPage()}nextPageParams(){const e=this.nextPageInfo();if(!e)return null;if("params"in e)return e.params;const t=Object.fromEntries(e.url.searchParams);return Object.keys(t).length?t:null}nextPageInfo(){const e=this.getPaginatedItems();if(!e.length)return null;const t=e[e.length-1]?.id;return t?{params:{after:t}}:null}}class Hu{constructor(e){this._client=e}}let Wu=class extends Hu{list(e,t={},n){return wu(t)?this.list(e,{},t):this._client.getAPIList(`/chat/completions/${e}/messages`,Ju,{query:t,...n})}},Vu=class extends Hu{constructor(){super(...arguments),this.messages=new Wu(this._client)}create(e,t){return this._client.post("/chat/completions",{body:e,...t,stream:e.stream??!1})}retrieve(e,t){return this._client.get(`/chat/completions/${e}`,t)}update(e,t,n){return this._client.post(`/chat/completions/${e}`,{body:t,...n})}list(e={},t){return wu(e)?this.list({},e):this._client.getAPIList("/chat/completions",Qu,{query:e,...t})}del(e,t){return this._client.delete(`/chat/completions/${e}`,t)}};class Qu extends Uu{}class Ju extends Uu{}Vu.ChatCompletionsPage=Qu,Vu.Messages=Wu;let Zu=class extends Hu{constructor(){super(...arguments),this.completions=new Vu(this._client)}};Zu.Completions=Vu,Zu.ChatCompletionsPage=Qu;class Gu extends Hu{create(e,t){return this._client.post("/audio/speech",{body:e,...t,headers:{Accept:"application/octet-stream",...t?.headers},__binaryResponse:!0})}}class Ku extends Hu{create(e,t){return this._client.post("/audio/transcriptions",lu({body:e,...t,stream:e.stream??!1,__metadata:{model:e.model}}))}}class Xu extends Hu{create(e,t){return this._client.post("/audio/translations",lu({body:e,...t,__metadata:{model:e.model}}))}}class Yu extends Hu{constructor(){super(...arguments),this.transcriptions=new Ku(this._client),this.translations=new Xu(this._client),this.speech=new Gu(this._client)}}Yu.Transcriptions=Ku,Yu.Translations=Xu,Yu.Speech=Gu;class eh extends Hu{create(e,t){return this._client.post("/batches",{body:e,...t})}retrieve(e,t){return this._client.get(`/batches/${e}`,t)}list(e={},t){return wu(e)?this.list({},e):this._client.getAPIList("/batches",th,{query:e,...t})}cancel(e,t){return this._client.post(`/batches/${e}/cancel`,t)}}class th extends Uu{}eh.BatchesPage=th;var nh,sh,rh,oh,ih,ah,lh,ch,uh,hh,dh,ph,fh,mh=function(e,t,n,s,r){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?r.call(e,n):r?r.value=n:t.set(e,n),n},gh=function(e,t,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(e):s?s.value:t.get(e)};class yh{constructor(){nh.add(this),this.controller=new AbortController,sh.set(this,void 0),rh.set(this,()=>{}),oh.set(this,()=>{}),ih.set(this,void 0),ah.set(this,()=>{}),lh.set(this,()=>{}),ch.set(this,{}),uh.set(this,!1),hh.set(this,!1),dh.set(this,!1),ph.set(this,!1),mh(this,sh,new Promise((e,t)=>{mh(this,rh,e,"f"),mh(this,oh,t,"f")}),"f"),mh(this,ih,new Promise((e,t)=>{mh(this,ah,e,"f"),mh(this,lh,t,"f")}),"f"),gh(this,sh,"f").catch(()=>{}),gh(this,ih,"f").catch(()=>{})}_run(e){setTimeout(()=>{e().then(()=>{this._emitFinal(),this._emit("end")},gh(this,nh,"m",fh).bind(this))},0)}_connected(){this.ended||(gh(this,rh,"f").call(this),this._emit("connect"))}get ended(){return gh(this,uh,"f")}get errored(){return gh(this,hh,"f")}get aborted(){return gh(this,dh,"f")}abort(){this.controller.abort()}on(e,t){return(gh(this,ch,"f")[e]||(gh(this,ch,"f")[e]=[])).push({listener:t}),this}off(e,t){const n=gh(this,ch,"f")[e];if(!n)return this;const s=n.findIndex(e=>e.listener===t);return s>=0&&n.splice(s,1),this}once(e,t){return(gh(this,ch,"f")[e]||(gh(this,ch,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{mh(this,ph,!0,"f"),"error"!==e&&this.once("error",n),this.once(e,t)})}async done(){mh(this,ph,!0,"f"),await gh(this,ih,"f")}_emit(e,...t){if(gh(this,uh,"f"))return;"end"===e&&(mh(this,uh,!0,"f"),gh(this,ah,"f").call(this));const n=gh(this,ch,"f")[e];if(n&&(gh(this,ch,"f")[e]=n.filter(e=>!e.once),n.forEach(({listener:e})=>e(...t))),"abort"===e){const e=t[0];return gh(this,ph,"f")||n?.length||Promise.reject(e),gh(this,oh,"f").call(this,e),gh(this,lh,"f").call(this,e),void this._emit("end")}if("error"===e){const e=t[0];gh(this,ph,"f")||n?.length||Promise.reject(e),gh(this,oh,"f").call(this,e),gh(this,lh,"f").call(this,e),this._emit("end")}}_emitFinal(){}}sh=new WeakMap,rh=new WeakMap,oh=new WeakMap,ih=new WeakMap,ah=new WeakMap,lh=new WeakMap,ch=new WeakMap,uh=new WeakMap,hh=new WeakMap,dh=new WeakMap,ph=new WeakMap,nh=new WeakSet,fh=function(e){if(mh(this,hh,!0,"f"),e instanceof Error&&"AbortError"===e.name&&(e=new Mc),e instanceof Mc)return mh(this,dh,!0,"f"),this._emit("abort",e);if(e instanceof Rc)return this._emit("error",e);if(e instanceof Error){const t=new Rc(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new Rc(String(e)))};var _h,bh,vh,wh,xh,kh,Ch,Ah,Eh,Dh,Sh,Fh,Ih,Rh,Th,Mh,Oh,Ph,Lh,$h,Bh,zh,Nh=function(e,t,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(e):s?s.value:t.get(e)},qh=function(e,t,n,s,r){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?r.call(e,n):r?r.value=n:t.set(e,n),n};class jh extends yh{constructor(){super(...arguments),_h.add(this),bh.set(this,[]),vh.set(this,{}),wh.set(this,{}),xh.set(this,void 0),kh.set(this,void 0),Ch.set(this,void 0),Ah.set(this,void 0),Eh.set(this,void 0),Dh.set(this,void 0),Sh.set(this,void 0),Fh.set(this,void 0),Ih.set(this,void 0)}[(bh=new WeakMap,vh=new WeakMap,wh=new WeakMap,xh=new WeakMap,kh=new WeakMap,Ch=new WeakMap,Ah=new WeakMap,Eh=new WeakMap,Dh=new WeakMap,Sh=new WeakMap,Fh=new WeakMap,Ih=new WeakMap,_h=new WeakSet,Symbol.asyncIterator)](){const e=[],t=[];let n=!1;return this.on("event",n=>{const s=t.shift();s?s.resolve(n):e.push(n)}),this.on("end",()=>{n=!0;for(const e of t)e.resolve(void 0);t.length=0}),this.on("abort",e=>{n=!0;for(const n of t)n.reject(e);t.length=0}),this.on("error",e=>{n=!0;for(const n of t)n.reject(e);t.length=0}),{next:async()=>{if(!e.length)return n?{value:void 0,done:!0}:new Promise((e,n)=>t.push({resolve:e,reject:n})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0});return{value:e.shift(),done:!1}},return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(e){const t=new jh;return t._run(()=>t._fromReadableStream(e)),t}async _fromReadableStream(e,t){const n=t?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort())),this._connected();const s=Yc.fromReadableStream(e,this.controller);for await(const r of s)Nh(this,_h,"m",Rh).call(this,r);if(s.controller.signal?.aborted)throw new Mc;return this._addRun(Nh(this,_h,"m",Th).call(this))}toReadableStream(){return new Yc(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(e,t,n,s,r){const o=new jh;return o._run(()=>o._runToolAssistantStream(e,t,n,s,{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),o}async _createToolAssistantStream(e,t,n,s,r){const o=r?.signal;o&&(o.aborted&&this.controller.abort(),o.addEventListener("abort",()=>this.controller.abort()));const i={...s,stream:!0},a=await e.submitToolOutputs(t,n,i,{...r,signal:this.controller.signal});this._connected();for await(const l of a)Nh(this,_h,"m",Rh).call(this,l);if(a.controller.signal?.aborted)throw new Mc;return this._addRun(Nh(this,_h,"m",Th).call(this))}static createThreadAssistantStream(e,t,n){const s=new jh;return s._run(()=>s._threadAssistantStream(e,t,{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}static createAssistantStream(e,t,n,s){const r=new jh;return r._run(()=>r._runAssistantStream(e,t,n,{...s,headers:{...s?.headers,"X-Stainless-Helper-Method":"stream"}})),r}currentEvent(){return Nh(this,Sh,"f")}currentRun(){return Nh(this,Fh,"f")}currentMessageSnapshot(){return Nh(this,xh,"f")}currentRunStepSnapshot(){return Nh(this,Ih,"f")}async finalRunSteps(){return await this.done(),Object.values(Nh(this,vh,"f"))}async finalMessages(){return await this.done(),Object.values(Nh(this,wh,"f"))}async finalRun(){if(await this.done(),!Nh(this,kh,"f"))throw Error("Final run was not received.");return Nh(this,kh,"f")}async _createThreadAssistantStream(e,t,n){const s=n?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort()));const r={...t,stream:!0},o=await e.createAndRun(r,{...n,signal:this.controller.signal});this._connected();for await(const i of o)Nh(this,_h,"m",Rh).call(this,i);if(o.controller.signal?.aborted)throw new Mc;return this._addRun(Nh(this,_h,"m",Th).call(this))}async _createAssistantStream(e,t,n,s){const r=s?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort()));const o={...n,stream:!0},i=await e.create(t,o,{...s,signal:this.controller.signal});this._connected();for await(const a of i)Nh(this,_h,"m",Rh).call(this,a);if(i.controller.signal?.aborted)throw new Mc;return this._addRun(Nh(this,_h,"m",Th).call(this))}static accumulateDelta(e,t){for(const[n,s]of Object.entries(t)){if(!e.hasOwnProperty(n)){e[n]=s;continue}let t=e[n];if(null!=t)if("index"!==n&&"type"!==n){if("string"==typeof t&&"string"==typeof s)t+=s;else if("number"==typeof t&&"number"==typeof s)t+=s;else{if(!qu(t)||!qu(s)){if(Array.isArray(t)&&Array.isArray(s)){if(t.every(e=>"string"==typeof e||"number"==typeof e)){t.push(...s);continue}for(const e of s){if(!qu(e))throw new Error(`Expected array delta entry to be an object but got: ${e}`);const n=e.index;if(null==n)throw console.error(e),new Error("Expected array delta entry to have an `index` property");if("number"!=typeof n)throw new Error(`Expected array delta entry \`index\` property to be a number but got ${n}`);const s=t[n];null==s?t.push(e):t[n]=this.accumulateDelta(s,e)}continue}throw Error(`Unhandled record type: ${n}, deltaValue: ${s}, accValue: ${t}`)}t=this.accumulateDelta(t,s)}e[n]=t}else e[n]=s;else e[n]=s}return e}_addRun(e){return e}async _threadAssistantStream(e,t,n){return await this._createThreadAssistantStream(t,e,n)}async _runAssistantStream(e,t,n,s){return await this._createAssistantStream(t,e,n,s)}async _runToolAssistantStream(e,t,n,s,r){return await this._createToolAssistantStream(n,e,t,s,r)}}Rh=function(e){if(!this.ended)switch(qh(this,Sh,e,"f"),Nh(this,_h,"m",Ph).call(this,e),e.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":Nh(this,_h,"m",zh).call(this,e);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":Nh(this,_h,"m",Oh).call(this,e);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":Nh(this,_h,"m",Mh).call(this,e);break;case"error":throw new Error("Encountered an error event in event processing - errors should be processed earlier")}},Th=function(){if(this.ended)throw new Rc("stream has ended, this shouldn't happen");if(!Nh(this,kh,"f"))throw Error("Final run has not been received");return Nh(this,kh,"f")},Mh=function(e){const[t,n]=Nh(this,_h,"m",$h).call(this,e,Nh(this,xh,"f"));qh(this,xh,t,"f"),Nh(this,wh,"f")[t.id]=t;for(const s of n){const e=t.content[s.index];"text"==e?.type&&this._emit("textCreated",e.text)}switch(e.event){case"thread.message.created":this._emit("messageCreated",e.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",e.data.delta,t),e.data.delta.content)for(const n of e.data.delta.content){if("text"==n.type&&n.text){let e=n.text,s=t.content[n.index];if(!s||"text"!=s.type)throw Error("The snapshot associated with this text delta is not text or missing");this._emit("textDelta",e,s.text)}if(n.index!=Nh(this,Ch,"f")){if(Nh(this,Ah,"f"))switch(Nh(this,Ah,"f").type){case"text":this._emit("textDone",Nh(this,Ah,"f").text,Nh(this,xh,"f"));break;case"image_file":this._emit("imageFileDone",Nh(this,Ah,"f").image_file,Nh(this,xh,"f"))}qh(this,Ch,n.index,"f")}qh(this,Ah,t.content[n.index],"f")}break;case"thread.message.completed":case"thread.message.incomplete":if(void 0!==Nh(this,Ch,"f")){const t=e.data.content[Nh(this,Ch,"f")];if(t)switch(t.type){case"image_file":this._emit("imageFileDone",t.image_file,Nh(this,xh,"f"));break;case"text":this._emit("textDone",t.text,Nh(this,xh,"f"))}}Nh(this,xh,"f")&&this._emit("messageDone",e.data),qh(this,xh,void 0,"f")}},Oh=function(e){const t=Nh(this,_h,"m",Lh).call(this,e);switch(qh(this,Ih,t,"f"),e.event){case"thread.run.step.created":this._emit("runStepCreated",e.data);break;case"thread.run.step.delta":const n=e.data.delta;if(n.step_details&&"tool_calls"==n.step_details.type&&n.step_details.tool_calls&&"tool_calls"==t.step_details.type)for(const e of n.step_details.tool_calls)e.index==Nh(this,Eh,"f")?this._emit("toolCallDelta",e,t.step_details.tool_calls[e.index]):(Nh(this,Dh,"f")&&this._emit("toolCallDone",Nh(this,Dh,"f")),qh(this,Eh,e.index,"f"),qh(this,Dh,t.step_details.tool_calls[e.index],"f"),Nh(this,Dh,"f")&&this._emit("toolCallCreated",Nh(this,Dh,"f")));this._emit("runStepDelta",e.data.delta,t);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":qh(this,Ih,void 0,"f");"tool_calls"==e.data.step_details.type&&Nh(this,Dh,"f")&&(this._emit("toolCallDone",Nh(this,Dh,"f")),qh(this,Dh,void 0,"f")),this._emit("runStepDone",e.data,t)}},Ph=function(e){Nh(this,bh,"f").push(e),this._emit("event",e)},Lh=function(e){switch(e.event){case"thread.run.step.created":return Nh(this,vh,"f")[e.data.id]=e.data,e.data;case"thread.run.step.delta":let t=Nh(this,vh,"f")[e.data.id];if(!t)throw Error("Received a RunStepDelta before creation of a snapshot");let n=e.data;if(n.delta){const s=jh.accumulateDelta(t,n.delta);Nh(this,vh,"f")[e.data.id]=s}return Nh(this,vh,"f")[e.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":Nh(this,vh,"f")[e.data.id]=e.data}if(Nh(this,vh,"f")[e.data.id])return Nh(this,vh,"f")[e.data.id];throw new Error("No snapshot available")},$h=function(e,t){let n=[];switch(e.event){case"thread.message.created":return[e.data,n];case"thread.message.delta":if(!t)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let s=e.data;if(s.delta.content)for(const e of s.delta.content)if(e.index in t.content){let n=t.content[e.index];t.content[e.index]=Nh(this,_h,"m",Bh).call(this,e,n)}else t.content[e.index]=e,n.push(e);return[t,n];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(t)return[t,n];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},Bh=function(e,t){return jh.accumulateDelta(t,e)},zh=function(e){switch(qh(this,Fh,e.data,"f"),e.event){case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":qh(this,kh,e.data,"f"),Nh(this,Dh,"f")&&(this._emit("toolCallDone",Nh(this,Dh,"f")),qh(this,Dh,void 0,"f"))}};class Uh extends Hu{create(e,t){return this._client.post("/assistants",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}retrieve(e,t){return this._client.get(`/assistants/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}update(e,t,n){return this._client.post(`/assistants/${e}`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}list(e={},t){return wu(e)?this.list({},e):this._client.getAPIList("/assistants",Hh,{query:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}del(e,t){return this._client.delete(`/assistants/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}}class Hh extends Uu{}function Wh(e){return"function"==typeof e.parse}Uh.AssistantsPage=Hh;const Vh=e=>"assistant"===e?.role,Qh=e=>"function"===e?.role,Jh=e=>"tool"===e?.role;function Zh(e){return"auto-parseable-response-format"===e?.$brand}function Gh(e){return"auto-parseable-tool"===e?.$brand}function Kh(e,t){const n=e.choices.map(e=>{if("length"===e.finish_reason)throw new Hc;if("content_filter"===e.finish_reason)throw new Wc;return{...e,message:{...e.message,...e.message.tool_calls?{tool_calls:e.message.tool_calls?.map(e=>function(e,t){const n=e.tools?.find(e=>e.function?.name===t.function.name);return{...t,function:{...t.function,parsed_arguments:Gh(n)?n.$parseRaw(t.function.arguments):n?.function.strict?JSON.parse(t.function.arguments):null}}}(t,e))??void 0}:void 0,parsed:e.message.content&&!e.message.refusal?Xh(t,e.message.content):null}}});return{...e,choices:n}}function Xh(e,t){if("json_schema"!==e.response_format?.type)return null;if("json_schema"===e.response_format?.type){if("$parseRaw"in e.response_format){return e.response_format.$parseRaw(t)}return JSON.parse(t)}return null}function Yh(e,t){if(!e)return!1;const n=e.tools?.find(e=>e.function?.name===t.function.name);return Gh(n)||n?.function.strict||!1}function ed(e){return!!Zh(e.response_format)||(e.tools?.some(e=>Gh(e)||"function"===e.type&&!0===e.function.strict)??!1)}var td,nd,sd,rd,od,id,ad,ld,cd=function(e,t,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(e):s?s.value:t.get(e)};const ud=10;class hd extends yh{constructor(){super(...arguments),td.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(e){this._chatCompletions.push(e),this._emit("chatCompletion",e);const t=e.choices[0]?.message;return t&&this._addMessage(t),e}_addMessage(e,t=!0){if("content"in e||(e.content=null),this.messages.push(e),t)if(this._emit("message",e),(Qh(e)||Jh(e))&&e.content)this._emit("functionCallResult",e.content);else if(Vh(e)&&e.function_call)this._emit("functionCall",e.function_call);else if(Vh(e)&&e.tool_calls)for(const n of e.tool_calls)"function"===n.type&&this._emit("functionCall",n.function)}async finalChatCompletion(){await this.done();const e=this._chatCompletions[this._chatCompletions.length-1];if(!e)throw new Rc("stream ended without producing a ChatCompletion");return e}async finalContent(){return await this.done(),cd(this,td,"m",nd).call(this)}async finalMessage(){return await this.done(),cd(this,td,"m",sd).call(this)}async finalFunctionCall(){return await this.done(),cd(this,td,"m",rd).call(this)}async finalFunctionCallResult(){return await this.done(),cd(this,td,"m",od).call(this)}async totalUsage(){return await this.done(),cd(this,td,"m",id).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){const e=this._chatCompletions[this._chatCompletions.length-1];e&&this._emit("finalChatCompletion",e);const t=cd(this,td,"m",sd).call(this);t&&this._emit("finalMessage",t);const n=cd(this,td,"m",nd).call(this);n&&this._emit("finalContent",n);const s=cd(this,td,"m",rd).call(this);s&&this._emit("finalFunctionCall",s);const r=cd(this,td,"m",od).call(this);null!=r&&this._emit("finalFunctionCallResult",r),this._chatCompletions.some(e=>e.usage)&&this._emit("totalUsage",cd(this,td,"m",id).call(this))}async _createChatCompletion(e,t,n){const s=n?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort())),cd(this,td,"m",ad).call(this,t);const r=await e.chat.completions.create({...t,stream:!1},{...n,signal:this.controller.signal});return this._connected(),this._addChatCompletion(Kh(r,t))}async _runChatCompletion(e,t,n){for(const s of t.messages)this._addMessage(s,!1);return await this._createChatCompletion(e,t,n)}async _runFunctions(e,t,n){const s="function",{function_call:r="auto",stream:o,...i}=t,a="string"!=typeof r&&r?.name,{maxChatCompletions:l=ud}=n||{},c={};for(const d of t.functions)c[d.name||d.function.name]=d;const u=t.functions.map(e=>({name:e.name||e.function.name,parameters:e.parameters,description:e.description}));for(const d of t.messages)this._addMessage(d,!1);for(let d=0;d<l;++d){const t=await this._createChatCompletion(e,{...i,function_call:r,functions:u,messages:[...this.messages]},n),o=t.choices[0]?.message;if(!o)throw new Rc("missing message in ChatCompletion response");if(!o.function_call)return;const{name:l,arguments:d}=o.function_call,p=c[l];if(!p){const e=`Invalid function_call: ${JSON.stringify(l)}. Available options are: ${u.map(e=>JSON.stringify(e.name)).join(", ")}. Please try again`;this._addMessage({role:s,name:l,content:e});continue}if(a&&a!==l){const e=`Invalid function_call: ${JSON.stringify(l)}. ${JSON.stringify(a)} requested. Please try again`;this._addMessage({role:s,name:l,content:e});continue}let f;try{f=Wh(p)?await p.parse(d):d}catch(h){this._addMessage({role:s,name:l,content:h instanceof Error?h.message:String(h)});continue}const m=await p.function(f,this),g=cd(this,td,"m",ld).call(this,m);if(this._addMessage({role:s,name:l,content:g}),a)return}}async _runTools(e,t,n){const s="tool",{tool_choice:r="auto",stream:o,...i}=t,a="string"!=typeof r&&r?.function?.name,{maxChatCompletions:l=ud}=n||{},c=t.tools.map(e=>{if(Gh(e)){if(!e.$callback)throw new Rc("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:e.$callback,name:e.function.name,description:e.function.description||"",parameters:e.function.parameters,parse:e.$parseRaw,strict:!0}}}return e}),u={};for(const p of c)"function"===p.type&&(u[p.function.name||p.function.function.name]=p.function);const h="tools"in t?c.map(e=>"function"===e.type?{type:"function",function:{name:e.function.name||e.function.function.name,parameters:e.function.parameters,description:e.function.description,strict:e.function.strict}}:e):void 0;for(const p of t.messages)this._addMessage(p,!1);for(let p=0;p<l;++p){const t=await this._createChatCompletion(e,{...i,tool_choice:r,tools:h,messages:[...this.messages]},n),o=t.choices[0]?.message;if(!o)throw new Rc("missing message in ChatCompletion response");if(!o.tool_calls?.length)return;for(const e of o.tool_calls){if("function"!==e.type)continue;const t=e.id,{name:n,arguments:r}=e.function,o=u[n];if(!o){const e=`Invalid tool_call: ${JSON.stringify(n)}. Available options are: ${Object.keys(u).map(e=>JSON.stringify(e)).join(", ")}. Please try again`;this._addMessage({role:s,tool_call_id:t,content:e});continue}if(a&&a!==n){const e=`Invalid tool_call: ${JSON.stringify(n)}. ${JSON.stringify(a)} requested. Please try again`;this._addMessage({role:s,tool_call_id:t,content:e});continue}let i;try{i=Wh(o)?await o.parse(r):r}catch(d){const e=d instanceof Error?d.message:String(d);this._addMessage({role:s,tool_call_id:t,content:e});continue}const l=await o.function(i,this),c=cd(this,td,"m",ld).call(this,l);if(this._addMessage({role:s,tool_call_id:t,content:c}),a)return}}}}td=new WeakSet,nd=function(){return cd(this,td,"m",sd).call(this).content??null},sd=function(){let e=this.messages.length;for(;e-- >0;){const t=this.messages[e];if(Vh(t)){const{function_call:e,...n}=t,s={...n,content:t.content??null,refusal:t.refusal??null};return e&&(s.function_call=e),s}}throw new Rc("stream ended without producing a ChatCompletionMessage with role=assistant")},rd=function(){for(let e=this.messages.length-1;e>=0;e--){const t=this.messages[e];if(Vh(t)&&t?.function_call)return t.function_call;if(Vh(t)&&t?.tool_calls?.length)return t.tool_calls.at(-1)?.function}},od=function(){for(let e=this.messages.length-1;e>=0;e--){const t=this.messages[e];if(Qh(t)&&null!=t.content)return t.content;if(Jh(t)&&null!=t.content&&"string"==typeof t.content&&this.messages.some(e=>"assistant"===e.role&&e.tool_calls?.some(e=>"function"===e.type&&e.id===t.tool_call_id)))return t.content}},id=function(){const e={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(const{usage:t}of this._chatCompletions)t&&(e.completion_tokens+=t.completion_tokens,e.prompt_tokens+=t.prompt_tokens,e.total_tokens+=t.total_tokens);return e},ad=function(e){if(null!=e.n&&e.n>1)throw new Rc("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},ld=function(e){return"string"==typeof e?e:void 0===e?"undefined":JSON.stringify(e)};class dd extends hd{static runFunctions(e,t,n){const s=new dd,r={...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"runFunctions"}};return s._run(()=>s._runFunctions(e,t,r)),s}static runTools(e,t,n){const s=new dd,r={...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"runTools"}};return s._run(()=>s._runTools(e,t,r)),s}_addMessage(e,t=!0){super._addMessage(e,t),Vh(e)&&e.content&&this._emit("content",e.content)}}const pd=1,fd=2,md=4,gd=8,yd=16,_d=32,bd=64,vd=128,wd=256,xd=511;class kd extends Error{}class Cd extends Error{}const Ad=(e,t)=>{const n=e.length;let s=0;const r=e=>{throw new kd(`${e} at position ${s}`)},o=e=>{throw new Cd(`${e} at position ${s}`)},i=()=>(h(),s>=n&&r("Unexpected end of input"),'"'===e[s]?a():"{"===e[s]?l():"["===e[s]?c():"null"===e.substring(s,s+4)||yd&t&&n-s<4&&"null".startsWith(e.substring(s))?(s+=4,null):"true"===e.substring(s,s+4)||_d&t&&n-s<4&&"true".startsWith(e.substring(s))?(s+=4,!0):"false"===e.substring(s,s+5)||_d&t&&n-s<5&&"false".startsWith(e.substring(s))?(s+=5,!1):"Infinity"===e.substring(s,s+8)||vd&t&&n-s<8&&"Infinity".startsWith(e.substring(s))?(s+=8,1/0):"-Infinity"===e.substring(s,s+9)||wd&t&&1<n-s&&n-s<9&&"-Infinity".startsWith(e.substring(s))?(s+=9,-1/0):"NaN"===e.substring(s,s+3)||bd&t&&n-s<3&&"NaN".startsWith(e.substring(s))?(s+=3,NaN):u()),a=()=>{const i=s;let a=!1;for(s++;s<n&&('"'!==e[s]||a&&"\\"===e[s-1]);)a="\\"===e[s]&&!a,s++;if('"'==e.charAt(s))try{return JSON.parse(e.substring(i,++s-Number(a)))}catch(Df){o(String(Df))}else if(pd&t)try{return JSON.parse(e.substring(i,s-Number(a))+'"')}catch(Df){return JSON.parse(e.substring(i,e.lastIndexOf("\\"))+'"')}r("Unterminated string literal")},l=()=>{s++,h();const o={};try{for(;"}"!==e[s];){if(h(),s>=n&&gd&t)return o;const r=a();h(),s++;try{const e=i();Object.defineProperty(o,r,{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(Df){if(gd&t)return o;throw Df}h(),","===e[s]&&s++}}catch(Df){if(gd&t)return o;r("Expected '}' at end of object")}return s++,o},c=()=>{s++;const n=[];try{for(;"]"!==e[s];)n.push(i()),h(),","===e[s]&&s++}catch(Df){if(md&t)return n;r("Expected ']' at end of array")}return s++,n},u=()=>{if(0===s){"-"===e&&fd&t&&r("Not sure what '-' is");try{return JSON.parse(e)}catch(Df){if(fd&t)try{return"."===e[e.length-1]?JSON.parse(e.substring(0,e.lastIndexOf("."))):JSON.parse(e.substring(0,e.lastIndexOf("e")))}catch(a){}o(String(Df))}}const i=s;for("-"===e[s]&&s++;e[s]&&!",]}".includes(e[s]);)s++;s!=n||fd&t||r("Unterminated number literal");try{return JSON.parse(e.substring(i,s))}catch(Df){"-"===e.substring(i,s)&&fd&t&&r("Not sure what '-' is");try{return JSON.parse(e.substring(i,e.lastIndexOf("e")))}catch(a){o(String(a))}}},h=()=>{for(;s<n&&" \n\r\t".includes(e[s]);)s++};return i()},Ed=e=>function(e,t=xd){if("string"!=typeof e)throw new TypeError("expecting str, got "+typeof e);if(!e.trim())throw new Error(`${e} is empty`);return Ad(e.trim(),t)}(e,xd^fd);var Dd,Sd,Fd,Id,Rd,Td,Md,Od,Pd,Ld,$d,Bd,zd=function(e,t,n,s,r){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?r.call(e,n):r?r.value=n:t.set(e,n),n},Nd=function(e,t,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(e):s?s.value:t.get(e)};class qd extends hd{constructor(e){super(),Dd.add(this),Sd.set(this,void 0),Fd.set(this,void 0),Id.set(this,void 0),zd(this,Sd,e,"f"),zd(this,Fd,[],"f")}get currentChatCompletionSnapshot(){return Nd(this,Id,"f")}static fromReadableStream(e){const t=new qd(null);return t._run(()=>t._fromReadableStream(e)),t}static createChatCompletion(e,t,n){const s=new qd(t);return s._run(()=>s._runChatCompletion(e,{...t,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}async _createChatCompletion(e,t,n){super._createChatCompletion;const s=n?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort())),Nd(this,Dd,"m",Rd).call(this);const r=await e.chat.completions.create({...t,stream:!0},{...n,signal:this.controller.signal});this._connected();for await(const o of r)Nd(this,Dd,"m",Md).call(this,o);if(r.controller.signal?.aborted)throw new Mc;return this._addChatCompletion(Nd(this,Dd,"m",Ld).call(this))}async _fromReadableStream(e,t){const n=t?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort())),Nd(this,Dd,"m",Rd).call(this),this._connected();const s=Yc.fromReadableStream(e,this.controller);let r;for await(const o of s)r&&r!==o.id&&this._addChatCompletion(Nd(this,Dd,"m",Ld).call(this)),Nd(this,Dd,"m",Md).call(this,o),r=o.id;if(s.controller.signal?.aborted)throw new Mc;return this._addChatCompletion(Nd(this,Dd,"m",Ld).call(this))}[(Sd=new WeakMap,Fd=new WeakMap,Id=new WeakMap,Dd=new WeakSet,Rd=function(){this.ended||zd(this,Id,void 0,"f")},Td=function(e){let t=Nd(this,Fd,"f")[e.index];return t||(t={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},Nd(this,Fd,"f")[e.index]=t,t)},Md=function(e){if(this.ended)return;const t=Nd(this,Dd,"m",Bd).call(this,e);this._emit("chunk",e,t);for(const n of e.choices){const e=t.choices[n.index];null!=n.delta.content&&"assistant"===e.message?.role&&e.message?.content&&(this._emit("content",n.delta.content,e.message.content),this._emit("content.delta",{delta:n.delta.content,snapshot:e.message.content,parsed:e.message.parsed})),null!=n.delta.refusal&&"assistant"===e.message?.role&&e.message?.refusal&&this._emit("refusal.delta",{delta:n.delta.refusal,snapshot:e.message.refusal}),null!=n.logprobs?.content&&"assistant"===e.message?.role&&this._emit("logprobs.content.delta",{content:n.logprobs?.content,snapshot:e.logprobs?.content??[]}),null!=n.logprobs?.refusal&&"assistant"===e.message?.role&&this._emit("logprobs.refusal.delta",{refusal:n.logprobs?.refusal,snapshot:e.logprobs?.refusal??[]});const s=Nd(this,Dd,"m",Td).call(this,e);e.finish_reason&&(Nd(this,Dd,"m",Pd).call(this,e),null!=s.current_tool_call_index&&Nd(this,Dd,"m",Od).call(this,e,s.current_tool_call_index));for(const t of n.delta.tool_calls??[])s.current_tool_call_index!==t.index&&(Nd(this,Dd,"m",Pd).call(this,e),null!=s.current_tool_call_index&&Nd(this,Dd,"m",Od).call(this,e,s.current_tool_call_index)),s.current_tool_call_index=t.index;for(const t of n.delta.tool_calls??[]){const n=e.message.tool_calls?.[t.index];n?.type&&("function"===n?.type?this._emit("tool_calls.function.arguments.delta",{name:n.function?.name,index:t.index,arguments:n.function.arguments,parsed_arguments:n.function.parsed_arguments,arguments_delta:t.function?.arguments??""}):Ud(n?.type))}}},Od=function(e,t){if(Nd(this,Dd,"m",Td).call(this,e).done_tool_calls.has(t))return;const n=e.message.tool_calls?.[t];if(!n)throw new Error("no tool call snapshot");if(!n.type)throw new Error("tool call snapshot missing `type`");if("function"===n.type){const e=Nd(this,Sd,"f")?.tools?.find(e=>"function"===e.type&&e.function.name===n.function.name);this._emit("tool_calls.function.arguments.done",{name:n.function.name,index:t,arguments:n.function.arguments,parsed_arguments:Gh(e)?e.$parseRaw(n.function.arguments):e?.function.strict?JSON.parse(n.function.arguments):null})}else n.type},Pd=function(e){const t=Nd(this,Dd,"m",Td).call(this,e);if(e.message.content&&!t.content_done){t.content_done=!0;const n=Nd(this,Dd,"m",$d).call(this);this._emit("content.done",{content:e.message.content,parsed:n?n.$parseRaw(e.message.content):null})}e.message.refusal&&!t.refusal_done&&(t.refusal_done=!0,this._emit("refusal.done",{refusal:e.message.refusal})),e.logprobs?.content&&!t.logprobs_content_done&&(t.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:e.logprobs.content})),e.logprobs?.refusal&&!t.logprobs_refusal_done&&(t.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:e.logprobs.refusal}))},Ld=function(){if(this.ended)throw new Rc("stream has ended, this shouldn't happen");const e=Nd(this,Id,"f");if(!e)throw new Rc("request ended without sending any chunks");return zd(this,Id,void 0,"f"),zd(this,Fd,[],"f"),function(e,t){const{id:n,choices:s,created:r,model:o,system_fingerprint:i,...a}=e,l={...a,id:n,choices:s.map(({message:t,finish_reason:n,index:s,logprobs:r,...o})=>{if(!n)throw new Rc(`missing finish_reason for choice ${s}`);const{content:i=null,function_call:a,tool_calls:l,...c}=t,u=t.role;if(!u)throw new Rc(`missing role for choice ${s}`);if(a){const{arguments:e,name:l}=a;if(null==e)throw new Rc(`missing function_call.arguments for choice ${s}`);if(!l)throw new Rc(`missing function_call.name for choice ${s}`);return{...o,message:{content:i,function_call:{arguments:e,name:l},role:u,refusal:t.refusal??null},finish_reason:n,index:s,logprobs:r}}return l?{...o,index:s,finish_reason:n,logprobs:r,message:{...c,role:u,content:i,refusal:t.refusal??null,tool_calls:l.map((t,n)=>{const{function:r,type:o,id:i,...a}=t,{arguments:l,name:c,...u}=r||{};if(null==i)throw new Rc(`missing choices[${s}].tool_calls[${n}].id\n${jd(e)}`);if(null==o)throw new Rc(`missing choices[${s}].tool_calls[${n}].type\n${jd(e)}`);if(null==c)throw new Rc(`missing choices[${s}].tool_calls[${n}].function.name\n${jd(e)}`);if(null==l)throw new Rc(`missing choices[${s}].tool_calls[${n}].function.arguments\n${jd(e)}`);return{...a,id:i,type:o,function:{...u,name:c,arguments:l}}})}}:{...o,message:{...c,content:i,role:u,refusal:t.refusal??null},finish_reason:n,index:s,logprobs:r}}),created:r,model:o,object:"chat.completion",...i?{system_fingerprint:i}:{}};return function(e,t){return t&&ed(t)?Kh(e,t):{...e,choices:e.choices.map(e=>({...e,message:{...e.message,parsed:null,...e.message.tool_calls?{tool_calls:e.message.tool_calls}:void 0}}))}}(l,t)}(e,Nd(this,Sd,"f"))},$d=function(){const e=Nd(this,Sd,"f")?.response_format;return Zh(e)?e:null},Bd=function(e){var t,n,s,r;let o=Nd(this,Id,"f");const{choices:i,...a}=e;o?Object.assign(o,a):o=zd(this,Id,{...a,choices:[]},"f");for(const{delta:l,finish_reason:c,index:u,logprobs:h=null,...d}of e.choices){let e=o.choices[u];if(e||(e=o.choices[u]={finish_reason:c,index:u,message:{},logprobs:h,...d}),h)if(e.logprobs){const{content:s,refusal:r,...o}=h;Object.assign(e.logprobs,o),s&&((t=e.logprobs).content??(t.content=[]),e.logprobs.content.push(...s)),r&&((n=e.logprobs).refusal??(n.refusal=[]),e.logprobs.refusal.push(...r))}else e.logprobs=Object.assign({},h);if(c&&(e.finish_reason=c,Nd(this,Sd,"f")&&ed(Nd(this,Sd,"f")))){if("length"===c)throw new Hc;if("content_filter"===c)throw new Wc}if(Object.assign(e,d),!l)continue;const{content:i,refusal:a,function_call:p,role:f,tool_calls:m,...g}=l;if(Object.assign(e.message,g),a&&(e.message.refusal=(e.message.refusal||"")+a),f&&(e.message.role=f),p&&(e.message.function_call?(p.name&&(e.message.function_call.name=p.name),p.arguments&&((s=e.message.function_call).arguments??(s.arguments=""),e.message.function_call.arguments+=p.arguments)):e.message.function_call=p),i&&(e.message.content=(e.message.content||"")+i,!e.message.refusal&&Nd(this,Dd,"m",$d).call(this)&&(e.message.parsed=Ed(e.message.content))),m){e.message.tool_calls||(e.message.tool_calls=[]);for(const{index:t,id:n,type:s,function:o,...i}of m){const a=(r=e.message.tool_calls)[t]??(r[t]={});Object.assign(a,i),n&&(a.id=n),s&&(a.type=s),o&&(a.function??(a.function={name:o.name??"",arguments:""})),o?.name&&(a.function.name=o.name),o?.arguments&&(a.function.arguments+=o.arguments,Yh(Nd(this,Sd,"f"),a)&&(a.function.parsed_arguments=Ed(a.function.arguments)))}}}return o},Symbol.asyncIterator)](){const e=[],t=[];let n=!1;return this.on("chunk",n=>{const s=t.shift();s?s.resolve(n):e.push(n)}),this.on("end",()=>{n=!0;for(const e of t)e.resolve(void 0);t.length=0}),this.on("abort",e=>{n=!0;for(const n of t)n.reject(e);t.length=0}),this.on("error",e=>{n=!0;for(const n of t)n.reject(e);t.length=0}),{next:async()=>{if(!e.length)return n?{value:void 0,done:!0}:new Promise((e,n)=>t.push({resolve:e,reject:n})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0});return{value:e.shift(),done:!1}},return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Yc(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function jd(e){return JSON.stringify(e)}function Ud(e){}class Hd extends qd{static fromReadableStream(e){const t=new Hd(null);return t._run(()=>t._fromReadableStream(e)),t}static runFunctions(e,t,n){const s=new Hd(null),r={...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"runFunctions"}};return s._run(()=>s._runFunctions(e,t,r)),s}static runTools(e,t,n){const s=new Hd(t),r={...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"runTools"}};return s._run(()=>s._runTools(e,t,r)),s}}let Wd=class extends Hu{parse(e,t){return function(e){for(const t of e??[]){if("function"!==t.type)throw new Rc(`Currently only \`function\` tool types support auto-parsing; Received \`${t.type}\``);if(!0!==t.function.strict)throw new Rc(`The \`${t.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}(e.tools),this._client.chat.completions.create(e,{...t,headers:{...t?.headers,"X-Stainless-Helper-Method":"beta.chat.completions.parse"}})._thenUnwrap(t=>Kh(t,e))}runFunctions(e,t){return e.stream?Hd.runFunctions(this._client,e,t):dd.runFunctions(this._client,e,t)}runTools(e,t){return e.stream?Hd.runTools(this._client,e,t):dd.runTools(this._client,e,t)}stream(e,t){return qd.createChatCompletion(this._client,e,t)}};class Vd extends Hu{constructor(){super(...arguments),this.completions=new Wd(this._client)}}(Vd||(Vd={})).Completions=Wd;class Qd extends Hu{create(e,t){return this._client.post("/realtime/sessions",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}}class Jd extends Hu{create(e,t){return this._client.post("/realtime/transcription_sessions",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}}class Zd extends Hu{constructor(){super(...arguments),this.sessions=new Qd(this._client),this.transcriptionSessions=new Jd(this._client)}}Zd.Sessions=Qd,Zd.TranscriptionSessions=Jd;class Gd extends Hu{create(e,t,n){return this._client.post(`/threads/${e}/messages`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}retrieve(e,t,n){return this._client.get(`/threads/${e}/messages/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}update(e,t,n,s){return this._client.post(`/threads/${e}/messages/${t}`,{body:n,...s,headers:{"OpenAI-Beta":"assistants=v2",...s?.headers}})}list(e,t={},n){return wu(t)?this.list(e,{},t):this._client.getAPIList(`/threads/${e}/messages`,Kd,{query:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}del(e,t,n){return this._client.delete(`/threads/${e}/messages/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}}class Kd extends Uu{}Gd.MessagesPage=Kd;class Xd extends Hu{retrieve(e,t,n,s={},r){return wu(s)?this.retrieve(e,t,n,{},s):this._client.get(`/threads/${e}/runs/${t}/steps/${n}`,{query:s,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}list(e,t,n={},s){return wu(n)?this.list(e,t,{},n):this._client.getAPIList(`/threads/${e}/runs/${t}/steps`,Yd,{query:n,...s,headers:{"OpenAI-Beta":"assistants=v2",...s?.headers}})}}class Yd extends Uu{}Xd.RunStepsPage=Yd;let ep=class extends Hu{constructor(){super(...arguments),this.steps=new Xd(this._client)}create(e,t,n){const{include:s,...r}=t;return this._client.post(`/threads/${e}/runs`,{query:{include:s},body:r,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers},stream:t.stream??!1})}retrieve(e,t,n){return this._client.get(`/threads/${e}/runs/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}update(e,t,n,s){return this._client.post(`/threads/${e}/runs/${t}`,{body:n,...s,headers:{"OpenAI-Beta":"assistants=v2",...s?.headers}})}list(e,t={},n){return wu(t)?this.list(e,{},t):this._client.getAPIList(`/threads/${e}/runs`,tp,{query:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}cancel(e,t,n){return this._client.post(`/threads/${e}/runs/${t}/cancel`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}async createAndPoll(e,t,n){const s=await this.create(e,t,n);return await this.poll(e,s.id,n)}createAndStream(e,t,n){return jh.createAssistantStream(e,this._client.beta.threads.runs,t,n)}async poll(e,t,n){const s={...n?.headers,"X-Stainless-Poll-Helper":"true"};for(n?.pollIntervalMs&&(s["X-Stainless-Custom-Poll-Interval"]=n.pollIntervalMs.toString());;){const{data:r,response:o}=await this.retrieve(e,t,{...n,headers:{...n?.headers,...s}}).withResponse();switch(r.status){case"queued":case"in_progress":case"cancelling":let e=5e3;if(n?.pollIntervalMs)e=n.pollIntervalMs;else{const t=o.headers.get("openai-poll-after-ms");if(t){const n=parseInt(t);isNaN(n)||(e=n)}}await Iu(e);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return r}}}stream(e,t,n){return jh.createAssistantStream(e,this._client.beta.threads.runs,t,n)}submitToolOutputs(e,t,n,s){return this._client.post(`/threads/${e}/runs/${t}/submit_tool_outputs`,{body:n,...s,headers:{"OpenAI-Beta":"assistants=v2",...s?.headers},stream:n.stream??!1})}async submitToolOutputsAndPoll(e,t,n,s){const r=await this.submitToolOutputs(e,t,n,s);return await this.poll(e,r.id,s)}submitToolOutputsStream(e,t,n,s){return jh.createToolAssistantStream(e,t,this._client.beta.threads.runs,n,s)}};class tp extends Uu{}ep.RunsPage=tp,ep.Steps=Xd,ep.RunStepsPage=Yd;class np extends Hu{constructor(){super(...arguments),this.runs=new ep(this._client),this.messages=new Gd(this._client)}create(e={},t){return wu(e)?this.create({},e):this._client.post("/threads",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}retrieve(e,t){return this._client.get(`/threads/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}update(e,t,n){return this._client.post(`/threads/${e}`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}del(e,t){return this._client.delete(`/threads/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}createAndRun(e,t){return this._client.post("/threads/runs",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers},stream:e.stream??!1})}async createAndRunPoll(e,t){const n=await this.createAndRun(e,t);return await this.runs.poll(n.thread_id,n.id,t)}createAndRunStream(e,t){return jh.createThreadAssistantStream(e,this._client.beta.threads,t)}}np.Runs=ep,np.RunsPage=tp,np.Messages=Gd,np.MessagesPage=Kd;class sp extends Hu{constructor(){super(...arguments),this.realtime=new Zd(this._client),this.chat=new Vd(this._client),this.assistants=new Uh(this._client),this.threads=new np(this._client)}}sp.Realtime=Zd,sp.Assistants=Uh,sp.AssistantsPage=Hh,sp.Threads=np;class rp extends Hu{create(e,t){return this._client.post("/completions",{body:e,...t,stream:e.stream??!1})}}class op extends Hu{retrieve(e,t,n){return this._client.get(`/containers/${e}/files/${t}/content`,{...n,headers:{Accept:"application/binary",...n?.headers},__binaryResponse:!0})}}let ip=class extends Hu{constructor(){super(...arguments),this.content=new op(this._client)}create(e,t,n){return this._client.post(`/containers/${e}/files`,lu({body:t,...n}))}retrieve(e,t,n){return this._client.get(`/containers/${e}/files/${t}`,n)}list(e,t={},n){return wu(t)?this.list(e,{},t):this._client.getAPIList(`/containers/${e}/files`,ap,{query:t,...n})}del(e,t,n){return this._client.delete(`/containers/${e}/files/${t}`,{...n,headers:{Accept:"*/*",...n?.headers}})}};class ap extends Uu{}ip.FileListResponsesPage=ap,ip.Content=op;class lp extends Hu{constructor(){super(...arguments),this.files=new ip(this._client)}create(e,t){return this._client.post("/containers",{body:e,...t})}retrieve(e,t){return this._client.get(`/containers/${e}`,t)}list(e={},t){return wu(e)?this.list({},e):this._client.getAPIList("/containers",cp,{query:e,...t})}del(e,t){return this._client.delete(`/containers/${e}`,{...t,headers:{Accept:"*/*",...t?.headers}})}}class cp extends Uu{}lp.ContainerListResponsesPage=cp,lp.Files=ip,lp.FileListResponsesPage=ap;class up extends Hu{create(e,t){const n=!!e.encoding_format;let s=n?e.encoding_format:"base64";n&&Bu("Request","User defined encoding_format:",e.encoding_format);const r=this._client.post("/embeddings",{body:{...e,encoding_format:s},...t});return n?r:(Bu("response","Decoding base64 embeddings to float32 array"),r._thenUnwrap(e=>(e&&e.data&&e.data.forEach(e=>{const t=e.embedding;e.embedding=(e=>{if("undefined"!=typeof Buffer){const t=Buffer.from(e,"base64");return Array.from(new Float32Array(t.buffer,t.byteOffset,t.length/Float32Array.BYTES_PER_ELEMENT))}{const t=atob(e),n=t.length,s=new Uint8Array(n);for(let e=0;e<n;e++)s[e]=t.charCodeAt(e);return Array.from(new Float32Array(s.buffer))}})(t)}),e)))}}class hp extends Hu{retrieve(e,t,n,s){return this._client.get(`/evals/${e}/runs/${t}/output_items/${n}`,s)}list(e,t,n={},s){return wu(n)?this.list(e,t,{},n):this._client.getAPIList(`/evals/${e}/runs/${t}/output_items`,dp,{query:n,...s})}}class dp extends Uu{}hp.OutputItemListResponsesPage=dp;class pp extends Hu{constructor(){super(...arguments),this.outputItems=new hp(this._client)}create(e,t,n){return this._client.post(`/evals/${e}/runs`,{body:t,...n})}retrieve(e,t,n){return this._client.get(`/evals/${e}/runs/${t}`,n)}list(e,t={},n){return wu(t)?this.list(e,{},t):this._client.getAPIList(`/evals/${e}/runs`,fp,{query:t,...n})}del(e,t,n){return this._client.delete(`/evals/${e}/runs/${t}`,n)}cancel(e,t,n){return this._client.post(`/evals/${e}/runs/${t}`,n)}}class fp extends Uu{}pp.RunListResponsesPage=fp,pp.OutputItems=hp,pp.OutputItemListResponsesPage=dp;class mp extends Hu{constructor(){super(...arguments),this.runs=new pp(this._client)}create(e,t){return this._client.post("/evals",{body:e,...t})}retrieve(e,t){return this._client.get(`/evals/${e}`,t)}update(e,t,n){return this._client.post(`/evals/${e}`,{body:t,...n})}list(e={},t){return wu(e)?this.list({},e):this._client.getAPIList("/evals",gp,{query:e,...t})}del(e,t){return this._client.delete(`/evals/${e}`,t)}}class gp extends Uu{}mp.EvalListResponsesPage=gp,mp.Runs=pp,mp.RunListResponsesPage=fp;let yp=class extends Hu{create(e,t){return this._client.post("/files",lu({body:e,...t}))}retrieve(e,t){return this._client.get(`/files/${e}`,t)}list(e={},t){return wu(e)?this.list({},e):this._client.getAPIList("/files",_p,{query:e,...t})}del(e,t){return this._client.delete(`/files/${e}`,t)}content(e,t){return this._client.get(`/files/${e}/content`,{...t,headers:{Accept:"application/binary",...t?.headers},__binaryResponse:!0})}retrieveContent(e,t){return this._client.get(`/files/${e}/content`,t)}async waitForProcessing(e,{pollInterval:t=5e3,maxWait:n=18e5}={}){const s=new Set(["processed","error","deleted"]),r=Date.now();let o=await this.retrieve(e);for(;!o.status||!s.has(o.status);)if(await Iu(t),o=await this.retrieve(e),Date.now()-r>n)throw new Pc({message:`Giving up on waiting for file ${e} to finish processing after ${n} milliseconds.`});return o}};class _p extends Uu{}yp.FileObjectsPage=_p;class bp extends Hu{}let vp=class extends Hu{run(e,t){return this._client.post("/fine_tuning/alpha/graders/run",{body:e,...t})}validate(e,t){return this._client.post("/fine_tuning/alpha/graders/validate",{body:e,...t})}};class wp extends Hu{constructor(){super(...arguments),this.graders=new vp(this._client)}}wp.Graders=vp;class xp extends Hu{create(e,t,n){return this._client.getAPIList(`/fine_tuning/checkpoints/${e}/permissions`,kp,{body:t,method:"post",...n})}retrieve(e,t={},n){return wu(t)?this.retrieve(e,{},t):this._client.get(`/fine_tuning/checkpoints/${e}/permissions`,{query:t,...n})}del(e,t,n){return this._client.delete(`/fine_tuning/checkpoints/${e}/permissions/${t}`,n)}}class kp extends ju{}xp.PermissionCreateResponsesPage=kp;let Cp=class extends Hu{constructor(){super(...arguments),this.permissions=new xp(this._client)}};Cp.Permissions=xp,Cp.PermissionCreateResponsesPage=kp;class Ap extends Hu{list(e,t={},n){return wu(t)?this.list(e,{},t):this._client.getAPIList(`/fine_tuning/jobs/${e}/checkpoints`,Ep,{query:t,...n})}}class Ep extends Uu{}Ap.FineTuningJobCheckpointsPage=Ep;class Dp extends Hu{constructor(){super(...arguments),this.checkpoints=new Ap(this._client)}create(e,t){return this._client.post("/fine_tuning/jobs",{body:e,...t})}retrieve(e,t){return this._client.get(`/fine_tuning/jobs/${e}`,t)}list(e={},t){return wu(e)?this.list({},e):this._client.getAPIList("/fine_tuning/jobs",Sp,{query:e,...t})}cancel(e,t){return this._client.post(`/fine_tuning/jobs/${e}/cancel`,t)}listEvents(e,t={},n){return wu(t)?this.listEvents(e,{},t):this._client.getAPIList(`/fine_tuning/jobs/${e}/events`,Fp,{query:t,...n})}pause(e,t){return this._client.post(`/fine_tuning/jobs/${e}/pause`,t)}resume(e,t){return this._client.post(`/fine_tuning/jobs/${e}/resume`,t)}}class Sp extends Uu{}class Fp extends Uu{}Dp.FineTuningJobsPage=Sp,Dp.FineTuningJobEventsPage=Fp,Dp.Checkpoints=Ap,Dp.FineTuningJobCheckpointsPage=Ep;class Ip extends Hu{constructor(){super(...arguments),this.methods=new bp(this._client),this.jobs=new Dp(this._client),this.checkpoints=new Cp(this._client),this.alpha=new wp(this._client)}}Ip.Methods=bp,Ip.Jobs=Dp,Ip.FineTuningJobsPage=Sp,Ip.FineTuningJobEventsPage=Fp,Ip.Checkpoints=Cp,Ip.Alpha=wp;class Rp extends Hu{}class Tp extends Hu{constructor(){super(...arguments),this.graderModels=new Rp(this._client)}}Tp.GraderModels=Rp;class Mp extends Hu{createVariation(e,t){return this._client.post("/images/variations",lu({body:e,...t}))}edit(e,t){return this._client.post("/images/edits",lu({body:e,...t}))}generate(e,t){return this._client.post("/images/generations",{body:e,...t})}}class Op extends Hu{retrieve(e,t){return this._client.get(`/models/${e}`,t)}list(e){return this._client.getAPIList("/models",Pp,e)}del(e,t){return this._client.delete(`/models/${e}`,t)}}class Pp extends ju{}Op.ModelsPage=Pp;class Lp extends Hu{create(e,t){return this._client.post("/moderations",{body:e,...t})}}function $p(e,t){return t&&function(e){if(Zh(e.text?.format))return!0;return!1}(t)?Bp(e,t):{...e,output_parsed:null,output:e.output.map(e=>"function_call"===e.type?{...e,parsed_arguments:null}:"message"===e.type?{...e,content:e.content.map(e=>({...e,parsed:null}))}:e)}}function Bp(e,t){const n=e.output.map(e=>{if("function_call"===e.type)return{...e,parsed_arguments:Np(t,e)};if("message"===e.type){const n=e.content.map(e=>"output_text"===e.type?{...e,parsed:zp(t,e.text)}:e);return{...e,content:n}}return e}),s=Object.assign({},e,{output:n});return Object.getOwnPropertyDescriptor(e,"output_text")||qp(s),Object.defineProperty(s,"output_parsed",{enumerable:!0,get(){for(const e of s.output)if("message"===e.type)for(const t of e.content)if("output_text"===t.type&&null!==t.parsed)return t.parsed;return null}}),s}function zp(e,t){if("json_schema"!==e.text?.format?.type)return null;if("$parseRaw"in e.text?.format){const n=e.text?.format;return n.$parseRaw(t)}return JSON.parse(t)}function Np(e,t){const n=(s=e.tools??[],r=t.name,s.find(e=>"function"===e.type&&e.name===r));var s,r,o;return{...t,...t,parsed_arguments:(o=n,"auto-parseable-tool"===o?.$brand?n.$parseRaw(t.arguments):n?.strict?JSON.parse(t.arguments):null)}}function qp(e){const t=[];for(const n of e.output)if("message"===n.type)for(const e of n.content)"output_text"===e.type&&t.push(e.text);e.output_text=t.join("")}class jp extends Hu{list(e,t={},n){return wu(t)?this.list(e,{},t):this._client.getAPIList(`/responses/${e}/input_items`,tf,{query:t,...n})}}var Up,Hp,Wp,Vp,Qp,Jp,Zp,Gp,Kp=function(e,t,n,s,r){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?r.call(e,n):r?r.value=n:t.set(e,n),n},Xp=function(e,t,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(e):s?s.value:t.get(e)};class Yp extends yh{constructor(e){super(),Up.add(this),Hp.set(this,void 0),Wp.set(this,void 0),Vp.set(this,void 0),Kp(this,Hp,e,"f")}static createResponse(e,t,n){const s=new Yp(t);return s._run(()=>s._createOrRetrieveResponse(e,t,{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}async _createOrRetrieveResponse(e,t,n){const s=n?.signal;let r;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort())),Xp(this,Up,"m",Qp).call(this);let o=null;"response_id"in t?(r=await e.responses.retrieve(t.response_id,{stream:!0},{...n,signal:this.controller.signal,stream:!0}),o=t.starting_after??null):r=await e.responses.create({...t,stream:!0},{...n,signal:this.controller.signal}),this._connected();for await(const i of r)Xp(this,Up,"m",Jp).call(this,i,o);if(r.controller.signal?.aborted)throw new Mc;return Xp(this,Up,"m",Zp).call(this)}[(Hp=new WeakMap,Wp=new WeakMap,Vp=new WeakMap,Up=new WeakSet,Qp=function(){this.ended||Kp(this,Wp,void 0,"f")},Jp=function(e,t){if(this.ended)return;const n=(e,n)=>{(null==t||n.sequence_number>t)&&this._emit(e,n)},s=Xp(this,Up,"m",Gp).call(this,e);switch(n("event",e),e.type){case"response.output_text.delta":{const t=s.output[e.output_index];if(!t)throw new Rc(`missing output at index ${e.output_index}`);if("message"===t.type){const s=t.content[e.content_index];if(!s)throw new Rc(`missing content at index ${e.content_index}`);if("output_text"!==s.type)throw new Rc(`expected content to be 'output_text', got ${s.type}`);n("response.output_text.delta",{...e,snapshot:s.text})}break}case"response.function_call_arguments.delta":{const t=s.output[e.output_index];if(!t)throw new Rc(`missing output at index ${e.output_index}`);"function_call"===t.type&&n("response.function_call_arguments.delta",{...e,snapshot:t.arguments});break}default:n(e.type,e)}},Zp=function(){if(this.ended)throw new Rc("stream has ended, this shouldn't happen");const e=Xp(this,Wp,"f");if(!e)throw new Rc("request ended without sending any events");Kp(this,Wp,void 0,"f");const t=function(e,t){return $p(e,t)}(e,Xp(this,Hp,"f"));return Kp(this,Vp,t,"f"),t},Gp=function(e){let t=Xp(this,Wp,"f");if(!t){if("response.created"!==e.type)throw new Rc(`When snapshot hasn't been set yet, expected 'response.created' event, got ${e.type}`);return t=Kp(this,Wp,e.response,"f"),t}switch(e.type){case"response.output_item.added":t.output.push(e.item);break;case"response.content_part.added":{const n=t.output[e.output_index];if(!n)throw new Rc(`missing output at index ${e.output_index}`);"message"===n.type&&n.content.push(e.part);break}case"response.output_text.delta":{const n=t.output[e.output_index];if(!n)throw new Rc(`missing output at index ${e.output_index}`);if("message"===n.type){const t=n.content[e.content_index];if(!t)throw new Rc(`missing content at index ${e.content_index}`);if("output_text"!==t.type)throw new Rc(`expected content to be 'output_text', got ${t.type}`);t.text+=e.delta}break}case"response.function_call_arguments.delta":{const n=t.output[e.output_index];if(!n)throw new Rc(`missing output at index ${e.output_index}`);"function_call"===n.type&&(n.arguments+=e.delta);break}case"response.completed":Kp(this,Wp,e.response,"f")}return t},Symbol.asyncIterator)](){const e=[],t=[];let n=!1;return this.on("event",n=>{const s=t.shift();s?s.resolve(n):e.push(n)}),this.on("end",()=>{n=!0;for(const e of t)e.resolve(void 0);t.length=0}),this.on("abort",e=>{n=!0;for(const n of t)n.reject(e);t.length=0}),this.on("error",e=>{n=!0;for(const n of t)n.reject(e);t.length=0}),{next:async()=>{if(!e.length)return n?{value:void 0,done:!0}:new Promise((e,n)=>t.push({resolve:e,reject:n})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0});return{value:e.shift(),done:!1}},return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();const e=Xp(this,Vp,"f");if(!e)throw new Rc("stream ended without producing a ChatCompletion");return e}}class ef extends Hu{constructor(){super(...arguments),this.inputItems=new jp(this._client)}create(e,t){return this._client.post("/responses",{body:e,...t,stream:e.stream??!1})._thenUnwrap(e=>("object"in e&&"response"===e.object&&qp(e),e))}retrieve(e,t={},n){return this._client.get(`/responses/${e}`,{query:t,...n,stream:t?.stream??!1})}del(e,t){return this._client.delete(`/responses/${e}`,{...t,headers:{Accept:"*/*",...t?.headers}})}parse(e,t){return this._client.responses.create(e,t)._thenUnwrap(t=>Bp(t,e))}stream(e,t){return Yp.createResponse(this._client,e,t)}cancel(e,t){return this._client.post(`/responses/${e}/cancel`,{...t,headers:{Accept:"*/*",...t?.headers}})}}class tf extends Uu{}ef.InputItems=jp;class nf extends Hu{create(e,t,n){return this._client.post(`/uploads/${e}/parts`,lu({body:t,...n}))}}class sf extends Hu{constructor(){super(...arguments),this.parts=new nf(this._client)}create(e,t){return this._client.post("/uploads",{body:e,...t})}cancel(e,t){return this._client.post(`/uploads/${e}/cancel`,t)}complete(e,t,n){return this._client.post(`/uploads/${e}/complete`,{body:t,...n})}}sf.Parts=nf;class rf extends Hu{create(e,t,n){return this._client.post(`/vector_stores/${e}/files`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}retrieve(e,t,n){return this._client.get(`/vector_stores/${e}/files/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}update(e,t,n,s){return this._client.post(`/vector_stores/${e}/files/${t}`,{body:n,...s,headers:{"OpenAI-Beta":"assistants=v2",...s?.headers}})}list(e,t={},n){return wu(t)?this.list(e,{},t):this._client.getAPIList(`/vector_stores/${e}/files`,of,{query:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}del(e,t,n){return this._client.delete(`/vector_stores/${e}/files/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}async createAndPoll(e,t,n){const s=await this.create(e,t,n);return await this.poll(e,s.id,n)}async poll(e,t,n){const s={...n?.headers,"X-Stainless-Poll-Helper":"true"};for(n?.pollIntervalMs&&(s["X-Stainless-Custom-Poll-Interval"]=n.pollIntervalMs.toString());;){const r=await this.retrieve(e,t,{...n,headers:s}).withResponse(),o=r.data;switch(o.status){case"in_progress":let e=5e3;if(n?.pollIntervalMs)e=n.pollIntervalMs;else{const t=r.response.headers.get("openai-poll-after-ms");if(t){const n=parseInt(t);isNaN(n)||(e=n)}}await Iu(e);break;case"failed":case"completed":return o}}}async upload(e,t,n){const s=await this._client.files.create({file:t,purpose:"assistants"},n);return this.create(e,{file_id:s.id},n)}async uploadAndPoll(e,t,n){const s=await this.upload(e,t,n);return await this.poll(e,s.id,n)}content(e,t,n){return this._client.getAPIList(`/vector_stores/${e}/files/${t}/content`,af,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}}class of extends Uu{}class af extends ju{}rf.VectorStoreFilesPage=of,rf.FileContentResponsesPage=af;class lf extends Hu{create(e,t,n){return this._client.post(`/vector_stores/${e}/file_batches`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}retrieve(e,t,n){return this._client.get(`/vector_stores/${e}/file_batches/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}cancel(e,t,n){return this._client.post(`/vector_stores/${e}/file_batches/${t}/cancel`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}async createAndPoll(e,t,n){const s=await this.create(e,t);return await this.poll(e,s.id,n)}listFiles(e,t,n={},s){return wu(n)?this.listFiles(e,t,{},n):this._client.getAPIList(`/vector_stores/${e}/file_batches/${t}/files`,of,{query:n,...s,headers:{"OpenAI-Beta":"assistants=v2",...s?.headers}})}async poll(e,t,n){const s={...n?.headers,"X-Stainless-Poll-Helper":"true"};for(n?.pollIntervalMs&&(s["X-Stainless-Custom-Poll-Interval"]=n.pollIntervalMs.toString());;){const{data:r,response:o}=await this.retrieve(e,t,{...n,headers:s}).withResponse();switch(r.status){case"in_progress":let e=5e3;if(n?.pollIntervalMs)e=n.pollIntervalMs;else{const t=o.headers.get("openai-poll-after-ms");if(t){const n=parseInt(t);isNaN(n)||(e=n)}}await Iu(e);break;case"failed":case"cancelled":case"completed":return r}}}async uploadAndPoll(e,{files:t,fileIds:n=[]},s){if(null==t||0==t.length)throw new Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");const r=s?.maxConcurrency??5,o=Math.min(r,t.length),i=this._client,a=t.values(),l=[...n];const c=Array(o).fill(a).map(async function(e){for(let t of e){const e=await i.files.create({file:t,purpose:"assistants"},s);l.push(e.id)}});return await(async e=>{const t=await Promise.allSettled(e),n=t.filter(e=>"rejected"===e.status);if(n.length){for(const e of n)console.error(e.reason);throw new Error(`${n.length} promise(s) failed - see the above errors`)}const s=[];for(const r of t)"fulfilled"===r.status&&s.push(r.value);return s})(c),await this.createAndPoll(e,{file_ids:l})}}class cf extends Hu{constructor(){super(...arguments),this.files=new rf(this._client),this.fileBatches=new lf(this._client)}create(e,t){return this._client.post("/vector_stores",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}retrieve(e,t){return this._client.get(`/vector_stores/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}update(e,t,n){return this._client.post(`/vector_stores/${e}`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}list(e={},t){return wu(e)?this.list({},e):this._client.getAPIList("/vector_stores",uf,{query:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}del(e,t){return this._client.delete(`/vector_stores/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}search(e,t,n){return this._client.getAPIList(`/vector_stores/${e}/search`,hf,{body:t,method:"post",...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}}class uf extends Uu{}class hf extends ju{}var df;cf.VectorStoresPage=uf,cf.VectorStoreSearchResponsesPage=hf,cf.Files=rf,cf.VectorStoreFilesPage=of,cf.FileContentResponsesPage=af,cf.FileBatches=lf;class pf extends gu{constructor({baseURL:e=Mu("OPENAI_BASE_URL"),apiKey:t=Mu("OPENAI_API_KEY"),organization:n=Mu("OPENAI_ORG_ID")??null,project:s=Mu("OPENAI_PROJECT_ID")??null,...r}={}){if(void 0===t)throw new Rc("The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' }).");const o={apiKey:t,organization:n,project:s,...r,baseURL:e||"https://api.openai.com/v1"};if(!o.dangerouslyAllowBrowser&&"undefined"!=typeof window&&void 0!==window.document&&"undefined"!=typeof navigator)throw new Rc("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew OpenAI({ apiKey, dangerouslyAllowBrowser: true });\n\nhttps://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety\n");super({baseURL:o.baseURL,timeout:o.timeout??6e5,httpAgent:o.httpAgent,maxRetries:o.maxRetries,fetch:o.fetch}),this.completions=new rp(this),this.chat=new Zu(this),this.embeddings=new up(this),this.files=new yp(this),this.images=new Mp(this),this.audio=new Yu(this),this.moderations=new Lp(this),this.models=new Op(this),this.fineTuning=new Ip(this),this.graders=new Tp(this),this.vectorStores=new cf(this),this.beta=new sp(this),this.batches=new eh(this),this.uploads=new sf(this),this.responses=new ef(this),this.evals=new mp(this),this.containers=new lp(this),this._options=o,this.apiKey=t,this.organization=n,this.project=s}defaultQuery(){return this._options.defaultQuery}defaultHeaders(e){return{...super.defaultHeaders(e),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project,...this._options.defaultHeaders}}authHeaders(e){return{Authorization:`Bearer ${this.apiKey}`}}stringifyQuery(e){return yc(e,{arrayFormat:"brackets"})}}df=pf,pf.OpenAI=df,pf.DEFAULT_TIMEOUT=6e5,pf.OpenAIError=Rc,pf.APIError=Tc,pf.APIConnectionError=Oc,pf.APIConnectionTimeoutError=Pc,pf.APIUserAbortError=Mc,pf.NotFoundError=zc,pf.ConflictError=Nc,pf.RateLimitError=jc,pf.BadRequestError=Lc,pf.AuthenticationError=$c,pf.InternalServerError=Uc,pf.PermissionDeniedError=Bc,pf.UnprocessableEntityError=qc,pf.toFile=ru,pf.fileFromPath=Ec,pf.Completions=rp,pf.Chat=Zu,pf.ChatCompletionsPage=Qu,pf.Embeddings=up,pf.Files=yp,pf.FileObjectsPage=_p,pf.Images=Mp,pf.Audio=Yu,pf.Moderations=Lp,pf.Models=Op,pf.ModelsPage=Pp,pf.FineTuning=Ip,pf.Graders=Tp,pf.VectorStores=cf,pf.VectorStoresPage=uf,pf.VectorStoreSearchResponsesPage=hf,pf.Beta=sp,pf.Batches=eh,pf.BatchesPage=th,pf.Uploads=sf,pf.Responses=ef,pf.Evals=mp,pf.EvalListResponsesPage=gp,pf.Containers=lp,pf.ContainerListResponsesPage=cp;class ff{client;config;constructor(e){this.config={timeout:3e4,maxRetries:3,enableStreaming:!0,...e},this.client=new pf({apiKey:this.config.apiKey,baseURL:this.config.baseUrl,organization:this.config.organization,timeout:this.config.timeout,maxRetries:this.config.maxRetries,dangerouslyAllowBrowser:!0})}async*chatCompletionStream(e){try{const t=await this.client.chat.completions.create({model:e.model||"gpt-3.5-turbo",messages:e.messages,temperature:e.temperature||.7,max_tokens:e.maxTokens||1e3,stream:!0});for await(const e of t)yield{id:e.id,object:e.object,created:e.created,model:e.model,choices:e.choices.map(e=>({index:e.index,delta:{role:e.delta.role,content:e.delta.content||void 0},finishReason:e.finish_reason||void 0}))}}catch(t){throw this.handleError(t)}}destroy(){this.client=null}getConfig(){return{...this.config}}async listModels(){try{return(await this.client.models.list()).data}catch(e){throw this.handleError(e)}}async testConnection(){try{return await this.client.models.list(),!0}catch(e){return console.warn("OpenAI API connection test failed:",e),!1}}updateConfig(e){this.config={...this.config,...e},this.client=new pf({apiKey:this.config.apiKey,baseURL:this.config.baseUrl,organization:this.config.organization,timeout:this.config.timeout,maxRetries:this.config.maxRetries,dangerouslyAllowBrowser:!0})}handleError(e){let t="未知错误",n="UNKNOWN_ERROR";e instanceof Error?(t=e.message,e.message.includes("401")?(t="API密钥无效或已过期",n="INVALID_API_KEY"):e.message.includes("429")?(t="请求频率过高,请稍后重试",n="RATE_LIMIT_EXCEEDED"):e.message.includes("500")?(t="OpenAI服务器错误,请稍后重试",n="SERVER_ERROR"):e.message.includes("timeout")?(t="请求超时,请检查网络连接",n="TIMEOUT_ERROR"):e.message.includes("network")&&(t="网络连接错误,请检查网络设置",n="NETWORK_ERROR")):"string"==typeof e?t=e:e?.message&&(t=e.message);const s=new Error(t);return s.code=n,s.originalError=e,s}}function mf(e){return new ff(e)}function gf(e){try{return new URL(e),!0}catch{return!1}}const yf={light:{mode:"light",primaryColor:"#3b82f6",backgroundColor:"#ffffff",textColor:"#1f2937",borderRadius:"0.5rem",shadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1)"},dark:{mode:"dark",primaryColor:"#60a5fa",backgroundColor:"#1f2937",textColor:"#f9fafb",borderRadius:"0.5rem",shadow:"0 10px 15px -3px rgba(0, 0, 0, 0.3)"},blue:{mode:"light",primaryColor:"#2563eb",backgroundColor:"#ffffff",textColor:"#1e40af",borderRadius:"0.75rem",shadow:"0 20px 25px -5px rgba(37, 99, 235, 0.1)"},green:{mode:"light",primaryColor:"#059669",backgroundColor:"#ffffff",textColor:"#065f46",borderRadius:"0.5rem",shadow:"0 10px 15px -3px rgba(5, 150, 105, 0.1)"},purple:{mode:"light",primaryColor:"#7c3aed",backgroundColor:"#ffffff",textColor:"#5b21b6",borderRadius:"1rem",shadow:"0 20px 25px -5px rgba(124, 58, 237, 0.1)"}};class _f{currentTheme=gt(yf.light);themeMode=gt("light");customThemes=gt({});styleElement=null;constructor(e){this.initializeTheme(e),this.setupThemeWatcher(),this.createStyleElement(),this.applyTheme()}initializeTheme(e){e&&(this.currentTheme.value={...yf.light,...e});const t=this.loadThemeFromStorage();t&&(this.currentTheme.value={...this.currentTheme.value,...t}),"auto"===this.currentTheme.value.mode?this.themeMode.value=this.getSystemTheme():this.themeMode.value=this.currentTheme.value.mode}setupThemeWatcher(){if(jn(this.currentTheme,()=>{this.applyTheme(),this.saveThemeToStorage()},{deep:!0}),"undefined"!=typeof window){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{"auto"===this.currentTheme.value.mode&&(this.themeMode.value=this.getSystemTheme(),this.applyTheme())})}}createStyleElement(){"undefined"!=typeof document&&(this.styleElement=document.createElement("style"),this.styleElement.id="langchat-theme-styles",document.head.appendChild(this.styleElement))}applyTheme(){if(!this.styleElement)return;const e=this.currentTheme.value,t=this.generateCSSVariables(e),n=e.customCSS||"";this.styleElement.textContent=`\n :root {\n ${t}\n }\n \n .langchat-widget {\n ${n}\n }\n \n /* 主题特定的样式 */\n .langchat-widget[data-theme="light"] {\n --background: 0 0% 100%;\n --foreground: 222.2 84% 4.9%;\n --card: 0 0% 100%;\n --card-foreground: 222.2 84% 4.9%;\n --popover: 0 0% 100%;\n --popover-foreground: 222.2 84% 4.9%;\n --primary: 222.2 47.4% 11.2%;\n --primary-foreground: 210 40% 98%;\n --secondary: 210 40% 96%;\n --secondary-foreground: 222.2 47.4% 11.2%;\n --muted: 210 40% 96%;\n --muted-foreground: 215.4 16.3% 46.9%;\n --accent: 210 40% 96%;\n --accent-foreground: 222.2 47.4% 11.2%;\n --destructive: 0 84.2% 60.2%;\n --destructive-foreground: 210 40% 98%;\n --border: 214.3 31.8% 91.4%;\n --input: 214.3 31.8% 91.4%;\n --ring: 222.2 84% 4.9%;\n --radius: 0.5rem;\n }\n \n .langchat-widget[data-theme="dark"] {\n --background: 222.2 84% 4.9%;\n --foreground: 210 40% 98%;\n --card: 222.2 84% 4.9%;\n --card-foreground: 210 40% 98%;\n --popover: 222.2 84% 4.9%;\n --popover-foreground: 210 40% 98%;\n --primary: 210 40% 98%;\n --primary-foreground: 222.2 47.4% 11.2%;\n --secondary: 217.2 32.6% 17.5%;\n --secondary-foreground: 210 40% 98%;\n --muted: 217.2 32.6% 17.5%;\n --muted-foreground: 215 20.2% 65.1%;\n --accent: 217.2 32.6% 17.5%;\n --accent-foreground: 210 40% 98%;\n --destructive: 0 62.8% 30.6%;\n --destructive-foreground: 210 40% 98%;\n --border: 217.2 32.6% 17.5%;\n --input: 217.2 32.6% 17.5%;\n --ring: 212.7 26.8% 83.9%;\n }\n `}generateCSSVariables(e){return`\n --langchat-primary-color: ${e.primaryColor};\n --langchat-background-color: ${e.backgroundColor};\n --langchat-text-color: ${e.textColor};\n --langchat-border-radius: ${e.borderRadius};\n --langchat-shadow: ${e.shadow};\n `}getSystemTheme(){return"undefined"!=typeof window&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}loadThemeFromStorage(){try{const e=localStorage.getItem("langchat-theme");return e?JSON.parse(e):null}catch{return null}}saveThemeToStorage(){try{localStorage.setItem("langchat-theme",JSON.stringify(this.currentTheme.value))}catch{}}getCurrentTheme(){return{...this.currentTheme.value}}setTheme(e){this.currentTheme.value={...this.currentTheme.value,...e}}setThemeMode(e){this.currentTheme.value.mode=e,this.themeMode.value="auto"===e?this.getSystemTheme():e}applyPresetTheme(e){const t=yf[e];t&&(this.currentTheme.value={...t})}addCustomTheme(e,t){this.customThemes.value[e]={...t}}getCustomTheme(e){return this.customThemes.value[e]||null}getAvailableThemes(){return[...Object.keys(yf),...Object.keys(this.customThemes.value)]}getThemeMode(){return this.themeMode.value}isDarkMode(){return"dark"===this.themeMode.value}getCSSVariables(){const e=this.currentTheme.value;return{"--langchat-primary-color":e.primaryColor,"--langchat-background-color":e.backgroundColor,"--langchat-text-color":e.textColor,"--langchat-border-radius":e.borderRadius,"--langchat-shadow":e.shadow}}exportTheme(){return JSON.stringify(this.currentTheme.value,null,2)}importTheme(e){try{const t=JSON.parse(e);return this.setTheme(t),!0}catch{return!1}}resetToDefault(){this.currentTheme.value={...yf.light}}destroy(){this.styleElement&&this.styleElement.parentNode&&this.styleElement.parentNode.removeChild(this.styleElement),this.styleElement=null}}const bf=new _f;class vf{_isLoading=gt(!1);_isOpen=gt(!1);app;config;container=null;eventListeners=new Map;isInitialized=gt(!1);messages=gt([]);openaiClient=null;streamingMessageId=null;suggestedQuestions=gt([]);welcomeData=gt({title:"欢迎使用 LangChat!",subtitle:"开始您的对话吧",icon:"👋"});constructor(e){this.config=this.mergeConfig(e),this.validateConfig(),this.initializeThemeManager(),this.initializeOpenAIClient(),this.initializeWelcomeAndQuestions(),this.init()}clearHistory(){this.messages.value=[],localStorage.removeItem("langchat-history")}close(){this.isInitialized.value&&(this._isOpen.value=!1,this.emit("close"),this.config.onClose?.())}destroy(){if(this.isInitialized.value)try{this.close(),this.streamingMessageId&&this.stopStreaming(this.streamingMessageId),bf.destroy(),this.app&&(this.app.unmount(),this.app=null),this.container&&this.container.parentNode&&(this.container.remove(),this.container=null),this.openaiClient&&(this.openaiClient.destroy(),this.openaiClient=null),this.eventListeners.clear(),this.isInitialized.value=!1,this._isOpen.value=!1,this._isLoading.value=!1,this.messages.value=[],this.streamingMessageId=null}catch(e){console.error("Failed to destroy LangChatBot:",e)}}getConfig(){return{...this.config}}getHistory(){return[...this.messages.value]}async getSuggestedQuestions(e){try{if(this.config.questions&&this.config.questions.length>0)return this.suggestedQuestions.value=this.config.questions,this.emit("questions-updated",this.config.questions),Ao.setQuestions(this.config.questions),this.config.questions;if(this.config.backendAPI?.getSuggestedQuestions){const t=await this.config.backendAPI.getSuggestedQuestions(e||"");return this.suggestedQuestions.value=t,this.emit("questions-updated",t),Ao.setQuestions(t),t}return[]}catch(t){return console.warn("Failed to get suggested questions:",t),[]}}init(){if(this.isInitialized.value)console.warn("LangChatBot already initialized");else try{this.createContainer(),this.createVueApp(),this.isInitialized.value=!0,this.config.autoOpen&&this.open(),this.emit("init")}catch(e){console.error("Failed to initialize LangChatBot:",e),this.config.onError?.(e)}}isLoading(){return this._isLoading.value}isOpen(){return this._isOpen.value}off(e,t){const n=this.eventListeners.get(e);n&&n.delete(t)}on(e,t){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(t)}open(){this.isInitialized.value?(this._isOpen.value=!0,this.emit("open"),this.config.onOpen?.()):console.warn("LangChatBot not initialized")}async sendMessage(e){if(e.trim())try{const t={id:this.generateId(),type:"user",content:e.trim(),timestamp:new Date,status:"sending"};this.messages.value.push(t),this.suggestedQuestions.value=[],Ao.clearQuestions(),this.emit("message-sent",t),this.config.onMessageSent?.(t),t.status="sent",this._isLoading.value=!0;const n={id:this.generateId(),type:"ai",content:"",timestamp:new Date,status:"streaming",isStreaming:!0};this.messages.value.push(n),await this.startStreamingReply(e,n.id),this.config.enableAutoSuggestions&&this.config.backendAPI?.getSuggestedQuestions&&await this.updateSuggestedQuestions(e),this.saveToHistory()}catch(t){if(console.error("Failed to send message:",t),this.messages.value.length>0){const e=this.messages.value[this.messages.value.length-1];e&&(e.status="error",e.error=t.message)}this.emit("error",t),this.config.onError?.(t)}finally{this._isLoading.value=!1}}startStreaming(e){const t=this.messages.value.find(t=>t.id===e);t&&(t.isStreaming=!0,t.status="streaming")}stopStreaming(e){const t=this.messages.value.find(t=>t.id===e);t&&(t.isStreaming=!1,t.status="sent"),this.streamingMessageId=null}toggle(){this._isOpen.value?this.close():this.open()}updateConfig(e){this.config=this.mergeConfig(e),this.validateConfig(),this.updateOpenAIClient(),this.emit("config-updated",this.config)}createContainer(){this.container=document.createElement("div"),this.container.id="langchat-widget-container",this.container.style.cssText=`\n position: fixed;\n z-index: ${this.config.zIndex};\n `,this.updateContainerPosition(),document.body.append(this.container)}createVueApp(){this.container&&(this.app=wr({setup:()=>{const e=ot({isOpen:zs(()=>this._isOpen.value),isLoading:zs(()=>this._isLoading.value),messages:zs(()=>this.messages.value),config:zs(()=>this.config),suggestedQuestions:zs(()=>this.suggestedQuestions.value),welcomeData:zs(()=>this.welcomeData.value)}),t={close:()=>this.close(),toggle:()=>this.toggle(),sendMessage:e=>this.sendMessage(e),questionClick:e=>this.sendMessage(e.text)};return()=>Ns("div",{class:"langchat-widget"},[Ns(ec,{isOpen:e.isOpen,onClick:t.toggle,config:e.config}),e.isOpen&&Ns(Zl,{messages:e.messages,isLoading:e.isLoading,config:e.config,suggestedQuestions:e.suggestedQuestions,welcomeData:e.welcomeData,onClose:t.close,onSendMessage:t.sendMessage,onQuestionClick:t.questionClick})])}}),this.app.mount(this.container))}emit(e,t){const n=this.eventListeners.get(e);n&&n.forEach(n=>{try{n(t)}catch(s){console.error(`Error in event listener for ${e}:`,s)}})}generateId(){return Date.now().toString(36)+Math.random().toString(36).slice(2)}initializeOpenAIClient(){this.config.apiKey&&(this.openaiClient=mf({apiKey:this.config.apiKey,baseUrl:this.config.baseUrl,organization:this.config.organization,timeout:3e4,maxRetries:3,enableStreaming:!0}))}initializeThemeManager(){this.config.theme&&bf.setTheme({mode:this.config.theme.mode||"light",primaryColor:this.config.theme.primaryColor||"#3b82f6",backgroundColor:this.config.theme.backgroundColor||"#ffffff",textColor:this.config.theme.textColor||"#1f2937",borderRadius:this.config.theme.borderRadius||"0.5rem",shadow:this.config.theme.shadow||"0 10px 15px -3px rgba(0, 0, 0, 0.1)",customCSS:this.config.theme.customCSS})}async initializeWelcomeAndQuestions(){try{this.config.backendAPI?.getWelcomeMessage&&(this.welcomeData.value=await this.config.backendAPI.getWelcomeMessage()),await this.getSuggestedQuestions(),this.suggestedQuestions.value.length>0&&Ao.setQuestions(this.suggestedQuestions.value)}catch(e){console.warn("Failed to initialize welcome and questions:",e)}}mergeConfig(e){const t={...tc},n=(e,t)=>{for(const s in t)t[s]&&"object"==typeof t[s]&&!Array.isArray(t[s])?(e[s]=e[s]||{},n(e[s],t[s])):e[s]=t[s]};return n(t,e),t}saveToHistory(){if(this.config.enableHistory)try{const e=this.messages.value.slice(-this.config.maxHistoryItems);localStorage.setItem("langchat-history",JSON.stringify(e))}catch(e){console.warn("Failed to save history:",e)}}async startStreamingReply(e,t){if(!this.openaiClient)throw new Error("OpenAI client not initialized");try{this.streamingMessageId=t;const n=this.messages.value.filter(e=>"user"===e.type||"ai"===e.type).slice(-10).map(e=>({role:"user"===e.type?"user":"assistant",content:e.content}));n.push({role:"user",content:e});const s=this.openaiClient.chatCompletionStream({messages:n,model:this.config.modelName,temperature:.7,maxTokens:1e3});let r="";for await(const e of s){const n=e.choices[0]?.delta?.content;if(n){r+=n;const e=this.messages.value.find(e=>e.id===t);e&&(e.content=r,e.streamContent=r,this.emit("streaming-update",{messageId:t,content:r}),this.config.onStreamingUpdate?.(t,r))}if(e.choices[0]?.finishReason)break}const o=this.messages.value.find(e=>e.id===t);o&&(o.status="sent",o.isStreaming=!1,delete o.streamContent,this.emit("message-received",o),this.config.onMessageReceived?.(o))}catch(n){console.error("Streaming reply failed:",n);const e=this.messages.value.find(e=>e.id===t);throw e&&(e.status="error",e.isStreaming=!1,e.error=n.message),n}finally{this.streamingMessageId=null}}updateContainerPosition(){if(!this.container)return;const e=this.config.position,t=e.includes("right"),n=e.includes("bottom");this.container.style.right=t?"20px":"auto",this.container.style.left=t?"auto":"20px",this.container.style.bottom=n?"20px":"auto",this.container.style.top=n?"auto":"20px"}updateOpenAIClient(){this.openaiClient&&this.config.apiKey?this.openaiClient.updateConfig({apiKey:this.config.apiKey,baseUrl:this.config.baseUrl,organization:this.config.organization}):this.config.apiKey&&this.initializeOpenAIClient()}async updateSuggestedQuestions(e){try{await this.getSuggestedQuestions(e)}catch(t){console.warn("Failed to update suggested questions:",t)}}validateConfig(){if(!this.config.apiKey)throw new Error("API key is required");if(this.config.baseUrl&&!gf(this.config.baseUrl))throw new Error("Invalid base URL format");if(this.config.maxHistoryItems<1)throw new Error("maxHistoryItems must be greater than 0")}}var wf=(e=>(e.NETWORK="NETWORK",e.API="API",e.VALIDATION="VALIDATION",e.AUTHENTICATION="AUTHENTICATION",e.RATE_LIMIT="RATE_LIMIT",e.TIMEOUT="TIMEOUT",e.UNKNOWN="UNKNOWN",e))(wf||{}),xf=(e=>(e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH",e.CRITICAL="CRITICAL",e))(xf||{});const kf={enableRetry:!0,maxRetries:3,retryDelay:1e3,showTechnicalDetails:!1,logErrors:!0};class Cf{config;errorHistory=[];retryQueue=new Map;constructor(e={}){this.config={...kf,...e}}handleError(e,t){const n=this.createErrorInfo(e,t);return this.errorHistory.push(n),this.config.logErrors&&this.logError(n),this.config.onError?.(n),this.config.enableRetry&&n.retryable&&this.scheduleRetry(n),n}createErrorInfo(e,t){let n,s="UNKNOWN",r="MEDIUM",o="UNKNOWN_ERROR",i="未知错误",a="发生了一个错误,请稍后重试",l=!1;return e instanceof Error?(i=e.message,e.message.includes("network")||e.message.includes("fetch")?(s="NETWORK",r="HIGH",o="NETWORK_ERROR",a="网络连接错误,请检查网络设置",l=!0):e.message.includes("API")||e.message.includes("openai")?(s="API",r="HIGH",o="API_ERROR",a="API调用失败,请稍后重试",l=!0):e.message.includes("401")||e.message.includes("unauthorized")?(s="AUTHENTICATION",r="CRITICAL",o="AUTHENTICATION_ERROR",a="认证失败,请检查API密钥",l=!1):e.message.includes("429")||e.message.includes("rate limit")?(s="RATE_LIMIT",r="MEDIUM",o="RATE_LIMIT_ERROR",a="请求过于频繁,请稍后重试",l=!0):e.message.includes("timeout")?(s="TIMEOUT",r="MEDIUM",o="TIMEOUT_ERROR",a="请求超时,请检查网络连接",l=!0):(e.message.includes("validation")||e.message.includes("invalid"))&&(s="VALIDATION",r="LOW",o="VALIDATION_ERROR",a="输入参数无效,请检查后重试",l=!1),n=e.stack):"string"==typeof e?(i=e,a=e):e?.message&&(i=e.message,a=e.message),{type:s,severity:r,code:o,message:i,userMessage:a,technicalDetails:n,retryable:l,timestamp:new Date,context:t}}scheduleRetry(e){const t=`${e.code}_${e.timestamp.getTime()}`;this.retryQueue.has(t)||this.retryQueue.set(t,{error:e,retryCount:0});const n=this.retryQueue.get(t);if(n.retryCount<this.config.maxRetries)n.retryCount++,setTimeout(()=>{this.executeRetry(t,n)},this.config.retryDelay*Math.pow(2,n.retryCount-1));else{this.retryQueue.delete(t);const s={...e,retryCount:n.retryCount,maxRetries:this.config.maxRetries,userMessage:"重试次数已用完,请稍后手动重试"};this.errorHistory.push(s)}}executeRetry(e,t){console.log(`Retrying operation: ${t.error.code} (attempt ${t.retryCount})`),this.retryQueue.delete(e)}logError(e){const t=`[${this.getLogLevel(e.severity)}] ${e.code}: ${e.message}`;"CRITICAL"===e.severity?console.error(t,e):"HIGH"===e.severity?console.warn(t,e):console.log(t,e)}getLogLevel(e){switch(e){case"CRITICAL":return"ERROR";case"HIGH":return"WARN";case"MEDIUM":default:return"INFO";case"LOW":return"DEBUG"}}getErrorHistory(){return[...this.errorHistory]}getErrorsByType(e){return this.errorHistory.filter(t=>t.type===e)}getErrorsBySeverity(e){return this.errorHistory.filter(t=>t.severity===e)}getRetryableErrors(){return this.errorHistory.filter(e=>e.retryable)}clearErrorHistory(){this.errorHistory=[]}cleanupOldErrors(e=24){const t=new Date;t.setHours(t.getHours()-e);const n=this.errorHistory.length;return this.errorHistory=this.errorHistory.filter(e=>e.timestamp>t),n-this.errorHistory.length}getErrorStats(){return{totalErrors:this.errorHistory.length,errorsByType:Object.values(wf).reduce((e,t)=>(e[t]=this.getErrorsByType(t).length,e),{}),errorsBySeverity:Object.values(xf).reduce((e,t)=>(e[t]=this.getErrorsBySeverity(t).length,e),{}),retryableErrors:this.getRetryableErrors().length,retryQueueSize:this.retryQueue.size}}updateConfig(e){this.config={...this.config,...e}}getConfig(){return{...this.config}}destroy(){this.errorHistory=[],this.retryQueue.clear()}}const Af=new Cf;const Ef={install:e=>{e.config.globalProperties.$langchat=vf}};e.DEFAULT_CONFIG=tc,e.LangChatBot=vf,e.VuePlugin=Ef,e.createErrorHandler=function(e){return new Cf(e)},e.createMessageStore=function(e){return new Co(e)},e.createOpenAIClient=mf,e.createThemeManager=function(e){return new _f(e)},e.default=vf,e.errorHandler=Af,e.messageStore=Ao,e.themeManager=bf,e.validateApiKey=function(e){return/^sk-[a-zA-Z0-9]{32,}$/.test(e)},e.validateBaseUrl=gf,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
25
+ //# sourceMappingURL=langchat-widget.umd.js.map