lollms-webui/web/dist/assets/index-5d95834b.js

188 lines
1.8 MiB
JavaScript
Raw Normal View History

(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function b_(t,e){const n=Object.create(null),r=t.split(",");for(let s=0;s<r.length;s++)n[r[s]]=!0;return e?s=>!!n[s.toLowerCase()]:s=>!!n[s]}const Je={},Lr=[],Bt=()=>{},_C=()=>!1,pC=/^on[^a-z]/,Ti=t=>pC.test(t),S_=t=>t.startsWith("onUpdate:"),ot=Object.assign,y_=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},mC=Object.prototype.hasOwnProperty,ze=(t,e)=>mC.call(t,e),Ie=Array.isArray,Pr=t=>ss(t)==="[object Map]",rs=t=>ss(t)==="[object Set]",Zp=t=>ss(t)==="[object Date]",gC=t=>ss(t)==="[object RegExp]",Me=t=>typeof t=="function",st=t=>typeof t=="string",Fs=t=>typeof t=="symbol",je=t=>t!==null&&typeof t=="object",gS=t=>je(t)&&Me(t.then)&&Me(t.catch),fS=Object.prototype.toString,ss=t=>fS.call(t),fC=t=>ss(t).slice(8,-1),hS=t=>ss(t)==="[object Object]",v_=t=>st(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Yo=b_(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ci=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},hC=/-(\w)/g,tn=Ci(t=>t.replace(hC,(e,n)=>n?n.toUpperCase():"")),EC=/\B([A-Z])/g,fr=Ci(t=>t.replace(EC,"-$1").toLowerCase()),Ri=Ci(t=>t.charAt(0).toUpperCase()+t.slice(1)),va=Ci(t=>t?`on${Ri(t)}`:""),Us=(t,e)=>!Object.is(t,e),Fr=(t,e)=>{for(let n=0;n<t.length;n++)t[n](e)},ei=(t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})},ti=t=>{const e=parseFloat(t);return isNaN(e)?t:e},bC=t=>{const e=st(t)?Number(t):NaN;return isNaN(e)?t:e};let Xp;const Mu=()=>Xp||(Xp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ht(t){if(Ie(t)){const e={};for(let n=0;n<t.length;n++){const r=t[n],s=st(r)?TC(r):ht(r);if(s)for(const o in s)e[o]=s[o]}return e}else{if(st(t))return t;if(je(t))return t}}const SC=/;(?![^(]*\))/g,yC=/:([^]+)/,vC=/\/\*[^]*?\*\//g;function TC(t){const e={};return t.replace(vC,"").split(SC).forEach(n=>{if(n){const r=n.split(yC);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Ae(t){let e="";if(st(t))e=t;else if(Ie(t))for(let n=0;n<t.length;n++){const r=Ae(t[n]);r&&(e+=r+" ")}else if(je(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const CC="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",RC=b_(CC);function ES(t){return!!t||t===""}function xC(t,e){if(t.length!==e.length)return!1;let n=!0;for(let r=0;n&&r<t.length;r++)n=_r(t[r],e[r]);return n}function _r(t,e){if(t===e)return!0;let n=Zp(t),r=Zp(e);if(n||r)return n&&r?t.getTime()===e.getTime():!1;if(n=Fs(t),r=Fs(e),n||r)return t===e;if(n=Ie(t),r=Ie(e),n||r)return n&&r?xC(t,e):!1;if(n=je(t),r=je(e),n||r){if(!n||!r)return!1;const s=Object.keys(t).length,o=Object.keys(e).length;if(s!==o)return!1;for(const i in t){const a=t.hasOwnProperty(i),l=e.hasOwnProperty(i);if(a&&!l||!a&&l||!_r(t[i],e[i]))return!1}}return String(t)===String(e)}function T_(t,e){return t.findIndex(n=>_r(n,e))}const j=t=>st(t)?t:t==null?"":Ie(t)||je(t)&&(t.toString===fS||!Me(t.toString))?JSON.stringify(t,bS,2):String(t),bS=(t,e)=>e&&e.__v_isRef?bS(t,e.value):Pr(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[r,s])=>(n[`${r} =>`]=s,n),{})}:rs(e)?{[`Set(${e.size})`]:[...e.values()]}:je(e)&&!Ie(e)&&!hS(e)?String(e):e;let Lt;class SS{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Lt,!e&&Lt&&(this.index=(Lt.scopes||(Lt.scopes=[])).pus
2023-10-23 23:40:39 +00:00
* vuex v4.1.0
* (c) 2022 Evan You
* @license MIT
*/var XR="store";function as(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}function JR(t){return t!==null&&typeof t=="object"}function e1(t){return t&&typeof t.then=="function"}function t1(t,e){return function(){return t(e)}}function Cy(t,e,n){return e.indexOf(t)<0&&(n&&n.prepend?e.unshift(t):e.push(t)),function(){var r=e.indexOf(t);r>-1&&e.splice(r,1)}}function Ry(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;Li(t,n,[],t._modules.root,!0),z_(t,n,e)}function z_(t,e,n){var r=t._state,s=t._scope;t.getters={},t._makeLocalGettersCache=Object.create(null);var o=t._wrappedGetters,i={},a={},l=OC(!0);l.run(function(){as(o,function(u,c){i[c]=t1(u,t),a[c]=Ot(function(){return i[c]()}),Object.defineProperty(t.getters,c,{get:function(){return a[c].value},enumerable:!0})})}),t._state=eo({data:e}),t._scope=l,t.strict&&i1(t),r&&n&&t._withCommit(function(){r.data=null}),s&&s.stop()}function Li(t,e,n,r,s){var o=!n.length,i=t._modules.getNamespace(n);if(r.namespaced&&(t._modulesNamespaceMap[i],t._modulesNamespaceMap[i]=r),!o&&!s){var a=H_(e,n.slice(0,-1)),l=n[n.length-1];t._withCommit(function(){a[l]=r.state})}var u=r.context=n1(t,i,n);r.forEachMutation(function(c,_){var p=i+_;r1(t,p,c,u)}),r.forEachAction(function(c,_){var p=c.root?_:i+_,g=c.handler||c;s1(t,p,g,u)}),r.forEachGetter(function(c,_){var p=i+_;o1(t,p,c,u)}),r.forEachChild(function(c,_){Li(t,e,n.concat(_),c,s)})}function n1(t,e,n){var r=e==="",s={dispatch:r?t.dispatch:function(o,i,a){var l=ii(o,i,a),u=l.payload,c=l.options,_=l.type;return(!c||!c.root)&&(_=e+_),t.dispatch(_,u)},commit:r?t.commit:function(o,i,a){var l=ii(o,i,a),u=l.payload,c=l.options,_=l.type;(!c||!c.root)&&(_=e+_),t.commit(_,u,c)}};return Object.defineProperties(s,{getters:{get:r?function(){return t.getters}:function(){return xy(t,e)}},state:{get:function(){return H_(t.state,n)}}}),s}function xy(t,e){if(!t._makeLocalGettersCache[e]){var n={},r=e.length;Object.keys(t.getters).forEach(function(s){if(s.slice(0,r)===e){var o=s.slice(r);Object.defineProperty(n,o,{get:function(){return t.getters[s]},enumerable:!0})}}),t._makeLocalGettersCache[e]=n}return t._makeLocalGettersCache[e]}function r1(t,e,n,r){var s=t._mutations[e]||(t._mutations[e]=[]);s.push(function(i){n.call(t,r.state,i)})}function s1(t,e,n,r){var s=t._actions[e]||(t._actions[e]=[]);s.push(function(i){var a=n.call(t,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:t.getters,rootState:t.state},i);return e1(a)||(a=Promise.resolve(a)),t._devtoolHook?a.catch(function(l){throw t._devtoolHook.emit("vuex:error",l),l}):a})}function o1(t,e,n,r){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(o){return n(r.state,r.getters,o.state,o.getters)})}function i1(t){Yn(function(){return t._state.data},function(){},{deep:!0,flush:"sync"})}function H_(t,e){return e.reduce(function(n,r){return n[r]},t)}function ii(t,e,n){return JR(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}var a1="vuex bindings",Fm="vuex:mutations",Ia="vuex:actions",Or="vuex",l1=0;function c1(t,e){ZR({id:"org.vuejs.vuex",app:t,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[a1]},function(n){n.addTimelineLayer({id:Fm,label:"Vuex Mutations",color:Um}),n.addTimelineLayer({id:Ia,label:"Vuex Actions",color:Um}),n.addInspector({id:Or,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),n.on.getInspectorTree(function(r){if(r.app===t&&r.inspectorId===Or)if(r.filter){var s=[];wy(s,e._modules.root,r.filter,""),r.rootNodes=s}else r.rootNodes=[Ny(e._modules.root,"")]}),n.on.getInspectorState(function(r){if(r.app===t&&r.inspectorId===Or){var s=r.nodeId;xy(e,s),r.state=_1(m1(e._modules,s),s==="root"?e.getters:e._makeLocalGettersCache,s)}}),n.on.editInspectorState(function(r){if(r.app===t&&r.inspectorId===Or){var s=r.nodeId,o=r.path;s!=="root"&&(o=s.split("/").filter(Boolean).concat(o)),e._withCommit(function(){r.set(e._st
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||e[n]&&dx[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},zm=Symbol("internals");function bs(t){return t&&String(t).trim().toLowerCase()}function Wo(t){return t===!1||t==null?t:de.isArray(t)?t.map(Wo):String(t)}function _x(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const px=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ka(t,e,n,r,s){if(de.isFunction(r))return r.call(this,e,n);if(s&&(e=n),!!de.isString(e)){if(de.isString(r))return e.indexOf(r)!==-1;if(de.isRegExp(r))return r.test(e)}}function mx(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function gx(t,e){const n=de.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(s,o,i){return this[r].call(this,e,s,o,i)},configurable:!0})})}class Gi{constructor(e){e&&this.set(e)}set(e,n,r){const s=this;function o(a,l,u){const c=bs(l);if(!c)throw new Error("header name must be a non-empty string");const _=de.findKey(s,c);(!_||s[_]===void 0||u===!0||u===void 0&&s[_]!==!1)&&(s[_||l]=Wo(a))}const i=(a,l)=>de.forEach(a,(u,c)=>o(u,c,l));return de.isPlainObject(e)||e instanceof this.constructor?i(e,n):de.isString(e)&&(e=e.trim())&&!px(e)?i(ux(e),n):e!=null&&o(n,e,r),this}get(e,n){if(e=bs(e),e){const r=de.findKey(this,e);if(r){const s=this[r];if(!n)return s;if(n===!0)return _x(s);if(de.isFunction(n))return n.call(this,s,r);if(de.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=bs(e),e){const r=de.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||ka(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let s=!1;function o(i){if(i=bs(i),i){const a=de.findKey(r,i);a&&(!n||ka(r,r[a],a,n))&&(delete r[a],s=!0)}}return de.isArray(e)?e.forEach(o):o(e),s}clear(e){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!e||ka(this,this[o],o,e,!0))&&(delete this[o],s=!0)}return s}normalize(e){const n=this,r={};return de.forEach(this,(s,o)=>{const i=de.findKey(r,o);if(i){n[i]=Wo(s),delete n[o];return}const a=e?mx(o):String(o).trim();a!==o&&delete n[o],n[a]=Wo(s),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return de.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=e&&de.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[zm]=this[zm]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=bs(i);r[a]||(gx(s,i),r[a]=!0)}return de.isArray(e)?e.forEach(o):o(e),this}}Gi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);de.reduceDescriptors(Gi.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});de.freezeMethods(Gi);const gn=Gi;function Ma(t,e){const n=this||j_,r=e||n,s=gn.from(r.headers);let o=r.data;return de.forEach(t,function(a){o=a.call(n,o,s.normalize(),e?e.status:void 0)}),s.normalize(),o}function Ky(t){return!!(t&&t.__CANCEL__)}function ro(t,e,n){Ve.call(this,t??"canceled",Ve.ERR_CANCELED,e,n),this.name="CanceledError"}de.inherits(ro,Ve,{__CANCEL__:!0});function fx(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Ve("Request failed with status code "+n.status,[Ve.ERR_BAD_REQUEST,Ve.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const hx=Qt.isStandardBrowserEnv?function(){return{write:function(n,r,s,o,i,a){const l=[];l.push(n+"="+encodeURIComponent(r)),de.isNumber(s)&&l.push("expires="+new Date(s).toGMTString()),de.isString(o)&&l.push("path="+o),de.isString(i)&&l.push("domain="+i),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Ex(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function bx(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function Qy(t,e){return t&&!Ex(e)?bx(t,e):e}const Sx=Qt.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return e&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const a=de.isString(i)?s(i):i;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function yx(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function vx(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s=0,o=0,i;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),c=r[o];i||(i=u),n[s]=l,r[s]=u;let _=o,p=0;for(;_!==s;)p+=n[_++],_=_%t;if(s=(s+1)%t,s===o&&(o=(o+1)%t),u-i<e)return;const g=c&&u-c;return g?Math.round(p*1e3/g):void 0}}function Hm(t,e){let n=0;const r=vx(50,250);return s=>{const o=s.loaded,i=s.lengthComputable?s.total:void 0,a=o-n,l=r(a),u=o<=i;n=o;const c={loaded:o,total:i,progress:i?o/i:void 0,bytes:a,rate:l||void 0,estimated:l&&i&&u?(i-o)/l:void 0,event:s};c[e?"download":"upload"]=!0,t(c)}}const Tx=typeof XMLHttpRequest<"u",Cx=Tx&&function(t){return new Promise(function(n,r){let s=t.data;const o=gn.from(t.headers).normalize(),i=t.responseType;let a;function l(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}let u;de.isFormData(s)&&(Qt.isStandardBrowserEnv||Qt.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.getContentType(/^\s*multipart\/form-data/)?de.isString(u=o.getContentType())&&o.setContentType(u.replace(/^\s*(multipart\/form-data);+/,"$1")):o.setContentType("multipart/form-data"));let c=new XMLHttpRequest;if(t.auth){const f=t.auth.username||"",h=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(f+":"+h))}const _=Qy(t.baseURL,t.url);c.open(t.method.toUpperCase(),Hy(_,t.params,t.paramsSerializer),!0),c
`+o.map($m).join(`
`):" "+$m(o[0]):"as no adapter specified";throw new Ve("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:Xu};function La(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ro(null,t)}function Wm(t){return La(t),t.headers=gn.from(t.headers),t.data=Ma.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),jy.getAdapter(t.adapter||j_.adapter)(t).then(function(r){return La(t),r.data=Ma.call(t,t.transformResponse,r),r.headers=gn.from(r.headers),r},function(r){return Ky(r)||(La(t),r&&r.response&&(r.response.data=Ma.call(t,t.transformResponse,r.response),r.response.headers=gn.from(r.response.headers))),Promise.reject(r)})}const Km=t=>t instanceof gn?t.toJSON():t;function Kr(t,e){e=e||{};const n={};function r(u,c,_){return de.isPlainObject(u)&&de.isPlainObject(c)?de.merge.call({caseless:_},u,c):de.isPlainObject(c)?de.merge({},c):de.isArray(c)?c.slice():c}function s(u,c,_){if(de.isUndefined(c)){if(!de.isUndefined(u))return r(void 0,u,_)}else return r(u,c,_)}function o(u,c){if(!de.isUndefined(c))return r(void 0,c)}function i(u,c){if(de.isUndefined(c)){if(!de.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function a(u,c,_){if(_ in e)return r(u,c);if(_ in t)return r(void 0,u)}const l={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(u,c)=>s(Km(u),Km(c),!0)};return de.forEach(Object.keys(Object.assign({},t,e)),function(c){const _=l[c]||s,p=_(t[c],e[c],c);de.isUndefined(p)&&_!==a||(n[c]=p)}),n}const Zy="1.5.1",Z_={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Z_[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Qm={};Z_.transitional=function(e,n,r){function s(o,i){return"[Axios v"+Zy+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,a)=>{if(e===!1)throw new Ve(s(i," has been removed"+(n?" in "+n:"")),Ve.ERR_DEPRECATED);return n&&!Qm[i]&&(Qm[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,i,a):!0}};function xx(t,e,n){if(typeof t!="object")throw new Ve("options must be an object",Ve.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const o=r[s],i=e[o];if(i){const a=t[o],l=a===void 0||i(a,o,t);if(l!==!0)throw new Ve("option "+o+" must be "+l,Ve.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ve("Unknown option "+o,Ve.ERR_BAD_OPTION)}}const Ju={assertOptions:xx,validators:Z_},An=Ju.validators;class ai{constructor(e){this.defaults=e,this.interceptors={request:new Vm,response:new Vm}}request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Kr(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&Ju.assertOptions(r,{silentJSONParsing:An.transitional(An.boolean),forcedJSONParsing:An.transitional(An.boolean),clarifyTimeoutError:An.transitional(An.boolean)},!1),s!=null&&(de.isFunction(s)?n.paramsSerializer={serialize:s}:Ju.assertOptions(s,{encode:An.function,serialize:An.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&de.merge(o.common,o[n.method]);o&&de.forEach(["delete","get","head","post","put","patch","common"],f=>{delete o[f]}),n.headers=gn.concat(i,o);const a=[];let l=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(l=l&&h.synchronous,a.unshift(h.fulfilled,h.rejected))});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let c,_=0,p;if(!l){const f=[Wm.bind(this),void 0];for(f.unshift.apply(f,a),f.push.apply(f,u),p=f.length,c=Promise.resolve(n);_<p;)c=c.then(f[_++],f[_++]);return c}p=a.length;let g=n;for(_=0;_<p;
2023-10-23 23:40:39 +00:00
* vue-router v4.2.5
* (c) 2023 Eduardo San Martin Morote
* @license MIT
*/const Ir=typeof window<"u";function Ix(t){return t.__esModule||t[Symbol.toStringTag]==="Module"}const Ke=Object.assign;function Pa(t,e){const n={};for(const r in e){const s=e[r];n[r]=Gt(s)?s.map(t):t(s)}return n}const Is=()=>{},Gt=Array.isArray,Dx=/\/$/,kx=t=>t.replace(Dx,"");function Fa(t,e,n="/"){let r,s={},o="",i="";const a=e.indexOf("#");let l=e.indexOf("?");return a<l&&a>=0&&(l=-1),l>-1&&(r=e.slice(0,l),o=e.slice(l+1,a>-1?a:e.length),s=t(o)),a>-1&&(r=r||e.slice(0,a),i=e.slice(a,e.length)),r=Fx(r??e,n),{fullPath:r+(o&&"?")+o+i,path:r,query:s,hash:i}}function Mx(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function jm(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function Lx(t,e,n){const r=e.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&Qr(e.matched[r],n.matched[s])&&Jy(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function Qr(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function Jy(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(!Px(t[n],e[n]))return!1;return!0}function Px(t,e){return Gt(t)?Zm(t,e):Gt(e)?Zm(e,t):t===e}function Zm(t,e){return Gt(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):t.length===1&&t[0]===e}function Fx(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),r=t.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let o=n.length-1,i,a;for(i=0;i<r.length;i++)if(a=r[i],a!==".")if(a==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(i-(i===r.length?1:0)).join("/")}var Ws;(function(t){t.pop="pop",t.push="push"})(Ws||(Ws={}));var Ds;(function(t){t.back="back",t.forward="forward",t.unknown=""})(Ds||(Ds={}));function Ux(t){if(!t)if(Ir){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),kx(t)}const Bx=/^[^#]+#/;function Gx(t,e){return t.replace(Bx,"#")+e}function qx(t,e){const n=document.documentElement.getBoundingClientRect(),r=t.getBoundingClientRect();return{behavior:e.behavior,left:r.left-n.left-(e.left||0),top:r.top-n.top-(e.top||0)}}const qi=()=>({left:window.pageXOffset,top:window.pageYOffset});function Yx(t){let e;if("el"in t){const n=t.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;e=qx(s,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.pageXOffset,e.top!=null?e.top:window.pageYOffset)}function Xm(t,e){return(history.state?history.state.position-e:-1)+t}const t_=new Map;function Vx(t,e){t_.set(t,e)}function zx(t){const e=t_.get(t);return t_.delete(t),e}let Hx=()=>location.protocol+"//"+location.host;function ev(t,e){const{pathname:n,search:r,hash:s}=e,o=t.indexOf("#");if(o>-1){let a=s.includes(t.slice(o))?t.slice(o).length:1,l=s.slice(a);return l[0]!=="/"&&(l="/"+l),jm(l,"")}return jm(n,t)+r+s}function $x(t,e,n,r){let s=[],o=[],i=null;const a=({state:p})=>{const g=ev(t,location),f=n.value,h=e.value;let E=0;if(p){if(n.value=g,e.value=p,i&&i===f){i=null;return}E=h?p.position-h.position:0}else r(g);s.forEach(b=>{b(n.value,f,{delta:E,type:Ws.pop,direction:E?E>0?Ds.forward:Ds.back:Ds.unknown})})};function l(){i=n.value}function u(p){s.push(p);const g=()=>{const f=s.indexOf(p);f>-1&&s.splice(f,1)};return o.push(g),g}function c(){const{history:p}=window;p.state&&p.replaceState(Ke({},p.state,{scroll:qi()}),"")}function _(){for(const p of o)p();o=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",c)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",c,{passive:!0}),{pauseListeners:l,listen:u,destroy:_}}function Jm(t,e,n,r=!1,s=!1){return{back:t,current:e,forward:n,replaced:r,position:window.history.length,scroll:s?qi():null}}function Wx(t){const{history:e,location:n}=window,r={value:ev(t,n)},s={value:e.state};s.value||o(r.value,{back:null,current:r.value,forward:null,position:e.length-1,replace
2023-10-23 23:40:39 +00:00
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(){var a=function(){function l(){}l.prototype=Object.create(null);function u(b,m){for(var S=m.length,C=0;C<S;++C)h(b,m[C])}var c={}.hasOwnProperty;function _(b,m){b[m]=!0}function p(b,m){for(var S in m)c.call(m,S)&&(b[S]=!!m[S])}var g=/\s+/;function f(b,m){for(var S=m.split(g),C=S.length,A=0;A<C;++A)b[S[A]]=!0}function h(b,m){if(m){var S=typeof m;S==="string"?f(b,m):Array.isArray(m)?u(b,m):S==="object"?p(b,m):S==="number"&&_(b,m)}}function E(){for(var b=arguments.length,m=Array(b),S=0;S<b;S++)m[S]=arguments[S];var C=new l;u(C,m);var A=[];for(var x in C)C[x]&&A.push(x);return A.join(" ")}return E}();typeof n<"u"&&n.exports?n.exports=a:(o=[],i=(function(){return a}).apply(r,o),i!==void 0&&(n.exports=i))})()},"./node_modules/core-js/es/array/from.js":function(n,r,s){s("./node_modules/core-js/modules/es.string.iterator.js"),s("./node_modules/core-js/modules/es.array.from.js");var o=s("./node_modules/core-js/internals/path.js");n.exports=o.Array.from},"./node_modules/core-js/internals/a-function.js":function(n,r){n.exports=function(s){if(typeof s!="function")throw TypeError(String(s)+" is not a function");return s}},"./node_modules/core-js/internals/an-object.js":function(n,r,s){var o=s("./node_modules/core-js/internals/is-object.js");n.exports=function(i){if(!o(i))throw TypeError(String(i)+" is not an object");return i}},"./node_modules/core-js/internals/array-from.js":function(n,r,s){var o=s("./node_modules/core-js/internals/bind-context.js"),i=s("./node_modules/core-js/internals/to-object.js"),a=s("./node_modules/core-js/internals/call-with-safe-iteration-closing.js"),l=s("./node_modules/core-js/internals/is-array-iterator-method.js"),u=s("./node_modules/core-js/internals/to-length.js"),c=s("./node_modules/core-js/internals/create-property.js"),_=s("./node_modules/core-js/internals/get-iterator-method.js");n.exports=function(g){var f=i(g),h=typeof this=="function"?this:Array,E=arguments.length,b=E>1?arguments[1]:void 0,m=b!==void 0,S=0,C=_(f),A,x,k,y;if(m&&(b=o(b,E>2?arguments[2]:void 0,2)),C!=null&&!(h==Array&&l(C)))for(y=C.call(f),x=new h;!(k=y.next()).done;S++)c(x,S,m?a(y,b,[k.value,S],!0):k.value);else for(A=u(f.length),x=new h(A);A>S;S++)c(x,S,m?b(f[S],S):f[S]);return x.length=S,x}},"./node_modules/core-js/internals/array-includes.js":function(n,r,s){var o=s("./node_modules/core-js/internals/to-indexed-object.js"),i=s("./node_modules/core-js/internals/to-length.js"),a=s("./node_modules/core-js/internals/to-absolute-index.js");n.exports=function(l){return function(u,c,_){var p=o(u),g=i(p.length),f=a(_,g),h;if(l&&c!=c){for(;g>f;)if(h=p[f++],h!=h)return!0}else for(;g>f;f++)if((l||f in p)&&p[f]===c)return l||f||0;return!l&&-1}}},"./node_modules/core-js/internals/bind-context.js":function(n,r,s){var o=s("./node_modules/core-js/internals/a-function.js");n.exports=function(i,a,l){if(o(i),a===void 0)return i;switch(l){case 0:return function(){return i.call(a)};case 1:return function(u){return i.call(a,u)};case 2:return function(u,c){return i.call(a,u,c)};case 3:return function(u,c,_){return i.call(a,u,c,_)}}return function(){return i.apply(a,arguments)}}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":function(n,r,s){var o=s("./node_modules/core-js/internals/an-object.js");n.exports=function(i,a,l,u){try{return u?a(o(l)[0],l[1]):a(l)}catch(_){var c=i.return;throw c!==void 0&&o(c.call(i)),_}}},"./node_modules/core-js/internals/check-correctness-of-iteration.js":function(n,r,s){var o=s("./node_modules/core-js/internals/well-known-symbol.js"),i=o("iterator"),a=!1;try{var l=0,u={next:function(){return{done:!!l++}},return:function(){a=!0}};u[i]=function(){return this},Array.from(u,function(){throw 2})}catch{}n.exports=function(c,_){if(!_&&!a)return!1;var p=!1;try{var g={};g[i]=function(){return{next:function(){return{done:p=!0}}}},c(g)}catch{}return p}},"./node_modules/core-js/internals/classof-raw.js":function(n,r){var s={}.toString;n.exports=function(o){return s.call(o).slice(8,-1)}},"./node_modules/core-js/internals/classof.js":function(n,r,s){var o=s("./node_modules/core-js/internals/classof
h-87.51l-313.51,338.7l-253.31-338.7H283.94z M412.63,231.77h136.81l604.13,807.76h-136.81L412.63,231.77z`})],-1),eA=[JO],tA=d("i",{"data-feather":"sun"},null,-1),nA=[tA],rA=d("i",{"data-feather":"moon"},null,-1),sA=[rA],oA=d("body",null,null,-1),iA={name:"TopBar",computed:{isConnected(){return this.$store.state.isConnected}},watch:{isConnected(){ve(()=>{Ce.replace()})}},data(){return{codeBlockStylesheet:"",sunIcon:document.querySelector(".sun"),moonIcon:document.querySelector(".moon"),userTheme:localStorage.getItem("theme"),systemTheme:window.matchMedia("prefers-color-scheme: dark").matches}},mounted(){this.sunIcon=document.querySelector(".sun"),this.moonIcon=document.querySelector(".moon"),this.userTheme=localStorage.getItem("theme"),this.systemTheme=window.matchMedia("prefers-color-scheme: dark").matches,this.themeCheck(),ve(()=>{Ce.replace()})},created(){this.sunIcon=document.querySelector(".sun"),this.moonIcon=document.querySelector(".moon"),this.userTheme=localStorage.getItem("theme"),this.systemTheme=window.matchMedia("prefers-color-scheme: dark").matches},methods:{themeCheck(){if(this.userTheme=="dark"||!this.userTheme&&this.systemTheme){document.documentElement.classList.add("dark"),this.moonIcon.classList.add("display-none"),ve(()=>{Ba(()=>Promise.resolve({}),["assets/stackoverflow-dark-57af98f5.css"])});return}ve(()=>{Ba(()=>Promise.resolve({}),["assets/stackoverflow-light-077a2b3c.css"])}),this.sunIcon.classList.add("display-none")},themeSwitch(){if(document.documentElement.classList.contains("dark")){document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light"),this.userTheme=="light",this.iconToggle();return}Ba(()=>Promise.resolve({}),["assets/tokyo-night-dark-f9656fc4.css"]),document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark"),this.userTheme=="dark",this.iconToggle()},iconToggle(){this.sunIcon.classList.toggle("display-none"),this.moonIcon.classList.toggle("display-none")}},components:{Navigation:pv}},aA=Object.assign(iA,{setup(t){return(e,n)=>(v(),T(we,null,[d("header",BO,[d("nav",GO,[he(ct(_n),{to:{name:"discussions"}},{default:ke(()=>[qO]),_:1}),d("div",YO,[e.isConnected?(v(),T("div",VO,HO)):U("",!0),e.isConnected?U("",!0):(v(),T("div",$O,KO)),QO,d("a",jO,[d("div",ZO,[(v(),T("svg",XO,eA))])]),d("div",{class:"sun text-2xl w-6 hover:text-primary duration-150",title:"Swith to Light theme",onClick:n[0]||(n[0]=r=>e.themeSwitch())},nA),d("div",{class:"moon text-2xl w-6 hover:text-primary duration-150",title:"Swith to Dark theme",onClick:n[1]||(n[1]=r=>e.themeSwitch())},sA)])]),he(pv)]),oA],64))}}),lA={class:"flex flex-col h-screen font-sans bg-bg-light text-slate-950 dark:bg-bg-dark dark:text-slate-50 overflow-y-scroll w-full dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},cA={class:"flex overflow-hidden flex-grow"},dA={__name:"App",setup(t){return(e,n)=>(v(),T("div",lA,[he(aA),d("div",cA,[he(ct(dv),null,{default:ke(({Component:r})=>[(v(),rt(v0,null,[(v(),rt(D0(r)))],1024))]),_:1})])]))}},nn=Object.create(null);nn.open="0";nn.close="1";nn.ping="2";nn.pong="3";nn.message="4";nn.upgrade="5";nn.noop="6";const Qo=Object.create(null);Object.keys(nn).forEach(t=>{Qo[nn[t]]=t});const s_={type:"error",data:"parser error"},mv=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",gv=typeof ArrayBuffer=="function",fv=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,tp=({type:t,data:e},n,r)=>mv&&e instanceof Blob?n?r(e):pg(e,r):gv&&(e instanceof ArrayBuffer||fv(e))?n?r(e):pg(new Blob([e]),r):r(nn[t]+(e||"")),pg=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function mg(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Ar
`,X7="∄",J7="∄",eY="𝔑",tY="𝔫",nY="≧̸",rY="≱",sY="≱",oY="≧̸",iY="⩾̸",aY="⩾̸",lY="⋙̸",cY="≵",dY="≫⃒",uY="≯",_Y="≯",pY="≫̸",mY="↮",gY="⇎",fY="⫲",hY="∋",EY="⋼",bY="⋺",SY="∋",yY="Њ",vY="њ",TY="↚",CY="⇍",RY="‥",xY="≦̸",OY="≰",AY="↚",NY="⇍",wY="↮",IY="⇎",DY="≰",kY="≦̸",MY="⩽̸",LY="⩽̸",PY="≮",FY="⋘̸",UY="≴",BY="≪⃒",GY="≮",qY="⋪",YY="⋬",VY="≪̸",zY="∤",HY="",$Y=" ",WY="𝕟",KY="",QY="⫬",jY="¬",ZY="≢",XY="≭",JY="∦",eV="∉",tV="≠",nV="≂̸",rV="∄",sV="≯",oV="≱",iV="≧̸",aV="≫̸",lV="≹",cV="⩾̸",dV="≵",uV="≎̸",_V="≏̸",pV="∉",mV="⋵̸",gV="⋹̸",fV="∉",hV="⋷",EV="⋶",bV="⧏̸",SV="⋪",yV="⋬",vV="≮",TV="≰",CV="≸",RV="≪̸",xV="⩽̸",OV="≴",AV="⪢̸",NV="⪡̸",wV="∌",IV="∌",DV="⋾",kV="⋽",MV="⊀",LV="⪯̸",PV="⋠",FV="∌",UV="⧐̸",BV="⋫",GV="⋭",qV="⊏̸",YV="⋢",VV="⊐̸",zV="⋣",HV="⊂⃒",$V="⊈",WV="⊁",KV="⪰̸",QV="⋡",jV="≿̸",ZV="⊃⃒",XV="⊉",JV="≁",ez="≄",tz="≇",nz="≉",rz="∤",sz="∦",oz="∦",iz="⫽⃥",az="∂̸",lz="⨔",cz="⊀",dz="⋠",uz="⊀",_z="⪯̸",pz="⪯̸",mz="⤳̸",gz="↛",fz="⇏",hz="↝̸",Ez="↛",bz="⇏",Sz="⋫",yz="⋭",vz="⊁",Tz="⋡",Cz="⪰̸",Rz="𝒩",xz="𝓃",Oz="∤",Az="∦",Nz="≁",wz="≄",Iz="≄",Dz="∤",kz="∦",Mz="⋢",Lz="⋣",Pz="⊄",Fz="⫅̸",Uz="⊈",Bz="⊂⃒",Gz="⊈",qz="⫅̸",Yz="⊁",Vz="⪰̸",zz="⊅",Hz="⫆̸",$z="⊉",Wz="⊃⃒",Kz="⊉",Qz="⫆̸",jz="≹",Zz="Ñ",Xz="ñ",Jz="≸",eH="⋪",tH="⋬",nH="⋫",rH="⋭",sH="Ν",oH="ν",iH="#",aH="№",lH="",cH="≍⃒",dH="⊬",uH="⊭",_H="⊮",pH="⊯",mH="≥⃒",gH=">⃒",fH="⤄",hH="⧞",EH="⤂",bH="≤⃒",SH="<⃒",yH="⊴⃒",vH="⤃",TH="⊵⃒",CH="∼⃒",RH="⤣",xH="↖",OH="⇖",AH="↖",NH="⤧",wH="Ó",IH="ó",DH="⊛",kH="Ô",MH="ô",LH="⊚",PH="О",FH="о",UH="⊝",BH="Ő",GH="ő",qH="⨸",YH="⊙",VH="⦼",zH="Œ",HH="œ",$H="⦿",WH="𝔒",KH="𝔬",QH="˛",jH="Ò",ZH="ò",XH="⧁",JH="⦵",e$="Ω",t$="∮",n$="↺",r$="⦾",s$="⦻",o$="‾",i$="⧀",a$="Ō",l$="ō",c$="Ω",d$="ω",u$="Ο",_$="ο",p$="⦶",m$="⊖",g$="𝕆",f$="𝕠",h$="⦷",E$="“",b$="",S$="⦹",y$="⊕",v$="↻",T$="⩔",C$="",R$="⩝",x$="",O$="",A$="ª",N$="º",w$="⊶",I$="⩖",D$="⩗",k$="⩛",M$="Ⓢ",L$="𝒪",P$="",F$="Ø",U$="ø",B$="⊘",G$="Õ",q$="õ",Y$="⨶",V$="⨷",z$="⊗",H$="Ö",$$="ö",W$="⌽",K$="‾",Q$="⏞",j$="⎴",Z$="⏜",X$="¶",J$="∥",eW="∥",tW="⫳",nW="⫽",rW="∂",sW="∂",oW="П",iW="п",aW="%",lW=".",cW="‰",dW="⊥",uW="‱",_W="𝔓",pW="𝔭",mW="Φ",gW="φ",fW="ϕ",hW="",EW="☎",bW="Π",SW="π",yW="⋔",vW="ϖ",TW="ℏ",CW="",RW="ℏ",xW="⨣",OW="⊞",AW="⨢",NW="+",wW="∔",IW="⨥",DW="⩲",kW="±",MW="±",LW="⨦",PW="⨧",FW="±",UW="",BW="⨕",GW="𝕡",qW="",YW="£",VW="⪷",zW="⪻",HW="≺",$W="≼",WW="⪷",KW="≺",QW="≼",jW="≺",ZW="⪯",XW="≼",JW="≾",eK="⪯",tK="⪹",nK="⪵",rK="⋨",sK="⪯",oK="⪳",iK="≾",aK="",lK="″",cK="",dK="⪹",uK="⪵",_K="⋨",pK="∏",mK="∏",gK="⌮",fK="⌒",hK="⌓",EK="∝",bK="∝",SK="∷",yK="∝",vK="≾",TK="⊰",CK="𝒫",RK="𝓅",xK="Ψ",OK="ψ",AK="",NK="𝔔",wK="𝔮",IK="⨌",DK="𝕢",kK="",MK="⁗",LK="𝒬",PK="𝓆",FK="",UK="⨖",BK="?",GK="≟",qK='"',YK='"',VK="⇛",zK="∽̱",HK="Ŕ",$K="ŕ",WK="√",KK="⦳",QK="⟩",jK="⟫",ZK="⦒",XK="⦥",JK="⟩",eQ="»",tQ="⥵",nQ="⇥",rQ="⤠",sQ="⤳",oQ="→",iQ="↠",aQ="⇒",lQ="⤞",cQ="↪",dQ="↬",uQ="⥅",_Q="⥴",pQ="⤖",mQ="↣",gQ="↝",fQ="⤚",hQ="⤜",EQ="",bQ="",SQ="⤍",yQ="⤏",vQ="⤐",TQ="",CQ="}",RQ="]",xQ="⦌",OQ="⦎",AQ="⦐",NQ="Ř",wQ="ř",IQ="Ŗ",DQ="ŗ",kQ="⌉",MQ="}",LQ="Р",PQ="р",FQ="⤷",UQ="⥩",BQ="”",GQ="”",qQ="↳",YQ="",VQ="",zQ="",HQ="",$Q="",WQ="▭",KQ="®",QQ="®",jQ="∋",ZQ="⇋",XQ="⥯",JQ="⥽",ej="⌋",tj="𝔯",nj="",rj="⥤",sj="⇁",oj="⇀",ij="⥬",aj="Ρ",lj="ρ",cj="ϱ",dj="⟩",uj="⇥",_j="→",pj="→
`," "],Zie=["{","}","|","\\","^","`"].concat(jie),Xie=["'"].concat(Zie),Rg=["%","/","?",";","#"].concat(Xie),xg=["/","?","#"],Jie=255,Og=/^[+a-z0-9A-Z_-]{0,63}$/,eae=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Ag={javascript:!0,"javascript:":!0},Ng={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function tae(t,e){if(t&&t instanceof ci)return t;var n=new ci;return n.parse(t,e),n}ci.prototype.parse=function(t,e){var n,r,s,o,i,a=t;if(a=a.trim(),!e&&t.split("#").length===1){var l=Qie.exec(a);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}var u=Wie.exec(a);if(u&&(u=u[0],s=u.toLowerCase(),this.protocol=u,a=a.substr(u.length)),(e||u||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)==="//",i&&!(u&&Ag[u])&&(a=a.substr(2),this.slashes=!0)),!Ag[u]&&(i||u&&!Ng[u])){var c=-1;for(n=0;n<xg.length;n++)o=a.indexOf(xg[n]),o!==-1&&(c===-1||o<c)&&(c=o);var _,p;for(c===-1?p=a.lastIndexOf("@"):p=a.lastIndexOf("@",c),p!==-1&&(_=a.slice(0,p),a=a.slice(p+1),this.auth=_),c=-1,n=0;n<Rg.length;n++)o=a.indexOf(Rg[n]),o!==-1&&(c===-1||o<c)&&(c=o);c===-1&&(c=a.length),a[c-1]===":"&&c--;var g=a.slice(0,c);a=a.slice(c),this.parseHost(g),this.hostname=this.hostname||"";var f=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!f){var h=this.hostname.split(/\./);for(n=0,r=h.length;n<r;n++){var E=h[n];if(E&&!E.match(Og)){for(var b="",m=0,S=E.length;m<S;m++)E.charCodeAt(m)>127?b+="x":b+=E[m];if(!b.match(Og)){var C=h.slice(0,n),A=h.slice(n+1),x=E.match(eae);x&&(C.push(x[1]),A.unshift(x[2])),A.length&&(a=A.join(".")+a),this.hostname=C.join(".");break}}}}this.hostname.length>Jie&&(this.hostname=""),f&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var k=a.indexOf("#");k!==-1&&(this.hash=a.substr(k),a=a.slice(0,k));var y=a.indexOf("?");return y!==-1&&(this.search=a.substr(y),a=a.slice(0,y)),a&&(this.pathname=a),Ng[s]&&this.hostname&&!this.pathname&&(this.pathname=""),this};ci.prototype.parseHost=function(t){var e=Kie.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var nae=tae;us.encode=Vie;us.decode=Hie;us.format=$ie;us.parse=nae;var er={},Ya,wg;function Nv(){return wg||(wg=1,Ya=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),Ya}var Va,Ig;function wv(){return Ig||(Ig=1,Va=/[\0-\x1F\x7F-\x9F]/),Va}var za,Dg;function rae(){return Dg||(Dg=1,za=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/),za}var Ha,kg;function Iv(){return kg||(kg=1,Ha=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),Ha}var Mg;function sae(){return Mg||(Mg=1,er.Any=Nv(),er.Cc=wv(),er.Cf=rae(),er.P=ap,er.Z=Iv()),er}(function(t){function e(B){return Object.prototype.toString.call(B)}function n(B){return e(B)==="[object String]"}var r=Object.prototype.hasOwnProperty;function s(B,se){return r.call(B,se)}function o(B){var se=Array.prototype.slice.call(arguments,1);return se.forEach(function(H){if(H){if(typeof H!="object")throw new TypeError(H+"must be object");Object.keys(H).forEach(function(I){B[I]=H[I]})}}),B}function i(B,se,H){return[].concat(B.slice(0,se),H,B.slice(se+1))}function a(B){return!(B>=55296&&B<=57343||B>=64976&&B<=65007||(B&65535)===65535||(B&65535)===65534||B>=0&&B<=8||B===11||B>=14&&B<=31||B>=127&&B<=159||B>1114111)}function l(B){if(B>65535){B-=65536;var se=55296+(B>>10),H=56320+(B&1023);return String.fromCharCode(se,H)}return String.fromCharCode(B)}var u=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=/&([a-z#][a-z0-9]{1,31});/gi,_=new RegExp(u.source+"|"+c.source,"gi"),p=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i,g=Av;function f(B,se){var H;return s(g,se)?g[se]:se.charCodeAt(0)===35&&p.test(se)&&(H=se[1].toLowerCase()==="x"?parseInt(se.slice(2),16):parseInt(se.slice(1),10),a(H))?l(H):B}function h(B){return B.indexOf("\\")<0?B:B.replace(u,"$1")}function E(B){return B.indexOf("\\")
`};on.fence=function(t,e,n,r,s){var o=t[e],i=o.info?dae(o.info).trim():"",a="",l="",u,c,_,p,g;return i&&(_=i.split(/(\s+)/g),a=_[0],l=_.slice(2).join("")),n.highlight?u=n.highlight(o.content,a,l)||pr(o.content):u=pr(o.content),u.indexOf("<pre")===0?u+`
2023-10-23 23:40:39 +00:00
`:i?(c=o.attrIndex("class"),p=o.attrs?o.attrs.slice():[],c<0?p.push(["class",n.langPrefix+a]):(p[c]=p[c].slice(),p[c][1]+=" "+n.langPrefix+a),g={attrs:p},"<pre><code"+s.renderAttrs(g)+">"+u+`</code></pre>
`):"<pre><code"+s.renderAttrs(o)+">"+u+`</code></pre>
`};on.image=function(t,e,n,r,s){var o=t[e];return o.attrs[o.attrIndex("alt")][1]=s.renderInlineAsText(o.children,n,r),s.renderToken(t,e,n)};on.hardbreak=function(t,e,n){return n.xhtmlOut?`<br />
`:`<br>
`};on.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`<br />
`:`<br>
`:`
`};on.text=function(t,e){return pr(t[e].content)};on.html_block=function(t,e){return t[e].content};on.html_inline=function(t,e){return t[e].content};function _s(){this.rules=cae({},on)}_s.prototype.renderAttrs=function(e){var n,r,s;if(!e.attrs)return"";for(s="",n=0,r=e.attrs.length;n<r;n++)s+=" "+pr(e.attrs[n][0])+'="'+pr(e.attrs[n][1])+'"';return s};_s.prototype.renderToken=function(e,n,r){var s,o="",i=!1,a=e[n];return a.hidden?"":(a.block&&a.nesting!==-1&&n&&e[n-1].hidden&&(o+=`
2023-10-23 23:40:39 +00:00
`),o+=(a.nesting===-1?"</":"<")+a.tag,o+=this.renderAttrs(a),a.nesting===0&&r.xhtmlOut&&(o+=" /"),a.block&&(i=!0,a.nesting===1&&n+1<e.length&&(s=e[n+1],(s.type==="inline"||s.hidden||s.nesting===-1&&s.tag===a.tag)&&(i=!1))),o+=i?`>
`:">",o)};_s.prototype.renderInline=function(t,e,n){for(var r,s="",o=this.rules,i=0,a=t.length;i<a;i++)r=t[i].type,typeof o[r]<"u"?s+=o[r](t,i,e,n,this):s+=this.renderToken(t,i,e);return s};_s.prototype.renderInlineAsText=function(t,e,n){for(var r="",s=0,o=t.length;s<o;s++)t[s].type==="text"?r+=t[s].content:t[s].type==="image"?r+=this.renderInlineAsText(t[s].children,e,n):t[s].type==="softbreak"&&(r+=`
`);return r};_s.prototype.render=function(t,e,n){var r,s,o,i="",a=this.rules;for(r=0,s=t.length;r<s;r++)o=t[r].type,o==="inline"?i+=this.renderInline(t[r].children,e,n):typeof a[o]<"u"?i+=a[o](t,r,e,n,this):i+=this.renderToken(t,r,e,n);return i};var uae=_s;function Yt(){this.__rules__=[],this.__cache__=null}Yt.prototype.__find__=function(t){for(var e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1};Yt.prototype.__compile__=function(){var t=this,e=[""];t.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){e.indexOf(r)<0&&e.push(r)})}),t.__cache__={},e.forEach(function(n){t.__cache__[n]=[],t.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||t.__cache__[n].push(r.fn))})})};Yt.prototype.at=function(t,e,n){var r=this.__find__(t),s=n||{};if(r===-1)throw new Error("Parser rule not found: "+t);this.__rules__[r].fn=e,this.__rules__[r].alt=s.alt||[],this.__cache__=null};Yt.prototype.before=function(t,e,n,r){var s=this.__find__(t),o=r||{};if(s===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(s,0,{name:e,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null};Yt.prototype.after=function(t,e,n,r){var s=this.__find__(t),o=r||{};if(s===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(s+1,0,{name:e,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null};Yt.prototype.push=function(t,e,n){var r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null};Yt.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach(function(r){var s=this.__find__(r);if(s<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[s].enabled=!0,n.push(r)},this),this.__cache__=null,n};Yt.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)};Yt.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach(function(r){var s=this.__find__(r);if(s<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[s].enabled=!1,n.push(r)},this),this.__cache__=null,n};Yt.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};var lp=Yt,_ae=/\r\n?|\n/g,pae=/\0/g,mae=function(e){var n;n=e.src.replace(_ae,`
`),n=n.replace(pae,"<22>"),e.src=n},gae=function(e){var n;e.inlineMode?(n=new e.Token("inline","",0),n.content=e.src,n.map=[0,1],n.children=[],e.tokens.push(n)):e.md.block.parse(e.src,e.md,e.env,e.tokens)},fae=function(e){var n=e.tokens,r,s,o;for(s=0,o=n.length;s<o;s++)r=n[s],r.type==="inline"&&e.md.inline.parse(r.content,e.md,e.env,r.children)},hae=$e.arrayReplaceAt;function Eae(t){return/^<a[>\s]/i.test(t)}function bae(t){return/^<\/a\s*>/i.test(t)}var Sae=function(e){var n,r,s,o,i,a,l,u,c,_,p,g,f,h,E,b,m=e.tokens,S;if(e.md.options.linkify){for(r=0,s=m.length;r<s;r++)if(!(m[r].type!=="inline"||!e.md.linkify.pretest(m[r].content)))for(o=m[r].children,f=0,n=o.length-1;n>=0;n--){if(a=o[n],a.type==="link_close"){for(n--;o[n].level!==a.level&&o[n].type!=="link_open";)n--;continue}if(a.type==="html_inline"&&(Eae(a.content)&&f>0&&f--,bae(a.content)&&f++),!(f>0)&&a.type==="text"&&e.md.linkify.test(a.content)){for(c=a.content,S=e.md.linkify.match(c),l=[],g=a.level,p=0,S.length>0&&S[0].index===0&&n>0&&o[n-1].type==="text_special"&&(S=S.slice(1)),u=0;u<S.length;u++)h=S[u].url,E=e.md.normalizeLink(h),e.md.validateLink(E)&&(b=S[u].text,S[u].schema?S[u].schema==="mailto:"&&!/^mailto:/i.test(b)?b=e.md.normalizeLinkText("mailto:"+b).replace(/^mailto:/,""):b=e.md.normalizeLinkText(b):b=e.md.normalizeLinkText("http://"+b).replace(/^http:\/\//,""),_=S[u].index,_>p&&(i=new e.Token("text","",0),i.content=c.slice(p,_),i.level=g,l.push(i)),i=new e.Token("link_open","a",1),i.attrs=[["href",E]],i.level=g++,i.markup="linkify",i.info="auto",l.push(i),i=new e.Token("text","",0),i.content=b,i.level=g,l.push(i),i=new e.Token("link_close","a",-1),i.level=--g,i.markup="linkify",i.info="auto",l.push(i),p=S[u].lastIndex);p<c.length&&(i=new e.Token("text","",0),i.content=c.slice(p),i.level=g,l.push(i)),m[r].children=o=hae(o,n,l)}}}},Dv=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,yae=/\((c|tm|r)\)/i,vae=/\((c|tm|r)\)/ig,Tae={c:"©",r:"®",tm:"™"};function Cae(t,e){return Tae[e.toLowerCase()]}function Rae(t){var e,n,r=0;for(e=t.length-1;e>=0;e--)n=t[e],n.type==="text"&&!r&&(n.content=n.content.replace(vae,Cae)),n.type==="link_open"&&n.info==="auto"&&r--,n.type==="link_close"&&n.info==="auto"&&r++}function xae(t){var e,n,r=0;for(e=t.length-1;e>=0;e--)n=t[e],n.type==="text"&&!r&&Dv.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1")),n.type==="link_open"&&n.info==="auto"&&r--,n.type==="link_close"&&n.info==="auto"&&r++}var Oae=function(e){var n;if(e.md.options.typographer)for(n=e.tokens.length-1;n>=0;n--)e.tokens[n].type==="inline"&&(yae.test(e.tokens[n].content)&&Rae(e.tokens[n].children),Dv.test(e.tokens[n].content)&&xae(e.tokens[n].children))},Pg=$e.isWhiteSpace,Fg=$e.isPunctChar,Ug=$e.isMdAsciiPunct,Aae=/['"]/,Bg=/['"]/g,Gg="";function Do(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}function Nae(t,e){var n,r,s,o,i,a,l,u,c,_,p,g,f,h,E,b,m,S,C,A,x;for(C=[],n=0;n<t.length;n++){for(r=t[n],l=t[n].level,m=C.length-1;m>=0&&!(C[m].level<=l);m--);if(C.length=m+1,r.type==="text"){s=r.content,i=0,a=s.length;e:for(;i<a&&(Bg.lastIndex=i,o=Bg.exec(s),!!o);){if(E=b=!0,i=o.index+1,S=o[0]==="'",c=32,o.index-1>=0)c=s.charCodeAt(o.index-1);else for(m=n-1;m>=0&&!(t[m].type==="softbreak"||t[m].type==="hardbreak");m--)if(t[m].content){c=t[m].content.charCodeAt(t[m].content.length-1);break}if(_=32,i<a)_=s.charCodeAt(i);else for(m=n+1;m<t.length&&!(t[m].type==="softbreak"||t[m].type==="hardbreak");m++)if(t[m].content){_=t[m].content.charCodeAt(0);break}if(p=Ug(c)||Fg(String.fromCharCode(c)),g=Ug(_)||Fg(String.fromCharCode(_)),f=Pg(c),h=Pg(_),h?E=!1:g&&(f||p||(E=!1)),f?b=!1:p&&(h||g||(b=!1)),_===34&&o[0]==='"'&&c>=48&&c<=57&&(b=E=!1),E&&b&&(E=p,b=g),!E&&!b){S&&(r.content=Do(r.content,o.index,Gg));continue}if(b){for(m=C.length-1;m>=0&&(u=C[m],!(C[m].level<l));m--)if(u.single===S&&C[m].level===l){u=C[m],S?(A=e.md.options.quotes[2],x=e.md.options.quotes[
`,i.map=[n,e.line],!0},Uae=function(e,n,r,s){var o,i,a,l,u,c,_,p=!1,g=e.bMarks[n]+e.tShift[n],f=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||g+3>f||(o=e.src.charCodeAt(g),o!==126&&o!==96)||(u=g,g=e.skipChars(g,o),i=g-u,i<3)||(_=e.src.slice(u,g),a=e.src.slice(g,f),o===96&&a.indexOf(String.fromCharCode(o))>=0))return!1;if(s)return!0;for(l=n;l++,!(l>=r||(g=u=e.bMarks[l]+e.tShift[l],f=e.eMarks[l],g<f&&e.sCount[l]<e.blkIndent));)if(e.src.charCodeAt(g)===o&&!(e.sCount[l]-e.blkIndent>=4)&&(g=e.skipChars(g,o),!(g-u<i)&&(g=e.skipSpaces(g),!(g<f)))){p=!0;break}return i=e.sCount[n],e.line=l+(p?1:0),c=e.push("fence","code",0),c.info=a,c.content=e.getLines(n+1,l,i,!0),c.markup=_,c.map=[n,e.line],!0},Bae=$e.isSpace,Gae=function(e,n,r,s){var o,i,a,l,u,c,_,p,g,f,h,E,b,m,S,C,A,x,k,y,R=e.lineMax,w=e.bMarks[n]+e.tShift[n],L=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||e.src.charCodeAt(w)!==62)return!1;if(s)return!0;for(f=[],h=[],m=[],S=[],x=e.md.block.ruler.getRules("blockquote"),b=e.parentType,e.parentType="blockquote",p=n;p<r&&(y=e.sCount[p]<e.blkIndent,w=e.bMarks[p]+e.tShift[p],L=e.eMarks[p],!(w>=L));p++){if(e.src.charCodeAt(w++)===62&&!y){for(l=e.sCount[p]+1,e.src.charCodeAt(w)===32?(w++,l++,o=!1,C=!0):e.src.charCodeAt(w)===9?(C=!0,(e.bsCount[p]+l)%4===3?(w++,l++,o=!1):o=!0):C=!1,g=l,f.push(e.bMarks[p]),e.bMarks[p]=w;w<L&&(i=e.src.charCodeAt(w),Bae(i));){i===9?g+=4-(g+e.bsCount[p]+(o?1:0))%4:g++;w++}c=w>=L,h.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(C?1:0),m.push(e.sCount[p]),e.sCount[p]=g-l,S.push(e.tShift[p]),e.tShift[p]=w-e.bMarks[p];continue}if(c)break;for(A=!1,a=0,u=x.length;a<u;a++)if(x[a](e,p,r,!0)){A=!0;break}if(A){e.lineMax=p,e.blkIndent!==0&&(f.push(e.bMarks[p]),h.push(e.bsCount[p]),S.push(e.tShift[p]),m.push(e.sCount[p]),e.sCount[p]-=e.blkIndent);break}f.push(e.bMarks[p]),h.push(e.bsCount[p]),S.push(e.tShift[p]),m.push(e.sCount[p]),e.sCount[p]=-1}for(E=e.blkIndent,e.blkIndent=0,k=e.push("blockquote_open","blockquote",1),k.markup=">",k.map=_=[n,0],e.md.block.tokenize(e,n,p),k=e.push("blockquote_close","blockquote",-1),k.markup=">",e.lineMax=R,e.parentType=b,_[1]=e.line,a=0;a<S.length;a++)e.bMarks[a+n]=f[a],e.tShift[a+n]=S[a],e.sCount[a+n]=m[a],e.bsCount[a+n]=h[a];return e.blkIndent=E,!0},qae=$e.isSpace,Yae=function(e,n,r,s){var o,i,a,l,u=e.bMarks[n]+e.tShift[n],c=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||(o=e.src.charCodeAt(u++),o!==42&&o!==45&&o!==95))return!1;for(i=1;u<c;){if(a=e.src.charCodeAt(u++),a!==o&&!qae(a))return!1;a===o&&i++}return i<3?!1:(s||(e.line=n+1,l=e.push("hr","hr",0),l.map=[n,e.line],l.markup=Array(i+1).join(String.fromCharCode(o))),!0)},Mv=$e.isSpace;function Yg(t,e){var n,r,s,o;return r=t.bMarks[e]+t.tShift[e],s=t.eMarks[e],n=t.src.charCodeAt(r++),n!==42&&n!==45&&n!==43||r<s&&(o=t.src.charCodeAt(r),!Mv(o))?-1:r}function Vg(t,e){var n,r=t.bMarks[e]+t.tShift[e],s=r,o=t.eMarks[e];if(s+1>=o||(n=t.src.charCodeAt(s++),n<48||n>57))return-1;for(;;){if(s>=o)return-1;if(n=t.src.charCodeAt(s++),n>=48&&n<=57){if(s-r>=10)return-1;continue}if(n===41||n===46)break;return-1}return s<o&&(n=t.src.charCodeAt(s),!Mv(n))?-1:s}function Vae(t,e){var n,r,s=t.level+2;for(n=e+2,r=t.tokens.length-2;n<r;n++)t.tokens[n].level===s&&t.tokens[n].type==="paragraph_open"&&(t.tokens[n+2].hidden=!0,t.tokens[n].hidden=!0,n+=2)}var zae=function(e,n,r,s){var o,i,a,l,u,c,_,p,g,f,h,E,b,m,S,C,A,x,k,y,R,w,L,M,Z,B,se,H=n,I=!1,Q=!0;if(e.sCount[H]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[H]-e.listIndent>=4&&e.sCount[H]<e.blkIndent)return!1;if(s&&e.parentType==="paragraph"&&e.sCount[H]>=e.blkIndent&&(I=!0),(w=Vg(e,H))>=0){if(_=!0,M=e.bMarks[H]+e.tShift[H],b=Number(e.src.slice(M,w-1)),I&&b!==1)return!1}else if((w=Yg(e,H))>=0)_=!1;else return!1;if(I&&e.skipSpaces(w)>=e.eMarks[H])return!1;if(s)return!0;for(E=e.src.charCodeAt(w-1),h=e.tokens.length,_?(se=e.push("ordered_list_open","ol",1),b!==1&&(se.attrs=[["start",b]])):se=e.push("bullet_list_open","ul",1),se.map=f=[H,0],se.markup=String.fromCharCode(E),L=!1,B=e.md.block.ruler.getRules("list"),A=e.parentType,e.parentType="list";H<r;){for(R=w,m=e.eMarks[H],c=S=e.sCount[H]+w-(e.bMarks[H]+e.tShift[H]);
2023-10-23 23:40:39 +00:00
`})),r.tokens.splice(s+3+c.length+1,0,Object.assign(new r.Token("html_block","",0),{content:e.wrapper[1]+`
`})))});function lf(t,e,n,r){var s=t,o=r;if(n&&Object.prototype.hasOwnProperty.call(e,s))throw new Error("User defined `id` attribute `"+t+"` is not unique. Please fix it in your Markdown to continue.");for(;Object.prototype.hasOwnProperty.call(e,s);)s=t+"-"+o,o+=1;return e[s]=!0,s}function kr(t,e){e=Object.assign({},kr.defaults,e),t.core.ruler.push("anchor",function(n){for(var r,s={},o=n.tokens,i=Array.isArray(e.level)?(r=e.level,function(_){return r.includes(_)}):function(_){return function(p){return p>=_}}(e.level),a=0;a<o.length;a++){var l=o[a];if(l.type==="heading_open"&&i(Number(l.tag.substr(1)))){var u=e.getTokensText(o[a+1].children),c=l.attrGet("id");c=c==null?lf(e.slugify(u),s,!1,e.uniqueSlugStartIndex):lf(c,s,!0,e.uniqueSlugStartIndex),l.attrSet("id",c),e.tabIndex!==!1&&l.attrSet("tabindex",""+e.tabIndex),typeof e.permalink=="function"?e.permalink(c,e,n,a):(e.permalink||e.renderPermalink&&e.renderPermalink!==__)&&e.renderPermalink(c,e,n,a),a=o.indexOf(l),e.callback&&e.callback(l,{slug:c,title:u})}}})}Object.assign(af.defaults,{style:"visually-hidden",space:!0,placement:"after",wrapper:null}),kr.permalink={__proto__:null,legacy:__,renderHref:Qv,renderAttrs:jv,makePermalink:io,linkInsideHeader:Xi,ariaHidden:tr,headerLink:Zv,linkAfterHeader:af},kr.defaults={level:1,slugify:function(t){return encodeURIComponent(String(t).trim().toLowerCase().replace(/\s+/g,"-"))},uniqueSlugStartIndex:1,tabIndex:"-1",getTokensText:function(t){return t.filter(function(e){return["text","code_inline"].includes(e.type)}).map(function(e){return e.content}).join("")},permalink:!1,renderPermalink:__,permalinkClass:tr.defaults.class,permalinkSpace:tr.defaults.space,permalinkSymbol:"¶",permalinkBefore:tr.defaults.placement==="before",permalinkHref:tr.defaults.renderHref,permalinkAttrs:tr.defaults.renderAttrs},kr.default=kr;Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(typeof t>"u"||t===null)throw new TypeError("Cannot convert first argument to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(!(typeof r>"u"||r===null))for(var s=Object.keys(Object(r)),o=0,i=s.length;o<i;o++){var a=s[o],l=Object.getOwnPropertyDescriptor(r,a);typeof l<"u"&&l.enumerable&&(e[a]=r[a])}}return e}});var Nr={},vs={},Ts={},gt={},cf;function Xv(){if(cf)return gt;cf=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.accents=gt.fonts=gt.groupings=gt.operators=gt.identifiers=gt.numbers=void 0;var t={};gt.numbers=t;var e="[0-9²³¹¼-¾٠-٩۰-۹߀-߉०-९০-৯৴-৹੦-੯૦-૯୦-୯୲-୷௦-௲౦-౯౸-౾೦-೯൦-൵๐-๙໐-໙༠-༳၀-၉႐-႙፩-፼ᛮ-ᛰ០-៩៰-៹᠐-᠙᥆-᥏᧐-᧚᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙⁰⁴-⁹₀-₉⅐-ↂↅ-↋①-⒛⓪-⓿❶-➓⳽〇〡-〩〸-〺㆒-㆕㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿零一二三四五六七八九十百千万億兆京垓𥝱秭穣溝澗正載割分厘毛糸忽微繊沙塵埃꘠-꘩ꛦ-ꛯ꠰-꠵꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-]",n=new RegExp(e);Object.defineProperties(t,{digitRange:{value:e},digitRE:{value:n},isdigit:{value:function(_){return _.match(n)}}});var r=["sin","cos","tan","csc","sec","cot","sinh","cosh","tanh","log","ln","det","dim","lim","mod","gcd","lcm","min","max"],s={Gamma:"Γ",Delta:"Δ",Theta:"Θ",Lambda:"Λ",Xi:"Ξ",Pi:"Π",Sigma:"Σ",Phi:"Φ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ɛ",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",pi:"π",rho:"ρ",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",oo:"∞","O/":"∅",CC:"",NN:"",QQ:"",RR:"",ZZ:""};gt.identifiers=s,r.forEach(function(c){s[c]=c}),Object.defineProperty(s,"contains",{value:function(_){return typeof s[_]<"u"}}),Object.defineProperty(s,"funs",{value:r}),Object.defineProperty(s,"isfun",{value:function(_){return r.indexOf(_)>=0}});var o={"*":"·","**":"","***":"⋆","//":"/","|":"|",":":":","'":"","''":"″","'''":"‴","''''":"⁗",xx:"×","-:":"÷","|><":"⋉","><|
`);function Ee(D){return function(K){for(var G=[],q=0,V=0,ne=0;ne<K.length;ne+=1){var oe=K.slice(ne),ge=K[ne];oe.startsWith(D)&&!K.slice(0,ne).match(/\\(\\{2})*$/)?q===0&&(G.push(K.slice(V,ne)),V=ne+D.length):ge.match(e.groupings.open.regexp)?q+=1:ge.match(e.groupings.close.regexp)&&(q-=1)}return G.push(K.slice(V)),G}}var z=function D(K,G,q,V){if(!K)return G;if(K.match(/^\s/)){if(K.match(/^\s+(\/[^\/]|^[^\^]|_[^_|])/))return D(K.trim(),G);var ne=K.match(/^ +/),oe=ne?ne[0].length:0;if(oe>1){var ge='<mspace width="'.concat(oe-1,'ex" />');return D(K.trim(),G+ge)}return D(K.trim(),G)}var J=Y(K,V),le=r(J,2),Se=le[0],Oe=le[1];if((Oe&&Oe.trimLeft().startsWith("/")||Oe.trimLeft().startsWith("./"))&&!Oe.trimLeft().match(/^\.?\/\//)){var Le=F(Se,Oe),Ge=r(Le,2);Se=Ge[0],Oe=Ge[1]}return D(Oe,G+Se)};function te(D){if(D.trim().length===0)return"";var K=z(D,"",!1,!0);return K===Z(K)?K:S(K)}function Y(D,K,G){if(!D)return["",""];var q,V,ne=D[0],oe=D.slice(1),ge=ne+(oe.match(/^[A-Za-z]+/)||"");if(D.startsWith("sqrt")){var J=Y(D.slice(4).trim(),K);q=C(J[0]?M(J[0]):S("")),V=J[1]}else if(D.startsWith("root")){var le=Y(D.slice(4).trimLeft(),K),Se=le[0]?M(le[0]):S(""),Oe=Y(le[1].trimLeft(),K),Le=Oe[0]?M(Oe[0]):S("");q=A(Le+Se),V=Oe[1]}else if(ne==="\\"&&D.length>1)if(D[1].match(/[(\[]/)){var Ge=B(oe);q=c(D.slice(2,Ge)),V=D.slice(Ge+1)}else q=c(D[1]),V=D.slice(2);else if(e.accents.contains(ge)){var nt=e.accents.get(ge),Ze=D.slice(ge.length).trimLeft(),et=Ze.match(/^\s*\(?([ij])\)?/),Xe=Y(Ze);switch(nt.type){case"over":et?(q=E(l(et[1]==="i"?"ı":"ȷ")+c(nt.accent,{accent:!0})),V=Ze.slice(et[0].length)):(q=E(M(Xe[0])+c(nt.accent,{accent:!0})),V=Xe[1]);break;case"under":q=h(M(Xe[0])+c(nt.accent)),V=Xe[1];break;case"enclose":q=m(M(Xe[0]),nt.attrs),V=Xe[1];break;default:throw new Error("Invalid config for accent "+ge)}}else if(t.default.isfontCommand(D)){var Fe=t.default.splitfont(D);q=a(Fe.tagname)(Fe.text,Fe.font&&{mathvariant:Fe.font}),V=Fe.rest}else if(e.groupings.complex.contains(ge)){var Tn=e.groupings.complex.get(ge),ln=D.slice(ge.length).trimLeft(),yr=Y(ln);q=x(M(yr[0]),Tn),V=yr[1]}else if(t.default.isgroupStart(D)||t.default.isvertGroupStart(D)){var na=t.default.isgroupStart(D)?t.default.splitNextGroup(D):t.default.splitNextVert(D),vr=r(na,5),Cn=vr[1],Vt=vr[2],Rn=vr[3],ra=vr[4];V=e.groupings.open.get(ra);var Tr=function(){var Cr=fe(Vt);return Cr.length>1?Cr:Te(Vt)}();if(t.default.ismatrixInterior(Vt.trim(),X.colSep,X.rowSep)){Vt.trim().endsWith(X.colSep)&&(Vt=Vt.trimRight().slice(0,-1));var sa=Cn==="{"&&Rn==="",oa=W(Vt,sa&&{columnalign:"center left"});q=x(oa,{open:Cn,close:Rn})}else if(Tr.length>1)if(Tr.length===2&&Cn==="("&&Rn===")"){var ia=_(Tr.map(te).join(""),{linethickness:0});q=x(ia,{open:Cn,close:Rn})}else{var jn=Tr.map(be);I(jn).length===1&&I(jn)[0].match(/^\s*$/)&&(jn=jn.slice(0,-1));var aa=jn.map(function(Cr){return y(Cr.map(Q(R,te)).join(""))}).join("");q=x(k(aa),{open:Cn,close:Rn})}else{var la=be(Vt),ca=la.map(te).join(""),_o={open:Cn,close:Rn};X.colSep!==","&&(_o.separators=X.colSep),q=x(ca,_o)}}else if(!K&&t.default.isgroupable(D,X)){var po=$(D);q=te(po[0]),V=po[1]}else if(e.numbers.isdigit(ne)){var mo=D.match(ee)[0];q=u(mo),V=oe.slice(mo.length-1)}else if(D.match(/^#`[^`]+`/)){var go=D.match(/^#`([^`]+)`/)[1];q=u(go),V=D.slice(go.length+3)}else if(D.match(new RegExp("^"+e.operators.regexp.source))&&!e.identifiers.contains(ge)){var da=t.default.splitNextOperator(D),fo=r(da,2),gs=fo[0],ua=fo[1],_a=D.startsWith("'"),pa=H(["∂","∇"],gs),ma=H(["|"],gs),ga=D.startsWith("| "),zt={};_a&&(zt.lspace=0,zt.rspace=0),pa&&(zt.rspace=0),ma&&(zt.stretchy=!0),ga&&(zt.lspace="veryverythickmathspace",zt.rspace="veryverythickmathspace"),q=c(gs,!se(zt)&&zt),V=ua}else if(e.identifiers.contains(ge)){var fs=e.identifiers[ge],fa=fs.match(/[\u0391-\u03A9\u2100-\u214F\u2200-\u22FF]/);q=fa?l(fs,{mathvariant:"normal"}):l(fs),V=oe.slice(ge.length-1)}else ne==="O"&&oe[0]==="/"?(q=l(e.identifiers["O/"],{mathvariant:"normal"}),V=oe.slice(1)):(q=l(ne),V=oe);if(V&&V.trimLeft().match(/\.?[\^_]/)){if((!G||!G.match(/m(sup|over)/))&&V.trim().startsWith("_")&&(
`:"")+r.getLines(s+1,c,l,!0)+(g&&g.trim()?g:""),_.info=u,_.map=[s,r.line],_.markup=t,!0}}function mf(t){if(nl===null)try{nl=G5e().default}catch{return t&&t.display==="block"?function(r,s){return'<div class="math block">'+r[s].content+"</div>"}:function(r,s){return'<span class="math inline">'+r[s].content+"</span>"}}var e=nl(Object.assign({},t));return t&&t.display==="block"?function(n,r){return e(n[r].content)+`
`}:function(n,r){return e(n[r].content)}}var V5e=function(e,n){n=typeof n=="object"?n:{};var r=n.inlineOpen||"$$",s=n.inlineClose||"$$",o=n.blockOpen||"$$$",i=n.blockClose||"$$$",a=n.inlineRenderer?function(_,p){return n.inlineRenderer(_[p].content,_[p])}:mf(n.renderingOptions),l=n.blockRenderer?function(_,p){return n.blockRenderer(_[p].content,_[p])+`
`}:mf(Object.assign({display:"block"},n.renderingOptions)),u=q5e(r,s),c=Y5e(o,i);e.inline.ruler.before("escape","math_inline",u),e.block.ruler.after("blockquote","math_block",c,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.math_inline=a,e.renderer.rules.math_block=l};const z5e=Sn(V5e);function yn(){this.__highest_alphabet__=0,this.__match_alphabets__={},this.__initial_state__=0,this.__accept_states__={},this.__transitions__={},this.__actions__={}}yn.prototype.set_highest_alphabet=function(t){this.__highest_alphabet__=t};yn.prototype.set_match_alphabets=function(t){this.__match_alphabets__=t};yn.prototype.set_initial_state=function(t){this.__initial_state__=t};yn.prototype.set_accept_states=function(t){for(var e=0;e<t.length;e++)this.__accept_states__[t[e]]=!0};yn.prototype.set_transitions=function(t){this.__transitions__=t};yn.prototype.set_actions=function(t){this.__actions__=t};yn.prototype.update_transition=function(t,e){this.__transitions__[t]=Object.assign(this.__transitions__[t]||Object(),e)};yn.prototype.execute=function(t,e){var n,r,s;for(n=this.__initial_state__,r=t;n&&r<e;r++){for(s=this.__highest_alphabet__;s>0&&!(n&s&&this.__match_alphabets__[s].call(this,r,n,s));s>>=4);if(this.__actions__(r,n,s),s===0)break;n=this.__transitions__[n][s]||0}return!!this.__accept_states__[n]};var H5e=yn,$5e=H5e,W5e=function(e,n){var r={multiline:!1,rowspan:!1,headerless:!1,multibody:!0,autolabel:!0};n=e.utils.assign({},r,n||{});function s(c,_){var p=c.bMarks[_]+c.sCount[_],g=c.bMarks[_]+c.blkIndent,f=c.skipSpacesBack(c.eMarks[_],g),h=[],E,b,m=!1,S=!1,C=0;for(E=p;E<f;E++)switch(c.src.charCodeAt(E)){case 92:m=!0;break;case 96:b=c.skipChars(E,96)-1,b>E?(S||(C===0?C=b-E:C===b-E&&(C=0)),E=b):(S||!m&&!C)&&(S=!S),m=!1;break;case 124:!S&&!m&&h.push(E),m=!1;break;default:m=!1;break}return h.length===0||(h[0]>g&&h.unshift(g-1),h[h.length-1]<f-1&&h.push(f)),h}function o(c,_,p){var g={text:null,label:null},f=c.bMarks[p]+c.sCount[p],h=c.eMarks[p],E=/^\[(.+?)\](\[([^\[\]]+)\])?\s*$/,b=c.src.slice(f,h).match(E);return b?_?!0:(g.text=b[1],!n.autolabel&&!b[2]||(g.label=b[2]||b[1],g.label=g.label.toLowerCase().replace(/\W+/g,"")),g):!1}function i(c,_,p){var g={bounds:null,multiline:null},f=s(c,p),h,E,b;return f.length<2?!1:_?!0:(g.bounds=f,n.multiline&&(h=c.bMarks[p]+c.sCount[p],E=c.eMarks[p]-1,g.multiline=c.src.charCodeAt(E)===92,g.multiline&&(b=c.eMarks[p],c.eMarks[p]=c.skipSpacesBack(E,h),g.bounds=s(c,p),c.eMarks[p]=b)),g)}function a(c,_,p){var g={aligns:[],wraps:[]},f=s(c,p),h=/^:?(-+|=+):?\+?$/,E,b,m;if(c.sCount[p]-c.blkIndent>=4||f.length===0)return!1;for(E=0;E<f.length-1;E++){if(b=c.src.slice(f[E]+1,f[E+1]).trim(),!h.test(b))return!1;switch(g.wraps.push(b.charCodeAt(b.length-1)===43),m=(b.charCodeAt(0)===58)<<4|b.charCodeAt(b.length-1-g.wraps[E])===58,m){case 0:g.aligns.push("");break;case 1:g.aligns.push("right");break;case 16:g.aligns.push("left");break;case 17:g.aligns.push("center");break}}return _?!0:g}function l(c,_,p){return c.isEmpty(p)}function u(c,_,p,g){var f=new $5e,h=16,E=-1,b,m,S,C,A,x,k=[],y,R,w,L,M,Z,B,se,H,I;if(_+2>p||(m=new c.Token("table_open","table",1),m.meta={sep:null,cap:null,tr:[]},f.set_highest_alphabet(65536),f.set_initial_state(65792),f.set_accept_states([65552,65553,0]),f.set_match_alphabets({65536:o.bind(this,c,!0),4096:a.bind(this,c,!0),256:i.bind(this,c,!0),16:i.bind(this,c,!0),1:l.bind(this,c,!0)}),f.set_transitions({65792:{65536:256,256:4352},256:{256:4352},4352:{4096:65552,256:4352},65552:{65536:0,16:65553},65553:{65536:0,16:65553,1:65552}}),n.headerless&&(f.set_initial_state(69888),f.update_transition(69888,{65536:4352,4096:65552,256:4352}),S=new c.Token("tr_placeholder","tr",0),S.meta=Object()),n.multibody||f.update_transition(65552,{65536:0,16:65552}),f.set_actions(function(X,pe,ee){switch(ee){case 65536:if(m.meta.cap)break;m.meta.cap=o(c,!1,X),m.meta.cap.map=[X,X+1],m.meta.cap.first=X===_;break;case 4096:m.meta.sep=a(c,!1,X),m.meta.sep.map=[X,X+1],S.meta.grp|=1,h=16;break;case 256:case 16:S=new c.Token("tr_open","tr",1),S.map=[X,X+1],S.meta=i(c,!1,X),S.meta.type=ee,S.meta.grp=
`),c.md,c.env,[]),I.level=S.level+1,c.md.block.tokenize(I,S.map[0],I.lineMax),H=0;H<I.tokens.length;H++)c.tokens.push(I.tokens[H])}else b=c.push("inline","",0),b.content=L.trim(),b.map=S.map,b.level=S.level+1,b.children=[];b=c.push(w+"_close",w,-1)}c.push("tr_close","tr",-1),S.meta.grp&1&&(w=S.meta.type===256?"thead":"tbody",b=c.push(w+"_close",w,-1),R[1]=S.map[1])}return y[1]=Math.max(R[1],m.meta.sep.map[1],m.meta.cap?m.meta.cap.map[1]:-1),b=c.push("table_close","table",-1),c.line=y[1],!0}e.block.ruler.at("table",u,{alt:["paragraph","reference"]})};const K5e=Sn(W5e);var Q5e=function(e,n){n=n||{};function r(s){for(var o=1,i=1,a=s.tokens.length;i<a-1;++i){var l=s.tokens[i];if(l.type==="inline"&&!(!l.children||l.children.length!==1&&l.children.length!==3)&&!(l.children.length===1&&l.children[0].type!=="image")&&!(l.children.length===3&&(l.children[0].type!=="link_open"||l.children[1].type!=="image"||l.children[2].type!=="link_close"))&&!(i!==0&&s.tokens[i-1].type!=="paragraph_open")&&!(i!==a-1&&s.tokens[i+1].type!=="paragraph_close")){var u=s.tokens[i-1];u.type="figure_open",u.tag="figure",s.tokens[i+1].type="figure_close",s.tokens[i+1].tag="figure",n.dataType==!0&&s.tokens[i-1].attrPush(["data-type","image"]);var c;if(n.link==!0&&l.children.length===1&&(c=l.children[0],l.children.unshift(new s.Token("link_open","a",1)),l.children[0].attrPush(["href",c.attrGet("src")]),l.children.push(new s.Token("link_close","a",-1))),c=l.children.length===1?l.children[0]:l.children[1],n.figcaption==!0&&c.children&&c.children.length&&(l.children.push(new s.Token("figcaption_open","figcaption",1)),l.children.splice(l.children.length,0,...c.children),l.children.push(new s.Token("figcaption_close","figcaption",-1)),c.children.length=0),n.copyAttrs&&c.attrs){const _=n.copyAttrs===!0?"":n.copyAttrs;u.attrs=c.attrs.filter(([p,g])=>p.match(_))}n.tabindex==!0&&(s.tokens[i-1].attrPush(["tabindex",o]),o++),n.lazyLoading==!0&&c.attrPush(["loading","lazy"])}}}e.core.ruler.before("linkify","implicit_figures",r)};const j5e=Sn(Q5e);var Kn={};Kn.getAttrs=function(t,e,n){const r=/[^\t\n\f />"'=]/,s=" ",o="=",i=".",a="#",l=[];let u="",c="",_=!0,p=!1;for(let g=e+n.leftDelimiter.length;g<t.length;g++){if(t.slice(g,g+n.rightDelimiter.length)===n.rightDelimiter){u!==""&&l.push([u,c]);break}const f=t.charAt(g);if(f===o&&_){_=!1;continue}if(f===i&&u===""){t.charAt(g+1)===i?(u="css-module",g+=1):u="class",_=!1;continue}if(f===a&&u===""){u="id",_=!1;continue}if(f==='"'&&c===""&&!p){p=!0;continue}if(f==='"'&&p){p=!1;continue}if(f===s&&!p){if(u==="")continue;l.push([u,c]),u="",c="",_=!0;continue}if(!(_&&f.search(r)===-1)){if(_){u+=f;continue}c+=f}}if(n.allowedAttributes&&n.allowedAttributes.length){const g=n.allowedAttributes;return l.filter(function(f){const h=f[0];function E(b){return h===b||b instanceof RegExp&&b.test(h)}return g.some(E)})}return l};Kn.addAttrs=function(t,e){for(let n=0,r=t.length;n<r;++n){const s=t[n][0];s==="class"?e.attrJoin("class",t[n][1]):s==="css-module"?e.attrJoin("css-module",t[n][1]):e.attrPush(t[n])}return e};Kn.hasDelimiters=function(t,e){if(!t)throw new Error('Parameter `where` not passed. Should be "start", "end" or "only".');return function(n){const r=e.leftDelimiter.length+1+e.rightDelimiter.length;if(!n||typeof n!="string"||n.length<r)return!1;function s(c){const _=c.charAt(e.leftDelimiter.length)===".",p=c.charAt(e.leftDelimiter.length)==="#";return _||p?c.length>=r+1:c.length>=r}let o,i,a,l;const u=r-e.rightDelimiter.length;switch(t){case"start":a=n.slice(0,e.leftDelimiter.length),o=a===e.leftDelimiter?0:-1,i=o===-1?-1:n.indexOf(e.rightDelimiter,u),l=n.charAt(i+e.rightDelimiter.length),l&&e.rightDelimiter.indexOf(l)!==-1&&(i=-1);break;case"end":o=n.lastIndexOf(e.leftDelimiter),i=o===-1?-1:n.indexOf(e.rightDelimiter,o+u),i=i===n.length-e.rightDelimiter.length?i:-1;break;case"only":a=n.slice(0,e.leftDelimiter.length),o=a===e.leftDelimiter?0:-1,a=n.slice(n.length-e.rightDelimiter.length),i=a===e.rightDelimiter?n.length-e.rightDelimiter.length:-1;break;default:throw new Error(`Unexpected case ${t}, expected 'start', 'end' or 'only
{.a} softbreak then curly in start`,tests:[{shift:0,type:"inline",children:[{position:-2,type:"softbreak"},{position:-1,type:"text",content:Ue.hasDelimiters("only",t)}]}],transform:(n,r,s)=>{const o=n[r].children[s],i=Ue.getAttrs(o.content,0,t);let a=r+1;for(;n[a+1]&&n[a+1].nesting===-1;)a++;const l=Ue.getMatchingOpeningToken(n,a);Ue.addAttrs(i,l),n[r].children=n[r].children.slice(0,-2)}},{name:"horizontal rule",tests:[{shift:0,type:"paragraph_open"},{shift:1,type:"inline",children:n=>n.length===1,content:n=>n.match(e)!==null},{shift:2,type:"paragraph_close"}],transform:(n,r)=>{const s=n[r];s.type="hr",s.tag="hr",s.nesting=0;const o=n[r+1].content,i=o.lastIndexOf(t.leftDelimiter),a=Ue.getAttrs(o,i,t);Ue.addAttrs(a,s),s.markup=o,n.splice(r+1,2)}},{name:"end of block",tests:[{shift:0,type:"inline",children:[{position:-1,content:Ue.hasDelimiters("end",t),type:n=>n!=="code_inline"&&n!=="math_inline"}]}],transform:(n,r,s)=>{const o=n[r].children[s],i=o.content,a=Ue.getAttrs(i,i.lastIndexOf(t.leftDelimiter),t);let l=r+1;for(;n[l+1]&&n[l+1].nesting===-1;)l++;const u=Ue.getMatchingOpeningToken(n,l);Ue.addAttrs(a,u);const c=i.slice(0,i.lastIndexOf(t.leftDelimiter));o.content=gf(c)!==" "?c:c.slice(0,-1)}}]};function gf(t){return t.slice(-1)[0]}const n3e=t3e,r3e={leftDelimiter:"{",rightDelimiter:"}",allowedAttributes:[]};var s3e=function(e,n){let r=Object.assign({},r3e);r=Object.assign(r,n);const s=n3e(r);function o(i){const a=i.tokens;for(let l=0;l<a.length;l++)for(let u=0;u<s.length;u++){const c=s[u];let _=null;c.tests.every(g=>{const f=m_(a,l,g);return f.j!==null&&(_=f.j),f.match})&&(c.transform(a,l,_),(c.name==="inline attributes"||c.name==="inline nesting 0")&&u--)}}e.core.ruler.before("linkify","curly_attributes",o)};function m_(t,e,n){const r={match:!1,j:null},s=n.shift!==void 0?e+n.shift:n.position;if(n.shift!==void 0&&s<0)return r;const o=a3e(t,s);if(o===void 0)return r;for(const i of Object.keys(n))if(!(i==="shift"||i==="position")){if(o[i]===void 0)return r;if(i==="children"&&o3e(n.children)){if(o.children.length===0)return r;let a;const l=n.children,u=o.children;if(l.every(c=>c.position!==void 0)){if(a=l.every(c=>m_(u,c.position,c).match),a){const c=l3e(l).position;r.j=c>=0?c:u.length+c}}else for(let c=0;c<u.length;c++)if(a=l.every(_=>m_(u,c,_).match),a){r.j=c;break}if(a===!1)return r;continue}switch(typeof n[i]){case"boolean":case"number":case"string":if(o[i]!==n[i])return r;break;case"function":if(!n[i](o[i]))return r;break;case"object":if(i3e(n[i])){if(n[i].every(l=>l(o[i]))===!1)return r;break}default:throw new Error(`Unknown type of pattern test (key: ${i}). Test should be of type boolean, number, string, function or array of functions.`)}}return r.match=!0,r}function o3e(t){return Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object")}function i3e(t){return Array.isArray(t)&&t.length&&t.every(e=>typeof e=="function")}function a3e(t,e){return e>=0?t[e]:t[t.length+e]}function l3e(t){return t.slice(-1)[0]||{}}const c3e=Sn(s3e);function Jv(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&Jv(n)}),t}class ff{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function eT(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Bn(t,...e){const n=Object.create(null);for(const r in t)n[r]=t[r];return e.forEach(function(r){for(const s in r)n[s]=r[s]}),n}const d3e="</span>",hf=t=>!!t.scope,u3e=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,s)=>`${r}${"_".repeat(s+1)}`)].join(" ")}return`${e}${t}`};class _3e{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText
https://github.com/highlightjs/highlight.js/issues/2277`),pe=I,X=Q),re===void 0&&(re=!0);const ee={code:X,language:pe};se("before:highlight",ee);const be=ee.result?ee.result:_(ee.language,ee.code,re);return be.code=ee.code,se("after:highlight",be),be}function _(I,Q,re,X){const pe=Object.create(null);function ee(J,le){return J.keywords[le]}function be(){if(!D.keywords){G.addText(q);return}let J=0;D.keywordPatternRe.lastIndex=0;let le=D.keywordPatternRe.exec(q),Se="";for(;le;){Se+=q.substring(J,le.index);const Oe=W.case_insensitive?le[0].toLowerCase():le[0],Le=ee(D,Oe);if(Le){const[Ge,nt]=Le;if(G.addText(Se),Se="",pe[Oe]=(pe[Oe]||0)+1,pe[Oe]<=t4e&&(V+=nt),Ge.startsWith("_"))Se+=le[0];else{const Ze=W.classNameAliases[Ge]||Ge;Ee(le[0],Ze)}}else Se+=le[0];J=D.keywordPatternRe.lastIndex,le=D.keywordPatternRe.exec(q)}Se+=q.substring(J),G.addText(Se)}function Te(){if(q==="")return;let J=null;if(typeof D.subLanguage=="string"){if(!e[D.subLanguage]){G.addText(q);return}J=_(D.subLanguage,q,!0,K[D.subLanguage]),K[D.subLanguage]=J._top}else J=g(q,D.subLanguage.length?D.subLanguage:null);D.relevance>0&&(V+=J.relevance),G.__addSublanguage(J._emitter,J.language)}function fe(){D.subLanguage!=null?Te():be(),q=""}function Ee(J,le){J!==""&&(G.startScope(le),G.addText(J),G.endScope())}function z(J,le){let Se=1;const Oe=le.length-1;for(;Se<=Oe;){if(!J._emit[Se]){Se++;continue}const Le=W.classNameAliases[J[Se]]||J[Se],Ge=le[Se];Le?Ee(Ge,Le):(q=Ge,be(),q=""),Se++}}function te(J,le){return J.scope&&typeof J.scope=="string"&&G.openNode(W.classNameAliases[J.scope]||J.scope),J.beginScope&&(J.beginScope._wrap?(Ee(q,W.classNameAliases[J.beginScope._wrap]||J.beginScope._wrap),q=""):J.beginScope._multi&&(z(J.beginScope,le),q="")),D=Object.create(J,{parent:{value:D}}),D}function Y(J,le,Se){let Oe=h3e(J.endRe,Se);if(Oe){if(J["on:end"]){const Le=new ff(J);J["on:end"](le,Le),Le.isMatchIgnored&&(Oe=!1)}if(Oe){for(;J.endsParent&&J.parent;)J=J.parent;return J}}if(J.endsWithParent)return Y(J.parent,le,Se)}function ue(J){return D.matcher.regexIndex===0?(q+=J[0],1):(ge=!0,0)}function ye(J){const le=J[0],Se=J.rule,Oe=new ff(Se),Le=[Se.__beforeBegin,Se["on:begin"]];for(const Ge of Le)if(Ge&&(Ge(J,Oe),Oe.isMatchIgnored))return ue(le);return Se.skip?q+=le:(Se.excludeBegin&&(q+=le),fe(),!Se.returnBegin&&!Se.excludeBegin&&(q=le)),te(Se,J),Se.returnBegin?0:le.length}function O(J){const le=J[0],Se=Q.substring(J.index),Oe=Y(D,J,Se);if(!Oe)return vf;const Le=D;D.endScope&&D.endScope._wrap?(fe(),Ee(le,D.endScope._wrap)):D.endScope&&D.endScope._multi?(fe(),z(D.endScope,J)):Le.skip?q+=le:(Le.returnEnd||Le.excludeEnd||(q+=le),fe(),Le.excludeEnd&&(q=le));do D.scope&&G.closeNode(),!D.skip&&!D.subLanguage&&(V+=D.relevance),D=D.parent;while(D!==Oe.parent);return Oe.starts&&te(Oe.starts,J),Le.returnEnd?0:le.length}function N(){const J=[];for(let le=D;le!==W;le=le.parent)le.scope&&J.unshift(le.scope);J.forEach(le=>G.openNode(le))}let F={};function $(J,le){const Se=le&&le[0];if(q+=J,Se==null)return fe(),0;if(F.type==="begin"&&le.type==="end"&&F.index===le.index&&Se===""){if(q+=Q.slice(le.index,le.index+1),!s){const Oe=new Error(`0 width match regex (${I})`);throw Oe.languageName=I,Oe.badRule=F.rule,Oe}return 1}if(F=le,le.type==="begin")return ye(le);if(le.type==="illegal"&&!re){const Oe=new Error('Illegal lexeme "'+Se+'" for mode "'+(D.scope||"<unnamed>")+'"');throw Oe.mode=D,Oe}else if(le.type==="end"){const Oe=O(le);if(Oe!==vf)return Oe}if(le.type==="illegal"&&Se==="")return 1;if(oe>1e5&&oe>le.index*3)throw new Error("potential infinite loop, way more iterations than matches");return q+=Se,Se.length}const W=R(I);if(!W)throw dr(o.replace("{}",I)),new Error('Unknown language: "'+I+'"');const ie=Z3e(W);let me="",D=X||ie;const K={},G=new a.__emitter(a);N();let q="",V=0,ne=0,oe=0,ge=!1;try{if(W.__emitTokens)W.__emitTokens(Q,G);else{for(D.matcher.considerAll();;){oe++,ge?ge=!1:D.matcher.considerAll(),D.matcher.lastIndex=ne;const J=D.matcher.exec(Q);if(!J)break;const le=Q.substring(ne,J.index),Se=$(le,J);ne=J.index+Se}$(Q.substring(ne))}return G.finalize(),me=G.toHTML(),{language:I,valu
`},f]}}return Yc=s,Yc}var Vc,lE;function Y9e(){if(lE)return Vc;lE=1;function t(e){const n="[a-zA-Z_][\\w.]*",r="<\\?(lasso(script)?|=)",s="\\]|\\?>",o={$pattern:n+"|&[lg]t;",literal:"true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",built_in:"array date decimal duration integer map pair string tag xml null boolean bytes keyword list locale queue set stack staticarray local var variable global data self inherited currentcapture givenblock",keyword:"cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else fail_if fail_ifnot fail if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"},i=e.COMMENT("<!--","-->",{relevance:0}),a={className:"meta",begin:"\\[noprocess\\]",starts:{end:"\\[/noprocess\\]",returnEnd:!0,contains:[i]}},l={className:"meta",begin:"\\[/noprocess|"+r},u={className:"symbol",begin:"'"+n+"'"},c=[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.inherit(e.C_NUMBER_MODE,{begin:e.C_NUMBER_RE+"|(-?infinity|NaN)\\b"}),e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"`",end:"`"},{variants:[{begin:"[#$]"+n},{begin:"#",end:"\\d+",illegal:"\\W"}]},{className:"type",begin:"::\\s*",end:n,illegal:"\\W"},{className:"params",variants:[{begin:"-(?!infinity)"+n,relevance:0},{begin:"(\\.\\.\\.)"}]},{begin:/(->|\.)\s*/,relevance:0,contains:[u]},{className:"class",beginKeywords:"define",returnEnd:!0,end:"\\(|=>",contains:[e.inherit(e.TITLE_MODE,{begin:n+"(=(?!>))?|[-+*/%](?!>)"})]}];return{name:"Lasso",aliases:["ls","lassoscript"],case_insensitive:!0,keywords:o,contains:[{className:"meta",begin:s,relevance:0,starts:{end:"\\[|"+r,returnEnd:!0,relevance:0,contains:[i]}},a,l,{className:"meta",begin:"\\[no_square_brackets",starts:{end:"\\[/no_square_brackets\\]",keywords:o,contains:[{className:"meta",begin:s,relevance:0,starts:{end:"\\[noprocess\\]|"+r,returnEnd:!0,contains:[i]}},a,l].concat(c)}},{className:"meta",begin:"\\[",relevance:0},{className:"meta",begin:"^#!",end:"lasso9$",relevance:10}].concat(c)}}return Vc=t,Vc}var zc,cE;function V9e(){if(cE)return zc;cE=1;function t(e){const r=e.regex.either(...["(?:NeedsTeXFormat|RequirePackage|GetIdInfo)","Provides(?:Expl)?(?:Package|Class|File)","(?:DeclareOption|ProcessOptions)","(?:documentclass|usepackage|input|include)","makeat(?:letter|other)","ExplSyntax(?:On|Off)","(?:new|renew|provide)?command","(?:re)newenvironment","(?:New|Renew|Provide|Declare)(?:Expandable)?DocumentCommand","(?:New|Renew|Provide|Declare)DocumentEnvironment","(?:(?:e|g|x)?def|let)","(?:begin|end)","(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph)","caption","(?:label|(?:eq|page|name)?ref|(?:paren|foot|super)?cite)","(?:alpha|beta|[Gg]amma|[Dd]elta|(?:var)?epsilon|zeta|eta|[Tt]heta|vartheta)","(?:iota|(?:var)?kappa|[Ll]ambda|mu|nu|[Xx]i|[Pp]i|varpi|(?:var)rho)","(?:[Ss]igma|varsigma|tau|[Uu]psilon|[Pp]hi|varphi|chi|[Pp]si|[Oo]mega)","(?:frac|sum|prod|lim|infty|times|sqrt|leq|geq|left|right|middle|[bB]igg?)","(?:[lr]angle|q?quad|[lcvdi]?dots|d?dot|hat|tilde|bar)"].map(L=>L+"(?![a-zA-Z@:_])")),s=new RegExp(["(?:__)?[a-zA-Z]{2,}_[a-zA-Z](?:_?[a-zA-Z])+:[a-zA-Z]*","[lgc]__?[a-zA-Z](?:_?[a-zA-
]`,f={scope:"string",variants:[c,u,_,p]},h={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},E=["false","null","true"],b=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],m=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],C={keyword:b,literal:(B=>{const se=[];return B.forEach(H=>{se.push(H),H.toLowerCase()===H?se.push(H.toUpperCase()):se.push(H.toLowerCase())}),se})(E),built_in:m},A=B=>B.map(se=>se.replace(/\|\d+$/,"")),x={variants:[{match:[/new/,n.concat(g,"+"),n.concat("(?!",A(m).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},k=n.concat(s,"\\b(?!\\()"),y={variants:[{match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),k],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,n.concat(/::/,n.lookahead(/(?!class\b)/)),k],scope:{1:"title.class",3:"variable.constant"}},{match:[o,n.concat("::",n.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:n.concat(s,n.lookahead(":"),n.lookahead(/(?!::)/))},w={relevance:0,begin:/\(/,end:/\)/,keywords:C,contains:[R,i,y,e.C_BLOCK_COMMENT_MODE,f,h,x]},L={relevance:0,match:[/\b/,n.concat("(?!fn\\b|function\\b|",A(b).join("\\b|"),"|",A(m).join("\\b|"),"\\b)"),s,n.concat(g,"*"),n.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[w]};w.contains.push(L);const M=[R,y,e.C_BLOCK_COMMENT_MODE,f,h,x],Z={begin:n.concat(/#\[\s*/,o),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:E,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:E,keyword:["new","array"]},contains:["self",...M]},
]*;`,relevance:0},{begin:"[vp][0-9]+"}]}}return nu=t,nu}var ru,vb;function n8e(){if(vb)return ru;vb=1;function t(e){const n="[a-z][a-zA-Z0-9_]*",r={className:"string",begin:"\\$.{1}"},s={className:"symbol",begin:"#"+e.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],keywords:["self","super","nil","true","false","thisContext"],contains:[e.COMMENT('"','"'),e.APOS_STRING_MODE,{className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:n+":",relevance:0},e.C_NUMBER_MODE,s,r,{begin:"\\|[ ]*"+n+"([ ]+"+n+")*[ ]*\\|",returnBegin:!0,end:/\|/,illegal:/\S/,contains:[{begin:"(\\|[ ]*)?"+n}]},{begin:"#\\(",end:"\\)",contains:[e.APOS_STRING_MODE,r,e.C_NUMBER_MODE,s]}]}}return ru=t,ru}var su,Tb;function r8e(){if(Tb)return su;Tb=1;function t(e){return{name:"SML (Standard ML)",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:/\[(\|\|)?\]|\(\)/,relevance:0},e.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*"},e.inherit(e.APOS_STRING_MODE,{className:"string",relevance:0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/[-=]>/}]}}return su=t,su}var ou,Cb;function s8e(){if(Cb)return ou;Cb=1;function t(e){const n={className:"variable",begin:/\b_+[a-zA-Z]\w*/},r={className:"title",begin:/[a-zA-Z][a-zA-Z_0-9]*_fnc_[a-zA-Z_0-9]+/},s={className:"string",variants:[{begin:'"',end:'"',contains:[{begin:'""',relevance:0}]},{begin:"'",end:"'",contains:[{begin:"''",relevance:0}]}]},o=["break","breakWith","breakOut","breakTo","case","catch","continue","continueWith","default","do","else","exit","exitWith","for","forEach","from","if","local","private","switch","step","then","throw","to","try","waitUntil","while","with"],i=["blufor","civilian","configNull","controlNull","displayNull","diaryRecordNull","east","endl","false","grpNull","independent","lineBreak","locationNull","nil","objNull","opfor","pi","resistance","scriptNull","sideAmbientLife","sideEmpty","sideEnemy","sideFriendly","sideLogic","sideUnknown","taskNull","teamMemberNull","true","west"],a=["abs","accTime","acos","action","actionIDs","actionKeys","actionKeysEx","actionKeysImages","actionKeysNames","actionKeysNamesArray","actionName","actionParams","activateAddons","activatedAddons","activateKey","activeTitleEffectParams","add3DENConnection","add3DENEventHandler","add3DENLayer","addAction","addBackpack","addBackpackCargo","addBackpackCargoGlobal","addBackpackGlobal","addBinocularItem","addCamShake","addCuratorAddons","addCuratorCameraArea","addCuratorEditableObjects","addCuratorEditingArea","addCuratorPoints","addEditorObject","addEventHandler","addForce","addForceGeneratorRTD","addGoggles","addGroupIcon","addHandgunItem","addHeadgear","addItem","addItemCargo","addItemCargoGlobal","addItemPool","addItemToBackpack","addItemToUniform","addItemToVest","addLiveStats","addMagazine","addMagazineAmmoCargo","addMagazineCargo","addMagazineCargoGlobal","addMagazineGlobal","addMagazinePool","addMagazines","addMagazineTurret","addMenu","addMenuItem","addMissionEventHandler","addMPEventHandler","addMusicEventHandler","addonFiles","addOwnedMine","addPlayerScores","addPrimaryWeaponItem","addPublicVariableEventHandler","addRating","addResources","addScore","addScoreSide","addSecondaryWeaponItem","addSwitchableUnit","addTeamMember","addToRemainsCollector","addTorque","addUniform","addUserActionEventHandler","a
2023-10-23 23:40:39 +00:00
]*?"'`},{begin:`"[^\r
"]*"`}]},{className:"built_in",variants:[{begin:"\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()"}]},e.COMMENT("^[ ]*\\*.*$",!1),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]}}return lu=t,lu}var cu,Ab;function l8e(){if(Ab)return cu;Ab=1;function t(e){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.COMMENT("/\\*\\*!","\\*/"),e.C_NUMBER_MODE,e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}return cu=t,cu}var du,Nb;function c8e(){if(Nb)return du;Nb=1;const t=a=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:a.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:a.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],r=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","
2023-10-23 23:40:39 +00:00
(multipart)?`,end:`\\]
`},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}return uu=t,uu}var _u,Ib;function u8e(){if(Ib)return _u;Ib=1;function t(y){return y?typeof y=="string"?y:y.source:null}function e(y){return n("(?=",y,")")}function n(...y){return y.map(w=>t(w)).join("")}function r(y){const R=y[y.length-1];return typeof R=="object"&&R.constructor===Object?(y.splice(y.length-1,1),R):{}}function s(...y){return"("+(r(y).capture?"":"?:")+y.map(L=>t(L)).join("|")+")"}const o=y=>n(/\b/,y,/\w$/.test(y)?/\b/:/\B/),i=["Protocol","Type"].map(o),a=["init","self"].map(o),l=["Any","Self"],u=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],c=["false","nil","true"],_=["assignment","associativity","higherThan","left","lowerThan","none","right"],p=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],g=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],f=s(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),h=s(f,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),E=n(f,h,"*"),b=s(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),m=s(b,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),S=n(b,m,"*"),C=n(/[A-Z]/,m,"*"),A=["attached","autoclosure",n(/convention\(/,s("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",n(/objc\(/,S,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain",
`),r=n.length.toString().length,s=n.map((u,c)=>(c+1).toString().padStart(r," ")),o=document.createElement("div");o.classList.add("line-numbers"),o.innerHTML=s.join("<br>");const i=document.createElement("div");i.classList.add("code-container");const a=document.createElement("pre"),l=document.createElement("code");return l.classList.add("code-content"),l.innerHTML=mr.highlight(t,e).value,a.appendChild(l),i.appendChild(o),i.appendChild(a),i.outerHTML}},methods:{copyCode(){this.isCopied=!0,console.log("Copying code");const t=document.createElement("textarea");t.value=this.code,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),ve(()=>{Ce.replace()})},executeCode(){const t=JSON.stringify({code:this.code,discussion_id:this.discussion_id,message_id:this.message_id,language:this.language});console.log(t),fetch("http://localhost:9600/execute_code",{method:"POST",headers:{"Content-Type":"application/json"},body:t}).then(e=>e.json()).then(e=>{console.log(e),this.executionOutput=e.output}).catch(e=>{console.error("Fetch error:",e)})},openFolder(){const t=JSON.stringify({discussion_id:this.discussion_id});console.log(t),fetch("http://localhost:9600/open_code_folder",{method:"POST",headers:{"Content-Type":"application/json"},body:t}).then(e=>e.json()).then(e=>{console.log(e)}).catch(e=>{console.error("Fetch error:",e)})}}},L8e={class:"bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel p-2 rounded-lg shadow-sm"},P8e={class:"flex flex-row bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel p-2 rounded-lg shadow-sm"},F8e=d("i",{"data-feather":"copy"},null,-1),U8e=[F8e],B8e=d("i",{"data-feather":"play-circle"},null,-1),G8e=[B8e],q8e=d("i",{"data-feather":"folder"},null,-1),Y8e=[q8e],V8e={class:"hljs p-1 rounded-md break-all grid grid-cols-1"},z8e={class:"code-container"},H8e=["innerHTML"],$8e={key:0,class:"hljs mt-4 p-1 rounded-md break-all grid grid-cols-1"},W8e={class:"overflow-x-auto break-all scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},K8e=["innerHTML"];function Q8e(t,e,n,r,s,o){return v(),T("div",L8e,[d("div",P8e,[d("span",null,j(n.language),1),d("button",{onClick:e[0]||(e[0]=(...i)=>o.copyCode&&o.copyCode(...i)),title:"copy",class:Ae([s.isCopied?"bg-green-500":"bg-bg-dark-tone-panel dark:bg-bg-dark-tone","px-2 py-1 ml-2 text-left p-2 text-sm font-medium rounded-lg hover:bg-primary dark:hover:bg-primary text-white text-xs transition-colors duration-200"])},U8e,2),["python","shell","bash","cmd","powershell"].includes(n.language)?(v(),T("button",{key:0,ref:"btn_code_exec",onClick:e[1]||(e[1]=(...i)=>o.executeCode&&o.executeCode(...i)),title:"execute",class:"px-2 py-1 ml-2 text-left p-2 text-sm font-medium bg-bg-dark-tone-panel dark:bg-bg-dark-tone rounded-lg hover:bg-primary dark:hover:bg-primary text-white text-xs transition-colors duration-200"},G8e,512)):U("",!0),["python"].includes(n.language)?(v(),T("button",{key:1,onClick:e[2]||(e[2]=(...i)=>o.openFolder&&o.openFolder(...i)),title:"open code project folder",class:"px-2 py-1 ml-2 text-left p-2 text-sm font-medium bg-bg-dark-tone-panel dark:bg-bg-dark-tone rounded-lg hover:bg-primary dark:hover:bg-primary text-white text-xs transition-colors duration-200"},Y8e)):U("",!0)]),d("pre",V8e,[xe(" "),d("div",z8e,[xe(`
`),d("code",{class:"code-content overflow-x-auto break-all scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",innerHTML:o.highlightedCode},null,8,H8e),xe(`
`)]),xe(`
2023-10-24 21:07:04 +00:00
`)]),s.executionOutput?(v(),T("pre",$8e,[xe(" "),d("div",W8e,[xe(`
`),d("div",{ref:"execution_output",innerHTML:s.executionOutput},null,8,K8e),xe(`
`)]),xe(`
`)])):U("",!0)])}const j8e=Ye(M8e,[["render",Q8e]]);function Z8e(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}const X8e={name:"MarkdownRenderer",props:{markdownText:{type:String,required:!0},discussion_id:{type:[String,Number],default:"0",required:!1},message_id:{value:"0",type:[String,Number],required:!1}},components:{CodeBlock:j8e},setup(t){const e=new Dce({html:!0,highlight:(s,o)=>{const i=o&&mr.getLanguage(o)?o:"plaintext";return mr.highlight(i,s).value},renderInline:!0,breaks:!0}).use(P5e).use(kr).use(j5e,{figcaption:!0}).use(c3e).use(z5e,{inlineOpen:"$",inlineClose:"$",blockOpen:"$$",blockClose:"$$"}).use(K5e,{enableRowspan:!0,enableColspan:!0,enableGridTables:!0,enableGridTablesExtra:!0,enableTableIndentation:!0,tableCellPadding:" ",tableCellJoiner:"|",multilineCellStartMarker:"|>",multilineCellEndMarker:"<|",multilineCellPadding:" ",multilineCellJoiner:`
`}),n=FS([]),r=()=>{if(t.markdownText){let s=e.parse(t.markdownText,{}),o=[];n.value=[];for(let i=0;i<s.length;i++)s[i].type!=="fence"?o.push(s[i]):(o.length>0&&(n.value.push({type:"html",html:e.renderer.render(o,e.options,{})}),o=[]),n.value.push({type:"code",language:Z8e(s[i].info),code:s[i].content}));o.length>0&&(n.value.push({type:"html",html:e.renderer.render(o,e.options,{})}),o=[])}else n.value=[];ve(()=>{Ce.replace()})};return Yn(()=>t.markdownText,r),to(r),{markdownItems:n}}},J8e={class:"break-all"},e6e={ref:"mdRender",class:"markdown-content"},t6e=["innerHTML"];function n6e(t,e,n,r,s,o){const i=Pe("code-block");return v(),T("div",J8e,[d("div",e6e,[(v(!0),T(we,null,Be(r.markdownItems,(a,l)=>(v(),T("div",{key:l},[a.type==="code"?(v(),rt(i,{key:0,language:a.language,code:a.code,discussion_id:n.discussion_id,message_id:n.message_id},null,8,["language","code","discussion_id","message_id"])):(v(),T("div",{key:1,innerHTML:a.html},null,8,t6e))]))),128))],512)])}const uT=Ye(X8e,[["render",n6e]]);const r6e={props:{value:String,inputType:{type:String,default:"text",validator:t=>["text","email","password","file","path","integer","float"].includes(t)},fileAccept:String},data(){return{inputValue:this.value,placeholderText:this.getPlaceholderText()}},watch:{value(t){console.log("Changing value to ",t),this.inputValue=t}},mounted(){ve(()=>{Ce.replace()}),console.log("Changing value to ",this.value),this.inputValue=this.value},methods:{handleSliderInput(t){this.inputValue=t.target.value,this.$emit("input",t.target.value)},getPlaceholderText(){switch(this.inputType){case"text":return"Enter text here";case"email":return"Enter your email";case"password":return"Enter your password";case"file":case"path":return"Choose a file";case"integer":return"Enter an integer";case"float":return"Enter a float";default:return"Enter value here"}},handleInput(t){if(this.inputType==="integer"){const e=t.target.value.replace(/[^0-9]/g,"");this.inputValue=e}console.log("handling input : ",t.target.value),this.$emit("input",t.target.value)},async pasteFromClipboard(){try{const t=await navigator.clipboard.readText();this.handleClipboardData(t)}catch(t){console.error("Failed to read from clipboard:",t)}},handlePaste(t){const e=t.clipboardData.getData("text");this.handleClipboardData(e)},handleClipboardData(t){switch(this.inputType){case"email":this.inputValue=this.isValidEmail(t)?t:"";break;case"password":this.inputValue=t;break;case"file":case"path":this.inputValue="";break;case"integer":this.inputValue=this.parseInteger(t);break;case"float":this.inputValue=this.parseFloat(t);break;default:this.inputValue=t;break}},isValidEmail(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)},parseInteger(t){const e=parseInt(t);return isNaN(e)?"":e},parseFloat(t){const e=parseFloat(t);return isNaN(e)?"":e},openFileInput(){this.$refs.fileInput.click()},handleFileInputChange(t){const e=t.target.files[0];e&&(this.inputValue=e.name)}}},s6e={class:"flex items-center space-x-2"},o6e=["value","type","placeholder"],i6e=["value","min","max"],a6e=d("i",{"data-feather":"clipboard"},null,-1),l6e=[a6e],c6e=d("i",{"data-feather":"upload"},null,-1),d6e=[c6e],u6e=["accept"];function _6e(t,e,n,r,s,o){return v(),T("div",s6e,[t.useSlider?(v(),T("input",{key:1,type:"range",value:parseInt(s.inputValue),min:t.minSliderValue,max:t.maxSliderValue,onInput:e[2]||(e[2]=(...i)=>o.handleSliderInput&&o.handleSliderInput(...i)),class:"flex-1 px-4 py-2 text-lg border dark:bg-gray-600 border-gray-300 rounded-md focus:outline-none focus:ring focus:border-blue-500"},null,40,i6e)):(v(),T("input",{key:0,value:s.inputValue,type:n.inputType,placeholder:s.placeholderText,onInput:e[0]||(e[0]=(...i)=>o.handleInput&&o.handleInput(...i)),onPaste:e[1]||(e[1]=(...i)=>o.handlePaste&&o.handlePaste(...i)),class:"flex-1 px-4 py-2 text-lg dark:bg-gray-600 border border-gray-300 rounded-md focus:outline-none focus:ring focus:border-blue-500"},null,40,o6e)),d("button",{onClick:e[3]||(e[3]=(...i)=>o.pasteFromClipboard&&o.pasteFromClipboard(...i)),class:"p-2 bg-blue-500 dark:bg-gray-600 text-white rounded-md hover:bg-blue-60
2023-10-23 23:40:39 +00:00
<div class="bg-white p-6 rounded-md shadow-md w-80">
<h2 class="text-lg font-semibold mb-3">${t}</h2>
<textarea id="replacementInput" class="w-full h-32 border rounded p-2 mb-3">${e}</textarea>
<div class="flex justify-end">
<button id="cancelButton" class="mr-2 px-4 py-2 border rounded">Cancel</button>
<button id="okButton" class="px-4 py-2 bg-blue-500 text-white rounded">OK</button>
</div>
</div>
`:o.innerHTML=`
<div class="bg-white p-6 rounded-md shadow-md w-80">
<h2 class="text-lg font-semibold mb-3">${t}</h2>
<select id="options_selector" class="form-control w-full h-25 border rounded p-2 mb-3">
${n.map(l=>`<option value="${l}">${l}</option>`)}
</select>
<div class="flex justify-end">
<button id="cancelButton" class="mr-2 px-4 py-2 border rounded">Cancel</button>
<button id="okButton" class="px-4 py-2 bg-blue-500 text-white rounded">OK</button>
</div>
</div>
`,document.body.appendChild(o);const i=o.querySelector("#cancelButton"),a=o.querySelector("#okButton");i.addEventListener("click",()=>{document.body.removeChild(o),r(null)}),a.addEventListener("click",()=>{if(n.length===0){const u=o.querySelector("#replacementInput").value.trim();document.body.removeChild(o),r(u)}else{const u=o.querySelector("#options_selector").value.trim();document.body.removeChild(o),r(u)}})})}function h6e(t,e){console.log(t);let n={},r=/@<([^>]+)>@/g,s=[],o;for(;(o=r.exec(t))!==null;)s.push("@<"+o[1]+">@");console.log("matches"),console.log(s),s=[...new Set(s)];async function i(l){console.log(l);let u=l.toLowerCase().substring(2,l.length-2);if(u!=="generation_placeholder")if(u.includes(":")){Object.entries({all_language_options:"english:french:german:chinese:japanese:spanish:italian:russian:portuguese:swedish:danish:dutch:norwegian:slovak:czech:hungarian:polish:ukrainian:bulgarian:latvian:lithuanian:estonian:maltese:irish:galician:basque:welsh:breton:georgian:turkmen:kazakh:uzbek:tajik:afghan:sri-lankan:filipino:vietnamese:lao:cambodian:thai:burmese:kenyan:botswanan:zimbabwean:malawian:mozambican:angolan:namibian:south-african:madagascan:seychellois:mauritian:haitian:peruvian:ecuadorian:bolivian:paraguayan:chilean:argentinean:uruguayan:brazilian:colombian:venezuelan:puerto-rican:cuban:dominican:honduran:nicaraguan:salvadorean:guatemalan:el-salvadoran:belizean:panamanian:costa-rican:antiguan:barbudan:dominica's:grenada's:st-lucia's:st-vincent's:gibraltarian:faroe-islander:greenlandic:icelandic:jamaican:trinidadian:tobagonian:barbadian:anguillan:british-virgin-islander:us-virgin-islander:turkish:israeli:palestinian:lebanese:egyptian:libyan:tunisian:algerian:moroccan:bahraini:kuwaiti:saudi-arabian:yemeni:omani:irani:iraqi:afghanistan's:pakistani:indian:nepalese:sri-lankan:maldivan:burmese:thai:lao:vietnamese:kampuchean:malaysian:bruneian:indonesian:australian:new-zealanders:fijians:tongans:samoans:vanuatuans:wallisians:kiribatians:tuvaluans:solomon-islanders:marshallese:micronesians:hawaiians",all_programming_language_options:"python:c:c++:java:javascript:php:ruby:go:swift:kotlin:rust:haskell:erlang:lisp:scheme:prolog:cobol:fortran:pascal:delphi:d:eiffel:h:basic:visual_basic:smalltalk:objective-c:html5:node.js:vue.js:svelte:react:angular:ember:clipper:stex:arduino:brainfuck:r:assembly:mason:lepton:seacat:bbc_microbit:raspberry_pi_gpio:raspberry_pi_spi:raspberry_pi_i2c:raspberry_pi_uart:raspberry_pi_adc:raspberry_pi_ddio"}).forEach(([E,b])=>{console.log(`Key: ${E}, Value: ${b}`);function m(A){return A.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const S=m(E),C=new RegExp(S,"g");u=u.replace(C,b)});let _=u.split(":"),p=_[0],g=_[1]||"",f=[];_.length>2&&(f=_.slice(1));let h=await Jb(p,g,f);h!==null&&(n[l]=h)}else{let c=await Jb(u);c!==null&&(n[l]=c)}}let a=Promise.resolve();s.forEach(l=>{a=a.then(()=>i(l)).then(u=>{console.log(u)})}),a.then(()=>{Object.entries(n).forEach(([l,u])=>{console.log(`Key: ${l}, Value: ${u}`);function c(g){return g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const _=c(l),p=new RegExp(_,"g");t=t.replace(p,u)}),e(t)})}const E6e={name:"PlayGroundView",data(){return{selecting_model:!1,tab_id:"source",generating:!1,isSpeaking:!1,voices:[],isLesteningToVoice:!1,presets:[],selectedPreset:"",cursorPosition:0,text:"",pre_text:"",post_text:"",temperature:.1,top_k:50,top_p:.9,repeat_penalty:1.3,repeat_last_n:50,n_crop:-1,n_predicts:2e3,seed:-1,silenceTimeout:5e3}},components:{Toast:ds,MarkdownRenderer:uT,ClipBoardTextInput:yp,Card:ao},mounted(){Re.get("./get_presets").then(t=>{console.log(t.data),this.presets=t.data,this.selectedPreset=this.presets[0]}).catch(t=>{this.$refs.toast.showToast(`Error: ${t}`,4,!1)}),Ne.on("text_chunk",t=>{this.appendToOutput(t.chunk)}),Ne.on("text_generated",t=>{this.generating=!1}),Ne.on("generation_error",t=>{console.log("generation_error:",t),this.$refs.toast.showToast(`Error: ${t}`,4,!1),this.generating=!1}),Ne.on("connect",()=>{console.log("Connected to LoLLMs server"),this.$store.state.isConnected=!0,this.generating=!1}),Ne.on("buzzy",t=>{console.error("Server is
`];let a=-1;return i.forEach(l=>{const u=o.lastIndexOf(l);u>a&&(a=u)}),a==-1&&(a=o.length),console.log(a),a+s+1},r=()=>{const s=n(t),o=this.text.substring(t,s);this.msg.text=o,t=s+1,this.msg.onend=i=>{t<this.text.length-2?setTimeout(()=>{r()},1):(this.isSpeaking=!1,console.log("voice off :",this.text.length," ",s))},this.speechSynthesis.speak(this.msg)};r()},getCursorPosition(){return this.cursorPosition},appendToOutput(t){this.pre_text+=t,this.text=this.pre_text+this.post_text},generate_in_placeholder(){console.log("Finding cursor position");let t=this.text.indexOf("@<generation_placeholder>@");if(t<0){this.$refs.toast.showToast("No generation placeholder found",4,!1);return}this.text=this.text.substring(0,t)+this.text.substring(t+26,this.text.length),this.pre_text=this.text.substring(0,t),this.post_text=this.text.substring(t,this.text.length);var e=this.text.substring(0,t);console.log(e),Ne.emit("generate_text",{prompt:e,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},generate(){console.log("Finding cursor position"),this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length);var t=this.text.substring(0,this.getCursorPosition());console.log(t),Ne.emit("generate_text",{prompt:t,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},stopGeneration(){Ne.emit("cancel_text_generation",{})},exportText(){const t=this.text,e=document.createElement("a"),n=new Blob([t],{type:"text/plain"});e.href=URL.createObjectURL(n),e.download="exported_text.txt",document.body.appendChild(e),e.click(),document.body.removeChild(e)},importText(){const t=document.getElementById("import-input");t&&(t.addEventListener("change",e=>{if(e.target.files&&e.target.files[0]){const n=new FileReader;n.onload=()=>{this.text=n.result},n.readAsText(e.target.files[0])}else alert("Please select a file.")}),t.click())},setPreset(){console.log("Setting preset"),console.log(this.selectedPreset),this.tab_id="render",this.text=h6e(this.selectedPreset.content,t=>{console.log("Done"),console.log(t),this.text=t})},addPreset(){let t=prompt("Enter the title of the preset:");this.presets[t]={name:t,content:this.text},Re.post("./add_preset",this.presets[t]).then(e=>{console.log(e.data)}).catch(e=>{this.$refs.toast.showToast(`Error: ${e}`,4,!1)})},removePreset(){this.selectedPreset&&delete this.presets[this.selectedPreset.name]},reloadPresets(){Re.get("./get_presets").then(t=>{console.log(t.data),this.presets=t.data,this.selectedPreset=this.presets[0]}).catch(t=>{this.$refs.toast.showToast(`Error: ${t}`,4,!1)})},startSpeechRecognition(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window?(this.recognition=new(window.SpeechRecognition||window.webkitSpeechRecognition),this.recognition.lang=this.$store.state.config.audio_in_language,this.recognition.interimResults=!0,this.recognition.onstart=()=>{this.isLesteningToVoice=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length),this.recognition.onresult=t=>{this.generated="";for(let e=t.resultIndex;e<t.results.length;e++)this.generated+=t.results[e][0].transcript;this.text=this.pre_text+this.generated+this.post_text,this.cursorPosition=this.pre_text.length+this.generated.length,clearTimeout(this.silenceTimer),this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=t=>{console.error("Speech recognition error:",t.error),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recog
`,36),[[De,s.text]]),d("span",null,"Cursor position "+j(s.cursorPosition),1)])):U("",!0),s.tab_id==="render"?(v(),T("div",q6e,[he(i,{ref:"mdRender","markdown-text":s.text,class:"mt-4 p-2 rounded shadow-lg dark:bg-bg-dark"},null,8,["markdown-text"])])):U("",!0)],2)]),he(a,{title:"settings",class:"slider-container ml-0 mr-0 max-width",isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:ke(()=>[he(a,{title:"Model",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:ke(()=>[ce(d("select",{"onUpdate:modelValue":e[11]||(e[11]=u=>o.selectedModel=u),onChange:e[12]||(e[12]=(...u)=>o.setModel&&o.setModel(...u)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(v(!0),T(we,null,Be(o.models,u=>(v(),T("option",{key:u,value:u},j(u),9,Y6e))),128))],544),[[Kt,o.selectedModel]]),s.selecting_model?(v(),T("div",V6e,H6e)):U("",!0)]),_:1}),he(a,{title:"Presets",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:ke(()=>[ce(d("select",{"onUpdate:modelValue":e[13]||(e[13]=u=>s.selectedPreset=u),class:"bg-white dark:bg-black mb-2 border-2 rounded-md shadow-sm w-full"},[(v(!0),T(we,null,Be(s.presets,u=>(v(),T("option",{key:u,value:u},j(u.name),9,$6e))),128))],512),[[Kt,s.selectedPreset]]),W6e,d("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[14]||(e[14]=(...u)=>o.setPreset&&o.setPreset(...u)),title:"Use preset"},Q6e),d("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[15]||(e[15]=(...u)=>o.addPreset&&o.addPreset(...u)),title:"Add this text as a preset"},Z6e),d("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[16]||(e[16]=(...u)=>o.removePreset&&o.removePreset(...u)),title:"Remove preset"},J6e),d("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[17]||(e[17]=(...u)=>o.reloadPresets&&o.reloadPresets(...u)),title:"Reload presets list"},tqe)]),_:1}),he(a,{title:"Generation params",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:ke(()=>[d("div",nqe,[rqe,ce(d("input",{type:"range","onUpdate:modelValue":e[18]||(e[18]=u=>s.temperature=u),min:"0",max:"5",step:"0.1",class:"w-full"},null,512),[[De,s.temperature]]),d("span",sqe,"Current value: "+j(s.temperature),1)]),d("div",oqe,[iqe,ce(d("input",{type:"range","onUpdate:modelValue":e[19]||(e[19]=u=>s.top_k=u),min:"1",max:"100",step:"1",class:"w-full"},null,512),[[De,s.top_k]]),d("span",aqe,"Current value: "+j(s.top_k),1)]),d("div",lqe,[cqe,ce(d("input",{type:"range","onUpdate:modelValue":e[20]||(e[20]=u=>s.top_p=u),min:"0",max:"1",step:"0.1",class:"w-full"},null,512),[[De,s.top_p]]),d("span",dqe,"Current value: "+j(s.top_p),1)]),d("div",uqe,[_qe,ce(d("input",{type:"range","onUpdate:modelValue":e[21]||(e[21]=u=>s.repeat_penalty=u),min:"0",max:"5",step:"0.1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[De,s.repeat_penalty]]),d("span",pqe,"Current value: "+j(s.repeat_penalty),1)]),d("div",mqe,[gqe,ce(d("input",{type:"range","onUpdate:modelValue":e[22]||(e[22]=u=>s.repeat_last_n=u),min:"0",max:"100",step:"1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[De,s.repeat_last_n]]),d("span",fqe,"Current value: "+j(s.repeat_last_n),1)]),d("div",hqe,[Eqe,ce(d("input",{type:"number","onUpdate:modelValue":e[23]||(e[23]=u=>s.n_crop=u),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[De,s.n_crop]]),d("span",bqe,"Current value: "+j(s.n_crop),1)]),d("div",Sqe,[yqe,ce(d("input",{type:"number","onUpdate:modelValue":e[24]||(e[24]=u=>s.n_predicts=u),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[De,s.n_predicts]]),d("span",vqe,"Current value: "+j(s.n_predicts),1)]),d("div",Tqe,[Cqe,ce(d("input",{type:"number","onUpdate:modelValue":
2023-10-23 23:40:39 +00:00
Papa Parse
v5.4.1
https://github.com/mholt/PapaParse
License: MIT
*/(function(t,e){(function(n,r){t.exports=r()})(uv,function n(){var r=typeof self<"u"?self:typeof window<"u"?window:r!==void 0?r:{},s=!r.document&&!!r.postMessage,o=r.IS_PAPA_WORKER||!1,i={},a=0,l={parse:function(y,R){var w=(R=R||{}).dynamicTyping||!1;if(k(w)&&(R.dynamicTypingFunction=w,w={}),R.dynamicTyping=w,R.transform=!!k(R.transform)&&R.transform,R.worker&&l.WORKERS_SUPPORTED){var L=function(){if(!l.WORKERS_SUPPORTED)return!1;var Z=(se=r.URL||r.webkitURL||null,H=n.toString(),l.BLOB_URL||(l.BLOB_URL=se.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",H,")();"],{type:"text/javascript"})))),B=new r.Worker(Z),se,H;return B.onmessage=m,B.id=a++,i[B.id]=B}();return L.userStep=R.step,L.userChunk=R.chunk,L.userComplete=R.complete,L.userError=R.error,R.step=k(R.step),R.chunk=k(R.chunk),R.complete=k(R.complete),R.error=k(R.error),delete R.worker,void L.postMessage({input:y,config:R,workerId:L.id})}var M=null;return l.NODE_STREAM_INPUT,typeof y=="string"?(y=function(Z){return Z.charCodeAt(0)===65279?Z.slice(1):Z}(y),M=R.download?new _(R):new g(R)):y.readable===!0&&k(y.read)&&k(y.on)?M=new f(R):(r.File&&y instanceof File||y instanceof Object)&&(M=new p(R)),M.stream(y)},unparse:function(y,R){var w=!1,L=!0,M=",",Z=`\r
`,B='"',se=B+B,H=!1,I=null,Q=!1;(function(){if(typeof R=="object"){if(typeof R.delimiter!="string"||l.BAD_DELIMITERS.filter(function(ee){return R.delimiter.indexOf(ee)!==-1}).length||(M=R.delimiter),(typeof R.quotes=="boolean"||typeof R.quotes=="function"||Array.isArray(R.quotes))&&(w=R.quotes),typeof R.skipEmptyLines!="boolean"&&typeof R.skipEmptyLines!="string"||(H=R.skipEmptyLines),typeof R.newline=="string"&&(Z=R.newline),typeof R.quoteChar=="string"&&(B=R.quoteChar),typeof R.header=="boolean"&&(L=R.header),Array.isArray(R.columns)){if(R.columns.length===0)throw new Error("Option columns is empty");I=R.columns}R.escapeChar!==void 0&&(se=R.escapeChar+B),(typeof R.escapeFormulae=="boolean"||R.escapeFormulae instanceof RegExp)&&(Q=R.escapeFormulae instanceof RegExp?R.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var re=new RegExp(E(B),"g");if(typeof y=="string"&&(y=JSON.parse(y)),Array.isArray(y)){if(!y.length||Array.isArray(y[0]))return X(null,y,H);if(typeof y[0]=="object")return X(I||Object.keys(y[0]),y,H)}else if(typeof y=="object")return typeof y.data=="string"&&(y.data=JSON.parse(y.data)),Array.isArray(y.data)&&(y.fields||(y.fields=y.meta&&y.meta.fields||I),y.fields||(y.fields=Array.isArray(y.data[0])?y.fields:typeof y.data[0]=="object"?Object.keys(y.data[0]):[]),Array.isArray(y.data[0])||typeof y.data[0]=="object"||(y.data=[y.data])),X(y.fields||[],y.data||[],H);throw new Error("Unable to serialize unrecognized input");function X(ee,be,Te){var fe="";typeof ee=="string"&&(ee=JSON.parse(ee)),typeof be=="string"&&(be=JSON.parse(be));var Ee=Array.isArray(ee)&&0<ee.length,z=!Array.isArray(be[0]);if(Ee&&L){for(var te=0;te<ee.length;te++)0<te&&(fe+=M),fe+=pe(ee[te],te);0<be.length&&(fe+=Z)}for(var Y=0;Y<be.length;Y++){var ue=Ee?ee.length:be[Y].length,ye=!1,O=Ee?Object.keys(be[Y]).length===0:be[Y].length===0;if(Te&&!Ee&&(ye=Te==="greedy"?be[Y].join("").trim()==="":be[Y].length===1&&be[Y][0].length===0),Te==="greedy"&&Ee){for(var N=[],F=0;F<ue;F++){var $=z?ee[F]:F;N.push(be[Y][$])}ye=N.join("").trim()===""}if(!ye){for(var W=0;W<ue;W++){0<W&&!O&&(fe+=M);var ie=Ee&&z?ee[W]:W;fe+=pe(be[Y][ie],W)}Y<be.length-1&&(!Te||0<ue&&!O)&&(fe+=Z)}}return fe}function pe(ee,be){if(ee==null)return"";if(ee.constructor===Date)return JSON.stringify(ee).slice(1,25);var Te=!1;Q&&typeof ee=="string"&&Q.test(ee)&&(ee="'"+ee,Te=!0);var fe=ee.toString().replace(re,se);return(Te=Te||w===!0||typeof w=="function"&&w(ee,be)||Array.isArray(w)&&w[be]||function(Ee,z){for(var te=0;te<z.length;te++)if(-1<Ee.indexOf(z[te]))return!0;return!1}(fe,l.BAD_DELIMITERS)||-1<fe.indexOf(M)||fe.charAt(0)===" "||fe.charAt(fe.length-1)===" ")?B+fe+B:fe}}};if(l.RECORD_SEP=String.fromCharCode(30),l.UNIT_SEP=String.fromCharCode(31),l.BYTE_ORDER_MARK="\uFEFF",l.BAD_DELIMITERS=["\r",`
`,'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!s&&!!r.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=b,l.ParserHandle=h,l.NetworkStreamer=_,l.FileStreamer=p,l.StringStreamer=g,l.ReadableStreamStreamer=f,r.jQuery){var u=r.jQuery;u.fn.parse=function(y){var R=y.config||{},w=[];return this.each(function(Z){if(!(u(this).prop("tagName").toUpperCase()==="INPUT"&&u(this).attr("type").toLowerCase()==="file"&&r.FileReader)||!this.files||this.files.length===0)return!0;for(var B=0;B<this.files.length;B++)w.push({file:this.files[B],inputElem:this,instanceConfig:u.extend({},R)})}),L(),this;function L(){if(w.length!==0){var Z,B,se,H,I=w[0];if(k(y.before)){var Q=y.before(I.file,I.inputElem);if(typeof Q=="object"){if(Q.action==="abort")return Z="AbortError",B=I.file,se=I.inputElem,H=Q.reason,void(k(y.error)&&y.error({name:Z},B,se,H));if(Q.action==="skip")return void M();typeof Q.config=="object"&&(I.instanceConfig=u.extend(I.instanceConfig,Q.config))}else if(Q==="skip")return void M()}var re=I.instanceConfig.complete;I.instanceConfig.complete=function(X){k(re)&&re(X,I.file,I.inputElem),M()},l.parse(I.file,I.instanceConfig)}else k(y.complete)&&y.complete()}function M(){w.splice(0,1),L()}}}function c(y){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(R){var w=A(R);w.chunkSize=parseInt(w.chunkSize),R.step||R.chunk||(w.chunkSize=null),this._handle=new h(w),(this._handle.streamer=this)._config=w}).call(this,y),this.parseChunk=function(R,w){if(this.isFirstChunk&&k(this._config.beforeFirstChunk)){var L=this._config.beforeFirstChunk(R);L!==void 0&&(R=L)}this.isFirstChunk=!1,this._halted=!1;var M=this._partialLine+R;this._partialLine="";var Z=this._handle.parse(M,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var B=Z.meta.cursor;this._finished||(this._partialLine=M.substring(B-this._baseIndex),this._baseIndex=B),Z&&Z.data&&(this._rowCount+=Z.data.length);var se=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(o)r.postMessage({results:Z,workerId:l.WORKER_ID,finished:se});else if(k(this._config.chunk)&&!w){if(this._config.chunk(Z,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);Z=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(Z.data),this._completeResults.errors=this._completeResults.errors.concat(Z.errors),this._completeResults.meta=Z.meta),this._completed||!se||!k(this._config.complete)||Z&&Z.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),se||Z&&Z.meta.paused||this._nextChunk(),Z}this._halted=!0},this._sendError=function(R){k(this._config.error)?this._config.error(R):o&&this._config.error&&r.postMessage({workerId:l.WORKER_ID,error:R,finished:!1})}}function _(y){var R;(y=y||{}).chunkSize||(y.chunkSize=l.RemoteChunkSize),c.call(this,y),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(w){this._input=w,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(R=new XMLHttpRequest,this._config.withCredentials&&(R.withCredentials=this._config.withCredentials),s||(R.onload=x(this._chunkLoaded,this),R.onerror=x(this._chunkError,this)),R.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var w=this._config.downloadRequestHeaders;for(var L in w)R.setRequestHeader(L,w[L])}if(this._config.chunkSize){var M=this._start+this._config.chunkSize-1;R.setRequestHeader("Range","bytes="+this._start+"-"+M)}try{R.send(this._config.downloadRequestBody)}catch(Z){this._chunkError(Z.message)}s&&R.status===0&&this._chunkError()}},this._chunkLoaded=function(){R.readyState===4&&(R.status<200||400<=R.status
2023-10-23 23:40:39 +00:00
`),K=1<D.length&&D[0].length<me[0].length;if(me.length===1||K)return`
`;for(var G=0,q=0;q<me.length;q++)me[q][0]===`
`&&G++;return G>=me.length/2?`\r
`:"\r"}(Y,O)),L=!1,y.delimiter)k(y.delimiter)&&(y.delimiter=y.delimiter(Y),ee.meta.delimiter=y.delimiter);else{var N=function($,W,ie,me,D){var K,G,q,V;D=D||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var ne=0;ne<D.length;ne++){var oe=D[ne],ge=0,J=0,le=0;q=void 0;for(var Se=new b({comments:me,delimiter:oe,newline:W,preview:10}).parse($),Oe=0;Oe<Se.data.length;Oe++)if(ie&&Te(Se.data[Oe]))le++;else{var Le=Se.data[Oe].length;J+=Le,q!==void 0?0<Le&&(ge+=Math.abs(Le-q),q=Le):q=Le}0<Se.data.length&&(J/=Se.data.length-le),(G===void 0||ge<=G)&&(V===void 0||V<J)&&1.99<J&&(G=ge,K=oe,V=J)}return{successful:!!(y.delimiter=K),bestDelimiter:K}}(Y,y.newline,y.skipEmptyLines,y.comments,y.delimitersToGuess);N.successful?y.delimiter=N.bestDelimiter:(L=!0,y.delimiter=l.DefaultDelimiter),ee.meta.delimiter=y.delimiter}var F=A(y);return y.preview&&y.header&&F.preview++,R=Y,w=new b(F),ee=w.parse(R,ue,ye),fe(),re?{meta:{paused:!0}}:ee||{meta:{paused:!1}}},this.paused=function(){return re},this.pause=function(){re=!0,w.abort(),R=k(y.chunk)?"":R.substring(w.getCharIndex())},this.resume=function(){H.streamer._halted?(re=!1,H.streamer.parseChunk(R,!0)):setTimeout(H.resume,3)},this.aborted=function(){return X},this.abort=function(){X=!0,w.abort(),ee.meta.aborted=!0,k(y.complete)&&y.complete(ee),R=""}}function E(y){return y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(y){var R,w=(y=y||{}).delimiter,L=y.newline,M=y.comments,Z=y.step,B=y.preview,se=y.fastMode,H=R=y.quoteChar===void 0||y.quoteChar===null?'"':y.quoteChar;if(y.escapeChar!==void 0&&(H=y.escapeChar),(typeof w!="string"||-1<l.BAD_DELIMITERS.indexOf(w))&&(w=","),M===w)throw new Error("Comment character same as delimiter");M===!0?M="#":(typeof M!="string"||-1<l.BAD_DELIMITERS.indexOf(M))&&(M=!1),L!==`
2023-10-23 23:40:39 +00:00
`&&L!=="\r"&&L!==`\r
`&&(L=`
`);var I=0,Q=!1;this.parse=function(re,X,pe){if(typeof re!="string")throw new Error("Input must be a string");var ee=re.length,be=w.length,Te=L.length,fe=M.length,Ee=k(Z),z=[],te=[],Y=[],ue=I=0;if(!re)return Ge();if(y.header&&!X){var ye=re.split(L)[0].split(w),O=[],N={},F=!1;for(var $ in ye){var W=ye[$];k(y.transformHeader)&&(W=y.transformHeader(W,$));var ie=W,me=N[W]||0;for(0<me&&(F=!0,ie=W+"_"+me),N[W]=me+1;O.includes(ie);)ie=ie+"_"+me;O.push(ie)}if(F){var D=re.split(L);D[0]=O.join(w),re=D.join(L)}}if(se||se!==!1&&re.indexOf(R)===-1){for(var K=re.split(L),G=0;G<K.length;G++){if(Y=K[G],I+=Y.length,G!==K.length-1)I+=L.length;else if(pe)return Ge();if(!M||Y.substring(0,fe)!==M){if(Ee){if(z=[],le(Y.split(w)),nt(),Q)return Ge()}else le(Y.split(w));if(B&&B<=G)return z=z.slice(0,B),Ge(!0)}}return Ge()}for(var q=re.indexOf(w,I),V=re.indexOf(L,I),ne=new RegExp(E(H)+E(R),"g"),oe=re.indexOf(R,I);;)if(re[I]!==R)if(M&&Y.length===0&&re.substring(I,I+fe)===M){if(V===-1)return Ge();I=V+Te,V=re.indexOf(L,I),q=re.indexOf(w,I)}else if(q!==-1&&(q<V||V===-1))Y.push(re.substring(I,q)),I=q+be,q=re.indexOf(w,I);else{if(V===-1)break;if(Y.push(re.substring(I,V)),Le(V+Te),Ee&&(nt(),Q))return Ge();if(B&&z.length>=B)return Ge(!0)}else for(oe=I,I++;;){if((oe=re.indexOf(R,oe+1))===-1)return pe||te.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:z.length,index:I}),Oe();if(oe===ee-1)return Oe(re.substring(I,oe).replace(ne,R));if(R!==H||re[oe+1]!==H){if(R===H||oe===0||re[oe-1]!==H){q!==-1&&q<oe+1&&(q=re.indexOf(w,oe+1)),V!==-1&&V<oe+1&&(V=re.indexOf(L,oe+1));var ge=Se(V===-1?q:Math.min(q,V));if(re.substr(oe+1+ge,be)===w){Y.push(re.substring(I,oe).replace(ne,R)),re[I=oe+1+ge+be]!==R&&(oe=re.indexOf(R,I)),q=re.indexOf(w,I),V=re.indexOf(L,I);break}var J=Se(V);if(re.substring(oe+1+J,oe+1+J+Te)===L){if(Y.push(re.substring(I,oe).replace(ne,R)),Le(oe+1+J+Te),q=re.indexOf(w,I),oe=re.indexOf(R,I),Ee&&(nt(),Q))return Ge();if(B&&z.length>=B)return Ge(!0);break}te.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:z.length,index:I}),oe++}}else oe++}return Oe();function le(Ze){z.push(Ze),ue=I}function Se(Ze){var et=0;if(Ze!==-1){var Xe=re.substring(oe+1,Ze);Xe&&Xe.trim()===""&&(et=Xe.length)}return et}function Oe(Ze){return pe||(Ze===void 0&&(Ze=re.substring(I)),Y.push(Ze),I=ee,le(Y),Ee&&nt()),Ge()}function Le(Ze){I=Ze,le(Y),Y=[],V=re.indexOf(L,I)}function Ge(Ze){return{data:z,errors:te,meta:{delimiter:w,linebreak:L,aborted:Q,truncated:!!Ze,cursor:ue+(X||0)}}}function nt(){Z(Ge()),z=[],te=[]}},this.abort=function(){Q=!0},this.getCharIndex=function(){return I}}function m(y){var R=y.data,w=i[R.workerId],L=!1;if(R.error)w.userError(R.error,R.file);else if(R.results&&R.results.data){var M={abort:function(){L=!0,S(R.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:C,resume:C};if(k(w.userStep)){for(var Z=0;Z<R.results.data.length&&(w.userStep({data:R.results.data[Z],errors:R.results.errors,meta:R.results.meta},M),!L);Z++);delete R.results}else k(w.userChunk)&&(w.userChunk(R.results,M,R.file),delete R.results)}R.finished&&!L&&S(R.workerId,R.results)}function S(y,R){var w=i[y];k(w.userComplete)&&w.userComplete(R),w.terminate(),delete i[y]}function C(){throw new Error("Not implemented.")}function A(y){if(typeof y!="object"||y===null)return y;var R=Array.isArray(y)?[]:{};for(var w in y)R[w]=A(y[w]);return R}function x(y,R){return function(){y.apply(R,arguments)}}function k(y){return typeof y=="function"}return o&&(r.onmessage=function(y){var R=y.data;if(l.WORKER_ID===void 0&&R&&(l.WORKER_ID=R.workerId),typeof R.input=="string")r.postMessage({workerId:l.WORKER_ID,results:l.parse(R.input,R.config),finished:!0});else if(r.File&&R.input instanceof File||R.input instanceof Object){var w=l.parse(R.input,R.config);w&&r.postMessage({workerId:l.WORKER_ID,results:w,finished:!0})}}),(_.prototype=Object.create(c.prototype)).constructor=_,(p.prototype=Object.create(c.prototype)).constructor=p,(g.prototype=Object.create(g.prototype)).constructor=g,(f.prototype=Object.create(c.prototype)).constructor=f,
2023-10-23 23:40:39 +00:00
`+e.model.name+`
installed!`,4,!0),this.$store.dispatch("refreshDiskUsage")}}else Ne.off("install_progress",r),console.log("Install failed"),e.installing=!1,this.showProgress=!1,console.error("Installation failed:",s.error),this.$refs.toast.showToast(`Model:
2023-10-23 23:40:39 +00:00
`+e.model.name+`
failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage");console.log("Here")};Ne.on("install_progress",r),Ne.emit("install_model",{path:n,type:e.model.type}),console.log("Started installation, please wait")},uploadAvatar(t){const e=t.target.files[0],n=new FormData;n.append("avatar",e),console.log("Uploading avatar"),Re.post("/upload_avatar",n).then(r=>{console.log("Avatar uploaded successfully"),this.$refs.toast.showToast("Avatar uploaded successfully!",4,!0);const s=r.data.fileName;console.log("response",r),this.user_avatar=s,this.update_setting("user_avatar",s,()=>{}).then(()=>{})}).catch(r=>{console.error("Error uploading avatar:",r)})},async update_software(){console.log("Posting");const t=await this.api_get_req("update_software");console.log("Posting done"),t.status?this.$refs.toast.showToast("Success!",4,!0):this.$refs.toast.showToast("Failure!",4,!1)},on_loading_text(t){console.log("Loading text",t),this.loading_text=t},async load_everything(){for(this.isLoading=!0,ve(()=>{Ce.replace()});this.isReady===!1;)await new Promise(t=>setTimeout(t,100));console.log("Ready"),this.configFile.model_name&&(this.isModelSelected=!0),this.persCatgArr=await this.api_get_req("list_personalities_categories"),this.persArr=await this.api_get_req("list_personalities?category="+this.configFile.personality_category),console.log("category");try{this.extCatgArr=await this.api_get_req("list_extensions_categories"),console.log(this.extCatgArr)}catch{console.log("Couldn't list catergories"),this.extCatgArr=[]}try{this.extArr=await this.api_get_req("list_extensions?category="+this.extension_category)}catch{console.log("Couldn't list extensions"),this.extCatgArr=[]}console.log("models_zoo:"),console.log(this.models_zoo),this.personality_category=this.configFile.personality_category,this.personalitiesFiltered=this.personalities.filter(t=>t.category===this.configFile.personality_category),console.log("Extensions zoo"),console.log(this.$store.state.extensionsZoo),this.modelsFiltered=this.models_zoo,this.extension_category=this.configFile.extension_category,this.extensionsFiltererd=this.$store.state.extensionsZoo.filter(t=>t.category===this.configFile.extension_category),console.log("Extensions filtered"),console.log(this.extensionsFiltererd),this.isLoading=!1,this.isMounted=!0,this.extension_category=this.configFile.extension_category},async open_mzl(){this.mzl_collapsed=!this.mzl_collapsed,console.log("Fetching models")},async getVramUsage(){await this.api_get_req("vram_usage")},async progressListener(t){if(console.log("received something"),t.status==="progress"){if(this.$refs.modelZoo){const e=this.$refs.modelZoo.findIndex(r=>r.model.name==t.model_name&&this.configFile.binding_name==t.binding_folder),n=this.models_zoo[e];n&&(console.log("model entry",n),n.installing=!0,n.progress=t.progress,console.log(`Progress = ${t.progress}`),t.progress>=100&&(n.installing=!1,n.isInstalled=!0))}}else if(t.status==="succeeded"){if(console.log("Received succeeded"),console.log("Installed successfully"),this.$refs.modelZoo){const e=this.$refs.modelZoo.findIndex(r=>r.model.name==t.model_name&&this.configFile.binding_name==t.binding_folder),n=this.models_zoo[e];n&&(n.installing=!1,n.isInstalled=!0)}this.$refs.toast.showToast(`Model:
2023-10-23 23:40:39 +00:00
`+model_object.name+`
installed!`,4,!0),this.$store.dispatch("refreshDiskUsage")}else if(t.status==="failed"&&(console.log("Install failed"),this.$refs.modelZoo)){const e=this.$refs.modelZoo.findIndex(r=>r.model.name==t.model_name&&this.configFile.binding_name==t.binding_folder),n=this.models_zoo[e];n&&(n.installing=!1,n.isInstalled=!1),console.error("Installation failed:",t.error),this.$refs.toast.showToast(`Model:
`+model_object.name+`
failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage")}},showAddModelDialog(){this.$refs.addmodeldialog.showDialog("").then(()=>{console.log(this.$refs.addmodeldialog.model_path);const t=this.$refs.addmodeldialog.model_path;Ne.emit("install_model",{path:t,type:this.models_zoo[0].type},e=>{console.log("Model installation successful:",e)}),console.log(this.$refs.addmodeldialog.model_path)})},closeAddModelDialog(){this.addModelDialogVisibility=!1},collapseAll(t){this.minconf_collapsed=t,this.bec_collapsed=t,this.mzc_collapsed=t,this.pzc_collapsed=t,this.bzc_collapsed=t,this.pc_collapsed=t,this.mc_collapsed=t,this.sc_collapsed=t,this.mzdc_collapsed=t},fetchPersonalities(){this.api_get_req("list_personalities_categories").then(t=>{this.persCatgArr=t,this.persCatgArr.sort()}),this.api_get_req("list_personalities").then(t=>{this.persArr=t,this.persArr.sort(),console.log(`Listed personalities:
2023-10-23 23:40:39 +00:00
${t}`)})},fetchExtensions(){this.api_get_req("list_extensions_categories").then(t=>{this.extCatgArr=t,this.extCatgArr.sort()}),this.api_get_req("list_extensions").then(t=>{this.extArr=t,this.extArr.sort(),console.log(`Listed extensions:
${t}`)})},fetchHardwareInfos(){this.$store.dispatch("refreshDiskUsage"),this.$store.dispatch("refreshRamUsage")},async onPersonalitySelected(t){if(console.log("on pers",t),this.isLoading&&this.$refs.toast.showToast("Loading... please wait",4,!1),this.isLoading=!0,console.log("selecting ",t),t){if(t.selected){this.$refs.toast.showToast("Personality already selected",4,!0),this.isLoading=!1;return}if(t.isMounted&&this.configFile.personalities.includes(t.full_path)){const e=await this.select_personality(t);console.log("pers is mounted",e),e&&e.status&&e.active_personality_id>-1?this.$refs.toast.showToast(`Selected personality:
`+t.name,4,!0):this.$refs.toast.showToast(`Error on select personality:
`+t.name,4,!1),this.isLoading=!1}else console.log("mounting pers"),this.mountPersonality(t);ve(()=>{Ce.replace()})}},async onExtensionSelected(t){if(console.log("on ext",t),this.isLoading&&this.$refs.toast.showToast("Loading... please wait",4,!1),this.isLoading=!0,console.log("extension",t),t){if(t.selected){this.$refs.toast.showToast("Extension already selected",4,!0),this.isLoading=!1;return}t.isMounted&&this.configFile.extensions.includes(t.full_path)?this.isLoading=!1:(console.log("mounting ext"),this.mountPersonality(t)),ve(()=>{Ce.replace()})}},onSelected(t,e=!1){if(this.isLoading){this.$refs.toast.showToast("Loading... please wait",4,!1);return}t&&(t.isInstalled?(this.configFile.model_name!=t.model.name||e)&&this.update_model(t.model.name).then(n=>{console.log("update_model",n),this.configFile.model_name=t.model.name,n.status?this.refreshModelsZoo().then(()=>{this.updateModelsZoo(),this.$refs.toast.showToast(`Selected model:
`+t.name,4,!0),ve(()=>{Ce.replace()})}):(this.$refs.toast.showToast(`Couldn't select model:
`+t.name,4,!1),ve(()=>{Ce.replace()})),this.settingsChanged=!0,this.isModelSelected=!0}):this.$refs.toast.showToast(`Model:
2023-10-23 23:40:39 +00:00
`+t.model.name+`
is not installed`,4,!1),ve(()=>{Ce.replace()}))},onCopy(t){let e;t.model.isCustomModel?e=`Model name: ${t.name}
2023-10-23 23:40:39 +00:00
File size: ${t.fileSize}
Manually downloaded model `:e=`Model name: ${t.name}
File size: ${t.fileSize}
Download: ${"https://huggingface.co/"+t.quantizer+"/"+t.name}
License: ${t.license}
Owner: ${t.quantizer}
Website: ${"https://huggingface.co/"+t.quantizer}
Description: ${t.description}`,this.$refs.toast.showToast("Copied model info to clipboard!",4,!0),navigator.clipboard.writeText(e.trim())},onCopyLink(t){this.$refs.toast.showToast("Copied link to clipboard!",4,!0),navigator.clipboard.writeText("https://huggingface.co/"+t.model.quantizer+"/"+t.model.name)},onCopyPersonalityName(t){this.$refs.toast.showToast("Copied name to clipboard!",4,!0),navigator.clipboard.writeText(t.name)},onCancelInstall(){const t=this.addModel;console.log("cancel install",t),this.modelDownlaodInProgress=!1,this.addModel={},Ne.emit("cancel_install",{model_name:t.model_name,binding_folder:t.binding_folder,model_url:t.model_url,patreon:model.patreon?model.patreon:"None"}),this.$refs.toast.showToast("Model installation aborted",4,!1)},onInstall(t){this.variant_choices=t.model.variants,this.currenModelToInstall=t,console.log("variant_choices"),console.log(this.variant_choices),console.log(t),this.variantSelectionDialogVisible=!0},onCreateReference(){Re.post("/add_reference_to_local_model",{path:this.reference_path}).then(t=>{t.status?(this.$refs.toast.showToast("Reference created",4,!0),this.refreshModelsZoo().then(()=>{this.updateModelsZoo()})):this.$refs.toast.showToast("Couldn't create reference",4,!1)})},onInstallAddModel(){if(!this.addModel.url){this.$refs.toast.showToast("Link is empty",4,!1);return}let t=this.addModel.url;this.addModel.progress=0,console.log("installing..."),console.log("value ",this.addModel.url),this.modelDownlaodInProgress=!0;const e=n=>{console.log("received something"),n.status&&n.progress<=100?(console.log("Progress",n),this.addModel=n,this.addModel.url=t,this.addModel.progress==100&&(this.modelDownlaodInProgress=!1,console.log("Received succeeded"),Ne.off("install_progress",e),console.log("Installed successfully"),this.addModel={},this.$refs.toast.showToast(`Model:
2023-10-23 23:40:39 +00:00
`+this.addModel.model_name+`
installed!`,4,!0),this.$store.dispatch("refreshDiskUsage"))):(Ne.off("install_progress",e),console.log("Install failed"),this.modelDownlaodInProgress=!1,console.error("Installation failed:",n.error),this.$refs.toast.showToast(`Model:
2023-10-23 23:40:39 +00:00
`+this.addModel.model_name+`
failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};Ne.on("install_progress",e),Ne.emit("install_model",{path:t,type:this.models_zoo[0].type}),console.log("Started installation, please wait")},uploadLocalModel(){if(this.uploadData.length==0){this.$refs.toast.showToast("No files to upload",4,!1);return}let t=this.addModel.url;this.addModel.progress=0,console.log("installing..."),console.log("value ",this.addModel.url),this.modelDownlaodInProgress=!0;const e=n=>{console.log("received something"),n.status&&n.progress<=100?(console.log("Progress",n),this.addModel=n,this.addModel.url=t,this.addModel.progress==100&&(this.modelDownlaodInProgress=!1,console.log("Received succeeded"),Ne.off("progress",e),console.log("Installed successfully"),this.addModel={},this.$refs.toast.showToast(`Model:
2023-10-23 23:40:39 +00:00
`+this.addModel.model_name+`
installed!`,4,!0),this.$store.dispatch("refreshDiskUsage"))):(Ne.off("progress",e),console.log("Install failed"),this.modelDownlaodInProgress=!1,console.error("Installation failed:",n.error),this.$refs.toast.showToast(`Model:
2023-10-23 23:40:39 +00:00
`+this.addModel.model_name+`
failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};Ne.on("progress",e),console.log("Started installation, please wait")},setFileList(t){this.uploadData=t.target.files,console.log("set file list",this.uploadData)},onUninstall(t){this.$refs.yesNoDialog.askQuestion(`Are you sure you want to delete this model?
[`+t.name+"]","Yes","Cancel").then(e=>{if(e){console.log("uninstalling model...");const n=r=>{console.log("uninstalling res",r),r.status?(console.log("uninstalling success",r),t.uninstalling=!1,Ne.off("install_progress",n),this.showProgress=!1,this.refreshModelsZoo().then(()=>{this.updateModelsZoo()}),this.modelsFiltered=this.models_zoo,this.$refs.toast.showToast(`Model:
2023-10-23 23:40:39 +00:00
`+t.model.name+`
was uninstalled!`,4,!0),this.$store.dispatch("refreshDiskUsage")):(console.log("uninstalling failed",r),t.uninstalling=!1,this.showProgress=!1,Ne.off("uninstall_progress",n),console.error("Uninstallation failed:",r.error),this.$refs.toast.showToast(`Model:
2023-10-23 23:40:39 +00:00
`+t.model.name+`
failed to uninstall!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};Ne.on("uninstall_progress",n),self.selected_variant!=null?Ne.emit("uninstall_model",{path:"https://huggingface.co/"+t.model.quantizer+"/"+t.model.name+"/resolve/main/"+this.selected_variant.name,type:t.model.type}):Ne.emit("uninstall_model",{path:"https://huggingface.co/"+t.model.quantizer+"/"+t.model.name,type:t.model.type})}})},onSelectedBinding(t){if(console.log("Binding selected"),!t.binding.installed){this.$refs.toast.showToast(`Binding is not installed:
`+t.binding.name,4,!1);return}this.mzc_collapsed=!0,this.configFile.binding_name!=t.binding.folder&&this.update_binding(t.binding.folder)},onInstallBinding(t){this.configFile.binding_name!=t.binding.folder&&(t.disclaimer?(this.$refs.yesNoDialog.askQuestion(t.disclaimer,"Proceed","Cancel"),res&&this.update_binding(t.binding.folder)):this.update_binding(t.binding.folder))},onUnInstallBinding(t){this.isLoading=!0,Re.post("/unInstall_binding",{name:t.binding.folder}).then(e=>{if(e)return this.isLoading=!1,console.log("unInstall_binding",e),e.data.status?this.$refs.toast.showToast("Reinstalled binding successfully!",4,!0):this.$refs.toast.showToast("Could not reinstall binding",4,!1),e.data;this.isLoading=!1,t.isInstalled=False}).catch(e=>(this.isLoading=!1,this.$refs.toast.showToast(`Could not reinstall binding
`+e.message,4,!1),{status:!1}))},onReinstallBinding(t){this.isLoading=!0,Re.post("/reinstall_binding",{name:t.binding.folder}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_binding",e),e.data.status?this.$refs.toast.showToast("Reinstalled binding successfully!",4,!0):this.$refs.toast.showToast("Could not reinstall binding",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$refs.toast.showToast(`Could not reinstall binding
`+e.message,4,!1),{status:!1}))},upgrade2GPU(){this.isLoading=!0;try{Re.get("/upgrade_to_gpu").then(t=>{this.isLoading=!1,t&&(t.status?(this.$refs.toast.showToast("Upgraded to GPU",4,!0),this.configFile.enable_gpu=!0):this.$refs.toast.showToast("Could not upgrade to GPU. Endpoint error: "+t.error,4,!1))})}catch(t){this.isLoading=!1,this.$refs.toast.showToast("Could not open binding settings. Endpoint error: "+t.message,4,!1)}},onSettingsBinding(t){try{this.isLoading=!0,Re.get("/get_active_binding_settings").then(e=>{this.isLoading=!1,e&&(console.log("binding sett",e),e.data&&Object.keys(e.data).length>0?this.$refs.universalForm.showForm(e.data,"Binding settings - "+t.binding.name,"Save changes","Cancel").then(n=>{try{Re.post("/set_active_binding_settings",n).then(r=>{r&&r.data?(console.log("binding set with new settings",r.data),this.$refs.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$refs.toast.showToast(`Did not get binding settings responses.
2023-10-23 23:40:39 +00:00
`+r,4,!1),this.isLoading=!1)})}catch(r){this.$refs.toast.showToast(`Did not get binding settings responses.
Endpoint error: `+r.message,4,!1),this.isLoading=!1}}):(this.$refs.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1))})}catch(e){this.isLoading=!1,this.$refs.toast.showToast("Could not open binding settings. Endpoint error: "+e.message,4,!1)}},onReloadBinding(t){this.isLoading=!0,Re.post("/reload_binding",{name:t.binding.folder}).then(e=>{if(e)return this.isLoading=!1,console.log("reload_binding",e),e.data.status?this.$refs.toast.showToast("Binding reloaded successfully!",4,!0):this.$refs.toast.showToast("Could not reinstall binding",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$refs.toast.showToast(`Could not reinstall binding
`+e.message,4,!1),{status:!1}))},onSettingsPersonality(t){try{this.isLoading=!0,Re.get("/get_active_personality_settings").then(e=>{this.isLoading=!1,e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this.$refs.universalForm.showForm(e.data,"Personality settings - "+t.personality.name,"Save changes","Cancel").then(n=>{try{Re.post("/set_active_personality_settings",n).then(r=>{r&&r.data?(console.log("personality set with new settings",r.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):(this.$refs.toast.showToast(`Did not get Personality settings responses.
2023-10-23 23:40:39 +00:00
`+r,4,!1),this.isLoading=!1)})}catch(r){this.$refs.toast.showToast(`Did not get Personality settings responses.
Endpoint error: `+r.message,4,!1),this.isLoading=!1}}):(this.$refs.toast.showToast("Personality has no settings",4,!1),this.isLoading=!1))})}catch(e){this.isLoading=!1,this.$refs.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},onMessageBoxOk(){console.log("OK button clicked")},update_personality_category(t,e){this.personality_category=t,e()},update_extension_category(t,e){this.extension_category=t,e()},refresh(){console.log("Refreshing"),this.$store.dispatch("refreshConfig").then(()=>{console.log(this.personality_category),this.api_get_req("list_personalities_categories").then(t=>{console.log("cats",t),this.persCatgArr=t,this.personalitiesFiltered=this.personalities.filter(e=>e.category===this.personality_category),this.personalitiesFiltered.sort()}),this.api_get_req("list_extensions_categories").then(t=>{console.log("cats",t),this.extCatgArr=t,this.extensionsFiltererd=this.$store.state.extensionsZoo.filter(e=>e.category===this.extension_category),this.extensionsFiltererd.sort()})})},toggleAccordion(){this.showAccordion=!this.showAccordion},async update_setting(t,e,n){console.log("Updating setting",t,":",e),this.isLoading=!0;const r={setting_name:t,setting_value:e};let s=await Re.post("/update_setting",r);if(s)return this.isLoading=!1,console.log("update_setting",s),s.status?this.$refs.toast.showToast(`Setting updated successfully.
2023-10-23 23:40:39 +00:00
Don't forget to save to keep the setting permanently.`,4,!0):this.$refs.toast.showToast(`Setting update failed.
Please view the console for more details.`,4,!1),n!==void 0&&n(s),s.data;this.isLoading=!1},async refreshModelsZoo(){await this.$store.dispatch("refreshModelsZoo"),console.log("ModelsZoo refreshed"),await this.$store.dispatch("refreshModels"),console.log("Models refreshed")},async updateModelsZoo(){let t=this.$store.state.modelsZoo;if(t.length==0)return;console.log("loading models_zoo",t);let e=t.findIndex(n=>n.name==this.configFile.model_name);e>0?this.imgModel=t[e].icon:this.imgModel=zn,console.log(`REFRESHING models using sorting ${this.sort_type}`),t.length>1?(this.sort_type==0?(t.sort((n,r)=>{const s=new Date(n.last_commit_time);return new Date(r.last_commit_time)-s}),console.log("Sorted")):this.sort_type==1?t.sort((n,r)=>r.rank-n.rank):this.sort_type==2?t.sort((n,r)=>n.name.localeCompare(r.name)):this.sort_type==3&&t.sort((n,r)=>n.name.localeCompare(r.name)),console.log("Sorted")):console.log("No sorting needed"),console.log("models_zoo"),t.forEach(n=>{n.name==this.$store.state.config.model_name?n.selected=!0:n.selected=!1}),this.models_zoo=t,console.log("models_zoo"),console.log(this.models_zoo);for(let n=0;n<this.$store.state.modelsArr.length;n++){const r=this.$store.state.modelsArr[n];let s=this.models_zoo.findIndex(o=>o.name==r);if(s==-1)for(let o=0;o<this.models_zoo.length;o++){let i=this.models_zoo[o].variants;if(i!=null&&(s=i.findIndex(a=>a.name==r),s!=-1)){s=o,console.log(`Found ${r} at index ${s}`);break}}if(s==-1){let o={};o.name=r,o.icon="",o.isCustomModel=!0,o.isInstalled=!0,this.models_zoo.push(o)}else this.models_zoo[s].isInstalled=!0}this.models_zoo.sort((n,r)=>n.isInstalled&&!r.isInstalled?-1:!n.isInstalled&&r.isInstalled?1:0)},update_binding(t){this.isLoading=!0,this.$store.state.modelsZoo=[],this.configFile.model_name=null,this.$store.state.config.model_name=null,console.log("updating binding_name"),this.update_setting("binding_name",t,async e=>{console.log("updated binding_name"),await this.$store.dispatch("refreshConfig"),await this.refreshModelsZoo(),await this.updateModelsZoo();const n=this.bindingsArr.findIndex(s=>s.folder==t),r=this.bindingsArr[n];r&&(r.installed=!0),this.settingsChanged=!0,this.isLoading=!1,ve(()=>{Ce.replace()}),console.log("updating model"),this.update_model(null).then(()=>{}),ve(()=>{Ce.replace()})}),ve(()=>{Ce.replace()})},async update_model(t){t||(this.isModelSelected=!1),this.isLoading=!0;let e=await this.update_setting("model_name",t);return this.isLoading=!1,ve(()=>{Ce.replace()}),e},applyConfiguration(){this.isLoading=!0,Re.post("/apply_settings",{config:this.configFile}).then(t=>{this.isLoading=!1,t.data.status?(this.$refs.toast.showToast("Configuration changed successfully.",4,!0),this.settingsChanged=!1):this.$refs.toast.showToast("Configuration change failed.",4,!1),ve(()=>{Ce.replace()})})},save_configuration(){this.showConfirmation=!1,Re.post("/save_settings",{}).then(t=>{if(t)return t.status||this.$refs.messageBox.showMessage("Error: Couldn't save settings!"),t.data}).catch(t=>(console.log(t.message,"save_configuration"),this.$refs.messageBox.showMessage("Couldn't save settings!"),{status:!1}))},reset_configuration(){this.$refs.yesNoDialog.askQuestion(`Are you sure?
This will delete all your configurations and get back to default configuration.`).then(t=>{t&&Re.post("/reset_settings",{}).then(e=>{if(e)return e.status?this.$refs.messageBox.showMessage("Settings have been reset correctly"):this.$refs.messageBox.showMessage("Couldn't reset settings!"),e.data}).catch(e=>(console.log(e.message,"reset_configuration"),this.$refs.messageBox.showMessage("Couldn't reset settings!"),{status:!1}))})},async api_get_req(t){try{const e=await Re.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - settings");return}},closeToast(){this.showToast=!1},async getPersonalitiesArr(){this.isLoading=!0,this.personalities=[];const t=await this.api_get_req("get_all_personalities"),e=this.$store.state.config,n=Object.keys(t);for(let r=0;r<n.length;r++){const s=n[r],i=catdictionary[s].map(a=>{const l=e.personalities.includes(s+"/"+a.folder);let u={};return u=a,u.category=s,u.language=langkey,u.full_path=s+"/"+a.folder,u.isMounted=l,u});this.personalities.length==0?this.personalities=i:this.personalities=this.personalities.concat(i)}this.personalities.sort((r,s)=>r.name.localeCompare(s.name)),this.personalitiesFiltered=this.personalities.filter(r=>r.category===this.configFile.personality_category),this.personalitiesFiltered.sort(),console.log("per filtered",this.personalitiesFiltered),this.isLoading=!1},async filterPersonalities(){if(!this.searchPersonality){this.personalitiesFiltered=this.personalities.filter(n=>n.category===this.configFile.personality_category),this.personalitiesFiltered.sort(),this.searchPersonalityInProgress=!1;return}const t=this.searchPersonality.toLowerCase(),e=this.personalities.filter(n=>{if(n.name&&n.name.toLowerCase().includes(t)||n.description&&n.description.toLowerCase().includes(t)||n.full_path&&n.full_path.toLowerCase().includes(t))return n});e.length>0?this.personalitiesFiltered=e.sort():(this.personalitiesFiltered=this.personalities.filter(n=>n.category===this.configFile.personality_category),this.personalitiesFiltered.sort()),this.searchPersonalityInProgress=!1},async filterExtensions(){if(!this.searchExtension){this.personalitiesFiltered=this.extensions.filter(n=>n.category===this.extension_category),this.personalitiesFiltered.sort(),this.searchExtensionInProgress=!1;return}const t=this.searchExtension.toLowerCase(),e=this.personalities.filter(n=>{if(n.name&&n.name.toLowerCase().includes(t)||n.description&&n.description.toLowerCase().includes(t)||n.full_path&&n.full_path.toLowerCase().includes(t))return n});e.length>0?this.personalitiesFiltered=e.sort():(this.personalitiesFiltered=this.personalities.filter(n=>n.category===this.configFile.personality_category),this.personalitiesFiltered.sort()),this.searchExtensionInProgress=!1},async filterModels(){if(!this.searchModel){console.log("Searching model"),this.modelsFiltered=this.models_zoo,this.searchModelInProgress=!1;return}const t=this.searchModel.toLowerCase();this.is_loading_zoo=!0,console.log("filtering models");const e=this.models_zoo.filter(n=>{if(n.name&&n.name.toLowerCase().includes(t)||n.description&&n.description.toLowerCase().includes(t)||n.category&&n.category.toLowerCase().includes(t))return n});this.is_loading_zoo=!1,e.length>0?this.modelsFiltered=e:this.modelsFiltered=this.models_zoo,this.searchModelInProgress=!1},computedFileSize(t){return Xt(t)},async mount_personality(t){if(!t)return{status:!1,error:"no personality - mount_personality"};try{const e={language:t.language,category:t.category,folder:t.folder},n=await Re.post("/mount_personality",e);if(n)return n.data}catch(e){console.log(e.message,"mount_personality - settings");return}},async unmount_personality(t){if(!t)return{status:!1,error:"no personality - unmount_personality"};const e={language:t.language,category:t.category,folder:t.folder};try{const n=await Re.post("/unmount_personality",e);if(n)return n.data}catch(n){console.log(n.message,"unmount_personality - settings");return}},async select_personality(t){if(!t)return{status:!1,error:"no personality - select_personality"};const n={id:this.configFile.personalities.findIndex(r=>r=
2023-10-23 23:40:39 +00:00
`+t.personality.name,4,!0),this.$store.dispatch("refreshMountedPersonalities")):(t.isMounted=!1,this.$refs.toast.showToast(`Could not mount personality
Error: `+e.error+`
Response:
`+e,4,!1)),this.isLoading=!1},async unmountPersonality(t){if(this.isLoading=!0,!t)return;const e=await this.unmount_personality(t.personality||t);if(e.status){this.configFile.personalities=e.personalities,this.$refs.toast.showToast("Personality unmounted",4,!0);const n=this.personalities.findIndex(a=>a.full_path==t.full_path),r=this.personalitiesFiltered.findIndex(a=>a.full_path==t.full_path),s=this.$refs.personalitiesZoo.findIndex(a=>a.full_path==t.full_path);console.log("ppp",this.personalities[n]),this.personalities[n].isMounted=!1,r>-1&&(this.personalitiesFiltered[r].isMounted=!1),s>-1&&(this.$refs.personalitiesZoo[s].isMounted=!1),this.$store.dispatch("refreshMountedPersonalities");const o=this.mountedPersArr[this.mountedPersArr.length-1];console.log(o,this.mountedPersArr.length),(await this.select_personality(t.personality)).status&&this.$refs.toast.showToast(`Selected personality:
`+o.name,4,!0)}else this.$refs.toast.showToast(`Could not unmount personality
2023-10-28 22:34:17 +00:00
Error: `+e.error,4,!1);this.isLoading=!1},async remountPersonality(t){await this.unmountPersonality(t),await this.mountPersonality(t)},async mountExtension(t){if(this.isLoading=!0,console.log("mount ext",t),!t)return;if(this.configFile.personalities.includes(t.extension.full_path)){this.isLoading=!1,this.$refs.toast.showToast("Extension already mounted",4,!1);return}const e=await this.mount_extension(t.extension);console.log("mount_extension res",e),e&&e.status&&e.extensions.includes(t.extension.full_path)?(this.configFile.extensions=e.extensions,this.$refs.toast.showToast("Extension mounted",4,!0),t.isMounted=!0,this.$store.dispatch("refreshMountedExtensions")):(t.isMounted=!1,this.$refs.toast.showToast(`Could not mount extension
2023-10-23 23:40:39 +00:00
Error: `+e.error+`
Response:
`+e,4,!1)),this.isLoading=!1},async unmountExtension(t){if(this.isLoading=!0,!t)return;const e=await this.unmount_personality(t.personality||t);if(e.status){this.configFile.personalities=e.personalities,this.$refs.toast.showToast("Extension unmounted",4,!0);const n=this.personalities.findIndex(i=>i.full_path==t.full_path),r=this.personalitiesFiltered.findIndex(i=>i.full_path==t.full_path),s=this.$refs.personalitiesZoo.findIndex(i=>i.full_path==t.full_path);console.log("ppp",this.personalities[n]),this.personalities[n].isMounted=!1,r>-1&&(this.personalitiesFiltered[r].isMounted=!1),s>-1&&(this.$refs.personalitiesZoo[s].isMounted=!1),this.$store.dispatch("refreshMountedPersonalities");const o=this.mountedPersArr[this.mountedPersArr.length-1];console.log(o,this.mountedPersArr.length)}else this.$refs.toast.showToast(`Could not unmount extension
Error: `+e.error,4,!1);this.isLoading=!1},async remountExtension(t){await this.unmountExtension(t),await this.mountExtension(t)},onPersonalityReinstall(t){console.log("on reinstall ",t),this.isLoading=!0,Re.post("/reinstall_personality",{name:t.personality.path}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this.$refs.toast.showToast("Personality reinstalled successfully!",4,!0):this.$refs.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$refs.toast.showToast(`Could not reinstall personality
`+e.message,4,!1),{status:!1}))},personalityImgPlacehodler(t){t.target.src=ms},searchPersonality_func(){clearTimeout(this.searchPersonalityTimer),this.searchPersonality&&(this.searchPersonalityInProgress=!0,setTimeout(this.filterPersonalities,this.searchPersonalityTimerInterval))},searchModel_func(){clearTimeout(this.searchModelTimer),this.searchModel&&(this.searchModelInProgress=!0,setTimeout(this.filterModels,this.searchModelTimer))}},async mounted(){console.log("Getting voices"),this.getVoices(),this.updateModelsZoo(),console.log("Constructing"),this.load_everything()},activated(){},computed:{isReady:{get(){return this.$store.state.ready}},audio_out_voice:{get(){return this.$store.state.config.audio_out_voice},set(t){this.$store.state.config.audio_out_voice=t}},audioLanguages(){return[{code:"en-US",name:"English (US)"},{code:"en-GB",name:"English (UK)"},{code:"es-ES",name:"Spanish (Spain)"},{code:"es-MX",name:"Spanish (Mexico)"},{code:"fr-FR",name:"French (France)"},{code:"fr-CA",name:"French (Canada)"},{code:"de-DE",name:"German (Germany)"},{code:"it-IT",name:"Italian (Italy)"},{code:"pt-BR",name:"Portuguese (Brazil)"},{code:"pt-PT",name:"Portuguese (Portugal)"},{code:"ru-RU",name:"Russian (Russia)"},{code:"zh-CN",name:"Chinese (China)"},{code:"ja-JP",name:"Japanese (Japan)"},{code:"ar-SA",name:"Arabic (Saudi Arabia)"},{code:"tr-TR",name:"Turkish (Turkey)"},{code:"ms-MY",name:"Malay (Malaysia)"},{code:"ko-KR",name:"Korean (South Korea)"},{code:"nl-NL",name:"Dutch (Netherlands)"},{code:"sv-SE",name:"Swedish (Sweden)"},{code:"da-DK",name:"Danish (Denmark)"},{code:"fi-FI",name:"Finnish (Finland)"},{code:"no-NO",name:"Norwegian (Norway)"},{code:"pl-PL",name:"Polish (Poland)"},{code:"el-GR",name:"Greek (Greece)"},{code:"hu-HU",name:"Hungarian (Hungary)"},{code:"cs-CZ",name:"Czech (Czech Republic)"},{code:"th-TH",name:"Thai (Thailand)"},{code:"hi-IN",name:"Hindi (India)"},{code:"he-IL",name:"Hebrew (Israel)"},{code:"id-ID",name:"Indonesian (Indonesia)"},{code:"vi-VN",name:"Vietnamese (Vietnam)"},{code:"uk-UA",name:"Ukrainian (Ukraine)"},{code:"ro-RO",name:"Romanian (Romania)"},{code:"bg-BG",name:"Bulgarian (Bulgaria)"},{code:"hr-HR",name:"Croatian (Croatia)"},{code:"sr-RS",name:"Serbian (Serbia)"},{code:"sk-SK",name:"Slovak (Slovakia)"},{code:"sl-SI",name:"Slovenian (Slovenia)"},{code:"et-EE",name:"Estonian (Estonia)"},{code:"lv-LV",name:"Latvian (Latvia)"},{code:"lt-LT",name:"Lithuanian (Lithuania)"},{code:"ka-GE",name:"Georgian (Georgia)"},{code:"hy-AM",name:"Armenian (Armenia)"},{code:"az-AZ",name:"Azerbaijani (Azerbaijan)"},{code:"kk-KZ",name:"Kazakh (Kazakhstan)"},{code:"uz-UZ",name:"Uzbek (Uzbekistan)"},{code:"kkj-CM",name:"Kako (Cameroon)"},{code:"my-MM",name:"Burmese (Myanmar)"},{code:"ne-NP",name:"Nepali (Nepal)"},{code:"si-LK",name:"Sinhala (Sri Lanka)"}]},configFile:{get(){return this.$store.state.config},set(t){this.$store.commit("setConfig",t)}},userName:{get(){return this.$store.state.config.user_name},set(t){this.$store.state.config.user_name=t}},user_avatar:{get(){return"/user_infos/"+this.$store.state.config.user_avatar},set(t){this.$store.state.config.user_avatar=t}},enable_gpu:{get(){return this.$store.state.config.enable_gpu},set(t){this.$store.state.config.enable_gpu=t}},auto_update:{get(){return this.$store.state.config.auto_update},set(t){this.$store.state.config.auto_update=t}},auto_speak:{get(){return this.$store.state.config.auto_speak},set(t){this.$store.state.config.auto_speak=t}},audio_pitch:{get(){return this.$store.state.config.audio_pitch},set(t){this.$store.state.config.audio_pitch=t}},audio_in_language:{get(){return this.$store.state.config.audio_in_language},set(t){this.$store.state.config.audio_in_language=t}},use_user_name_in_discussions:{get(){return this.$store.state.config.use_user_name_in_discussions},set(t){this.$store.state.config.use_user_name_in_discussions=t}},db_path:{get(){return this.$store.state.config.db_path},set(t){this.$store.state.config.db_path=t}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPe
2023-10-23 23:40:39 +00:00
You need to apply changes before you leave, or else.`,"Apply configuration","Cancel")&&this.applyConfiguration(),!1;if(!this.isModelSelected)return await this.$refs.yesNoDialog.askQuestion(`Did You forgot to select model?
You need to select model before you leave, or else.`,"Ok","Cancel"),!1}},ae=t=>(hr("data-v-2ffc044d"),t=t(),Er(),t),yWe={class:"container overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 overflow-y-scroll w-full dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},vWe={class:"sticky top-0 z-10 flex flex-row mb-2 p-3 gap-3 w-full rounded-b-lg bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg"},TWe={key:0,class:"flex gap-3 flex-1 items-center duration-75"},CWe=ae(()=>d("i",{"data-feather":"x"},null,-1)),RWe=[CWe],xWe=ae(()=>d("i",{"data-feather":"check"},null,-1)),OWe=[xWe],AWe={key:1,class:"flex gap-3 flex-1 items-center"},NWe=ae(()=>d("i",{"data-feather":"save"},null,-1)),wWe=[NWe],IWe=ae(()=>d("i",{"data-feather":"refresh-ccw"},null,-1)),DWe=[IWe],kWe=ae(()=>d("i",{"data-feather":"list"},null,-1)),MWe=[kWe],LWe={class:"flex gap-3 flex-1 items-center justify-end"},PWe=ae(()=>d("i",{"data-feather":"trash-2"},null,-1)),FWe=[PWe],UWe=ae(()=>d("i",{"data-feather":"refresh-ccw"},null,-1)),BWe=[UWe],GWe=ae(()=>d("i",{"data-feather":"arrow-up-circle"},null,-1)),qWe={key:0},YWe=ae(()=>d("i",{"data-feather":"alert-circle"},null,-1)),VWe=[YWe],zWe={class:"flex gap-3 items-center"},HWe={key:0,class:"flex gap-3 items-center"},$We=ae(()=>d("p",{class:"text-red-600 font-bold"},"Apply changes:",-1)),WWe=ae(()=>d("i",{"data-feather":"check"},null,-1)),KWe=[WWe],QWe={key:1,role:"status"},jWe=ae(()=>d("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[d("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),d("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1)),ZWe=ae(()=>d("span",{class:"sr-only"},"Loading...",-1)),XWe={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},JWe={class:"flex flex-row p-3"},eKe=ae(()=>d("i",{"data-feather":"chevron-right"},null,-1)),tKe=[eKe],nKe=ae(()=>d("i",{"data-feather":"chevron-down"},null,-1)),rKe=[nKe],sKe=ae(()=>d("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),oKe=ae(()=>d("div",{class:"mr-2"},"|",-1)),iKe={class:"text-base font-semibold cursor-pointer select-none items-center"},aKe={class:"flex gap-2 items-center"},lKe={key:0},cKe={class:"flex gap-2 items-center"},dKe=["src"],uKe={class:"font-bold font-large text-lg"},_Ke={key:1},pKe={class:"flex gap-2 items-center"},mKe=["src"],gKe={class:"font-bold font-large text-lg"},fKe=ae(()=>d("i",{"data-feather":"cpu",title:"CPU Ram",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),hKe={class:"font-bold font-large text-lg"},EKe=ae(()=>d("i",{"data-feather":"hard-drive",title:"Hard drive",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),bKe={class:"font-bold font-large text-lg"},SKe={class:"mb-2"},yKe=ae(()=>d("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-whi
`];let a=-1;return i.forEach(l=>{const u=o.lastIndexOf(l);u>a&&(a=u)}),a==-1&&(a=o.length),console.log(a),a+s+1},r=()=>{if(this.message.content.includes(".")){const s=n(t),o=this.message.content.substring(t,s);this.msg.text=o,t=s+1,this.msg.onend=i=>{t<this.message.content.length-2?setTimeout(()=>{r()},1):(this.isSpeaking=!1,console.log("voice off :",this.message.content.length," ",s))},this.speechSynthesis.speak(this.msg)}else setTimeout(()=>{r()},1)};r()},toggleModel(){this.expanded=!this.expanded},copyContentToClipboard(){this.$emit("copy",this)},deleteMsg(){this.$emit("delete",this.message.id),this.deleteMsgMode=!1},rankUp(){this.$emit("rankUp",this.message.id)},rankDown(){this.$emit("rankDown",this.message.id)},updateMessage(){this.$emit("updateMessage",this.message.id,this.message.content),this.editMsgMode=!1},resendMessage(){this.$emit("resendMessage",this.message.id,this.message.content)},continueMessage(){this.$emit("continueMessage",this.message.id,this.message.content)},getImgUrl(){return this.avatar?(console.log("Avatar:",eS+this.avatar),eS+this.avatar):(console.log("No avatar found"),Ks)},defaultImg(t){t.target.src=Ks},parseDate(t){let e=new Date(Date.parse(t)),r=Math.floor((new Date-e)/1e3);return r<=1?"just now":r<20?r+" seconds ago":r<40?"half a minute ago":r<60?"less than a minute ago":r<=90?"one minute ago":r<=3540?Math.round(r/60)+" minutes ago":r<=5400?"1 hour ago":r<=86400?Math.round(r/3600)+" hours ago":r<=129600?"1 day ago":r<604800?Math.round(r/86400)+" days ago":r<=777600?"1 week ago":t},prettyDate(t){let e=new Date((t||"").replace(/-/g,"/").replace(/[TZ]/g," ")),n=(new Date().getTime()-e.getTime())/1e3,r=Math.floor(n/86400);if(!(isNaN(r)||r<0||r>=31))return r==0&&(n<60&&"just now"||n<120&&"1 minute ago"||n<3600&&Math.floor(n/60)+" minutes ago"||n<7200&&"1 hour ago"||n<86400&&Math.floor(n/3600)+" hours ago")||r==1&&"Yesterday"||r<7&&r+" days ago"||r<31&&Math.ceil(r/7)+" weeks ago"},checkForFullSentence(){if(this.message.content.trim().split(" ").length>3){this.speak();return}}},watch:{"message.content":function(t){this.$store.state.config.auto_speak&&(this.isSpeaking||this.checkForFullSentence())},"message.ui":function(t){console.log("ui changed"),console.log(this.message_ui)},showConfirmation(){ve(()=>{Ce.replace()})},editMsgMode(t){ve(()=>{Ce.replace()})},deleteMsgMode(){ve(()=>{Ce.replace()})}},computed:{message_ui:{get(){return this.message.ui}},isTalking:{get(){return this.isSpeaking}},created_at(){return this.prettyDate(this.message.created_at)},created_at_parsed(){return new Date(Date.parse(this.message.created_at)).toLocaleString()},finished_generating_at_parsed(){return new Date(Date.parse(this.message.finished_generating_at)).toLocaleString()},time_spent(){const t=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===t.getTime()||!e.getTime())return;let r=e.getTime()-t.getTime();const s=Math.floor(r/(1e3*60*60));r-=s*(1e3*60*60);const o=Math.floor(r/(1e3*60));r-=o*(1e3*60);const i=Math.floor(r/1e3);r-=i*1e3;function a(u){return u<10&&(u="0"+u),u}return a(s)+"h:"+a(o)+"m:"+a(i)+"s"}}},Vtt={class:"relative group rounded-lg m-2 shadow-lg hover:border-primary dark:hover:border-primary hover:border-solid hover:border-2 border-2 border-transparent even:bg-bg-light-discussion-odd dark:even:bg-bg-dark-discussion-odd flex flex-col flex-grow flex-wrap overflow-visible p-4 pb-2"},ztt={class:"flex flex-row gap-2"},Htt={class:"flex-shrink-0"},$tt={class:"group/avatar"},Wtt=["src","data-popover-target"],Ktt={class:"flex flex-col w-full flex-grow-0"},Qtt={class:"flex flex-row flex-grow items-start"},jtt={class:"flex flex-col mb-2"},Ztt={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},Xtt=["title"],Jtt=d("div",{class:"flex-grow"},null,-1),ent={class:"flex-row justify-end mx-2"},tnt={class:"invisible group-hover:visible flex flex-row"},nnt={key:0,class:"flex items-center duration-75"},rnt=d("i",{"data-feather":"x"},null,-1),snt=[rnt],ont=d("i",{"data-feather":"check"},null,-1),int=[ont],ant=d("i",{"data-feather":"edit"
`,36)),[[De,n.message.content]]):U("",!0)]),n.message.metadata!==null?(v(),T("div",knt,[(v(!0),T(we,null,Be(n.message.metadata,(_,p)=>(v(),T("div",{key:"json-"+n.message.id+"-"+p,class:"json font-bold"},[he(u,{jsonFormText:_.title,jsonData:_.content},null,8,["jsonFormText","jsonData"])]))),128))])):U("",!0),n.message.ui!==null&&n.message.ui!==void 0&&n.message.ui!==""?(v(),rt(c,{key:2,class:"w-full h-full",code:o.message_ui},null,8,["code"])):U("",!0)]),d("div",Mnt,[d("div",Lnt,[n.message.binding?(v(),T("p",Pnt,[xe("Binding: "),d("span",Fnt,j(n.message.binding),1)])):U("",!0),n.message.model?(v(),T("p",Unt,[xe("Model: "),d("span",Bnt,j(n.message.model),1)])):U("",!0),n.message.seed?(v(),T("p",Gnt,[xe("Seed: "),d("span",qnt,j(n.message.seed),1)])):U("",!0),o.time_spent?(v(),T("p",Ynt,[xe("Time spent: "),d("span",{class:"font-thin",title:"Finished generating: "+o.finished_generating_at_parsed},j(o.time_spent),9,Vnt)])):U("",!0)])])])])])}const hT=Ye(Ytt,[["render",znt]]),Hnt="/";Re.defaults.baseURL="/";const $nt={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{UniversalForm:vp},data(){return{bUrl:Hnt,isMounted:!1,show:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.constructor()},computed:{configFile:{get(){return this.$store.state.config},set(t){this.$store.commit("setConfig",t)}},mountedPers:{get(){return this.$store.state.mountedPers},set(t){this.$store.commit("setMountedPers",t)}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(t){this.$store.commit("setMountedPers",t)}}},methods:{onSettingsPersonality(t){try{Re.get("/get_active_personality_settings").then(e=>{e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this.$refs.universalForm.showForm(e.data,"Personality settings - "+t.name,"Save changes","Cancel").then(n=>{try{Re.post("/set_active_personality_settings",n).then(r=>{r&&r.data?(console.log("personality set with new settings",r.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses.
2023-10-23 23:40:39 +00:00
`+r,4,!1)})}catch(r){this.$refs.toast.showToast(`Did not get Personality settings responses.
Endpoint error: `+r.message,4,!1)}}):this.$refs.toast.showToast("Personality has no settings",4,!1))})}catch(e){this.$refs.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},toggleShowPersList(){this.onShowPersList()},async constructor(){for(ve(()=>{Ce.replace()});this.$store.state.ready===!1;)await new Promise(t=>setTimeout(t,100));this.onReady()},async api_get_req(t){try{const e=await Re.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(t){t.target.src=ms}}},Wnt={class:"w-fit select-none"},Knt={key:0,class:"flex -space-x-4"},Qnt=["src","title"],jnt={key:1,class:"flex -space-x-4"},Znt=["src","title"],Xnt={key:2,title:"Loading personalities"},Jnt=d("div",{role:"status"},[d("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[d("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),d("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),d("span",{class:"sr-only"},"Loading...")],-1),ert=[Jnt];function trt(t,e,n,r,s,o){const i=Pe("UniversalForm");return v(),T(we,null,[d("div",Wnt,[o.mountedPersArr.length>1?(v(),T("div",Knt,[d("img",{src:s.bUrl+o.mountedPers.avatar,onError:e[0]||(e[0]=(...a)=>o.personalityImgPlacehodler&&o.personalityImgPlacehodler(...a)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-secondary cursor-pointer",title:"Active personality: "+o.mountedPers.name,onClick:e[1]||(e[1]=a=>o.onSettingsPersonality(o.mountedPers))},null,40,Qnt),d("div",{class:"flex items-center justify-center w-8 h-8 cursor-pointer text-xs font-medium bg-bg-light dark:bg-bg-dark border-2 hover:border-secondary rounded-full hover:bg-bg-light-tone dark:hover:bg-bg-dark-tone dark:border-gray-800 hover:z-20 hover:-translate-y-2 duration-150 active:scale-90",onClick:e[2]||(e[2]=_e((...a)=>o.toggleShowPersList&&o.toggleShowPersList(...a),["stop"])),title:"Click to show more"},"+"+j(o.mountedPersArr.length-1),1)])):U("",!0),o.mountedPersArr.length==1?(v(),T("div",jnt,[d("img",{src:s.bUrl+this.$store.state.mountedPers.avatar,onError:e[3]||(e[3]=(...a)=>o.personalityImgPlacehodler&&o.personalityImgPlacehodler(...a)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 cursor-pointer border-secondary",title:"Active personality: "+this.$store.state.mountedPers.name,onClick:e[4]||(e[4]=_e((...a)=>o.toggleShowPersList&&o.toggleShowPersList(...a),["stop"]))},null,40,Znt)])):U("",!0),o.mountedPersArr.length==0?(v(),T("div",Xnt,ert)):U("",!0)]),he(i,{ref:"universalForm",class:"z-20"},null,512)],64)}const nrt=Ye($nt,[["render",trt]]);const rrt="/";Re.defaults.baseURL="/";const srt={props:{onTalk:Function,onMounted:Function,onUnmounted:Function,onRemounted:Function,discussionPersonalities:Array,onShowPersList:Function},components:{PersonalityEntry:mT,Toast:ds,UniversalForm:vp},name:"MountedPersonalitiesList",data(){return{bUrl:rrt,isMounted:!1,isLoading:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activa
`+e.message,4,!1),{status:!1}))},onPersonalityMounted(t){this.mountPersonality(t)},onPersonalityUnMounted(t){this.unmountPersonality(t)},onPersonalityRemount(t){this.reMountPersonality(t)},async handleOnTalk(t){if(Ce.replace(),console.log("ppa",t),t){if(t.isMounted){const e=await this.select_personality(t);e&&e.status&&(await this.constructor(),this.$refs.toast.showToast(`Selected personality:
`+t.name,4,!0))}else this.onPersonalityMounted(t);this.onTalk(t)}},async onPersonalitySelected(t){if(Ce.replace(),console.log("Selected personality : ",JSON.stringify(t.personality)),t){if(t.selected){this.$refs.toast.showToast("Personality already selected",4,!0);return}if(t.isMounted){const e=await this.select_personality(t);e&&e.status&&(await this.constructor(),this.$refs.toast.showToast(`Selected personality:
`+t.name,4,!0))}else this.onPersonalityMounted(t)}},onSettingsPersonality(t){try{Re.get("/get_active_personality_settings").then(e=>{e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this.$refs.universalForm.showForm(e.data,"Personality settings - "+t.personality.name,"Save changes","Cancel").then(n=>{try{Re.post("/set_active_personality_settings",n).then(r=>{r&&r.data?(console.log("personality set with new settings",r.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses.
2023-10-23 23:40:39 +00:00
`+r,4,!1)})}catch(r){this.$refs.toast.showToast(`Did not get Personality settings responses.
Endpoint error: `+r.message,4,!1)}}):this.$refs.toast.showToast("Personality has no settings",4,!1))})}catch(e){this.$refs.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},async mount_personality(t){if(!t)return{status:!1,error:"no personality - mount_personality"};try{const e={category:t.category,folder:t.folder,language:t.language},n=await Re.post("/mount_personality",e);if(n)return n.data}catch(e){console.log(e.message,"mount_personality - settings");return}},async remount_personality(t){if(!t)return{status:!1,error:"no personality - mount_personality"};try{const e={category:t.category,folder:t.folder,language:t.language},n=await Re.post("/remount_personality",e);if(n)return n.data}catch(e){console.log(e.message,"remount_personality - settings");return}},async unmount_personality(t){if(!t)return{status:!1,error:"no personality - unmount_personality"};const e={category:t.category,folder:t.folder,language:t.language};try{const n=await Re.post("/unmount_personality",e);if(n)return n.data}catch(n){console.log(n.message,"unmount_personality - settings");return}},async select_personality(t){if(!t)return{status:!1,error:"no personality - select_personality"};let e=-1;if(console.log("Personality full path : ",t.full_path),console.log("Personality language : ",t.personality.language),t.personality.language!=null&&t.personality.language!=null?(console.log("Mounting a localized version of personality"),console.log("Mounted personalities :",JSON.stringify(this.configFile.personalities)),console.log("Personality to select: ",t.full_path+":"+t.personality.language),e=this.configFile.personalities.findIndex(n=>n===t.full_path+":"+t.personality.language)):(console.log("Mounted personalities :",JSON.stringify(this.configFile.personalities)),e=this.configFile.personalities.findIndex(n=>n===t.full_path)),e>-1){console.log("Selecting personality with id:",JSON.stringify(e));const n={id:e};try{const r=await Re.post("/select_personality",n);if(r)return this.$store.dispatch("refreshConfig").then(()=>{console.log("recovered config",this.configFile.active_personality_id),this.$store.dispatch("refreshPersonalitiesZoo").then(()=>{this.$store.dispatch("refreshMountedPersonalities")})}),r.data}catch(r){console.log(r,"select_personality - settings");return}}else return console.log("Personality id is wrong"),this.$refs.toast.showToast("Personality id is wrong!",4,!1),{status:!1,error:"Personality id is wrong"}},async mountPersonality(t){if(console.log("mount pers",t),!t)return;if(this.configFile.personalities.includes(t.personality.full_path)){this.$refs.toast.showToast("Personality already mounted",4,!1);return}const e=await this.mount_personality(t.personality);console.log("mount_personality res",e),e.status?(this.configFile.personalities=e.personalities,this.$refs.toast.showToast("Personality mounted",4,!0),t.isMounted=!0,this.onMounted(this),(await this.select_personality(t.personality)).status&&this.$refs.toast.showToast(`Selected personality:
2023-10-23 23:40:39 +00:00
`+t.personality.name,4,!0),this.getMountedPersonalities()):(t.isMounted=!1,this.$refs.toast.showToast(`Could not mount personality
Error: `+e.error,4,!1))},async reMountPersonality(t){if(console.log("remount pers",t),!t)return;if(!this.configFile.personalities.includes(t.personality.full_path)){this.$refs.toast.showToast("Personality not mounted",4,!1);return}const e=await this.remount_personality(t.personality);console.log("remount_personality res",e),e.status?(this.configFile.personalities=e.personalities,this.$refs.toast.showToast("Personality remounted",4,!0),t.isMounted=!0,this.onMounted(this),(await this.select_personality(t.personality)).status&&this.$refs.toast.showToast(`Selected personality:
`+t.personality.name,4,!0),this.getMountedPersonalities()):(t.isMounted=!1,this.$refs.toast.showToast(`Could not mount personality
Error: `+e.error,4,!1))},async unmountPersonality(t){if(!t)return;console.log(`Unmounting ${JSON.stringify(t.personality)}`);const e=await this.unmount_personality(t.personality);if(e.status){console.log("unmount response",e),this.configFile.active_personality_id=e.active_personality_id,this.configFile.personalities=e.personalities;const n=this.configFile.personalities[this.configFile.active_personality_id],r=this.personalities.findIndex(a=>a.full_path==n),s=this.$refs.personalitiesZoo.findIndex(a=>a.full_path==t.full_path),o=this.personalities[r];o.isMounted=!1,o.selected=!0,this.$refs.personalitiesZoo[s].isMounted=!1,this.getMountedPersonalities(),(await this.select_personality(o)).status&&Ce.replace(),this.$refs.toast.showToast("Personality unmounted",4,!0),this.onUnMounted(this)}else this.$refs.toast.showToast(`Could not unmount personality
Error: `+e.error,4,!1)},getMountedPersonalities(){this.isLoading=!0;let t=[];console.log(this.configFile.personalities.length);for(let e=0;e<this.configFile.personalities.length;e++){const n=this.configFile.personalities[e],r=this.personalities.findIndex(o=>o.full_path==n),s=this.personalities[r];if(s)console.log("adding from config"),t.push(s);else{console.log("adding default");const o=this.personalities.findIndex(a=>a.full_path=="english/generic/lollms"),i=this.personalities[o];t.push(i)}}if(this.mountedPersArr=[],this.mountedPersArr=t,console.log("discussionPersonalities",this.discussionPersonalities),this.discussionPersonalities!=null&&this.discussionPersonalities.length>0)for(let e=0;e<this.discussionPersonalities.length;e++){const n=this.discussionPersonalities[e];console.log("discussionPersonalities - per",n);const r=this.mountedPersArr.findIndex(s=>s.full_path==n);if(console.log("discussionPersonalities -includes",r),console.log("discussionPersonalities -mounted list",this.mountedPersArr),r==-1){const s=this.personalities.findIndex(i=>i.full_path==n),o=this.personalities[s];console.log("adding discucc121",o,n),o&&(this.mountedPersArr.push(o),console.log("adding discucc",o))}}this.isLoading=!1,console.log("getMountedPersonalities",this.mountedPersArr),console.log("fig",this.configFile)}}},Cp=t=>(hr("data-v-d16a58b9"),t=t(),Er(),t),ort={class:"text-left overflow-visible text-base font-semibold cursor-pointer select-none items-center flex flex-col flex-grow w-full overflow-x-auto scrollbar-thin scrollbar-track-bg-light scrollbar-thumb-bg-light-tone hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark dark:scrollbar-thumb-bg-dark-tone dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},irt={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},art=Cp(()=>d("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[d("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),d("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1)),lrt=Cp(()=>d("span",{class:"sr-only"},"Loading...",-1)),crt=[art,lrt],drt=Cp(()=>d("i",{"data-feather":"chevron-down"},null,-1)),urt=[drt],_rt={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},prt={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function mrt(t,e,n,r,s,o){const i=Pe("personality-entry"),a=Pe("Toast"),l=Pe("UniversalForm");return v(),T("div",ort,[s.isLoading?(v(),T("div",irt,crt)):U("",!0),d("div",null,[o.mountedPersArr.length>0?(v(),T("div",{key:0,class:Ae(s.isLoading?"pointer-events-none opacity-30 cursor-default":"")},[d("button",{class:"mt-0 w-full text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Close personality list",type:"button",onClick:e[0]||(e[0]=_e((...u)=>o.toggleShowPersList&&o.toggleShowPersList(...u),["stop"]))},urt),d("label",_rt," Mounted Personalities: ("+j(o.mountedPersArr.length)+") ",1),d("div",prt,[he(Vn,{name:"bounce"},{default:ke(()=>[(v(!0),T(we,null,Be(this.$store.state.mountedPersArr,(u,c
`+r.error,4,!1),this.loading=!1,Ne.off("file_received")}),Ne.emit("send_file",n)},e.readAsDataURL(this.selectedFile)},async constructor(){nextTick(()=>{Ce.replace()})},toggleMenu(){this.showMenu=!this.showMenu},execute_cmd(t){this.showMenu=!this.showMenu,t.hasOwnProperty("is_file")?(console.log("Need to send a file."),this.selectFile(t.hasOwnProperty("file_types")?t.file_types:"*",()=>{this.selectedFile!=null&&this.uploadFile()})):this.sendCommand(t.value)},handleClickOutside(t){const e=this.$el.querySelector(".commands-menu-items-wrapper");e&&!e.contains(t.target)&&(this.showMenu=!1)}},mounted(){this.commands=this.commandsList,document.addEventListener("click",this.handleClickOutside)},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},hrt=t=>(hr("data-v-52cfa09c"),t=t(),Er(),t),Ert={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"},brt=hrt(()=>d("div",{role:"status"},[d("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[d("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),d("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),d("span",{class:"sr-only"},"Loading...")],-1)),Srt=[brt];function yrt(t,e,n,r,s,o){const i=Pe("InteractiveMenu");return s.loading?(v(),T("div",Ert,Srt)):(v(),rt(i,{key:1,commands:n.commandsList,execute_cmd:o.execute_cmd},null,8,["commands","execute_cmd"]))}const vrt=Ye(frt,[["render",yrt],["__scopeId","data-v-52cfa09c"]]);console.log("modelImgPlaceholder:",zn);const Trt="/",Crt={name:"ChatBox",emits:["messageSentEvent","sendCMDEvent","stopGenerating","loaded","createEmptyUserMessage","createEmptyAIMessage"],props:{onTalk:Function,discussionList:Array,loading:!1,onShowToastMessage:Function},components:{Toast:ds,MountedPersonalities:nrt,MountedPersonalitiesList:grt,PersonalitiesCommands:vrt,InteractiveMenu:lo},setup(){},data(){return{modelImgPlaceholder:zn,bUrl:Trt,message:"",selecting_model:!1,selectedModel:"",isLesteningToVoice:!1,filesList:[],isFileSentList:[],totalSize:0,showfilesList:!0,showPersonalities:!1,personalities_ready:!1,models_menu_icon:""}},computed:{config(){return this.$store.state.config},mountedPers(){return this.$store.state.mountedPers},allDiscussionPersonalities(){if(this.discussionList.length>0){let t=[];for(let e=0;e<this.discussionList.length;e++)!t.includes(this.discussionList[e].personality)&&!this.discussionList[e].personality==""&&t.push(this.discussionList[e].personality);return console.log("conputer pers",t),console.log("dis conputer pers",this.discussionList),t}}},methods:{showModelConfig(){},async unmountPersonality(t){if(this.loading=!0,!t)return;const e=await this.unmount_personality(t.personality||t);if(e.status){this.$store.state.config.personalities=e.personalities,this.$refs.toast.showToast("Personality unmounted",4,!0),this.$store.dispatch("refreshMountedPersonalities");const n=this.$store.state.mountedPersArr[this.$store.state.mountedPersArr.length-1];console.log(n,this.$store.state.mountedPersArr.length),(await this.select_personality(t.personality)).status&&this.$refs.toast.showToast(`Selected personality:
2023-10-23 23:40:39 +00:00
`+n.name,4,!0)}else this.$refs.toast.showToast(`Could not unmount personality
Error: `+e.error,4,!1);this.loading=!1},async unmount_personality(t){if(!t)return{status:!1,error:"no personality - unmount_personality"};const e={language:t.language,category:t.category,folder:t.folder};try{const n=await Re.post("/unmount_personality",e);if(n)return n.data}catch(n){console.log(n.message,"unmount_personality - settings");return}},async onPersonalitySelected(t){if(console.log("on pers",t),console.log("selecting ",t),t){if(t.selected){this.$refs.toast.showToast("Personality already selected",4,!0);return}if(t.isMounted&&this.$store.state.config.personalities.includes(t.full_path)){const e=await this.select_personality(t);console.log("pers is mounted",e),e&&e.status&&e.active_personality_id>-1?this.$refs.toast.showToast(`Selected personality:
2023-10-23 23:40:39 +00:00
`+t.name,4,!0):this.$refs.toast.showToast(`Error on select personality:
`+t.name,4,!1)}else console.log("mounting pers"),this.mountPersonality(t);ve(()=>{Ce.replace()})}},async select_personality(t){if(!t)return{status:!1,error:"no personality - select_personality"};const n={id:this.$store.state.config.personalities.findIndex(r=>r===t.full_path)};try{const r=await Re.post("/select_personality",n);if(r)return this.$store.dispatch("refreshConfig").then(()=>{this.$store.dispatch("refreshPersonalitiesZoo").then(()=>{this.$store.dispatch("refreshMountedPersonalities")})}),r.data}catch(r){console.log(r.message,"select_personality - settings");return}},emitloaded(){this.$emit("loaded")},showModels(t){t.preventDefault();const e=this.$refs.modelsSelectionList;console.log(e);const n=new MouseEvent("click");e.dispatchEvent(n)},setModel(t){console.log("Setting model to "+t.name),this.selecting_model=!0,this.selectedModel=t,Re.post("/update_setting",{setting_name:"model_name",setting_value:t.name}).then(async e=>{console.log(e),await this.$store.dispatch("refreshModels"),await this.$store.dispatch("refreshConfig"),this.$refs.toast.showToast(`Model changed to ${t.name}`,4,!0),this.selecting_model=!1}).catch(e=>{this.$refs.toast.showToast(`Error ${e}`,4,!0),this.selecting_model=!1})},clear_files(){Re.get("/clear_personality_files_list").then(t=>{t.data.status?console.log("Files removed"):console.log("Files couldn't be removed")}),this.filesList=[],this.isFileSentList=[]},send_file(t,e){const n=new FileReader,r=24*1024;let s=0,o=0;n.onloadend=()=>{if(n.error){console.error("Error reading file:",n.error);return}const a=n.result,l=s+a.byteLength>=t.size;Ne.emit("send_file_chunk",{filename:t.name,chunk:a,offset:s,isLastChunk:l,chunkIndex:o}),s+=a.byteLength,o++,l?(console.log("File sent successfully"),this.isFileSentList[this.filesList.length-1]=!0,console.log(this.isFileSentList),this.onShowToastMessage("File uploaded successfully",4,!0),this.loading=!1,e()):i()};function i(){const a=t.slice(s,s+r);n.readAsArrayBuffer(a)}console.log("Uploading file"),i()},makeAnEmptyUserMessage(){this.$emit("createEmptyUserMessage")},makeAnEmptyAIMessage(){this.$emit("createEmptyAIMessage")},startSpeechRecognition(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window?(this.recognition=new(window.SpeechRecognition||window.webkitSpeechRecognition),this.recognition.lang=this.$store.state.config.audio_in_language,this.recognition.interimResults=!0,this.recognition.onstart=()=>{this.isLesteningToVoice=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.recognition.onresult=t=>{let e="";for(let n=t.resultIndex;n<t.results.length;n++)e+=t.results[n][0].transcript;this.message=e,clearTimeout(this.silenceTimer),this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=t=>{console.error("Speech recognition error:",t.error),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer),this.submit()},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")},onPersonalitiesReadyFun(){this.personalities_ready=!0},onShowPersListFun(t){this.showPersonalities=!this.showPersonalities},handleOnTalk(t){this.showPersonalities=!1,this.onTalk(t)},onMountFun(t){console.log("Mounting personality"),this.$refs.mountedPers.constructor()},onUnmountFun(t){console.log("Unmounting personality"),this.$refs.mountedPers.constructor()},onRemount(t){console.log("Remounting chat"),this.$refs.mountedPers.constructor()},computedFileSize(t){return ve(()=>{Ce.replace()}),Xt(t)},removeItem(t){this.filesList=this.filesList.filter(e=>e!=t)},sendMessageEvent(t){this.filesList=[],this.$emit("messageSentEvent",t)},sendCMDEvent(t){this.$emit("sendCMDEvent",t)},submitOnEnter(t){t.which===13&&(t.preventDefault(),t.repeat||(this.sendMessageEvent(this.message),this.message=""))},submit(){this.message&&(this.sendMessageEvent(this.message),this.message="")},stopGenerating(){this.$emit("stopGenerating")},addFiles(t){conso
2023-10-23 23:40:39 +00:00
\r
\r
`,544),[[De,s.message]]),d("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:e[9]||(e[9]=(...c)=>o.addFiles&&o.addFiles(...c)),multiple:""},null,544),d("button",{type:"button",onClick:e[10]||(e[10]=_e(c=>t.$refs.fileDialog.click(),["stop"])),title:"Add files",class:"absolute inset-y-0 right-0 flex items-center mr-2 w-6 hover:text-secondary duration-75 active:scale-90"},vst)])),d("div",Tst,[n.loading?U("",!0):(v(),T("button",{key:0,type:"button",onClick:e[11]||(e[11]=(...c)=>o.startSpeechRecognition&&o.startSpeechRecognition(...c)),class:Ae([{"text-red-500":s.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},Rst,2)),n.loading?U("",!0):(v(),T("button",{key:1,type:"button",onClick:e[12]||(e[12]=(...c)=>o.makeAnEmptyUserMessage&&o.makeAnEmptyUserMessage(...c)),title:"New empty user message",class:"w-6 text-blue-400 hover:text-secondary duration-75 active:scale-90"},Ast)),n.loading?U("",!0):(v(),T("button",{key:2,type:"button",onClick:e[13]||(e[13]=(...c)=>o.makeAnEmptyAIMessage&&o.makeAnEmptyAIMessage(...c)),title:"New empty ai message",class:"w-6 text-red-400 hover:text-secondary duration-75 active:scale-90"},Ist)),n.loading?U("",!0):(v(),T("button",{key:3,type:"button",onClick:e[14]||(e[14]=(...c)=>o.submit&&o.submit(...c)),class:"w-6 hover:text-secondary duration-75 active:scale-90"},Mst)),n.loading?(v(),T("div",Lst,Fst)):U("",!0)])])])])])]),he(u,{ref:"toast"},null,512)],64)}const ET=Ye(Crt,[["render",Ust],["__scopeId","data-v-9461be21"]]),Bst={name:"WelcomeComponent",setup(){return{}}},Gst={class:"flex flex-col text-center"},qst=B_('<div class="flex flex-col text-center items-center"><div class="flex items-center gap-3 text-5xl drop-shadow-md align-middle pt-24"><img class="w-24 animate-bounce" title="LoLLMS WebUI" src="'+Ks+'" alt="Logo"><div class="flex flex-col items-start"><p class="text-2xl">Lord of Large Language Models</p><p class="text-gray-400 text-base">One tool to rule them all</p></div></div><hr class="mt-1 w-96 h-1 mx-auto my-2 md:my-2 dark:bg-bg-dark-tone-panel bg-bg-light-tone-panel border-0 rounded"><p class="text-2xl">Welcome</p><p class="text-lg">Please create a new discussion or select existing one to start</p></div>',1),Yst=[qst];function Vst(t,e,n,r,s,o){return v(),T("div",Gst,Yst)}const bT=Ye(Bst,[["render",Vst]]);var zst=function(){function t(e,n){n===void 0&&(n=[]),this._eventType=e,this._eventFunctions=n}return t.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(n){typeof window<"u"&&window.addEventListener(e._eventType,n)})},t}(),pi=globalThis&&globalThis.__assign||function(){return pi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},pi.apply(this,arguments)},mi={alwaysOpen:!1,activeClasses:"bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white",inactiveClasses:"text-gray-500 dark:text-gray-400",onOpen:function(){},onClose:function(){},onToggle:function(){}},ST=function(){function t(e,n){e===void 0&&(e=[]),n===void 0&&(n=mi),this._items=e,this._options=pi(pi({},mi),n),this._init()}return t.prototype._init=function(){var e=this;this._items.length&&this._items.map(function(n){n.active&&e.open(n.id),n.triggerEl.addEventListener("click",function(){e.toggle(n.id)})})},t.prototype.getItem=function(e){return this._items.filter(function(n){return n.id===e})[0]},t.prototype.open=function(e){var n,r,s=this,o=this.getItem(e);this._options.alwaysOpen||this._items.map(function(i){var a,l;i!==o&&((a=i.triggerEl.classList).remove.apply(a,s._options.activeClasses.split(" ")),(l=i.triggerEl.classList).add.apply(l,s._options.inactiveClasses.split(" ")),i.targetEl.classList.add("hidden"),i.triggerEl.setAttribute("aria-expanded","false"),i.active=!1,i.iconEl&&i.iconEl.classList.remove("rotate-180"))}),(n=o.triggerEl.classList).add.apply(n,this._options.activeClasses.split(" ")),(r=o.triggerEl.classList).remove.apply(r,this._options.inactiveClasses.split(" ")),o.triggerEl.setAttribu
2023-10-23 23:40:39 +00:00
Personality: ${t.message.personality}`);let r="";t.created_at_parsed&&(r=`
Created: ${t.created_at_parsed}`);let s="";t.message.content&&(s=t.message.content);let o="";t.message.model&&(o=`Model: ${t.message.model}`);let i="";t.message.seed&&(i=`Seed: ${t.message.seed}`);let a="";t.time_spent&&(a=`
Time spent: ${t.time_spent}`);let l="";l=`${e} ${o} ${i} ${a}`.trim();const u=`${t.message.sender}${n}${r}
${s}
${l}`;navigator.clipboard.writeText(u),ve(()=>{Ce.replace()})},closeToast(){this.showToast=!1},saveJSONtoFile(t,e){e=e||"data.json";const n=document.createElement("a");n.href=URL.createObjectURL(new Blob([JSON.stringify(t,null,2)],{type:"text/plain"})),n.setAttribute("download",e),document.body.appendChild(n),n.click(),document.body.removeChild(n)},parseJsonObj(t){try{return JSON.parse(t)}catch(e){return this.$refs.toast.showToast(`Could not parse JSON.
2023-10-23 23:40:39 +00:00
`+e.message,4,!1),null}},async parseJsonFile(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=s=>e(this.parseJsonObj(s.target.result)),r.onerror=s=>n(s),r.readAsText(t)})},async exportDiscussions(){const t=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(t.length>0){console.log("export",t);let e=new Date;const n=e.getFullYear(),r=(e.getMonth()+1).toString().padStart(2,"0"),s=e.getDate().toString().padStart(2,"0"),o=e.getHours().toString().padStart(2,"0"),i=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0"),u="discussions_export_"+(n+"."+r+"."+s+"."+o+i+a)+".json";this.loading=!0;const c=await this.export_multiple_discussions(t);c?(this.saveJSONtoFile(c,u),this.$refs.toast.showToast("Successfully exported",4,!0),this.isCheckbox=!1):this.$refs.toast.showToast("Failed to export discussions",4,!1),this.loading=!1}},async importDiscussions(t){const e=await this.parseJsonFile(t.target.files[0]);await this.import_multiple_discussions(e)?(this.$refs.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$refs.toast.showToast("Failed to import discussions",4,!1)},async getPersonalityAvatars(){for(;this.$store.state.personalities===null;)await new Promise(e=>setTimeout(e,100));let t=this.$store.state.personalities;this.personalityAvatars=t.map(e=>({name:e.name,avatar:e.avatar}))},getAvatar(t){if(t.toLowerCase().trim()==this.$store.state.config.user_name.toLowerCase().trim())return"user_infos/"+this.$store.state.config.user_avatar;const e=this.personalityAvatars.findIndex(r=>r.name===t),n=this.personalityAvatars[e];if(n)return console.log("Avatar",n.avatar),n.avatar},setFileListChat(t){try{this.$refs.chatBox.fileList=this.$refs.chatBox.fileList.concat(t)}catch(e){this.$refs.toast.showToast(`Failed to set filelist in chatbox
`+e.message,4,!1)}this.isDragOverChat=!1},async setFileListDiscussion(t){if(t.length>1){this.$refs.toast.showToast("Failed to import discussions. Too many files",4,!1);return}const e=await this.parseJsonFile(t[0]);await this.import_multiple_discussions(e)?(this.$refs.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$refs.toast.showToast("Failed to import discussions",4,!1),this.isDragOverDiscussion=!1}},async created(){for(this.$nextTick(()=>{Ce.replace()}),Ne.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason),this.socketIODisconnected()},Ne.on("connect_error",t=>{t.message==="ERR_CONNECTION_REFUSED"?(this.$store.state.isConnected=!1,console.error("Connection refused. The server is not available.")):console.error("Connection error:",t)}),Ne.onerror=t=>{console.log("WebSocket connection error:",t.code,t.reason),this.socketIODisconnected(),Ne.disconnect()},Ne.on("connected",this.socketIOConnected),Ne.on("disconnected",this.socketIODisconnected),console.log("Added events"),console.log("Waiting to be ready");this.$store.state.ready===!1;)await new Promise(t=>setTimeout(t,100)),console.log(this.$store.state.ready);console.log("Ready"),this.setPageTitle(),await this.list_discussions(),this.loadLastUsedDiscussion(),Ne.on("notification",this.notify),Ne.on("new_message",this.new_message),Ne.on("update_message",this.streamMessageContent),Ne.on("close_message",this.finalMsgEvent),Ne.onopen=()=>{console.log("WebSocket connection established."),this.currentDiscussion!=null&&(this.setPageTitle(item),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(item.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)}))},this.isCreated=!0},async mounted(){this.$nextTick(()=>{Ce.replace()})},async activated(){for(;this.isReady===!1;)await new Promise(t=>setTimeout(t,100));await this.getPersonalityAvatars(),console.log("Avatars found:",this.personalityAvatars),this.isCreated&&ve(()=>{const t=document.getElementById("messages-list");this.scrollBottom(t)})},components:{Discussion:fT,Message:hT,ChatBox:ET,WelcomeComponent:bT,Toast:ds,ChoiceDialog:Tp},watch:{filterTitle(t){t==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(t){ve(()=>{Ce.replace()}),t||(this.isSelectAll=!1)},socketConnected(t){console.log("Websocket connected (watch)",t)},showConfirmation(){ve(()=>{Ce.replace()})},isSearch(){ve(()=>{Ce.replace()})}},computed:{formatted_database_name(){const t=this.$store.state.config.db_path;return t.slice(0,t.length-3)},UseDiscussionHistory(){return this.$store.state.config.use_discussions_history},isReady:{get(){return this.$store.state.ready}},databases(){return this.$store.state.databases},client_id(){return Ne.id},isReady(){return console.log("verify ready",this.isCreated),this.isCreated},showPanel(){return this.$store.state.ready&&!this.panelCollapsed},socketConnected(){return console.log(" --- > Websocket connected"),this.$store.commit("setIsConnected",!0),!0},socketDisconnected(){return this.$store.commit("setIsConnected",!1),console.log(" --- > Websocket disconnected"),!0},selectedDiscussions(){return ve(()=>{Ce.replace()}),this.list.filter(t=>t.checkBoxValue==!0)}}},xat=Object.assign(Rat,{__name:"DiscussionsView",setup(t){return to(()=>{BT()}),Re.defaults.baseURL="/",(e,n)=>(v(),T(we,null,[he(Hr,{name:"fade-and-fly"},{default:ke(()=>[e.isReady?U("",!0):(v(),T("div",eit,[d("div",tit,[d("div",nit,[d("div",rit,[sit,d("div",oit,[d("p",iit,"Lord of Large Language Models v "+j(ct(GT).state.version),1),ait,lit])]),cit,dit,uit])])]))]),_:1}),e.isReady?(v(),T("button",{key:0,onClick:n[0]||(n[0]=(...r)=>e.togglePanel&&e.togglePanel(...r)),class:"absolute top-0 left-0 z-50 p-2 m-2 bg-white rounded-full shadow-md bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-primary-light dark:hover:bg-primary"},[ce(d("div",null,pit,512),[[We,e.panelCollapsed]]),ce(d("div",null