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

143 lines
890 KiB
JavaScript
Raw Normal View History

2023-07-17 11:03:42 +00:00
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();function yl(t,e){const n=Object.create(null),s=t.split(",");for(let o=0;o<s.length;o++)n[s[o]]=!0;return e?o=>!!n[o.toLowerCase()]:o=>!!n[o]}function zt(t){if(ke(t)){const e={};for(let n=0;n<t.length;n++){const s=t[n],o=We(s)?wm(s):zt(s);if(o)for(const r in o)e[r]=o[r]}return e}else{if(We(t))return t;if(He(t))return t}}const bm=/;(?![^(]*\))/g,ym=/:([^]+)/,vm=/\/\*.*?\*\//gs;function wm(t){const e={};return t.replace(vm,"").split(bm).forEach(n=>{if(n){const s=n.split(ym);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function Te(t){let e="";if(We(t))e=t;else if(ke(t))for(let n=0;n<t.length;n++){const s=Te(t[n]);s&&(e+=s+" ")}else if(He(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const xm="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",km=yl(xm);function Ih(t){return!!t||t===""}function Em(t,e){if(t.length!==e.length)return!1;let n=!0;for(let s=0;n&&s<t.length;s++)n=Ro(t[s],e[s]);return n}function Ro(t,e){if(t===e)return!0;let n=Ac(t),s=Ac(e);if(n||s)return n&&s?t.getTime()===e.getTime():!1;if(n=fo(t),s=fo(e),n||s)return t===e;if(n=ke(t),s=ke(e),n||s)return n&&s?Em(t,e):!1;if(n=He(t),s=He(e),n||s){if(!n||!s)return!1;const o=Object.keys(t).length,r=Object.keys(e).length;if(o!==r)return!1;for(const i in t){const a=t.hasOwnProperty(i),l=e.hasOwnProperty(i);if(a&&!l||!a&&l||!Ro(t[i],e[i]))return!1}}return String(t)===String(e)}function vl(t,e){return t.findIndex(n=>Ro(n,e))}const Y=t=>We(t)?t:t==null?"":ke(t)||He(t)&&(t.toString===Bh||!Me(t.toString))?JSON.stringify(t,Ph,2):String(t),Ph=(t,e)=>e&&e.__v_isRef?Ph(t,e.value):_s(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[s,o])=>(n[`${s} =>`]=o,n),{})}:Ps(e)?{[`Set(${e.size})`]:[...e.values()]}:He(e)&&!ke(e)&&!$h(e)?String(e):e,Ve={},ms=[],Lt=()=>{},Cm=()=>!1,Am=/^on[^a-z]/,jr=t=>Am.test(t),wl=t=>t.startsWith("onUpdate:"),nt=Object.assign,xl=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Sm=Object.prototype.hasOwnProperty,Fe=(t,e)=>Sm.call(t,e),ke=Array.isArray,_s=t=>Fs(t)==="[object Map]",Ps=t=>Fs(t)==="[object Set]",Ac=t=>Fs(t)==="[object Date]",Tm=t=>Fs(t)==="[object RegExp]",Me=t=>typeof t=="function",We=t=>typeof t=="string",fo=t=>typeof t=="symbol",He=t=>t!==null&&typeof t=="object",Fh=t=>He(t)&&Me(t.then)&&Me(t.catch),Bh=Object.prototype.toString,Fs=t=>Bh.call(t),Mm=t=>Fs(t).slice(8,-1),$h=t=>Fs(t)==="[object Object]",kl=t=>We(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,sr=yl(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),zr=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},Om=/-(\w)/g,Zt=zr(t=>t.replace(Om,(e,n)=>n?n.toUpperCase():"")),Rm=/\B([A-Z])/g,ts=zr(t=>t.replace(Rm,"-$1").toLowerCase()),Ur=zr(t=>t.charAt(0).toUpperCase()+t.slice(1)),wi=zr(t=>t?`on${Ur(t)}`:""),po=(t,e)=>!Object.is(t,e),bs=(t,e)=>{for(let n=0;n<t.length;n++)t[n](e)},mr=(t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})},_r=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Nm=t=>{const e=We(t)?Number(t):NaN;return isNaN(e)?t:e};let Sc;const Dm=()=>Sc||(Sc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});let Ot;class Lm{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Ot,!e&&Ot&&(this.index=(Ot.scopes||(Ot.scopes=[])).push(this)
2023-07-10 23:12:40 +00:00
* vuex v4.0.2
* (c) 2021 Evan You
* @license MIT
2023-07-17 11:03:42 +00:00
*/var i0="store";function Us(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}function Hf(t){return t!==null&&typeof t=="object"}function a0(t){return t&&typeof t.then=="function"}function l0(t,e){return function(){return t(e)}}function Vf(t,e,n){return e.indexOf(t)<0&&(n&&n.prepend?e.unshift(t):e.push(t)),function(){var s=e.indexOf(t);s>-1&&e.splice(s,1)}}function Gf(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;Xr(t,n,[],t._modules.root,!0),Ul(t,n,e)}function Ul(t,e,n){var s=t._state;t.getters={},t._makeLocalGettersCache=Object.create(null);var o=t._wrappedGetters,r={};Us(o,function(i,a){r[a]=l0(i,t),Object.defineProperty(t.getters,a,{get:function(){return r[a]()},enumerable:!0})}),t._state=js({data:e}),t.strict&&f0(t),s&&n&&t._withCommit(function(){s.data=null})}function Xr(t,e,n,s,o){var r=!n.length,i=t._modules.getNamespace(n);if(s.namespaced&&(t._modulesNamespaceMap[i],t._modulesNamespaceMap[i]=s),!r&&!o){var a=ql(e,n.slice(0,-1)),l=n[n.length-1];t._withCommit(function(){a[l]=s.state})}var c=s.context=c0(t,i,n);s.forEachMutation(function(u,h){var p=i+h;u0(t,p,u,c)}),s.forEachAction(function(u,h){var p=u.root?h:i+h,g=u.handler||u;d0(t,p,g,c)}),s.forEachGetter(function(u,h){var p=i+h;h0(t,p,u,c)}),s.forEachChild(function(u,h){Xr(t,e,n.concat(h),u,o)})}function c0(t,e,n){var s=e==="",o={dispatch:s?t.dispatch:function(r,i,a){var l=xr(r,i,a),c=l.payload,u=l.options,h=l.type;return(!u||!u.root)&&(h=e+h),t.dispatch(h,c)},commit:s?t.commit:function(r,i,a){var l=xr(r,i,a),c=l.payload,u=l.options,h=l.type;(!u||!u.root)&&(h=e+h),t.commit(h,c,u)}};return Object.defineProperties(o,{getters:{get:s?function(){return t.getters}:function(){return Kf(t,e)}},state:{get:function(){return ql(t.state,n)}}}),o}function Kf(t,e){if(!t._makeLocalGettersCache[e]){var n={},s=e.length;Object.keys(t.getters).forEach(function(o){if(o.slice(0,s)===e){var r=o.slice(s);Object.defineProperty(n,r,{get:function(){return t.getters[o]},enumerable:!0})}}),t._makeLocalGettersCache[e]=n}return t._makeLocalGettersCache[e]}function u0(t,e,n,s){var o=t._mutations[e]||(t._mutations[e]=[]);o.push(function(i){n.call(t,s.state,i)})}function d0(t,e,n,s){var o=t._actions[e]||(t._actions[e]=[]);o.push(function(i){var a=n.call(t,{dispatch:s.dispatch,commit:s.commit,getters:s.getters,state:s.state,rootGetters:t.getters,rootState:t.state},i);return a0(a)||(a=Promise.resolve(a)),t._devtoolHook?a.catch(function(l){throw t._devtoolHook.emit("vuex:error",l),l}):a})}function h0(t,e,n,s){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(r){return n(s.state,s.getters,r.state,r.getters)})}function f0(t){Wn(function(){return t._state.data},function(){},{deep:!0,flush:"sync"})}function ql(t,e){return e.reduce(function(n,s){return n[s]},t)}function xr(t,e,n){return Hf(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}var p0="vuex bindings",cu="vuex:mutations",Oi="vuex:actions",ls="vuex",g0=0;function m0(t,e){r0({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:[p0]},function(n){n.addTimelineLayer({id:cu,label:"Vuex Mutations",color:uu}),n.addTimelineLayer({id:Oi,label:"Vuex Actions",color:uu}),n.addInspector({id:ls,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),n.on.getInspectorTree(function(s){if(s.app===t&&s.inspectorId===ls)if(s.filter){var o=[];Qf(o,e._modules.root,s.filter,""),s.rootNodes=o}else s.rootNodes=[Yf(e._modules.root,"")]}),n.on.getInspectorState(function(s){if(s.app===t&&s.inspectorId===ls){var o=s.nodeId;Kf(e,o),s.state=y0(w0(e._modules,o),o==="root"?e.getters:e._makeLocalGettersCache,o)}}),n.on.editInspectorState(function(s){if(s.app===t&&s.inspectorId===ls){var o=s.nodeId,r=s.path;o!=="root"&&(r=o.split("/").filter(Boolean).concat(r)),e._withCommit(function(){s.set(e._state.data,r,s.state.value)})}}),e.subscribe(function(s,o){var r={};s.payload&&(r.payload=s.payload),r.state
`).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),s=i.substring(o+1).trim(),!(!n||e[n]&&wb[n])&&(n==="set-cookie"?e[n]?e[n].push(s):e[n]=[s]:e[n]=e[n]?e[n]+", "+s:s)}),e},mu=Symbol("internals");function Ys(t){return t&&String(t).trim().toLowerCase()}function lr(t){return t===!1||t==null?t:G.isArray(t)?t.map(lr):String(t)}function kb(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(t);)e[s[1]]=s[2];return e}const Eb=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Ni(t,e,n,s,o){if(G.isFunction(s))return s.call(this,e,n);if(o&&(e=n),!!G.isString(e)){if(G.isString(s))return e.indexOf(s)!==-1;if(G.isRegExp(s))return s.test(e)}}function Cb(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,s)=>n.toUpperCase()+s)}function Ab(t,e){const n=G.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+n,{value:function(o,r,i){return this[s].call(this,e,o,r,i)},configurable:!0})})}class oi{constructor(e){e&&this.set(e)}set(e,n,s){const o=this;function r(a,l,c){const u=Ys(l);if(!u)throw new Error("header name must be a non-empty string");const h=G.findKey(o,u);(!h||o[h]===void 0||c===!0||c===void 0&&o[h]!==!1)&&(o[h||l]=lr(a))}const i=(a,l)=>G.forEach(a,(c,u)=>r(c,u,l));return G.isPlainObject(e)||e instanceof this.constructor?i(e,n):G.isString(e)&&(e=e.trim())&&!Eb(e)?i(xb(e),n):e!=null&&r(n,e,s),this}get(e,n){if(e=Ys(e),e){const s=G.findKey(this,e);if(s){const o=this[s];if(!n)return o;if(n===!0)return kb(o);if(G.isFunction(n))return n.call(this,o,s);if(G.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Ys(e),e){const s=G.findKey(this,e);return!!(s&&this[s]!==void 0&&(!n||Ni(this,this[s],s,n)))}return!1}delete(e,n){const s=this;let o=!1;function r(i){if(i=Ys(i),i){const a=G.findKey(s,i);a&&(!n||Ni(s,s[a],a,n))&&(delete s[a],o=!0)}}return G.isArray(e)?e.forEach(r):r(e),o}clear(e){const n=Object.keys(this);let s=n.length,o=!1;for(;s--;){const r=n[s];(!e||Ni(this,this[r],r,e,!0))&&(delete this[r],o=!0)}return o}normalize(e){const n=this,s={};return G.forEach(this,(o,r)=>{const i=G.findKey(s,r);if(i){n[i]=lr(o),delete n[r];return}const a=e?Cb(r):String(r).trim();a!==r&&delete n[r],n[a]=lr(o),s[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return G.forEach(this,(s,o)=>{s!=null&&s!==!1&&(n[o]=e&&G.isArray(s)?s.join(", "):s)}),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 s=new this(e);return n.forEach(o=>s.set(o)),s}static accessor(e){const s=(this[mu]=this[mu]={accessors:{}}).accessors,o=this.prototype;function r(i){const a=Ys(i);s[a]||(Ab(o,i),s[a]=!0)}return G.isArray(e)?e.forEach(r):r(e),this}}oi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);G.freezeMethods(oi.prototype);G.freezeMethods(oi);const on=oi;function Di(t,e){const n=this||Wl,s=e||n,o=on.from(s.headers);let r=s.data;return G.forEach(t,function(a){r=a.call(n,r,o.normalize(),e?e.status:void 0)}),o.normalize(),r}function gp(t){return!!(t&&t.__CANCEL__)}function Do(t,e,n){Be.call(this,t??"canceled",Be.ERR_CANCELED,e,n),this.name="CanceledError"}G.inherits(Do,Be,{__CANCEL__:!0});function Sb(t,e,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):e(new Be("Request failed with status code "+n.status,[Be.ERR_BAD_REQUEST,Be.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Tb=qt.isStandardBrowserEnv?function(){return{write:function(n,s,o,r,i,a){const l=[];l.push(n+"="+encodeURIComponent(s)),G.isNumber(o)&&l.push("expires="+new Date(o).toGMTString()),G.isString(r)&&l.push("path="+r),G.isString(i)&&l.push("domain="+i),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){const s=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Mb(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Ob(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function mp(t,e){return t&&!Mb(e)?Ob(t,e):e}const Rb=qt.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let s;function o(r){let i=r;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 s=o(window.location.href),function(i){const a=G.isString(i)?o(i):i;return a.protocol===s.protocol&&a.host===s.host}}():function(){return function(){return!0}}();function Nb(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Db(t,e){t=t||10;const n=new Array(t),s=new Array(t);let o=0,r=0,i;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=s[r];i||(i=c),n[o]=l,s[o]=c;let h=r,p=0;for(;h!==o;)p+=n[h++],h=h%t;if(o=(o+1)%t,o===r&&(r=(r+1)%t),c-i<e)return;const g=u&&c-u;return g?Math.round(p*1e3/g):void 0}}function _u(t,e){let n=0;const s=Db(50,250);return o=>{const r=o.loaded,i=o.lengthComputable?o.total:void 0,a=r-n,l=s(a),c=r<=i;n=r;const u={loaded:r,total:i,progress:i?r/i:void 0,bytes:a,rate:l||void 0,estimated:l&&i&&c?(i-r)/l:void 0,event:o};u[e?"download":"upload"]=!0,t(u)}}const Lb=typeof XMLHttpRequest<"u",Ib=Lb&&function(t){return new Promise(function(n,s){let o=t.data;const r=on.from(t.headers).normalize(),i=t.responseType;let a;function l(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}G.isFormData(o)&&(qt.isStandardBrowserEnv||qt.isStandardBrowserWebWorkerEnv)&&r.setContentType(!1);let c=new XMLHttpRequest;if(t.auth){const g=t.auth.username||"",f=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";r.set("Authorization","Basic "+btoa(g+":"+f))}const u=mp(t.baseURL,t.url);c.open(t.method.toUpperCase(),hp(u,t.params,t.paramsSerializer),!0),c.timeout=t.timeout;function h(){if(!c)return;const g=on.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),m={data:!i||i==="text"||i==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:g,config:t,request:c};Sb(function(_){n(_),l()},function(_){s(_),l()
2023-07-10 23:12:40 +00:00
* vue-router v4.1.6
* (c) 2022 Eduardo San Martin Morote
* @license MIT
2023-07-17 11:03:42 +00:00
*/const hs=typeof window<"u";function Ub(t){return t.__esModule||t[Symbol.toStringTag]==="Module"}const Ue=Object.assign;function Ii(t,e){const n={};for(const s in e){const o=e[s];n[s]=It(o)?o.map(t):t(o)}return n}const ro=()=>{},It=Array.isArray,qb=/\/$/,Hb=t=>t.replace(qb,"");function Pi(t,e,n="/"){let s,o={},r="",i="";const a=e.indexOf("#");let l=e.indexOf("?");return a<l&&a>=0&&(l=-1),l>-1&&(s=e.slice(0,l),r=e.slice(l+1,a>-1?a:e.length),o=t(r)),a>-1&&(s=s||e.slice(0,a),i=e.slice(a,e.length)),s=Wb(s??e,n),{fullPath:s+(r&&"?")+r+i,path:s,query:o,hash:i}}function Vb(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function wu(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function Gb(t,e,n){const s=e.matched.length-1,o=n.matched.length-1;return s>-1&&s===o&&Ts(e.matched[s],n.matched[o])&&yp(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function Ts(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function yp(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(!Kb(t[n],e[n]))return!1;return!0}function Kb(t,e){return It(t)?xu(t,e):It(e)?xu(e,t):t===e}function xu(t,e){return It(e)?t.length===e.length&&t.every((n,s)=>n===e[s]):t.length===1&&t[0]===e}function Wb(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),s=t.split("/");let o=n.length-1,r,i;for(r=0;r<s.length;r++)if(i=s[r],i!==".")if(i==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+s.slice(r-(r===s.length?1:0)).join("/")}var Eo;(function(t){t.pop="pop",t.push="push"})(Eo||(Eo={}));var io;(function(t){t.back="back",t.forward="forward",t.unknown=""})(io||(io={}));function Zb(t){if(!t)if(hs){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),Hb(t)}const Yb=/^[^#]+#/;function Qb(t,e){return t.replace(Yb,"#")+e}function Jb(t,e){const n=document.documentElement.getBoundingClientRect(),s=t.getBoundingClientRect();return{behavior:e.behavior,left:s.left-n.left-(e.left||0),top:s.top-n.top-(e.top||0)}}const ri=()=>({left:window.pageXOffset,top:window.pageYOffset});function Xb(t){let e;if("el"in t){const n=t.el,s=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;e=Jb(o,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 ku(t,e){return(history.state?history.state.position-e:-1)+t}const tl=new Map;function ey(t,e){tl.set(t,e)}function ty(t){const e=tl.get(t);return tl.delete(t),e}let ny=()=>location.protocol+"//"+location.host;function vp(t,e){const{pathname:n,search:s,hash:o}=e,r=t.indexOf("#");if(r>-1){let a=o.includes(t.slice(r))?t.slice(r).length:1,l=o.slice(a);return l[0]!=="/"&&(l="/"+l),wu(l,"")}return wu(n,t)+s+o}function sy(t,e,n,s){let o=[],r=[],i=null;const a=({state:p})=>{const g=vp(t,location),f=n.value,m=e.value;let v=0;if(p){if(n.value=g,e.value=p,i&&i===f){i=null;return}v=m?p.position-m.position:0}else s(g);o.forEach(_=>{_(n.value,f,{delta:v,type:Eo.pop,direction:v?v>0?io.forward:io.back:io.unknown})})};function l(){i=n.value}function c(p){o.push(p);const g=()=>{const f=o.indexOf(p);f>-1&&o.splice(f,1)};return r.push(g),g}function u(){const{history:p}=window;p.state&&p.replaceState(Ue({},p.state,{scroll:ri()}),"")}function h(){for(const p of r)p();r=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u),{pauseListeners:l,listen:c,destroy:h}}function Eu(t,e,n,s=!1,o=!1){return{back:t,current:e,forward:n,replaced:s,position:window.history.length,scroll:o?ri():null}}function oy(t){const{history:e,location:n}=window,s={value:vp(t,n)},o={value:e.state};o.value||r(s.value,{back:null,current:s.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function r(l,c,u){const h=t.indexOf("#"
2023-07-10 23:12:40 +00:00
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
2023-07-17 11:03:42 +00:00
*/(function(){var a=function(){function l(){}l.prototype=Object.create(null);function c(_,b){for(var x=b.length,C=0;C<x;++C)m(_,b[C])}var u={}.hasOwnProperty;function h(_,b){_[b]=!0}function p(_,b){for(var x in b)u.call(b,x)&&(_[x]=!!b[x])}var g=/\s+/;function f(_,b){for(var x=b.split(g),C=x.length,R=0;R<C;++R)_[x[R]]=!0}function m(_,b){if(b){var x=typeof b;x==="string"?f(_,b):Array.isArray(b)?c(_,b):x==="object"?p(_,b):x==="number"&&h(_,b)}}function v(){for(var _=arguments.length,b=Array(_),x=0;x<_;x++)b[x]=arguments[x];var C=new l;c(C,b);var R=[];for(var O in C)C[O]&&R.push(O);return R.join(" ")}return v}();typeof n<"u"&&n.exports?n.exports=a:(r=[],i=function(){return a}.apply(s,r),i!==void 0&&(n.exports=i))})()},"./node_modules/core-js/es/array/from.js":function(n,s,o){o("./node_modules/core-js/modules/es.string.iterator.js"),o("./node_modules/core-js/modules/es.array.from.js");var r=o("./node_modules/core-js/internals/path.js");n.exports=r.Array.from},"./node_modules/core-js/internals/a-function.js":function(n,s){n.exports=function(o){if(typeof o!="function")throw TypeError(String(o)+" is not a function");return o}},"./node_modules/core-js/internals/an-object.js":function(n,s,o){var r=o("./node_modules/core-js/internals/is-object.js");n.exports=function(i){if(!r(i))throw TypeError(String(i)+" is not an object");return i}},"./node_modules/core-js/internals/array-from.js":function(n,s,o){var r=o("./node_modules/core-js/internals/bind-context.js"),i=o("./node_modules/core-js/internals/to-object.js"),a=o("./node_modules/core-js/internals/call-with-safe-iteration-closing.js"),l=o("./node_modules/core-js/internals/is-array-iterator-method.js"),c=o("./node_modules/core-js/internals/to-length.js"),u=o("./node_modules/core-js/internals/create-property.js"),h=o("./node_modules/core-js/internals/get-iterator-method.js");n.exports=function(g){var f=i(g),m=typeof this=="function"?this:Array,v=arguments.length,_=v>1?arguments[1]:void 0,b=_!==void 0,x=0,C=h(f),R,O,D,y;if(b&&(_=r(_,v>2?arguments[2]:void 0,2)),C!=null&&!(m==Array&&l(C)))for(y=C.call(f),O=new m;!(D=y.next()).done;x++)u(O,x,b?a(y,_,[D.value,x],!0):D.value);else for(R=c(f.length),O=new m(R);R>x;x++)u(O,x,b?_(f[x],x):f[x]);return O.length=x,O}},"./node_modules/core-js/internals/array-includes.js":function(n,s,o){var r=o("./node_modules/core-js/internals/to-indexed-object.js"),i=o("./node_modules/core-js/internals/to-length.js"),a=o("./node_modules/core-js/internals/to-absolute-index.js");n.exports=function(l){return function(c,u,h){var p=r(c),g=i(p.length),f=a(h,g),m;if(l&&u!=u){for(;g>f;)if(m=p[f++],m!=m)return!0}else for(;g>f;f++)if((l||f in p)&&p[f]===u)return l||f||0;return!l&&-1}}},"./node_modules/core-js/internals/bind-context.js":function(n,s,o){var r=o("./node_modules/core-js/internals/a-function.js");n.exports=function(i,a,l){if(r(i),a===void 0)return i;switch(l){case 0:return function(){return i.call(a)};case 1:return function(c){return i.call(a,c)};case 2:return function(c,u){return i.call(a,c,u)};case 3:return function(c,u,h){return i.call(a,c,u,h)}}return function(){return i.apply(a,arguments)}}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":function(n,s,o){var r=o("./node_modules/core-js/internals/an-object.js");n.exports=function(i,a,l,c){try{return c?a(r(l)[0],l[1]):a(l)}catch(h){var u=i.return;throw u!==void 0&&r(u.call(i)),h}}},"./node_modules/core-js/internals/check-correctness-of-iteration.js":function(n,s,o){var r=o("./node_modules/core-js/internals/well-known-symbol.js"),i=r("iterator"),a=!1;try{var l=0,c={next:function(){return{done:!!l++}},return:function(){a=!0}};c[i]=function(){return this},Array.from(c,function(){throw 2})}catch{}n.exports=function(u,h){if(!h&&!a)return!1;var p=!1;try{var g={};g[i]=function(){return{next:function(){return{done:p=!0}}}},u(g)}catch{}return p}},"./node_modules/core-js/internals/classof-raw.js":function(n,s){var o={}.toString;n.exports=function(r){return o.call(r).slice(8,-1)}},"./node_modules/core-js/internals/classof.js":function(n,s,o){var r=o("./node_modules/core-js/internals/classof-r
2023-07-10 23:12:40 +00:00
Papa Parse
v5.4.1
https://github.com/mholt/PapaParse
License: MIT
2023-07-17 11:03:42 +00:00
*/(function(t,e){(function(n,s){t.exports=s()})(Rp,function n(){var s=typeof self<"u"?self:typeof window<"u"?window:s!==void 0?s:{},o=!s.document&&!!s.postMessage,r=s.IS_PAPA_WORKER||!1,i={},a=0,l={parse:function(y,k){var T=(k=k||{}).dynamicTyping||!1;if(D(T)&&(k.dynamicTypingFunction=T,T={}),k.dynamicTyping=T,k.transform=!!D(k.transform)&&k.transform,k.worker&&l.WORKERS_SUPPORTED){var L=function(){if(!l.WORKERS_SUPPORTED)return!1;var Q=(ae=s.URL||s.webkitURL||null,W=n.toString(),l.BLOB_URL||(l.BLOB_URL=ae.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; ","(",W,")();"],{type:"text/javascript"})))),I=new s.Worker(Q),ae,W;return I.onmessage=b,I.id=a++,i[I.id]=I}();return L.userStep=k.step,L.userChunk=k.chunk,L.userComplete=k.complete,L.userError=k.error,k.step=D(k.step),k.chunk=D(k.chunk),k.complete=D(k.complete),k.error=D(k.error),delete k.worker,void L.postMessage({input:y,config:k,workerId:L.id})}var F=null;return l.NODE_STREAM_INPUT,typeof y=="string"?(y=function(Q){return Q.charCodeAt(0)===65279?Q.slice(1):Q}(y),F=k.download?new h(k):new g(k)):y.readable===!0&&D(y.read)&&D(y.on)?F=new f(k):(s.File&&y instanceof File||y instanceof Object)&&(F=new p(k)),F.stream(y)},unparse:function(y,k){var T=!1,L=!0,F=",",Q=`\r
`,I='"',ae=I+I,W=!1,S=null,q=!1;(function(){if(typeof k=="object"){if(typeof k.delimiter!="string"||l.BAD_DELIMITERS.filter(function(ee){return k.delimiter.indexOf(ee)!==-1}).length||(F=k.delimiter),(typeof k.quotes=="boolean"||typeof k.quotes=="function"||Array.isArray(k.quotes))&&(T=k.quotes),typeof k.skipEmptyLines!="boolean"&&typeof k.skipEmptyLines!="string"||(W=k.skipEmptyLines),typeof k.newline=="string"&&(Q=k.newline),typeof k.quoteChar=="string"&&(I=k.quoteChar),typeof k.header=="boolean"&&(L=k.header),Array.isArray(k.columns)){if(k.columns.length===0)throw new Error("Option columns is empty");S=k.columns}k.escapeChar!==void 0&&(ae=k.escapeChar+I),(typeof k.escapeFormulae=="boolean"||k.escapeFormulae instanceof RegExp)&&(q=k.escapeFormulae instanceof RegExp?k.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var V=new RegExp(v(I),"g");if(typeof y=="string"&&(y=JSON.parse(y)),Array.isArray(y)){if(!y.length||Array.isArray(y[0]))return be(null,y,W);if(typeof y[0]=="object")return be(S||Object.keys(y[0]),y,W)}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||S),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])),be(y.fields||[],y.data||[],W);throw new Error("Unable to serialize unrecognized input");function be(ee,ve,Ee){var N="";typeof ee=="string"&&(ee=JSON.parse(ee)),typeof ve=="string"&&(ve=JSON.parse(ve));var J=Array.isArray(ee)&&0<ee.length,H=!Array.isArray(ve[0]);if(J&&L){for(var te=0;te<ee.length;te++)0<te&&(N+=F),N+=ge(ee[te],te);0<ve.length&&(N+=Q)}for(var X=0;X<ve.length;X++){var fe=J?ee.length:ve[X].length,ce=!1,w=J?Object.keys(ve[X]).length===0:ve[X].length===0;if(Ee&&!J&&(ce=Ee==="greedy"?ve[X].join("").trim()==="":ve[X].length===1&&ve[X][0].length===0),Ee==="greedy"&&J){for(var E=[],P=0;P<fe;P++){var B=H?ee[P]:P;E.push(ve[X][B])}ce=E.join("").trim()===""}if(!ce){for(var $=0;$<fe;$++){0<$&&!w&&(N+=F);var ne=J&&H?ee[$]:$;N+=ge(ve[X][ne],$)}X<ve.length-1&&(!Ee||0<fe&&!w)&&(N+=Q)}}return N}function ge(ee,ve){if(ee==null)return"";if(ee.constructor===Date)return JSON.stringify(ee).slice(1,25);var Ee=!1;q&&typeof ee=="string"&&q.test(ee)&&(ee="'"+ee,Ee=!0);var N=ee.toString().replace(V,ae);return(Ee=Ee||T===!0||typeof T=="function"&&T(ee,ve)||Array.isArray(T)&&T[ve]||function(J,H){for(var te=0;te<H.length;te++)if(-1<J.indexOf(H[te]))return!0;return!1}(N,l.BAD_DELIMITERS)||-1<N.indexOf(F)||N.charAt(0)===" "||N.charAt(N.length-1)===" ")?I+N+I:N}}};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=!o&&!!s.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=_,l.ParserHandle=m,l.NetworkStreamer=h,l.FileStreamer=p,l.StringStreamer=g,l.ReadableStreamStreamer=f,s.jQuery){var c=s.jQuery;c.fn.parse=function(y){var k=y.config||{},T=[];return this.each(function(Q){if(!(c(this).prop("tagName").toUpperCase()==="INPUT"&&c(this).attr("type").toLowerCase()==="file"&&s.FileReader)||!this.files||this.files.length===0)return!0;for(var I=0;I<this.files.length;I++)T.push({file:this.files[I],inputElem:this,instanceConfig:c.extend({},k)})}),L(),this;function L(){if(T.length!==0){var Q,I,ae,W,S=T[0];if(D(y.before)){var q=y.before(S.file,S.inputElem);if(typeof q=="object"){if(q.action==="abort")return Q="AbortError",I=S.file,ae=S.inputElem,W=q.reason,void(D(y.error)&&y.error({name:Q},I,ae,W));if(q.action==="skip")return void F();typeof q.config=="object"&&(S.instanceConfig=c.extend(S.instanceConfig,q.config))}else if(q==="skip")return void F()}var V=S.instanceConfig.complete;S.instanceConfig.complete=function(be){D(V)&&V(be,S.file,S.inputElem),F()},l.parse(S.file,S.instanceConfig)}else D(y.complete)&&y.complete()}function F(){T.splice(0,1),L()}}}function u(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(k){var T=R(k);T.chunkSize=parseInt(T.chunkSize),k.step||k.chunk||(T.chunkSize=null),this._handle=new m(T),(this._handle.streamer=this)._config=T}.call(this,y),this.parseChunk=function(k,T){if(this.isFirstChunk&&D(this._config.beforeFirstChunk)){var L=this._config.beforeFirstChunk(k);L!==void 0&&(k=L)}this.isFirstChunk=!1,this._halted=!1;var F=this._partialLine+k;this._partialLine="";var Q=this._handle.parse(F,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var I=Q.meta.cursor;this._finished||(this._partialLine=F.substring(I-this._baseIndex),this._baseIndex=I),Q&&Q.data&&(this._rowCount+=Q.data.length);var ae=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(r)s.postMessage({results:Q,workerId:l.WORKER_ID,finished:ae});else if(D(this._config.chunk)&&!T){if(this._config.chunk(Q,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);Q=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(Q.data),this._completeResults.errors=this._completeResults.errors.concat(Q.errors),this._completeResults.meta=Q.meta),this._completed||!ae||!D(this._config.complete)||Q&&Q.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),ae||Q&&Q.meta.paused||this._nextChunk(),Q}this._halted=!0},this._sendError=function(k){D(this._config.error)?this._config.error(k):r&&this._config.error&&s.postMessage({workerId:l.WORKER_ID,error:k,finished:!1})}}function h(y){var k;(y=y||{}).chunkSize||(y.chunkSize=l.RemoteChunkSize),u.call(this,y),this._nextChunk=o?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(T){this._input=T,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(k=new XMLHttpRequest,this._config.withCredentials&&(k.withCredentials=this._config.withCredentials),o||(k.onload=O(this._chunkLoaded,this),k.onerror=O(this._chunkError,this)),k.open(this._config.downloadRequestBody?"POST":"GET",this._input,!o),this._config.downloadRequestHeaders){var T=this._config.downloadRequestHeaders;for(var L in T)k.setRequestHeader(L,T[L])}if(this._config.chunkSize){var F=this._start+this._config.chunkSize-1;k.setRequestHeader("Range","bytes="+this._start+"-"+F)}try{k.send(this._config.downloadRequestBody)}catch(Q){this._chunkError(Q.message)}o&&k.status===0&&this._chunkError()}},this._chunkLoaded=function(){k.readyState===4&&(k.status<200||400<=k.status?th
`),se=1<j.length&&j[0].length<re[0].length;if(re.length===1||se)return`
2023-07-13 23:42:29 +00:00
`;for(var U=0,Z=0;Z<re.length;Z++)re[Z][0]===`
`&&U++;return U>=re.length/2?`\r
2023-07-17 11:03:42 +00:00
`:"\r"}(X,w)),L=!1,y.delimiter)D(y.delimiter)&&(y.delimiter=y.delimiter(X),ee.meta.delimiter=y.delimiter);else{var E=function(B,$,ne,re,j){var se,U,Z,ie;j=j||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var de=0;de<j.length;de++){var ue=j[de],xe=0,K=0,oe=0;Z=void 0;for(var pe=new _({comments:re,delimiter:ue,newline:$,preview:10}).parse(B),Ce=0;Ce<pe.data.length;Ce++)if(ne&&Ee(pe.data[Ce]))oe++;else{var Pe=pe.data[Ce].length;K+=Pe,Z!==void 0?0<Pe&&(xe+=Math.abs(Pe-Z),Z=Pe):Z=Pe}0<pe.data.length&&(K/=pe.data.length-oe),(U===void 0||xe<=U)&&(ie===void 0||ie<K)&&1.99<K&&(U=xe,se=ue,ie=K)}return{successful:!!(y.delimiter=se),bestDelimiter:se}}(X,y.newline,y.skipEmptyLines,y.comments,y.delimitersToGuess);E.successful?y.delimiter=E.bestDelimiter:(L=!0,y.delimiter=l.DefaultDelimiter),ee.meta.delimiter=y.delimiter}var P=R(y);return y.preview&&y.header&&P.preview++,k=X,T=new _(P),ee=T.parse(k,fe,ce),N(),V?{meta:{paused:!0}}:ee||{meta:{paused:!1}}},this.paused=function(){return V},this.pause=function(){V=!0,T.abort(),k=D(y.chunk)?"":k.substring(T.getCharIndex())},this.resume=function(){W.streamer._halted?(V=!1,W.streamer.parseChunk(k,!0)):setTimeout(W.resume,3)},this.aborted=function(){return be},this.abort=function(){be=!0,T.abort(),ee.meta.aborted=!0,D(y.complete)&&y.complete(ee),k=""}}function v(y){return y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _(y){var k,T=(y=y||{}).delimiter,L=y.newline,F=y.comments,Q=y.step,I=y.preview,ae=y.fastMode,W=k=y.quoteChar===void 0||y.quoteChar===null?'"':y.quoteChar;if(y.escapeChar!==void 0&&(W=y.escapeChar),(typeof T!="string"||-1<l.BAD_DELIMITERS.indexOf(T))&&(T=","),F===T)throw new Error("Comment character same as delimiter");F===!0?F="#":(typeof F!="string"||-1<l.BAD_DELIMITERS.indexOf(F))&&(F=!1),L!==`
2023-07-10 23:12:40 +00:00
`&&L!=="\r"&&L!==`\r
`&&(L=`
2023-07-17 11:03:42 +00:00
`);var S=0,q=!1;this.parse=function(V,be,ge){if(typeof V!="string")throw new Error("Input must be a string");var ee=V.length,ve=T.length,Ee=L.length,N=F.length,J=D(Q),H=[],te=[],X=[],fe=S=0;if(!V)return qe();if(y.header&&!be){var ce=V.split(L)[0].split(T),w=[],E={},P=!1;for(var B in ce){var $=ce[B];D(y.transformHeader)&&($=y.transformHeader($,B));var ne=$,re=E[$]||0;for(0<re&&(P=!0,ne=$+"_"+re),E[$]=re+1;w.includes(ne);)ne=ne+"_"+re;w.push(ne)}if(P){var j=V.split(L);j[0]=w.join(T),V=j.join(L)}}if(ae||ae!==!1&&V.indexOf(k)===-1){for(var se=V.split(L),U=0;U<se.length;U++){if(X=se[U],S+=X.length,U!==se.length-1)S+=L.length;else if(ge)return qe();if(!F||X.substring(0,N)!==F){if(J){if(H=[],oe(X.split(T)),De(),q)return qe()}else oe(X.split(T));if(I&&I<=U)return H=H.slice(0,I),qe(!0)}}return qe()}for(var Z=V.indexOf(T,S),ie=V.indexOf(L,S),de=new RegExp(v(W)+v(k),"g"),ue=V.indexOf(k,S);;)if(V[S]!==k)if(F&&X.length===0&&V.substring(S,S+N)===F){if(ie===-1)return qe();S=ie+Ee,ie=V.indexOf(L,S),Z=V.indexOf(T,S)}else if(Z!==-1&&(Z<ie||ie===-1))X.push(V.substring(S,Z)),S=Z+ve,Z=V.indexOf(T,S);else{if(ie===-1)break;if(X.push(V.substring(S,ie)),Pe(ie+Ee),J&&(De(),q))return qe();if(I&&H.length>=I)return qe(!0)}else for(ue=S,S++;;){if((ue=V.indexOf(k,ue+1))===-1)return ge||te.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:H.length,index:S}),Ce();if(ue===ee-1)return Ce(V.substring(S,ue).replace(de,k));if(k!==W||V[ue+1]!==W){if(k===W||ue===0||V[ue-1]!==W){Z!==-1&&Z<ue+1&&(Z=V.indexOf(T,ue+1)),ie!==-1&&ie<ue+1&&(ie=V.indexOf(L,ue+1));var xe=pe(ie===-1?Z:Math.min(Z,ie));if(V.substr(ue+1+xe,ve)===T){X.push(V.substring(S,ue).replace(de,k)),V[S=ue+1+xe+ve]!==k&&(ue=V.indexOf(k,S)),Z=V.indexOf(T,S),ie=V.indexOf(L,S);break}var K=pe(ie);if(V.substring(ue+1+K,ue+1+K+Ee)===L){if(X.push(V.substring(S,ue).replace(de,k)),Pe(ue+1+K+Ee),Z=V.indexOf(T,S),ue=V.indexOf(k,S),J&&(De(),q))return qe();if(I&&H.length>=I)return qe(!0);break}te.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:H.length,index:S}),ue++}}else ue++}return Ce();function oe(Ye){H.push(Ye),fe=S}function pe(Ye){var et=0;if(Ye!==-1){var it=V.substring(ue+1,Ye);it&&it.trim()===""&&(et=it.length)}return et}function Ce(Ye){return ge||(Ye===void 0&&(Ye=V.substring(S)),X.push(Ye),S=ee,oe(X),J&&De()),qe()}function Pe(Ye){S=Ye,oe(X),X=[],ie=V.indexOf(L,S)}function qe(Ye){return{data:H,errors:te,meta:{delimiter:T,linebreak:L,aborted:q,truncated:!!Ye,cursor:fe+(be||0)}}}function De(){Q(qe()),H=[],te=[]}},this.abort=function(){q=!0},this.getCharIndex=function(){return S}}function b(y){var k=y.data,T=i[k.workerId],L=!1;if(k.error)T.userError(k.error,k.file);else if(k.results&&k.results.data){var F={abort:function(){L=!0,x(k.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:C,resume:C};if(D(T.userStep)){for(var Q=0;Q<k.results.data.length&&(T.userStep({data:k.results.data[Q],errors:k.results.errors,meta:k.results.meta},F),!L);Q++);delete k.results}else D(T.userChunk)&&(T.userChunk(k.results,F,k.file),delete k.results)}k.finished&&!L&&x(k.workerId,k.results)}function x(y,k){var T=i[y];D(T.userComplete)&&T.userComplete(k),T.terminate(),delete i[y]}function C(){throw new Error("Not implemented.")}function R(y){if(typeof y!="object"||y===null)return y;var k=Array.isArray(y)?[]:{};for(var T in y)k[T]=R(y[T]);return k}function O(y,k){return function(){y.apply(k,arguments)}}function D(y){return typeof y=="function"}return r&&(s.onmessage=function(y){var k=y.data;if(l.WORKER_ID===void 0&&k&&(l.WORKER_ID=k.workerId),typeof k.input=="string")s.postMessage({workerId:l.WORKER_ID,results:l.parse(k.input,k.config),finished:!0});else if(s.File&&k.input instanceof File||k.input instanceof Object){var T=l.parse(k.input,k.config);T&&s.postMessage({workerId:l.WORKER_ID,results:T,finished:!0})}}),(h.prototype=Object.create(u.prototype)).constructor=h,(p.prototype=Object.create(u.prototype)).constructor=p,(g.prototype=Object.create(g.prototype)).constructor=g,(f.prototype=Object.create(u.prototype)).constructor=f,l})})(Lp);var w2=Lp.ex
2023-07-10 23:12:40 +00:00
`+model_object.title+`
2023-07-10 23:28:47 +00:00
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(s=>s.model.path==t.model_url&&s.model.title==t.model_name&&this.configFile.binding_name==t.binding_folder),n=this.models[e];n&&(n.installing=!1,n.isInstalled=!1),console.error("Installation failed:",t.error),this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+model_object.title+`
2023-07-17 11:03:42 +00:00
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;je.emit("install_model",{path:t},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-07-14 12:02:53 +00:00
${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("ppa",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:
2023-07-10 23:12:40 +00:00
`+t.name,4,!0):this.$refs.toast.showToast(`Error on select personality:
2023-07-16 16:57:30 +00:00
`+t.name,4,!1),this.isLoading=!1}else console.log("mounting pers"),this.onPersonalityMounted(t);_e(()=>{ye.replace()})}},onSelected(t){this.isLoading&&this.$refs.toast.showToast("Loading... please wait",4,!1),t&&(t.isInstalled?this.configFile.model_name!=t.title&&this.update_model(t.title).then(e=>{console.log("update_model",e),this.configFile.model_name=t.title,this.$refs.toast.showToast(`Selected model:
2023-07-10 23:28:47 +00:00
`+t.title,4,!0),this.settingsChanged=!0,this.isModelSelected=!0}):this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+t.title+`
2023-07-16 16:57:30 +00:00
is not installed`,4,!1),_e(()=>{ye.replace()}))},onCopy(t){let e;t.model.isCustomModel?e=`Model name: ${t.title}
2023-07-10 23:12:40 +00:00
File size: ${t.fileSize}
Manually downloaded model `:e=`Model name: ${t.title}
File size: ${t.fileSize}
Download: ${t.path}
License: ${t.license}
Owner: ${t.owner}
Website: ${t.owner_link}
2023-07-17 11:03:42 +00:00
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(t.path)},onCancelInstall(){const t=this.addModel;console.log("cancel install",t),this.modelDownlaodInProgress=!1,this.addModel={},this.$refs.toast.showToast("Model installation aborted",4,!1),je.emit("cancel_install",{model_name:t.model_name,binding_folder:t.binding_folder,model_url:t.model_url})},onInstall(t){if(t.linkNotValid){t.installing=!1,this.$refs.toast.showToast("Link is not valid, file does not exist",4,!1);return}let e=t.path;this.showProgress=!0,this.progress=0,this.addModel={model_name:t.model.title,binding_folder:this.configFile.binding_name,model_url:t.path},console.log("installing...",this.addModel);const n=s=>{if(console.log("received something"),s.status&&s.progress<=100){if(this.addModel=s,console.log("Progress",s),t.progress=s.progress,t.speed=s.speed,t.total_size=s.total_size,t.downloaded_size=s.downloaded_size,t.start_time=s.start_time,t.installing=!0,t.progress==100){const o=this.models.findIndex(r=>r.path===e);this.models[o].isInstalled=!0,this.showProgress=!1,t.installing=!1,console.log("Received succeeded"),je.off("install_progress",n),console.log("Installed successfully"),this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+t.title+`
2023-07-17 11:03:42 +00:00
installed!`,4,!0),this.$store.dispatch("refreshDiskUsage")}}else je.off("install_progress",n),console.log("Install failed"),t.installing=!1,this.showProgress=!1,console.error("Installation failed:",s.error),this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+t.title+`
2023-07-17 11:03:42 +00:00
failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage")};je.on("install_progress",n),je.emit("install_model",{path:e}),console.log("Started installation, please wait")},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.modelDownlaodInProgress=!0,this.addModel.progress==100&&(this.modelDownlaodInProgress=!1,console.log("Received succeeded"),je.off("install_progress",e),console.log("Installed successfully"),this.addModel={},this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+this.addModel.model_name+`
2023-07-17 11:03:42 +00:00
installed!`,4,!0),this.$store.dispatch("refreshDiskUsage"))):(je.off("install_progress",e),console.log("Install failed"),this.modelDownlaodInProgress=!1,console.error("Installation failed:",n.error),this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+this.addModel.model_name+`
2023-07-17 11:03:42 +00:00
failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};je.on("install_progress",e),je.emit("install_model",{path:t}),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.modelDownlaodInProgress=!0,this.addModel.progress==100&&(this.modelDownlaodInProgress=!1,console.log("Received succeeded"),je.off("progress",e),console.log("Installed successfully"),this.addModel={},this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+this.addModel.model_name+`
2023-07-17 11:03:42 +00:00
installed!`,4,!0),this.$store.dispatch("refreshDiskUsage"))):(je.off("progress",e),console.log("Install failed"),this.modelDownlaodInProgress=!1,console.error("Installation failed:",n.error),this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+this.addModel.model_name+`
2023-07-17 11:03:42 +00:00
failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};je.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.title+"]","Yes","Cancel").then(e=>{if(e){console.log("uninstalling model...");const n=s=>{if(console.log("uninstalling res",s),s.status){console.log("uninstalling success",s),t.uninstalling=!1,je.off("install_progress",n),this.showProgress=!1;const o=this.models.findIndex(r=>r.path===t.path);this.models[o].isInstalled=!1,t.model.isCustomModel&&(this.models=this.models.filter(r=>r.title!==t.title)),this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+t.title+`
2023-07-17 11:03:42 +00:00
was uninstalled!`,4,!0),this.$store.dispatch("refreshDiskUsage")}else console.log("uninstalling failed",s),t.uninstalling=!1,this.showProgress=!1,je.off("install_progress",n),console.error("Uninstallation failed:",message.error),this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+t.title+`
2023-07-17 11:03:42 +00:00
failed to uninstall!`,4,!1),this.$store.dispatch("refreshDiskUsage")};je.on("install_progress",n),je.emit("uninstall_model",{path:t.path})}})},onSelectedBinding(t){if(console.log("Binding selected"),!t.binding.installed){this.$refs.toast.showToast(`Binding is not installed:
2023-07-10 23:28:47 +00:00
`+t.binding.name,4,!1);return}this.configFile.binding_name!=t.binding.folder&&this.update_binding(t.binding.folder)},onInstallBinding(t){this.configFile.binding_name!=t.binding.folder&&this.update_binding(t.binding.folder)},onReinstallBinding(t){this.isLoading=!0,Se.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}))},onSettingsBinding(t){try{this.isLoading=!0,Se.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{Se.post("/set_active_binding_settings",n).then(s=>{s&&s.data?(console.log("binding set with new settings",s.data),this.$refs.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$refs.toast.showToast(`Did not get binding settings responses.
2023-07-10 23:12:40 +00:00
`+s,4,!1),this.isLoading=!1)})}catch(s){this.$refs.toast.showToast(`Did not get binding settings responses.
2023-07-13 23:42:29 +00:00
Endpoint error: `+s.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,Se.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,Se.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{Se.post("/set_active_personality_settings",n).then(s=>{s&&s.data?(console.log("personality set with new settings",s.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):(this.$refs.toast.showToast(`Did not get Personality settings responses.
2023-07-10 23:12:40 +00:00
`+s,4,!1),this.isLoading=!1)})}catch(s){this.$refs.toast.showToast(`Did not get Personality settings responses.
2023-07-16 16:57:30 +00:00
Endpoint error: `+s.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_language(t,e){this.personality_language=t,e()},update_personality_category(t,e){this.personality_category=t,e()},refresh(){console.log("Refreshing"),this.$store.dispatch("refreshConfig").then(()=>{console.log(this.personality_language),console.log(this.personality_category),this.personalitiesFiltered=this.personalities.filter(t=>t.category===this.personality_category&&t.language===this.personality_language),this.personalitiesFiltered.sort()})},toggleAccordion(){this.showAccordion=!this.showAccordion},async update_setting(t,e,n){console.log("Updating setting",t,":",e),this.isLoading=!0;const s={setting_name:t,setting_value:e};let o=await Se.post("/update_setting",s);if(o)return this.isLoading=!1,console.log("update_setting",o),n!==void 0&&n(o),o.data;this.isLoading=!1},update_binding(t){this.isLoading=!0,console.log("updating binding_name"),this.update_setting("binding_name",t,e=>{console.log("updated binding_name");const n=this.bindingsArr.findIndex(o=>o.folder==t),s=this.bindingsArr[n];s&&(s.installed=!0),this.settingsChanged=!0,this.isLoading=!1,console.log("updating model"),this.update_model(null).then(()=>{console.log("updated model"),this.configFile.model_name=null,this.$store.dispatch("refreshConfig"),this.$store.dispatch("refreshModelsZoo"),this.$refs.toast.showToast("Binding changed.",4,!0),this.$forceUpdate()}),_e(()=>{ye.replace()})})},async update_model(t){console.log("hjsdfhksdjufkdshf"),t||(this.isModelSelected=!1),this.isLoading=!0;let e=await this.update_setting("model_name",t);return this.isLoading=!1,e},applyConfiguration(){this.isLoading=!0,Se.post("/apply_settings").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),_e(()=>{ye.replace()})})},save_configuration(){this.showConfirmation=!1,Se.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?
2023-07-17 11:03:42 +00:00
This will delete all your configurations and get back to default configuration.`).then(t=>{t&&Se.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 Se.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.config,n=Object.keys(t);for(let s=0;s<n.length;s++){const o=n[s],r=t[o],i=Object.keys(r);for(let a=0;a<i.length;a++){const l=i[a],u=r[l].map(h=>{const p=e.personalities.includes(o+"/"+l+"/"+h.folder);let g={};return g=h,g.category=l,g.language=o,g.full_path=o+"/"+l+"/"+h.folder,g.isMounted=p,g});this.personalities.length==0?this.personalities=u:this.personalities=this.personalities.concat(u)}}this.personalities.sort((s,o)=>s.name.localeCompare(o.name)),this.personalitiesFiltered=this.personalities.filter(s=>s.category===this.configFile.personality_category&&s.language===this.configFile.personality_language),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&&n.language===this.configFile.personality_language),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&&n.language===this.configFile.personality_language),this.personalitiesFiltered.sort()),this.searchPersonalityInProgress=!1},async filterModels(){if(!this.searchModel){console.log("Searching model"),this.modelsFiltered=this.models,this.modelsFiltered.sort(),this.searchModelInProgress=!1;return}const t=this.searchModel.toLowerCase(),e=this.models.filter(n=>{if(n.title&&n.title.toLowerCase().includes(t)||n.description&&n.description.toLowerCase().includes(t)||n.path&&n.path.toLowerCase().includes(t))return n});e.length>0?this.modelsFiltered=e.sort():(this.modelsFiltered=this.models,this.modelsFiltered.sort()),this.searchModelInProgress=!1},computedFileSize(t){return Ht(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 Se.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 Se.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"};console.log("select pers",t);const n={id:this.configFile.personalities.findIndex(s=>s===t.full_path)};try{const s=await Se.post("/select_personality",n);if(s)return this.$store.dispatch("refreshConfig").then(()=>{this.$store.dispatch("refreshPersonalitiesArr").then(()=>{this.$store.dispatch("refreshMountedPersonalities")})}),s.data}catch(s){console.log(s.message,"select_personality - settings");return}},async mountPersonality(t){if(this.isLoading=!0,console.log("mount pers",t),!t)return;if(this.configFile.personalities.includes(t.personality.full_path)){this.isLo
2023-07-10 23:28:47 +00:00
`+t.personality.name,4,!0),this.$store.dispatch("refreshMountedPersonalities")):(t.isMounted=!1,this.$refs.toast.showToast(`Could not mount personality
2023-07-10 23:12:40 +00:00
Error: `+e.error+`
Response:
2023-07-10 23:28:47 +00:00
`+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),s=this.personalitiesFiltered.findIndex(a=>a.full_path==t.full_path),o=this.$refs.personalitiesZoo.findIndex(a=>a.full_path==t.full_path);console.log("ppp",this.personalities[n]),this.personalities[n].isMounted=!1,s>-1&&(this.personalitiesFiltered[s].isMounted=!1),o>-1&&(this.$refs.personalitiesZoo[o].isMounted=!1),this.$store.dispatch("refreshMountedPersonalities");const r=this.mountedPersArr[this.mountedPersArr.length-1];console.log(r,this.mountedPersArr.length),(await this.select_personality(t.personality)).status&&this.$refs.toast.showToast(`Selected personality:
2023-07-10 23:12:40 +00:00
`+r.name,4,!0)}else this.$refs.toast.showToast(`Could not unmount personality
2023-07-15 00:12:43 +00:00
Error: `+e.error,4,!1);this.isLoading=!1},onPersonalityReinstall(t){console.log("on reinstall ",t),this.isLoading=!0,Se.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
2023-07-17 11:03:42 +00:00
`+e.message,4,!1),{status:!1}))},onPersonalityMounted(t){console.log("on sel ",t),this.configFile.personalities.includes(t.full_path)?this.configFile.personalities.length==1?this.$refs.toast.showToast("Can't unmount last personality",4,!1):this.unmountPersonality(t):this.mountPersonality(t)},personalityImgPlacehodler(t){t.target.src=Jn},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(){this.constructor()},activated(){this.isMounted&&this.constructor()},computed:{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}},auto_update:{get(){return this.$store.state.config.auto_update},set(t){this.$store.state.config.auto_update=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)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(t){this.$store.commit("setMountedPers",t)}},bindingsArr:{get(){return this.$store.state.bindingsArr},set(t){this.$store.commit("setBindingsArr",t)}},modelsArr:{get(){return this.$store.state.modelsArr},set(t){this.$store.commit("setModelsArr",t)}},models:{get(){return this.$store.state.models_zoo},set(t){this.$store.commit("setModelsZoo",t)}},diskUsage:{get(){return this.$store.state.diskUsage},set(t){this.$store.commit("setDiskUsage",t)}},ramUsage:{get(){return this.$store.state.ramUsage},set(t){this.$store.commit("setRamUsage",t)}},vramUsage:{get(){return this.$store.state.vramUsage},set(t){this.$store.commit("setVramUsage",t)}},disk_available_space(){return this.computedFileSize(this.diskUsage.available_space)},disk_binding_models_usage(){return console.log(`this.diskUsage : ${this.diskUsage}`),this.computedFileSize(this.diskUsage.binding_models_usage)},disk_percent_usage(){return this.diskUsage.percent_usage},disk_total_space(){return this.computedFileSize(this.diskUsage.total_space)},ram_available_space(){return this.computedFileSize(this.ramUsage.available_space)},ram_usage(){return this.computedFileSize(this.ramUsage.ram_usage)},ram_percent_usage(){return this.ramUsage.percent_usage},ram_total_space(){return this.computedFileSize(this.ramUsage.total_space)},imgBinding(){if(this.isMounted)try{return this.$refs.bindingZoo[this.$refs.bindingZoo.findIndex(t=>t.binding.folder==this.configFile.binding_name)].$refs.imgElement.src}catch{return Cr}},imgModel(){if(this.isMounted)try{return this.$refs.modelZoo[this.$refs.modelZoo.findIndex(t=>t.title==this.configFile.model_name)].$refs.imgElement.src}catch{return Cr}},model_name(){if(this.isMounted)return this.configFile.model_name},binding_name(){if(!this.isMounted)return;const t=this.bindingsArr.findIndex(e=>e.folder===this.configFile.binding_name);if(t>-1)return this.bindingsArr[t].name},active_pesonality(){if(!this.isMounted)return;const t=this.personalities.findIndex(e=>e.full_path===this.configFile.personalities[this.configFile.active_personality_id]);if(t>-1)return this.personalities[t].name},speed_computed(){return Ht(this.addModel.speed)},total_size_computed(){return Ht(this.addModel.total_size)},downloaded_size_computed(){return Ht(this.addModel.downloaded_size)}},watch:{bec_collapsed(){_e(()=>{ye.replace()})},pc_collapsed(){_e(()=>{ye.replace()})},mc_collapsed(){_e(()=>{ye.replace()})},sc_collapsed(){_e(()=>{ye.replace()})
2023-07-10 23:12:40 +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?
2023-07-17 11:03:42 +00:00
You need to select model before you leave, or else.`,"Ok","Cancel"),!1}},he=t=>(ns("data-v-ec3927a6"),t=t(),ss(),t),d5={class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-0"},h5={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"},f5={key:0,class:"flex gap-3 flex-1 items-center duration-75"},p5=he(()=>d("i",{"data-feather":"x"},null,-1)),g5=[p5],m5=he(()=>d("i",{"data-feather":"check"},null,-1)),_5=[m5],b5={key:1,class:"flex gap-3 flex-1 items-center"},y5=he(()=>d("i",{"data-feather":"save"},null,-1)),v5=[y5],w5=he(()=>d("i",{"data-feather":"refresh-ccw"},null,-1)),x5=[w5],k5=he(()=>d("i",{"data-feather":"list"},null,-1)),E5=[k5],C5={class:"flex gap-3 flex-1 items-center justify-end"},A5={class:"flex gap-3 items-center"},S5={key:0,class:"flex gap-3 items-center"},T5=he(()=>d("i",{"data-feather":"check"},null,-1)),M5=[T5],O5={key:1,role:"status"},R5=he(()=>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)),N5=he(()=>d("span",{class:"sr-only"},"Loading...",-1)),D5={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"},L5={class:"flex flex-row p-3"},I5=he(()=>d("i",{"data-feather":"chevron-right"},null,-1)),P5=[I5],F5=he(()=>d("i",{"data-feather":"chevron-down"},null,-1)),B5=[F5],$5=he(()=>d("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),j5=he(()=>d("div",{class:"mr-2"},"|",-1)),z5={class:"text-base font-semibold cursor-pointer select-none items-center"},U5={class:"flex gap-2 items-center"},q5={key:0},H5={class:"flex gap-2 items-center"},V5=["title"],G5=zs('<path d="M 5.9133057,14.000286 H 70.974329 a 8.9999999,8.9999999 0 0 1 8.999987,8.999998 V 47.889121 H 5.9133057 Z" style="fill:none;stroke:currentColor;stroke-width:2.5;stroke-opacity:1;" id="path1116" data-v-ec3927a6></path><path d="m 5.9133057,28.634282 h -2.244251 v -9.367697 h 2.244251 z" style="fill:none;stroke:currentColor;stroke-width:2.5;stroke-opacity:1;" id="path1118" data-v-ec3927a6></path><path d="M 5.9133057,42.648417 H 3.6690547 V 33.28072 h 2.244251 z" style="fill:none;stroke:currentColor;stroke-width:2.5;stroke-opacity:1;" id="path1120" data-v-ec3927a6></path><path d="m 5.9133057,47.889121 v 4.42369" style="fill:none;stroke:currentColor;stroke-width:2.5;stroke-opacity:1;" id="path1122" data-v-ec3927a6></path><path d="M 5.9133057,14.000286 H 2.3482707" style="fill:none;stroke:currentColor;stroke-width:2.5;stroke-opacity:1;" id="path1124" data-v-ec3927a6></path><path d="M 2.3482707,14.000286 V 10.006515" style="fill:none;stroke:currentColor;stroke-width:2.5;stroke-opacity:1;" id="path1126" data-v-ec3927a6></path><path d="m 74.31472,30.942798 a 11.594069,11.594069 0 0 0 -23.188136,0 11.594069,11.594069 0 0 0 23.188136,0 z" style="fill:none;stroke:currentColor;stroke-width:2.5;stroke-opacity:1;" id="path1
`,ZH="∄",YH="∄",QH="𝔑",JH="𝔫",XH="≧̸",eV="≱",tV="≱",nV="≧̸",sV="⩾̸",oV="⩾̸",rV="⋙̸",iV="≵",aV="≫⃒",lV="≯",cV="≯",uV="≫̸",dV="↮",hV="⇎",fV="⫲",pV="∋",gV="⋼",mV="⋺",_V="∋",bV="Њ",yV="њ",vV="↚",wV="⇍",xV="‥",kV="≦̸",EV="≰",CV="↚",AV="⇍",SV="↮",TV="⇎",MV="≰",OV="≦̸",RV="⩽̸",NV="⩽̸",DV="≮",LV="⋘̸",IV="≴",PV="≪⃒",FV="≮",BV="⋪",$V="⋬",jV="≪̸",zV="∤",UV="",qV=" ",HV="𝕟",VV="",GV="⫬",KV="¬",WV="≢",ZV="≭",YV="∦",QV="∉",JV="≠",XV="≂̸",eG="∄",tG="≯",nG="≱",sG="≧̸",oG="≫̸",rG="≹",iG="⩾̸",aG="≵",lG="≎̸",cG="≏̸",uG="∉",dG="⋵̸",hG="⋹̸",fG="∉",pG="⋷",gG="⋶",mG="⧏̸",_G="⋪",bG="⋬",yG="≮",vG="≰",wG="≸",xG="≪̸",kG="⩽̸",EG="≴",CG="⪢̸",AG="⪡̸",SG="∌",TG="∌",MG="⋾",OG="⋽",RG="⊀",NG="⪯̸",DG="⋠",LG="∌",IG="⧐̸",PG="⋫",FG="⋭",BG="⊏̸",$G="⋢",jG="⊐̸",zG="⋣",UG="⊂⃒",qG="⊈",HG="⊁",VG="⪰̸",GG="⋡",KG="≿̸",WG="⊃⃒",ZG="⊉",YG="≁",QG="≄",JG="≇",XG="≉",eK="∤",tK="∦",nK="∦",sK="⫽⃥",oK="∂̸",rK="⨔",iK="⊀",aK="⋠",lK="⊀",cK="⪯̸",uK="⪯̸",dK="⤳̸",hK="↛",fK="⇏",pK="↝̸",gK="↛",mK="⇏",_K="⋫",bK="⋭",yK="⊁",vK="⋡",wK="⪰̸",xK="𝒩",kK="𝓃",EK="∤",CK="∦",AK="≁",SK="≄",TK="≄",MK="∤",OK="∦",RK="⋢",NK="⋣",DK="⊄",LK="⫅̸",IK="⊈",PK="⊂⃒",FK="⊈",BK="⫅̸",$K="⊁",jK="⪰̸",zK="⊅",UK="⫆̸",qK="⊉",HK="⊃⃒",VK="⊉",GK="⫆̸",KK="≹",WK="Ñ",ZK="ñ",YK="≸",QK="⋪",JK="⋬",XK="⋫",eW="⋭",tW="Ν",nW="ν",sW="#",oW="№",rW="",iW="≍⃒",aW="⊬",lW="⊭",cW="⊮",uW="⊯",dW="≥⃒",hW=">⃒",fW="⤄",pW="⧞",gW="⤂",mW="≤⃒",_W="<⃒",bW="⊴⃒",yW="⤃",vW="⊵⃒",wW="∼⃒",xW="⤣",kW="↖",EW="⇖",CW="↖",AW="⤧",SW="Ó",TW="ó",MW="⊛",OW="Ô",RW="ô",NW="⊚",DW="О",LW="о",IW="⊝",PW="Ő",FW="ő",BW="⨸",$W="⊙",jW="⦼",zW="Œ",UW="œ",qW="⦿",HW="𝔒",VW="𝔬",GW="˛",KW="Ò",WW="ò",ZW="⧁",YW="⦵",QW="Ω",JW="∮",XW="↺",eZ="⦾",tZ="⦻",nZ="‾",sZ="⧀",oZ="Ō",rZ="ō",iZ="Ω",aZ="ω",lZ="Ο",cZ="ο",uZ="⦶",dZ="⊖",hZ="𝕆",fZ="𝕠",pZ="⦷",gZ="“",mZ="",_Z="⦹",bZ="⊕",yZ="↻",vZ="⩔",wZ="",xZ="⩝",kZ="",EZ="",CZ="ª",AZ="º",SZ="⊶",TZ="⩖",MZ="⩗",OZ="⩛",RZ="Ⓢ",NZ="𝒪",DZ="",LZ="Ø",IZ="ø",PZ="⊘",FZ="Õ",BZ="õ",$Z="⨶",jZ="⨷",zZ="⊗",UZ="Ö",qZ="ö",HZ="⌽",VZ="‾",GZ="⏞",KZ="⎴",WZ="⏜",ZZ="¶",YZ="∥",QZ="∥",JZ="⫳",XZ="⫽",eY="∂",tY="∂",nY="П",sY="п",oY="%",rY=".",iY="‰",aY="⊥",lY="‱",cY="𝔓",uY="𝔭",dY="Φ",hY="φ",fY="ϕ",pY="",gY="☎",mY="Π",_Y="π",bY="⋔",yY="ϖ",vY="ℏ",wY="",xY="ℏ",kY="⨣",EY="⊞",CY="⨢",AY="+",SY="∔",TY="⨥",MY="⩲",OY="±",RY="±",NY="⨦",DY="⨧",LY="±",IY="",PY="⨕",FY="𝕡",BY="",$Y="£",jY="⪷",zY="⪻",UY="≺",qY="≼",HY="⪷",VY="≺",GY="≼",KY="≺",WY="⪯",ZY="≼",YY="≾",QY="⪯",JY="⪹",XY="⪵",eQ="⋨",tQ="⪯",nQ="⪳",sQ="≾",oQ="",rQ="″",iQ="",aQ="⪹",lQ="⪵",cQ="⋨",uQ="∏",dQ="∏",hQ="⌮",fQ="⌒",pQ="⌓",gQ="∝",mQ="∝",_Q="∷",bQ="∝",yQ="≾",vQ="⊰",wQ="𝒫",xQ="𝓅",kQ="Ψ",EQ="ψ",CQ="",AQ="𝔔",SQ="𝔮",TQ="⨌",MQ="𝕢",OQ="",RQ="⁗",NQ="𝒬",DQ="𝓆",LQ="",IQ="⨖",PQ="?",FQ="≟",BQ='"',$Q='"',jQ="⇛",zQ="∽̱",UQ="Ŕ",qQ="ŕ",HQ="√",VQ="⦳",GQ="⟩",KQ="⟫",WQ="⦒",ZQ="⦥",YQ="⟩",QQ="»",JQ="⥵",XQ="⇥",eJ="⤠",tJ="⤳",nJ="→",sJ="↠",oJ="⇒",rJ="⤞",iJ="↪",aJ="↬",lJ="⥅",cJ="⥴",uJ="⤖",dJ="↣",hJ="↝",fJ="⤚",pJ="⤜",gJ="",mJ="",_J="⤍",bJ="⤏",yJ="⤐",vJ="",wJ="}",xJ="]",kJ="⦌",EJ="⦎",CJ="⦐",AJ="Ř",SJ="ř",TJ="Ŗ",MJ="ŗ",OJ="⌉",RJ="}",NJ="Р",DJ="р",LJ="⤷",IJ="⥩",PJ="”",FJ="”",BJ="↳",$J="",jJ="",zJ="",UJ="",qJ="",HJ="▭",VJ="®",GJ="®",KJ="∋",WJ="⇋",ZJ="⥯",YJ="⥽",QJ="⌋",JJ="𝔯",XJ="",eX="⥤",tX="⇁",nX="⇀",sX="⥬",oX="Ρ",rX="ρ",iX="ϱ",aX="⟩",lX="⇥",cX="→",uX="→
`," "],Wce=["{","}","|","\\","^","`"].concat(Kce),Zce=["'"].concat(Wce),Wu=["%","/","?",";","#"].concat(Zce),Zu=["/","?","#"],Yce=255,Yu=/^[+a-z0-9A-Z_-]{0,63}$/,Qce=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Qu={javascript:!0,"javascript:":!0},Ju={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Jce(t,e){if(t&&t instanceof Ar)return t;var n=new Ar;return n.parse(t,e),n}Ar.prototype.parse=function(t,e){var n,s,o,r,i,a=t;if(a=a.trim(),!e&&t.split("#").length===1){var l=Gce.exec(a);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}var c=Hce.exec(a);if(c&&(c=c[0],o=c.toLowerCase(),this.protocol=c,a=a.substr(c.length)),(e||c||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)==="//",i&&!(c&&Qu[c])&&(a=a.substr(2),this.slashes=!0)),!Qu[c]&&(i||c&&!Ju[c])){var u=-1;for(n=0;n<Zu.length;n++)r=a.indexOf(Zu[n]),r!==-1&&(u===-1||r<u)&&(u=r);var h,p;for(u===-1?p=a.lastIndexOf("@"):p=a.lastIndexOf("@",u),p!==-1&&(h=a.slice(0,p),a=a.slice(p+1),this.auth=h),u=-1,n=0;n<Wu.length;n++)r=a.indexOf(Wu[n]),r!==-1&&(u===-1||r<u)&&(u=r);u===-1&&(u=a.length),a[u-1]===":"&&u--;var g=a.slice(0,u);a=a.slice(u),this.parseHost(g),this.hostname=this.hostname||"";var f=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!f){var m=this.hostname.split(/\./);for(n=0,s=m.length;n<s;n++){var v=m[n];if(v&&!v.match(Yu)){for(var _="",b=0,x=v.length;b<x;b++)v.charCodeAt(b)>127?_+="x":_+=v[b];if(!_.match(Yu)){var C=m.slice(0,n),R=m.slice(n+1),O=v.match(Qce);O&&(C.push(O[1]),R.unshift(O[2])),R.length&&(a=R.join(".")+a),this.hostname=C.join(".");break}}}}this.hostname.length>Yce&&(this.hostname=""),f&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var D=a.indexOf("#");D!==-1&&(this.hash=a.substr(D),a=a.slice(0,D));var y=a.indexOf("?");return y!==-1&&(this.search=a.substr(y),a=a.slice(0,y)),a&&(this.pathname=a),Ju[o]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Ar.prototype.parseHost=function(t){var e=Vce.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 Xce=Jce;Vs.encode=jce;Vs.decode=Uce;Vs.format=qce;Vs.parse=Xce;var Pn={},$i,Xu;function ng(){return Xu||(Xu=1,$i=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),$i}var ji,ed;function sg(){return ed||(ed=1,ji=/[\0-\x1F\x7F-\x9F]/),ji}var zi,td;function eue(){return td||(td=1,zi=/[\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]/),zi}var Ui,nd;function og(){return nd||(nd=1,Ui=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),Ui}var sd;function tue(){return sd||(sd=1,Pn.Any=ng(),Pn.Cc=sg(),Pn.Cf=eue(),Pn.P=nc,Pn.Z=og()),Pn}(function(t){function e(I){return Object.prototype.toString.call(I)}function n(I){return e(I)==="[object String]"}var s=Object.prototype.hasOwnProperty;function o(I,ae){return s.call(I,ae)}function r(I){var ae=Array.prototype.slice.call(arguments,1);return ae.forEach(function(W){if(W){if(typeof W!="object")throw new TypeError(W+"must be object");Object.keys(W).forEach(function(S){I[S]=W[S]})}}),I}function i(I,ae,W){return[].concat(I.slice(0,ae),W,I.slice(ae+1))}function a(I){return!(I>=55296&&I<=57343||I>=64976&&I<=65007||(I&65535)===65535||(I&65535)===65534||I>=0&&I<=8||I===11||I>=14&&I<=31||I>=127&&I<=159||I>1114111)}function l(I){if(I>65535){I-=65536;var ae=55296+(I>>10),W=56320+(I&1023);return String.fromCharCode(ae,W)}return String.fromCharCode(I)}var c=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,u=/&([a-z#][a-z0-9]{1,31});/gi,h=new RegExp(c.source+"|"+u.source,"gi"),p=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,g=tg;function f(I,ae){var W=0;return o(g,ae)?g[ae]:ae.charCodeAt(0)===35&&p.test(ae)&&(W=ae[1].toLowerCase()==="x"?parseInt(ae.slice(2),16):parseInt(ae.slice(1),10),a(W))?l(W):I}function m(I){return I.indexOf("\\")<0?I:I.replace(c,"$1")}function v(I){return I.indexOf("\\"
`};Jt.fence=function(t,e,n,s,o){var r=t[e],i=r.info?aue(r.info).trim():"",a="",l="",c,u,h,p,g;return i&&(h=i.split(/(\s+)/g),a=h[0],l=h.slice(2).join("")),n.highlight?c=n.highlight(r.content,a,l)||Xn(r.content):c=Xn(r.content),c.indexOf("<pre")===0?c+`
`:i?(u=r.attrIndex("class"),p=r.attrs?r.attrs.slice():[],u<0?p.push(["class",n.langPrefix+a]):(p[u]=p[u].slice(),p[u][1]+=" "+n.langPrefix+a),g={attrs:p},"<pre><code"+o.renderAttrs(g)+">"+c+`</code></pre>
2023-07-10 23:12:40 +00:00
`):"<pre><code"+o.renderAttrs(r)+">"+c+`</code></pre>
2023-07-16 16:57:30 +00:00
`};Jt.image=function(t,e,n,s,o){var r=t[e];return r.attrs[r.attrIndex("alt")][1]=o.renderInlineAsText(r.children,n,s),o.renderToken(t,e,n)};Jt.hardbreak=function(t,e,n){return n.xhtmlOut?`<br />
2023-07-10 23:12:40 +00:00
`:`<br>
2023-07-16 16:57:30 +00:00
`};Jt.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`<br />
2023-07-10 23:12:40 +00:00
`:`<br>
`:`
2023-07-17 11:03:42 +00:00
`};Jt.text=function(t,e){return Xn(t[e].content)};Jt.html_block=function(t,e){return t[e].content};Jt.html_inline=function(t,e){return t[e].content};function Gs(){this.rules=iue({},Jt)}Gs.prototype.renderAttrs=function(e){var n,s,o;if(!e.attrs)return"";for(o="",n=0,s=e.attrs.length;n<s;n++)o+=" "+Xn(e.attrs[n][0])+'="'+Xn(e.attrs[n][1])+'"';return o};Gs.prototype.renderToken=function(e,n,s){var o,r="",i=!1,a=e[n];return a.hidden?"":(a.block&&a.nesting!==-1&&n&&e[n-1].hidden&&(r+=`
2023-07-10 23:12:40 +00:00
`),r+=(a.nesting===-1?"</":"<")+a.tag,r+=this.renderAttrs(a),a.nesting===0&&s.xhtmlOut&&(r+=" /"),a.block&&(i=!0,a.nesting===1&&n+1<e.length&&(o=e[n+1],(o.type==="inline"||o.hidden||o.nesting===-1&&o.tag===a.tag)&&(i=!1))),r+=i?`>
2023-07-10 23:28:47 +00:00
`:">",r)};Gs.prototype.renderInline=function(t,e,n){for(var s,o="",r=this.rules,i=0,a=t.length;i<a;i++)s=t[i].type,typeof r[s]<"u"?o+=r[s](t,i,e,n,this):o+=this.renderToken(t,i,e);return o};Gs.prototype.renderInlineAsText=function(t,e,n){for(var s="",o=0,r=t.length;o<r;o++)t[o].type==="text"?s+=t[o].content:t[o].type==="image"?s+=this.renderInlineAsText(t[o].children,e,n):t[o].type==="softbreak"&&(s+=`
2023-07-17 11:03:42 +00:00
`);return s};Gs.prototype.render=function(t,e,n){var s,o,r,i="",a=this.rules;for(s=0,o=t.length;s<o;s++)r=t[s].type,r==="inline"?i+=this.renderInline(t[s].children,e,n):typeof a[r]<"u"?i+=a[t[s].type](t,s,e,n,this):i+=this.renderToken(t,s,e,n);return i};var lue=Gs;function Ft(){this.__rules__=[],this.__cache__=null}Ft.prototype.__find__=function(t){for(var e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1};Ft.prototype.__compile__=function(){var t=this,e=[""];t.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(s){e.indexOf(s)<0&&e.push(s)})}),t.__cache__={},e.forEach(function(n){t.__cache__[n]=[],t.__rules__.forEach(function(s){s.enabled&&(n&&s.alt.indexOf(n)<0||t.__cache__[n].push(s.fn))})})};Ft.prototype.at=function(t,e,n){var s=this.__find__(t),o=n||{};if(s===-1)throw new Error("Parser rule not found: "+t);this.__rules__[s].fn=e,this.__rules__[s].alt=o.alt||[],this.__cache__=null};Ft.prototype.before=function(t,e,n,s){var o=this.__find__(t),r=s||{};if(o===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o,0,{name:e,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null};Ft.prototype.after=function(t,e,n,s){var o=this.__find__(t),r=s||{};if(o===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o+1,0,{name:e,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null};Ft.prototype.push=function(t,e,n){var s=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:s.alt||[]}),this.__cache__=null};Ft.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach(function(s){var o=this.__find__(s);if(o<0){if(e)return;throw new Error("Rules manager: invalid rule name "+s)}this.__rules__[o].enabled=!0,n.push(s)},this),this.__cache__=null,n};Ft.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)};Ft.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach(function(s){var o=this.__find__(s);if(o<0){if(e)return;throw new Error("Rules manager: invalid rule name "+s)}this.__rules__[o].enabled=!1,n.push(s)},this),this.__cache__=null,n};Ft.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};var sc=Ft,cue=/\r\n?|\n/g,uue=/\0/g,due=function(e){var n;n=e.src.replace(cue,`
`),n=n.replace(uue,"<22>"),e.src=n},hue=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)},fue=function(e){var n=e.tokens,s,o,r;for(o=0,r=n.length;o<r;o++)s=n[o],s.type==="inline"&&e.md.inline.parse(s.content,e.md,e.env,s.children)},pue=ze.arrayReplaceAt;function gue(t){return/^<a[>\s]/i.test(t)}function mue(t){return/^<\/a\s*>/i.test(t)}var _ue=function(e){var n,s,o,r,i,a,l,c,u,h,p,g,f,m,v,_,b=e.tokens,x;if(e.md.options.linkify){for(s=0,o=b.length;s<o;s++)if(!(b[s].type!=="inline"||!e.md.linkify.pretest(b[s].content)))for(r=b[s].children,f=0,n=r.length-1;n>=0;n--){if(a=r[n],a.type==="link_close"){for(n--;r[n].level!==a.level&&r[n].type!=="link_open";)n--;continue}if(a.type==="html_inline"&&(gue(a.content)&&f>0&&f--,mue(a.content)&&f++),!(f>0)&&a.type==="text"&&e.md.linkify.test(a.content)){for(u=a.content,x=e.md.linkify.match(u),l=[],g=a.level,p=0,x.length>0&&x[0].index===0&&n>0&&r[n-1].type==="text_special"&&(x=x.slice(1)),c=0;c<x.length;c++)m=x[c].url,v=e.md.normalizeLink(m),e.md.validateLink(v)&&(_=x[c].text,x[c].schema?x[c].schema==="mailto:"&&!/^mailto:/i.test(_)?_=e.md.normalizeLinkText("mailto:"+_).replace(/^mailto:/,""):_=e.md.normalizeLinkText(_):_=e.md.normalizeLinkText("http://"+_).replace(/^http:\/\//,""),h=x[c].index,h>p&&(i=new e.Token("text","",0),i.content=u.slice(p,h),i.level=g,l.push(i)),i=new e.Token("link_open","a",1),i.attrs=[["href",v]],i.level=g++,i.markup="linkify",i.info="auto",l.push(i),i=new e.Token("text","",0),i.content=_,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=x[c].lastIndex);p<u.length&&(i=new e.Token("text","",0),i.content=u.slice(p),i.level=g,l.push(i)),b[s].children=r=pue(r,n,l)}}}},rg=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,bue=/\((c|tm|r)\)/i,yue=/\((c|tm|r)\)/ig,vue={c:"©",r:"®",tm:"™"};function wue(t,e){return vue[e.toLowerCase()]}function xue(t){var e,n,s=0;for(e=t.length-1;e>=0;e--)n=t[e],n.type==="text"&&!s&&(n.content=n.content.replace(yue,wue)),n.type==="link_open"&&n.info==="auto"&&s--,n.type==="link_close"&&n.info==="auto"&&s++}function kue(t){var e,n,s=0;for(e=t.length-1;e>=0;e--)n=t[e],n.type==="text"&&!s&&rg.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"&&s--,n.type==="link_close"&&n.info==="auto"&&s++}var Eue=function(e){var n;if(e.md.options.typographer)for(n=e.tokens.length-1;n>=0;n--)e.tokens[n].type==="inline"&&(bue.test(e.tokens[n].content)&&xue(e.tokens[n].children),rg.test(e.tokens[n].content)&&kue(e.tokens[n].children))},rd=ze.isWhiteSpace,id=ze.isPunctChar,ad=ze.isMdAsciiPunct,Cue=/['"]/,ld=/['"]/g,cd="";function Ko(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}function Aue(t,e){var n,s,o,r,i,a,l,c,u,h,p,g,f,m,v,_,b,x,C,R,O;for(C=[],n=0;n<t.length;n++){for(s=t[n],l=t[n].level,b=C.length-1;b>=0&&!(C[b].level<=l);b--);if(C.length=b+1,s.type==="text"){o=s.content,i=0,a=o.length;e:for(;i<a&&(ld.lastIndex=i,r=ld.exec(o),!!r);){if(v=_=!0,i=r.index+1,x=r[0]==="'",u=32,r.index-1>=0)u=o.charCodeAt(r.index-1);else for(b=n-1;b>=0&&!(t[b].type==="softbreak"||t[b].type==="hardbreak");b--)if(t[b].content){u=t[b].content.charCodeAt(t[b].content.length-1);break}if(h=32,i<a)h=o.charCodeAt(i);else for(b=n+1;b<t.length&&!(t[b].type==="softbreak"||t[b].type==="hardbreak");b++)if(t[b].content){h=t[b].content.charCodeAt(0);break}if(p=ad(u)||id(String.fromCharCode(u)),g=ad(h)||id(String.fromCharCode(h)),f=rd(u),m=rd(h),m?v=!1:g&&(f||p||(v=!1)),f?_=!1:p&&(m||g||(_=!1)),h===34&&r[0]==='"'&&u>=48&&u<=57&&(_=v=!1),v&&_&&(v=p,_=g),!v&&!_){x&&(s.content=Ko(s.content,r.index,cd));continue}if(_){for(b=C.length-1;b>=0&&(c=C[b],!(C[b].level<l));b--)if(c.single===x&&C[b].level===l){c=C[b],x?(R=e.md.options.quotes[2],O=e.md.options.quotes[
`,i.map=[n,e.line],!0},Iue=function(e,n,s,o){var r,i,a,l,c,u,h,p=!1,g=e.bMarks[n]+e.tShift[n],f=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||g+3>f||(r=e.src.charCodeAt(g),r!==126&&r!==96)||(c=g,g=e.skipChars(g,r),i=g-c,i<3)||(h=e.src.slice(c,g),a=e.src.slice(g,f),r===96&&a.indexOf(String.fromCharCode(r))>=0))return!1;if(o)return!0;for(l=n;l++,!(l>=s||(g=c=e.bMarks[l]+e.tShift[l],f=e.eMarks[l],g<f&&e.sCount[l]<e.blkIndent));)if(e.src.charCodeAt(g)===r&&!(e.sCount[l]-e.blkIndent>=4)&&(g=e.skipChars(g,r),!(g-c<i)&&(g=e.skipSpaces(g),!(g<f)))){p=!0;break}return i=e.sCount[n],e.line=l+(p?1:0),u=e.push("fence","code",0),u.info=a,u.content=e.getLines(n+1,l,i,!0),u.markup=h,u.map=[n,e.line],!0},dd=ze.isSpace,Pue=function(e,n,s,o){var r,i,a,l,c,u,h,p,g,f,m,v,_,b,x,C,R,O,D,y,k=e.lineMax,T=e.bMarks[n]+e.tShift[n],L=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||e.src.charCodeAt(T++)!==62)return!1;if(o)return!0;for(l=g=e.sCount[n]+1,e.src.charCodeAt(T)===32?(T++,l++,g++,r=!1,C=!0):e.src.charCodeAt(T)===9?(C=!0,(e.bsCount[n]+g)%4===3?(T++,l++,g++,r=!1):r=!0):C=!1,f=[e.bMarks[n]],e.bMarks[n]=T;T<L&&(i=e.src.charCodeAt(T),dd(i));){i===9?g+=4-(g+e.bsCount[n]+(r?1:0))%4:g++;T++}for(m=[e.bsCount[n]],e.bsCount[n]=e.sCount[n]+1+(C?1:0),u=T>=L,b=[e.sCount[n]],e.sCount[n]=g-l,x=[e.tShift[n]],e.tShift[n]=T-e.bMarks[n],O=e.md.block.ruler.getRules("blockquote"),_=e.parentType,e.parentType="blockquote",p=n+1;p<s&&(y=e.sCount[p]<e.blkIndent,T=e.bMarks[p]+e.tShift[p],L=e.eMarks[p],!(T>=L));p++){if(e.src.charCodeAt(T++)===62&&!y){for(l=g=e.sCount[p]+1,e.src.charCodeAt(T)===32?(T++,l++,g++,r=!1,C=!0):e.src.charCodeAt(T)===9?(C=!0,(e.bsCount[p]+g)%4===3?(T++,l++,g++,r=!1):r=!0):C=!1,f.push(e.bMarks[p]),e.bMarks[p]=T;T<L&&(i=e.src.charCodeAt(T),dd(i));){i===9?g+=4-(g+e.bsCount[p]+(r?1:0))%4:g++;T++}u=T>=L,m.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(C?1:0),b.push(e.sCount[p]),e.sCount[p]=g-l,x.push(e.tShift[p]),e.tShift[p]=T-e.bMarks[p];continue}if(u)break;for(R=!1,a=0,c=O.length;a<c;a++)if(O[a](e,p,s,!0)){R=!0;break}if(R){e.lineMax=p,e.blkIndent!==0&&(f.push(e.bMarks[p]),m.push(e.bsCount[p]),x.push(e.tShift[p]),b.push(e.sCount[p]),e.sCount[p]-=e.blkIndent);break}f.push(e.bMarks[p]),m.push(e.bsCount[p]),x.push(e.tShift[p]),b.push(e.sCount[p]),e.sCount[p]=-1}for(v=e.blkIndent,e.blkIndent=0,D=e.push("blockquote_open","blockquote",1),D.markup=">",D.map=h=[n,0],e.md.block.tokenize(e,n,p),D=e.push("blockquote_close","blockquote",-1),D.markup=">",e.lineMax=k,e.parentType=_,h[1]=e.line,a=0;a<x.length;a++)e.bMarks[a+n]=f[a],e.tShift[a+n]=x[a],e.sCount[a+n]=b[a],e.bsCount[a+n]=m[a];return e.blkIndent=v,!0},Fue=ze.isSpace,Bue=function(e,n,s,o){var r,i,a,l,c=e.bMarks[n]+e.tShift[n],u=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||(r=e.src.charCodeAt(c++),r!==42&&r!==45&&r!==95))return!1;for(i=1;c<u;){if(a=e.src.charCodeAt(c++),a!==r&&!Fue(a))return!1;a===r&&i++}return i<3?!1:(o||(e.line=n+1,l=e.push("hr","hr",0),l.map=[n,e.line],l.markup=Array(i+1).join(String.fromCharCode(r))),!0)},ag=ze.isSpace;function hd(t,e){var n,s,o,r;return s=t.bMarks[e]+t.tShift[e],o=t.eMarks[e],n=t.src.charCodeAt(s++),n!==42&&n!==45&&n!==43||s<o&&(r=t.src.charCodeAt(s),!ag(r))?-1:s}function fd(t,e){var n,s=t.bMarks[e]+t.tShift[e],o=s,r=t.eMarks[e];if(o+1>=r||(n=t.src.charCodeAt(o++),n<48||n>57))return-1;for(;;){if(o>=r)return-1;if(n=t.src.charCodeAt(o++),n>=48&&n<=57){if(o-s>=10)return-1;continue}if(n===41||n===46)break;return-1}return o<r&&(n=t.src.charCodeAt(o),!ag(n))?-1:o}function $ue(t,e){var n,s,o=t.level+2;for(n=e+2,s=t.tokens.length-2;n<s;n++)t.tokens[n].level===o&&t.tokens[n].type==="paragraph_open"&&(t.tokens[n+2].hidden=!0,t.tokens[n].hidden=!0,n+=2)}var jue=function(e,n,s,o){var r,i,a,l,c,u,h,p,g,f,m,v,_,b,x,C,R,O,D,y,k,T,L,F,Q,I,ae,W,S=!1,q=!0;if(e.sCount[n]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[n]-e.listIndent>=4&&e.sCount[n]<e.blkIndent)return!1;if(o&&e.parentType==="paragraph"&&e.sCount[n]>=e.blkIndent&&(S=!0),(L=fd(e,n))>=0){if(h=!0,Q=e.bMarks[n]+e.tShift[n],_=Number(e.src.slice(Q,L-1)),S&&_!==1)return!1}else if((L=hd(e,n))>=0)h=!1;else return!1;if(S&&e.skipSpaces(L)>=e.
`})),s.tokens.splice(o+3+u.length+1,0,Object.assign(new s.Token("html_block","",0),{content:e.wrapper[1]+`
`})))});function Rd(t,e,n,s){var o=t,r=s;if(n&&Object.prototype.hasOwnProperty.call(e,o))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,o);)o=t+"-"+r,r+=1;return e[o]=!0,o}function ps(t,e){e=Object.assign({},ps.defaults,e),t.core.ruler.push("anchor",function(n){for(var s,o={},r=n.tokens,i=Array.isArray(e.level)?(s=e.level,function(h){return s.includes(h)}):function(h){return function(p){return p>=h}}(e.level),a=0;a<r.length;a++){var l=r[a];if(l.type==="heading_open"&&i(Number(l.tag.substr(1)))){var c=e.getTokensText(r[a+1].children),u=l.attrGet("id");u=u==null?Rd(e.slugify(c),o,!1,e.uniqueSlugStartIndex):Rd(u,o,!0,e.uniqueSlugStartIndex),l.attrSet("id",u),e.tabIndex!==!1&&l.attrSet("tabindex",""+e.tabIndex),typeof e.permalink=="function"?e.permalink(u,e,n,a):(e.permalink||e.renderPermalink&&e.renderPermalink!==dl)&&e.renderPermalink(u,e,n,a),a=r.indexOf(l),e.callback&&e.callback(l,{slug:u,title:c})}}})}Object.assign(Od.defaults,{style:"visually-hidden",space:!0,placement:"after",wrapper:null}),ps.permalink={__proto__:null,legacy:dl,renderHref:xg,renderAttrs:kg,makePermalink:Po,linkInsideHeader:_i,ariaHidden:$n,headerLink:Eg,linkAfterHeader:Od},ps.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:dl,permalinkClass:$n.defaults.class,permalinkSpace:$n.defaults.space,permalinkSymbol:"¶",permalinkBefore:$n.defaults.placement==="before",permalinkHref:$n.defaults.renderHref,permalinkAttrs:$n.defaults.renderAttrs},ps.default=ps;var LPe=function(e,n){n=n||{};function s(o){for(var r=1,i=1,a=o.tokens.length;i<a-1;++i){var l=o.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&&o.tokens[i-1].type!=="paragraph_open")&&!(i!==a-1&&o.tokens[i+1].type!=="paragraph_close")){var c=o.tokens[i-1];c.type="figure_open",c.tag="figure",o.tokens[i+1].type="figure_close",o.tokens[i+1].tag="figure",n.dataType==!0&&o.tokens[i-1].attrPush(["data-type","image"]);var u;if(n.link==!0&&l.children.length===1&&(u=l.children[0],l.children.unshift(new o.Token("link_open","a",1)),l.children[0].attrPush(["href",u.attrGet("src")]),l.children.push(new o.Token("link_close","a",-1))),u=l.children.length===1?l.children[0]:l.children[1],n.figcaption==!0&&u.children&&u.children.length&&(l.children.push(new o.Token("figcaption_open","figcaption",1)),l.children.splice(l.children.length,0,...u.children),l.children.push(new o.Token("figcaption_close","figcaption",-1)),u.children.length=0),n.copyAttrs&&u.attrs){const h=n.copyAttrs===!0?"":n.copyAttrs;c.attrs=u.attrs.filter(([p,g])=>p.match(h))}n.tabindex==!0&&(o.tokens[i-1].attrPush(["tabindex",r]),r++),n.lazyLoading==!0&&u.attrPush(["loading","lazy"])}}}e.core.ruler.before("linkify","implicit_figures",s)};const IPe=rs(LPe);function Cg(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],s=typeof n;(s==="object"||s==="function")&&!Object.isFrozen(n)&&Cg(n)}),t}class Nd{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Ag(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function An(t,...e){const n=Object.create(null);for(const s in t)n[s]=t[s];return e.forEach(function(s){for(const o in s)n[o]=s[o]}),n}const PPe="</span>",Dd=t=>!!t.scope,FPe=(t,{prefix:
https://github.com/highlightjs/highlight.js/issues/2277`),ge=S,be=q),V===void 0&&(V=!0);const ee={code:be,language:ge};ae("before:highlight",ee);const ve=ee.result?ee.result:h(ee.language,ee.code,V);return ve.code=ee.code,ae("after:highlight",ve),ve}function h(S,q,V,be){const ge=Object.create(null);function ee(K,oe){return K.keywords[oe]}function ve(){if(!j.keywords){U.addText(Z);return}let K=0;j.keywordPatternRe.lastIndex=0;let oe=j.keywordPatternRe.exec(Z),pe="";for(;oe;){pe+=Z.substring(K,oe.index);const Ce=$.case_insensitive?oe[0].toLowerCase():oe[0],Pe=ee(j,Ce);if(Pe){const[qe,De]=Pe;if(U.addText(pe),pe="",ge[Ce]=(ge[Ce]||0)+1,ge[Ce]<=SFe&&(ie+=De),qe.startsWith("_"))pe+=oe[0];else{const Ye=$.classNameAliases[qe]||qe;J(oe[0],Ye)}}else pe+=oe[0];K=j.keywordPatternRe.lastIndex,oe=j.keywordPatternRe.exec(Z)}pe+=Z.substring(K),U.addText(pe)}function Ee(){if(Z==="")return;let K=null;if(typeof j.subLanguage=="string"){if(!e[j.subLanguage]){U.addText(Z);return}K=h(j.subLanguage,Z,!0,se[j.subLanguage]),se[j.subLanguage]=K._top}else K=g(Z,j.subLanguage.length?j.subLanguage:null);j.relevance>0&&(ie+=K.relevance),U.__addSublanguage(K._emitter,K.language)}function N(){j.subLanguage!=null?Ee():ve(),Z=""}function J(K,oe){K!==""&&(U.startScope(oe),U.addText(K),U.endScope())}function H(K,oe){let pe=1;const Ce=oe.length-1;for(;pe<=Ce;){if(!K._emit[pe]){pe++;continue}const Pe=$.classNameAliases[K[pe]]||K[pe],qe=oe[pe];Pe?J(qe,Pe):(Z=qe,ve(),Z=""),pe++}}function te(K,oe){return K.scope&&typeof K.scope=="string"&&U.openNode($.classNameAliases[K.scope]||K.scope),K.beginScope&&(K.beginScope._wrap?(J(Z,$.classNameAliases[K.beginScope._wrap]||K.beginScope._wrap),Z=""):K.beginScope._multi&&(H(K.beginScope,oe),Z="")),j=Object.create(K,{parent:{value:j}}),j}function X(K,oe,pe){let Ce=qPe(K.endRe,pe);if(Ce){if(K["on:end"]){const Pe=new Nd(K);K["on:end"](oe,Pe),Pe.isMatchIgnored&&(Ce=!1)}if(Ce){for(;K.endsParent&&K.parent;)K=K.parent;return K}}if(K.endsWithParent)return X(K.parent,oe,pe)}function fe(K){return j.matcher.regexIndex===0?(Z+=K[0],1):(xe=!0,0)}function ce(K){const oe=K[0],pe=K.rule,Ce=new Nd(pe),Pe=[pe.__beforeBegin,pe["on:begin"]];for(const qe of Pe)if(qe&&(qe(K,Ce),Ce.isMatchIgnored))return fe(oe);return pe.skip?Z+=oe:(pe.excludeBegin&&(Z+=oe),N(),!pe.returnBegin&&!pe.excludeBegin&&(Z=oe)),te(pe,K),pe.returnBegin?0:oe.length}function w(K){const oe=K[0],pe=q.substring(K.index),Ce=X(j,K,pe);if(!Ce)return Bd;const Pe=j;j.endScope&&j.endScope._wrap?(N(),J(oe,j.endScope._wrap)):j.endScope&&j.endScope._multi?(N(),H(j.endScope,K)):Pe.skip?Z+=oe:(Pe.returnEnd||Pe.excludeEnd||(Z+=oe),N(),Pe.excludeEnd&&(Z=oe));do j.scope&&U.closeNode(),!j.skip&&!j.subLanguage&&(ie+=j.relevance),j=j.parent;while(j!==Ce.parent);return Ce.starts&&te(Ce.starts,K),Pe.returnEnd?0:oe.length}function E(){const K=[];for(let oe=j;oe!==$;oe=oe.parent)oe.scope&&K.unshift(oe.scope);K.forEach(oe=>U.openNode(oe))}let P={};function B(K,oe){const pe=oe&&oe[0];if(Z+=K,pe==null)return N(),0;if(P.type==="begin"&&oe.type==="end"&&P.index===oe.index&&pe===""){if(Z+=q.slice(oe.index,oe.index+1),!o){const Ce=new Error(`0 width match regex (${S})`);throw Ce.languageName=S,Ce.badRule=P.rule,Ce}return 1}if(P=oe,oe.type==="begin")return ce(oe);if(oe.type==="illegal"&&!V){const Ce=new Error('Illegal lexeme "'+pe+'" for mode "'+(j.scope||"<unnamed>")+'"');throw Ce.mode=j,Ce}else if(oe.type==="end"){const Ce=w(oe);if(Ce!==Bd)return Ce}if(oe.type==="illegal"&&pe==="")return 1;if(ue>1e5&&ue>oe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Z+=pe,pe.length}const $=k(S);if(!$)throw Yn(r.replace("{}",S)),new Error('Unknown language: "'+S+'"');const ne=kFe($);let re="",j=be||ne;const se={},U=new a.__emitter(a);E();let Z="",ie=0,de=0,ue=0,xe=!1;try{if($.__emitTokens)$.__emitTokens(q,U);else{for(j.matcher.considerAll();;){ue++,xe?xe=!1:j.matcher.considerAll(),j.matcher.lastIndex=de;const K=j.matcher.exec(q);if(!K)break;const oe=q.substring(de,K.index),pe=B(oe,K);de=K.index+pe}B(q.substring(de))}return U.finalize(),re=U.toHTML(),{language:S,value:re,
`},f]}}return ga=o,ga}var ma,th;function VFe(){if(th)return ma;th=1;const t=l=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:l.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:[l.APOS_STRING_MODE,l.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:l.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"],s=["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","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],o=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],r=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radiu
]`,f={scope:"string",variants:[u,c,h,p]},m={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},v=["false","null","true"],_=["__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"],b=["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:_,literal:(I=>{const ae=[];return I.forEach(W=>{ae.push(W),W.toLowerCase()===W?ae.push(W.toUpperCase()):ae.push(W.toLowerCase())}),ae})(v),built_in:b},R=I=>I.map(ae=>ae.replace(/\|\d+$/,"")),O={variants:[{match:[/new/,n.concat(g,"+"),n.concat("(?!",R(b).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},D=n.concat(o,"\\b(?!\\()"),y={variants:[{match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),D],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,n.concat(/::/,n.lookahead(/(?!class\b)/)),D],scope:{1:"title.class",3:"variable.constant"}},{match:[r,n.concat("::",n.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},k={scope:"attr",match:n.concat(o,n.lookahead(":"),n.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:C,contains:[k,i,y,e.C_BLOCK_COMMENT_MODE,f,m,O]},L={relevance:0,match:[/\b/,n.concat("(?!fn\\b|function\\b|",R(_).join("\\b|"),"|",R(b).join("\\b|"),"\\b)"),o,n.concat(g,"*"),n.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push(L);const F=[k,y,e.C_BLOCK_COMMENT_MODE,f,m,O],Q={begin:n.concat(/#\[\s*/,r),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...F]},
{.a} softbreak then curly in start`,tests:[{shift:0,type:"inline",children:[{position:-2,type:"softbreak"},{position:-1,type:"text",content:Ne.hasDelimiters("only",t)}]}],transform:(n,s,o)=>{const r=n[s].children[o],i=Ne.getAttrs(r.content,0,t);let a=s+1;for(;n[a+1]&&n[a+1].nesting===-1;)a++;const l=Ne.getMatchingOpeningToken(n,a);Ne.addAttrs(i,l),n[s].children=n[s].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,s)=>{const o=n[s];o.type="hr",o.tag="hr",o.nesting=0;const r=n[s+1].content,i=r.lastIndexOf(t.leftDelimiter),a=Ne.getAttrs(r,i,t);Ne.addAttrs(a,o),o.markup=r,n.splice(s+1,2)}},{name:"end of block",tests:[{shift:0,type:"inline",children:[{position:-1,content:Ne.hasDelimiters("end",t),type:n=>n!=="code_inline"&&n!=="math_inline"}]}],transform:(n,s,o)=>{const r=n[s].children[o],i=r.content,a=Ne.getAttrs(i,i.lastIndexOf(t.leftDelimiter),t);let l=s+1;for(;n[l+1]&&n[l+1].nesting===-1;)l++;const c=Ne.getMatchingOpeningToken(n,l);Ne.addAttrs(a,c);const u=i.slice(0,i.lastIndexOf(t.leftDelimiter));r.content=wh(u)!==" "?u:u.slice(0,-1)}}]};function wh(t){return t.slice(-1)[0]}const _Be=mBe,bBe={leftDelimiter:"{",rightDelimiter:"}",allowedAttributes:[]};var yBe=function(e,n){let s=Object.assign({},bBe);s=Object.assign(s,n);const o=_Be(s);function r(i){const a=i.tokens;for(let l=0;l<a.length;l++)for(let c=0;c<o.length;c++){const u=o[c];let h=null;u.tests.every(g=>{const f=fl(a,l,g);return f.j!==null&&(h=f.j),f.match})&&(u.transform(a,l,h),(u.name==="inline attributes"||u.name==="inline nesting 0")&&c--)}}e.core.ruler.before("linkify","curly_attributes",r)};function fl(t,e,n){const s={match:!1,j:null},o=n.shift!==void 0?e+n.shift:n.position;if(n.shift!==void 0&&o<0)return s;const r=xBe(t,o);if(r===void 0)return s;for(const i of Object.keys(n))if(!(i==="shift"||i==="position")){if(r[i]===void 0)return s;if(i==="children"&&vBe(n.children)){if(r.children.length===0)return s;let a;const l=n.children,c=r.children;if(l.every(u=>u.position!==void 0)){if(a=l.every(u=>fl(c,u.position,u).match),a){const u=kBe(l).position;s.j=u>=0?u:c.length+u}}else for(let u=0;u<c.length;u++)if(a=l.every(h=>fl(c,u,h).match),a){s.j=u;break}if(a===!1)return s;continue}switch(typeof n[i]){case"boolean":case"number":case"string":if(r[i]!==n[i])return s;break;case"function":if(!n[i](r[i]))return s;break;case"object":if(wBe(n[i])){if(n[i].every(l=>l(r[i]))===!1)return s;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 s.match=!0,s}function vBe(t){return Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object")}function wBe(t){return Array.isArray(t)&&t.length&&t.every(e=>typeof e=="function")}function xBe(t,e){return e>=0?t[e]:t[t.length+e]}function kBe(t){return t.slice(-1)[0]||{}}const EBe=rs(yBe);function CBe(){const t=Date.now().toString(),e=Math.floor(Math.random()*1e3).toString();return t+e}const To=new The("commonmark",{html:!0,xhtmlOut:!0,breaks:!0,linkify:!0,typographer:!0,highlight:(t,e)=>{let n=CBe();if(e&&lo.getLanguage(e))try{const o=lo.highlight(e,t).value;return'<div class="bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel p-2 rounded-lg shadow-sm">'+e+'<button class="px-2 py-1 ml-10 mb-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"><span class="mr-1" id="copy-btn_'+n+'" onclick="copyContentToClipboard('+n+')">Copy</span><span class="hidden text-xs text-green-500" id="copyed-btn_'+n+'" onclick="copyContentToClipboard('+n+')">Copied!</span></button><pre class="hljs p-1 rounded-md break-all grid grid-cols-1"><code id="code_'+n+'" 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-pan
2023-07-10 23:12:40 +00:00
// Your inline script code here
console.log('Inline script executed!');
function copyContentToClipboard(id) {
console.log("copied");
const codeElement = document.getElementById('code_' + id);
const copybtnElement = document.getElementById('copy-btn_' + id);
const copyedbtnElement = document.getElementById('copyed-btn_' + id);
copybtnElement.classList.add('hidden');
copyedbtnElement.classList.remove('hidden');
const range = document.createRange();
range.selectNode(codeElement);
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
document.execCommand('copy');
window.getSelection().removeAllRanges();
}
2023-07-17 11:03:42 +00:00
`,t.async=!0,document.body.appendChild(t),this.renderedMarkdown=To.render(this.markdownText),_e(()=>{ye.replace()})},methods:{},watch:{markdownText(t){this.renderedMarkdown=To.render(t),_e(()=>{ye.replace()})}}},SBe={class:"break-all"},TBe=["innerHTML"];function MBe(t,e,n,s,o,r){return A(),M("div",SBe,[d("div",{innerHTML:o.renderedMarkdown,class:"markdown-content"},null,8,TBe)])}const OBe=Ge(ABe,[["render",MBe]]),RBe={props:{done:{type:Boolean,required:!0},message:{type:String,required:!0}}},NBe={class:"step flex items-center mb-4"},DBe={class:"flex items-center justify-center w-6 h-6 rounded border border-gray-300 mr-2"},LBe={key:0},IBe=d("i",{"data-feather":"square",class:"text-gray-400 w-4 h-4"},null,-1),PBe=[IBe],FBe={key:1},BBe=d("i",{"data-feather":"check-square",class:"text-green-500 w-4 h-4"},null,-1),$Be=[BBe],jBe={key:0,class:"loader w-6 h-6 border-t-4 border-b-4 border-blue-500 rounded-full animate-spin ml-2"};function zBe(t,e,n,s,o,r){return A(),M("div",NBe,[d("div",DBe,[n.done?z("",!0):(A(),M("div",LBe,PBe)),n.done?(A(),M("div",FBe,$Be)):z("",!0)]),d("div",{class:Te(["content flex-1",{"text-green-500":n.done,"text-yellow-500":!n.done}])},Y(n.message),3),n.done?z("",!0):(A(),M("div",jBe))])}const UBe=Ge(RBe,[["render",zBe]]);const qBe="/",HBe={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:OBe,Step:UBe},props:{message:Object,avatar:""},data(){return{expanded:!1,new_message_content:"",showConfirmation:!1,editMsgMode:!1,deleteMsgMode:!1,mdRenderHeight:Number}},mounted(){console.log("Mounted message"),console.log(this.message),this.new_message_content=this.message.content,_e(()=>{ye.replace(),this.mdRenderHeight=this.$refs.mdRender.$el.offsetHeight})},methods:{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.new_message_content),this.editMsgMode=!1},resendMessage(){this.$emit("resendMessage",this.message.id,this.new_message_content)},continueMessage(){this.$emit("continueMessage",this.message.id,this.new_message_content)},getImgUrl(){return this.message.sender=="user"?this.avatar?this.avatar:Yw:this.avatar?qBe+this.avatar:Jn},defaultImg(t){t.target.src=Jn},parseDate(t){let e=new Date(Date.parse(t)),s=Math.floor((new Date-e)/1e3);return s<=1?"just now":s<20?s+" seconds ago":s<40?"half a minute ago":s<60?"less than a minute ago":s<=90?"one minute ago":s<=3540?Math.round(s/60)+" minutes ago":s<=5400?"1 hour ago":s<=86400?Math.round(s/3600)+" hours ago":s<=129600?"1 day ago":s<604800?Math.round(s/86400)+" days ago":s<=777600?"1 week ago":t},prettyDate(t){let e=new Date((t||"").replace(/-/g,"/").replace(/[TZ]/g," ")),n=(new Date().getTime()-e.getTime())/1e3,s=Math.floor(n/86400);if(!(isNaN(s)||s<0||s>=31))return s==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")||s==1&&"Yesterday"||s<7&&s+" days ago"||s<31&&Math.ceil(s/7)+" weeks ago"}},watch:{showConfirmation(){_e(()=>{ye.replace()})},editMsgMode(t){t||(this.new_message_content=this.message.content),_e(()=>{ye.replace()})},deleteMsgMode(){_e(()=>{ye.replace()})}},computed:{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 s=e.getTime()-t.getTime();const o=Math.floor(s/(1e3*60*60));s-=o*(1e3*60*60);const r=Math.floor(s/(1e3*60));s-=r*(1e3*60);const i=Math.floor(s/1e3);s-=i*1e3;function a(c){return c<10&&(c
2023-07-15 21:06:28 +00:00
`+e.message,4,!1),{status:!1}))},onPersonalityMounted(t){this.configFile.personalities.includes(t.full_path)?this.configFile.personalities.length==1?this.$refs.toast.showToast("Can't unmount last personality",4,!1):this.unmountPersonality(t):this.mountPersonality(t)},async handleOnTalk(t){if(ye.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(ye.replace(),console.log("ppa",t),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:
2023-07-10 23:28:47 +00:00
`+t.name,4,!0))}else this.onPersonalityMounted(t)}},onSettingsPersonality(t){try{Se.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{Se.post("/set_active_personality_settings",n).then(s=>{s&&s.data?(console.log("personality set with new settings",s.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses.
2023-07-10 23:12:40 +00:00
`+s,4,!1)})}catch(s){this.$refs.toast.showToast(`Did not get Personality settings responses.
2023-07-10 23:28:47 +00:00
Endpoint error: `+s.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={language:t.language,category:t.category,folder:t.folder},n=await Se.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 Se.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"};console.log("select pers",t);const n={id:this.configFile.personalities.findIndex(s=>s===t.full_path)};try{const s=await Se.post("/select_personality",n);if(s)return this.toggleMountUnmount(),this.$store.dispatch("refreshConfig").then(()=>{console.log("recovered config"),this.$store.dispatch("refreshPersonalitiesArr").then(()=>{this.$store.dispatch("refreshMountedPersonalities")})}),s.data}catch(s){console.log(s,"select_personality - settings");return}},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.toggleMountUnmount(),(await this.select_personality(t.personality)).status&&this.$refs.toast.showToast(`Selected personality:
2023-07-10 23:12:40 +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 unmountPersonality(t){if(!t)return;const e=await this.unmount_personality(t.personality||t);if(e.status){this.toggleMountUnmount(),console.log("unmount response",e),this.configFile.active_personality_id=e.active_personality_id,this.configFile.personalities=e.personalities,this.$refs.toast.showToast("Personality unmounted",4,!0);const n=this.configFile.personalities[this.configFile.active_personality_id];console.log();const s=this.personalities.findIndex(a=>a.full_path==n),o=this.$refs.personalitiesZoo.findIndex(a=>a.full_path==t.full_path);console.log("ppp",this.personalities[s]);const r=this.personalities[s];r.isMounted=!1,r.selected=!0,this.$refs.personalitiesZoo[o].isMounted=!1,this.getMountedPersonalities(),(await this.select_personality(r)).status&&this.$refs.toast.showToast(`Selected personality:
`+r.name,4,!0)}else this.$refs.toast.showToast(`Could not unmount personality
2023-07-17 11:03:42 +00:00
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],s=this.personalities.findIndex(r=>r.full_path==n),o=this.personalities[s];if(o)console.log("adding from config"),t.push(o);else{console.log("adding default");const r=this.personalities.findIndex(a=>a.full_path=="english/generic/lollms"),i=this.personalities[r];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 s=this.mountedPersArr.findIndex(o=>o.full_path==n);if(console.log("discussionPersonalities -includes",s),console.log("discussionPersonalities -mounted list",this.mountedPersArr),s==-1){const o=this.personalities.findIndex(i=>i.full_path==n),r=this.personalities[o];console.log("adding discucc121",r,n),r&&(this.mountedPersArr.push(r),console.log("adding discucc",r))}}this.isLoading=!1,console.log("getMountedPersonalities",this.mountedPersArr),console.log("fig",this.configFile)}}},mc=t=>(ns("data-v-e36401c9"),t=t(),ss(),t),nje={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"},sje={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},oje=mc(()=>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)),rje=mc(()=>d("span",{class:"sr-only"},"Loading...",-1)),ije=[oje,rje],aje=mc(()=>d("i",{"data-feather":"chevron-down"},null,-1)),lje=[aje],cje={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},uje={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function dje(t,e,n,s,o,r){const i=lt("personality-entry"),a=lt("Toast"),l=lt("UniversalForm");return A(),M("div",nje,[o.isLoading?(A(),M("div",sje,ije)):z("",!0),d("div",null,[r.mountedPersArr.length>0?(A(),M("div",{key:0,class:Te(o.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]=le((...c)=>r.toggleShowPersList&&r.toggleShowPersList(...c),["stop"]))},lje),d("label",cje," Mounted Personalities: ("+Y(r.mountedPersArr.length)+") ",1),d("div",uje,[Ae(Ut,{name:"bounce"},{default:Ke(()=>[(A(!0),M(Le,null,Qe(this.$store.state.mountedPersArr,(c,u
2023-07-10 23:12:40 +00:00
\r
\r
2023-07-17 11:03:42 +00:00
`,544),[[Re,o.message]]),d("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:e[5]||(e[5]=(...c)=>r.addFiles&&r.addFiles(...c)),multiple:""},null,544),d("button",{type:"button",onClick:e[6]||(e[6]=le(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"},lze)]),d("div",cze,[n.loading?z("",!0):(A(),M("button",{key:0,type:"button",onClick:e[7]||(e[7]=(...c)=>r.submit&&r.submit(...c)),class:"w-6 hover:text-secondary duration-75 active:scale-90"},hze)),n.loading?(A(),M("div",fze,gze)):z("",!0)])])])])])])}const jg=Ge(Tje,[["render",mze],["__scopeId","data-v-7bd685fe"]]),_ze={name:"WelcomeComponent",setup(){return{}}},bze={class:"flex flex-col text-center"},yze=zs('<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="'+Xl+'" 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),vze=[yze];function wze(t,e,n,s,o,r){return A(),M("div",bze,vze)}const zg=Ge(_ze,[["render",wze]]);const xze={setup(){return{}},name:"DragDrop",emits:["panelLeave","panelDrop"],data(){return{fileList:[],show:!1,dropRelease:!1}},mounted(){_e(()=>{ye.replace()})},methods:{async panelDrop(t){const e="getAsFileSystemHandle"in DataTransferItem.prototype,n="webkitGetAsEntry"in DataTransferItem.prototype;if(!e&&!n)return;const s=[...t.dataTransfer.items].filter(r=>r.kind==="file").map(r=>e?r.getAsFileSystemHandle():r.webkitGetAsEntry());let o=[];for await(const r of s)(r.kind==="directory"||r.isDirectory)&&o.push(r.name);this.dropRelease=!0,t.dataTransfer.files.length>0&&[...t.dataTransfer.files].forEach(r=>{o.includes(r.name)||this.fileList.push(r)}),_e(()=>{ye.replace()}),this.$emit("panelDrop",this.fileList),this.fileList=[],this.show=!1},panelLeave(){this.$emit("panelLeave"),console.log("exit/leave"),this.dropRelease=!1,this.show=!1,_e(()=>{ye.replace()})}}},kze={class:"text-4xl text-center"};function Eze(t,e,n,s,o,r){return A(),ot(Ut,{name:"list",tag:"div"},{default:Ke(()=>[o.show?(A(),M("div",{key:"dropmenu",class:"select-none text-slate-50 absolute top-0 left-0 right-0 bottom-0 flex flex-col items-center justify-center bg-black bg-opacity-50 duration-200 backdrop-blur-sm",onDragleave:e[0]||(e[0]=le(i=>r.panelLeave(i),["prevent"])),onDrop:e[1]||(e[1]=le(i=>r.panelDrop(i),["stop","prevent"]))},[d("div",{class:Te(["flex flex-col items-center justify-center p-8 rounded-lg shadow-lg border-dashed border-4 border-secondary w-4/5 h-4/5",o.dropRelease?"":"pointer-events-none"])},[d("div",kze,[wf(t.$slots,"default",{},()=>[we(" Drop your files here ")])])],2)],32)):z("",!0)]),_:3})}const pl=Ge(xze,[["render",Eze]]);var Cze=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}(),Or=globalThis&&globalThis.__assign||function(){return Or=Object.assign||function(t){for(var e,n=1,s=arguments.length;n<s;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Or.apply(this,arguments)},Rr={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(){}},Ug=function(){function t(e,n){e===void 0&&(e=[]),n===void 0&&(n=Rr),this._items=e,this._options=Or(Or({},Rr),n),this._init()}return t.prototype._init=function(){var e=this;this._items.length&&this._items.m
2023-07-10 23:12:40 +00:00
Personality: ${t.message.personality}`);let s="";t.created_at_parsed&&(s=`
Created: ${t.created_at_parsed}`);let o="";t.message.content&&(o=t.message.content);let r="";t.message.model&&(r=`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} ${r} ${i} ${a}`.trim();const c=`${t.message.sender}${n}${s}
${o}
2023-07-16 16:57:30 +00:00
${l}`;navigator.clipboard.writeText(c),_e(()=>{ye.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-07-17 11:03:42 +00:00
`+e.message,4,!1),null}},async parseJsonFile(t){return new Promise((e,n)=>{const s=new FileReader;s.onload=o=>e(this.parseJsonObj(o.target.result)),s.onerror=o=>n(o),s.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(),s=(e.getMonth()+1).toString().padStart(2,"0"),o=e.getDate().toString().padStart(2,"0"),r=e.getHours().toString().padStart(2,"0"),i=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0"),c="discussions_export_"+(n+"."+s+"."+o+"."+r+i+a)+".json";this.loading=!0;const u=await this.export_multiple_discussions(t);u?(this.saveJSONtoFile(u,c),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){const e=this.personalityAvatars.findIndex(s=>s.name===t),n=this.personalityAvatars[e];if(n)return 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},setDropZoneChat(){this.isDragOverChat=!0,this.$refs.dragdropChat.show=!0},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},setDropZoneDiscussion(){this.isDragOverDiscussion=!0,this.$refs.dragdropDiscussion.show=!0}},async created(){for(this.$nextTick(()=>{ye.replace()}),console.log("Waiting to be ready");this.$store.state.ready===!1;)await new Promise(t=>setTimeout(t,100));console.log("Setting title"),this.setPageTitle(),console.log("listing discussions"),await this.list_discussions(),console.log("loading last discussion"),this.loadLastUsedDiscussion(),console.log("Discussions view is ready"),je.on("infos",this.createBotMsg),je.on("message",this.streamMessageContent),je.on("final",this.finalMsgEvent),je.on("connected",this.socketIOConnected),je.on("disconnected",this.socketIODisconnected),console.log("Added events"),this.isCreated=!0},mounted(){this.$nextTick(()=>{ye.replace()})},async activated(){await this.getPersonalityAvatars(),this.isCreated&&_e(()=>{const t=document.getElementById("messages-list");this.scrollBottom(t)})},components:{Discussion:eg,Message:Bg,ChatBox:jg,WelcomeComponent:zg,Toast:ii,DragDrop:pl},watch:{filterTitle(t){t==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(t){_e(()=>{ye.replace()}),t||(this.isSelectAll=!1)},socketConnected(t){console.log("Websocket connected (watch)",t)},showConfirmation(){_e(()=>{ye.replace()})},isSearch(){_e(()=>{ye.replace()})}},computed:{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 _e(()=>{ye.replace()}),this.list.filter(t=>t.checkBoxValue==!0)}}},$qe=Object.assign(Bqe,{__name:"DiscussionsView",setup(t){return Zr(()=>{RUe()}),Se.defaults.baseURL="/",(e,n)=>(A(),M(Le,null,[Ae(wr,{name:"fade-and-fly"},{default:Ke(()=>[e.isReady?z("",!0):(A(),M("div",DUe,IUe))]),_:1}),e.isReady?(A(),M("button",{key:0,onClick:n[0]||(n[0]=(...s)=>e.togglePanel&&e.togglePanel(...s)),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"},[me(d("div",null,FUe,512),[[at,e.panelCollapsed]]),me(d("div",null,$Ue,512),[[at,!e.panelCollapsed]])])):z("",!0),Ae(wr,{name:"slide-right"},{default:Ke(()=>[e.showPanel?(A(),M("div",jUe,[d("div",{id:"leftPanel",class:"flex flex-col flex-grow overflow-y-scroll no-scrollbar",onDragover:n[16]||(n[16]=le(s=>e.setDropZoneDiscussion(),["stop","prevent"]))},[d("div",zUe,[d("div",UUe,[d("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Create new discussion",type:"button",onClick:n[1]||(n[1]=s=>e.createNewDiscussion())},HUe),d("button",{class:Te(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isCheckbox?"text-secondary":""]),title:"Edit discussion list",type:"button",onClick:n[2]||(n[2]=s=>e.isCheckbox=!e.isCheckbox)},GUe,2),KUe,WUe,d("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:n[3]||(n[3]=(...s)=>e.importDiscussions&&e.importDiscussions(...s))},null,544),d("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Import discussions",type:"button",onClick:n[4]||(n[4]=le(s=>e.$refs.fileDialog.click(),["stop"]))},YUe),e.isOpen?(A(),M("div",QUe,[d("button",{onClick:n[5]||(n[5]=(...s)=>e.importDiscussions&&e.importDiscussions(...s))},"LOLLMS"),d("button",{onClick:n[6]||(n[6