const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__prependStaticUrl("assets/Editor-ofIDUvYY.js"),window.__prependStaticUrl("assets/i18n-Dh4wZcJ3.js"),window.__prependStaticUrl("assets/rolldown-runtime-Bhmf7a9N.js"),window.__prependStaticUrl("assets/dayjs-DtVdYEdL.js"),window.__prependStaticUrl("assets/Editor-qZJ_8PxF.css"),window.__prependStaticUrl("assets/Preview-DftVD8Zw.js"),window.__prependStaticUrl("assets/Preview-Bo1SzKJm.css")])))=>i.map(i=>d[i]); import'data:text/javascript,if(!import.meta.resolve)throw Error("import.meta.resolve not supported")';export function __vite_legacy_guard(){import(`_`).catch(()=>1),(async function*(){})().next()}import{o as t,t as n}from"./rolldown-runtime-Bhmf7a9N.js";import{$ as r,A as i,B as a,C as o,D as s,E as c,F as l,G as u,H as d,I as f,K as p,L as m,N as h,O as g,P as _,Q as v,R as y,S as b,T as x,U as S,V as C,W as w,X as T,Y as E,Z as D,_ as O,_t as k,a as A,at as j,b as M,c as ee,d as te,dt as ne,f as N,ft as re,g as P,gt as F,h as ie,i as ae,it as I,j as L,k as R,l as oe,lt as z,m as se,mt as ce,n as le,nt as ue,o as de,ot as fe,p as pe,pt as me,q as he,r as ge,rt as _e,s as B,st as ve,t as ye,tt as be,u as V,ut as xe,vt as Se,w as H,x as U,y as W,yt as G,z as Ce}from"./i18n-Dh4wZcJ3.js";import{F as we,I as Te,N as Ee,P as De}from"./dayjs-DtVdYEdL.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Oe=window.FileBrowser.Name||`File Browser`,ke=window.FileBrowser.DisableExternal,Ae=window.FileBrowser.DisableUsedPercentage,je=window.FileBrowser.BaseURL,Me=window.FileBrowser.StaticURL,Ne=window.FileBrowser.ReCaptcha,Pe=window.FileBrowser.ReCaptchaKey,Fe=window.FileBrowser.Signup,Ie=window.FileBrowser.Version,Le=`${Me}/img/logo.svg`,Re=window.FileBrowser.NoAuth,ze=window.FileBrowser.AuthMethod,Be=window.FileBrowser.LogoutPage,Ve=window.FileBrowser.LoginPage,He=window.FileBrowser.Theme,Ue=window.FileBrowser.EnableThumbs,We=window.FileBrowser.ResizePreview,Ge=window.FileBrowser.EnableExec,Ke=window.FileBrowser.TusSettings,qe=window.location.origin,Je=`/api/tus`,Ye=window.FileBrowser.HideLoginButton,Xe=Number.isNaN||window.isNaN,Ze=/^-?(?:\d+|\d+\.\d+|\.\d+)(?:[eE][-+]?\d+)?$/,Qe=/\.\d*(?:0|9){10}\d*$/,$e=(e,t=1e11)=>Qe.test(String(e))?Math.round(e*t)/t:e,et=s({name:`VueNumberInput`,props:{attrs:{type:Object,default:void 0},center:Boolean,controls:Boolean,disabled:Boolean,inputtable:{type:Boolean,default:!0},inline:Boolean,max:{type:Number,default:1/0},min:{type:Number,default:-1/0},name:{type:String,default:void 0},placeholder:{type:String,default:void 0},readonly:Boolean,rounded:Boolean,size:{type:String,default:void 0},step:{type:Number,default:1},modelValue:{type:Number,default:NaN}},emits:[`update:modelValue`],data(){return{value:NaN}},computed:{increasable(){return Xe(this.value)||this.valuethis.min}},watch:{modelValue:{immediate:!0,handler(e,t){!(Xe(e)&&t===void 0)&&e!==this.value&&this.setValue(e)}}},methods:{isNaN:Xe,change(e){this.setValue(e.target.value)},paste(e){let t=e.clipboardData||window.clipboardData;t&&!Ze.test(t.getData(`text`))&&e.preventDefault()},decrease(){if(this.decreasable){let{value:e}=this;Xe(e)&&(e=0),this.setValue($e(e-this.step))}},increase(){if(this.increasable){let{value:e}=this;Xe(e)&&(e=0),this.setValue($e(e+this.step))}},setValue(e){let t=this.value,n=typeof e==`number`?e:parseFloat(e);Xe(n)||(this.min<=this.max&&(n=Math.min(this.max,Math.max(this.min,n))),this.rounded&&(n=Math.round(n))),this.value=n,n===t&&(this.$refs.input.value=String(n)),this.$emit(`update:modelValue`,n,t)}}}),tt=[`disabled`],nt=[`name`,`value`,`min`,`max`,`step`,`readonly`,`disabled`,`placeholder`],rt=[`disabled`];function it(e,t,n,r,i,s){return a(),o(`div`,{class:k([`vue-number-input`,{"vue-number-input--inline":e.inline,"vue-number-input--center":e.center,"vue-number-input--controls":e.controls,[`vue-number-input--${e.size}`]:e.size}])},[e.controls?(a(),o(`button`,{key:0,class:`vue-number-input__button vue-number-input__button--minus`,type:`button`,tabindex:`-1`,disabled:e.disabled||e.readonly||!e.decreasable,onClick:t[0]||(t[0]=(...t)=>e.decrease&&e.decrease(...t))},null,8,tt)):b(`v-if`,!0),M(`input`,h({ref:`input`,class:`vue-number-input__input`},e.attrs,{type:`number`,name:e.name,value:isNaN(e.value)?``:e.value,min:e.min,max:e.max,step:e.step,readonly:e.readonly||!e.inputtable,disabled:e.disabled||!e.decreasable&&!e.increasable,placeholder:e.placeholder,autocomplete:`off`,onChange:t[1]||(t[1]=(...t)=>e.change&&e.change(...t)),onPaste:t[2]||(t[2]=(...t)=>e.paste&&e.paste(...t))}),null,16,nt),e.controls?(a(),o(`button`,{key:1,class:`vue-number-input__button vue-number-input__button--plus`,type:`button`,tabindex:`-1`,disabled:e.disabled||e.readonly||!e.increasable,onClick:t[3]||(t[3]=(...t)=>e.increase&&e.increase(...t))},null,8,rt)):b(`v-if`,!0)],2)}function at(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>`u`)){var r=document.head||document.getElementsByTagName(`head`)[0],i=document.createElement(`style`);i.type=`text/css`,n===`top`&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}at(`.vue-number-input[data-v-188efc8c]{display:block;font-size:0;max-width:100%;overflow:hidden;position:relative}.vue-number-input__button[data-v-188efc8c]{background-color:#fff;border:0;border-radius:.25rem;bottom:1px;position:absolute;top:1px;width:2.5rem;z-index:1}.vue-number-input__button[data-v-188efc8c]:focus{outline:none}.vue-number-input__button[data-v-188efc8c]:hover:after,.vue-number-input__button[data-v-188efc8c]:hover:before{background-color:#0074d9}.vue-number-input__button[data-v-188efc8c]:disabled{opacity:.65}.vue-number-input__button[data-v-188efc8c]:disabled:after,.vue-number-input__button[data-v-188efc8c]:disabled:before{background-color:#ddd}.vue-number-input__button[data-v-188efc8c]:after,.vue-number-input__button[data-v-188efc8c]:before{background-color:#111;content:"";left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);transition:background-color .15s}.vue-number-input__button[data-v-188efc8c]:before{height:1px;width:50%}.vue-number-input__button[data-v-188efc8c]:after{height:50%;width:1px}.vue-number-input__button--minus[data-v-188efc8c]{border-bottom-right-radius:0;border-right:1px solid #ddd;border-top-right-radius:0;left:1px}.vue-number-input__button--minus[data-v-188efc8c]:after{visibility:hidden}.vue-number-input__button--plus[data-v-188efc8c]{border-bottom-left-radius:0;border-left:1px solid #ddd;border-top-left-radius:0;right:1px}.vue-number-input__input[data-v-188efc8c]{-moz-appearance:textfield;background-color:#fff;border:1px solid #ddd;border-radius:.25rem;display:block;font-size:1rem;line-height:1.5;max-width:100%;min-height:1.5rem;min-width:3rem;padding:.4375rem .875rem;transition:border-color .15s;width:100%}.vue-number-input__input[data-v-188efc8c]::-webkit-inner-spin-button,.vue-number-input__input[data-v-188efc8c]::-webkit-outer-spin-button{-webkit-appearance:none}.vue-number-input__input[data-v-188efc8c]:focus{border-color:#0074d9;outline:none}.vue-number-input__input[data-v-188efc8c]:disabled,.vue-number-input__input[readonly][data-v-188efc8c]{background-color:#f8f8f8}.vue-number-input--inline[data-v-188efc8c]{display:inline-block}.vue-number-input--inline>input[data-v-188efc8c]{display:inline-block;width:12.5rem}.vue-number-input--center>input[data-v-188efc8c]{text-align:center}.vue-number-input--controls>input[data-v-188efc8c]{padding-left:3.375rem;padding-right:3.375rem}.vue-number-input--small>input[data-v-188efc8c]{border-radius:.1875rem;font-size:.875rem;padding:.25rem .5rem}.vue-number-input--small.vue-number-input--inline>input[data-v-188efc8c]{width:10rem}.vue-number-input--small.vue-number-input--controls>button[data-v-188efc8c]{width:2rem}.vue-number-input--small.vue-number-input--controls>input[data-v-188efc8c]{padding-left:2.5rem;padding-right:2.5rem}.vue-number-input--large>input[data-v-188efc8c]{border-radius:.3125rem;font-size:1.25rem;padding:.5rem 1rem}.vue-number-input--large.vue-number-input--inline>input[data-v-188efc8c]{width:15rem}.vue-number-input--large.vue-number-input--controls>button[data-v-188efc8c]{width:3rem}.vue-number-input--large.vue-number-input--controls>input[data-v-188efc8c]{padding-left:4rem;padding-right:4rem}`),et.render=it,et.__scopeId=`data-v-188efc8c`;function ot(e,t){return t={exports:{}},e(t,t.exports),t.exports}var st=ot(function(e){let t=Object.prototype.toString,n=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;e.exports=(e,...t)=>{if(!i(e))throw TypeError(`expected the first argument to be an object`);if(t.length===0||typeof Symbol!=`function`||typeof r!=`function`)return e;for(let i of t){let t=r(i);for(let r of t)n.call(i,r)&&(e[r]=i[r])}return e};function i(e){return typeof e==`function`||t.call(e)===`[object Object]`||Array.isArray(e)}}),ct=Object.freeze({__proto__:null,default:st,__moduleExports:st}),lt=ct&&st||ct,ut=ot(function(e){let t=Object.prototype.toString,n=e=>e!==`__proto__`&&e!==`constructor`&&e!==`prototype`,r=e.exports=(e,...t)=>{let o=0;for(a(e)&&(e=t[o++]),e||(e={});o0}}),!0):!1}var mt={event:`event`,observer:`observer`};function ht(e,t){if(!e.length)return;let n=e.indexOf(t);if(n>-1)return e.splice(n,1)}function gt(e,t){if(e.tagName!==`IMG`||!e.getAttribute(`data-srcset`))return``;let n=e.getAttribute(`data-srcset`).trim().split(`,`),r=[],i=e.parentNode.offsetWidth*t,a,o,s;n.forEach(e=>{e=e.trim(),a=e.lastIndexOf(` `),a===-1?(o=e,s=99999):(o=e.substr(0,a),s=parseInt(e.substr(a+1,e.length-a-2),10)),r.push([s,o])}),r.sort((e,t)=>{if(e[0]t[0])return-1;if(e[0]===t[0]){if(t[1].indexOf(`.webp`,t[1].length-5)!==-1)return 1;if(e[1].indexOf(`.webp`,e[1].length-5)!==-1)return-1}return 0});let c=``,l;for(let e=0;edt&&window.devicePixelRatio||e;function vt(){if(!dt)return!1;let e=!0;function t(e,t){let n={lossy:`UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA`,lossless:`UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==`,alpha:`UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==`,animation:`UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA`},r=new Image;r.onload=function(){t(r.width>0&&r.height>0)},r.onerror=function(){t(!1)},r.src=`data:image/webp;base64,`+n[e]}return t(`lossy`,t=>{e=t}),t(`lossless`,t=>{e=t}),t(`alpha`,t=>{e=t}),t(`animation`,t=>{e=t}),e}function yt(e,t){let n=null,r=0;return function(){if(n)return;let i=Date.now()-r,a=this,o=arguments,s=function(){r=Date.now(),n=!1,e.apply(a,o)};i>=t?s():n=setTimeout(s,t)}}function bt(){if(!dt)return!1;let e=!1;try{let t=Object.defineProperty({},`passive`,{get:function(){e=!0}});window.addEventListener(`test`,Ot,t)}catch{}return e}var xt=bt(),St={on(e,t,n,r=!1){xt?e.addEventListener(t,n,{capture:r,passive:!0}):e.addEventListener(t,n,r)},off(e,t,n,r=!1){e.removeEventListener(t,n,r)}},Ct=(e,t,n)=>{let r=new Image;if(!e||!e.src)return n(Error(`image src is required`));e.cors&&(r.crossOrigin=e.cors),r.src=e.src,r.onload=function(){t({naturalHeight:r.naturalHeight,naturalWidth:r.naturalWidth,src:r.src}),r=null},r.onerror=function(e){n(e)}},wt=(e,t)=>typeof getComputedStyle<`u`?getComputedStyle(e,null).getPropertyValue(t):e.style[t],Tt=e=>wt(e,`overflow`)+wt(e,`overflowY`)+wt(e,`overflowX`),Et=e=>{if(!dt)return;if(!(e instanceof Element))return window;let t=e;for(;t&&!(t===document.body||t===document.documentElement||!t.parentNode);){if(/(scroll|auto)/.test(Tt(t)))return t;t=t.parentNode}return window};function Dt(e){return typeof e==`object`&&!!e}function Ot(){}var kt=class{constructor(e){this.max=e||100,this._caches=[]}has(e){return this._caches.indexOf(e)>-1}add(e){this.has(e)||(this._caches.push(e),this._caches.length>this.max&&this.free())}free(){this._caches.shift()}},At=class{constructor(e,t,n,r,i,a,o,s,c,l){this.el=e,this.src=t,this.error=n,this.loading=r,this.bindType=i,this.attempt=0,this.cors=s,this.naturalHeight=0,this.naturalWidth=0,this.options=o,this.rect={},this.$parent=a,this.elRenderer=c,this._imageCache=l,this.performanceData={init:Date.now(),loadStart:0,loadEnd:0},this.filter(),this.initState(),this.render(`loading`,!1)}initState(){`dataset`in this.el?this.el.dataset.src=this.src:this.el.setAttribute(`data-src`,this.src),this.state={loading:!1,error:!1,loaded:!1,rendered:!1}}record(e){this.performanceData[e]=Date.now()}update(e){let t=this.src;this.src=e.src,this.loading=e.loading,this.error=e.error,this.filter(),t!==this.src&&(this.attempt=0,this.initState())}getRect(){this.rect=this.el.getBoundingClientRect()}checkInView(){return this.getRect(),this.rect.topthis.options.preLoadTop&&this.rect.left0}filter(){for(let e in this.options.filter)this.options.filter[e](this,this.options)}renderLoading(e){this.state.loading=!0,Ct({src:this.loading,cors:this.cors},()=>{this.render(`loading`,!1),this.state.loading=!1,e()},()=>{e(),this.state.loading=!1,this.options.silent||console.warn(`VueLazyload log: load failed with loading image(${this.loading})`)})}load(e=Ot){if(this.attempt>this.options.attempt-1&&this.state.error){this.options.silent||console.log(`VueLazyload log: ${this.src} tried too more than ${this.options.attempt} times`),e();return}if(!(this.state.rendered&&this.state.loaded)){if(this._imageCache.has(this.src))return this.state.loaded=!0,this.render(`loaded`,!0),this.state.rendered=!0,e();this.renderLoading(()=>{this.attempt++,this.options.adapter.beforeLoad&&this.options.adapter.beforeLoad(this,this.options),this.record(`loadStart`),Ct({src:this.src,cors:this.cors},t=>{this.naturalHeight=t.naturalHeight,this.naturalWidth=t.naturalWidth,this.state.loaded=!0,this.state.error=!1,this.record(`loadEnd`),this.render(`loaded`,!1),this.state.rendered=!0,this._imageCache.add(this.src),e()},e=>{!this.options.silent&&console.error(e),this.state.error=!0,this.state.loaded=!1,this.render(`error`,!1)})})}}render(e,t){this.elRenderer(this,e,t)}performance(){let e=`loading`,t=0;return this.state.loaded&&(e=`loaded`,t=(this.performanceData.loadEnd-this.performanceData.loadStart)/1e3),this.state.error&&(e=`error`),{src:this.src,state:e,time:t}}$destroy(){this.el=null,this.src=``,this.error=null,this.loading=``,this.bindType=null,this.attempt=0}},jt=`data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7`,Mt=[`scroll`,`wheel`,`mousewheel`,`resize`,`animationend`,`transitionend`,`touchmove`],Nt={rootMargin:`0px`,threshold:0},Pt=class{constructor({preLoad:e,error:t,throttleWait:n,preLoadTop:r,dispatchEvent:i,loading:a,attempt:o,silent:s=!0,scale:c,listenEvents:l,filter:u,adapter:d,observer:f,observerOptions:p}){this.version=`"3.0.0"`,this.lazyContainerMananger=null,this.mode=mt.event,this.ListenerQueue=[],this.TargetIndex=0,this.TargetQueue=[],this.options={silent:s,dispatchEvent:!!i,throttleWait:n||200,preLoad:e||1.3,preLoadTop:r||0,error:t||jt,loading:a||jt,attempt:o||3,scale:c||_t(c),listenEvents:l||Mt,supportWebp:vt(),filter:u||{},adapter:d||{},observer:!!f,observerOptions:p||Nt},this._initEvent(),this._imageCache=new kt(200),this.lazyLoadHandler=yt(this._lazyLoadHandler.bind(this),this.options.throttleWait),this.setMode(this.options.observer?mt.observer:mt.event)}performance(){let e=[];return this.ListenerQueue.map(t=>e.push(t.performance())),e}addLazyBox(e){this.ListenerQueue.push(e),dt&&(this._addListenerTarget(window),this._observer&&this._observer.observe(e.el),e.$el&&e.$el.parentNode&&this._addListenerTarget(e.$el.parentNode))}add(e,t,n){if(this.ListenerQueue.some(t=>t.el===e))return this.update(e,t),_(this.lazyLoadHandler);let{src:r,loading:i,error:a,cors:o}=this._valueFormatter(t.value);_(()=>{r=gt(e,this.options.scale)||r,this._observer&&this._observer.observe(e);let n=Object.keys(t.modifiers)[0],s;n&&(s=t.instance.$refs[n],s=s?s.el||s:document.getElementById(n)),s||(s=Et(e));let c=new At(e,r,a,i,t.arg,s,this.options,o,this._elRenderer.bind(this),this._imageCache);this.ListenerQueue.push(c),dt&&(this._addListenerTarget(window),this._addListenerTarget(s)),_(this.lazyLoadHandler)})}update(e,t,n){let{src:r,loading:i,error:a}=this._valueFormatter(t.value);r=gt(e,this.options.scale)||r;let o=this.ListenerQueue.find(t=>t.el===e);o?o.update({src:r,loading:i,error:a}):(e.getAttribute(`lazy`)!==`loaded`||e.dataset.src!==r)&&this.add(e,t,n),this._observer&&(this._observer.unobserve(e),this._observer.observe(e)),_(this.lazyLoadHandler)}remove(e){if(!e)return;this._observer&&this._observer.unobserve(e);let t=this.ListenerQueue.find(t=>t.el===e);t&&(this._removeListenerTarget(t.$parent),this._removeListenerTarget(window),ht(this.ListenerQueue,t),t.$destroy&&t.$destroy())}removeComponent(e){e&&(ht(this.ListenerQueue,e),this._observer&&this._observer.unobserve(e.el),e.$parent&&e.$el.parentNode&&this._removeListenerTarget(e.$el.parentNode),this._removeListenerTarget(window))}setMode(e){!ft&&e===mt.observer&&(e=mt.event),this.mode=e,e===mt.event?(this._observer&&(this.ListenerQueue.forEach(e=>{this._observer.unobserve(e.el)}),this._observer=null),this.TargetQueue.forEach(e=>{this._initListen(e.el,!0)})):(this.TargetQueue.forEach(e=>{this._initListen(e.el,!1)}),this._initIntersectionObserver())}_addListenerTarget(e){if(!e)return;let t=this.TargetQueue.find(t=>t.el===e);return t?t.childrenCount++:(t={el:e,id:++this.TargetIndex,childrenCount:1,listened:!0},this.mode===mt.event&&this._initListen(t.el,!0),this.TargetQueue.push(t)),this.TargetIndex}_removeListenerTarget(e){this.TargetQueue.forEach((t,n)=>{t.el===e&&(t.childrenCount--,t.childrenCount||(this._initListen(t.el,!1),this.TargetQueue.splice(n,1),t=null))})}_initListen(e,t){this.options.listenEvents.forEach(n=>St[t?`on`:`off`](e,n,this.lazyLoadHandler))}_initEvent(){this.Event={listeners:{loading:[],loaded:[],error:[]}},this.$on=(e,t)=>{this.Event.listeners[e]||(this.Event.listeners[e]=[]),this.Event.listeners[e].push(t)},this.$once=(e,t)=>{let n=this;function r(){n.$off(e,r),t.apply(n,arguments)}this.$on(e,r)},this.$off=(e,t)=>{if(!t){if(!this.Event.listeners[e])return;this.Event.listeners[e].length=0;return}ht(this.Event.listeners[e],t)},this.$emit=(e,t,n)=>{this.Event.listeners[e]&&this.Event.listeners[e].forEach(e=>e(t,n))}}_lazyLoadHandler(){let e=[];this.ListenerQueue.forEach((t,n)=>{(!t.el||!t.el.parentNode||t.state.loaded)&&e.push(t),t.checkInView()&&(t.state.loaded||t.load())}),e.forEach(e=>{ht(this.ListenerQueue,e),e.$destroy&&e.$destroy()})}_initIntersectionObserver(){ft&&(this._observer=new IntersectionObserver(this._observerHandler.bind(this),this.options.observerOptions),this.ListenerQueue.length&&this.ListenerQueue.forEach(e=>{this._observer.observe(e.el)}))}_observerHandler(e){e.forEach(e=>{e.isIntersecting&&this.ListenerQueue.forEach(t=>{if(t.el===e.target){if(t.state.loaded)return this._observer.unobserve(t.el);t.load()}})})}_elRenderer(e,t,n){if(!e.el)return;let{el:r,bindType:i}=e,a;switch(t){case`loading`:a=e.loading;break;case`error`:a=e.error;break;default:a=e.src;break}if(i?r.style[i]=`url("`+a+`")`:r.getAttribute(`src`)!==a&&r.setAttribute(`src`,a),r.setAttribute(`lazy`,t),this.$emit(t,e,n),this.options.adapter[t]&&this.options.adapter[t](e,this.options),this.options.dispatchEvent){let n=new CustomEvent(t,{detail:e});r.dispatchEvent(n)}}_valueFormatter(e){return Dt(e)?(!e.src&&!this.options.silent&&console.error(`Vue Lazyload warning: miss src with `+e),{src:e.src,loading:e.loading||this.options.loading,error:e.error||this.options.error,cors:this.options.cors}):{src:e,loading:this.options.loading,error:this.options.error,cors:this.options.cors}}},Ft=(e,t)=>{let n=ve({}),r=()=>{n=e.value.getBoundingClientRect()};return{rect:n,checkInView:()=>(r(),dt&&n.top0&&n.left0)}},It=(e=>s({props:{tag:{type:String,default:`div`}},emits:[`show`],setup(t,{emit:n,slots:r}){let i=z(),a=ve({loaded:!1,error:!1,attempt:0}),o=z(!1),{rect:s,checkInView:c}=Ft(i,e.options.preLoad),l=()=>{o.value=!0,a.loaded=!0,n(`show`,o.value)},u=W(()=>({el:i.value,rect:s,checkInView:c,load:l,state:a}));return y(()=>{e.addLazyBox(u.value),e.lazyLoadHandler()}),Ce(()=>{e.removeComponent(u.value)}),()=>x(t.tag,{ref:i},[o.value&&r.default?.call(r)])}})),Lt=class{constructor(e){this.lazy=e,e.lazyContainerMananger=this,this._queue=[]}bind(e,t,n){let r=new zt(e,t,n,this.lazy);this._queue.push(r)}update(e,t,n){let r=this._queue.find(t=>t.el===e);r&&r.update(e,t)}unbind(e,t,n){let r=this._queue.find(t=>t.el===e);r&&(r.clear(),ht(this._queue,r))}},Rt={selector:`img`,error:``,loading:``},zt=class{constructor(e,t,n,r){this.el=e,this.vnode=n,this.binding=t,this.options={},this.lazy=r,this._queue=[],this.update(e,t)}update(e,t){this.el=e,this.options=ut({},Rt,t.value),this.getImgs().forEach(e=>{this.lazy.add(e,ut({},this.binding,{value:{src:e.getAttribute(`data-src`)||e.dataset.src,error:e.getAttribute(`data-error`)||e.dataset.error||this.options.error,loading:e.getAttribute(`data-loading`)||e.dataset.loading||this.options.loading}}),this.vnode)})}getImgs(){return Array.from(this.el.querySelectorAll(this.options.selector))}clear(){this.getImgs().forEach(e=>this.lazy.remove(e)),this.vnode=null,this.binding=null,this.lazy=null}},Bt=(e=>s({setup(t,{slots:n}){let r=z(),i=ve({src:``,error:``,loading:``,attempt:e.options.attempt}),a=ve({loaded:!1,error:!1,attempt:0}),{rect:o,checkInView:s}=Ft(r,e.options.preLoad),c=z(``),l=(t=Ot)=>{if(a.attempt>i.attempt-1&&a.error)return e.options.silent||console.log(`VueLazyload log: ${i.src} tried too more than ${i.attempt} times`),t();let n=i.src;Ct({src:n},({src:e})=>{c.value=e,a.loaded=!0},()=>{a.attempt++,c.value=i.error,a.error=!0})},u=W(()=>({el:r.value,rect:o,checkInView:s,load:l,state:a}));y(()=>{e.addLazyBox(u.value),e.lazyLoadHandler()}),Ce(()=>{e.removeComponent(u.value)});let d=()=>{let{src:n,loading:r,error:o}=e._valueFormatter(t.src);a.loaded=!1,i.src=n,i.error=o,i.loading=r,c.value=i.loading};return T(()=>t.src,()=>{d(),e.addLazyBox(u.value),e.lazyLoadHandler()},{immediate:!0}),()=>x(t.tag||`img`,{src:c.value,ref:r},[n.default?.call(n)])}})),Vt={install(e,t={}){let n=new Pt(t),r=new Lt(n);if(Number(e.version.split(`.`)[0])<3)return Error(`Vue version at least 3.0`);e.config.globalProperties.$Lazyload=n,e.provide(`Lazyload`,n),t.lazyComponent&&e.component(`lazy-component`,It(n)),t.lazyImage&&e.component(`lazy-image`,Bt(n)),e.directive(`lazy`,{beforeMount:n.add.bind(n),beforeUpdate:n.update.bind(n),updated:n.lazyLoadHandler.bind(n),unmounted:n.remove.bind(n)}),e.directive(`lazy-container`,{beforeMount:r.bind.bind(r),updated:r.update.bind(r),unmounted:r.unbind.bind(r)})}},Ht=Object.defineProperty,Ut=Object.getOwnPropertySymbols,Wt=Object.prototype.hasOwnProperty,Gt=Object.prototype.propertyIsEnumerable,Kt=(e,t,n)=>t in e?Ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qt=(e,t)=>{for(var n in t||(t={}))Wt.call(t,n)&&Kt(e,n,t[n]);if(Ut)for(var n of Ut(t))Gt.call(t,n)&&Kt(e,n,t[n]);return e},Jt=e=>typeof e==`function`,Yt=e=>typeof e==`string`,Xt=e=>Yt(e)&&e.trim().length>0,Zt=e=>typeof e==`number`,Qt=e=>e===void 0,$t=e=>typeof e==`object`&&!!e,en=e=>sn(e,`tag`)&&Xt(e.tag),tn=e=>window.TouchEvent&&e instanceof TouchEvent,nn=e=>sn(e,`component`)&&an(e.component),rn=e=>Jt(e)||$t(e),an=e=>!Qt(e)&&(Yt(e)||rn(e)||nn(e)),on=e=>$t(e)&&[`height`,`width`,`right`,`left`,`top`,`bottom`].every(t=>Zt(e[t])),sn=(e,t)=>($t(e)||Jt(e))&&t in e,cn=(e=>()=>e++)(0);function ln(e){return tn(e)?e.targetTouches[0].clientX:e.clientX}function un(e){return tn(e)?e.targetTouches[0].clientY:e.clientY}var dn=e=>{Qt(e.remove)?e.parentNode&&e.parentNode.removeChild(e):e.remove()},fn=e=>nn(e)?fn(e.component):en(e)?s({render(){return e}}):typeof e==`string`?e:re(F(e)),pn=e=>{if(typeof e==`string`)return e;let t=sn(e,`props`)&&$t(e.props)?e.props:{},n=sn(e,`listeners`)&&$t(e.listeners)?e.listeners:{};return{component:fn(e),props:t,listeners:n}},mn=()=>typeof window<`u`,hn=class{constructor(){this.allHandlers={}}getHandlers(e){return this.allHandlers[e]||[]}on(e,t){let n=this.getHandlers(e);n.push(t),this.allHandlers[e]=n}off(e,t){let n=this.getHandlers(e);n.splice(n.indexOf(t)>>>0,1)}emit(e,t){this.getHandlers(e).forEach(e=>e(t))}},gn=e=>[`on`,`off`,`emit`].every(t=>sn(e,t)&&Jt(e[t])),_n;(function(e){e.SUCCESS=`success`,e.ERROR=`error`,e.WARNING=`warning`,e.INFO=`info`,e.DEFAULT=`default`})(_n||(_n={}));var vn;(function(e){e.TOP_LEFT=`top-left`,e.TOP_CENTER=`top-center`,e.TOP_RIGHT=`top-right`,e.BOTTOM_LEFT=`bottom-left`,e.BOTTOM_CENTER=`bottom-center`,e.BOTTOM_RIGHT=`bottom-right`})(vn||(vn={}));var yn;(function(e){e.ADD=`add`,e.DISMISS=`dismiss`,e.UPDATE=`update`,e.CLEAR=`clear`,e.UPDATE_DEFAULTS=`update_defaults`})(yn||(yn={}));var bn=`Vue-Toastification`,xn={type:{type:String,default:_n.DEFAULT},classNames:{type:[String,Array],default:()=>[]},trueBoolean:{type:Boolean,default:!0}},Sn={type:xn.type,customIcon:{type:[String,Boolean,Object,Function],default:!0}},Cn={component:{type:[String,Object,Function,Boolean],default:`button`},classNames:xn.classNames,showOnHover:{type:Boolean,default:!1},ariaLabel:{type:String,default:`close`}},wn={timeout:{type:[Number,Boolean],default:5e3},hideProgressBar:{type:Boolean,default:!1},isRunning:{type:Boolean,default:!1}},Tn={transition:{type:[Object,String],default:`${bn}__bounce`}},En={CORE_TOAST:{position:{type:String,default:vn.TOP_RIGHT},draggable:xn.trueBoolean,draggablePercent:{type:Number,default:.6},pauseOnFocusLoss:xn.trueBoolean,pauseOnHover:xn.trueBoolean,closeOnClick:xn.trueBoolean,timeout:wn.timeout,hideProgressBar:wn.hideProgressBar,toastClassName:xn.classNames,bodyClassName:xn.classNames,icon:Sn.customIcon,closeButton:Cn.component,closeButtonClassName:Cn.classNames,showCloseButtonOnHover:Cn.showOnHover,accessibility:{type:Object,default:()=>({toastRole:`alert`,closeButtonLabel:`close`})},rtl:{type:Boolean,default:!1},eventBus:{type:Object,required:!1,default:()=>new hn}},TOAST:{id:{type:[String,Number],required:!0,default:0},type:xn.type,content:{type:[String,Object,Function],required:!0,default:``},onClick:{type:Function,default:void 0},onClose:{type:Function,default:void 0}},CONTAINER:{container:{type:[Object,Function],default:()=>document.body},newestOnTop:xn.trueBoolean,maxToasts:{type:Number,default:20},transition:Tn.transition,toastDefaults:Object,filterBeforeCreate:{type:Function,default:e=>e},filterToasts:{type:Function,default:e=>e},containerClassName:xn.classNames,onMounted:Function,shareAppContext:[Boolean,Object]},PROGRESS_BAR:wn,ICON:Sn,TRANSITION:Tn,CLOSE_BUTTON:Cn},Dn=s({name:`VtProgressBar`,props:En.PROGRESS_BAR,data(){return{hasClass:!0}},computed:{style(){return{animationDuration:`${this.timeout}ms`,animationPlayState:this.isRunning?`running`:`paused`,opacity:this.hideProgressBar?0:1}},cpClass(){return this.hasClass?`${bn}__progress-bar`:``}},watch:{timeout(){this.hasClass=!1,this.$nextTick(()=>this.hasClass=!0)}},mounted(){this.$el.addEventListener(`animationend`,this.animationEnded)},beforeUnmount(){this.$el.removeEventListener(`animationend`,this.animationEnded)},methods:{animationEnded(){this.$emit(`close-toast`)}}});function On(e,t){return a(),o(`div`,{style:Se(e.style),class:k(e.cpClass)},null,6)}Dn.render=On;var kn=Dn,An=s({name:`VtCloseButton`,props:En.CLOSE_BUTTON,computed:{buttonComponent(){return this.component===!1?`button`:fn(this.component)},classes(){let e=[`${bn}__close-button`];return this.showOnHover&&e.push(`show-on-hover`),e.concat(this.classNames)}}}),jn=H(` × `);function Mn(e,t){return a(),U(p(e.buttonComponent),h({"aria-label":e.ariaLabel,class:e.classes},e.$attrs),{default:v(()=>[jn]),_:1},16,[`aria-label`,`class`])}An.render=Mn;var Nn=An,Pn={},Fn={"aria-hidden":`true`,focusable:`false`,"data-prefix":`fas`,"data-icon":`check-circle`,class:`svg-inline--fa fa-check-circle fa-w-16`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},In=[M(`path`,{fill:`currentColor`,d:`M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z`},null,-1)];function Ln(e,t){return a(),o(`svg`,Fn,In)}Pn.render=Ln;var Rn=Pn,zn={},Bn={"aria-hidden":`true`,focusable:`false`,"data-prefix":`fas`,"data-icon":`info-circle`,class:`svg-inline--fa fa-info-circle fa-w-16`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},Vn=[M(`path`,{fill:`currentColor`,d:`M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z`},null,-1)];function Hn(e,t){return a(),o(`svg`,Bn,Vn)}zn.render=Hn;var Un=zn,Wn={},Gn={"aria-hidden":`true`,focusable:`false`,"data-prefix":`fas`,"data-icon":`exclamation-circle`,class:`svg-inline--fa fa-exclamation-circle fa-w-16`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},Kn=[M(`path`,{fill:`currentColor`,d:`M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z`},null,-1)];function qn(e,t){return a(),o(`svg`,Gn,Kn)}Wn.render=qn;var Jn=Wn,Yn={},Xn={"aria-hidden":`true`,focusable:`false`,"data-prefix":`fas`,"data-icon":`exclamation-triangle`,class:`svg-inline--fa fa-exclamation-triangle fa-w-18`,role:`img`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 576 512`},Zn=[M(`path`,{fill:`currentColor`,d:`M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z`},null,-1)];function Qn(e,t){return a(),o(`svg`,Xn,Zn)}Yn.render=Qn;var $n=Yn,er=s({name:`VtIcon`,props:En.ICON,computed:{customIconChildren(){return sn(this.customIcon,`iconChildren`)?this.trimValue(this.customIcon.iconChildren):``},customIconClass(){return Yt(this.customIcon)?this.trimValue(this.customIcon):sn(this.customIcon,`iconClass`)?this.trimValue(this.customIcon.iconClass):``},customIconTag(){return sn(this.customIcon,`iconTag`)?this.trimValue(this.customIcon.iconTag,`i`):`i`},hasCustomIcon(){return this.customIconClass.length>0},component(){return this.hasCustomIcon?this.customIconTag:an(this.customIcon)?fn(this.customIcon):this.iconTypeComponent},iconTypeComponent(){return{[_n.DEFAULT]:Un,[_n.INFO]:Un,[_n.SUCCESS]:Rn,[_n.ERROR]:$n,[_n.WARNING]:Jn}[this.type]},iconClasses(){let e=[`${bn}__icon`];return this.hasCustomIcon?e.concat(this.customIconClass):e}},methods:{trimValue(e,t=``){return Xt(e)?e.trim():t}}});function tr(e,t){return a(),U(p(e.component),{class:k(e.iconClasses)},{default:v(()=>[H(G(e.customIconChildren),1)]),_:1},8,[`class`])}er.render=tr;var nr=s({name:`VtToast`,components:{ProgressBar:kn,CloseButton:Nn,Icon:er},inheritAttrs:!1,props:Object.assign({},En.CORE_TOAST,En.TOAST),data(){return{isRunning:!0,disableTransitions:!1,beingDragged:!1,dragStart:0,dragPos:{x:0,y:0},dragRect:{}}},computed:{classes(){let e=[`${bn}__toast`,`${bn}__toast--${this.type}`,`${this.position}`].concat(this.toastClassName);return this.disableTransitions&&e.push(`disable-transition`),this.rtl&&e.push(`${bn}__toast--rtl`),e},bodyClasses(){return[`${bn}__toast-${Yt(this.content)?`body`:`component-body`}`].concat(this.bodyClassName)},draggableStyle(){return this.dragStart===this.dragPos.x?{}:this.beingDragged?{transform:`translateX(${this.dragDelta}px)`,opacity:1-Math.abs(this.dragDelta/this.removalDistance)}:{transition:`transform 0.2s, opacity 0.2s`,transform:`translateX(0)`,opacity:1}},dragDelta(){return this.beingDragged?this.dragPos.x-this.dragStart:0},removalDistance(){return on(this.dragRect)?(this.dragRect.right-this.dragRect.left)*this.draggablePercent:0}},mounted(){this.draggable&&this.draggableSetup(),this.pauseOnFocusLoss&&this.focusSetup()},beforeUnmount(){this.draggable&&this.draggableCleanup(),this.pauseOnFocusLoss&&this.focusCleanup()},methods:{hasProp:sn,getVueComponentFromObj:fn,closeToast(){this.eventBus.emit(yn.DISMISS,this.id)},clickHandler(){this.onClick&&this.onClick(this.closeToast),this.closeOnClick&&(!this.beingDragged||this.dragStart===this.dragPos.x)&&this.closeToast()},timeoutHandler(){this.closeToast()},hoverPause(){this.pauseOnHover&&(this.isRunning=!1)},hoverPlay(){this.pauseOnHover&&(this.isRunning=!0)},focusPause(){this.isRunning=!1},focusPlay(){this.isRunning=!0},focusSetup(){addEventListener(`blur`,this.focusPause),addEventListener(`focus`,this.focusPlay)},focusCleanup(){removeEventListener(`blur`,this.focusPause),removeEventListener(`focus`,this.focusPlay)},draggableSetup(){let e=this.$el;e.addEventListener(`touchstart`,this.onDragStart,{passive:!0}),e.addEventListener(`mousedown`,this.onDragStart),addEventListener(`touchmove`,this.onDragMove,{passive:!1}),addEventListener(`mousemove`,this.onDragMove),addEventListener(`touchend`,this.onDragEnd),addEventListener(`mouseup`,this.onDragEnd)},draggableCleanup(){let e=this.$el;e.removeEventListener(`touchstart`,this.onDragStart),e.removeEventListener(`mousedown`,this.onDragStart),removeEventListener(`touchmove`,this.onDragMove),removeEventListener(`mousemove`,this.onDragMove),removeEventListener(`touchend`,this.onDragEnd),removeEventListener(`mouseup`,this.onDragEnd)},onDragStart(e){this.beingDragged=!0,this.dragPos={x:ln(e),y:un(e)},this.dragStart=ln(e),this.dragRect=this.$el.getBoundingClientRect()},onDragMove(e){this.beingDragged&&(e.preventDefault(),this.isRunning&&(this.isRunning=!1),this.dragPos={x:ln(e),y:un(e)})},onDragEnd(){this.beingDragged&&(Math.abs(this.dragDelta)>=this.removalDistance?(this.disableTransitions=!0,this.$nextTick(()=>this.closeToast())):setTimeout(()=>{this.beingDragged=!1,on(this.dragRect)&&this.pauseOnHover&&this.dragRect.bottom>=this.dragPos.y&&this.dragPos.y>=this.dragRect.top&&this.dragRect.left<=this.dragPos.x&&this.dragPos.x<=this.dragRect.right?this.isRunning=!1:this.isRunning=!0}))}}}),rr=[`role`];function ir(e,t){let n=w(`Icon`),r=w(`CloseButton`),i=w(`ProgressBar`);return a(),o(`div`,{class:k(e.classes),style:Se(e.draggableStyle),onClick:t[0]||(t[0]=(...t)=>e.clickHandler&&e.clickHandler(...t)),onMouseenter:t[1]||(t[1]=(...t)=>e.hoverPause&&e.hoverPause(...t)),onMouseleave:t[2]||(t[2]=(...t)=>e.hoverPlay&&e.hoverPlay(...t))},[e.icon?(a(),U(n,{key:0,"custom-icon":e.icon,type:e.type},null,8,[`custom-icon`,`type`])):b(`v-if`,!0),M(`div`,{role:e.accessibility.toastRole||`alert`,class:k(e.bodyClasses)},[typeof e.content==`string`?(a(),o(P,{key:0},[H(G(e.content),1)],2112)):(a(),U(p(e.getVueComponentFromObj(e.content)),h({key:1,"toast-id":e.id},e.hasProp(e.content,`props`)?e.content.props:{},he(e.hasProp(e.content,`listeners`)?e.content.listeners:{}),{onCloseToast:e.closeToast}),null,16,[`toast-id`,`onCloseToast`]))],10,rr),e.closeButton?(a(),U(r,{key:1,component:e.closeButton,"class-names":e.closeButtonClassName,"show-on-hover":e.showCloseButtonOnHover,"aria-label":e.accessibility.closeButtonLabel,onClick:ie(e.closeToast,[`stop`])},null,8,[`component`,`class-names`,`show-on-hover`,`aria-label`,`onClick`])):b(`v-if`,!0),e.timeout?(a(),U(i,{key:2,"is-running":e.isRunning,"hide-progress-bar":e.hideProgressBar,timeout:e.timeout,onCloseToast:e.timeoutHandler},null,8,[`is-running`,`hide-progress-bar`,`timeout`,`onCloseToast`])):b(`v-if`,!0)],38)}nr.render=ir;var ar=nr,or=s({name:`VtTransition`,props:En.TRANSITION,emits:[`leave`],methods:{hasProp:sn,leave(e){e instanceof HTMLElement&&(e.style.left=e.offsetLeft+`px`,e.style.top=e.offsetTop+`px`,e.style.width=getComputedStyle(e).width,e.style.position=`absolute`)}}});function sr(e,t){return a(),U(ee,{tag:`div`,"enter-active-class":e.transition.enter?e.transition.enter:`${e.transition}-enter-active`,"move-class":e.transition.move?e.transition.move:`${e.transition}-move`,"leave-active-class":e.transition.leave?e.transition.leave:`${e.transition}-leave-active`,onLeave:e.leave},{default:v(()=>[S(e.$slots,`default`)]),_:3},8,[`enter-active-class`,`move-class`,`leave-active-class`,`onLeave`])}or.render=sr;var cr=s({name:`VueToastification`,devtools:{hide:!0},components:{Toast:ar,VtTransition:or},props:Object.assign({},En.CORE_TOAST,En.CONTAINER,En.TRANSITION),data(){return{count:0,positions:Object.values(vn),toasts:{},defaults:{}}},computed:{toastArray(){return Object.values(this.toasts)},filteredToasts(){return this.defaults.filterToasts(this.toastArray)}},beforeMount(){let e=this.eventBus;e.on(yn.ADD,this.addToast),e.on(yn.CLEAR,this.clearToasts),e.on(yn.DISMISS,this.dismissToast),e.on(yn.UPDATE,this.updateToast),e.on(yn.UPDATE_DEFAULTS,this.updateDefaults),this.defaults=this.$props},mounted(){this.setup(this.container)},methods:{async setup(e){Jt(e)&&(e=await e()),dn(this.$el),e.appendChild(this.$el)},setToast(e){Qt(e.id)||(this.toasts[e.id]=e)},addToast(e){e.content=pn(e.content);let t=Object.assign({},this.defaults,e.type&&this.defaults.toastDefaults&&this.defaults.toastDefaults[e.type],e),n=this.defaults.filterBeforeCreate(t,this.toastArray);n&&this.setToast(n)},dismissToast(e){let t=this.toasts[e];!Qt(t)&&!Qt(t.onClose)&&t.onClose(),delete this.toasts[e]},clearToasts(){Object.keys(this.toasts).forEach(e=>{this.dismissToast(e)})},getPositionToasts(e){let t=this.filteredToasts.filter(t=>t.position===e).slice(0,this.defaults.maxToasts);return this.defaults.newestOnTop?t.reverse():t},updateDefaults(e){Qt(e.container)||this.setup(e.container),this.defaults=Object.assign({},this.defaults,e)},updateToast({id:e,options:t,create:n}){this.toasts[e]?(t.timeout&&t.timeout===this.toasts[e].timeout&&t.timeout++,this.setToast(Object.assign({},this.toasts[e],t))):n&&this.addToast(Object.assign({},{id:e},t))},getClasses(e){return[`${bn}__container`,e].concat(this.defaults.containerClassName)}}});function lr(e,t){let n=w(`Toast`),r=w(`VtTransition`);return a(),o(`div`,null,[(a(!0),o(P,null,d(e.positions,t=>(a(),o(`div`,{key:t},[x(r,{transition:e.defaults.transition,class:k(e.getClasses(t))},{default:v(()=>[(a(!0),o(P,null,d(e.getPositionToasts(t),e=>(a(),U(n,h({key:e.id},e),null,16))),128))]),_:2},1032,[`transition`,`class`])]))),128))])}cr.render=lr;var ur=cr,dr=(e={},t=!0)=>{let n=e.eventBus=e.eventBus||new hn;t&&_(()=>{let t=oe(ur,qt({},e)),n=t.mount(document.createElement(`div`)),r=e.onMounted;if(Qt(r)||r(n,t),e.shareAppContext){let n=e.shareAppContext;n===!0?console.warn(`[${bn}] App to share context with was not provided.`):(t._context.components=n._context.components,t._context.directives=n._context.directives,t._context.mixins=n._context.mixins,t._context.provides=n._context.provides,t.config.globalProperties=n.config.globalProperties)}});let r=(e,t)=>{let r=Object.assign({},{id:cn(),type:_n.DEFAULT},t,{content:e});return n.emit(yn.ADD,r),r.id};r.clear=()=>n.emit(yn.CLEAR,void 0),r.updateDefaults=e=>{n.emit(yn.UPDATE_DEFAULTS,e)},r.dismiss=e=>{n.emit(yn.DISMISS,e)};function i(e,{content:t,options:r},i=!1){let a=Object.assign({},r,{content:t});n.emit(yn.UPDATE,{id:e,options:a,create:i})}return r.update=i,r.success=(e,t)=>r(e,Object.assign({},t,{type:_n.SUCCESS})),r.info=(e,t)=>r(e,Object.assign({},t,{type:_n.INFO})),r.error=(e,t)=>r(e,Object.assign({},t,{type:_n.ERROR})),r.warning=(e,t)=>r(e,Object.assign({},t,{type:_n.WARNING})),r},fr=()=>{let e=()=>console.warn(`[${bn}] This plugin does not support SSR!`);return new Proxy(e,{get(){return e}})};function pr(e){return mn()?gn(e)?dr({eventBus:e},!1):dr(e,!0):fr()}var mr=Symbol(`VueToastification`),hr=new hn,gr=(e,t)=>{t?.shareAppContext===!0&&(t.shareAppContext=e);let n=pr(qt({eventBus:hr},t));e.provide(mr,n)},_r=e=>e?pr(e):(g()?L(mr,void 0):void 0)||pr(hr),vr=gr,yr=typeof window<`u`,br,xr=e=>br=e,Sr=Symbol();function Cr(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var wr;(function(e){e.direct=`direct`,e.patchObject=`patch object`,e.patchFunction=`patch function`})(wr||(wr={}));var Tr=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null};function Er(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function Dr(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){Mr(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function Or(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function kr(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(t)}}var Ar=typeof navigator==`object`?navigator:{userAgent:``},jr=/Macintosh/.test(Ar.userAgent)&&/AppleWebKit/.test(Ar.userAgent)&&!/Safari/.test(Ar.userAgent),Mr=yr?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!jr?Nr:`msSaveOrOpenBlob`in Ar?Pr:Fr:()=>{};function Nr(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?kr(r):Or(r.href)?Dr(e,t,n):(r.target=`_blank`,kr(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){kr(r)},0))}function Pr(e,t=`download`,n){if(typeof e==`string`)if(Or(e))Dr(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){kr(t)})}else navigator.msSaveOrOpenBlob(Er(e,n),t)}function Fr(e,t,n,r){if(r=r||open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return Dr(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(Tr.HTMLElement))||`safari`in Tr,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||jr)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:Ir}=Object;function Lr(){let e=be(!0),t=e.run(()=>z({})),n=[],r=[],i=j({install(e){xr(i),i._a=e,e.provide(Sr,i),e.config.globalProperties.$pinia=i,r.forEach(e=>n.push(e)),r=[]},use(e){return this._a?n.push(e):r.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}var Rr=()=>{};function zr(e,t,n,r=Rr){e.add(t);let i=()=>{e.delete(t)&&r()};return!n&&ue()&&fe(i),i}function Br(e,...t){e.forEach(e=>{e(...t)})}var Vr=e=>e(),Hr=Symbol(),Ur=Symbol();function Wr(e,t){e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(let n in t){if(!t.hasOwnProperty(n))continue;let r=t[n],i=e[n];Cr(i)&&Cr(r)&&e.hasOwnProperty(n)&&!I(r)&&!_e(r)?e[n]=Wr(i,r):e[n]=r}return e}var Gr=Symbol();function Kr(e){return!Cr(e)||!Object.prototype.hasOwnProperty.call(e,Gr)}var{assign:qr}=Object;function Jr(e){return!!(I(e)&&e.effect)}function Yr(e,t,n,r){let{state:i,actions:a,getters:o}=t,s=n.state.value[e],c;function l(){return s||(n.state.value[e]=i?i():{}),qr(ce(n.state.value[e]),a,Object.keys(o||{}).reduce((t,r)=>(t[r]=j(W(()=>{xr(n);let t=n._s.get(e);return o[r].call(t,t)})),t),{}))}return c=Xr(e,l,t,n,r,!0),c}function Xr(e,t,n={},r,i,a){let o,s=qr({actions:{}},n),c={deep:!0},l,u,d=new Set,f=new Set,p=r.state.value[e];!a&&!p&&(r.state.value[e]={}),z({});let m;function h(t){let n;l=u=!1,typeof t==`function`?(t(r.state.value[e]),n={type:wr.patchFunction,storeId:e,events:void 0}):(Wr(r.state.value[e],t),n={type:wr.patchObject,payload:t,storeId:e,events:void 0});let i=m=Symbol();_().then(()=>{m===i&&(l=!0)}),u=!0,Br(d,n,r.state.value[e])}let g=a?function(){let{state:e}=n,t=e?e():{};this.$patch(e=>{qr(e,t)})}:Rr;function v(){o.stop(),d.clear(),f.clear(),r._s.delete(e)}let y=(t,n=``)=>{if(Hr in t)return t[Ur]=n,t;let i=function(){xr(r);let n=Array.from(arguments),a=new Set,o=new Set;function s(e){a.add(e)}function c(e){o.add(e)}Br(f,{args:n,name:i[Ur],store:b,after:s,onError:c});let l;try{l=t.apply(this&&this.$id===e?this:b,n)}catch(e){throw Br(o,e),e}return l instanceof Promise?l.then(e=>(Br(a,e),e)).catch(e=>(Br(o,e),Promise.reject(e))):(Br(a,l),l)};return i[Hr]=!0,i[Ur]=n,i},b=ve({_p:r,$id:e,$onAction:zr.bind(null,f),$patch:h,$reset:g,$subscribe(t,n={}){let i=zr(d,t,n.detached,()=>a()),a=o.run(()=>T(()=>r.state.value[e],r=>{(n.flush===`sync`?u:l)&&t({storeId:e,type:wr.direct,events:void 0},r)},qr({},c,n)));return i},$dispose:v});r._s.set(e,b);let x=(r._a&&r._a.runWithContext||Vr)(()=>r._e.run(()=>(o=be()).run(()=>t({action:y}))));for(let t in x){let n=x[t];I(n)&&!Jr(n)||_e(n)?a||(p&&Kr(n)&&(I(n)?n.value=p[t]:Wr(n,p[t])),r.state.value[e][t]=n):typeof n==`function`&&(x[t]=y(n,t),s.actions[t]=n)}return qr(b,x),qr(re(b),x),Object.defineProperty(b,`$state`,{get:()=>r.state.value[e],set:e=>{h(t=>{qr(t,e)})}}),r._p.forEach(e=>{qr(b,o.run(()=>e({store:b,app:r._a,pinia:r,options:s})))}),p&&a&&n.hydrate&&n.hydrate(b.$state,p),l=!0,u=!0,b}function Zr(e,t,n){let r,a=typeof t==`function`;r=a?n:t;function o(n,o){let s=i();return n=n||(s?L(Sr,null):null),n&&xr(n),n=br,n._s.has(e)||(a?Xr(e,t,r,n):Yr(e,r,n)),n._s.get(e)}return o.$id=e,o}function Qr(e,t){return Array.isArray(t)?t.reduce((t,n)=>(t[n]=function(){return e(this.$pinia)[n]},t),{}):Object.keys(t).reduce((n,r)=>(n[r]=function(){let n=e(this.$pinia),i=t[r];return typeof i==`function`?i.call(this,n):n[i]},n),{})}function $r(e,t){return Array.isArray(t)?t.reduce((t,n)=>(t[n]=function(...t){return e(this.$pinia)[n](...t)},t),{}):Object.keys(t).reduce((n,r)=>(n[r]=function(...n){return e(this.$pinia)[t[r]](...n)},n),{})}function ei(e,t){return Array.isArray(t)?t.reduce((t,n)=>(t[n]={get(){return e(this.$pinia)[n]},set(t){return e(this.$pinia)[n]=t}},t),{}):Object.keys(t).reduce((n,r)=>(n[r]={get(){return e(this.$pinia)[t[r]]},set(n){return e(this.$pinia)[t[r]]=n}},n),{})}function ti(e){let t=re(e),n={};for(let r in t){let i=t[r];i.effect?n[r]=W({get:()=>e[r],set(t){e[r]=t}}):(I(i)||_e(i))&&(n[r]=me(e,r))}return n}function ni(e){let t=Lr();return t.use(({store:t})=>{t.router=j(e)}),t}var ri=typeof document<`u`;function ii(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function ai(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&ii(e.default)}var K=Object.assign;function oi(e,t){let n={};for(let r in t){let i=t[r];n[r]=ci(i)?i.map(e):e(i)}return n}var si=()=>{},ci=Array.isArray;function li(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var q=function(e){return e[e.MATCHER_NOT_FOUND=1]=`MATCHER_NOT_FOUND`,e[e.NAVIGATION_GUARD_REDIRECT=2]=`NAVIGATION_GUARD_REDIRECT`,e[e.NAVIGATION_ABORTED=4]=`NAVIGATION_ABORTED`,e[e.NAVIGATION_CANCELLED=8]=`NAVIGATION_CANCELLED`,e[e.NAVIGATION_DUPLICATED=16]=`NAVIGATION_DUPLICATED`,e}({}),ui=Symbol(``);q.MATCHER_NOT_FOUND,q.NAVIGATION_GUARD_REDIRECT,q.NAVIGATION_ABORTED,q.NAVIGATION_CANCELLED,q.NAVIGATION_DUPLICATED;function di(e,t){return K(Error(),{type:e,[ui]:!0},t)}function fi(e,t){return e instanceof Error&&ui in e&&(t==null||!!(e.type&t))}var pi=Symbol(``),mi=Symbol(``),hi=Symbol(``),gi=Symbol(``),_i=Symbol(``);function vi(){return L(hi)}function yi(e){return L(gi)}var bi=/#/g,xi=/&/g,Si=/\//g,Ci=/=/g,wi=/\?/g,Ti=/\+/g,Ei=/%5B/g,Di=/%5D/g,Oi=/%5E/g,ki=/%60/g,Ai=/%7B/g,ji=/%7C/g,Mi=/%7D/g,Ni=/%20/g;function Pi(e){return e==null?``:encodeURI(``+e).replace(ji,`|`).replace(Ei,`[`).replace(Di,`]`)}function Fi(e){return Pi(e).replace(Ai,`{`).replace(Mi,`}`).replace(Oi,`^`)}function Ii(e){return Pi(e).replace(Ti,`%2B`).replace(Ni,`+`).replace(bi,`%23`).replace(xi,`%26`).replace(ki,"`").replace(Ai,`{`).replace(Mi,`}`).replace(Oi,`^`)}function Li(e){return Ii(e).replace(Ci,`%3D`)}function Ri(e){return Pi(e).replace(bi,`%23`).replace(wi,`%3F`)}function zi(e){return Ri(e).replace(Si,`%2F`)}function Bi(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{}return``+e}var Vi=/\/$/,Hi=e=>e.replace(Vi,``);function Ui(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return c=s>=0&&c>s?-1:c,c>=0&&(r=t.slice(0,c),a=t.slice(c,s>0?s:t.length),i=e(a.slice(1))),s>=0&&(r=r||t.slice(0,s),o=t.slice(s,t.length)),r=Zi(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:Bi(o)}}function Wi(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function Gi(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function Ki(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&qi(t.matched[r],n.matched[i])&&Ji(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function qi(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Ji(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Yi(e[n],t[n]))return!1;return!0}function Yi(e,t){return ci(e)?Xi(e,t):ci(t)?Xi(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function Xi(e,t){return ci(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function Zi(e,t){if(e.startsWith(`/`))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o1&&a--;else break;return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}var Qi={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0},$i=function(e){return e.pop=`pop`,e.push=`push`,e}({}),ea=function(e){return e.back=`back`,e.forward=`forward`,e.unknown=``,e}({});function ta(e){if(!e)if(ri){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^\/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),Hi(e)}var na=/^[^#]+#/;function ra(e,t){return e.replace(na,`#`)+t}function ia(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}var aa=()=>({left:window.scrollX,top:window.scrollY});function oa(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=ia(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function sa(e,t){return(history.state?history.state.position-t:-1)+e}var ca=new Map;function la(e,t){ca.set(e,t)}function ua(e){let t=ca.get(e);return ca.delete(e),t}function da(e){return typeof e==`string`||e&&typeof e==`object`}function fa(e){return typeof e==`string`||typeof e==`symbol`}function pa(e){let t={};if(e===``||e===`?`)return t;let n=(e[0]===`?`?e.slice(1):e).split(`&`);for(let e=0;ee&&Ii(e)):[r&&Ii(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function ha(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=ci(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}function ga(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function _a(e,t,n){let r=e.value;if(!r)return;let i=r,a=()=>{i[t].delete(n)};Ce(a),m(a),l(()=>{let r=e.value;r&&(i=r),i[t].add(n)}),i[t].add(n)}function va(e){_a(L(pi,{}),`updateGuards`,e)}function ya(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(di(q.NAVIGATION_ABORTED,{from:n,to:t})):e instanceof Error?c(e):da(e)?c(di(q.NAVIGATION_GUARD_REDIRECT,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function ba(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(!(t!==`beforeRouteEnter`&&!o.instances[e]))if(ii(s)){let c=(s.__vccOpts||s)[t];c&&a.push(ya(c,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=ai(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=(s.__vccOpts||s)[t];return c&&ya(c,n,r,o,e,i)()}))}}return a}function xa(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;oqi(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>qi(e,s))||i.push(s))}return[n,r,i]}var Sa=()=>location.protocol+`//`+location.host;function Ca(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),Gi(n,``)}return Gi(n,e)+r+i}function wa(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=Ca(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:$i.pop,direction:u?u>0?ea.forward:ea.back:ea.unknown})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){if(document.visibilityState===`hidden`){let{history:e}=window;if(!e.state)return;e.replaceState(K({},e.state,{scroll:aa()}),``)}}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u),document.removeEventListener(`visibilitychange`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),document.addEventListener(`visibilitychange`,u),{pauseListeners:c,listen:l,destroy:d}}function Ta(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?aa():null}}function Ea(e){let{history:t,location:n}=window,r={value:Ca(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:Sa()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,K({},t.state,Ta(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=K({},i.value,t.state,{forward:e,scroll:aa()});a(o.current,o,!0),a(e,K({},Ta(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function Da(e){e=ta(e);let t=Ea(e),n=wa(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=K({location:``,base:e,go:r,createHref:ra.bind(null,e)},t,n);return Object.defineProperty(i,`location`,{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,`state`,{enumerable:!0,get:()=>t.state.value}),i}var Oa=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.Group=2]=`Group`,e}({}),ka=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.ParamRegExp=2]=`ParamRegExp`,e[e.ParamRegExpEnd=3]=`ParamRegExpEnd`,e[e.EscapeNext=4]=`EscapeNext`,e}(ka||{}),Aa={type:Oa.Static,value:``},ja=/[a-zA-Z0-9_]/;function Ma(e){if(!e)return[[]];if(e===`/`)return[[Aa]];if(!e.startsWith(`/`))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=ka.Static,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&(n===ka.Static?a.push({type:Oa.Static,value:l}):n===ka.Param||n===ka.ParamRegExp||n===ka.ParamRegExpEnd?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:Oa.Param,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),l=``)}function f(){l+=c}for(;st.length?t.length===1&&t[0]===Fa.Static+Fa.Segment?1:-1:0}function za(e,t){let n=0,r=e.score,i=t.score;for(;n0&&t[t.length-1]<0}var Va={strict:!1,end:!0,sensitive:!1};function Ha(e,t,n){let r=K(La(Ma(e.path),n),{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Ua(e,t){let n=[],r=new Map;t=li(Va,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=Ga(e);s.aliasOf=r&&r.record;let l=li(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(Ga(K({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&u[0]!==`/`){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=Ha(t,n,l),r?r.alias.push(d):(f=f||d,f!==d&&f.alias.push(d),i&&e.name&&!qa(d)&&o(e.name)),Za(d)&&c(d),s.children){let e=s.children;for(let t=0;t{o(f)}:si}function o(e){if(fa(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=Ya(e,n);n.splice(t,0,e),e.record.name&&!qa(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw di(q.MATCHER_NOT_FOUND,{location:e});s=i.record.name,a=K(Wa(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&Wa(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name);else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw di(q.MATCHER_NOT_FOUND,{location:e,currentLocation:t});s=i.record.name,a=K({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:Ja(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function Wa(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Ga(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Ka(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,`mods`,{value:{}}),t}function Ka(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function qa(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Ja(e){return e.reduce((e,t)=>K(e,t.meta),{})}function Ya(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;za(e,t[i])<0?r=i:n=i+1}let i=Xa(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function Xa(e){let t=e;for(;t=t.parent;)if(Za(t)&&za(e,t)===0)return t}function Za({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Qa(e){let t=L(hi),n=L(gi),r=W(()=>{let n=F(e.to);return t.resolve(n)}),i=W(()=>{let{matched:e}=r.value,{length:t}=e,i=e[t-1],a=n.matched;if(!i||!a.length)return-1;let o=a.findIndex(qi.bind(null,i));if(o>-1)return o;let s=ro(e[t-2]);return t>1&&ro(i)===s&&a[a.length-1].path!==s?a.findIndex(qi.bind(null,e[t-2])):o}),a=W(()=>i.value>-1&&no(n.params,r.value.params)),o=W(()=>i.value>-1&&i.value===n.matched.length-1&&Ji(n.params,r.value.params));function s(n={}){if(to(n)){let n=t[F(e.replace)?`replace`:`push`](F(e.to)).catch(si);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:r,href:W(()=>r.value.href),isActive:a,isExactActive:o,navigate:s}}function $a(e){return e.length===1?e[0]:e}var eo=s({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:Qa,setup(e,{slots:t}){let n=ve(Qa(e)),{options:r}=L(hi),i=W(()=>({[io(e.activeClass,r.linkActiveClass,`router-link-active`)]:n.isActive,[io(e.exactActiveClass,r.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&$a(t.default(n));return e.custom?r:R(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}});function to(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function no(e,t){for(let n in t){let r=t[n],i=e[n];if(typeof r==`string`){if(r!==i)return!1}else if(!ci(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}return!0}function ro(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var io=(e,t,n)=>e??t??n,ao=s({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){let r=L(_i),i=W(()=>e.route||r.value),a=L(mi,0),o=W(()=>{let e=F(a),{matched:t}=i.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),s=W(()=>i.value.matched[o.value]);C(mi,W(()=>o.value+1)),C(pi,s),C(_i,i);let c=z();return T(()=>[c.value,s.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!qi(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let r=i.value,a=e.name,o=s.value,l=o&&o.components[a];if(!l)return oo(n.default,{Component:l,route:r});let u=o.props[a],d=R(l,K({},u?u===!0?r.params:typeof u==`function`?u(r):u:null,t,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(o.instances[a]=null)},ref:c}));return oo(n.default,{Component:d,route:r})||d}}});function oo(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var so=ao;function co(e){let t=Ua(e.routes,e),n=e.parseQuery||pa,r=e.stringifyQuery||ma,i=e.history,a=ga(),o=ga(),s=ga(),c=ne(Qi),l=Qi;ri&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let u=oi.bind(null,e=>``+e),d=oi.bind(null,zi),f=oi.bind(null,Bi);function p(e,n){let r,i;return fa(e)?(r=t.getRecordMatcher(e),i=n):i=e,t.addRoute(i,r)}function m(e){let n=t.getRecordMatcher(e);n&&t.removeRoute(n)}function h(){return t.getRoutes().map(e=>e.record)}function g(e){return!!t.getRecordMatcher(e)}function v(e,a){if(a=K({},a||c.value),typeof e==`string`){let r=Ui(n,e,a.path),o=t.resolve({path:r.path},a),s=i.createHref(r.fullPath);return K(r,o,{params:f(o.params),hash:Bi(r.hash),redirectedFrom:void 0,href:s})}let o;if(e.path!=null)o=K({},e,{path:Ui(n,e.path,a.path).path});else{let t=K({},e.params);for(let e in t)t[e]??delete t[e];o=K({},e,{params:d(t)}),a.params=d(a.params)}let s=t.resolve(o,a),l=e.hash||``;s.params=u(f(s.params));let p=Wi(r,K({},e,{hash:Fi(l),path:s.path})),m=i.createHref(p);return K({fullPath:p,hash:l,query:r===ma?ha(e.query):e.query||{}},s,{redirectedFrom:void 0,href:m})}function y(e){return typeof e==`string`?Ui(n,e,c.value.path):K({},e)}function b(e,t){if(l!==e)return di(q.NAVIGATION_CANCELLED,{from:t,to:e})}function x(e){return w(e)}function S(e){return x(K(y(e),{replace:!0}))}function C(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=y(i):{path:i},i.params={}),K({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function w(e,t){let n=l=v(e),i=c.value,a=e.state,o=e.force,s=e.replace===!0,u=C(n,i);if(u)return w(K(y(u),{state:typeof u==`object`?K({},a,u.state):a,force:o,replace:s}),t||n);let d=n;d.redirectedFrom=t;let f;return!o&&Ki(r,i,n)&&(f=di(q.NAVIGATION_DUPLICATED,{to:d,from:i}),ie(i,i,!0,!1)),(f?Promise.resolve(f):D(d,i)).catch(e=>fi(e)?fi(e,q.NAVIGATION_GUARD_REDIRECT)?e:P(e):N(e,d,i)).then(e=>{if(e){if(fi(e,q.NAVIGATION_GUARD_REDIRECT))return w(K({replace:s},y(e.to),{state:typeof e.to==`object`?K({},a,e.to.state):a,force:o}),t||d)}else e=k(d,i,!0,s,a);return O(d,i,e),e})}function T(e,t){let n=b(e,t);return n?Promise.reject(n):Promise.resolve()}function E(e){let t=L.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function D(e,t){let n,[r,i,s]=xa(e,t);n=ba(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(ya(r,e,t))});let c=T.bind(null,e,t);return n.push(c),oe(n).then(()=>{n=[];for(let r of a.list())n.push(ya(r,e,t));return n.push(c),oe(n)}).then(()=>{n=ba(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(ya(r,e,t))});return n.push(c),oe(n)}).then(()=>{n=[];for(let r of s)if(r.beforeEnter)if(ci(r.beforeEnter))for(let i of r.beforeEnter)n.push(ya(i,e,t));else n.push(ya(r.beforeEnter,e,t));return n.push(c),oe(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=ba(s,`beforeRouteEnter`,e,t,E),n.push(c),oe(n))).then(()=>{n=[];for(let r of o.list())n.push(ya(r,e,t));return n.push(c),oe(n)}).catch(e=>fi(e,q.NAVIGATION_CANCELLED)?e:Promise.reject(e))}function O(e,t,n){s.list().forEach(r=>E(()=>r(e,t,n)))}function k(e,t,n,r,a){let o=b(e,t);if(o)return o;let s=t===Qi,l=ri?history.state:{};n&&(r||s?i.replace(e.fullPath,K({scroll:s&&l&&l.scroll},a)):i.push(e.fullPath,a)),c.value=e,ie(e,t,n,s),P()}let A;function j(){A||(A=i.listen((e,t,n)=>{if(!R.listening)return;let r=v(e),a=C(r,R.currentRoute.value);if(a){w(K(a,{replace:!0,force:!0}),r).catch(si);return}l=r;let o=c.value;ri&&la(sa(o.fullPath,n.delta),aa()),D(r,o).catch(e=>fi(e,q.NAVIGATION_ABORTED|q.NAVIGATION_CANCELLED)?e:fi(e,q.NAVIGATION_GUARD_REDIRECT)?(w(K(y(e.to),{force:!0}),r).then(e=>{fi(e,q.NAVIGATION_ABORTED|q.NAVIGATION_DUPLICATED)&&!n.delta&&n.type===$i.pop&&i.go(-1,!1)}).catch(si),Promise.reject()):(n.delta&&i.go(-n.delta,!1),N(e,r,o))).then(e=>{e=e||k(r,o,!1),e&&(n.delta&&!fi(e,q.NAVIGATION_CANCELLED)?i.go(-n.delta,!1):n.type===$i.pop&&fi(e,q.NAVIGATION_ABORTED|q.NAVIGATION_DUPLICATED)&&i.go(-1,!1)),O(r,o,e)}).catch(si)}))}let M=ga(),ee=ga(),te;function N(e,t,n){P(e);let r=ee.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function re(){return te&&c.value!==Qi?Promise.resolve():new Promise((e,t)=>{M.add([e,t])})}function P(e){return te||(te=!e,j(),M.list().forEach(([t,n])=>e?n(e):t()),M.reset()),e}function ie(t,n,r,i){let{scrollBehavior:a}=e;if(!ri||!a)return Promise.resolve();let o=!r&&ua(sa(t.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return _().then(()=>a(t,n,o)).then(e=>e&&oa(e)).catch(e=>N(e,t,n))}let ae=e=>i.go(e),I,L=new Set,R={currentRoute:c,listening:!0,addRoute:p,removeRoute:m,clearRoutes:t.clearRoutes,hasRoute:g,getRoutes:h,resolve:v,options:e,push:x,replace:S,go:ae,back:()=>ae(-1),forward:()=>ae(1),beforeEach:a.add,beforeResolve:o.add,afterEach:s.add,onError:ee.add,isReady:re,install(e){e.component(`RouterLink`,eo),e.component(`RouterView`,so),e.config.globalProperties.$router=R,Object.defineProperty(e.config.globalProperties,`$route`,{enumerable:!0,get:()=>F(c)}),ri&&!I&&c.value===Qi&&(I=!0,x(i.location).catch(e=>{}));let t={};for(let e in Qi)Object.defineProperty(t,e,{get:()=>c.value[e],enumerable:!0});e.provide(hi,R),e.provide(gi,xe(t)),e.provide(_i,c);let n=e.unmount;L.add(e),e.unmount=function(){L.delete(e),L.size<1&&(l=Qi,A&&A(),A=null,c.value=Qi,I=!1,te=!1),n()}}};function oe(e){return e.reduce((e,t)=>e.then(()=>E(t)),Promise.resolve())}return R}var lo=typeof global==`object`&&global&&global.Object===Object&&global,uo=typeof self==`object`&&self&&self.Object===Object&&self,fo=lo||uo||Function(`return this`)(),po=fo.Symbol,mo=Object.prototype,ho=mo.hasOwnProperty,go=mo.toString,_o=po?po.toStringTag:void 0;function vo(e){var t=ho.call(e,_o),n=e[_o];try{e[_o]=void 0;var r=!0}catch{}var i=go.call(e);return r&&(t?e[_o]=n:delete e[_o]),i}var yo=Object.prototype.toString;function bo(e){return yo.call(e)}var xo=`[object Null]`,So=`[object Undefined]`,Co=po?po.toStringTag:void 0;function wo(e){return e==null?e===void 0?So:xo:Co&&Co in Object(e)?vo(e):bo(e)}function To(e){return typeof e==`object`&&!!e}var Eo=`[object Symbol]`;function Do(e){return typeof e==`symbol`||To(e)&&wo(e)==Eo}var Oo=Array.isArray,ko=/\s/;function Ao(e){for(var t=e.length;t--&&ko.test(e.charAt(t)););return t}var jo=/^\s+/;function Mo(e){return e&&e.slice(0,Ao(e)+1).replace(jo,``)}function No(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var Po=NaN,Fo=/^[-+]0x[0-9a-f]+$/i,Io=/^0b[01]+$/i,Lo=/^0o[0-7]+$/i,Ro=parseInt;function zo(e){if(typeof e==`number`)return e;if(Do(e))return Po;if(No(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=No(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=Mo(e);var n=Io.test(e);return n||Lo.test(e)?Ro(e.slice(2),n?2:8):Fo.test(e)?Po:+e}var Bo=`[object AsyncFunction]`,Vo=`[object Function]`,Ho=`[object GeneratorFunction]`,Uo=`[object Proxy]`;function Wo(e){if(!No(e))return!1;var t=wo(e);return t==Vo||t==Ho||t==Bo||t==Uo}var Go=fo[`__core-js_shared__`],Ko=function(){var e=/[^.]+$/.exec(Go&&Go.keys&&Go.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function qo(e){return!!Ko&&Ko in e}var Jo=Function.prototype.toString;function Yo(e){if(e!=null){try{return Jo.call(e)}catch{}try{return e+``}catch{}}return``}var Xo=/[\\^$.*+?()[\]{}|]/g,Zo=/^\[object .+?Constructor\]$/,Qo=Function.prototype,$o=Object.prototype,es=Qo.toString,ts=$o.hasOwnProperty,ns=RegExp(`^`+es.call(ts).replace(Xo,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function rs(e){return!No(e)||qo(e)?!1:(Wo(e)?ns:Zo).test(Yo(e))}function is(e,t){return e?.[t]}function as(e,t){var n=is(e,t);return rs(n)?n:void 0}var os=as(fo,`WeakMap`),ss=Object.create,cs=function(){function e(){}return function(t){if(!No(t))return{};if(ss)return ss(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function ls(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n-1&&e%1==0&&e-1&&e%1==0&&e<=bs}function Ss(e){return e!=null&&xs(e.length)&&!Wo(e)}var Cs=Object.prototype;function ws(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||Cs)}function Ts(e,t){for(var n=-1,r=Array(e);++n-1}function Uc(e,t){var n=this.__data__,r=Rc(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Wc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t=t||n<0||d&&r>=a}function _(){var e=cd();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(cd())}function x(){var e=cd(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}var pd=`Expected a function`;function md(e,t,n){var r=!0,i=!0;if(typeof e!=`function`)throw TypeError(pd);return No(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),fd(e,t,{leading:r,maxWait:t,trailing:i})}var hd=Zr(`auth`,{state:()=>({user:null,jwt:``,logoutTimer:null}),getters:{isLoggedIn:e=>e.user!==null},actions:{setUser(e){if(e===null){this.user=null;return}A(e.locale||ye()),this.user=e},updateUser(e){e.locale&&A(e.locale),this.user={...this.user,...sd(e)}},clearUser(){this.$reset()},setLogoutTimer(e){this.logoutTimer=e}}}),gd=class extends Error{};gd.prototype.name=`InvalidTokenError`;function _d(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n=`0`+n),`%`+n}))}function vd(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);switch(t.length%4){case 0:break;case 2:t+=`==`;break;case 3:t+=`=`;break;default:throw Error(`base64 string is not of the correct length`)}try{return _d(t)}catch{return atob(t)}}function yd(e,t){if(typeof e!=`string`)throw new gd(`Invalid token specified: must be a string`);t||(t={});let n=t.header===!0?0:1,r=e.split(`.`)[n];if(typeof r!=`string`)throw new gd(`Invalid token specified: missing part #${n+1}`);let i;try{i=vd(r)}catch(e){throw new gd(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new gd(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}function bd(e){let t=yd(e);document.cookie=`auth=${e}; Path=/; SameSite=Strict;`,localStorage.setItem(`jwt`,e);let n=hd();if(n.jwt=e,n.setUser(t.user),Be!==`/login`&&ze===`proxy`){console.warn(`idle timeout disabled with proxy auth and custom logout`);return}n.logoutTimer&&clearTimeout(n.logoutTimer);let r=new Date(t.exp*1e3).getTime()-Date.now();n.setLogoutTimer(Fd(()=>{Td(`inactivity`)},r))}async function xd(){try{localStorage.getItem(`jwt`)&&await Cd(localStorage.getItem(`jwt`))}catch(e){throw console.warn(`Invalid JWT token in storage`),e}}async function Sd(e,t,n){let r={username:e,password:t,recaptcha:n},i=await fetch(`${je}/api/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)}),a=await i.text();if(i.status===200)bd(a);else throw new Ad(a||`${i.status} ${i.statusText}`,i.status)}async function Cd(e){let t=await fetch(`${je}/api/renew`,{method:`POST`,headers:{"X-Auth":e}}),n=await t.text();if(t.status===200)bd(n);else throw new Ad(n||`${t.status} ${t.statusText}`,t.status)}async function wd(e,t){let n={username:e,password:t},r=await fetch(`${je}/api/signup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)});if(r.status!==200)throw new Ad(await r.text()||`${r.status} ${r.statusText}`,r.status)}function Td(e){document.cookie=`auth=; Max-Age=0; Path=/; SameSite=Strict;`,hd().clearUser(),localStorage.setItem(`jwt`,``),Re?window.location.reload():Be===`/login`?typeof e==`string`&&e.trim()!==``?mE.push({path:`/login`,query:{"logout-reason":e}}):mE.push({path:`/login`}):document.location.href=`${Be}`}function Ed(e){let t=e.split(`/`);return t.pop()===``&&t.pop(),t.join(`/`)}function Dd(e){return encodeURIComponent(e).replace(/['()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`).replace(/%(7C|60|5E)/g,(e,t)=>String.fromCharCode(parseInt(t,16)))}function Od(e){return e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}var kd={encodeRFC5987ValueChars:Dd,removeLastDir:Ed,encodePath:Od},Ad=class extends Error{constructor(e,t,n){super(e),this.status=t,this.is_canceled=n,this.name=`StatusError`}};async function jd(e,t,n=!0){let r=hd();t=t||{},t.headers=t.headers||{};let{headers:i,...a}=t,o;try{o=await fetch(`${je}${e}`,{headers:{"X-Auth":r.jwt,...i},...a})}catch(e){throw e instanceof Error&&e.name===`AbortError`?new Ad(`000 No connection`,0,!0):new Ad(`000 No connection`,0)}if(n&&o.headers.get(`X-Renew-Token`)===`true`&&await Cd(r.jwt),o.status<200||o.status>299){let e=new Ad(await o.text()||`${o.status} ${o.statusText}`,o.status);throw n&&o.status==401&&Td(),e}return o}async function Md(e,t){let n=await jd(e,t);if(n.status===200)return n.json();throw new Ad(`${n.status} ${n.statusText}`,n.status)}function Nd(e){return e=e.split(`/`).splice(2).join(`/`),e===``&&(e=`/`),e[0]!==`/`&&(e=`/`+e),e}function Pd(e,t={}){let n=je;n.endsWith(`/`)||(n+=`/`);let r=new URL(n+Od(e),origin);return r.search=new URLSearchParams(t).toString(),r.toString()}function Fd(e,t){let n=864e5,r=t;function i(){return r<=n?window.setTimeout(e,r):window.setTimeout(()=>{r-=n,i()},n)}return i()}var Id=[`src`],Ld={key:0,class:`logout-message`},Rd={key:1,class:`wrong`},zd=[`placeholder`],Bd=[`placeholder`],Vd=[`placeholder`],Hd={key:3,id:`recaptcha`},Ud=[`value`],Wd=s({__name:`Login`,setup(e){let t=z(!1),n=z(``),i=z(``),s=z(``),c=z(``),l=yi(),u=vi(),{t:d}=B({}),f=()=>t.value=!t.value,p=L(`$showError`),m=l.query[`logout-reason`]??null,h=async e=>{e.preventDefault(),e.stopPropagation();let r=l.query.redirect||`/files/`,a=``;if(Ne&&(a=window.grecaptcha.getResponse(),a===``)){n.value=d(`login.wrongCredentials`);return}if(t.value&&s.value!==c.value){n.value=d(`login.passwordsDontMatch`);return}try{t.value&&await wd(i.value,s.value),await Sd(i.value,s.value,a),u.push({path:r})}catch(e){if(e instanceof Ad)if(e.status===409)n.value=d(`login.usernameTaken`);else if(e.status===403)n.value=d(`login.wrongCredentials`);else if(e.status===400){let t=e.message.match(/minimum length is (\d+)/);t?n.value=d(`login.passwordTooShort`,{min:t[1]}):n.value=e.message}else p(e)}};return y(()=>{Ne&&window.grecaptcha.ready(function(){window.grecaptcha.render(`recaptcha`,{sitekey:Pe})})}),(e,l)=>(a(),o(`div`,{id:`login`,class:k({recaptcha:F(Ne)})},[M(`form`,{onSubmit:h},[M(`img`,{src:F(Le),alt:`File Browser`},null,8,Id),M(`h1`,null,G(F(Oe)),1),F(m)==null?b(``,!0):(a(),o(`p`,Ld,G(F(d)(`login.logout_reasons.${F(m)}`)),1)),n.value===``?b(``,!0):(a(),o(`div`,Rd,G(n.value),1)),r(M(`input`,{autofocus:``,class:`input input--block`,type:`text`,autocapitalize:`off`,"onUpdate:modelValue":l[0]||(l[0]=e=>i.value=e),placeholder:F(d)(`login.username`)},null,8,zd),[[N,i.value]]),r(M(`input`,{class:`input input--block`,type:`password`,"onUpdate:modelValue":l[1]||(l[1]=e=>s.value=e),placeholder:F(d)(`login.password`)},null,8,Bd),[[N,s.value]]),t.value?r((a(),o(`input`,{key:2,class:`input input--block`,type:`password`,"onUpdate:modelValue":l[2]||(l[2]=e=>c.value=e),placeholder:F(d)(`login.passwordConfirm`)},null,8,Vd)),[[N,c.value]]):b(``,!0),F(Ne)?(a(),o(`div`,Hd)):b(``,!0),M(`input`,{class:`button button--block`,type:`submit`,value:t.value?F(d)(`login.signup`):F(d)(`login.submit`)},null,8,Ud),F(Fe)?(a(),o(`p`,{key:4,onClick:f},G(t.value?F(d)(`login.loginInstead`):F(d)(`login.createAnAccount`)),1)):b(``,!0)],32)],2))}}),X=Zr(`layout`,{state:()=>({loading:!1,prompts:[],showShell:!1}),getters:{currentPrompt(e){return e.prompts.length>0?e.prompts[e.prompts.length-1]:null},currentPromptName(){return this.currentPrompt?.prompt}},actions:{toggleShell(){this.showShell=!this.showShell},setCloseOnPrompt(e,t){let n=this.prompts.find(e=>e.prompt===t);n&&(n.close=e)},showHover(e){if(typeof e!=`object`){this.prompts.push({prompt:e,confirm:null,action:void 0,saveAction:void 0,props:null,close:null});return}this.prompts.push({prompt:e.prompt,confirm:e?.confirm,action:e?.action,saveAction:e?.saveAction,props:e?.props,close:e?.close})},showError(){this.prompts.push({prompt:`error`,confirm:null,action:void 0,props:null,close:null})},showSuccess(){this.prompts.push({prompt:`success`,confirm:null,action:void 0,props:null,close:null})},closeHovers(){this.prompts.pop()?.close?.()},clearLayout(){this.$reset()}}}),Z=Zr(`file`,{state:()=>({req:null,oldReq:null,reload:!1,selected:[],multiple:!1,isFiles:!1,preselect:null}),getters:{selectedCount:e=>e.selected.length,isListing:e=>e.isFiles&&e?.req?.isDir},actions:{toggleMultiple(){this.multiple=!this.multiple},updateRequest(e){let t=this.selected.map(e=>this.req?.items[e]);this.oldReq=this.req,this.req=e,this.selected=[],this.req?.items&&(this.selected=this.req.items.filter(e=>t.some(t=>t?.url===e.url)).map(e=>e.index))},removeSelected(e){let t=this.selected.indexOf(e);t!==-1&&this.selected.splice(t,1)},clearFile(){this.$reset()}}});function Gd(e){"@babel/helpers - typeof";return Gd=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Gd(e)}function Kd(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(Xd(this,t),n=Zd(this,t,[e]),n.originalRequest=i,n.originalResponse=a,n.causingError=r,r!=null&&(e+=`, caused by ${r.toString()}`),i!=null){var o=i.getHeader(`X-Request-ID`)||`n/a`,s=i.getMethod(),c=i.getURL(),l=a?a.getStatus():`n/a`,u=a?a.getBody()||``:`n/a`;e+=`, originated from request (method: ${s}, url: ${c}, response code: ${l}, response text: ${u}, request id: ${o})`}return n.message=e,n}return ef(t,e),qd(t)}(tf(Error)),lf=!1;function uf(e){lf&&console.log(e)}function df(e){"@babel/helpers - typeof";return df=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},df(e)}function ff(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function pf(e,t){for(var n=0;n{let t={};return e.forEach((e,n)=>t[e]=n),t})(Cf),Tf=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Ef=String.fromCharCode.bind(String),Df=typeof Uint8Array.from==`function`?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Of=e=>e.replace(/=/g,``).replace(/[+\/]/g,e=>e==`+`?`-`:`_`),kf=e=>e.replace(/[^A-Za-z0-9\+\/]/g,``),Af=e=>{let t,n,r,i,a=``,o=e.length%3;for(let o=0;o255||(r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw TypeError(`invalid character found`);t=n<<16|r<<8|i,a+=Cf[t>>18&63]+Cf[t>>12&63]+Cf[t>>6&63]+Cf[t&63]}return o?a.slice(0,o-3)+`===`.substring(o):a},jf=typeof btoa==`function`?e=>btoa(e):bf?e=>Buffer.from(e,`binary`).toString(`base64`):Af,Mf=bf?e=>Buffer.from(e).toString(`base64`):e=>{let t=4096,n=[];for(let r=0,i=e.length;rt?Of(Mf(e)):Mf(e),Pf=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?Ef(192|t>>>6)+Ef(128|t&63):Ef(224|t>>>12&15)+Ef(128|t>>>6&63)+Ef(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return Ef(240|t>>>18&7)+Ef(128|t>>>12&63)+Ef(128|t>>>6&63)+Ef(128|t&63)}},Ff=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,If=e=>e.replace(Ff,Pf),Lf=bf?e=>Buffer.from(e,`utf8`).toString(`base64`):Sf?e=>Mf(Sf.encode(e)):e=>jf(If(e)),Rf=(e,t=!1)=>t?Of(Lf(e)):Lf(e),zf=e=>Rf(e,!0),Bf=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Vf=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return Ef((t>>>10)+55296)+Ef((t&1023)+56320);case 3:return Ef((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Ef((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},Hf=e=>e.replace(Bf,Vf),Uf=e=>{if(e=e.replace(/\s+/g,``),!Tf.test(e))throw TypeError(`malformed base64.`);e+=`==`.slice(2-(e.length&3));let t,n,r,i=[];for(let a=0;a>16&255)):r===64?i.push(Ef(t>>16&255,t>>8&255)):i.push(Ef(t>>16&255,t>>8&255,t&255));return i.join(``)},Wf=typeof atob==`function`?e=>atob(kf(e)):bf?e=>Buffer.from(e,`base64`).toString(`binary`):Uf,Gf=bf?e=>Df(Buffer.from(e,`base64`)):e=>Df(Wf(e).split(``).map(e=>e.charCodeAt(0))),Kf=e=>Gf(Jf(e)),qf=bf?e=>Buffer.from(e,`base64`).toString(`utf8`):xf?e=>xf.decode(Gf(e)):e=>Hf(Wf(e)),Jf=e=>kf(e.replace(/[-_]/g,e=>e==`-`?`+`:`/`)),Yf=e=>qf(Jf(e)),Xf=e=>{if(typeof e!=`string`)return!1;let t=e.replace(/\s+/g,``).replace(/={0,2}$/,``);return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},Zf=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),Qf=function(){let e=(e,t)=>Object.defineProperty(String.prototype,e,Zf(t));e(`fromBase64`,function(){return Yf(this)}),e(`toBase64`,function(e){return Rf(this,e)}),e(`toBase64URI`,function(){return Rf(this,!0)}),e(`toBase64URL`,function(){return Rf(this,!0)}),e(`toUint8Array`,function(){return Kf(this)})},$f=function(){let e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,Zf(t));e(`toBase64`,function(e){return Nf(this,e)}),e(`toBase64URI`,function(){return Nf(this,!0)}),e(`toBase64URL`,function(){return Nf(this,!0)})},ep={version:vf,VERSION:yf,atob:Wf,atobPolyfill:Uf,btoa:jf,btoaPolyfill:Af,fromBase64:Yf,toBase64:Rf,encode:Rf,encodeURI:zf,encodeURL:zf,utob:If,btou:Hf,decode:Yf,isValid:Xf,fromUint8Array:Nf,toUint8Array:Kf,extendString:Qf,extendUint8Array:$f,extendBuiltins:()=>{Qf(),$f()}},tp=n(((e,t)=>{t.exports=function(e,t){if(t=t.split(`:`)[0],e=+e,!e)return!1;switch(t){case`http`:case`ws`:return e!==80;case`https`:case`wss`:return e!==443;case`ftp`:return e!==21;case`gopher`:return e!==70;case`file`:return!1}return e!==0}})),np=n((e=>{var t=Object.prototype.hasOwnProperty,n;function r(e){try{return decodeURIComponent(e.replace(/\+/g,` `))}catch{return null}}function i(e){try{return encodeURIComponent(e)}catch{return null}}function a(e){for(var t=/([^=?#&]+)=?([^&]*)/g,n={},i;i=t.exec(e);){var a=r(i[1]),o=r(i[2]);a===null||o===null||a in n||(n[a]=o)}return n}function o(e,r){r=r||``;var a=[],o,s;for(s in typeof r!=`string`&&(r=`?`),e)if(t.call(e,s)){if(o=e[s],!o&&(o===null||o===n||isNaN(o))&&(o=``),s=i(s),o=i(o),s===null||o===null)continue;a.push(s+`=`+o)}return a.length?r+a.join(`&`):``}e.stringify=o,e.parse=a})),rp=t(n(((e,t)=>{var n=tp(),r=np(),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,a=/[\n\r\t]/g,o=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,s=/:\d+$/,c=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,l=/^[a-zA-Z]:/;function u(e){return(e||``).toString().replace(i,``)}var d=[[`#`,`hash`],[`?`,`query`],function(e,t){return m(t.protocol)?e.replace(/\\/g,`/`):e},[`/`,`pathname`],[`@`,`auth`,1],[NaN,`host`,void 0,1,1],[/:(\d*)$/,`port`,void 0,1],[NaN,`hostname`,void 0,1,1]],f={hash:1,query:1};function p(e){var t=(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{}).location||{};e=e||t;var n={},r=typeof e,i;if(e.protocol===`blob:`)n=new _(unescape(e.pathname),{});else if(r===`string`)for(i in n=new _(e,{}),f)delete n[i];else if(r===`object`){for(i in e)i in f||(n[i]=e[i]);n.slashes===void 0&&(n.slashes=o.test(e.href))}return n}function m(e){return e===`file:`||e===`ftp:`||e===`http:`||e===`https:`||e===`ws:`||e===`wss:`}function h(e,t){e=u(e),e=e.replace(a,``),t=t||{};var n=c.exec(e),r=n[1]?n[1].toLowerCase():``,i=!!n[2],o=!!n[3],s=0,l;return i?o?(l=n[2]+n[3]+n[4],s=n[2].length+n[3].length):(l=n[2]+n[4],s=n[2].length):o?(l=n[3]+n[4],s=n[3].length):l=n[4],r===`file:`?s>=2&&(l=l.slice(2)):m(r)?l=n[4]:r?i&&(l=l.slice(2)):s>=2&&m(t.protocol)&&(l=n[4]),{protocol:r,slashes:i||m(r),slashesCount:s,rest:l}}function g(e,t){if(e===``)return t;for(var n=(t||`/`).split(`/`).slice(0,-1).concat(e.split(`/`)),r=n.length,i=n[r-1],a=!1,o=0;r--;)n[r]===`.`?n.splice(r,1):n[r]===`..`?(n.splice(r,1),o++):o&&(r===0&&(a=!0),n.splice(r,1),o--);return a&&n.unshift(``),(i===`.`||i===`..`)&&n.push(``),n.join(`/`)}function _(e,t,i){if(e=u(e),e=e.replace(a,``),!(this instanceof _))return new _(e,t,i);var o,s,c,f,v,y,b=d.slice(),x=typeof t,S=this,C=0;for(x!==`object`&&x!==`string`&&(i=t,t=null),i&&typeof i!=`function`&&(i=r.parse),t=p(t),s=h(e||``,t),o=!s.protocol&&!s.slashes,S.slashes=s.slashes||o&&t.slashes,S.protocol=s.protocol||t.protocol||``,e=s.rest,(s.protocol===`file:`&&(s.slashesCount!==2||l.test(e))||!s.slashes&&(s.protocol||s.slashesCount<2||!m(S.protocol)))&&(b[3]=[/(.*)/,`pathname`]);C=0;--a){var o=this.tryEntries[a],s=o.completion;if(o.tryLoc===`root`)return i(`end`);if(o.tryLoc<=this.prev){var c=r.call(o,`catchLoc`),l=r.call(o,`finallyLoc`);if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,`finallyLoc`)&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if(r.type===`throw`){var i=r.arg;k(n)}return i}}throw Error(`illegal catch attempt`)},delegateYield:function(t,n,r){return this.delegate={iterator:j(t),resultName:n,nextLoc:r},this.method===`next`&&(this.arg=e),g}},t}function op(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function sp(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){op(a,r,i,o,s,`next`,e)}function s(e){op(a,r,i,o,s,`throw`,e)}o(void 0)})}}function cp(e,t){return dp(e)||up(e,t)||mp(e,t)||lp()}function lp(){throw TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function up(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function dp(e){if(Array.isArray(e))return e}function fp(e){"@babel/helpers - typeof";return fp=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},fp(e)}function pp(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=mp(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(o)throw s}}}}function mp(e,t){if(e){if(typeof e==`string`)return hp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hp(e,t)}}function hp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1)for(var r=0,i=[`uploadUrl`,`uploadSize`,`uploadLengthDeferred`];r1||e._parallelUploadUrls!=null?e._startParallelUpload():e._startSingleUpload()}).catch(function(t){e._emitError(t)})}},{key:`_startParallelUpload`,value:function(){var t=this,n=this._size,r=0;this._parallelUploads=[];var i=this._parallelUploadUrls==null?this.options.parallelUploads:this._parallelUploadUrls.length,a=this.options.parallelUploadBoundaries??Rp(this._source.size,i);this._parallelUploadUrls&&a.forEach(function(e,n){e.uploadUrl=t._parallelUploadUrls[n]||null}),this._parallelUploadUrls=Array(a.length);var o=a.map(function(i,o){var s=0;return t._source.slice(i.start,i.end).then(function(c){var l=c.value;return new Promise(function(c,u){var d=new e(l,_p(_p({},t.options),{},{uploadUrl:i.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:t.options.metadataForPartialUploads,headers:_p(_p({},t.options.headers),{},{"Upload-Concat":`partial`}),onSuccess:c,onError:u,onProgress:function(e){r=r-s+e,s=e,t._emitProgress(r,n)},onUploadUrlAvailable:function(){t._parallelUploadUrls[o]=d.url,t._parallelUploadUrls.filter(function(e){return!!e}).length===a.length&&t._saveUploadInUrlStorage()}}));d.start(),t._parallelUploads.push(d)})})}),s;Promise.all(o).then(function(){s=t._openRequest(`POST`,t.options.endpoint),s.setHeader(`Upload-Concat`,`final;${t._parallelUploadUrls.join(` `)}`);var e=kp(t.options.metadata);return e!==``&&s.setHeader(`Upload-Metadata`,e),t._sendRequest(s,null)}).then(function(e){if(!Ap(e.getStatus(),200)){t._emitHttpError(s,e,`tus: unexpected response while creating upload`);return}var n=e.getHeader(`Location`);if(n==null){t._emitHttpError(s,e,`tus: invalid or missing Location header`);return}t.url=Lp(t.options.endpoint,n),uf(`Created upload at ${t.url}`),t._emitSuccess(e)}).catch(function(e){t._emitError(e)})}},{key:`_startSingleUpload`,value:function(){if(this._aborted=!1,this.url!=null){uf(`Resuming upload from previous URL: ${this.url}`),this._resumeUpload();return}if(this.options.uploadUrl!=null){uf(`Resuming upload from provided URL: ${this.options.uploadUrl}`),this.url=this.options.uploadUrl,this._resumeUpload();return}uf(`Creating a new upload`),this._createUpload()}},{key:`abort`,value:function(t){var n=this;if(this._parallelUploads!=null){var r=pp(this._parallelUploads),i;try{for(r.s();!(i=r.n()).done;)i.value.abort(t)}catch(e){r.e(e)}finally{r.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!t||this.url==null?Promise.resolve():e.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:`_emitHttpError`,value:function(e,t,n,r){this._emitError(new cf(n,r,e,t))}},{key:`_emitError`,value:function(e){var t=this;if(!this._aborted){if(this.options.retryDelays!=null&&(this._offset!=null&&this._offset>this._offsetBeforeRetry&&(this._retryAttempt=0),Fp(e,this._retryAttempt,this.options))){var n=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){t.start()},n);return}if(typeof this.options.onError==`function`)this.options.onError(e);else throw e}}},{key:`_emitSuccess`,value:function(e){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess==`function`&&this.options.onSuccess({lastResponse:e})}},{key:`_emitProgress`,value:function(e,t){typeof this.options.onProgress==`function`&&this.options.onProgress(e,t)}},{key:`_emitChunkComplete`,value:function(e,t,n){typeof this.options.onChunkComplete==`function`&&this.options.onChunkComplete(e,t,n)}},{key:`_createUpload`,value:function(){var e=this;if(!this.options.endpoint){this._emitError(Error(`tus: unable to create upload because no endpoint is provided`));return}var t=this._openRequest(`POST`,this.options.endpoint);this.options.uploadLengthDeferred?t.setHeader(`Upload-Defer-Length`,`1`):t.setHeader(`Upload-Length`,`${this._size}`);var n=kp(this.options.metadata);n!==``&&t.setHeader(`Upload-Metadata`,n);var r;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,r=this._addChunkToRequest(t)):((this.options.protocol===Tp||this.options.protocol===Ep)&&t.setHeader(`Upload-Complete`,`?0`),r=this._sendRequest(t,null)),r.then(function(n){if(!Ap(n.getStatus(),200)){e._emitHttpError(t,n,`tus: unexpected response while creating upload`);return}var r=n.getHeader(`Location`);if(r==null){e._emitHttpError(t,n,`tus: invalid or missing Location header`);return}if(e.url=Lp(e.options.endpoint,r),uf(`Created upload at ${e.url}`),typeof e.options.onUploadUrlAvailable==`function`&&e.options.onUploadUrlAvailable(),e._size===0){e._emitSuccess(n),e._source.close();return}e._saveUploadInUrlStorage().then(function(){e.options.uploadDataDuringCreation?e._handleUploadResponse(t,n):(e._offset=0,e._performUpload())})}).catch(function(n){e._emitHttpError(t,null,`tus: failed to create upload`,n)})}},{key:`_resumeUpload`,value:function(){var e=this,t=this._openRequest(`HEAD`,this.url);this._sendRequest(t,null).then(function(n){var r=n.getStatus();if(!Ap(r,200)){if(r===423){e._emitHttpError(t,n,`tus: upload is currently locked; retry later`);return}if(Ap(r,400)&&e._removeFromUrlStorage(),!e.options.endpoint){e._emitHttpError(t,n,`tus: unable to resume upload (new upload cannot be created without an endpoint)`);return}e.url=null,e._createUpload();return}var i=Number.parseInt(n.getHeader(`Upload-Offset`),10);if(Number.isNaN(i)){e._emitHttpError(t,n,`tus: invalid or missing offset value`);return}var a=Number.parseInt(n.getHeader(`Upload-Length`),10);if(Number.isNaN(a)&&!e.options.uploadLengthDeferred&&e.options.protocol===wp){e._emitHttpError(t,n,`tus: invalid or missing length value`);return}typeof e.options.onUploadUrlAvailable==`function`&&e.options.onUploadUrlAvailable(),e._saveUploadInUrlStorage().then(function(){if(i===a){e._emitProgress(a,a),e._emitSuccess(n);return}e._offset=i,e._performUpload()})}).catch(function(n){e._emitHttpError(t,null,`tus: failed to resume upload`,n)})}},{key:`_performUpload`,value:function(){var e=this;if(!this._aborted){var t;this.options.overridePatchMethod?(t=this._openRequest(`POST`,this.url),t.setHeader(`X-HTTP-Method-Override`,`PATCH`)):t=this._openRequest(`PATCH`,this.url),t.setHeader(`Upload-Offset`,`${this._offset}`),this._addChunkToRequest(t).then(function(n){if(!Ap(n.getStatus(),200)){e._emitHttpError(t,n,`tus: unexpected response while uploading chunk`);return}e._handleUploadResponse(t,n)}).catch(function(n){e._aborted||e._emitHttpError(t,null,`tus: failed to upload chunk at offset ${e._offset}`,n)})}}},{key:`_addChunkToRequest`,value:function(e){var t=this,n=this._offset,r=this._offset+this.options.chunkSize;return e.setProgressHandler(function(e){t._emitProgress(n+e,t._size)}),this.options.protocol===wp?e.setHeader(`Content-Type`,`application/offset+octet-stream`):this.options.protocol===Ep&&e.setHeader(`Content-Type`,`application/partial-upload`),(r===1/0||r>this._size)&&!this.options.uploadLengthDeferred&&(r=this._size),this._source.slice(n,r).then(function(n){var r=n.value,i=n.done,a=r!=null&&r.size?r.size:0;t.options.uploadLengthDeferred&&i&&(t._size=t._offset+a,e.setHeader(`Upload-Length`,`${t._size}`));var o=t._offset+a;return!t.options.uploadLengthDeferred&&i&&o!==t._size?Promise.reject(Error(`upload was configured with a size of ${t._size} bytes, but the source is done after ${o} bytes`)):r===null?t._sendRequest(e):((t.options.protocol===Tp||t.options.protocol===Ep)&&e.setHeader(`Upload-Complete`,i?`?1`:`?0`),t._emitProgress(t._offset,t._size),t._sendRequest(e,r))})}},{key:`_handleUploadResponse`,value:function(e,t){var n=Number.parseInt(t.getHeader(`Upload-Offset`),10);if(Number.isNaN(n)){this._emitHttpError(e,t,`tus: invalid or missing offset value`);return}if(this._emitProgress(n,this._size),this._emitChunkComplete(n-this._offset,n,this._size),this._offset=n,n===this._size){this._emitSuccess(t),this._source.close();return}this._performUpload()}},{key:`_openRequest`,value:function(e,t){var n=jp(e,t,this.options);return this._req=n,n}},{key:`_removeFromUrlStorage`,value:function(){var e=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(t){e._emitError(t)}),this._urlStorageKey=null)}},{key:`_saveUploadInUrlStorage`,value:function(){var e=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var t={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?t.parallelUploadUrls=this._parallelUploadUrls:t.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,t).then(function(t){e._urlStorageKey=t})}},{key:`_sendRequest`,value:function(e){return Mp(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,this.options)}}],[{key:`terminate`,value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=jp(`DELETE`,t,n);return Mp(r,null,n).then(function(e){if(e.getStatus()!==204)throw new cf(`tus: unexpected response while terminating upload`,null,r,e)}).catch(function(i){if(i instanceof cf||(i=new cf(`tus: failed to terminate upload`,i,r,null)),!Fp(i,0,n))throw i;var a=n.retryDelays[0],o=n.retryDelays.slice(1),s=_p(_p({},n),{},{retryDelays:o});return new Promise(function(e){return setTimeout(e,a)}).then(function(){return e.terminate(t,s)})})}}])}();function kp(e){return Object.entries(e).map(function(e){var t=cp(e,2),n=t[0],r=t[1];return`${n} ${ep.encode(String(r))}`}).join(`,`)}function Ap(e,t){return e>=t&&e=n.retryDelays.length||e.originalRequest==null?!1:n&&typeof n.onShouldRetry==`function`?n.onShouldRetry(e,t,n):Ip(e)}function Ip(e){var t=e.originalResponse?e.originalResponse.getStatus():0;return(!Ap(t,400)||t===409||t===423)&&Pp()}function Lp(e,t){return new rp.default(t,e).toString()}function Rp(e,t){for(var n=Math.floor(e/t),r=[],i=0;i=this.size;return Promise.resolve({value:n,done:r})}},{key:`close`,value:function(){}}])}();function Xp(e){"@babel/helpers - typeof";return Xp=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Xp(e)}function Zp(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Qp(e,t){for(var n=0;nthis._bufferOffset&&(this._buffer=this._buffer.slice(e-this._bufferOffset),this._bufferOffset=e);var n=nm(this._buffer)===0;return this._done&&n?null:this._buffer.slice(0,t-e)}},{key:`close`,value:function(){this._reader.cancel&&this._reader.cancel()}}])}();function am(e){"@babel/helpers - typeof";return am=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},am(e)}function om(){om=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a=typeof Symbol==`function`?Symbol:{},o=a.iterator||`@@iterator`,s=a.asyncIterator||`@@asyncIterator`,c=a.toStringTag||`@@toStringTag`;function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},``)}catch{l=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof _?t:_,o=Object.create(a.prototype);return i(o,`_invoke`,{value:E(e,n,new A(r||[]))}),o}function d(e,t,n){try{return{type:`normal`,arg:e.call(t,n)}}catch(e){return{type:`throw`,arg:e}}}t.wrap=u;var f=`suspendedStart`,p=`suspendedYield`,m=`executing`,h=`completed`,g={};function _(){}function v(){}function y(){}var b={};l(b,o,function(){return this});var x=Object.getPrototypeOf,S=x&&x(x(j([])));S&&S!==n&&r.call(S,o)&&(b=S);var C=y.prototype=_.prototype=Object.create(b);function w(e){[`next`,`throw`,`return`].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function T(e,t){function n(i,a,o,s){var c=d(e[i],e,a);if(c.type!==`throw`){var l=c.arg,u=l.value;return u&&am(u)==`object`&&r.call(u,`__await`)?t.resolve(u.__await).then(function(e){n(`next`,e,o,s)},function(e){n(`throw`,e,o,s)}):t.resolve(u).then(function(e){l.value=e,o(l)},function(e){return n(`throw`,e,o,s)})}s(c.arg)}var a;i(this,`_invoke`,{value:function(e,r){function i(){return new t(function(t,i){n(e,r,t,i)})}return a=a?a.then(i,i):i()}})}function E(t,n,r){var i=f;return function(a,o){if(i===m)throw Error(`Generator is already running`);if(i===h){if(a===`throw`)throw o;return{value:e,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var c=D(s,r);if(c){if(c===g)continue;return c}}if(r.method===`next`)r.sent=r._sent=r.arg;else if(r.method===`throw`){if(i===f)throw i=h,r.arg;r.dispatchException(r.arg)}else r.method===`return`&&r.abrupt(`return`,r.arg);i=m;var l=d(t,n,r);if(l.type===`normal`){if(i=r.done?h:p,l.arg===g)continue;return{value:l.arg,done:r.done}}l.type===`throw`&&(i=h,r.method=`throw`,r.arg=l.arg)}}}function D(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,r===`throw`&&t.iterator.return&&(n.method=`return`,n.arg=e,D(t,n),n.method===`throw`)||r!==`return`&&(n.method=`throw`,n.arg=TypeError(`The iterator does not provide a '`+r+`' method`)),g;var a=d(i,t.iterator,n.arg);if(a.type===`throw`)return n.method=`throw`,n.arg=a.arg,n.delegate=null,g;var o=a.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,n.method!==`return`&&(n.method=`next`,n.arg=e),n.delegate=null,g):o:(n.method=`throw`,n.arg=TypeError(`iterator result is not an object`),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type=`normal`,delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:`root`}],e.forEach(O,this),this.reset(!0)}function j(t){if(t||t===``){var n=t[o];if(n)return n.call(t);if(typeof t.next==`function`)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i=0;--a){var o=this.tryEntries[a],s=o.completion;if(o.tryLoc===`root`)return i(`end`);if(o.tryLoc<=this.prev){var c=r.call(o,`catchLoc`),l=r.call(o,`finallyLoc`);if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,`finallyLoc`)&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if(r.type===`throw`){var i=r.arg;k(n)}return i}}throw Error(`illegal catch attempt`)},delegateYield:function(t,n,r){return this.delegate={iterator:j(t),resultName:n,nextLoc:r},this.method===`next`&&(this.arg=e),g}},t}function sm(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function cm(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){sm(a,r,i,o,s,`next`,e)}function s(e){sm(a,r,i,o,s,`throw`,e)}o(void 0)})}}function lm(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function um(e,t){for(var n=0;n0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(n,r){e._xhr.onload=function(){n(new Em(e._xhr))},e._xhr.onerror=function(e){r(e)},e._xhr.send(t)})}},{key:`abort`,value:function(){return this._xhr.abort(),Promise.resolve()}},{key:`getUnderlyingObject`,value:function(){return this._xhr}}])}(),Em=function(){function e(t){ym(this,e),this._xhr=t}return xm(e,[{key:`getStatus`,value:function(){return this._xhr.status}},{key:`getHeader`,value:function(e){return this._xhr.getResponseHeader(e)}},{key:`getBody`,value:function(){return this._xhr.responseText}},{key:`getUnderlyingObject`,value:function(){return this._xhr}}])}();function Dm(e){"@babel/helpers - typeof";return Dm=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Dm(e)}function Om(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function km(e,t){for(var n=0;n0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return zm(this,t),n=Xm(Xm({},eh),n),Hm(this,t,[e,n])}return qm(t,e),Vm(t,null,[{key:`terminate`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t=Xm(Xm({},eh),t),Op.terminate(e,t)}}])}(Op),nh=typeof XMLHttpRequest==`function`&&typeof Blob==`function`&&typeof Blob.prototype.slice==`function`,rh=1e3,ih=2e4,ah={};async function oh(e,t=``,n=!1,r){if(!Ke)throw Error(`Tus.io settings are not defined`);e=Nd(e);let i=`${Je}${e}?override=${n}`,a=hd();return t===``?!1:new Promise((n,o)=>{let s=new th(t,{endpoint:`${qe}${je}${i}`,chunkSize:Ke.chunkSize,retryDelays:sh(Ke),parallelUploads:1,storeFingerprintForResuming:!1,headers:{"X-Auth":a.jwt},onShouldRetry:function(e){return(e.originalResponse?e.originalResponse.getStatus():0)!==409},onError:function(t){if(delete ah[e],t.message===`Upload aborted`)return o(t);let n=t instanceof cf?t.originalResponse===null?`000 No connection`:t.originalResponse.getBody():`Upload failed`;console.error(t),o(Error(n))},onProgress:function(e){typeof r==`function`&&r({loaded:e})},onSuccess:function(){delete ah[e],n()}});ah[e]=s,s.start()})}function sh(e){if(!e.retryCount||e.retryCount<1)return;let t=[],n=0;for(let r=0;r`u`)return!1;for(let n of t)if(e.endsWith(n))return!0;return!1}async function mh(e,t){let n=await e.arrayBuffer();return{items:[],numDirs:0,numFiles:0,sorting:{},index:0,extension:hh(t),isDir:!1,isSymlink:!1,path:t,size:n.byteLength,modified:new Date().toISOString(),name:t.split(`/`).pop()||``,type:`text`,mode:0,url:`/files${t}`,rawContent:n,content:fh(n,`utf-8`)}}function hh(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.substring(t)}async function gh(e,t){let n=ph(e);e=Nd(e);let r=await jd(`/api/resources${e}`,{signal:t,headers:{"X-Encoding":n?`true`:`false`}}),i;try{i=r.headers.get(`Content-Type`)==`application/octet-stream`?await mh(r,e):await r.json()}catch(e){throw e instanceof Error&&e.name===`AbortError`?new Ad(`000 No connection`,0,!0):e}return i.url=`/files${e}`,i.isDir&&(i.url.endsWith(`/`)||(i.url+=`/`),i.items=i.items.map((e,t)=>(e.index=t,e.url=`${i.url}${encodeURIComponent(e.name)}`,e.isDir&&(e.url+=`/`),e))),i}async function _h(e,t,n){e=Nd(e);let r={method:t};return n&&(r.body=n),await jd(`/api/resources${e}`,r)}async function vh(e){return _h(e,`DELETE`)}async function yh(e,t=``){return _h(e,`PUT`,t)}function bh(e,...t){let n=`${je}/api/raw`;if(t.length===1)n+=Nd(t[0])+`?`;else{let e=``;for(let n of t)e+=Nd(n)+`,`;e=e.substring(0,e.length-1),e=encodeURIComponent(e),n+=`/?files=${e}&`}e&&(n+=`algo=${e}&`),window.open(n)}async function xh(e,t=``,n=!1,r=()=>{}){return e.endsWith(`/`)||t instanceof Blob&&![`http:`,`https:`].includes(window.location.protocol)||!await ch(t)?Sh(e,t,n,r):oh(e,t,n,r)}async function Sh(e,t=``,n=!1,r){e=Nd(e);let i;t instanceof Blob&&![`http:`,`https:`].includes(window.location.protocol)&&(i=await new Response(t).arrayBuffer());let a=hd();return new Promise((o,s)=>{let c=new XMLHttpRequest;c.open(`POST`,`${je}/api/resources${e}?override=${n}`,!0),c.setRequestHeader(`X-Auth`,a.jwt),typeof r==`function`&&(c.upload.onprogress=r),c.onload=()=>{c.status===200?o(c.responseText):c.status===409?s(Error(c.status.toString())):s(Error(c.responseText))},c.onerror=()=>{s(Error(`001 Connection aborted`))},c.send(i||t)})}function Ch(e,t=!1,n=!1,r=!1){let i=X(),a=[];for(let i of e){let e=i.from,o=encodeURIComponent(Nd(i.to??``)),s=i.overwrite==null?n:i.overwrite,c=i.rename==null?r:i.rename,l=`${e}?action=${t?`copy`:`rename`}&destination=${o}&override=${s}&rename=${c}`;a.push(_h(l,`PATCH`))}return i.closeHovers(),Promise.all(a)}function wh(e,t=!1,n=!1){return Ch(e,!1,t,n)}function Th(e,t=!1,n=!1){return Ch(e,!0,t,n)}async function Eh(e,t){return(await(await _h(`${e}?checksum=${t}`,`GET`)).json()).checksums[t]}function Dh(e,t){let n={...t&&{inline:`true`}};return Pd(`api/raw`+e.path,n)}function Oh(e,t){let n={inline:`true`,key:Date.parse(e.modified)};return Pd(`api/preview/`+t+e.path,n)}function kh(e){let t={inline:`true`};return e.subtitles?.map(e=>Pd(`api/subtitle`+e,t))}async function Ah(e,t){e=Nd(e);let n=await jd(`/api/usage${e}`,{signal:t});try{return await n.json()}catch(e){throw e instanceof Error&&e.name==`AbortError`?new Ad(`000 No connection`,0,!0):e}}async function jh(){return Md(`/api/shares`)}async function Mh(e){return e=Nd(e),Md(`/api/share${e}`)}async function Nh(e){await jd(`/api/share/${e}`,{method:`DELETE`})}async function Ph(e,t=``,n=``,r=`hours`){e=Nd(e),e=`/api/share${e}`,n!==``&&(e+=`?expires=${n}&unit=${r}`);let i=`{}`;return(t!=``||n!==``||r!==`hours`)&&(i=JSON.stringify({password:t,expires:n.toString(),unit:r})),Md(e,{method:`POST`,body:i})}function Fh(e){return Pd(`share/`+e.hash,{})}async function Ih(){return Md(`/api/users`,{})}async function Lh(e){return Md(`/api/users/${e}`,{})}async function Rh(e,t){let n=await jd(`/api/users`,{method:`POST`,body:JSON.stringify({what:`user`,which:[],current_password:t,data:e})});if(n.status===201)return n.headers.get(`Location`);throw new Ad(await n.text(),n.status)}async function zh(e,t=[`all`],n=null){await jd(`/api/users/${e.id}`,{method:`PUT`,body:JSON.stringify({what:`user`,which:t,...n==null?{}:{current_password:n},data:e})})}async function Bh(e,t=null){await jd(`/api/users/${e}`,{method:`DELETE`,body:JSON.stringify({...t==null?{}:{current_password:t}})})}function Vh(){return Md(`/api/settings`,{})}async function Hh(e){await jd(`/api/settings`,{method:`PUT`,body:JSON.stringify(e)})}async function Uh(e,t=``){e=Nd(e);let n=await(await jd(`/api/public/share${e}`,{headers:{"X-SHARE-PASSWORD":encodeURIComponent(t)}},!1)).json();return n.url=`/share${e}`,n.isDir&&(n.url.endsWith(`/`)||(n.url+=`/`),n.items=n.items.map((e,t)=>(e.index=t,e.url=`${n.url}${encodeURIComponent(e.name)}`,e.isDir&&(e.url+=`/`),e))),n}function Wh(e,t,n,...r){let i=`${je}/api/public/dl/${t}`;if(r.length===1)i+=r[0]+`?`;else{let e=``;for(let t of r)e+=t+`,`;e=e.substring(0,e.length-1),e=encodeURIComponent(e),i+=`/?files=${e}&`}e&&(i+=`algo=${e}&`),n&&(i+=`token=${n}&`),window.open(i)}function Gh(e,t=!1){let n={...t&&{inline:`true`},...e.token&&{token:e.token}};return Pd(`api/public/dl/`+e.hash+e.path,n)}async function Kh(e,t,n,r){e=Nd(e),t=encodeURIComponent(t),e.endsWith(`/`)||(e+=`/`);let i=await jd(`/api/search${e}?query=${t}`,{signal:n});if(!i.body)throw new Ad(`000 No connection`,0);try{if(i.body&&typeof i.body.pipeThrough==`function`){let t=i.body.pipeThrough(new TextDecoderStream).getReader(),n=``;for(;;){let{done:i,value:a}=await t.read();a&&(n+=a);let o=n.split(/\n/),s=o.pop();s||(s=``),n=s;for(let t of o)if(t){let n=JSON.parse(t);n.url=`/files${e}`+kd.encodePath(n.path),n.isDir&&(n.url+=`/`),r(n)}if(i)break}}else{let t=(await i.text()).split(/\n/);for(let n of t)if(n){let t=JSON.parse(n);t.url=`/files${e}`+kd.encodePath(t.path),t.isDir&&(t.url+=`/`),r(t)}}}catch(e){throw e instanceof Error&&e.name===`AbortError`?new Ad(`000 No connection`,0,!0):e}}var qh=window.location.protocol===`https:`?`wss:`:`ws:`;function Jh(e,t,n,r){e=Nd(e),e=`${qh}//${window.location.host}${je}/api/command${e}`;let i=new window.WebSocket(e);i.onopen=()=>i.send(t),i.onmessage=n,i.onclose=r}function Yh(e){let t=document.querySelector(`#${e}-button > i`);if(t==null){console.log(`Error getting button `+e);return}t.innerHTML==`autorenew`||t.innerHTML==`done`||(t.dataset.icon=t.innerHTML,t.style.opacity=`0`,setTimeout(()=>{t&&(t.classList.add(`spin`),t.innerHTML=`autorenew`,t.style.opacity=`1`)},100))}function Xh(e){let t=document.querySelector(`#${e}-button > i`);if(t==null){console.log(`Error getting button `+e);return}t.style.opacity=`0`,setTimeout(()=>{t!==null&&(t.classList.remove(`spin`),t.innerHTML=t?.dataset?.icon||``,t.style.opacity=`1`)},100)}function Zh(e){let t=document.querySelector(`#${e}-button > i`);if(t==null){console.log(`Error getting button `+e);return}t.style.opacity=`0`,setTimeout(()=>{t!==null&&(t.classList.remove(`spin`),t.innerHTML=`done`,t.style.opacity=`1`),setTimeout(()=>{t&&(t.style.opacity=`0`),setTimeout(()=>{t!==null&&(t.innerHTML=t?.dataset?.icon||``,t.style.opacity=`1`)},100)},500)},100)}var Qh={loading:Yh,done:Xh,success:Zh},$h=5,eg=e=>{e.preventDefault()},tg=Zr(`upload`,()=>{let e=L(`$showError`),t=null,n=z([]),r=z(new Set),i=z(-1),a=z(0),o=z(0),s=(e,t,r,i,o)=>{!u()&&!d()&&(window.addEventListener(`beforeunload`,eg),Qh.loading(`upload`));let s={path:e,name:t,file:r,overwrite:i,type:o,totalBytes:r?.size||1,sentBytes:0,rawProgress:j({sentBytes:0})};a.value+=s.totalBytes,n.value.push(s),p()},c=()=>{i.value=1/0,uh()},l=W(()=>n.value.length-(i.value+1)+r.value.size),u=()=>r.value.size>0,d=()=>n.value.length>i.value+1,f=()=>r.value.size<$h,p=async()=>{if(!u()&&!d()){let e=Z();window.removeEventListener(`beforeunload`,eg),Qh.success(`upload`),_(),e.reload=!0}if(f()&&d()){u()||(t=window.setInterval(g,1e3));let n=m();n.type===`dir`?await xh(n.path).catch(e):await xh(n.path,n.file,n.overwrite,e=>{n.rawProgress.sentBytes=e.loaded}).catch(t=>t.message!==`Upload aborted`&&e(t)),h(n)}},m=()=>{i.value++;let e=n.value[i.value];return r.value.add(e),e},h=e=>{o.value+=e.totalBytes-e.sentBytes,e.sentBytes=e.totalBytes,e.file=null,r.value.delete(e),p()},g=()=>{for(let e of r.value)o.value+=e.rawProgress.sentBytes-e.sentBytes,e.sentBytes=e.rawProgress.sentBytes},_=()=>{t!==null&&(clearInterval(t),t=null),n.value=[],r.value=new Set,i.value=-1,a.value=0,o.value=0};return{activeUploads:r,totalBytes:a,sentBytes:o,upload:s,abort:c,pendingUploadCount:l}}),Q=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},ng=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},rg={name:`progress-bar`,props:{val:{default:0},max:{default:100},size:{default:3},"bg-color":{type:String,default:`#eee`},"bar-color":{type:String,default:`#2196f3`},"bar-transition":{type:String,default:`all 0.5s ease`},"bar-border-radius":{type:Number,default:0},spacing:{type:Number,default:4},text:{type:String,default:``},"text-align":{type:String,default:`center`},"text-position":{type:String,default:`bottom`},"font-size":{type:Number,default:13},"text-fg-color":{type:String,default:`#222`}},computed:{pct(){let e=this.val/this.max*100;return e=e.toFixed(2),Math.min(e,this.max)},size_px(){switch(this.size){case`tiny`:return 2;case`small`:return 4;case`medium`:return 8;case`large`:return 12;case`big`:return 16;case`huge`:return 32;case`massive`:return 64}return ng(this.size)?this.size:32},text_padding(){switch(this.size){case`tiny`:case`small`:case`medium`:case`large`:case`big`:case`huge`:case`massive`:return Math.min(Math.max(Math.ceil(this.size_px/8),3),12)}return ng(this.spacing)?this.spacing:4},text_font_size(){switch(this.size){case`tiny`:case`small`:case`medium`:case`large`:case`big`:case`huge`:case`massive`:return Math.min(Math.max(Math.ceil(this.size_px*1.4),11),32)}return ng(this.fontSize)?this.fontSize:13},progress_style(){let e={background:this.bgColor};return(this.textPosition==`middle`||this.textPosition==`inside`)&&(e.position=`relative`,e[`min-height`]=this.size_px+`px`,e[`z-index`]=`-2`),this.barBorderRadius>0&&(e[`border-radius`]=this.barBorderRadius+`px`),e},bar_style(){let e={background:this.barColor,width:this.pct+`%`,height:this.size_px+`px`,transition:this.barTransition};return this.barBorderRadius>0&&(e[`border-radius`]=this.barBorderRadius+`px`),(this.textPosition==`middle`||this.textPosition==`inside`)&&(e.position=`absolute`,e.top=`0`,e.height=`100%`,e[`min-height`]=this.size_px+`px`,e[`z-index`]=`-1`),e},text_style(){let e={color:this.textFgColor,"font-size":this.text_font_size+`px`,"text-align":this.textAlign};return(this.textPosition==`top`||this.textPosition==`middle`||this.textPosition==`inside`)&&(e[`padding-bottom`]=this.text_padding+`px`),(this.textPosition==`bottom`||this.textPosition==`middle`||this.textPosition==`inside`)&&(e[`padding-top`]=this.text_padding+`px`),e}}};function ig(e,t,n,r,i,s){return a(),o(`div`,null,[n.text.length>0&&e.textPosition==`top`?(a(),o(`div`,{key:0,class:`vue-simple-progress-text`,style:Se(s.text_style)},G(n.text),5)):b(``,!0),M(`div`,{class:`vue-simple-progress`,style:Se(s.progress_style)},[n.text.length>0&&e.textPosition==`middle`?(a(),o(`div`,{key:0,class:`vue-simple-progress-text`,style:Se(s.text_style)},G(n.text),5)):b(``,!0),n.text.length>0&&e.textPosition==`inside`?(a(),o(`div`,{key:1,style:Se([{position:`relative`,left:`-9999px`},s.text_style])},G(n.text),5)):b(``,!0),M(`div`,{class:`vue-simple-progress-bar`,style:Se(s.bar_style)},[n.text.length>0&&e.textPosition==`inside`?(a(),o(`div`,{key:0,style:Se(s.text_style)},G(n.text),5)):b(``,!0)],4)],4),n.text.length>0&&e.textPosition==`bottom`?(a(),o(`div`,{key:1,class:`vue-simple-progress-text`,style:Se(s.text_style)},G(n.text),5)):b(``,!0)])}var ag=Q(rg,[[`render`,ig]]),og=[`B`,`kB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],sg=[`B`,`KiB`,`MiB`,`GiB`,`TiB`,`PiB`,`EiB`,`ZiB`,`YiB`],cg=[`b`,`kbit`,`Mbit`,`Gbit`,`Tbit`,`Pbit`,`Ebit`,`Zbit`,`Ybit`],lg=[`b`,`kibit`,`Mibit`,`Gibit`,`Tibit`,`Pibit`,`Eibit`,`Zibit`,`Yibit`],ug=(e,t,n)=>{let r=e;return typeof t==`string`||Array.isArray(t)?r=e.toLocaleString(t,n):(t===!0||n!==void 0)&&(r=e.toLocaleString(void 0,n)),r},dg=e=>{if(typeof e==`number`)return Math.log10(e);let t=e.toString(10);return t.length+Math.log10(`0.${t.slice(0,15)}`)},fg=e=>typeof e==`number`?Math.log(e):dg(e)*Math.log(10),pg=(e,t)=>{if(typeof e==`number`)return e/t;let n=e/BigInt(t),r=e%BigInt(t);return Number(n)+Number(r)/t},mg=(e,t)=>{if(t===void 0)return e;if(typeof t!=`number`||!Number.isSafeInteger(t)||t<0)throw TypeError(`Expected fixedWidth to be a non-negative integer, got ${typeof t}: ${t}`);return t===0?e:e.length{let{minimumFractionDigits:t,maximumFractionDigits:n}=e;if(!(t===void 0&&n===void 0))return{...t!==void 0&&{minimumFractionDigits:t},...n!==void 0&&{maximumFractionDigits:n},roundingMode:`trunc`}};function gg(e,t){if(typeof e!=`bigint`&&!Number.isFinite(e))throw TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,space:!0,nonBreakingSpace:!1,...t};let n=t.bits?t.binary?lg:cg:t.binary?sg:og,r=t.space?t.nonBreakingSpace?`\xA0`:` `:``,i=typeof e==`number`?e===0:e===0n;if(t.signed&&i)return mg(` 0${r}${n[0]}`,t.fixedWidth);let a=e<0,o=a?`-`:t.signed?`+`:``;a&&(e=-e);let s=hg(t),c;if(e<1)c=o+ug(e,t.locale,s)+r+n[0];else{let i=Math.min(Math.floor(t.binary?fg(e)/Math.log(1024):dg(e)/3),n.length-1);if(e=pg(e,(t.binary?1024:1e3)**i),!s){let t=Math.max(3,Math.floor(e).toString().length);e=e.toPrecision(t)}let a=ug(Number(e),t.locale,s),l=n[i];c=o+a+r+l}return mg(c,t.fixedWidth)}var _g={used:`0 B`,total:`0 B`,usedPercentage:0},vg={name:`sidebar`,setup(){return{usage:ve(_g),usageAbortController:new AbortController}},components:{ProgressBar:ag},inject:[`$showError`],computed:{...Qr(hd,[`user`,`isLoggedIn`]),...Qr(Z,[`isFiles`,`reload`]),...Qr(X,[`currentPromptName`]),active(){return this.currentPromptName===`sidebar`},signup:()=>Fe,hideLoginButton:()=>Ye,version:()=>Ie,disableExternal:()=>ke,disableUsedPercentage:()=>Ae,canLogout:()=>!Re&&(Ve||Be!==`/login`)},methods:{...$r(X,[`closeHovers`,`showHover`]),abortOngoingFetchUsage(){this.usageAbortController.abort()},async fetchUsage(){let e=this.$route.path.endsWith(`/`)?this.$route.path:this.$route.path+`/`,t=_g;if(this.disableUsedPercentage)return Object.assign(this.usage,t);try{this.abortOngoingFetchUsage(),this.usageAbortController=new AbortController;let n=await Ah(e,this.usageAbortController.signal);t={used:gg(n.used,{binary:!0}),total:gg(n.total,{binary:!0}),usedPercentage:Math.round(n.used/n.total*100)}}finally{return Object.assign(this.usage,t)}},toRoot(){this.$router.push({path:`/files`}),this.closeHovers()},toAccountSettings(){this.$router.push({path:`/settings/profile`}),this.closeHovers()},toGlobalSettings(){this.$router.push({path:`/settings/global`}),this.closeHovers()},help(){this.showHover(`help`)},logout:Td},watch:{$route:{handler(e){e.path.includes(`/files`)&&this.fetchUsage()},immediate:!0}},unmounted(){this.abortOngoingFetchUsage()}},yg=[`aria-label`,`title`],bg={key:0},xg=[`aria-label`,`title`],Sg=[`aria-label`,`title`],Cg={key:1},wg=[`aria-label`,`title`],Tg=[`aria-label`,`title`],Eg={key:2,class:`credits`,style:{width:`90%`,margin:`2em 2.5em 3em 2.5em`}},Dg={class:`credits`},Og={key:0},kg={key:1,rel:`noopener noreferrer`,target:`_blank`,href:`https://github.com/filebrowser/filebrowser`};function Ag(e,t,n,i,s,c){let l=w(`router-link`),u=w(`progress-bar`);return a(),o(P,null,[r(M(`div`,{onClick:t[0]||(t[0]=(...t)=>e.closeHovers&&e.closeHovers(...t)),class:`overlay`},null,512),[[pe,c.active]]),M(`nav`,{class:k({active:c.active})},[e.isLoggedIn?(a(),o(P,{key:0},[M(`button`,{onClick:t[1]||(t[1]=(...e)=>c.toAccountSettings&&c.toAccountSettings(...e)),class:`action`},[t[8]||(t[8]=M(`i`,{class:`material-icons`},`person`,-1)),M(`span`,null,G(e.user.username),1)]),M(`button`,{class:`action`,onClick:t[2]||(t[2]=(...e)=>c.toRoot&&c.toRoot(...e)),"aria-label":e.$t(`sidebar.myFiles`),title:e.$t(`sidebar.myFiles`)},[t[9]||(t[9]=M(`i`,{class:`material-icons`},`folder`,-1)),M(`span`,null,G(e.$t(`sidebar.myFiles`)),1)],8,yg),e.user.perm.create?(a(),o(`div`,bg,[M(`button`,{onClick:t[3]||(t[3]=t=>e.showHover(`newDir`)),class:`action`,"aria-label":e.$t(`sidebar.newFolder`),title:e.$t(`sidebar.newFolder`)},[t[10]||(t[10]=M(`i`,{class:`material-icons`},`create_new_folder`,-1)),M(`span`,null,G(e.$t(`sidebar.newFolder`)),1)],8,xg),M(`button`,{onClick:t[4]||(t[4]=t=>e.showHover(`newFile`)),class:`action`,"aria-label":e.$t(`sidebar.newFile`),title:e.$t(`sidebar.newFile`)},[t[11]||(t[11]=M(`i`,{class:`material-icons`},`note_add`,-1)),M(`span`,null,G(e.$t(`sidebar.newFile`)),1)],8,Sg)])):b(``,!0),e.user.perm.admin?(a(),o(`div`,Cg,[M(`button`,{class:`action`,onClick:t[5]||(t[5]=(...e)=>c.toGlobalSettings&&c.toGlobalSettings(...e)),"aria-label":e.$t(`sidebar.settings`),title:e.$t(`sidebar.settings`)},[t[12]||(t[12]=M(`i`,{class:`material-icons`},`settings_applications`,-1)),M(`span`,null,G(e.$t(`sidebar.settings`)),1)],8,wg)])):b(``,!0),c.canLogout?(a(),o(`button`,{key:2,onClick:t[6]||(t[6]=(...e)=>c.logout&&c.logout(...e)),class:`action`,id:`logout`,"aria-label":e.$t(`sidebar.logout`),title:e.$t(`sidebar.logout`)},[t[13]||(t[13]=M(`i`,{class:`material-icons`},`exit_to_app`,-1)),M(`span`,null,G(e.$t(`sidebar.logout`)),1)],8,Tg)):b(``,!0)],64)):(a(),o(P,{key:1},[c.hideLoginButton?b(``,!0):(a(),U(l,{key:0,class:`action`,to:`/login`,"aria-label":e.$t(`sidebar.login`),title:e.$t(`sidebar.login`)},{default:v(()=>[t[14]||(t[14]=M(`i`,{class:`material-icons`},`exit_to_app`,-1)),M(`span`,null,G(e.$t(`sidebar.login`)),1)]),_:1},8,[`aria-label`,`title`])),c.signup?(a(),U(l,{key:1,class:`action`,to:`/login`,"aria-label":e.$t(`sidebar.signup`),title:e.$t(`sidebar.signup`)},{default:v(()=>[t[15]||(t[15]=M(`i`,{class:`material-icons`},`person_add`,-1)),M(`span`,null,G(e.$t(`sidebar.signup`)),1)]),_:1},8,[`aria-label`,`title`])):b(``,!0)],64)),e.isFiles&&!c.disableUsedPercentage?(a(),o(`div`,Eg,[x(u,{val:i.usage.usedPercentage,size:`small`},null,8,[`val`]),t[16]||(t[16]=M(`br`,null,null,-1)),H(` `+G(i.usage.used)+` of `+G(i.usage.total)+` used `,1)])):b(``,!0),M(`p`,Dg,[M(`span`,null,[c.disableExternal?(a(),o(`span`,Og,`File Browser`)):(a(),o(`a`,kg,`File Browser`)),M(`span`,null,G(` `)+` `+G(c.version),1)]),M(`span`,null,[M(`a`,{onClick:t[7]||(t[7]=(...e)=>c.help&&c.help(...e))},G(e.$t(`sidebar.help`)),1)])])],2)],64)}var jg=Q(vg,[[`render`,Ag]]),Mg=Q(s({__name:`BaseModal`,emits:[`closed`],setup(e,{emit:t}){let n=t,r=z(null);y(()=>{let e=document.querySelector(`#focus-prompt`);e?e.focus():r.value&&r.value.focus()});let i=e=>{e.target.id==`modal-background`&&n(`closed`)};return window.addEventListener(`keydown`,e=>{e.key===`Escape`&&(e.stopImmediatePropagation(),n(`closed`))}),(e,t)=>(a(),o(`div`,{id:`modal-background`,onClick:i},[M(`div`,{ref_key:`modalContainer`,ref:r},[S(e.$slots,`default`,{},void 0,!0)],512)]))}}),[[`__scopeId`,`data-v-59c83d21`]]),Ng={name:`help`,methods:{...$r(X,[`closeHovers`])}},Pg={class:`card floating help`},Fg={class:`card-title`},Ig={class:`card-content`},Lg={class:`card-action`},Rg=[`aria-label`,`title`];function zg(e,t,n,r,i,s){return a(),o(`div`,Pg,[M(`div`,Fg,[M(`h2`,null,G(e.$t(`help.help`)),1)]),M(`div`,Ig,[M(`ul`,null,[M(`li`,null,[t[1]||(t[1]=M(`strong`,null,`F1`,-1)),H(` - `+G(e.$t(`help.f1`)),1)]),M(`li`,null,[t[2]||(t[2]=M(`strong`,null,`F2`,-1)),H(` - `+G(e.$t(`help.f2`)),1)]),M(`li`,null,[t[3]||(t[3]=M(`strong`,null,`DEL`,-1)),H(` - `+G(e.$t(`help.del`)),1)]),M(`li`,null,[t[4]||(t[4]=M(`strong`,null,`ESC`,-1)),H(` - `+G(e.$t(`help.esc`)),1)]),M(`li`,null,[t[5]||(t[5]=M(`strong`,null,`CTRL + S`,-1)),H(` - `+G(e.$t(`help.ctrl.s`)),1)]),M(`li`,null,[t[6]||(t[6]=M(`strong`,null,`CTRL + SHIFT + F`,-1)),H(` - `+G(e.$t(`help.ctrl.f`)),1)]),M(`li`,null,[t[7]||(t[7]=M(`strong`,null,`CTRL + Click`,-1)),H(` - `+G(e.$t(`help.ctrl.click`)),1)]),M(`li`,null,[t[8]||(t[8]=M(`strong`,null,`Click`,-1)),H(` - `+G(e.$t(`help.click`)),1)]),M(`li`,null,[t[9]||(t[9]=M(`strong`,null,`Double click`,-1)),H(` - `+G(e.$t(`help.doubleClick`)),1)])])]),M(`div`,Lg,[M(`button`,{id:`focus-prompt`,type:`submit`,onClick:t[0]||(t[0]=(...t)=>e.closeHovers&&e.closeHovers(...t)),class:`button button--flat`,"aria-label":e.$t(`buttons.ok`),title:e.$t(`buttons.ok`),tabindex:`1`},G(e.$t(`buttons.ok`)),9,Rg)])])}var Bg=Q(Ng,[[`render`,zg]]),Vg=`Invalid number`,Hg=`Invalid rounding method`,Ug=`iec`,Wg=`jedec`,Gg=`si`,Kg=`bit`,qg=`bits`,Jg=`byte`,Yg=`bytes`,Xg=`kbit`,Zg=`kB`,Qg=`array`,$g=`function`,e_=`object`,t_=`string`,n_=`exponent`,r_=`round`,i_=`e`,a_=``,o_=`.`,s_=`s`,c_=` `,l_=`0`,u_={symbol:{iec:{bits:[`bit`,`Kibit`,`Mibit`,`Gibit`,`Tibit`,`Pibit`,`Eibit`,`Zibit`,`Yibit`],bytes:[`B`,`KiB`,`MiB`,`GiB`,`TiB`,`PiB`,`EiB`,`ZiB`,`YiB`]},jedec:{bits:[`bit`,`Kbit`,`Mbit`,`Gbit`,`Tbit`,`Pbit`,`Ebit`,`Zbit`,`Ybit`],bytes:[`B`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`]}},fullform:{iec:[``,`kibi`,`mebi`,`gibi`,`tebi`,`pebi`,`exbi`,`zebi`,`yobi`],jedec:[``,`kilo`,`mega`,`giga`,`tera`,`peta`,`exa`,`zetta`,`yotta`]}},d_=[1,1024,1048576,1073741824,1099511627776,0x4000000000000,0x1000000000000000,0x400000000000000000,12089258196146292e8],f_=[1,1e3,1e6,1e9,0xe8d4a51000,0x38d7ea4c68000,0xde0b6b3a7640000,1e21,1e24],p_=Math.log(1024),m_=Math.log(1e3),h_={[Gg]:{isDecimal:!0,ceil:1e3,actualStandard:Wg},[Ug]:{isDecimal:!1,ceil:1024,actualStandard:Ug},[Wg]:{isDecimal:!1,ceil:1024,actualStandard:Wg}};function g_(e,t){return h_[e]?h_[e]:t===2?{isDecimal:!1,ceil:1024,actualStandard:Ug}:{isDecimal:!0,ceil:1e3,actualStandard:Wg}}function __(e,t,n,r,i,a,o,s){let c=[];c[0]=e>0?0 .toPrecision(e):0;let l=c[1]=u_.symbol[t][n?qg:Yg][0];return o===n_?0:(r[c[1]]&&(c[1]=r[c[1]]),i&&(c[1]=a[0]||u_.fullform[t][0]+(n?Kg:Jg)),o===Qg?c:o===e_?{value:c[0],symbol:c[1],exponent:0,unit:l}:c.join(s))}function v_(e,t,n,r,i){let a=e/(n?f_[t]:d_[t]);return r&&(a*=8,a>=i&&t<8&&(a/=i,t++)),{result:a,e:t}}function y_(e,t,n,r,i,a,o,s,c){let l=e.toPrecision(t);if(l.includes(i_)&&n<8){n++;let{result:e}=v_(r,n,i,a,o),u=c>0?10**c:1;l=(u===1?s(e):s(e*u)/u).toPrecision(t)}return{value:l,e:n}}function b_(e,t,n,r,i,a){let o=e;if(t===!0?o=o.toLocaleString():t.length>0?o=o.toLocaleString(t,n):r.length>0&&(o=o.toString().replace(o_,r)),i&&a>0){let e=o.toString(),t=r||(e.match(/(\D)/g)||[]).pop()||o_,n=e.split(t),i=n[1]||a_,s=i.length,c=a-s;o=`${n[0]}${t}${i.padEnd(s+c,l_)}`}return o}function x_(e,{bits:t=!1,pad:n=!1,base:r=-1,round:i=2,locale:a=a_,localeOptions:o={},separator:s=a_,spacer:c=c_,symbols:l={},standard:u=a_,output:d=t_,fullform:f=!1,fullforms:p=[],exponent:m=-1,roundingMethod:h=r_,precision:g=0}={}){let _=m,v=Number(e),y=[],b=0,x=a_,{isDecimal:S,ceil:C,actualStandard:w}=g_(u,r),T=f===!0,E=v<0,D=Math[h];if(typeof e!=`bigint`&&isNaN(e))throw TypeError(Vg);if(typeof D!==$g)throw TypeError(Hg);if(E&&(v=-v),v===0)return __(g,w,t,l,T,p,d,c);if((_===-1||isNaN(_))&&(_=S?Math.floor(Math.log(v)/m_):Math.floor(Math.log(v)/p_),_<0&&(_=0)),_>8&&(g>0&&(g+=8-_),_=8),d===n_)return _;let{result:O,e:k}=v_(v,_,S,t,C);b=O,_=k;let A=_>0&&i>0?10**i:1;if(y[0]=A===1?D(b):D(b*A)/A,y[0]===C&&_<8&&m===-1&&(y[0]=1,_++),g>0){let e=y_(y[0],g,_,v,S,t,C,D,i);y[0]=e.value,_=e.e}let j=u_.symbol[w][t?qg:Yg];return x=y[1]=S&&_===1?t?Xg:Zg:j[_],E&&(y[0]=-y[0]),l[y[1]]&&(y[1]=l[y[1]]),y[0]=b_(y[0],a,o,s,n,i),T&&(y[1]=p[_]||u_.fullform[w][_]+(t?Kg:Jg)+(y[0]===1?a_:s_)),d===Qg?y:d===e_?{value:y[0],symbol:y[1],exponent:_,unit:x}:c===c_?`${y[0]} ${y[1]}`:y.join(c)}function S_({bits:e=!1,pad:t=!1,base:n=-1,round:r=2,locale:i=a_,localeOptions:a={},separator:o=a_,spacer:s=c_,symbols:c={},standard:l=a_,output:u=t_,fullform:d=!1,fullforms:f=[],exponent:p=-1,roundingMethod:m=r_,precision:h=0}={}){return g=>x_(g,{bits:e,pad:t,base:n,round:r,locale:i,localeOptions:a,separator:o,spacer:s,symbols:c,standard:l,output:u,fullform:d,fullforms:f,exponent:p,roundingMethod:m,precision:h})}var C_=S_({base:2}),w_={created(e,t){e.clickOutsideEvent=n=>{let r=n.target;r instanceof Node&&(e.contains(r)||t.value(n))},document.addEventListener(`click`,e.clickOutsideEvent)},unmounted(e){e.clickOutsideEvent&&document.removeEventListener(`click`,e.clickOutsideEvent)}},T_=t(Te()),E_={name:`info`,inject:[`$showError`],computed:{...Qr(Z,[`req`,`selected`,`selectedCount`,`isListing`]),humanSize:function(){if(this.selectedCount===0||!this.isListing)return C_(this.req.size);let e=0;for(let t of this.selected)e+=this.req.items[t].size;return C_(e)},humanTime:function(){return this.selectedCount===0?(0,T_.default)(this.req.modified).fromNow():(0,T_.default)(this.req.items[this.selected[0]].modified).fromNow()},modTime:function(){return this.selectedCount===0?new Date(Date.parse(this.req.modified)).toLocaleString():new Date(Date.parse(this.req.items[this.selected[0]].modified)).toLocaleString()},name:function(){return this.selectedCount===0?this.req.name:this.req.items[this.selected[0]].name},dir:function(){return this.selectedCount>1||(this.selectedCount===0?this.req.isDir:this.req.items[this.selected[0]].isDir)},resolution:function(){if(this.selectedCount===1){let e=this.req.items[this.selected[0]];if(e&&e.type===`image`)return e.resolution}else if(this.req&&this.req.type===`image`)return this.req.resolution;return null}},methods:{...$r(X,[`closeHovers`]),checksum:async function(e,t){e.preventDefault();let n;n=this.selectedCount?this.req.items[this.selected[0]].url:this.$route.path;try{let r=await Eh(n,t);e.target.textContent=r}catch(e){this.$showError(e)}}}},D_={class:`card floating`},O_={class:`card-title`},k_={class:`card-content`},A_={key:0},j_={key:1,class:`break-word`},M_={key:2},N_={key:3},P_=[`title`],F_={class:`card-action`},I_=[`aria-label`,`title`];function L_(e,t,n,r,i,s){return a(),o(`div`,D_,[M(`div`,O_,[M(`h2`,null,G(e.$t(`prompts.fileInfo`)),1)]),M(`div`,k_,[e.selected.length>1?(a(),o(`p`,A_,G(e.$t(`prompts.filesSelected`,{count:e.selected.length})),1)):b(``,!0),e.selected.length<2?(a(),o(`p`,j_,[M(`strong`,null,G(e.$t(`prompts.displayName`)),1),H(` `+G(s.name),1)])):b(``,!0),!s.dir||e.selected.length>1?(a(),o(`p`,M_,[M(`strong`,null,G(e.$t(`prompts.size`))+`:`,1),t[9]||(t[9]=M(`span`,{id:`content_length`},null,-1)),H(` `+G(s.humanSize),1)])):b(``,!0),s.resolution?(a(),o(`div`,N_,[M(`strong`,null,G(e.$t(`prompts.resolution`))+`:`,1),H(` `+G(s.resolution.width)+` x `+G(s.resolution.height),1)])):b(``,!0),e.selected.length<2?(a(),o(`p`,{key:4,title:s.modTime},[M(`strong`,null,G(e.$t(`prompts.lastModified`))+`:`,1),H(` `+G(s.humanTime),1)],8,P_)):b(``,!0),s.dir&&e.selected.length===0?(a(),o(P,{key:5},[M(`p`,null,[M(`strong`,null,G(e.$t(`prompts.numberFiles`))+`:`,1),H(` `+G(e.req.numFiles),1)]),M(`p`,null,[M(`strong`,null,G(e.$t(`prompts.numberDirs`))+`:`,1),H(` `+G(e.req.numDirs),1)])],64)):b(``,!0),s.dir?b(``,!0):(a(),o(P,{key:6},[M(`p`,null,[t[10]||(t[10]=M(`strong`,null,`MD5: `,-1)),M(`code`,null,[M(`a`,{onClick:t[0]||(t[0]=e=>s.checksum(e,`md5`)),onKeypress:t[1]||(t[1]=se(e=>s.checksum(e,`md5`),[`enter`])),tabindex:`2`},G(e.$t(`prompts.show`)),33)])]),M(`p`,null,[t[11]||(t[11]=M(`strong`,null,`SHA1: `,-1)),M(`code`,null,[M(`a`,{onClick:t[2]||(t[2]=e=>s.checksum(e,`sha1`)),onKeypress:t[3]||(t[3]=se(e=>s.checksum(e,`sha1`),[`enter`])),tabindex:`3`},G(e.$t(`prompts.show`)),33)])]),M(`p`,null,[t[12]||(t[12]=M(`strong`,null,`SHA256: `,-1)),M(`code`,null,[M(`a`,{onClick:t[4]||(t[4]=e=>s.checksum(e,`sha256`)),onKeypress:t[5]||(t[5]=se(e=>s.checksum(e,`sha256`),[`enter`])),tabindex:`4`},G(e.$t(`prompts.show`)),33)])]),M(`p`,null,[t[13]||(t[13]=M(`strong`,null,`SHA512: `,-1)),M(`code`,null,[M(`a`,{onClick:t[6]||(t[6]=e=>s.checksum(e,`sha512`)),onKeypress:t[7]||(t[7]=se(e=>s.checksum(e,`sha512`),[`enter`])),tabindex:`5`},G(e.$t(`prompts.show`)),33)])])],64))]),M(`div`,F_,[M(`button`,{id:`focus-prompt`,type:`submit`,onClick:t[8]||(t[8]=(...t)=>e.closeHovers&&e.closeHovers(...t)),class:`button button--flat`,"aria-label":e.$t(`buttons.ok`),title:e.$t(`buttons.ok`)},G(e.$t(`buttons.ok`)),9,I_)])])}var R_=Q(E_,[[`render`,L_]]),z_={name:`delete`,inject:[`$showError`],computed:{...Qr(Z,[`isListing`,`selectedCount`,`req`,`selected`]),...Qr(X,[`currentPrompt`]),...ei(Z,[`reload`,`preselect`])},methods:{...$r(X,[`closeHovers`]),submit:async function(){Qh.loading(`delete`);try{if(!this.isListing){await vh(this.$route.path),Qh.success(`delete`),this.currentPrompt?.confirm(),this.closeHovers();return}if(this.closeHovers(),this.selectedCount===0)return;let e=[];for(let t of this.selected)e.push(vh(this.req.items[t].url));await Promise.all(e),Qh.success(`delete`),this.preselect=this.req.items[Math.max(0,Math.min(this.selected)-1)]?.path,this.reload=!0}catch(e){Qh.done(`delete`),this.$showError(e),this.isListing&&(this.reload=!0)}}}},B_={class:`card floating`},V_={class:`card-content`},H_={key:0},U_={key:1},W_={class:`card-action`},G_=[`aria-label`,`title`],K_=[`aria-label`,`title`];function q_(e,t,n,r,i,s){return a(),o(`div`,B_,[M(`div`,V_,[!this.isListing||e.selectedCount===1?(a(),o(`p`,H_,G(e.$t(`prompts.deleteMessageSingle`)),1)):(a(),o(`p`,U_,G(e.$t(`prompts.deleteMessageMultiple`,{count:e.selectedCount})),1))]),M(`div`,W_,[M(`button`,{onClick:t[0]||(t[0]=(...t)=>e.closeHovers&&e.closeHovers(...t)),class:`button button--flat button--grey`,"aria-label":e.$t(`buttons.cancel`),title:e.$t(`buttons.cancel`),tabindex:`2`},G(e.$t(`buttons.cancel`)),9,G_),M(`button`,{id:`focus-prompt`,onClick:t[1]||(t[1]=(...e)=>s.submit&&s.submit(...e)),class:`button button--flat button--red`,"aria-label":e.$t(`buttons.delete`),title:e.$t(`buttons.delete`),tabindex:`1`},G(e.$t(`buttons.delete`)),9,K_)])])}var J_=Q(z_,[[`render`,q_]]),Y_={class:`card floating`},X_={class:`card-content`},Z_={class:`card-action`},Q_=[`aria-label`,`title`],$_=s({__name:`DeleteUser`,setup(e){let t=X(),{t:n}=B();return(e,r)=>(a(),o(`div`,Y_,[M(`div`,X_,[M(`p`,null,G(F(n)(`prompts.deleteUser`)),1)]),M(`div`,Z_,[M(`button`,{id:`focus-prompt`,class:`button button--flat button--grey`,onClick:r[0]||(r[0]=(...e)=>F(t).closeHovers&&F(t).closeHovers(...e)),"aria-label":F(n)(`buttons.cancel`),title:F(n)(`buttons.cancel`),tabindex:`1`},G(F(n)(`buttons.cancel`)),9,Q_),M(`button`,{class:`button button--flat`,onClick:r[1]||(r[1]=(...e)=>F(t).currentPrompt?.confirm&&F(t).currentPrompt?.confirm(...e)),tabindex:`2`},G(F(n)(`buttons.delete`)),1)])]))}}),ev={class:`card floating`,id:`download`},tv={class:`card-title`},nv={class:`card-content`},rv=[`onClick`],iv=s({__name:`Download`,setup(e){let t=X(),{t:n}=B(),r={zip:`zip`,tar:`tar`,targz:`tar.gz`,tarbz2:`tar.bz2`,tarxz:`tar.xz`,tarlz4:`tar.lz4`,tarsz:`tar.sz`,tarbr:`tar.br`,tarzst:`tar.zst`};return(e,i)=>(a(),o(`div`,ev,[M(`div`,tv,[M(`h2`,null,G(F(n)(`prompts.download`)),1)]),M(`div`,nv,[M(`p`,null,G(F(n)(`prompts.downloadMessage`)),1),(a(),o(P,null,d(r,(e,n)=>M(`button`,{id:`focus-prompt`,key:n,class:`button button--block`,onClick:e=>F(t).currentPrompt?.confirm(n)},G(e),9,rv)),64))])]))}}),av={name:`rename`,data:function(){return{name:``}},created(){this.name=this.oldName},inject:[`$showError`],computed:{...Qr(Z,[`req`,`selected`,`selectedCount`,`isListing`]),...ei(Z,[`reload`,`preselect`]),oldName(){return this.isListing?this.selectedCount===0||this.selectedCount>1?``:this.req.items[this.selected[0]].name:this.req.name}},methods:{...$r(X,[`closeHovers`]),cancel:function(){this.closeHovers()},submit:async function(){if(this.name===``||this.name===this.oldName)return;let e=``,t=``;e=this.isListing?this.req.items[this.selected[0]].url:this.req.url,t=kd.removeLastDir(e)+`/`+encodeURIComponent(this.name);try{if(await wh([{from:e,to:t}]),!this.isListing){this.$router.push({path:t});return}this.preselect=Nd(t),this.reload=!0}catch(e){this.$showError(e)}this.closeHovers()}}},ov={class:`card floating`},sv={class:`card-title`},cv={class:`card-content`},lv={class:`card-action`},uv=[`aria-label`,`title`],dv=[`aria-label`,`title`,`disabled`];function fv(e,t,n,i,s,c){return a(),o(`div`,ov,[M(`div`,sv,[M(`h2`,null,G(e.$t(`prompts.rename`)),1)]),M(`div`,cv,[M(`p`,null,[H(G(e.$t(`prompts.renameMessage`))+` `,1),M(`code`,null,G(c.oldName),1),t[4]||(t[4]=H(`: `,-1))]),r(M(`input`,{id:`focus-prompt`,class:`input input--block`,type:`text`,onKeyup:t[0]||(t[0]=se((...e)=>c.submit&&c.submit(...e),[`enter`])),"onUpdate:modelValue":t[1]||(t[1]=t=>e.name=t)},null,544),[[N,e.name,void 0,{trim:!0}]])]),M(`div`,lv,[M(`button`,{class:`button button--flat button--grey`,onClick:t[2]||(t[2]=(...t)=>e.closeHovers&&e.closeHovers(...t)),"aria-label":e.$t(`buttons.cancel`),title:e.$t(`buttons.cancel`)},G(e.$t(`buttons.cancel`)),9,uv),M(`button`,{onClick:t[3]||(t[3]=(...e)=>c.submit&&c.submit(...e)),class:`button button--flat`,type:`submit`,"aria-label":e.$t(`buttons.rename`),title:e.$t(`buttons.rename`),disabled:e.name===``||e.name===c.oldName},G(e.$t(`buttons.rename`)),9,dv)])])}var pv=Q(av,[[`render`,fv]]),mv={name:`file-list`,props:{exclude:{type:Array,default:()=>[]}},data:function(){return{items:[],touches:{id:``,count:0},selected:null,current:window.location.pathname,nextAbortController:new AbortController}},inject:[`$showError`],computed:{...Qr(hd,[`user`]),...Qr(Z,[`req`]),nav(){return decodeURIComponent(this.current)}},mounted(){this.fillOptions(this.req)},unmounted(){this.abortOngoingNext()},methods:{...$r(X,[`showHover`]),abortOngoingNext(){this.nextAbortController.abort()},fillOptions(e){if(this.current=e.url,this.items=[],this.$emit(`update:selected`,this.current),e.url!==`/files/`&&this.items.push({name:`..`,url:kd.removeLastDir(e.url)+`/`}),e.items!==null)for(let t of e.items)t.isDir&&(this.exclude?.includes(t.url)||this.items.push({name:t.name,url:t.url}))},next:function(e){let t=e.currentTarget.dataset.url;this.abortOngoingNext(),this.nextAbortController=new AbortController,gh(t,this.nextAbortController.signal).then(this.fillOptions).catch(e=>{e instanceof Ad&&e.is_canceled||this.$showError(e)})},touchstart(e){let t=e.currentTarget.dataset.url;if(setTimeout(()=>{this.touches.count=0},300),this.touches.id!==t){this.touches.id=t,this.touches.count=1;return}this.touches.count++,this.touches.count>1&&this.next(e)},itemClick:function(e){this.user.singleClick?this.next(e):this.select(e)},select:function(e){if(this.selected===e.currentTarget.dataset.url){this.selected=null,this.$emit(`update:selected`,this.current);return}this.selected=e.currentTarget.dataset.url,this.$emit(`update:selected`,this.selected)},createDir:async function(){this.showHover({prompt:`newDir`,action:null,confirm:e=>{let t=e.split(`/`);this.items.push({name:t[t.length-2],url:e})},props:{redirect:!1,base:this.current===this.$route.path?null:this.current}})}}},hv={class:`file-list`},gv=[`aria-label`,`aria-selected`,`data-url`];function _v(e,t,n,r,i,s){return a(),o(`div`,null,[M(`ul`,hv,[(a(!0),o(P,null,d(e.items,n=>(a(),o(`li`,{onClick:t[0]||(t[0]=(...e)=>s.itemClick&&s.itemClick(...e)),onTouchstart:t[1]||(t[1]=(...e)=>s.touchstart&&s.touchstart(...e)),onDblclick:t[2]||(t[2]=(...e)=>s.next&&s.next(...e)),role:`button`,tabindex:`0`,"aria-label":n.name,"aria-selected":e.selected==n.url,key:n.name,"data-url":n.url},G(n.name),41,gv))),128))]),M(`p`,null,[H(G(e.$t(`prompts.currentlyNavigating`))+` `,1),M(`code`,null,G(s.nav),1),t[3]||(t[3]=H(`. `,-1))])])}var vv=Q(mv,[[`render`,_v]]);function yv(e,t){t??(t=[]);let n=[],r=e[0].fullPath!==void 0;function i(e){for(let n of t)if(n.name==e)return n;return null}for(let t=0;t1)continue}let s=i(o);s!=null&&n.push({index:t,name:s.path,origin:{lastModified:a.modified||a.file?.lastModified,size:a.size},dest:{lastModified:s.modified,size:s.size},checked:[`origin`]})}return n}function bv(e){return new Promise(t=>{let n=0,r=[];if(e.items)for(let t=0;t{n--,r.push({file:e,name:e.name,size:e.size,isDir:!1,fullPath:`${i}${e.name}`}),n===0&&t(r)});else if(e.isDirectory){let t={isDir:!0,size:0,fullPath:`${i}${e.name}`,name:e.name};r.push(t),a(e.createReader(),`${i}${e.name}`)}}function a(e,o){n++,e.readEntries(s=>{if(n--,s.length>0){for(let e of s)i(e,`${o}/`);a(e,`${o}/`)}n===0&&t(r)})}})}function xv(e){return e.startsWith(`video`)?`video`:e.startsWith(`audio`)?`audio`:e.startsWith(`image`)?`image`:e.startsWith(`pdf`)?`pdf`:e.startsWith(`text`)?`text`:`blob`}function Sv(e,t,n=!1){let r=tg();X().closeHovers();for(let i of e){let e=t;i.fullPath===void 0?e+=kd.encodeRFC5987ValueChars(i.name):e+=kd.encodePath(i.fullPath),i.isDir&&(e+=`/`);let a=i.isDir?`dir`:xv(i.file.type);r.upload(e,i.name,i.file??null,i.overwrite||n,a)}}var Cv={name:`move`,components:{FileList:vv},data:function(){return{current:window.location.pathname,dest:null}},inject:[`$showError`],computed:{...Qr(Z,[`req`,`selected`]),...Qr(hd,[`user`]),...ei(Z,[`reload`,`preselect`]),excludedFolders(){return this.selected.filter(e=>this.req.items[e].isDir).map(e=>this.req.items[e].url)}},methods:{...$r(X,[`showHover`,`closeHovers`]),move:async function(e){e.preventDefault();let t=[];for(let e of this.selected)t.push({from:this.req.items[e].url,to:this.dest+encodeURIComponent(this.req.items[e].name),name:this.req.items[e].name,size:this.req.items[e].size,modified:this.req.items[e].modified,overwrite:!1,rename:!1});let n=async(e,n)=>{Qh.loading(`move`),await wh(t,e,n).then(()=>{Qh.success(`move`),this.preselect=Nd(t[0].to),this.user.redirectAfterCopyMove?this.$router.push({path:this.dest}):this.reload=!0}).catch(e=>{Qh.done(`move`),this.$showError(e)})},r=(await gh(this.dest)).items,i=yv(t,r);if(i.length>0){this.showHover({prompt:`resolve-conflict`,props:{conflict:i,files:t},confirm:(e,r)=>{e.preventDefault(),this.closeHovers();for(let e=r.length-1;e>=0;e--){let n=r[e];n.checked.length==2?t[n.index].rename=!0:n.checked.length==1&&n.checked[0]==`origin`?t[n.index].overwrite=!0:t.splice(n.index,1)}t.length>0&&n()}});return}n(!1,!1)}}},wv={class:`card floating`},Tv={class:`card-title`},Ev={class:`card-content`},Dv={class:`card-action`,style:{display:`flex`,"align-items":`center`,"justify-content":`space-between`}},Ov=[`aria-label`,`title`],kv=[`aria-label`,`title`],Av=[`disabled`,`aria-label`,`title`];function jv(e,t,n,r,i,s){let c=w(`file-list`);return a(),o(`div`,wv,[M(`div`,Tv,[M(`h2`,null,G(e.$t(`prompts.move`)),1)]),M(`div`,Ev,[M(`p`,null,G(e.$t(`prompts.moveMessage`)),1),x(c,{ref:`fileList`,"onUpdate:selected":t[0]||(t[0]=t=>e.dest=t),exclude:s.excludedFolders,tabindex:`1`},null,8,[`exclude`])]),M(`div`,Dv,[e.user.perm.create?(a(),o(`button`,{key:0,class:`button button--flat`,onClick:t[1]||(t[1]=t=>e.$refs.fileList.createDir()),"aria-label":e.$t(`sidebar.newFolder`),title:e.$t(`sidebar.newFolder`),style:{"justify-self":`left`}},[M(`span`,null,G(e.$t(`sidebar.newFolder`)),1)],8,Ov)):b(``,!0),M(`div`,null,[M(`button`,{class:`button button--flat button--grey`,onClick:t[2]||(t[2]=(...t)=>e.closeHovers&&e.closeHovers(...t)),"aria-label":e.$t(`buttons.cancel`),title:e.$t(`buttons.cancel`),tabindex:`3`},G(e.$t(`buttons.cancel`)),9,kv),M(`button`,{id:`focus-prompt`,class:`button button--flat`,onClick:t[3]||(t[3]=(...e)=>s.move&&s.move(...e)),disabled:e.$route.path===e.dest,"aria-label":e.$t(`buttons.move`),title:e.$t(`buttons.move`),tabindex:`2`},G(e.$t(`buttons.move`)),9,Av)])])])}var Mv=Q(Cv,[[`render`,jv]]),Nv={name:`copy`,components:{FileList:vv},data:function(){return{current:window.location.pathname,dest:null}},inject:[`$showError`],computed:{...Qr(Z,[`req`,`selected`]),...Qr(hd,[`user`]),...ei(Z,[`reload`,`preselect`])},methods:{...$r(X,[`showHover`,`closeHovers`]),copy:async function(e){e.preventDefault();let t=[];for(let e of this.selected)t.push({from:this.req.items[e].url,to:this.dest+encodeURIComponent(this.req.items[e].name),name:this.req.items[e].name,size:this.req.items[e].size,modified:this.req.items[e].modified,overwrite:!1,rename:this.$route.path===this.dest});let n=async(e,n)=>{Qh.loading(`copy`),await Th(t,e,n).then(()=>{if(Qh.success(`copy`),this.preselect=Nd(t[0].to),this.$route.path===this.dest){this.reload=!0;return}this.user.redirectAfterCopyMove&&this.$router.push({path:this.dest})}).catch(e=>{Qh.done(`copy`),this.$showError(e)})},r=(await gh(this.dest)).items,i=yv(t,r);if(i.length>0){this.showHover({prompt:`resolve-conflict`,props:{conflict:i},confirm:(e,r)=>{e.preventDefault(),this.closeHovers();for(let e=r.length-1;e>=0;e--){let n=r[e];n.checked.length==2?t[n.index].rename=!0:n.checked.length==1&&n.checked[0]==`origin`?t[n.index].overwrite=!0:t.splice(n.index,1)}t.length>0&&n()}});return}n(!1,!1)}}},Pv={class:`card floating`},Fv={class:`card-title`},Iv={class:`card-content`},Lv={class:`card-action`,style:{display:`flex`,"align-items":`center`,"justify-content":`space-between`}},Rv=[`aria-label`,`title`],zv=[`aria-label`,`title`],Bv=[`aria-label`,`title`];function Vv(e,t,n,r,i,s){let c=w(`file-list`);return a(),o(`div`,Pv,[M(`div`,Fv,[M(`h2`,null,G(e.$t(`prompts.copy`)),1)]),M(`div`,Iv,[M(`p`,null,G(e.$t(`prompts.copyMessage`)),1),x(c,{ref:`fileList`,"onUpdate:selected":t[0]||(t[0]=t=>e.dest=t),tabindex:`1`},null,512)]),M(`div`,Lv,[e.user.perm.create?(a(),o(`button`,{key:0,class:`button button--flat`,onClick:t[1]||(t[1]=t=>e.$refs.fileList.createDir()),"aria-label":e.$t(`sidebar.newFolder`),title:e.$t(`sidebar.newFolder`),style:{"justify-self":`left`}},[M(`span`,null,G(e.$t(`sidebar.newFolder`)),1)],8,Rv)):b(``,!0),M(`div`,null,[M(`button`,{class:`button button--flat button--grey`,onClick:t[2]||(t[2]=(...t)=>e.closeHovers&&e.closeHovers(...t)),"aria-label":e.$t(`buttons.cancel`),title:e.$t(`buttons.cancel`),tabindex:`3`},G(e.$t(`buttons.cancel`)),9,zv),M(`button`,{id:`focus-prompt`,class:`button button--flat`,onClick:t[3]||(t[3]=(...e)=>s.copy&&s.copy(...e)),"aria-label":e.$t(`buttons.copy`),title:e.$t(`buttons.copy`),tabindex:`2`},G(e.$t(`buttons.copy`)),9,Bv)])])])}var Hv=Q(Nv,[[`render`,Vv]]),Uv={class:`path-item`},Wv={key:0,class:`material-icons`},Gv={key:1,class:`material-icons`},Kv=Q(s({__name:`CreateFilePath`,props:{name:{type:String,required:!0},isDir:{type:Boolean,default:!1},path:{type:String,default:null}},setup(e){let t=Z(),n=yi(),r=e,i=z(null),s=W(()=>{let e=r.path||n.path,i=t.isFiles?e:kd.removeLastDir(e);return i.endsWith(`/`)||(i+=`/`),i+=r.name,i.split(`/`).filter(Boolean).splice(1)});return T(s,()=>{_(()=>{(i.value?.lastElementChild)?.scrollIntoView({behavior:`auto`,inline:`end`})})}),(t,n)=>(a(),o(`div`,null,[M(`div`,{class:`path-container`,ref_key:`container`,ref:i},[(a(!0),o(P,null,d(s.value,(t,r)=>(a(),o(P,{key:r},[n[0]||(n[0]=H(` / `,-1)),M(`span`,Uv,[e.isDir===!0||r{if(e.preventDefault(),u.value===``)return;let r=n.isFiles?s.path+`/`:`/`;n.isListing||(r=kd.removeLastDir(r)+`/`),r+=encodeURIComponent(u.value),r=r.replace(`//`,`/`);try{await xh(r),c.push({path:r})}catch(e){e instanceof Error&&t(e)}i.closeHovers()};return(e,t)=>(a(),o(`div`,qv,[M(`div`,Jv,[M(`h2`,null,G(F(l)(`prompts.newFile`)),1)]),M(`div`,Yv,[M(`p`,null,G(F(l)(`prompts.newFileMessage`)),1),r(M(`input`,{id:`focus-prompt`,class:`input input--block`,type:`text`,onKeyup:se(d,[`enter`]),"onUpdate:modelValue":t[0]||(t[0]=e=>u.value=e)},null,544),[[N,u.value,void 0,{trim:!0}]]),x(Kv,{name:u.value},null,8,[`name`])]),M(`div`,Xv,[M(`button`,{class:`button button--flat button--grey`,onClick:t[1]||(t[1]=(...e)=>F(i).closeHovers&&F(i).closeHovers(...e)),"aria-label":F(l)(`buttons.cancel`),title:F(l)(`buttons.cancel`)},G(F(l)(`buttons.cancel`)),9,Zv),M(`button`,{class:`button button--flat`,onClick:d,"aria-label":F(l)(`buttons.create`),title:F(l)(`buttons.create`)},G(F(l)(`buttons.create`)),9,Qv)])]))}}),ey={class:`card floating`},ty={class:`card-title`},ny={class:`card-content`},ry={class:`card-action`},iy=[`aria-label`,`title`],ay=[`aria-label`,`title`],oy=s({__name:`NewDir`,setup(e){let t=L(`$showError`),n=Z(),i=X(),s=W(()=>i.currentPrompt?.props?.base),c=yi(),l=vi(),{t:u}=B(),d=z(``),f=async e=>{if(e.preventDefault(),d.value===``)return;let r;r=s.value?s.value:n.isFiles?c.path+`/`:`/`,n.isListing||(r=kd.removeLastDir(r)+`/`),r+=encodeURIComponent(d.value)+`/`,r=r.replace(`//`,`/`);try{if(await xh(r),i.currentPrompt?.props?.redirect)l.push({path:r});else if(!s.value){let e=await gh(kd.removeLastDir(r)+`/`);n.updateRequest(e)}i.currentPrompt?.confirm&&i.currentPrompt?.confirm(r)}catch(e){e instanceof Error&&t(e)}i.closeHovers()};return(e,t)=>(a(),o(`div`,ey,[M(`div`,ty,[M(`h2`,null,G(F(u)(`prompts.newDir`)),1)]),M(`div`,ny,[M(`p`,null,G(F(u)(`prompts.newDirMessage`)),1),r(M(`input`,{id:`focus-prompt`,class:`input input--block`,type:`text`,onKeyup:se(f,[`enter`]),"onUpdate:modelValue":t[0]||(t[0]=e=>d.value=e),tabindex:`1`},null,544),[[N,d.value,void 0,{trim:!0}]]),x(Kv,{name:d.value,"is-dir":!0,path:s.value},null,8,[`name`,`path`])]),M(`div`,ry,[M(`button`,{class:`button button--flat button--grey`,onClick:t[1]||(t[1]=(...e)=>F(i).closeHovers&&F(i).closeHovers(...e)),"aria-label":F(u)(`buttons.cancel`),title:F(u)(`buttons.cancel`),tabindex:`3`},G(F(u)(`buttons.cancel`)),9,iy),M(`button`,{class:`button button--flat`,"aria-label":e.$t(`buttons.create`),title:F(u)(`buttons.create`),onClick:f,tabindex:`2`},G(F(u)(`buttons.create`)),9,ay)])]))}}),sy={name:`replace`,computed:{...Qr(X,[`currentPrompt`])},methods:{...$r(X,[`closeHovers`])}},cy={class:`card floating`},ly={class:`card-title`},uy={class:`card-content`},dy={class:`card-action`},fy=[`aria-label`,`title`],py=[`aria-label`,`title`],my=[`aria-label`,`title`];function hy(e,t,n,r,i,s){return a(),o(`div`,cy,[M(`div`,ly,[M(`h2`,null,G(e.$t(`prompts.replace`)),1)]),M(`div`,uy,[M(`p`,null,G(e.$t(`prompts.replaceMessage`)),1)]),M(`div`,dy,[M(`button`,{class:`button button--flat button--grey`,onClick:t[0]||(t[0]=(...t)=>e.closeHovers&&e.closeHovers(...t)),"aria-label":e.$t(`buttons.cancel`),title:e.$t(`buttons.cancel`),tabindex:`3`},G(e.$t(`buttons.cancel`)),9,fy),M(`button`,{class:`button button--flat button--blue`,onClick:t[1]||(t[1]=(...t)=>e.currentPrompt.action&&e.currentPrompt.action(...t)),"aria-label":e.$t(`buttons.continue`),title:e.$t(`buttons.continue`),tabindex:`2`},G(e.$t(`buttons.continue`)),9,py),M(`button`,{id:`focus-prompt`,class:`button button--flat button--red`,onClick:t[2]||(t[2]=(...t)=>e.currentPrompt.confirm&&e.currentPrompt.confirm(...t)),"aria-label":e.$t(`buttons.replace`),title:e.$t(`buttons.replace`),tabindex:`1`},G(e.$t(`buttons.replace`)),9,my)])])}var gy=Q(sy,[[`render`,hy]]);function _y(e,t){return new Promise((n,r)=>{if(window.isSecureContext&&navigator.clipboard!==void 0)t?.permission?yy(`clipboard-write`).then(()=>by(e).then(n).catch(r)).catch(r):by(e).then(n).catch(r);else if(document.queryCommandSupported&&document.queryCommandSupported(`copy`)&&e.text){let t=Sy(e.text),i=document.activeElement||document.body;try{i.appendChild(t),t.focus(),t.select(),document.execCommand(`copy`),n()}catch(e){r(e)}finally{i.removeChild(t)}}else r(Error(`None of copying methods are supported by this browser!`))})}function vy(){return new Promise((e,t)=>{window.isSecureContext&&navigator.clipboard!==void 0?navigator.clipboard.readText().then(e).catch(t):t()})}function yy(e){return new Promise((t,n)=>{navigator.permissions!==void 0&&navigator.permissions.query({name:e}).then(e=>{e.state===`granted`||e.state===`prompt`?t():n(Error(`Permission denied!`))})})}function by(e){return e.text?navigator.clipboard.writeText(e.text):e.data?navigator.clipboard.write(e.data):new Promise((e,t)=>{t(Error(`No data was supplied!`))})}var xy={fontSize:`12pt`,position:`fixed`,top:0,left:0,width:`2em`,height:`2em`,padding:0,margin:0,border:`none`,outline:`none`,boxShadow:`none`,background:`transparent`};function Sy(e){let t=document.createElement(`textarea`);return t.value=e,t.setAttribute(`readonly`,``),Object.assign(t.style,xy),t}var Cy={name:`share`,data:function(){return{time:0,unit:`hours`,links:[],clip:null,password:``,listing:!0}},inject:[`$showError`,`$showSuccess`],computed:{...Qr(Z,[`req`,`selected`,`selectedCount`,`isListing`]),url(){if(!this.isListing)return this.$route.path;if(!(this.selectedCount===0||this.selectedCount>1))return this.req.items[this.selected[0]].url}},async beforeMount(){try{this.links=await Mh(this.url),this.sort(),this.links.length==0&&(this.listing=!1)}catch(e){this.$showError(e)}},methods:{...$r(X,[`closeHovers`]),copyToClipboard:function(e){_y({text:e}).then(()=>{this.$showSuccess(this.$t(`success.linkCopied`))},()=>{_y({text:e},{permission:!0}).then(()=>{this.$showSuccess(this.$t(`success.linkCopied`))},e=>{this.$showError(e)})})},submit:async function(){try{let e=null;e=this.time?await Ph(this.url,this.password,this.time,this.unit):await Ph(this.url,this.password),this.links.push(e),this.sort(),this.time=0,this.unit=`hours`,this.password=``,this.listing=!0}catch(e){this.$showError(e)}},deleteLink:async function(e,t){e.preventDefault();try{await Nh(t.hash),this.links=this.links.filter(e=>e.hash!==t.hash),this.links.length==0&&(this.listing=!1)}catch(e){this.$showError(e)}},humanTime(e){return(0,T_.default)(e*1e3).fromNow()},buildLink(e){return Fh(e)},buildDownloadLink(e){return Gh({hash:e.hash,path:``},!0)},sort(){this.links=this.links.sort((e,t)=>e.expire===0?-1:t.expire===0?1:new Date(e.expire)-new Date(t.expire))},switchListing(){this.links.length==0&&!this.listing&&this.closeHovers(),this.listing=!this.listing}}},wy={class:`card floating`,id:`share`},Ty={class:`card-title`},Ey={class:`card-content`},Dy={class:`small`},Oy=[`aria-label`,`title`,`onClick`],ky={class:`small`},Ay=[`aria-label`,`title`,`disabled`,`onClick`],jy={class:`small`},My=[`onClick`,`aria-label`,`title`],Ny={class:`card-action`},Py=[`aria-label`,`title`],Fy=[`aria-label`,`title`],Iy={class:`card-content`},Ly={class:`input-group input`},Ry=[`aria-label`],zy={value:`seconds`},By={value:`minutes`},Vy={value:`hours`},Hy={value:`days`},Uy={class:`card-action`},Wy=[`aria-label`,`title`],Gy=[`aria-label`,`title`];function Ky(e,t,n,i,s,c){let l=w(`vue-number-input`);return a(),o(`div`,wy,[M(`div`,Ty,[M(`h2`,null,G(e.$t(`buttons.share`)),1)]),e.listing?(a(),o(P,{key:0},[M(`div`,Ey,[M(`table`,null,[M(`tr`,null,[t[7]||(t[7]=M(`th`,null,`#`,-1)),M(`th`,null,G(e.$t(`settings.shareDuration`)),1),t[8]||(t[8]=M(`th`,null,null,-1)),t[9]||(t[9]=M(`th`,null,null,-1)),t[10]||(t[10]=M(`th`,null,null,-1))]),(a(!0),o(P,null,d(e.links,n=>(a(),o(`tr`,{key:n.hash},[M(`td`,null,G(n.hash),1),M(`td`,null,[n.expire===0?(a(),o(P,{key:1},[H(G(e.$t(`permanent`)),1)],64)):(a(),o(P,{key:0},[H(G(c.humanTime(n.expire)),1)],64))]),M(`td`,Dy,[M(`button`,{class:`action`,"aria-label":e.$t(`buttons.copyToClipboard`),title:e.$t(`buttons.copyToClipboard`),onClick:e=>c.copyToClipboard(c.buildLink(n))},[...t[11]||(t[11]=[M(`i`,{class:`material-icons`},`content_paste`,-1)])],8,Oy)]),M(`td`,ky,[M(`button`,{class:`action`,"aria-label":e.$t(`buttons.copyDownloadLinkToClipboard`),title:e.$t(`buttons.copyDownloadLinkToClipboard`),disabled:!!n.password_hash,onClick:e=>c.copyToClipboard(c.buildDownloadLink(n))},[...t[12]||(t[12]=[M(`i`,{class:`material-icons`},`content_paste_go`,-1)])],8,Ay)]),M(`td`,jy,[M(`button`,{class:`action`,onClick:e=>c.deleteLink(e,n),"aria-label":e.$t(`buttons.delete`),title:e.$t(`buttons.delete`)},[...t[13]||(t[13]=[M(`i`,{class:`material-icons`},`delete`,-1)])],8,My)])]))),128))])]),M(`div`,Ny,[M(`button`,{class:`button button--flat button--grey`,onClick:t[0]||(t[0]=(...t)=>e.closeHovers&&e.closeHovers(...t)),"aria-label":e.$t(`buttons.close`),title:e.$t(`buttons.close`),tabindex:`2`},G(e.$t(`buttons.close`)),9,Py),M(`button`,{id:`focus-prompt`,class:`button button--flat button--blue`,onClick:t[1]||(t[1]=()=>c.switchListing()),"aria-label":e.$t(`buttons.new`),title:e.$t(`buttons.new`),tabindex:`1`},G(e.$t(`buttons.new`)),9,Fy)])],64)):(a(),o(P,{key:1},[M(`div`,Iy,[M(`p`,null,G(e.$t(`settings.shareDuration`)),1),M(`div`,Ly,[x(l,{center:``,controls:``,size:`small`,max:2147483647,min:0,onKeyup:se(c.submit,[`enter`]),modelValue:e.time,"onUpdate:modelValue":t[2]||(t[2]=t=>e.time=t),tabindex:`1`},null,8,[`onKeyup`,`modelValue`]),r(M(`select`,{class:`right`,"onUpdate:modelValue":t[3]||(t[3]=t=>e.unit=t),"aria-label":e.$t(`time.unit`),tabindex:`2`},[M(`option`,zy,G(e.$t(`time.seconds`)),1),M(`option`,By,G(e.$t(`time.minutes`)),1),M(`option`,Vy,G(e.$t(`time.hours`)),1),M(`option`,Hy,G(e.$t(`time.days`)),1)],8,Ry),[[te,e.unit]])]),M(`p`,null,G(e.$t(`prompts.optionalPassword`)),1),r(M(`input`,{class:`input input--block`,type:`password`,"onUpdate:modelValue":t[4]||(t[4]=t=>e.password=t),tabindex:`3`},null,512),[[N,e.password,void 0,{trim:!0}]])]),M(`div`,Uy,[M(`button`,{class:`button button--flat button--grey`,onClick:t[5]||(t[5]=()=>c.switchListing()),"aria-label":e.$t(`buttons.cancel`),title:e.$t(`buttons.cancel`),tabindex:`5`},G(e.$t(`buttons.cancel`)),9,Wy),M(`button`,{id:`focus-prompt`,class:`button button--flat button--blue`,onClick:t[6]||(t[6]=(...e)=>c.submit&&c.submit(...e)),"aria-label":e.$t(`buttons.share`),title:e.$t(`buttons.share`),tabindex:`4`},G(e.$t(`buttons.share`)),9,Gy)])],64))])}var qy=Q(Cy,[[`render`,Ky]]),Jy={name:`share-delete`,computed:{...Qr(X,[`currentPrompt`])},methods:{...$r(X,[`closeHovers`]),submit:function(){this.currentPrompt?.confirm()}}},Yy={class:`card floating`},Xy={class:`card-content`},Zy={class:`card-action`},Qy=[`aria-label`,`title`],$y=[`aria-label`,`title`];function eb(e,t,n,r,i,s){return a(),o(`div`,Yy,[M(`div`,Xy,[M(`p`,null,G(e.$t(`prompts.deleteMessageShare`,{path:``})),1)]),M(`div`,Zy,[M(`button`,{onClick:t[0]||(t[0]=(...t)=>e.closeHovers&&e.closeHovers(...t)),class:`button button--flat button--grey`,"aria-label":e.$t(`buttons.cancel`),title:e.$t(`buttons.cancel`),tabindex:`2`},G(e.$t(`buttons.cancel`)),9,Qy),M(`button`,{id:`focus-prompt`,onClick:t[1]||(t[1]=(...e)=>s.submit&&s.submit(...e)),class:`button button--flat button--red`,"aria-label":e.$t(`buttons.delete`),title:e.$t(`buttons.delete`),tabindex:`1`},G(e.$t(`buttons.delete`)),9,$y)])])}var tb=Q(Jy,[[`render`,eb]]),nb={class:`card floating`},rb={class:`card-title`},ib={class:`card-content`},ab={class:`card-action full`},ob={class:`title`},sb={class:`title`},cb=s({__name:`Upload`,setup(e){let{t}=B(),n=yi(),r=Z(),i=X(),s=e=>{let t=e.currentTarget?.files;if(t===null)return;let a=!!t[0].webkitRelativePath,o=[];for(let e=0;e0){i.showHover({prompt:`resolve-conflict`,props:{conflict:c,isUploadAction:!0},confirm:(e,t)=>{e.preventDefault(),i.closeHovers();for(let e=t.length-1;e>=0;e--){let n=t[e];n.checked.length!=2&&(n.checked.length==1&&n.checked[0]==`origin`?o[n.index].overwrite=!0:o.splice(n.index,1))}o.length>0&&Sv(o,s)}});return}Sv(o,s)},c=e=>{let t=document.createElement(`input`);t.type=`file`,t.multiple=!0,t.webkitdirectory=e,t.onchange=s,t.click()},l=()=>{c(!1)},u=()=>{c(!0)};return(e,n)=>(a(),o(`div`,nb,[M(`div`,rb,[M(`h2`,null,G(F(t)(`prompts.upload`)),1)]),M(`div`,ib,[M(`p`,null,G(F(t)(`prompts.uploadMessage`)),1)]),M(`div`,ab,[M(`div`,{onClick:l,onKeypress:se(l,[`enter`]),class:`action`,id:`focus-prompt`,tabindex:`1`},[n[0]||(n[0]=M(`i`,{class:`material-icons`},`insert_drive_file`,-1)),M(`div`,ob,G(F(t)(`buttons.file`)),1)],32),M(`div`,{onClick:u,onKeypress:se(u,[`enter`]),class:`action`,tabindex:`2`},[n[1]||(n[1]=M(`i`,{class:`material-icons`},`folder`,-1)),M(`div`,sb,G(F(t)(`buttons.folder`)),1)],32)])]))}}),lb={name:`discardEditorChanges`,computed:{...Qr(X,[`currentPrompt`])},methods:{...$r(X,[`closeHovers`])}},ub={class:`card floating`},db={class:`card-content`},fb={class:`card-action`},pb=[`aria-label`,`title`],mb=[`aria-label`,`title`],hb=[`aria-label`,`title`];function gb(e,t,n,r,i,s){return a(),o(`div`,ub,[M(`div`,db,[M(`p`,null,G(e.$t(`prompts.discardEditorChanges`)),1)]),M(`div`,fb,[M(`button`,{class:`button button--flat button--grey`,onClick:t[0]||(t[0]=(...t)=>e.closeHovers&&e.closeHovers(...t)),"aria-label":e.$t(`buttons.cancel`),title:e.$t(`buttons.cancel`),tabindex:`3`},G(e.$t(`buttons.cancel`)),9,pb),M(`button`,{class:`button button--flat button--blue`,onClick:t[1]||(t[1]=(...t)=>e.currentPrompt.saveAction&&e.currentPrompt.saveAction(...t)),"aria-label":e.$t(`buttons.saveChanges`),title:e.$t(`buttons.saveChanges`),tabindex:`1`},G(e.$t(`buttons.saveChanges`)),9,mb),M(`button`,{id:`focus-prompt`,onClick:t[2]||(t[2]=(...t)=>e.currentPrompt.confirm&&e.currentPrompt.confirm(...t)),class:`button button--flat button--red`,"aria-label":e.$t(`buttons.discardChanges`),title:e.$t(`buttons.discardChanges`),tabindex:`2`},G(e.$t(`buttons.discardChanges`)),9,hb)])])}var _b=Q(lb,[[`render`,gb]]),vb={class:`card floating`},yb={class:`card-title`},bb={class:`card-content`},xb={key:0},Sb={class:`conflict-list-container`},Cb=[`checked`],wb=[`checked`],Tb={class:`conflict-file-name`},Eb={key:0,class:`result-rename`},Db={key:1,class:`result-error`},Ob={key:1,class:`result-override`},kb={key:2,class:`result-skip`},Ab=[`onUpdate:modelValue`],jb={class:`conflict-file-value`},Mb={class:`conflict-file-value`},Nb=[`onUpdate:modelValue`],Pb={class:`conflict-file-value`},Fb={class:`conflict-file-value`},Ib={class:`result-buttons`},Lb={class:`card-action`,style:{display:`flex`,"justify-content":`end`}},Rb=[`aria-label`,`title`],zb=[`aria-label`,`title`],Bb=Q(s({__name:`ResolveConflict`,setup(e){let t=X(),{currentPrompt:n}=t,i=z(n?.props.conflict),s=z(n?.props.isUploadAction),c=z(!1),l=W(()=>{for(let e of i.value)if(!e.checked.includes(`origin`))return!1;return!0}),u=W(()=>{for(let e of i.value)if(!e.checked.includes(`dest`))return!1;return!0}),f=()=>{t.closeHovers()},p=e=>e==null?`Unknown size`:C_(e),m=e=>e==null?`Unknown date`:(0,T_.default)(e).format(`L LT`),h=(e,t)=>{for(let e of i.value)e.checked=t;n?.confirm(e,i.value)},g=e=>{let t=e.currentTarget,n=t.value,r=t.checked;for(let e of i.value)n==`both`?e.checked=[`origin`,`dest`]:e.checked.includes(n)?r||(e.checked=n==`dest`?[`origin`]:[`dest`]):r&&e.checked.push(n)};return(e,t)=>(a(),o(`div`,vb,[M(`div`,yb,[M(`h2`,null,G(c.value?e.$t(`prompts.resolveConflict`):e.$t(`prompts.replaceOrSkip`)),1)]),M(`div`,bb,[c.value?(a(),o(P,{key:0},[s.value==1?b(``,!0):(a(),o(`p`,xb,G(e.$t(`prompts.singleConflictResolve`)),1)),M(`div`,Sb,[M(`div`,null,[M(`p`,null,[M(`input`,{onChange:g,type:`checkbox`,checked:l.value,value:`origin`},null,40,Cb),H(` `+G(s.value==1?e.$t(`prompts.uploadingFiles`):e.$t(`prompts.filesInOrigin`)),1)]),M(`p`,null,[M(`input`,{onChange:g,type:`checkbox`,checked:u.value,value:`dest`},null,40,wb),H(` `+G(e.$t(`prompts.filesInDest`)),1)])]),M(`div`,null,[(a(!0),o(P,null,d(i.value,(t,n)=>(a(),o(P,{key:n},[M(`div`,Tb,[M(`span`,null,G(t.name),1),t.checked.length==2?(a(),o(P,{key:0},[s.value==1?(a(),o(`span`,Db,G(e.$t(`prompts.forbiddenError`)),1)):(a(),o(`span`,Eb,G(e.$t(`prompts.rename`)),1))],64)):t.checked.length==1&&t.checked[0]==`origin`?(a(),o(`span`,Ob,G(e.$t(`prompts.override`)),1)):(a(),o(`span`,kb,G(e.$t(`prompts.skip`)),1))]),M(`div`,null,[r(M(`input`,{"onUpdate:modelValue":e=>t.checked=e,type:`checkbox`,value:`origin`},null,8,Ab),[[V,t.checked]]),M(`div`,null,[M(`p`,jb,G(m(t.origin.lastModified)),1),M(`p`,Mb,G(p(t.origin.size)),1)])]),M(`div`,null,[r(M(`input`,{"onUpdate:modelValue":e=>t.checked=e,type:`checkbox`,value:`dest`},null,8,Nb),[[V,t.checked]]),M(`div`,null,[M(`p`,Pb,G(m(t.dest.lastModified)),1),M(`p`,Fb,G(p(t.dest.size)),1)])])],64))),128))])])],64)):(a(),o(P,{key:1},[M(`p`,null,G(e.$t(`prompts.fastConflictResolve`,{count:i.value.length})),1),M(`div`,Ib,[M(`button`,{onClick:t[0]||(t[0]=e=>h(e,[`origin`]))},[t[5]||(t[5]=M(`i`,{class:`material-icons`},`done_all`,-1)),H(` `+G(e.$t(`buttons.overrideAll`)),1)]),s.value==1?b(``,!0):(a(),o(`button`,{key:0,onClick:t[1]||(t[1]=e=>h(e,[`origin`,`dest`]))},[t[6]||(t[6]=M(`i`,{class:`material-icons`},`folder_copy`,-1)),H(` `+G(e.$t(`buttons.renameAll`)),1)])),M(`button`,{onClick:t[2]||(t[2]=e=>h(e,[`dest`]))},[t[7]||(t[7]=M(`i`,{class:`material-icons`},`undo`,-1)),H(` `+G(e.$t(`buttons.skipAll`)),1)]),M(`button`,{onClick:t[3]||(t[3]=e=>c.value=!0)},[t[8]||(t[8]=M(`i`,{class:`material-icons`},`checklist`,-1)),H(` `+G(e.$t(`buttons.singleDecision`)),1)])])],64))]),M(`div`,Lb,[M(`div`,null,[M(`button`,{class:`button button--flat button--grey`,onClick:f,"aria-label":e.$t(`buttons.cancel`),title:e.$t(`buttons.cancel`),tabindex:`4`},G(e.$t(`buttons.cancel`)),9,Rb),c.value?(a(),o(`button`,{key:0,id:`focus-prompt`,class:`button button--flat`,onClick:t[4]||(t[4]=e=>F(n)?.confirm(e,i.value)),"aria-label":e.$t(`buttons.ok`),title:e.$t(`buttons.ok`),tabindex:`1`},G(e.$t(`buttons.ok`)),9,zb)):b(``,!0)])])]))}}),[[`__scopeId`,`data-v-eeccf995`]]),Vb={class:`card floating`},Hb={class:`card-title`},Ub={class:`card-content`},Wb={class:`card-action`},Gb=[`aria-label`,`title`],Kb=[`aria-label`,`title`],qb=s({__name:`CurrentPassword`,setup(e){let t=X(),{currentPrompt:n}=t,i=z(``),s=e=>{n?.confirm(e,i.value)},c=()=>{t.closeHovers()};return(e,t)=>(a(),o(`div`,Vb,[M(`div`,Hb,[M(`h2`,null,G(e.$t(`prompts.currentPassword`)),1)]),M(`div`,Ub,[M(`p`,null,G(e.$t(`prompts.currentPasswordMessage`)),1),r(M(`input`,{id:`focus-prompt`,class:`input input--block`,type:`password`,onKeyup:se(s,[`enter`]),"onUpdate:modelValue":t[0]||(t[0]=e=>i.value=e)},null,544),[[N,i.value]])]),M(`div`,Wb,[M(`button`,{class:`button button--flat button--grey`,onClick:c,"aria-label":e.$t(`buttons.cancel`),title:e.$t(`buttons.cancel`)},G(e.$t(`buttons.cancel`)),9,Gb),M(`button`,{onClick:s,class:`button button--flat`,type:`submit`,"aria-label":e.$t(`buttons.ok`),title:e.$t(`buttons.ok`)},G(e.$t(`buttons.ok`)),9,Kb)])]))}}),Jb=s({__name:`Prompts`,setup(e){let t=X(),{currentPromptName:n}=ti(t),r=new Map([[`info`,R_],[`help`,Bg],[`delete`,J_],[`rename`,pv],[`move`,Mv],[`copy`,Hv],[`newFile`,$v],[`newDir`,oy],[`download`,iv],[`replace`,gy],[`share`,qy],[`upload`,cb],[`share-delete`,tb],[`deleteUser`,$_],[`discardEditorChanges`,_b],[`resolve-conflict`,Bb],[`current-password`,qb]]),i=W(()=>r.get(n.value)),o=()=>{t.currentPrompt&&t.closeHovers()};return(e,t)=>i.value==null?b(``,!0):(a(),U(Mg,{key:0,prompt:F(n),onClosed:o},{default:v(()=>[(a(),U(O,null,[(a(),U(p(i.value)))],1024))]),_:1},8,[`prompt`]))}}),Yb={name:`shell`,computed:{...Qr(X,[`showShell`]),...Qr(Z,[`isFiles`]),path:function(){return this.isFiles?this.$route.path:``}},data:()=>({content:[],history:[],historyPos:0,canInput:!0,shellDrag:!1,shellHeight:25,fontsize:parseFloat(getComputedStyle(document.documentElement).fontSize)}),mounted(){window.addEventListener(`resize`,this.resize)},beforeUnmount(){window.removeEventListener(`resize`,this.resize)},methods:{...$r(X,[`toggleShell`]),checkTheme(){return He==`dark`?`rgba(255, 255, 255, 0.4)`:`rgba(127, 127, 127, 0.4)`},startDrag(){document.addEventListener(`pointermove`,this.handleDrag),this.shellDrag=!0},stopDrag(){document.removeEventListener(`pointermove`,this.handleDrag),this.shellDrag=!1},handleDrag:md(function(e){let t=window.innerHeight/this.fontsize-4,n=(window.innerHeight-e.clientY)/this.fontsize,r=2.25+document.querySelector(`.shell__divider`).offsetHeight/this.fontsize;n<=t&&n>=r&&(this.shellHeight=n.toFixed(2))},32),resize:md(function(){let e=window.innerHeight/this.fontsize-4,t=2.25+document.querySelector(`.shell__divider`).offsetHeight/this.fontsize;this.shellHeight>e?this.shellHeight=e:this.shellHeight0&&(this.$refs.input.innerText=this.history[--this.historyPos],this.focus())},historyDown(){this.historyPos>=0&&this.historyPos{n.text+=`${e.data}\n`,this.scroll()},()=>{n.text=n.text.replace(/\u001b\[[0-9;]+m/g,``).trimEnd(),this.canInput=!0,this.$refs.input.focus(),this.scroll()})}}},Xb={class:`shell__text`};function Zb(e,t,n,i,s,c){return a(),o(`div`,{class:k([`shell`,{"shell--hidden":!e.showShell}]),style:Se({height:`${this.shellHeight}em`,direction:`ltr`})},[M(`div`,{onPointerdown:t[0]||(t[0]=e=>c.startDrag()),onPointerup:t[1]||(t[1]=e=>c.stopDrag()),class:`shell__divider`,style:Se(this.shellDrag?{background:`${c.checkTheme()}`}:``)},null,36),M(`div`,{onClick:t[5]||(t[5]=(...e)=>c.focus&&c.focus(...e)),class:`shell__content`,ref:`scrollable`},[(a(!0),o(P,null,d(e.content,(e,n)=>(a(),o(`div`,{key:n,class:`shell__result`},[t[7]||(t[7]=M(`div`,{class:`shell__prompt`},[M(`i`,{class:`material-icons`},`chevron_right`)],-1)),M(`pre`,Xb,G(e.text),1)]))),128)),M(`div`,{class:k([`shell__result`,{"shell__result--hidden":!e.canInput}])},[t[8]||(t[8]=M(`div`,{class:`shell__prompt`},[M(`i`,{class:`material-icons`},`chevron_right`)],-1)),M(`pre`,{tabindex:`0`,ref:`input`,class:`shell__text`,contenteditable:!0,onKeydown:[t[2]||(t[2]=se(ie((...e)=>c.historyUp&&c.historyUp(...e),[`prevent`]),[`arrow-up`])),t[3]||(t[3]=se(ie((...e)=>c.historyDown&&c.historyDown(...e),[`prevent`]),[`arrow-down`]))],onKeypress:t[4]||(t[4]=se(ie((...e)=>c.submit&&c.submit(...e),[`prevent`]),[`enter`]))},null,544)],2)],512),r(M(`div`,{onPointerup:t[6]||(t[6]=e=>c.stopDrag()),class:`shell__overlay`},null,544),[[pe,this.shellDrag]])],6)}var Qb=Q(Yb,[[`render`,Zb]]),$b={class:`card floating`},ex={class:`card-title`},tx={class:`upload-info`},nx={class:`upload-speed`},rx={class:`upload-eta`},ix={class:`upload-percentage`},ax={class:`upload-fraction`},ox={class:`material-icons`},sx={class:`card-content file-icons`},cx=[`data-dir`,`data-type`,`aria-label`],lx={class:`file-name`},ux={class:`file-progress`},dx=Q(s({__name:`UploadFiles`,setup(e){let{t}=B({}),n=z(!1),r=z(0),i=z(1/0),s=Z(),c=tg(),{sentBytes:l,totalBytes:u}=ti(c),f=S_({exponent:2}),p=S_({exponent:1}),m=W(()=>(c.sentBytes/c.totalBytes*100).toFixed(2)),h=W(()=>f(c.sentBytes)),g=W(()=>f(c.totalBytes)),_=W(()=>{let e=r.value;return e<1024*1024?`${parseFloat(p(e)).toFixed(2)} KB`:`${parseFloat(f(e)).toFixed(2)} MB`}),v=0,y=[],x=0,S=(e,t)=>{let n=Date.now();n-x<100||(x=n,C(e,t))},C=(e,t)=>{if(e===0){v=0,y=[],i.value=1/0,r.value=0;return}let n=(Date.now()-(v??0))/1e3,a=(e-t)/n;y.push(a),y.length>5&&y.shift();let o=y.reduce((e,t)=>e+t)/y.length;y.length===1&&(r.value=a),r.value=o*.2+r.value*.8,v=Date.now(),w()},w=()=>{if(r.value===0)return i.value=1/0,1/0;i.value=(c.totalBytes-c.sentBytes)/r.value};T(l,S),T(u,(e,t)=>{t===0&&(v=Date.now())});let E=W(()=>{if(!i.value||i.value===1/0)return`--:--:--`;let e=i.value,t=Math.floor(e/3600);e%=3600;let n=Math.floor(e/60),r=Math.round(e%60);return`${t.toString().padStart(2,`0`)}:${n.toString().padStart(2,`0`)}:${r.toString().padStart(2,`0`)}`}),D=()=>{n.value=!n.value},O=()=>{confirm(t(`upload.abortUpload`))&&(Qh.done(`upload`),n.value=!1,c.abort(),s.reload=!0)};return(e,t)=>F(c).activeUploads.size>0?(a(),o(`div`,{key:0,class:k([`upload-files`,{closed:!n.value}])},[M(`div`,$b,[M(`div`,ex,[M(`h2`,null,G(e.$t(`prompts.uploadFiles`,{files:F(c).pendingUploadCount})),1),M(`div`,tx,[M(`div`,nx,G(_.value)+`/s`,1),M(`div`,rx,G(E.value)+` remaining`,1),M(`div`,ix,G(m.value)+`% Completed`,1),M(`div`,ax,G(h.value)+` / `+G(g.value),1)]),M(`button`,{class:`action`,onClick:O,"aria-label":`Abort upload`,title:`Abort upload`},[...t[0]||(t[0]=[M(`i`,{class:`material-icons`},G(`cancel`),-1)])]),M(`button`,{class:`action`,onClick:D,"aria-label":`Toggle file upload list`,title:`Toggle file upload list`},[M(`i`,ox,G(n.value?`keyboard_arrow_down`:`keyboard_arrow_up`),1)])]),M(`div`,sx,[(a(!0),o(P,null,d(F(c).activeUploads,e=>(a(),o(`div`,{class:`file`,key:e.path,"data-dir":e.type===`dir`,"data-type":e.type,"aria-label":e.name},[M(`div`,lx,[t[1]||(t[1]=M(`i`,{class:`material-icons`},null,-1)),H(` `+G(e.name),1)]),M(`div`,ux,[M(`div`,{style:Se({width:e.sentBytes/e.totalBytes*100+`%`})},null,4)])],8,cx))),128))])])],2)):b(``,!0)}}),[[`__scopeId`,`data-v-1cfefb0f`]]),fx={key:0,class:`progress`},px=s({__name:`Layout`,setup(e){let t=X(),n=hd(),r=Z(),i=tg(),s=yi(),c=W(()=>(i.sentBytes/i.totalBytes*100).toFixed(2));return T(s,()=>{r.selected=[],r.multiple=!1,t.currentPromptName!==`success`&&t.closeHovers()}),(e,t)=>{let r=w(`router-view`);return a(),o(`div`,null,[F(i).totalBytes?(a(),o(`div`,fx,[M(`div`,{style:Se({width:c.value+`%`})},null,4)])):b(``,!0),x(jg),M(`main`,null,[x(r),F(Ge)&&F(n).isLoggedIn&&F(n).user?.perm.execute?(a(),U(Qb,{key:0})):b(``,!0)]),x(Jb),x(dx)])}}}),mx=[`aria-label`,`title`],hx={class:`material-icons`},gx={key:0,class:`counter`},$=s({__name:`Action`,props:{icon:{},label:{},counter:{},show:{}},emits:[`action`],setup(e,{emit:t}){let n=e,r=t,i=X(),s=()=>{n.show&&i.showHover(n.show),r(`action`)};return(t,n)=>(a(),o(`button`,{onClick:s,"aria-label":e.label,title:e.label,class:`action`},[M(`i`,hx,G(e.icon),1),M(`span`,null,G(e.label),1),e.counter&&e.counter>0?(a(),o(`span`,gx,G(e.counter),1)):b(``,!0)],8,mx))}}),_x=[`src`],vx=s({__name:`HeaderBar`,props:{showLogo:{type:Boolean},showMenu:{type:Boolean}},setup(e){let t=X(),n=E(),{t:i}=B(),s=W(()=>!!n.actions);return(n,c)=>(a(),o(`header`,null,[e.showLogo?(a(),o(`img`,{key:0,src:F(Le)},null,8,_x)):b(``,!0),e.showMenu?(a(),U($,{key:1,class:`menu-button`,icon:`menu`,label:F(i)(`buttons.toggleSidebar`),onAction:c[0]||(c[0]=e=>F(t).showHover(`sidebar`))},null,8,[`label`])):b(``,!0),S(n.$slots,`default`),M(`div`,{id:`dropdown`,class:k({active:F(t).currentPromptName===`more`})},[S(n.$slots,`actions`)],2),s.value?(a(),U($,{key:2,id:`more`,icon:`more_vert`,label:F(i)(`buttons.more`),onAction:c[1]||(c[1]=e=>F(t).showHover(`more`))},null,8,[`label`])):b(``,!0),r(M(`div`,{class:`overlay`,onClick:c[2]||(c[2]=(...e)=>F(t).closeHovers&&F(t).closeHovers(...e))},null,512),[[pe,F(t).currentPromptName==`more`]])]))}}),yx={class:`breadcrumbs`},bx=s({__name:`Breadcrumbs`,props:{base:{},noLink:{type:Boolean}},setup(e){let{t}=B(),n=yi(),r=e,i=W(()=>{let e=n.path.replace(r.base,``).split(`/`);e[0]===``&&e.shift(),e[e.length-1]===``&&e.pop();let t=[];for(let n=0;n3){for(;t.length!==4;)t.shift();t[0].name=`...`}return t}),s=W(()=>r.noLink?`span`:`router-link`);return(n,r)=>(a(),o(`div`,yx,[(a(),U(p(s.value),{to:e.base||``,"aria-label":F(t)(`files.home`),title:F(t)(`files.home`)},{default:v(()=>[...r[0]||(r[0]=[M(`i`,{class:`material-icons`},`home`,-1)])]),_:1},8,[`to`,`aria-label`,`title`])),(a(!0),o(P,null,d(i.value,(e,t)=>(a(),o(`span`,{key:t},[r[1]||(r[1]=M(`span`,{class:`chevron`},[M(`i`,{class:`material-icons`},`keyboard_arrow_right`)],-1)),(a(),U(p(s.value),{to:e.url},{default:v(()=>[H(G(e.name),1)]),_:2},1032,[`to`]))]))),128))]))}}),xx={class:`message`},Sx={class:`material-icons`},Cx=s({__name:`Errors`,props:{errorCode:{default:500},showHeader:{type:Boolean,default:!1}},setup(e){let{t}=B({}),n={0:{icon:`cloud_off`,message:`errors.connection`},403:{icon:`error`,message:`errors.forbidden`},404:{icon:`gps_off`,message:`errors.notFound`},500:{icon:`error_outline`,message:`errors.internal`}},r=e,i=W(()=>n[r.errorCode]?n[r.errorCode]:n[500]);return(n,r)=>(a(),o(`div`,null,[e.showHeader?(a(),U(vx,{key:0,showMenu:``,showLogo:``})):b(``,!0),M(`h2`,xx,[M(`i`,Sx,G(i.value.icon),1),M(`span`,null,G(F(t)(i.value.message)),1)])]))}}),wx=Zr(`clipboard`,{state:()=>({key:``,items:[],path:void 0}),getters:{},actions:{resetClipboard(){this.$reset()}}});function Tx(e){for(let t=0;t(t=n.call(r.cssRules,t=>{let n=!1;if(t.constructor.name===`CSSStyleRule`)for(let r=0;r{u.value=e===`search`,t===`search`&&!u.value?(m.value&&(i.reload=!0),document.body.style.overflow=`auto`,F(),l.value=``,u.value=!1,_.value?.blur()):u.value&&(m.value=!1,_.value?.focus(),document.body.style.overflow=`hidden`)}),T(l,()=>{F()});let D=W(()=>p.value.length===0),O=W(()=>f.value?``:l.value===``?C(`search.typeToSearch`):C(`search.pressToSearch`)),A=W(()=>p.value.slice(0,h.value)),j=W(()=>f.value?C(`buttons.stopSearch`):C(`buttons.close`));y(()=>{S.value!==null&&S.value.addEventListener(`scroll`,e=>{e.target.offsetHeight+e.target.scrollTop>=e.target.scrollHeight-100&&(h.value+=50)})}),Ce(()=>{ae()});let ee=()=>{!u.value&&n.showHover(`search`)},te=e=>{f.value?(ae(),f.value=!1):(e.stopPropagation(),e.preventDefault(),n.closeHovers())},ne=e=>{if(e.key===`Escape`){te(e);return}p.value.length=0},re=e=>{l.value=`${e} `,_.value!==null&&_.value.focus()},F=()=>{ae(),f.value=!1,h.value=50,p.value=[]},ae=()=>{s.abort()},I=async e=>{if(e.preventDefault(),l.value===``)return;let t=E.path;i.isListing||(t=kd.removeLastDir(t)+`/`),f.value=!0;try{ae(),s=new AbortController,p.value=[],await Kh(t,l.value,s.signal,e=>p.value.push(e))}catch(e){if(e instanceof Ad&&e.is_canceled)return;g(e)}f.value=!1};return(e,n)=>{let i=w(`router-link`);return a(),o(`div`,{id:`search`,onClick:ee,class:k({active:u.value,ongoing:f.value})},[M(`div`,Ex,[u.value?(a(),o(`button`,{key:0,class:`action`,onClick:te,"aria-label":j.value,title:j.value},[f.value?(a(),o(`i`,Ox,`stop_circle`)):(a(),o(`i`,kx,`arrow_back`))],8,Dx)):(a(),o(`i`,Ax,`search`)),r(M(`input`,{type:`text`,onKeyup:[ie(ne,[`exact`]),se(I,[`enter`])],ref_key:`input`,ref:_,autofocus:u.value,"onUpdate:modelValue":n[0]||(n[0]=e=>l.value=e),"aria-label":e.$t(`search.search`),placeholder:e.$t(`search.search`)},null,40,jx),[[N,l.value,void 0,{trim:!0}]]),r(M(`i`,Mx,`autorenew `,512),[[pe,f.value]]),r(M(`span`,{style:{"margin-top":`5px`}},G(p.value.length),513),[[pe,p.value.length>0]])]),M(`div`,{id:`result`,ref_key:`result`,ref:S},[M(`div`,null,[D.value?(a(),o(P,{key:0},[M(`p`,null,G(O.value),1),l.value.length===0?(a(),o(`div`,Nx,[M(`h3`,null,G(e.$t(`search.types`)),1),M(`div`,null,[(a(),o(P,null,d(t,(t,n)=>M(`div`,{tabindex:`0`,key:n,role:`button`,onClick:e=>re(`type:`+n),"aria-label":e.$t(`search.`+t.label)},[M(`i`,Fx,G(t.icon),1),M(`p`,null,G(e.$t(`search.`+t.label)),1)],8,Px)),64))])])):b(``,!0)],64)):b(``,!0),r(M(`ul`,null,[(a(!0),o(P,null,d(A.value,(e,t)=>(a(),o(`li`,{key:t},[x(i,{onClick:te,to:e.url},{default:v(()=>[e.dir?(a(),o(`i`,Ix,`folder`)):(a(),o(`i`,Lx,`insert_drive_file`)),M(`span`,null,`./`+G(e.path),1)]),_:2},1032,[`to`])]))),128))],512),[[pe,p.value.length>0]])])],512)],2)}}}),zx=[`draggable`,`data-dir`,`data-type`,`aria-label`,`aria-selected`,`data-ext`],Bx={key:0},Vx={key:1,class:`material-icons`},Hx={class:`name`},Ux={key:0,class:`size`,"data-order":`-1`},Wx=[`data-order`],Gx={class:`modified`},Kx=[`datetime`],qx=s({__name:`ListingItem`,props:{name:{},isDir:{type:Boolean},url:{},type:{},size:{},modified:{},index:{},readOnly:{type:Boolean},path:{}},setup(e){let t=z(0),n=z(null),i=z(!1),s=z(500),c=z(null),l=z(10),d=L(`$showError`),f=vi(),p=e,m=hd(),h=Z(),g=X(),_=W(()=>!p.readOnly&&m.user?.singleClick),v=W(()=>h.selected.indexOf(p.index)!==-1),y=W(()=>!p.readOnly&&m.user?.perm.rename),b=W(()=>{if(!p.isDir||p.readOnly)return!1;for(let e of h.selected)if(h.req?.items[e].url===p.url)return!1;return!0}),x=W(()=>Oh({path:p.path,modified:p.modified},`thumb`)),S=W(()=>Ue),C=()=>p.type==`invalid_link`?`invalid link`:C_(p.size),w=()=>!p.readOnly&&m.user?.dateFormat?(0,T_.default)(p.modified).format(`L LT`):(0,T_.default)(p.modified).fromNow(),T=()=>{if(h.selectedCount===0){h.selected.push(p.index);return}v.value||(h.selected=[],h.selected.push(p.index))},E=e=>{if(!b.value)return;e.preventDefault();let t=e.target;if(t!==null){for(let e=0;e<5;e++)t?.classList.contains(`item`)||(t=t?.parentElement??null);t!==null&&(t.style.opacity=`1`)}},D=async e=>{if(!b.value||(e.preventDefault(),h.selectedCount===0))return;let t=e.target;for(let e=0;e<5;e++)t!==null&&!t.classList.contains(`item`)&&(t=t.parentElement);let n=[];for(let e of h.selected)h.req&&n.push({from:h.req?.items[e].url,to:p.url+encodeURIComponent(h.req?.items[e].name),name:h.req?.items[e].name,size:h.req?.items[e].size,modified:h.req?.items[e].modified,overwrite:!1,rename:!1});if(t===null)return;let r=t.__vue__.url,i=(await gh(r)).items,a=(e,t)=>{wh(n,e,t).then(()=>{h.reload=!0}).catch(d)},o=yv(n,i);if(o.length>0){g.showHover({prompt:`resolve-conflict`,props:{conflict:o},confirm:(e,t)=>{e.preventDefault(),g.closeHovers();for(let e=t.length-1;e>=0;e--){let r=t[e];r.checked.length==2?n[r.index].rename=!0:r.checked.length==1&&r.checked[0]==`origin`?n[r.index].overwrite=!0:n.splice(r.index,1)}n.length>0&&a()}});return}a(!1,!1)},O=e=>{if(i.value){i.value=!1;return}_.value&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!h.multiple?j():A(e)},k=e=>{e.preventDefault(),(h.selected.length===0||e.ctrlKey||h.selected.indexOf(p.index)===-1)&&A(e)},A=e=>{if(!_.value&&h.selectedCount!==0&&e.preventDefault(),setTimeout(()=>{t.value=0},300),t.value++,t.value>1&&j(),h.selected.indexOf(p.index)!==-1){e.ctrlKey||e.metaKey||h.multiple?h.removeSelected(p.index):h.selected=[p.index];return}if(e.shiftKey&&h.selected.length>0){let e=0,t=0;for(p.index>h.selected[0]?(e=h.selected[0]+1,t=p.index):(e=p.index,t=h.selected[0]-1);e<=t;e++)h.selected.indexOf(e)==-1&&h.selected.push(e);return}!e.ctrlKey&&!e.metaKey&&!h.multiple&&(h.selected=[]),h.selected.push(p.index)},j=()=>{f.push({path:p.url})},ee=e=>{let t=e.lastIndexOf(`.`);return t===-1?e:e.substring(t)},te=(e,t)=>{c.value={x:e,y:t},n.value=window.setTimeout(()=>{N()},s.value)},ne=()=>{n.value!==null&&(window.clearTimeout(n.value),n.value=null),c.value=null},N=()=>{_.value&&(i.value=!0,A(new Event(`longpress`))),ne()},re=(e,t)=>{if(!c.value)return!1;let n=Math.abs(e-c.value.x),r=Math.abs(t-c.value.y);return n>l.value||r>l.value},P=e=>{e.button===0&&te(e.clientX,e.clientY)},F=()=>{ne()},ie=()=>{ne()},ae=e=>{if(e.touches.length===1){let t=e.touches[0];te(t.clientX,t.clientY)}},I=()=>{ne()},R=()=>{ne()},oe=e=>{if(e.touches.length===1&&c.value){let t=e.touches[0];re(t.clientX,t.clientY)&&ne()}};return(t,n)=>{let i=u(`lazy`);return a(),o(`div`,{class:`item`,role:`button`,tabindex:`0`,draggable:y.value,onDragstart:T,onDragover:E,onDrop:D,onClick:O,onMousedown:P,onMouseup:F,onMouseleave:ie,onTouchstart:ae,onTouchend:I,onTouchcancel:R,onTouchmove:oe,"data-dir":e.isDir,"data-type":e.type,"aria-label":e.name,"aria-selected":v.value,"data-ext":ee(e.name).toLowerCase(),onContextmenu:k},[M(`div`,null,[!e.readOnly&&e.type===`image`&&S.value?r((a(),o(`img`,Bx,null,512)),[[i,x.value]]):(a(),o(`i`,Vx))]),M(`div`,null,[M(`p`,Hx,G(e.name),1),e.isDir?(a(),o(`p`,Ux,`—`)):(a(),o(`p`,{key:1,class:`size`,"data-order":C()},G(C()),9,Wx)),M(`p`,Gx,[M(`time`,{datetime:e.modified},G(w()),9,Kx)])])],40,zx)}}}),Jx=s({__name:`ContextMenu`,props:{show:{type:Boolean},pos:{}},emits:[`hide`],setup(e,{emit:t}){let n=t,i=e,s=z(null),c=W(()=>Math.min(i.pos.x,window.innerWidth-(s.value?.clientWidth??0))),l=()=>{n(`hide`)};return T(()=>i.show,e=>{e?document.addEventListener(`click`,l):document.removeEventListener(`click`,l)}),Ce(()=>{document.removeEventListener(`click`,l)}),(t,n)=>r((a(),o(`div`,{class:`context-menu`,ref_key:`contextMenu`,ref:s,style:Se({top:`${i.pos.y}px`,left:`${c.value}px`})},[S(t.$slots,`default`)],4)),[[pe,e.show]])}}),Yx={key:0},Xx={key:1},Zx={class:`message delayed`},Qx={key:0},$x={class:`message`},eS={class:`item header`},tS=[`title`,`aria-label`],nS={class:`material-icons`},rS=[`title`,`aria-label`],iS={class:`material-icons`},aS=[`title`,`aria-label`],oS={class:`material-icons`},sS={key:0,"data-clear-on-click":`true`},cS={key:2,"data-clear-on-click":`true`},lS=[`title`,`aria-label`],uS=Q(s({__name:`FileListing`,setup(e){let t=z(50),n=z(280),r=z(0),i=z(window.innerWidth),s=z(0),c=z(!1),l=z({x:0,y:0}),u=L(`$showError`),p=wx(),m=hd(),h=Z(),g=X(),{req:S}=ti(h),C=yi();va(()=>{De()});let{t:w}=B(),E=z(null),D=W(()=>h.req?h.req.sorting.by===`name`:!1),O=W(()=>h.req?h.req.sorting.by===`size`:!1),A=W(()=>h.req?h.req.sorting.by===`modified`:!1),j=W(()=>h.req?h.req.sorting.asc:!1),ee=W(()=>te.value.dirs.slice(0,t.value)),te=W(()=>{let e=[],t=[];return h.req?.items.forEach(n=>{n.isDir?e.push(n):t.push(n)}),{dirs:e,files:t}}),ne=W(()=>{let e=t.value-te.value.dirs.length;return e<0&&(e=0),te.value.files.slice(0,e)}),N=W(()=>D.value&&!j.value?`arrow_upward`:`arrow_downward`),re=W(()=>O.value&&j.value?`arrow_downward`:`arrow_upward`),ie=W(()=>A.value&&j.value?`arrow_downward`:`arrow_upward`),ae=W(()=>{let e={list:`view_module`,mosaic:`grid_view`,"mosaic gallery":`view_list`};return m.user===null?e.list:e[m.user.viewMode]}),I=W(()=>({upload:m.user?.perm.create,download:m.user?.perm.download,shell:m.user?.perm.execute&&Ge,delete:h.selectedCount>0&&m.user?.perm.delete,rename:h.selectedCount===1&&m.user?.perm.rename,share:h.selectedCount===1&&m.user?.perm.share&&m.user?.perm.download,move:h.selectedCount>0&&m.user?.perm.rename,copy:h.selectedCount>0&&m.user?.perm.create})),R=W(()=>i.value<=736);T(S,()=>{t.value=50,_(()=>{Ce(),Te()||we(!0)})}),y(()=>{de(),Ce(),Te()||we(!0),window.addEventListener(`keydown`,se),window.addEventListener(`scroll`,fe),window.addEventListener(`resize`,V),m.user?.perm.create&&(document.addEventListener(`dragover`,ce),document.addEventListener(`dragenter`,pe),document.addEventListener(`dragleave`,me),document.addEventListener(`drop`,he))}),f(()=>{window.removeEventListener(`keydown`,se),window.removeEventListener(`scroll`,fe),window.removeEventListener(`resize`,V),!(m.user&&!m.user?.perm.create)&&(document.removeEventListener(`dragover`,ce),document.removeEventListener(`dragenter`,pe),document.removeEventListener(`dragleave`,me),document.removeEventListener(`drop`,he))});let oe=e=>ep.encodeURI(e),se=e=>{if(g.currentPrompt===null){if(e.key===`Escape`&&(h.selected=[]),e.key===`Delete`){if(!m.user?.perm.delete||h.selectedCount==0)return;g.showHover(`delete`)}if(e.key===`F2`){if(!m.user?.perm.rename||h.selectedCount!==1)return;g.showHover(`rename`)}if(!(!e.ctrlKey&&!e.metaKey))switch(e.key){case`f`:case`F`:e.shiftKey&&(e.preventDefault(),g.showHover(`search`));break;case`c`:case`x`:le(e);break;case`v`:ue(e);break;case`a`:e.preventDefault();for(let e of te.value.files)h.selected.indexOf(e.index)===-1&&h.selected.push(e.index);for(let e of te.value.dirs)h.selected.indexOf(e.index)===-1&&h.selected.push(e.index);break;case`s`:e.preventDefault(),document.getElementById(`download-button`)?.click();break}}},ce=e=>{e.preventDefault()},le=e=>{if(e.target.tagName?.toLowerCase()===`input`||h.req===null)return;let t=[];for(let e of h.selected)t.push({from:h.req.items[e].url,name:h.req.items[e].name,size:h.req.items[e].size,modified:h.req.items[e].modified});t.length!==0&&p.$patch({key:e.key,items:t,path:C.path})},ue=e=>{if(e.target.tagName?.toLowerCase()===`input`)return;let t=[];for(let e of p.items){let n=e.from.endsWith(`/`)?e.from.slice(0,-1):e.from,r=C.path+encodeURIComponent(e.name);t.push({from:n,to:r,name:e.name,size:e.size,modified:e.modified,overwrite:!1,rename:p.path==C.path})}if(t.length===0)return;let n=Nd(C.path)+t[0].name,r=(e,r)=>{Th(t,e,r).then(()=>{h.preselect=n,h.reload=!0}).catch(u)};p.key===`x`&&(r=(e,r)=>{wh(t,e,r).then(()=>{p.resetClipboard(),h.preselect=n,h.reload=!0}).catch(u)});let i=yv(t,h.req.items);if(i.length>0){g.showHover({prompt:`resolve-conflict`,props:{conflict:i},confirm:(e,n)=>{e.preventDefault(),g.closeHovers();for(let e=n.length-1;e>=0;e--){let r=n[e];r.checked.length==2?t[r.index].rename=!0:r.checked.length==1&&r.checked[0]==`origin`?t[r.index].overwrite=!0:t.splice(r.index,1)}t.length>0&&r()}});return}r(!1,!1)},de=()=>{let e=Tx([`#listing.mosaic .item`,`.mosaic#listing .item`]);if(e===null)return;let t=Math.floor((document.querySelector(`main`)?.offsetWidth??0)/n.value);t===0&&(t=1),e.style.width=`calc(${100/t}% - 1em)`},fe=md(()=>{let e=(h.req?.numDirs??0)+(h.req?.numFiles??0);if(!(t.value>=e)&&window.innerHeight+window.scrollY>document.body.offsetHeight-window.innerHeight*.25){let e=Math.ceil(window.innerHeight*2/s.value);t.value+=e}},100),pe=()=>{r.value++;let e=document.getElementsByClassName(`item`);Array.from(e).forEach(e=>{e.style.opacity=`0.5`})},me=()=>{r.value--,r.value==0&&_e()},he=async e=>{e.preventDefault(),r.value=0,_e();let t=e.dataTransfer,n=e.target;if(h.req===null||t===null||t.files.length<=0)return;for(let e=0;e<5;e++)n!==null&&!n.classList.contains(`item`)&&(n=n.parentElement);let i=await bv(t),a=h.req.items,o=C.path.endsWith(`/`)?C.path:C.path+`/`;if(n!==null&&n.classList.contains(`item`)&&n.dataset.dir===`true`){o=n.__vue__.url;try{a=(await gh(o)).items}catch(e){u(e)}}let s=yv(i,a),c=Nd(o)+(i[0].fullPath||i[0].name);if(s.length>0){g.showHover({prompt:`resolve-conflict`,props:{conflict:s,isUploadAction:!0},confirm:(e,t)=>{e.preventDefault(),g.closeHovers();for(let e=t.length-1;e>=0;e--){let n=t[e];n.checked.length!=2&&(n.checked.length==1&&n.checked[0]==`origin`?i[n.index].overwrite=!0:i.splice(n.index,1))}i.length>0&&(Sv(i,o,!0),h.preselect=c)}});return}Sv(i,o),h.preselect=c},ge=e=>{let t=e.currentTarget?.files;if(t===null)return;let n=!!t[0].webkitRelativePath,r=[];for(let e=0;e0){g.showHover({prompt:`resolve-conflict`,props:{conflict:a,isUploadAction:!0},confirm:(e,t)=>{e.preventDefault(),g.closeHovers();for(let e=t.length-1;e>=0;e--){let n=t[e];n.checked.length!=2&&(n.checked.length==1&&n.checked[0]==`origin`?r[n.index].overwrite=!0:r.splice(n.index,1))}r.length>0&&Sv(r,i,!0)}});return}Sv(r,i)},_e=()=>{let e=document.getElementsByClassName(`item`);Array.from(e).forEach(e=>{e.style.opacity=`1`})},ve=async e=>{let t=!1;e===`name`?N.value===`arrow_upward`&&(t=!0):e===`size`?re.value===`arrow_upward`&&(t=!0):e===`modified`&&ie.value===`arrow_upward`&&(t=!0);try{m.user?.id&&await zh({id:m.user?.id,sorting:{by:e,asc:t}},[`sorting`])}catch(e){u(e)}h.reload=!0},ye=()=>{g.showHover(`search`)},be=()=>{h.toggleMultiple(),g.closeHovers()},V=md(()=>{de(),i.value=window.innerWidth,E.value!=null&&(Ce(),we())},100),xe=()=>{if(h.req!==null){if(h.selectedCount===1&&!h.req.items[h.selected[0]].isDir){bh(null,h.req.items[h.selected[0]].url);return}g.showHover({prompt:`download`,confirm:e=>{g.closeHovers();let t=[];if(h.selectedCount>0&&h.req!==null)for(let e of h.selected)t.push(h.req.items[e].url);else t.push(C.path);bh(e,...t)}})}},Se=async()=>{g.closeHovers();let e={id:m.user?.id,viewMode:{list:`mosaic`,mosaic:`mosaic gallery`,"mosaic gallery":`list`}[m.user?.viewMode??`list`]||`list`};zh(e,[`viewMode`]).catch(u),m.updateUser(e),Ce(),we()},H=()=>{window.DataTransferItem!==void 0&&DataTransferItem.prototype.webkitGetAsEntry!==void 0?g.showHover(`upload`):document.getElementById(`upload-input`)?.click()},Ce=()=>{if(E.value===null||h.req===null)return;let e=h.req.numDirs+h.req.numFiles;e>t.value&&(e=t.value),s.value=E.value.offsetHeight/e},we=(e=!1)=>{if(h.req===null)return;let n=h.req.numDirs+h.req.numFiles;if(t.value>=n&&!e)return;let r=window.innerHeight,i=Math.ceil((r+r*2)/s.value);t.value>i&&!e||(t.value=i>n?n:i)},Te=()=>{if(!h.req||!h.oldReq)return;let e=h.selected[0];if(e!==void 0)return t.value=e+Math.ceil(window.innerHeight*2/s.value),_(()=>{document.querySelectorAll(`#listing .item`)[e].scrollIntoView({block:`center`})}),!0},Ee=e=>{e.preventDefault(),c.value=!0,l.value={x:e.clientX+8,y:e.clientY+Math.floor(window.scrollY)}},De=()=>{c.value=!1},Oe=e=>{let t=e.target;t instanceof HTMLElement&&t.dataset.clearOnClick===`true`&&(h.selected=[])};return(e,t)=>(a(),o(`div`,null,[x(vx,{showMenu:``,showLogo:``},{actions:v(()=>[R.value?b(``,!0):(a(),o(P,{key:0},[I.value.share?(a(),U($,{key:0,icon:`share`,label:F(w)(`buttons.share`),show:`share`},null,8,[`label`])):b(``,!0),I.value.rename?(a(),U($,{key:1,icon:`mode_edit`,label:F(w)(`buttons.rename`),show:`rename`},null,8,[`label`])):b(``,!0),I.value.copy?(a(),U($,{key:2,id:`copy-button`,icon:`content_copy`,label:F(w)(`buttons.copyFile`),show:`copy`},null,8,[`label`])):b(``,!0),I.value.move?(a(),U($,{key:3,id:`move-button`,icon:`forward`,label:F(w)(`buttons.moveFile`),show:`move`},null,8,[`label`])):b(``,!0),I.value.delete?(a(),U($,{key:4,id:`delete-button`,icon:`delete`,label:F(w)(`buttons.delete`),show:`delete`},null,8,[`label`])):b(``,!0)],64)),I.value.shell?(a(),U($,{key:1,icon:`code`,label:F(w)(`buttons.shell`),onAction:F(g).toggleShell},null,8,[`label`,`onAction`])):b(``,!0),x($,{icon:ae.value,label:F(w)(`buttons.switchView`),onAction:Se},null,8,[`icon`,`label`]),I.value.download?(a(),U($,{key:2,icon:`file_download`,label:F(w)(`buttons.download`),onAction:xe,counter:F(h).selectedCount},null,8,[`label`,`counter`])):b(``,!0),I.value.upload?(a(),U($,{key:3,icon:`file_upload`,id:`upload-button`,label:F(w)(`buttons.upload`),onAction:H},null,8,[`label`])):b(``,!0),x($,{icon:`info`,label:F(w)(`buttons.info`),show:`info`},null,8,[`label`]),x($,{icon:`check_circle`,label:F(w)(`buttons.selectMultiple`),onAction:be},null,8,[`label`])]),default:v(()=>[x(Rx),t[9]||(t[9]=M(`title`,null,null,-1)),x($,{class:`search-button`,icon:`search`,label:F(w)(`buttons.search`),onAction:t[0]||(t[0]=e=>ye())},null,8,[`label`])]),_:1}),R.value?(a(),o(`div`,{key:0,id:`file-selection`,class:k({"file-selection-margin-bottom":F(h).multiple})},[F(h).selectedCount>0?(a(),o(`span`,Yx,G(F(w)(`prompts.filesSelected`,F(h).selectedCount)),1)):b(``,!0),I.value.share?(a(),U($,{key:1,icon:`share`,label:F(w)(`buttons.share`),show:`share`},null,8,[`label`])):b(``,!0),I.value.rename?(a(),U($,{key:2,icon:`mode_edit`,label:F(w)(`buttons.rename`),show:`rename`},null,8,[`label`])):b(``,!0),I.value.copy?(a(),U($,{key:3,icon:`content_copy`,label:F(w)(`buttons.copyFile`),show:`copy`},null,8,[`label`])):b(``,!0),I.value.move?(a(),U($,{key:4,icon:`forward`,label:F(w)(`buttons.moveFile`),show:`move`},null,8,[`label`])):b(``,!0),I.value.delete?(a(),U($,{key:5,icon:`delete`,label:F(w)(`buttons.delete`),show:`delete`},null,8,[`label`])):b(``,!0)],2)):b(``,!0),F(g).loading?(a(),o(`div`,Xx,[M(`h2`,Zx,[t[10]||(t[10]=M(`div`,{class:`spinner`},[M(`div`,{class:`bounce1`}),M(`div`,{class:`bounce2`}),M(`div`,{class:`bounce3`})],-1)),M(`span`,null,G(F(w)(`files.loading`)),1)])])):(a(),o(P,{key:2},[(F(h).req?.numDirs??0)+(F(h).req?.numFiles??0)==0?(a(),o(`div`,Qx,[M(`h2`,$x,[t[11]||(t[11]=M(`i`,{class:`material-icons`},`sentiment_dissatisfied`,-1)),M(`span`,null,G(F(w)(`files.lonely`)),1)]),M(`input`,{style:{display:`none`},type:`file`,id:`upload-input`,onChange:t[1]||(t[1]=e=>ge(e)),multiple:``},null,32),M(`input`,{style:{display:`none`},type:`file`,id:`upload-folder-input`,onChange:t[2]||(t[2]=e=>ge(e)),webkitdirectory:``,multiple:``},null,32)])):(a(),o(`div`,{key:1,id:`listing`,ref_key:`listing`,ref:E,class:k([`file-icons`,F(m).user?.viewMode??``]),"data-clear-on-click":`true`,onClick:Oe},[M(`div`,null,[M(`div`,eS,[M(`div`,null,[M(`p`,{class:k([{active:D.value},`name`]),role:`button`,tabindex:`0`,onClick:t[3]||(t[3]=e=>ve(`name`)),title:F(w)(`files.sortByName`),"aria-label":F(w)(`files.sortByName`)},[M(`span`,null,G(F(w)(`files.name`)),1),M(`i`,nS,G(N.value),1)],10,tS),M(`p`,{class:k([{active:O.value},`size`]),role:`button`,tabindex:`0`,onClick:t[4]||(t[4]=e=>ve(`size`)),title:F(w)(`files.sortBySize`),"aria-label":F(w)(`files.sortBySize`)},[M(`span`,null,G(F(w)(`files.size`)),1),M(`i`,iS,G(re.value),1)],10,rS),M(`p`,{class:k([{active:A.value},`modified`]),role:`button`,tabindex:`0`,onClick:t[5]||(t[5]=e=>ve(`modified`)),title:F(w)(`files.sortByLastModified`),"aria-label":F(w)(`files.sortByLastModified`)},[M(`span`,null,G(F(w)(`files.lastModified`)),1),M(`i`,oS,G(ie.value),1)],10,aS)])])]),F(h).req?.numDirs??!1?(a(),o(`h2`,sS,G(F(w)(`files.folders`)),1)):b(``,!0),F(h).req?.numDirs??!1?(a(),o(`div`,{key:1,"data-clear-on-click":`true`,onContextmenu:Ee},[(a(!0),o(P,null,d(ee.value,e=>(a(),U(qx,{key:oe(e.name),index:e.index,name:e.name,isDir:e.isDir,url:e.url,modified:e.modified,type:e.type,size:e.size,path:e.path},null,8,[`index`,`name`,`isDir`,`url`,`modified`,`type`,`size`,`path`]))),128))],32)):b(``,!0),F(h).req?.numFiles??!1?(a(),o(`h2`,cS,G(F(w)(`files.files`)),1)):b(``,!0),F(h).req?.numFiles??!1?(a(),o(`div`,{key:3,"data-clear-on-click":`true`,onContextmenu:Ee},[(a(!0),o(P,null,d(ne.value,e=>(a(),U(qx,{key:oe(e.name),index:e.index,name:e.name,isDir:e.isDir,url:e.url,modified:e.modified,type:e.type,size:e.size,path:e.path},null,8,[`index`,`name`,`isDir`,`url`,`modified`,`type`,`size`,`path`]))),128))],32)):b(``,!0),x(Jx,{show:c.value,pos:l.value,onHide:De},{default:v(()=>[I.value.share?(a(),U($,{key:0,icon:`share`,label:F(w)(`buttons.share`),show:`share`},null,8,[`label`])):b(``,!0),I.value.rename?(a(),U($,{key:1,icon:`mode_edit`,label:F(w)(`buttons.rename`),show:`rename`},null,8,[`label`])):b(``,!0),I.value.copy?(a(),U($,{key:2,id:`copy-button`,icon:`content_copy`,label:F(w)(`buttons.copyFile`),show:`copy`},null,8,[`label`])):b(``,!0),I.value.move?(a(),U($,{key:3,id:`move-button`,icon:`forward`,label:F(w)(`buttons.moveFile`),show:`move`},null,8,[`label`])):b(``,!0),I.value.delete?(a(),U($,{key:4,id:`delete-button`,icon:`delete`,label:F(w)(`buttons.delete`),show:`delete`},null,8,[`label`])):b(``,!0),I.value.download?(a(),U($,{key:5,icon:`file_download`,label:F(w)(`buttons.download`),onAction:xe,counter:F(h).selectedCount},null,8,[`label`,`counter`])):b(``,!0),x($,{icon:`info`,label:F(w)(`buttons.info`),show:`info`},null,8,[`label`])]),_:1},8,[`show`,`pos`]),M(`input`,{style:{display:`none`},type:`file`,id:`upload-input`,onChange:t[6]||(t[6]=e=>ge(e)),multiple:``},null,32),M(`input`,{style:{display:`none`},type:`file`,id:`upload-folder-input`,onChange:t[7]||(t[7]=e=>ge(e)),webkitdirectory:``,multiple:``},null,32),M(`div`,{class:k({active:F(h).multiple}),id:`multiple-selection`},[M(`p`,null,G(F(w)(`files.multipleSelectionEnabled`)),1),M(`div`,{onClick:t[8]||(t[8]=()=>F(h).multiple=!1),tabindex:`0`,role:`button`,title:F(w)(`buttons.clear`),"aria-label":F(w)(`buttons.clear`),class:`action`},[...t[12]||(t[12]=[M(`i`,{class:`material-icons`},`clear`,-1)])],8,lS)],2)],2))],64))]))}}),[[`__scopeId`,`data-v-4c538632`]]),dS={key:3},fS={class:`message delayed`},pS=s({__name:`Files`,setup(e){let t=c(()=>de(()=>import(`./Editor-ofIDUvYY.js`),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),n=c(()=>de(()=>import(`./Preview-DftVD8Zw.js`),__vite__mapDeps([5,1,2,3,6]),import.meta.url)),r=X(),i=Z(),{reload:s}=ti(i),l=yi(),{t:u}=B({}),d=new AbortController,m=z(null),h=W(()=>i.req?.type===void 0?null:i.req.isDir?uS:i.req.extension.toLowerCase()===`.csv`?l.query.edit===`true`?t:n:i.req.type===`text`||i.req.type===`textImmutable`?t:n);y(()=>{_(),i.isFiles=!0,window.addEventListener(`keydown`,v)}),f(()=>{window.removeEventListener(`keydown`,v)}),Ce(()=>{i.isFiles=!1,r.showShell&&r.toggleShell(),i.updateRequest(null),d.abort()}),T(l,()=>{_()}),T(s,e=>{e&&_()});let g=()=>{let e=i.preselect;if(i.preselect=null,!i.req?.isDir||i.oldReq===null)return;let t=-1;if(e)t=i.req.items.findIndex(t=>t.path===e);else if(i.oldReq.path.startsWith(i.req.path)){let e=i.oldReq.path.substring(i.req.path.length).split(`/`).shift();t=i.req.items.findIndex(t=>t.path==i.req.path+e)}t!==-1&&i.selected.push(t)},_=async()=>{i.reload=!1,i.selected=[],i.multiple=!1,r.closeHovers(),r.loading=!0,m.value=null;let e=l.path;e===``&&(e=`/`),e[0]!==`/`&&(e=`/`+e),d.abort(),d=new AbortController;try{let t=await gh(e,d.signal);i.updateRequest(t),document.title=`${t.name||u(`sidebar.myFiles`)} - ${u(`files.files`)} - ${Oe}`,r.loading=!1,g()}catch(e){if(e instanceof Ad&&e.is_canceled)return;e instanceof Error&&(m.value=e),r.loading=!1}},v=e=>{e.key===`F1`&&(e.preventDefault(),r.showHover(`help`))};return(e,t)=>(a(),o(`div`,null,[m.value||F(i).req?.type===void 0?(a(),U(vx,{key:0,showMenu:``,showLogo:``})):b(``,!0),x(bx,{base:`/files`}),m.value?(a(),U(Cx,{key:1,errorCode:m.value.status},null,8,[`errorCode`])):h.value?(a(),U(p(h.value),{key:2})):(a(),o(`div`,dS,[M(`h2`,fS,[t[0]||(t[0]=M(`div`,{class:`spinner`},[M(`div`,{class:`bounce1`}),M(`div`,{class:`bounce2`}),M(`div`,{class:`bounce3`})],-1)),M(`span`,null,G(F(u)(`files.loading`)),1)])]))]))}}),mS=function(){return mS=Object.assign||function(e){for(var t,n=1,r=arguments.length;na.MAX_VERSION)throw RangeError(`Version value out of range`);if(i<-1||i>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;for(var o=[],s=0;s7)throw RangeError(`Invalid value`);var u,d;for(u=o;;u++){var f=a.getNumDataCodewords(u,n)*8,p=i.getTotalBits(e,u);if(p<=f){d=p;break}if(u>=s)throw RangeError(`Data too long`)}for(var m=0,h=[a.Ecc.MEDIUM,a.Ecc.QUARTILE,a.Ecc.HIGH];m>>3]|=e<<7-(t&7)}),new a(u,n,E,c)},a.prototype.getModule=function(e,t){return 0<=e&&e>>9)*1335;var o=(t<<10|i)^21522;r(o>>>15==0);for(var a=0;a<=5;a++)this.setFunctionModule(8,a,n(o,a));this.setFunctionModule(8,7,n(o,6)),this.setFunctionModule(8,8,n(o,7)),this.setFunctionModule(7,8,n(o,8));for(var a=9;a<15;a++)this.setFunctionModule(14-a,8,n(o,a));for(var a=0;a<8;a++)this.setFunctionModule(this.size-1-a,8,n(o,a));for(var a=8;a<15;a++)this.setFunctionModule(8,this.size-15+a,n(o,a));this.setFunctionModule(8,this.size-8,!0)},a.prototype.drawVersion=function(){if(!(this.version<7)){for(var e=this.version,t=0;t<12;t++)e=e<<1^(e>>>11)*7973;var i=this.version<<12|e;r(i>>>18==0);for(var t=0;t<18;t++){var a=n(i,t),o=this.size-11+t%3,s=Math.floor(t/3);this.setFunctionModule(o,s,a),this.setFunctionModule(s,o,a)}}},a.prototype.drawFinderPattern=function(e,t){for(var n=-4;n<=4;n++)for(var r=-4;r<=4;r++){var i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;0<=a&&a=c)&&g.push(t[e])})},f=0;f=1;i-=2){i==6&&(i=5);for(var o=0;o>>3],7-(t&7)),t++)}}r(t==e.length*8)},a.prototype.applyMask=function(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(var t=0;t5&&e++):(this.finderPenaltyAddHistory(i,o),n||(e+=this.finderPenaltyCountPatterns(o)*a.PENALTY_N3),n=this.modules[t][s],i=1);e+=this.finderPenaltyTerminateAndCount(n,i,o)*a.PENALTY_N3}for(var s=0;s5&&e++):(this.finderPenaltyAddHistory(c,o),n||(e+=this.finderPenaltyCountPatterns(o)*a.PENALTY_N3),n=this.modules[t][s],c=1);e+=this.finderPenaltyTerminateAndCount(n,c,o)*a.PENALTY_N3}for(var t=0;ta.MAX_VERSION)throw RangeError(`Version number out of range`);var t=(16*e+128)*e+64;if(e>=2){var n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return r(208<=t&&t<=29648),t},a.getNumDataCodewords=function(e,t){return Math.floor(a.getNumRawDataModules(e)/8)-a.ECC_CODEWORDS_PER_BLOCK[t.ordinal][e]*a.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][e]},a.reedSolomonComputeDivisor=function(e){if(e<1||e>255)throw RangeError(`Degree out of range`);for(var t=[],n=0;n>>8||t>>>8)throw RangeError(`Byte out of range`);for(var n=0,i=7;i>=0;i--)n=n<<1^(n>>>7)*285,n^=(t>>>i&1)*e;return r(n>>>8==0),n},a.prototype.finderPenaltyCountPatterns=function(e){var t=e[1];r(t<=this.size*3);var n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)},a.prototype.finderPenaltyTerminateAndCount=function(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)},a.prototype.finderPenaltyAddHistory=function(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)},a.MIN_VERSION=1,a.MAX_VERSION=40,a.PENALTY_N1=3,a.PENALTY_N2=3,a.PENALTY_N3=40,a.PENALTY_N4=10,a.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],a.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],a}();function t(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(var r=t-1;r>=0;r--)n.push(e>>>r&1)}function n(e,t){return(e>>>t&1)!=0}function r(e){if(!e)throw Error(`Assertion error`)}var i=function(){function e(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}return e.makeBytes=function(n){for(var r=[],i=0,a=n;i=1<>>0}),n=W(function(){var t=wS(e.level)?e.level:_S;return gS.QrCode.encodeText(e.value,SS[t]).getModules()}),r=W(function(){return n.value.length+t.value*2}),i=W(function(){return TS(n.value,t.value)}),a=W(function(){if(!e.imageSettings.src)return{x:0,y:0,width:0,height:0,borderRadius:0};var r=ES(n.value,e.size,t.value,e.imageSettings);return{x:r.x+t.value,y:r.y+t.value,width:r.w,height:r.h,borderRadius:r.borderRadius}});return{margin:t,numCells:r,cells:n,fgPath:i,imageProps:a,imageBorderProps:W(function(){if(!e.imageSettings.excavate||!e.imageSettings.src)return null;var t=xS/(e.size/r.value);return{x:a.value.x-t,y:a.value.y-t,width:a.value.width+t*2,height:a.value.height+t*2,borderRadius:a.value.borderRadius}})}}var OS={value:{type:String,required:!0,default:``},size:{type:Number,default:vS},level:{type:String,default:_S,validator:function(e){return wS(e)}},background:{type:String,default:`#fff`},foreground:{type:String,default:`#000`},margin:{type:Number,required:!1,default:yS},imageSettings:{type:Object,required:!1,default:function(){return{}}},gradient:{type:Boolean,required:!1,default:!1},gradientType:{type:String,required:!1,default:`linear`,validator:function(e){return[`linear`,`radial`].indexOf(e)>-1}},gradientStartColor:{type:String,required:!1,default:`#000`},gradientEndColor:{type:String,required:!1,default:`#fff`}},kS=mS(mS({},OS),{renderAs:{type:String,required:!1,default:`canvas`,validator:function(e){return[`canvas`,`svg`].indexOf(e)>-1}}}),AS=s({name:`QRCodeSvg`,props:OS,setup:function(e){var t=DS(e),n=t.numCells,r=t.fgPath,i=t.imageProps,a=t.imageBorderProps,o=`qrcode.vue-gradient`,s=function(){if(!e.gradient)return null;var t=e.gradientType===`linear`?{x1:`0%`,y1:`0%`,x2:`100%`,y2:`100%`}:{cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`};return R(e.gradientType===`linear`?`linearGradient`:`radialGradient`,mS({id:o},t),[R(`stop`,{offset:`0%`,style:{stopColor:e.gradientStartColor}}),R(`stop`,{offset:`100%`,style:{stopColor:e.gradientEndColor}})])},c=`qrcode.vue-logo-clip-path`,l=function(){var t=i.value.borderRadius;return!e.imageSettings.src||t<=0?null:R(`clipPath`,{id:c},[R(`rect`,{x:i.value.x,y:i.value.y,width:i.value.width,height:i.value.height,rx:t,ry:t})])};return function(){return R(`svg`,{width:e.size,height:e.size,"shape-rendering":`crispEdges`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 ${n.value} ${n.value}`},[R(`defs`,{},[s(),l()]),R(`rect`,{width:`100%`,height:`100%`,fill:e.background}),R(`path`,{fill:e.gradient?`url(#${o})`:e.foreground,d:r.value}),a.value&&R(`rect`,{x:a.value.x,y:a.value.y,width:a.value.width,height:a.value.height,fill:e.background,rx:a.value.borderRadius,ry:a.value.borderRadius}),e.imageSettings.src&&R(`image`,mS(mS({href:e.imageSettings.src},i.value),i.value.borderRadius>0?{"clip-path":`url(#${c})`}:{}))])}}}),jS=s({name:`QRCodeCanvas`,props:OS,setup:function(e,t){var n=DS(e),r=n.margin,i=n.cells,a=n.numCells,o=n.imageProps,s=n.imageBorderProps,c=z(null),l=z(null),u=function(){var t=e.size,n=e.background,u=e.foreground,d=e.gradient,f=e.gradientType,p=e.gradientStartColor,m=e.gradientEndColor,h=c.value;if(h){var g=h.getContext(`2d`);if(g){var _=i.value,v=l.value,y=typeof window<`u`&&window.devicePixelRatio||1,b=t/a.value*y;if(h.height=h.width=t*y,g.scale(b,b),g.fillStyle=n,g.fillRect(0,0,a.value,a.value),d){var x=void 0;x=f===`linear`?g.createLinearGradient(0,0,a.value,a.value):g.createRadialGradient(a.value/2,a.value/2,0,a.value/2,a.value/2,a.value/2),x.addColorStop(0,p),x.addColorStop(1,m),g.fillStyle=x}else g.fillStyle=u;if(CS?g.fill(new Path2D(TS(_,r.value))):_.forEach(function(e,t){e.forEach(function(e,n){e&&g.fillRect(n+r.value,t+r.value,1,1)})}),e.imageSettings.src&&v&&v.naturalWidth!==0&&v.naturalHeight!==0){var S=function(e,t,n,r,i,a){e.beginPath(),e.roundRect?e.roundRect(t,n,r,i,a):e.rect(t,n,r,i)};if(s.value){var C=s.value;g.fillStyle=e.background,S(g,C.x,C.y,C.width,C.height,C.borderRadius),g.fill()}var w=o.value.borderRadius;w>0?(g.save(),S(g,o.value.x,o.value.y,o.value.width,o.value.height,w),g.clip(),g.drawImage(v,o.value.x,o.value.y,o.value.width,o.value.height),g.restore()):g.drawImage(v,o.value.x,o.value.y,o.value.width,o.value.height)}}}};y(u),D(u);var d=t.attrs.style;return function(){return R(P,[R(`canvas`,mS(mS({},t.attrs),{ref:c,style:mS(mS({},d),{width:`${e.size}px`,height:`${e.size}px`})})),e.imageSettings.src&&R(`img`,{ref:l,src:e.imageSettings.src,style:{display:`none`},onLoad:u})])}}}),MS=s({name:`Qrcode`,render:function(){var e=this.$props,t=e.renderAs,n=e.value,r=e.size,i=e.margin,a=e.level,o=e.background,s=e.foreground,c=e.imageSettings,l=e.gradient,u=e.gradientType,d=e.gradientStartColor,f=e.gradientEndColor;return R(t===`svg`?AS:jS,{value:n,size:r,margin:i,level:a,background:o,foreground:s,imageSettings:c,gradient:l,gradientType:u,gradientStartColor:d,gradientEndColor:f})},props:kS}),NS=[`aria-label`,`data-title`],PS={key:0},FS={class:`message delayed`,style:{"padding-top":`3em !important`}},IS={key:1},LS={key:0},RS={class:`card floating`,id:`password`,style:{"z-index":`9999999`}},zS={key:0,class:`share__wrong__password`},BS={class:`card-title`},VS={class:`card-content`},HS=[`placeholder`],US={class:`card-action`},WS=[`aria-label`,`data-title`],GS={key:2},KS={class:`share`},qS={class:`share__box share__box__info`,style:{position:`sticky`,top:`-20.6em`,"z-index":`999`}},JS={class:`share__box__header`,style:{height:`3em`}},YS={key:0,class:`share__box__element share__box__center share__box__icon`},XS={class:`material-icons`},ZS={class:`share__box__element`,style:{height:`3em`}},QS=[`title`],$S={class:`share__box__element`,style:{height:`3em`}},eC={class:`share__box__element share__box__center`},tC=[`href`],nC=[`href`],rC={key:2,class:`share__box__element share__box__center`},iC={key:3,class:`share__box__element share__box__header`,style:{height:`3em`}},aC={key:4,class:`share__box__element share__box__center share__box__icon`,style:{padding:`0em !important`,height:`12em !important`}},oC=[`href`],sC=[`src`],cC={key:1,style:{height:`12em`,"padding-top":`1em`,margin:`0`}},lC=[`src`,`autoplay`],uC=[`src`],dC=[`href`],fC={key:3,class:`material-icons`},pC={key:4,class:`material-icons`},mC={key:0,id:`shareList`,class:`share__box share__box__items`},hC={key:0,class:`share__box__header`},gC={id:`listing`,class:`list file-icons`},_C={class:`name`},vC=[`data-title`,`aria-label`],yC={key:1,class:`share__box share__box__items`},bC={class:`message`},xC=Q(s({__name:`Share`,setup(e){let t=z(null),n=z(100),i=z(``),s=z(!1),c=z(``),l=z(``),p=z(),m=z(!1),h=L(`$showError`),g=L(`$showSuccess`),{t:_}=B({}),S=yi(),C=Z(),w=X();T(S,()=>{n.value=100,ae()});let E=W(()=>C.req),D=W(()=>E.value===null?`insert_drive_file`:E.value.isDir?`folder`:E.value.type===`image`?`insert_photo`:E.value.type===`audio`?`volume_up`:E.value.type===`video`?`movie`:`insert_drive_file`),O=W(()=>E.value?Gh(E.value):``),A=W(()=>!E.value||!E.value.items[C.selected[0]]?``:Pd(`api/public/dl/${c.value}${E.value.items[C.selected[0]].path}`,{token:l.value})),j=W(()=>E.value?Gh(E.value,!0):``),ee=W(()=>E.value?E.value.isDir?E.value.items.length:C_(E.value.size??0):``),te=W(()=>(0,T_.default)(E.value?.modified).fromNow()),ne=W(()=>E.value?new Date(Date.parse(E.value.modified)).toLocaleString():new Date().toLocaleString()),re=e=>ep.encodeURI(e),ie=()=>{m.value?(p.value?.pause(),m.value=!1):(p.value?.play(),m.value=!0)},ae=async()=>{C.reload=!1,C.selected=[],C.multiple=!1,w.closeHovers(),w.loading=!0,t.value=null,i.value!==``&&(s.value=!0);let e=S.path;e===``&&(e=`/`),e[0]!==`/`&&(e=`/`+e);try{let t=await Uh(e,i.value);t.hash=c.value,l.value=t.token||``,C.updateRequest(t),document.title=`${t.name} - ${document.title}`}catch(e){e instanceof Error&&(t.value=e)}finally{w.loading=!1}},I=e=>{e.key===`Escape`&&C.selectedCount>0&&(C.selected=[])},R=()=>{C.toggleMultiple()},oe=()=>C.selectedCount===1&&!E.value?.items[C.selected[0]].isDir,ce=()=>E.value?oe()?(Wh(null,c.value,l.value,E.value.items[C.selected[0]].path),!0):(w.showHover({prompt:`download`,confirm:e=>{if(E.value===null)return!1;w.closeHovers();let t=[];for(let e of C.selected)t.push(E.value.items[e].path);return Wh(e,c.value,l.value,...t),!0}}),!0):!1,le=()=>oe()&&E.value?Gh({...E.value,hash:c.value,path:E.value.items[C.selected[0]].path}):``,ue=e=>{_y({text:e}).then(()=>{g(_(`success.linkCopied`))},()=>{_y({text:e},{permission:!0}).then(()=>{g(_(`success.linkCopied`))},e=>{h(e)})})};return y(async()=>{c.value=S.params.path[0],window.addEventListener(`keydown`,I),await ae()}),f(()=>{window.removeEventListener(`keydown`,I)}),(e,l)=>{let f=u(`focus`);return a(),o(`div`,null,[x(vx,{showMenu:``,showLogo:``},{default:v(()=>[l[5]||(l[5]=M(`title`,null,null,-1)),F(C).selectedCount?(a(),U($,{key:0,icon:`file_download`,label:F(_)(`buttons.download`),onAction:ce,counter:F(C).selectedCount},null,8,[`label`,`counter`])):b(``,!0),oe()?(a(),o(`button`,{key:1,class:`action copy-clipboard`,"aria-label":F(_)(`buttons.copyDownloadLinkToClipboard`),"data-title":F(_)(`buttons.copyDownloadLinkToClipboard`),onClick:l[0]||(l[0]=e=>ue(le()))},[...l[4]||(l[4]=[M(`i`,{class:`material-icons`},`content_paste`,-1)])],8,NS)):b(``,!0),x($,{icon:`check_circle`,label:F(_)(`buttons.selectMultiple`),onAction:R},null,8,[`label`])]),_:1}),x(bx,{base:`/share/`+c.value},null,8,[`base`]),F(w).loading?(a(),o(`div`,PS,[M(`h2`,FS,[l[6]||(l[6]=M(`div`,{class:`spinner`},[M(`div`,{class:`bounce1`}),M(`div`,{class:`bounce2`}),M(`div`,{class:`bounce3`})],-1)),M(`span`,null,G(F(_)(`files.loading`)),1)])])):t.value?(a(),o(`div`,IS,[t.value.status===401?(a(),o(`div`,LS,[M(`div`,RS,[s.value?(a(),o(`div`,zS,G(F(_)(`login.wrongCredentials`)),1)):b(``,!0),M(`div`,BS,[M(`h2`,null,G(F(_)(`login.password`)),1)]),M(`div`,VS,[r(M(`input`,{class:`input input--block`,type:`password`,placeholder:F(_)(`login.password`),"onUpdate:modelValue":l[1]||(l[1]=e=>i.value=e),onKeyup:se(ae,[`enter`])},null,40,HS),[[f],[N,i.value]])]),M(`div`,US,[M(`button`,{class:`button button--flat`,onClick:ae,"aria-label":F(_)(`buttons.submit`),"data-title":F(_)(`buttons.submit`)},G(F(_)(`buttons.submit`)),9,WS)])]),l[7]||(l[7]=M(`div`,{class:`overlay`},null,-1))])):(a(),U(Cx,{key:1,errorCode:t.value.status},null,8,[`errorCode`]))])):E.value===null?b(``,!0):(a(),o(`div`,GS,[M(`div`,KS,[M(`div`,qS,[M(`div`,JS,G(E.value.isDir?F(_)(`download.downloadFolder`):F(_)(`download.downloadFile`)),1),E.value.isDir?b(``,!0):(a(),o(`div`,YS,[M(`i`,XS,G(D.value),1)])),M(`div`,ZS,[M(`strong`,null,G(e.$t(`prompts.displayName`)),1),H(` `+G(E.value.name),1)]),E.value.isDir?b(``,!0):(a(),o(`div`,{key:1,class:`share__box__element`,title:ne.value},[M(`strong`,null,G(e.$t(`prompts.lastModified`))+`:`,1),H(` `+G(te.value),1)],8,QS)),M(`div`,$S,[M(`strong`,null,G(e.$t(`prompts.size`))+`:`,1),H(` `+G(ee.value),1)]),M(`div`,eC,[M(`a`,{target:`_blank`,href:O.value,class:`button button--flat`,style:{height:`4em`}},[M(`div`,null,[l[8]||(l[8]=M(`i`,{class:`material-icons`},`file_download`,-1)),H(G(F(_)(`buttons.download`)),1)])],8,tC),E.value.isDir?b(``,!0):(a(),o(`a`,{key:0,target:`_blank`,href:j.value,class:`button button--flat`},[M(`div`,null,[l[9]||(l[9]=M(`i`,{class:`material-icons`},`open_in_new`,-1)),H(G(F(_)(`buttons.openFile`)),1)])],8,nC)),E.value.isDir?(a(),U(MS,{key:1,value:O.value,size:100,level:`M`},null,8,[`value`])):b(``,!0)]),E.value.isDir?b(``,!0):(a(),o(`div`,rC,[x(MS,{value:O.value,size:200,level:`M`},null,8,[`value`])])),E.value.isDir?(a(),o(`div`,iC,G(e.$t(`sidebar.preview`)),1)):b(``,!0),E.value.isDir?(a(),o(`div`,aC,[!F(C).multiple&&F(C).selectedCount===1&&E.value.items[F(C).selected[0]].type===`image`?(a(),o(`a`,{key:0,target:`_blank`,href:A.value,class:`button button--flat`,style:{height:`12em`,padding:`0`,margin:`0`}},[M(`img`,{style:{height:`12em`},src:A.value},null,8,sC)],8,oC)):F(C).multiple&&F(C).selectedCount===1&&E.value.items[F(C).selected[0]].type===`audio`?(a(),o(`div`,cC,[m.value?b(``,!0):(a(),o(`button`,{key:0,onClick:ie,style:{"font-size":`6em !important`,border:`0px`,outline:`none`,background:`white`},class:`material-icons`},` play_circle_filled `)),m.value?(a(),o(`button`,{key:1,onClick:ie,style:{"font-size":`6em !important`,border:`0px`,outline:`none`,background:`white`},class:`material-icons`},` pause_circle_filled `)):b(``,!0),M(`audio`,{id:`myaudio`,ref_key:`audio`,ref:p,src:A.value,controls:``,autoplay:m.value},null,8,lC)])):!F(C).multiple&&F(C).selectedCount===1&&E.value.items[F(C).selected[0]].type===`video`?(a(),o(`video`,{key:2,style:{height:`12em`,padding:`0`,margin:`0`},src:A.value,controls:``},[l[10]||(l[10]=H(` Sorry, your browser doesn't support embedded videos, but don't worry, you can `,-1)),M(`a`,{href:A.value},`download it`,8,dC),l[11]||(l[11]=H(` and watch it with your favorite video player! `,-1))],8,uC)):!F(C).multiple&&F(C).selectedCount===1&&E.value.items[F(C).selected[0]].isDir?(a(),o(`i`,fC,`folder `)):(a(),o(`i`,pC,`call_to_action`))])):b(``,!0)]),E.value.isDir&&E.value.items.length>0?(a(),o(`div`,mC,[E.value.isDir?(a(),o(`div`,hC,G(F(_)(`files.files`)),1)):b(``,!0),M(`div`,gC,[(a(!0),o(P,null,d(E.value.items.slice(0,n.value),e=>(a(),U(qx,{key:re(e.name),index:e.index,name:e.name,isDir:e.isDir,url:e.url,modified:e.modified,type:e.type,size:e.size,readOnly:``},null,8,[`index`,`name`,`isDir`,`url`,`modified`,`type`,`size`]))),128)),E.value.items.length>n.value?(a(),o(`div`,{key:0,class:`item`,onClick:l[2]||(l[2]=e=>n.value+=100)},[M(`div`,null,[M(`p`,_C,`+ `+G(E.value.items.length-n.value),1)])])):b(``,!0),M(`div`,{class:k({active:F(C).multiple}),id:`multiple-selection`},[M(`p`,null,G(F(_)(`files.multipleSelectionEnabled`)),1),M(`div`,{onClick:l[3]||(l[3]=()=>F(C).multiple=!1),tabindex:`0`,role:`button`,"data-title":F(_)(`buttons.clear`),"aria-label":F(_)(`buttons.clear`),class:`action`},[...l[12]||(l[12]=[M(`i`,{class:`material-icons`},`clear`,-1)])],8,vC)],2)])])):E.value.isDir&&E.value.items.length===0?(a(),o(`div`,yC,[M(`h2`,bC,[l[13]||(l[13]=M(`i`,{class:`material-icons`},`sentiment_dissatisfied`,-1)),M(`span`,null,G(F(_)(`files.lonely`)),1)])])):b(``,!0)])]))])}}}),[[`__scopeId`,`data-v-a07d13cb`]]),SC={key:1,class:`row`},CC={class:`column`},wC={class:`card`},TC={class:`card-title`},EC={class:`button`},DC={class:`card-content full`},OC={key:0,class:`material-icons`},kC={key:1,class:`material-icons`},AC={class:`small`},jC=s({__name:`Users`,setup(e){let t=z(null),n=z([]),r=X(),{t:i}=B();return y(async()=>{r.loading=!0;try{n.value=await Ih()}catch(e){e instanceof Error&&(t.value=e)}finally{r.loading=!1}}),(e,s)=>{let c=w(`router-link`);return t.value?(a(),U(Cx,{key:0,errorCode:t.value.status},null,8,[`errorCode`])):F(r).loading?b(``,!0):(a(),o(`div`,SC,[M(`div`,CC,[M(`div`,wC,[M(`div`,TC,[M(`h2`,null,G(F(i)(`settings.users`)),1),x(c,{to:`/settings/users/new`},{default:v(()=>[M(`button`,EC,G(F(i)(`buttons.new`)),1)]),_:1})]),M(`div`,DC,[M(`table`,null,[M(`tr`,null,[M(`th`,null,G(F(i)(`settings.username`)),1),M(`th`,null,G(F(i)(`settings.admin`)),1),M(`th`,null,G(F(i)(`settings.scope`)),1),s[0]||(s[0]=M(`th`,null,null,-1))]),(a(!0),o(P,null,d(n.value,e=>(a(),o(`tr`,{key:e.id},[M(`td`,null,G(e.username),1),M(`td`,null,[e.perm.admin?(a(),o(`i`,OC,`done`)):(a(),o(`i`,kC,`close`))]),M(`td`,null,G(e.scope),1),M(`td`,AC,[x(c,{to:`/settings/users/`+e.id},{default:v(()=>[...s[1]||(s[1]=[M(`i`,{class:`material-icons`},`mode_edit`,-1)])]),_:1},8,[`to`])])]))),128))])])])])]))}}}),MC={name:`languages`,props:[`locale`],data(){let e={};return Object.defineProperty(e,`locales`,{value:j({ar:`العربية`,bg:`български език`,ca:`Català`,cs:`Čeština`,de:`Deutsch`,el:`Ελληνικά`,en:`English`,es:`Español`,fr:`Français`,he:`עברית`,hr:`Hrvatski`,hu:`Magyar`,is:`Icelandic`,it:`Italiano`,ja:`日本語`,ko:`한국어`,no:`Norsk`,nl:`Nederlands (Nederland)`,"nl-be":`Nederlands (België)`,lv:`Latviešu`,pl:`Polski`,"pt-br":`Português (Brasil)`,"pt-pt":`Português (Portugal)`,ro:`Romanian`,ru:`Русский`,sk:`Slovenčina`,"sv-se":`Swedish (Sweden)`,tr:`Türkçe`,uk:`Українська`,vi:`Tiếng Việt`,"zh-cn":`中文 (简体)`,"zh-tw":`中文 (繁體)`}),configurable:!1,writable:!1}),e},methods:{change(e){this.$emit(`update:locale`,e.target.value)}}},NC=[`value`],PC=[`value`];function FC(e,t,n,r,i,s){return a(),o(`select`,{name:`selectLanguage`,onChange:t[0]||(t[0]=(...e)=>s.change&&s.change(...e)),value:n.locale},[(a(!0),o(P,null,d(e.locales,(e,t)=>(a(),o(`option`,{key:t,value:t},G(e),9,PC))),128))],40,NC)}var IC=Q(MC,[[`render`,FC]]),LC={name:`rules-textarea`,props:[`rules`],methods:{remove(e,t){e.preventDefault();let n=[...this.rules];n.splice(t,1),this.$emit(`update:rules`,[...n])},create(e){e.preventDefault(),this.$emit(`update:rules`,[...this.rules,{allow:!0,path:``,regex:!1,regexp:{raw:``}}])}}},RC={class:`rules small`},zC=[`onUpdate:modelValue`],BC=[`onUpdate:modelValue`],VC=[`onUpdate:modelValue`,`placeholder`],HC=[`onUpdate:modelValue`,`placeholder`],UC=[`onClick`];function WC(e,t,n,i,s,c){return a(),o(`form`,RC,[(a(!0),o(P,null,d(n.rules,(n,i)=>(a(),o(`div`,{key:i},[r(M(`input`,{type:`checkbox`,"onUpdate:modelValue":e=>n.regex=e},null,8,zC),[[V,n.regex]]),t[3]||(t[3]=M(`label`,null,`Regex`,-1)),r(M(`input`,{type:`checkbox`,"onUpdate:modelValue":e=>n.allow=e},null,8,BC),[[V,n.allow]]),t[4]||(t[4]=M(`label`,null,`Allow`,-1)),n.regex?r((a(),o(`input`,{key:0,onKeypress:t[0]||(t[0]=se(ie(()=>{},[`prevent`]),[`enter`])),type:`text`,"onUpdate:modelValue":e=>n.regexp.raw=e,placeholder:e.$t(`settings.insertRegex`)},null,40,VC)),[[N,n.regexp.raw]]):r((a(),o(`input`,{key:1,onKeypress:t[1]||(t[1]=se(ie(()=>{},[`prevent`]),[`enter`])),type:`text`,"onUpdate:modelValue":e=>n.path=e,placeholder:e.$t(`settings.insertPath`)},null,40,HC)),[[N,n.path]]),M(`button`,{class:`button button--red`,onClick:e=>c.remove(e,i)},` - `,8,UC)]))),128)),M(`div`,null,[M(`button`,{class:`button`,onClick:t[2]||(t[2]=(...e)=>c.create&&c.create(...e)),default:`false`},G(e.$t(`buttons.new`)),1)])])}var GC=Q(LC,[[`render`,WC]]),KC={name:`permissions`,props:[`perm`],computed:{admin:{get(){return this.perm.admin},set(e){if(e)for(let e in this.perm)this.perm[e]=!0;this.perm.admin=e}},isExecEnabled:()=>Ge}},qC={class:`small`},JC=[`disabled`],YC=[`disabled`],XC=[`disabled`],ZC=[`disabled`],QC={key:0},$C=[`disabled`],ew=[`disabled`],tw=[`disabled`];function nw(e,t,n,i,s,c){return a(),o(`div`,null,[M(`h3`,null,G(e.$t(`settings.permissions`)),1),M(`p`,qC,G(e.$t(`settings.permissionsHelp`)),1),M(`p`,null,[r(M(`input`,{type:`checkbox`,"onUpdate:modelValue":t[0]||(t[0]=e=>c.admin=e)},null,512),[[V,c.admin]]),H(` `+G(e.$t(`settings.administrator`)),1)]),M(`p`,null,[r(M(`input`,{type:`checkbox`,disabled:c.admin,"onUpdate:modelValue":t[1]||(t[1]=e=>n.perm.create=e)},null,8,JC),[[V,n.perm.create]]),H(` `+G(e.$t(`settings.perm.create`)),1)]),M(`p`,null,[r(M(`input`,{type:`checkbox`,disabled:c.admin,"onUpdate:modelValue":t[2]||(t[2]=e=>n.perm.delete=e)},null,8,YC),[[V,n.perm.delete]]),H(` `+G(e.$t(`settings.perm.delete`)),1)]),M(`p`,null,[r(M(`input`,{type:`checkbox`,disabled:c.admin,"onUpdate:modelValue":t[3]||(t[3]=e=>n.perm.download=e)},null,8,XC),[[V,n.perm.download]]),H(` `+G(e.$t(`settings.perm.download`)),1)]),M(`p`,null,[r(M(`input`,{type:`checkbox`,disabled:c.admin,"onUpdate:modelValue":t[4]||(t[4]=e=>n.perm.modify=e)},null,8,ZC),[[V,n.perm.modify]]),H(` `+G(e.$t(`settings.perm.modify`)),1)]),c.isExecEnabled?(a(),o(`p`,QC,[r(M(`input`,{type:`checkbox`,disabled:c.admin,"onUpdate:modelValue":t[5]||(t[5]=e=>n.perm.execute=e)},null,8,$C),[[V,n.perm.execute]]),H(` `+G(e.$t(`settings.perm.execute`)),1)])):b(``,!0),M(`p`,null,[r(M(`input`,{type:`checkbox`,disabled:c.admin,"onUpdate:modelValue":t[6]||(t[6]=e=>n.perm.rename=e)},null,8,ew),[[V,n.perm.rename]]),H(` `+G(e.$t(`settings.perm.rename`)),1)]),M(`p`,null,[r(M(`input`,{type:`checkbox`,disabled:c.admin,"onUpdate:modelValue":t[7]||(t[7]=e=>n.perm.share=e)},null,8,tw),[[V,n.perm.share]]),H(` `+G(e.$t(`settings.perm.share`)),1)])])}var rw=Q(KC,[[`render`,nw]]),iw={name:`permissions`,props:[`commands`],computed:{raw:{get(){return this.commands.join(` `)},set(e){e===``?this.$emit(`update:commands`,[]):this.$emit(`update:commands`,e.split(` `))}}}},aw={class:`small`};function ow(e,t,n,i,s,c){return a(),o(`div`,null,[M(`h3`,null,G(e.$t(`settings.userCommands`)),1),M(`p`,aw,[H(G(e.$t(`settings.userCommandsHelp`))+` `,1),t[1]||(t[1]=M(`i`,null,`git svn hg`,-1)),t[2]||(t[2]=H(`. `,-1))]),r(M(`input`,{class:`input input--block`,type:`text`,"onUpdate:modelValue":t[0]||(t[0]=e=>c.raw=e)},null,512),[[N,c.raw,void 0,{trim:!0}]])])}var sw=Q(iw,[[`render`,ow]]),cw={key:0},lw={for:`username`},uw={key:1},dw={for:`password`},fw=[`placeholder`],pw={for:`scope`},mw=[`disabled`,`placeholder`],hw={key:2,class:`small`},gw={for:`locale`},_w={key:3},vw=[`disabled`],yw={key:5},bw={class:`small`},xw=s({__name:`UserForm`,props:{user:{},isNew:{type:Boolean},isDefault:{type:Boolean},createUserDir:{type:Boolean}},setup(e){let{t}=B(),n=z(null),i=z(null),s=e;y(()=>{s.user.scope&&(i.value=s.user.scope,n.value=s.createUserDir)});let c=W(()=>s.isNew?``:t(`settings.avoidChanges`)),l=W(()=>n.value?t(`settings.userScopeGenerationPlaceholder`):``),u=W(()=>s.isNew&&n.value);return T(()=>s.user,()=>{s.user?.perm?.admin&&(s.user.lockPassword=!1)}),T(n,()=>{s.user?.scope&&(s.user.scope=n.value?``:i.value??``)}),(i,d)=>(a(),o(`div`,null,[!e.isDefault&&s.user!==null?(a(),o(`p`,cw,[M(`label`,lw,G(F(t)(`settings.username`)),1),r(M(`input`,{class:`input input--block`,type:`text`,"onUpdate:modelValue":d[0]||(d[0]=t=>e.user.username=t),id:`username`},null,512),[[N,e.user.username]])])):b(``,!0),e.isDefault?b(``,!0):(a(),o(`p`,uw,[M(`label`,dw,G(F(t)(`settings.password`)),1),r(M(`input`,{class:`input input--block`,type:`password`,placeholder:c.value,"onUpdate:modelValue":d[1]||(d[1]=t=>e.user.password=t),id:`password`},null,8,fw),[[N,e.user.password]])])),M(`p`,null,[M(`label`,pw,G(F(t)(`settings.scope`)),1),r(M(`input`,{disabled:n.value??!1,placeholder:l.value,class:`input input--block`,type:`text`,"onUpdate:modelValue":d[2]||(d[2]=t=>e.user.scope=t),id:`scope`},null,8,mw),[[N,e.user.scope]])]),u.value?(a(),o(`p`,hw,[r(M(`input`,{type:`checkbox`,"onUpdate:modelValue":d[3]||(d[3]=e=>n.value=e)},null,512),[[V,n.value]]),H(` `+G(F(t)(`settings.createUserHomeDirectory`)),1)])):b(``,!0),M(`p`,null,[M(`label`,gw,G(F(t)(`settings.language`)),1),x(IC,{class:`input input--block`,id:`locale`,locale:e.user.locale,"onUpdate:locale":d[4]||(d[4]=t=>e.user.locale=t)},null,8,[`locale`])]),!e.isDefault&&e.user.perm?(a(),o(`p`,_w,[r(M(`input`,{type:`checkbox`,disabled:e.user.perm.admin,"onUpdate:modelValue":d[5]||(d[5]=t=>e.user.lockPassword=t)},null,8,vw),[[V,e.user.lockPassword]]),H(` `+G(F(t)(`settings.lockPassword`)),1)])):b(``,!0),x(rw,{perm:e.user.perm,"onUpdate:perm":d[6]||(d[6]=t=>e.user.perm=t)},null,8,[`perm`]),F(Ge)?(a(),U(sw,{key:4,commands:e.user.commands,"onUpdate:commands":d[7]||(d[7]=t=>e.user.commands=t)},null,8,[`commands`])):b(``,!0),e.isDefault?b(``,!0):(a(),o(`div`,yw,[M(`h3`,null,G(F(t)(`settings.rules`)),1),M(`p`,bw,G(F(t)(`settings.rulesHelp`)),1),x(GC,{rules:e.user.rules,"onUpdate:rules":d[8]||(d[8]=t=>e.user.rules=t)},null,8,[`rules`])]))]))}}),Sw={key:1,class:`row`},Cw={class:`column`},ww={class:`card-title`},Tw={key:0},Ew={key:1},Dw={key:0,class:`card-content`},Ow={class:`card-action`},kw=[`aria-label`,`title`],Aw=[`aria-label`,`title`],jw=[`value`],Mw=s({__name:`User`,setup(e){let t=z(),n=z(),r=z(),i=z(!1),s=z(!1),c=L(`$showError`),l=L(`$showSuccess`),u=hd(),d=X(),f=yi(),p=vi(),{t:m}=B();y(()=>{g()});let h=W(()=>f.path===`/settings/users/new`);T(f,()=>g()),T(r,()=>{r.value?.perm.admin&&(r.value.lockPassword=!1)});let g=async()=>{d.loading=!0;try{if(h.value){let{defaults:e,createUserDir:t}=await Vh();s.value=ze==`json`,i.value=t,r.value={...e,username:``,password:``,rules:[],lockPassword:!1,id:0}}else{let{authMethod:e}=await Vh();s.value=e==`json`;let t=Array.isArray(f.params.id)?f.params.id.join(``):f.params.id;r.value={...await Lh(parseInt(t))}}}catch(e){e instanceof Error&&(t.value=e)}finally{d.loading=!1}},_=()=>{s.value?d.showHover({prompt:`current-password`,confirm:(e,t)=>{e.preventDefault(),d.closeHovers(),S(t)}}):d.showHover({prompt:`deleteUser`,confirm:()=>S(``)})},S=async e=>{if(!r.value)return!1;try{await Bh(r.value.id,e),r.value.id==u.user?.id?Td():p.push({path:`/settings/users`}),l(m(`settings.userDeleted`))}catch(e){e instanceof Ad?e.status===403?c(m(`errors.forbidden`)):c(e):e instanceof Error&&c(e)}return!0},C=e=>(e.preventDefault(),s.value?d.showHover({prompt:`current-password`,confirm:(e,t)=>{e.preventDefault(),d.closeHovers(),E(t)}}):E(``),!0),E=async e=>{if(!r.value)return!1;try{if(h.value){let t=await Rh({...n?.value,...r.value},e);p.push({path:t||`/settings/users`}),l(m(`settings.userCreated`))}else await zh(r.value,[`all`],e),r.value.id===u.user?.id&&u.updateUser(r.value),l(m(`settings.userUpdated`))}catch(e){c(e)}};return(e,n)=>{let s=w(`router-link`);return t.value?(a(),U(Cx,{key:0,errorCode:t.value.status},null,8,[`errorCode`])):F(d).loading?b(``,!0):(a(),o(`div`,Sw,[M(`div`,Cw,[M(`form`,{onSubmit:C,class:`card`},[M(`div`,ww,[r.value?.id===0?(a(),o(`h2`,Tw,G(e.$t(`settings.newUser`)),1)):(a(),o(`h2`,Ew,G(e.$t(`settings.user`))+` `+G(r.value?.username),1))]),r.value?(a(),o(`div`,Dw,[x(xw,{user:r.value,"onUpdate:user":n[0]||(n[0]=e=>r.value=e),createUserDir:i.value,"onUpdate:createUserDir":n[1]||(n[1]=e=>i.value=e),isDefault:!1,isNew:h.value},null,8,[`user`,`createUserDir`,`isNew`])])):b(``,!0),M(`div`,Ow,[h.value?b(``,!0):(a(),o(`button`,{key:0,onClick:ie(_,[`prevent`]),type:`button`,class:`button button--flat button--red`,"aria-label":e.$t(`buttons.delete`),title:e.$t(`buttons.delete`)},G(e.$t(`buttons.delete`)),9,kw)),x(s,{to:`/settings/users`},{default:v(()=>[M(`button`,{class:`button button--flat button--grey`,"aria-label":e.$t(`buttons.cancel`),title:e.$t(`buttons.cancel`)},G(e.$t(`buttons.cancel`)),9,Aw)]),_:1}),M(`input`,{class:`button button--flat`,type:`submit`,value:e.$t(`buttons.save`)},null,8,jw)])],32)])]))}}}),Nw={class:`dashboard`},Pw={id:`nav`},Fw={class:`wrapper`},Iw={key:0},Lw={class:`message delayed`},Rw=s({__name:`Settings`,setup(e){let{t}=B(),n=hd(),r=X(),i=W(()=>n.user),s=W(()=>r.loading);return(e,n)=>{let r=w(`router-link`),c=w(`router-view`);return a(),o(`div`,Nw,[x(vx,{showMenu:``,showLogo:``}),M(`div`,Pw,[M(`div`,Fw,[M(`ul`,null,[x(r,{to:`/settings/profile`},{default:v(()=>[M(`li`,{class:k({active:e.$route.path===`/settings/profile`})},G(F(t)(`settings.profileSettings`)),3)]),_:1}),i.value?.perm.share?(a(),U(r,{key:0,to:`/settings/shares`},{default:v(()=>[M(`li`,{class:k({active:e.$route.path===`/settings/shares`})},G(F(t)(`settings.shareManagement`)),3)]),_:1})):b(``,!0),i.value?.perm.admin?(a(),U(r,{key:1,to:`/settings/global`},{default:v(()=>[M(`li`,{class:k({active:e.$route.path===`/settings/global`})},G(F(t)(`settings.globalSettings`)),3)]),_:1})):b(``,!0),i.value?.perm.admin?(a(),U(r,{key:2,to:`/settings/users`},{default:v(()=>[M(`li`,{class:k({active:e.$route.path===`/settings/users`||e.$route.name===`User`})},G(F(t)(`settings.userManagement`)),3)]),_:1})):b(``,!0)])])]),s.value?(a(),o(`div`,Iw,[M(`h2`,Lw,[n[0]||(n[0]=M(`div`,{class:`spinner`},[M(`div`,{class:`bounce1`}),M(`div`,{class:`bounce2`}),M(`div`,{class:`bounce3`})],-1)),M(`span`,null,G(F(t)(`files.loading`)),1)])])):b(``,!0),x(c)])}}}),zw=[`value`],Bw={value:``},Vw={value:`light`},Hw={value:`dark`},Uw=s({__name:`Themes`,props:{theme:{}},emits:[`update:theme`],setup(e,{emit:t}){let{t:n}=B(),r=t,i=e=>{r(`update:theme`,e.target?.value)};return(t,r)=>(a(),o(`select`,{onChange:i,value:e.theme},[M(`option`,Bw,G(F(n)(`settings.themes.default`)),1),M(`option`,Vw,G(F(n)(`settings.themes.light`)),1),M(`option`,Hw,G(F(n)(`settings.themes.dark`)),1)],40,zw))}}),Ww=n(((e,t)=>{(function(){var e=`ace`,t=(function(){return this})();if(!t&&typeof window<`u`&&(t=window),!e&&typeof requirejs<`u`)return;var n=function(e,t,r){if(typeof e!=`string`){n.original?n.original.apply(this,arguments):(console.error(`dropping module because define wasn't a string.`),console.trace());return}arguments.length==2&&(r=t),n.modules[e]||(n.payloads[e]=r,n.modules[e]=null)};n.modules={},n.payloads={};var r=function(e,t,n){if(typeof t==`string`){var r=o(e,t);if(r!=null)return n&&n(),r}else if(Object.prototype.toString.call(t)===`[object Array]`){for(var a=[],s=0,c=t.length;sn.length)&&(t=n.length),t-=e.length;var r=n.indexOf(e,t);return r!==-1&&r===t}),String.prototype.repeat||r(String.prototype,`repeat`,function(e){for(var t=``,n=this;e>0;)e&1&&(t+=n),(e>>=1)&&(n+=n);return t}),String.prototype.includes||r(String.prototype,`includes`,function(e,t){return this.indexOf(e,t)!=-1}),Object.assign||(Object.assign=function(e){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n>>0,r=arguments[1]>>0,i=r<0?Math.max(n+r,0):Math.min(r,n),a=arguments[2],o=a===void 0?n:a>>0,s=o<0?Math.max(n+o,0):Math.min(o,n);i0;)t&1&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,``)},t.stringTrimRight=function(e){return e.replace(i,``)},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;n65535?2:1}}),ace.define(`ace/lib/useragent`,[`require`,`exports`,`module`],function(e,t,n){t.OS={LINUX:`LINUX`,MAC:`MAC`,WINDOWS:`WINDOWS`},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r=typeof navigator==`object`?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||[`other`])[0].toLowerCase(),a=r.userAgent||``,o=r.appName||``;t.isWin=i==`win`,t.isMac=i==`mac`,t.isLinux=i==`linux`,t.isIE=o==`Microsoft Internet Explorer`||o.indexOf(`MSAppHost`)>=0?parseFloat((a.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((a.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=a.match(/ Gecko\/\d+/),t.isOpera=typeof opera==`object`&&Object.prototype.toString.call(window.opera)==`[object Opera]`,t.isWebKit=parseFloat(a.split(`WebKit/`)[1])||void 0,t.isChrome=parseFloat(a.split(` Chrome/`)[1])||void 0,t.isSafari=parseFloat(a.split(` Safari/`)[1])&&!t.isChrome||void 0,t.isEdge=parseFloat(a.split(` Edge/`)[1])||void 0,t.isAIR=a.indexOf(`AdobeAIR`)>=0,t.isAndroid=a.indexOf(`Android`)>=0,t.isChromeOS=a.indexOf(` CrOS `)>=0,t.isIOS=/iPad|iPhone|iPod/.test(a)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define(`ace/lib/dom`,[`require`,`exports`,`module`,`ace/lib/useragent`],function(e,t,n){var r=e(`./useragent`),i=`http://www.w3.org/1999/xhtml`;t.buildDom=function e(t,n,r){if(typeof t==`string`&&t){var i=document.createTextNode(t);return n&&n.appendChild(i),i}if(!Array.isArray(t))return t&&t.appendChild&&n&&n.appendChild(t),t;if(typeof t[0]!=`string`||!t[0]){for(var a=[],o=0;o`u`)){if(o){if(r)s();else if(r===!1)return o.push([e,n])}if(!a){var i=r;!r||!r.getRootNode?i=document:(i=r.getRootNode(),(!i||i==r)&&(i=document));var c=i.ownerDocument||i;if(n&&t.hasCssString(n,i))return null;n&&(e+=` /*# sourceURL=ace/css/`+n+` */`);var l=t.createElement(`style`);l.appendChild(c.createTextNode(e)),n&&(l.id=n),i==c&&(i=t.getDocumentHead(c)),i.insertBefore(l,i.firstChild)}}}if(t.importCssString=c,t.importCssStylsheet=function(e,n){t.buildDom([`link`,{rel:`stylesheet`,href:e}],t.getDocumentHead(n))},t.$fixPositionBug=function(e){var t=e.getBoundingClientRect();if(e.style.left){var n=parseFloat(e.style.left),r=+t.left;Math.abs(n-r)>1&&(e.style.left=2*n-r+`px`)}if(e.style.right){var n=parseFloat(e.style.right),r=window.innerWidth-t.right;Math.abs(n-r)>1&&(e.style.right=2*n-r+`px`)}if(e.style.top){var n=parseFloat(e.style.top),r=+t.top;Math.abs(n-r)>1&&(e.style.top=2*n-r+`px`)}if(e.style.bottom){var n=parseFloat(e.style.bottom),r=window.innerHeight-t.bottom;Math.abs(n-r)>1&&(e.style.bottom=2*n-r+`px`)}},t.scrollbarWidth=function(e){var n=t.createElement(`ace_inner`);n.style.width=`100%`,n.style.minWidth=`0px`,n.style.height=`200px`,n.style.display=`block`;var r=t.createElement(`ace_outer`),i=r.style;i.position=`absolute`,i.left=`-10000px`,i.overflow=`hidden`,i.width=`200px`,i.minWidth=`0px`,i.height=`150px`,i.display=`block`,r.appendChild(n);var a=e&&e.documentElement||document&&document.documentElement;if(!a)return 0;a.appendChild(r);var o=n.offsetWidth;i.overflow=`scroll`;var s=n.offsetWidth;return o===s&&(s=r.clientWidth),a.removeChild(r),o-s},t.computedStyle=function(e,t){return window.getComputedStyle(e,``)||{}},t.setStyle=function(e,t,n){e[t]!==n&&(e[t]=n)},t.HAS_CSS_ANIMATION=!1,t.HAS_CSS_TRANSFORMS=!1,t.HI_DPI=r.isWin?typeof window<`u`&&window.devicePixelRatio>=1.5:!0,r.isChromeOS&&(t.HI_DPI=!1),typeof document<`u`){var l=document.createElement(`div`);t.HI_DPI&&l.style.transform!==void 0&&(t.HAS_CSS_TRANSFORMS=!0),!r.isEdge&&l.style.animationName!==void 0&&(t.HAS_CSS_ANIMATION=!0),l=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform=`translate(`+Math.round(t)+`px, `+Math.round(n)+`px)`}:t.translate=function(e,t,n){e.style.top=Math.round(n)+`px`,e.style.left=Math.round(t)+`px`}}),ace.define(`ace/lib/net`,[`require`,`exports`,`module`,`ace/lib/dom`],function(e,t,n){var r=e(`./dom`);t.get=function(e,t){var n=new XMLHttpRequest;n.open(`GET`,e,!0),n.onreadystatechange=function(){n.readyState===4&&t(n.responseText)},n.send(null)},t.loadScript=function(e,t){var n=r.getDocumentHead(),i=document.createElement(`script`);i.src=e,n.appendChild(i),i.onload=i.onreadystatechange=function(e,n){(n||!i.readyState||i.readyState==`loaded`||i.readyState==`complete`)&&(i=i.onload=i.onreadystatechange=null,n||t())}},t.qualifyURL=function(e){var t=document.createElement(`a`);return t.href=e,t.href}}),ace.define(`ace/lib/oop`,[`require`,`exports`,`module`],function(e,t,n){t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define(`ace/lib/event_emitter`,[`require`,`exports`,`module`],function(e,t,n){var r={},i=function(){this.propagationStopped=!0},a=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!(!n.length&&!r)){(typeof t!=`object`||!t)&&(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=i),t.preventDefault||(t.preventDefault=a),n=n.slice();for(var o=0;o1&&(i=n[n.length-2]);var o=s[t+`Path`];return o==null?o=s.basePath:r==`/`&&(t=r=``),o&&o.slice(-1)!=`/`&&(o+=`/`),o+t+r+i+this.get(`suffix`)},t.setModuleUrl=function(e,t){return s.$moduleUrls[e]=t};var c=function(t,n){if(t===`ace/theme/textmate`||t===`./theme/textmate`)return n(null,e(`./theme/textmate`));if(l)return l(t,n);console.error(`loader is not configured`)},l;t.setLoader=function(e){l=e},t.dynamicModules=Object.create(null),t.$loading={},t.$loaded={},t.loadModule=function(e,n){var r;if(Array.isArray(e))var a=e[0],o=e[1];else if(typeof e==`string`)var o=e;var s=function(e){if(e&&!t.$loading[o])return n&&n(e);if(t.$loading[o]||(t.$loading[o]=[]),t.$loading[o].push(n),!(t.$loading[o].length>1)){var r=function(){c(o,function(e,n){n&&(t.$loaded[o]=n),t._emit(`load.module`,{name:o,module:n});var r=t.$loading[o];t.$loading[o]=null,r.forEach(function(e){e&&e(n)})})};if(!t.get(`packaged`))return r();i.loadScript(t.moduleUrl(o,a),r),u()}};if(t.dynamicModules[o])t.dynamicModules[o]().then(function(e){e.default?s(e.default):s(e)});else{try{r=this.$require(o)}catch{}s(r||t.$loaded[o])}},t.$require=function(e){if(typeof n.require==`function`)return n.require(e)},t.setModuleLoader=function(e,n){t.dynamicModules[e]=n};var u=function(){!s.basePath&&!s.workerPath&&!s.modePath&&!s.themePath&&!Object.keys(s.$moduleUrls).length&&(console.error(`Unable to infer path to ace from script src,`,`use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes`,`or with webpack use ace/webpack-resolver`),u=function(){})};t.version=`1.43.6`}),ace.define(`ace/loader_build`,[`require`,`exports`,`module`,`ace/lib/fixoldbrowsers`,`ace/config`],function(e,t,n){e(`./lib/fixoldbrowsers`);var r=e(`./config`);r.setLoader(function(t,n){e([t],function(e){n(null,e)})});var i=(function(){return this||typeof window<`u`&&window})();n.exports=function(t){r.init=a,r.$require=e,t.require=e,typeof define==`function`&&(t.define=define)},a(!0);function a(t){if(!(!i||!i.document)){r.set(`packaged`,t||e.packaged||n.packaged||i.define&&define.packaged);var a={},s=``,c=document.currentScript||document._currentScript,l=c&&c.ownerDocument||document;c&&c.src&&(s=c.src.split(/[?#]/)[0].split(`/`).slice(0,-1).join(`/`)||``);for(var u=l.getElementsByTagName(`script`),d=0;d [`+this.end.row+`/`+this.end.column+`]`},e.prototype.contains=function(e,t){return this.compare(e,t)==0},e.prototype.compareRange=function(e){var t,n=e.end,r=e.start;return t=this.compare(n.row,n.column),t==1?(t=this.compare(r.row,r.column),t==1?2:t==0?1:0):t==-1?-2:(t=this.compare(r.row,r.column),t==-1?-1:t==1?42:0)},e.prototype.comparePoint=function(e){return this.compare(e.row,e.column)},e.prototype.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},e.prototype.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},e.prototype.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},e.prototype.isStart=function(e,t){return this.start.row==e&&this.start.column==t},e.prototype.setStart=function(e,t){typeof e==`object`?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},e.prototype.setEnd=function(e,t){typeof e==`object`?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},e.prototype.inside=function(e,t){return this.compare(e,t)==0?!(this.isEnd(e,t)||this.isStart(e,t)):!1},e.prototype.insideStart=function(e,t){return this.compare(e,t)==0?!this.isEnd(e,t):!1},e.prototype.insideEnd=function(e,t){return this.compare(e,t)==0?!this.isStart(e,t):!1},e.prototype.compare=function(e,t){return!this.isMultiLine()&&e===this.start.row?tthis.end.column?1:0:ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0},e.prototype.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},e.prototype.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},e.prototype.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},e.prototype.clipRows=function(t,n){if(this.end.row>n)var r={row:n+1,column:0};else if(this.end.rown)var i={row:n+1,column:0};else if(this.start.row1?(s++,s>4&&(s=1)):s=1:s=0,i.isIE){var o=Math.abs(e.clientX-c)>5||Math.abs(e.clientY-l)>5;(!u||o)&&(s=1),u&&clearTimeout(u),u=setTimeout(function(){u=null},n[s-1]||600),s==1&&(c=e.clientX,l=e.clientY)}if(e._clicks=s,r[a](`mousedown`,e),s>4)s=0;else if(s>1)return r[a](f[s],e)}Array.isArray(e)||(e=[e]),e.forEach(function(e){d(e,`mousedown`,p,o)})};function p(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}t.getModifierString=function(e){return r.KEY_MODS[p(e)]};function m(e,t,n){var s=p(t);if(!n&&t.code&&(n=r.$codeToKeyCode[t.code]||n),!i.isMac&&a){if(t.getModifierState&&(t.getModifierState(`OS`)||t.getModifierState(`Win`))&&(s|=8),a.altGr)if((3&s)!=3)a.altGr=0;else return;if(n===18||n===17){var c=t.location;n===17&&c===1?a[n]==1&&(o=t.timeStamp):n===18&&s===3&&c===2&&t.timeStamp-o<50&&(a.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),!(!s&&n===13&&t.location===3&&(e(t,s,-n),t.defaultPrevented))){if(i.isChromeOS&&s&8){if(e(t,s,n),t.defaultPrevented)return;s&=-9}return!s&&!(n in r.FUNCTION_KEYS)&&!(n in r.PRINTABLE_KEYS)?!1:e(t,s,n)}}t.addCommandKeyListener=function(e,n,r){var i=null;d(e,`keydown`,function(e){a[e.keyCode]=(a[e.keyCode]||0)+1;var t=m(n,e,e.keyCode);return i=e.defaultPrevented,t},r),d(e,`keypress`,function(e){i&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),i=null)},r),d(e,`keyup`,function(e){a[e.keyCode]=null},r),a||(h(),d(window,`focus`,h))};function h(){a=Object.create(null)}if(typeof window==`object`&&window.postMessage&&!i.isOldIE){var g=1;t.nextTick=function(e,n){n=n||window;var r=`zero-timeout-message-`+ g++,i=function(a){a.data==r&&(t.stopPropagation(a),f(n,`message`,i),e())};d(n,`message`,i),n.postMessage(r,`*`)}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function n(){t.$idleBlocked?setTimeout(n,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame=typeof window==`object`&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define(`ace/clipboard`,[`require`,`exports`,`module`],function(e,t,n){var r;n.exports={lineMode:!1,pasteCancelled:function(){return r&&r>Date.now()-50?!0:r=!1},cancel:function(){r=Date.now()}}}),ace.define(`ace/keyboard/textinput`,[`require`,`exports`,`module`,`ace/lib/event`,`ace/config`,`ace/lib/useragent`,`ace/lib/dom`,`ace/lib/lang`,`ace/clipboard`,`ace/lib/keys`],function(e,t,n){var r=e(`../lib/event`),i=e(`../config`).nls,a=e(`../lib/useragent`),o=e(`../lib/dom`),s=e(`../lib/lang`),c=e(`../clipboard`),l=a.isChrome<18,u=a.isIE,d=a.isChrome>63,f=400,p=e(`../lib/keys`),m=p.KEY_MODS,h=a.isIOS,g=h?/\s/:/\n/,_=a.isMobile;t.TextInput=function(){function e(e,t){var n=this;this.host=t,this.text=o.createElement(`textarea`),this.text.className=`ace_text-input`,this.text.setAttribute(`wrap`,`off`),this.text.setAttribute(`autocomplete`,`off`),this.text.setAttribute(`autocorrect`,`off`),this.text.setAttribute(`autocapitalize`,`off`),this.text.setAttribute(`spellcheck`,`false`),this.text.style.opacity=`0`,e.insertBefore(this.text,e.firstChild),this.copied=!1,this.pasted=!1,this.inComposition=!1,this.sendingText=!1,this.tempStyle=``,_||(this.text.style.fontSize=`1px`),this.commandMode=!1,this.ignoreFocusEvents=!1,this.lastValue=``,this.lastSelectionStart=0,this.lastSelectionEnd=0,this.lastRestoreEnd=0,this.rowStart=2**53-1,this.rowEnd=-(2**53-1),this.numberOfExtraLines=0;try{this.$isFocused=document.activeElement===this.text}catch{}this.cancelComposition=this.cancelComposition.bind(this),this.setAriaOptions({role:`textbox`}),r.addListener(this.text,`blur`,function(e){n.ignoreFocusEvents||(t.onBlur(e),n.$isFocused=!1)},t),r.addListener(this.text,`focus`,function(e){if(!n.ignoreFocusEvents){if(n.$isFocused=!0,a.isEdge)try{if(!document.hasFocus())return}catch{}t.onFocus(e),a.isEdge?setTimeout(n.resetSelection.bind(n)):n.resetSelection()}},t),this.$focusScroll=!1,t.on(`beforeEndOperation`,function(){var e=t.curOp,r=e&&e.command&&e.command.name;if(r!=`insertstring`){var i=r&&(e.docChanged||e.selectionChanged);n.inComposition&&i&&(n.lastValue=n.text.value=``,n.onCompositionEnd()),n.resetSelection()}}),t.on(`changeSelection`,this.setAriaLabel.bind(this)),this.resetSelection=h?this.$resetSelectionIOS:this.$resetSelection,this.$isFocused&&t.onFocus(),this.inputHandler=null,this.afterContextMenu=!1,r.addCommandKeyListener(this.text,function(e,r,i){if(!n.inComposition)return t.onCommandKey(e,r,i)},t),r.addListener(this.text,`select`,this.onSelect.bind(this),t),r.addListener(this.text,`input`,this.onInput.bind(this),t),r.addListener(this.text,`cut`,this.onCut.bind(this),t),r.addListener(this.text,`copy`,this.onCopy.bind(this),t),r.addListener(this.text,`paste`,this.onPaste.bind(this),t),(!(`oncut`in this.text)||!(`oncopy`in this.text)||!(`onpaste`in this.text))&&r.addListener(e,`keydown`,function(e){if(!(a.isMac&&!e.metaKey||!e.ctrlKey))switch(e.keyCode){case 67:n.onCopy(e);break;case 86:n.onPaste(e);break;case 88:n.onCut(e);break}},t),this.syncComposition=s.delayedCall(this.onCompositionUpdate.bind(this),50).schedule.bind(null,null),r.addListener(this.text,`compositionstart`,this.onCompositionStart.bind(this),t),r.addListener(this.text,`compositionupdate`,this.onCompositionUpdate.bind(this),t),r.addListener(this.text,`keyup`,this.onKeyup.bind(this),t),r.addListener(this.text,`keydown`,this.syncComposition.bind(this),t),r.addListener(this.text,`compositionend`,this.onCompositionEnd.bind(this),t),this.closeTimeout,r.addListener(this.text,`mouseup`,this.$onContextMenu.bind(this),t),r.addListener(this.text,`mousedown`,function(e){e.preventDefault(),n.onContextMenuClose()},t),r.addListener(t.renderer.scroller,`contextmenu`,this.$onContextMenu.bind(this),t),r.addListener(this.text,`contextmenu`,this.$onContextMenu.bind(this),t),h&&this.addIosSelectionHandler(e,t,this.text)}return e.prototype.addIosSelectionHandler=function(e,t,n){var r=this,i=null,a=!1;n.addEventListener(`keydown`,function(e){i&&clearTimeout(i),a=!0},!0),n.addEventListener(`keyup`,function(e){i=setTimeout(function(){a=!1},100)},!0);var o=function(e){if(document.activeElement===n&&!(a||r.inComposition||t.$mouseHandler.isMousePressed)&&!r.copied){var i=n.selectionStart,o=n.selectionEnd,s=null,c=0;if(i==0?s=p.up:i==1?s=p.home:o>r.lastSelectionEnd&&r.lastValue[o]==` `?s=p.end:ir.lastSelectionEnd&&r.lastValue.slice(0,o).split(` `).length>2?s=p.down:o>r.lastSelectionEnd&&r.lastValue[o-1]==` `?(s=p.right,c=m.option):(o>r.lastSelectionEnd||o==r.lastSelectionEnd&&r.lastSelectionEnd!=r.lastSelectionStart&&i==o)&&(s=p.right),i!==o&&(c|=m.shift),s){if(!t.onCommandKey({},c,s)&&t.commands){s=p.keyCodeToString(s);var l=t.commands.findKeyCommand(c,s);l&&t.execCommand(l)}r.lastSelectionStart=i,r.lastSelectionEnd=o,r.resetSelection(``)}}};document.addEventListener(`selectionchange`,o),t.on(`destroy`,function(){document.removeEventListener(`selectionchange`,o)})},e.prototype.onContextMenuClose=function(){var e=this;clearTimeout(this.closeTimeout),this.closeTimeout=setTimeout(function(){e.tempStyle&&(e.text.style.cssText=e.tempStyle,e.tempStyle=``),e.host.renderer.$isMousePressed=!1,e.host.renderer.$keepTextAreaAtCursor&&e.host.renderer.$moveTextAreaToCursor()},0)},e.prototype.$onContextMenu=function(e){this.host.textInput.onContextMenu(e),this.onContextMenuClose()},e.prototype.onKeyup=function(e){e.keyCode==27&&this.text.value.lengthf+100||g.test(n)||_&&this.lastSelectionStart<1&&this.lastSelectionStart==this.lastSelectionEnd)&&this.resetSelection()},e.prototype.sendText=function(e,t){if(this.afterContextMenu&&(this.afterContextMenu=!1),this.pasted)return this.resetSelection(),e&&this.host.onPaste(e),this.pasted=!1,``;for(var n=this.text.selectionStart,r=this.text.selectionEnd,i=this.lastSelectionStart,o=this.lastValue.length-this.lastSelectionEnd,s=e,c=e.length-n,l=e.length-r,u=0;i>0&&this.lastValue[u]==e[u];)u++,i--;for(s=s.slice(u),u=1;o>0&&this.lastValue.length-u>this.lastSelectionStart-1&&this.lastValue[this.lastValue.length-u]==e[e.length-u];)u++,o--;c-=u-1,l-=u-1;var d=s.length-u+1;if(d<0&&(i=-d,d=0),s=s.slice(0,d),!t&&!s&&!c&&!i&&!o&&!l)return``;this.sendingText=!0;var f=!1;return a.isAndroid&&s==`. `&&(s=` `,f=!0),s&&!i&&!o&&!c&&!l||this.commandMode?this.host.onTextInput(s):this.host.onTextInput(s,{extendLeft:i,extendRight:o,restoreStart:c,restoreEnd:l}),this.sendingText=!1,this.lastValue=e,this.lastSelectionStart=n,this.lastSelectionEnd=r,this.lastRestoreEnd=l,f?` `:s},e.prototype.onSelect=function(e){var t=this;this.inComposition||(this.copied?this.copied=!1:function(e){return e.selectionStart===0&&e.selectionEnd>=t.lastValue.length&&e.value===t.lastValue&&t.lastValue&&e.selectionEnd!==t.lastSelectionEnd}(this.text)?(this.host.selectAll(),this.resetSelection()):_&&this.text.selectionStart!=this.lastSelectionStart&&this.resetSelection())},e.prototype.$resetSelectionIOS=function(e){if(!(!this.$isFocused||this.copied&&!e||this.sendingText)){e||(e=``);var t=` ab`+e+`cde fg `;t!=this.text.value&&(this.text.value=this.lastValue=t);var n=4,r=4+(e.length||(this.host.selection.isEmpty()?0:1));(this.lastSelectionStart!=n||this.lastSelectionEnd!=r)&&this.text.setSelectionRange(n,r),this.lastSelectionStart=n,this.lastSelectionEnd=r}},e.prototype.$resetSelection=function(){var e=this;if(!(this.inComposition||this.sendingText)&&!(!this.$isFocused&&!this.afterContextMenu)){this.inComposition=!0;var t=0,n=0,r=``,i=function(t,n){for(var r=n,i=1;i<=t-e.rowStart&&i<2*e.numberOfExtraLines+1;i++)r+=e.host.session.getLine(t-i).length+1;return r};if(this.host.session){var a=this.host.selection,o=a.getRange(),s=a.cursor.row;s===this.rowEnd+1?(this.rowStart=this.rowEnd+1,this.rowEnd=this.rowStart+2*this.numberOfExtraLines):s===this.rowStart-1?(this.rowEnd=this.rowStart-1,this.rowStart=this.rowEnd-2*this.numberOfExtraLines):(sthis.rowEnd+1)&&(this.rowStart=s>this.numberOfExtraLines?s-this.numberOfExtraLines:0,this.rowEnd=s>this.numberOfExtraLines?s+this.numberOfExtraLines:2*this.numberOfExtraLines);for(var c=[],l=this.rowStart;l<=this.rowEnd;l++)c.push(this.host.session.getLine(l));if(r=c.join(` `),t=i(o.start.row,o.start.column),n=i(o.end.row,o.end.column),o.start.rowthis.rowEnd){var d=this.host.session.getLine(this.rowEnd+1);n=o.end.row>this.rowEnd+1?d.length:o.end.column,n+=r.length+1,r=r+` `+d}else _&&s>0&&(r=` `+r,n+=1,t+=1);r.length>f&&(t1),e.preventDefault()},e.prototype.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.setStyle(`ace_selecting`),this.setState(`select`))},e.prototype.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(r==-1)e=this.$clickSelection.end;else if(r==1)e=this.$clickSelection.start;else{var i=c(this.$clickSelection,n,t.session);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},e.prototype.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var a=this.$clickSelection.comparePoint(i.start),o=this.$clickSelection.comparePoint(i.end);if(a==-1&&o<=0)t=this.$clickSelection.end,(i.end.row!=r.row||i.end.column!=r.column)&&(r=i.start);else if(o==1&&a>=0)t=this.$clickSelection.start,(i.start.row!=r.row||i.start.column!=r.column)&&(r=i.end);else if(a==-1&&o==1)r=i.end,t=i.start;else{var s=c(this.$clickSelection,r,n.session);r=s.cursor,t=s.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},e.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle(`ace_selecting`)},e.prototype.focusWait=function(){(s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>i||Date.now()-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},e.prototype.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState(`select`)):(r=n.selection.getWordRange(t.row,t.column),this.setState(`selectByWords`)),this.$clickSelection=r,this.select()},e.prototype.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState(`selectByLines`);var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},e.prototype.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState(`selectAll`)},e.prototype.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,o=i?e.wheelX/i:n.vx,s=i?e.wheelY/i:n.vy;i=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),c<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=r:r-n.allowedt.clientHeight||e.preventDefault()}}),ace.define(`ace/tooltip`,[`require`,`exports`,`module`,`ace/lib/dom`,`ace/lib/event`,`ace/range`,`ace/lib/scroll`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=this&&this.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},a=e(`./lib/dom`);e(`./lib/event`);var o=e(`./range`).Range,s=e(`./lib/scroll`).preventParentScroll,c=`ace_tooltip`,l=function(){function e(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}return e.prototype.$init=function(){return this.$element=a.createElement(`div`),this.$element.className=c,this.$element.style.display=`none`,this.$parentNode.appendChild(this.$element),this.$element},e.prototype.getElement=function(){return this.$element||this.$init()},e.prototype.setText=function(e){this.getElement().textContent=e},e.prototype.setHtml=function(e){this.getElement().innerHTML=e},e.prototype.setPosition=function(e,t){this.getElement().style.left=e+`px`,this.getElement().style.top=t+`px`},e.prototype.setClassName=function(e){a.addCssClass(this.getElement(),e)},e.prototype.setTheme=function(e){this.theme&&(this.theme.isDark&&a.removeCssClass(this.getElement(),`ace_dark`),this.theme.cssClass&&a.removeCssClass(this.getElement(),this.theme.cssClass)),e.isDark&&a.addCssClass(this.getElement(),`ace_dark`),e.cssClass&&a.addCssClass(this.getElement(),e.cssClass),this.theme={isDark:e.isDark,cssClass:e.cssClass}},e.prototype.show=function(e,t,n){e!=null&&this.setText(e),t!=null&&n!=null&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display=`block`,this.isOpen=!0)},e.prototype.hide=function(e){this.isOpen&&(this.getElement().style.display=`none`,this.getElement().className=c,this.isOpen=!1)},e.prototype.getHeight=function(){return this.getElement().offsetHeight},e.prototype.getWidth=function(){return this.getElement().offsetWidth},e.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},e}(),u=new(function(){function e(){this.popups=[]}return e.prototype.addPopup=function(e){this.popups.push(e),this.updatePopups()},e.prototype.removePopup=function(e){var t=this.popups.indexOf(e);t!==-1&&(this.popups.splice(t,1),this.updatePopups())},e.prototype.updatePopups=function(){var e,t,n,r;this.popups.sort(function(e,t){return t.priority-e.priority});var a=[];try{for(var o=i(this.popups),s=o.next();!s.done;s=o.next()){var c=s.value,l=!0;try{for(var u=(n=void 0,i(a)),d=u.next();!d.done;d=u.next()){var f=d.value;if(this.doPopupsOverlap(f,c)){l=!1;break}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}l?a.push(c):c.hide()}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}},e.prototype.doPopupsOverlap=function(e,t){var n=e.getElement().getBoundingClientRect(),r=t.getElement().getBoundingClientRect();return n.leftr.left&&n.topr.top},e}());t.popupManager=u,t.Tooltip=l,t.HoverTooltip=function(e){r(t,e);function t(t){t===void 0&&(t=document.body);var n=e.call(this,t)||this;n.timeout=void 0,n.lastT=0,n.idleTime=350,n.lastEvent=void 0,n.onMouseOut=n.onMouseOut.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.waitForHover=n.waitForHover.bind(n),n.hide=n.hide.bind(n);var r=n.getElement();return r.style.whiteSpace=`pre-wrap`,r.style.pointerEvents=`auto`,r.addEventListener(`mouseout`,n.onMouseOut),r.tabIndex=-1,r.addEventListener(`blur`,function(){r.contains(document.activeElement)||this.hide()}.bind(n)),r.addEventListener(`wheel`,s),n}return t.prototype.addToEditor=function(e){e.on(`mousemove`,this.onMouseMove),e.on(`mousedown`,this.hide);var t=e.renderer.getMouseEventTarget();t&&typeof t.removeEventListener==`function`&&t.addEventListener(`mouseout`,this.onMouseOut,!0)},t.prototype.removeFromEditor=function(e){e.off(`mousemove`,this.onMouseMove),e.off(`mousedown`,this.hide);var t=e.renderer.getMouseEventTarget();t&&typeof t.removeEventListener==`function`&&t.removeEventListener(`mouseout`,this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},t.prototype.onMouseMove=function(e,t){this.lastEvent=e,this.lastT=Date.now();var n=t.$mouseHandler.isMousePressed;if(this.isOpen){var r=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(r.row,r.column)||n||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||n||(this.lastEvent=e,this.timeout=setTimeout(this.waitForHover,this.idleTime))},t.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var e=Date.now()-this.lastT;if(this.idleTime-e>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-e);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},t.prototype.isOutsideOfText=function(e){var t=e.editor,n=e.getDocumentPosition(),r=t.session.getLine(n.row);if(n.column==r.length){var i=t.renderer.pixelToScreenCoordinates(e.clientX,e.clientY),a=t.session.documentToScreenPosition(n.row,n.column);if(a.column!=i.column||a.row!=i.row)return!0}return!1},t.prototype.setDataProvider=function(e){this.$gatherData=e},t.prototype.showForRange=function(e,t,n,r){if(!(r&&r!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var i=e.renderer;this.isOpen||(u.addPopup(this),this.$registerCloseEvents(),this.setTheme(i.theme)),this.isOpen=!0,this.range=o.fromPoints(t.start,t.end);var s=i.textToScreenCoordinates(t.start.row,t.start.column),c=i.scroller.getBoundingClientRect();s.pageX=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},a=e(`../lib/dom`),o=e(`./mouse_event`).MouseEvent,s=e(`../tooltip`).HoverTooltip,c=e(`../config`).nls,l=e(`../range`).Range;function u(e){var t=e.editor,n=t.renderer.$gutterLayer;e.$tooltip=new d(t),e.$tooltip.addToEditor(t),e.$tooltip.setDataProvider(function(t,n){var r=t.getDocumentPosition().row;e.$tooltip.showTooltip(r)}),e.editor.setDefaultHandler(`guttermousedown`,function(r){if(!(!t.isFocused()||r.getButton()!=0)&&n.getRegion(r)!=`foldWidgets`){var i=r.getDocumentPosition().row,a=t.session.selection;if(r.getShiftKey())a.selectTo(i,0);else{if(r.domEvent.detail==2)return t.selectAll(),r.preventDefault();e.$clickSelection=t.selection.getLineRange(i)}return e.setState(`selectByLines`),e.captureMouse(r),r.preventDefault()}})}t.GutterHandler=u;var d=function(e){r(t,e);function t(n){var r=e.call(this,n.container)||this;r.id=`gt`+ ++t.$uid,r.editor=n,r.visibleTooltipRow;var i=r.getElement();return i.setAttribute(`role`,`tooltip`),i.setAttribute(`id`,r.id),i.style.pointerEvents=`auto`,r.idleTime=50,r.onDomMouseMove=r.onDomMouseMove.bind(r),r.onDomMouseOut=r.onDomMouseOut.bind(r),r.setClassName(`ace_gutter-tooltip`),r}return t.prototype.onDomMouseMove=function(e){var t=new o(e,this.editor);this.onMouseMove(t,this.editor)},t.prototype.onDomMouseOut=function(e){var t=new o(e,this.editor);this.onMouseOut(t)},t.prototype.addToEditor=function(t){var n=t.renderer.$gutter;n.addEventListener(`mousemove`,this.onDomMouseMove),n.addEventListener(`mouseout`,this.onDomMouseOut),e.prototype.addToEditor.call(this,t)},t.prototype.removeFromEditor=function(t){var n=t.renderer.$gutter;n.removeEventListener(`mousemove`,this.onDomMouseMove),n.removeEventListener(`mouseout`,this.onDomMouseOut),e.prototype.removeFromEditor.call(this,t)},t.prototype.destroy=function(){this.editor&&this.removeFromEditor(this.editor),e.prototype.destroy.call(this)},Object.defineProperty(t,`annotationLabels`,{get:function(){return{error:{singular:c(`gutter-tooltip.aria-label.error.singular`,`error`),plural:c(`gutter-tooltip.aria-label.error.plural`,`errors`)},security:{singular:c(`gutter-tooltip.aria-label.security.singular`,`security finding`),plural:c(`gutter-tooltip.aria-label.security.plural`,`security findings`)},warning:{singular:c(`gutter-tooltip.aria-label.warning.singular`,`warning`),plural:c(`gutter-tooltip.aria-label.warning.plural`,`warnings`)},info:{singular:c(`gutter-tooltip.aria-label.info.singular`,`information message`),plural:c(`gutter-tooltip.aria-label.info.plural`,`information messages`)},hint:{singular:c(`gutter-tooltip.aria-label.hint.singular`,`suggestion`),plural:c(`gutter-tooltip.aria-label.hint.plural`,`suggestions`)}}},enumerable:!1,configurable:!0}),t.prototype.showTooltip=function(e){var n,r=this.editor.renderer.$gutterLayer,i=r.$annotations[e],o=i?{displayText:Array.from(i.displayText),type:Array.from(i.type)}:{displayText:[],type:[]},s=r.session.getFoldLine(e);if(s&&r.$showFoldedAnnotations){for(var c={error:[],security:[],warning:[],info:[],hint:[]},u={error:1,security:2,warning:3,info:4,hint:5},d,f=e+1;f<=s.end.row;f++)if(r.$annotations[f])for(var p=0;p2)return n.childNodes[2]}},t.prototype.$findCellByRow=function(e){return this.editor.renderer.$gutterLayer.$lines.cells.find(function(t){return t.row===e})},t.prototype.hide=function(t){if(this.isOpen){if(this.$element.removeAttribute(`aria-live`),this.visibleTooltipRow!=null){var n=this.$findLinkedAnnotationNode(this.visibleTooltipRow);n&&n.removeAttribute(`aria-describedby`)}this.visibleTooltipRow=void 0,this.editor._signal(`hideGutterTooltip`,this),e.prototype.hide.call(this,t)}},t.annotationsToSummaryString=function(e){var n,r,a=[],o=[`error`,`security`,`warning`,`info`,`hint`];try{for(var s=i(o),c=s.next();!c.done;c=s.next()){var l=c.value;if(e[l].length){var u=e[l].length===1?t.annotationLabels[l].singular:t.annotationLabels[l].plural;a.push(`${e[l].length} ${u}`)}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return a.join(`, `)},t.prototype.isOutsideOfText=function(e){var t=e.editor.renderer.$gutter.getBoundingClientRect();return!(e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom)},t}(s);d.$uid=0,t.GutterTooltip=d}),ace.define(`ace/mouse/dragdrop_handler`,[`require`,`exports`,`module`,`ace/lib/dom`,`ace/lib/event`,`ace/lib/useragent`],function(e,t,n){var r=e(`../lib/dom`),i=e(`../lib/event`),a=e(`../lib/useragent`),o=200,s=200,c=5;function l(e){var t=e.editor,n=r.createElement(`div`);n.style.cssText=`top:-100px;position:absolute;z-index:2147483647;opacity:0.5`,n.textContent=`\xA0`,[`dragWait`,`dragWaitEnd`,`startDrag`,`dragReadyEnd`,`onMouseDrag`].forEach(function(t){e[t]=this[t]},this),t.on(`mousedown`,this.onMouseDown.bind(e));var l=t.container,d,f,p,m,h,g,_=0,v,y,b,x,S;this.onDragStart=function(e){if(this.cancelDrag||!l.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}h=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?`copy`:`copyMove`,t.container.appendChild(n),i.setDragImage&&i.setDragImage(n,0,0),setTimeout(function(){t.container.removeChild(n)}),i.clearData(),i.setData(`Text`,t.session.getTextRange()),y=!0,this.setState(`drag`)},this.onDragEnd=function(e){if(l.draggable=!1,y=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;!v&&n==`move`&&t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle(`ace_dragging`),this.editor.renderer.setCursorStyle(``)},this.onDragEnter=function(e){if(!(t.getReadOnly()||!A(e.dataTransfer)))return f=e.clientX,p=e.clientY,d||E(),_++,e.dataTransfer.dropEffect=v=j(e),i.preventDefault(e)},this.onDragOver=function(e){if(!(t.getReadOnly()||!A(e.dataTransfer)))return f=e.clientX,p=e.clientY,d||(E(),_++),O!==null&&(O=null),e.dataTransfer.dropEffect=v=j(e),i.preventDefault(e)},this.onDragLeave=function(e){if(_--,_<=0&&d)return D(),v=null,i.preventDefault(e)},this.onDrop=function(e){if(g){var n=e.dataTransfer;if(y)switch(v){case`move`:h=h.contains(g.row,g.column)?{start:g,end:g}:t.moveText(h,g);break;case`copy`:h=t.moveText(h,g,!0);break}else{var r=n.getData(`Text`);h={start:g,end:t.session.insert(g,r)},t.focus(),v=null}return D(),i.preventDefault(e)}},i.addListener(l,`dragstart`,this.onDragStart.bind(e),t),i.addListener(l,`dragend`,this.onDragEnd.bind(e),t),i.addListener(l,`dragenter`,this.onDragEnter.bind(e),t),i.addListener(l,`dragover`,this.onDragOver.bind(e),t),i.addListener(l,`dragleave`,this.onDragLeave.bind(e),t),i.addListener(l,`drop`,this.onDrop.bind(e),t);function C(e,n){var r=Date.now(),i=!n||e.row!=n.row,a=!n||e.column!=n.column;!x||i||a?(t.moveCursorToPosition(e),x=r,S={x:f,y:p}):u(S.x,S.y,f,p)>c?x=null:r-x>=s&&(t.renderer.scrollCursorIntoView(),x=null)}function w(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,a=t.renderer.layerConfig.characterWidth,s=t.renderer.scroller.getBoundingClientRect(),c={x:{left:f-s.left,right:s.right-f},y:{top:p-s.top,bottom:s.bottom-p}},l=Math.min(c.x.left,c.x.right),u=Math.min(c.y.top,c.y.bottom),d={row:e.row,column:e.column};l/a<=2&&(d.column+=c.x.left=o&&t.renderer.scrollCursorIntoView(d):b=r:b=null}function T(){var e=g;g=t.renderer.screenToTextCoordinates(f,p),C(g,e),w(g,e)}function E(){h=t.selection.toOrientedRange(),d=t.session.addMarker(h,`ace_selection`,t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(m),T(),m=setInterval(T,20),_=0,i.addListener(document,`mousemove`,k)}function D(){clearInterval(m),t.session.removeMarker(d),d=null,t.selection.fromOrientedRange(h),t.isFocused()&&!y&&t.$resetCursorStyle(),h=null,g=null,_=0,b=null,x=null,i.removeListener(document,`mousemove`,k)}var O=null;function k(){O??(O=setTimeout(function(){O!=null&&d&&D()},20))}function A(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return e==`text/plain`||e==`Text`})}function j(e){var t=[`copy`,`copymove`,`all`,`uninitialized`],n=[`move`,`copymove`,`linkmove`,`all`,`uninitialized`],r=a.isMac?e.altKey:e.ctrlKey,i=`uninitialized`;try{i=e.dataTransfer.effectAllowed.toLowerCase()}catch{}var o=`none`;return r&&t.indexOf(i)>=0?o=`copy`:n.indexOf(i)>=0?o=`move`:t.indexOf(i)>=0&&(o=`copy`),o}}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var e=this.editor.container;e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle(`ace_dragging`),this.editor.renderer.setCursorStyle(``),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor,t=e.container;t.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle(`ace_dragging`);var n=a.isWin?`default`:`move`;e.renderer.setCursorStyle(n),this.setState(`dragReady`)},this.onMouseDrag=function(e){var t=this.editor.container;if(a.isIE&&this.state==`dragReady`){var n=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>3&&t.dragDrop()}if(this.state===`dragWait`){var n=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if((e.domEvent.detail||1)===1&&r===0&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var i=e.domEvent.target||e.domEvent.srcElement;if(`unselectable`in i&&(i.unselectable=`on`),t.getDragDelay()){if(a.isWebKit){this.cancelDrag=!0;var o=t.container;o.draggable=!0}this.setState(`dragWait`)}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(l.prototype);function u(e,t,n,r){return Math.sqrt((n-e)**2+(r-t)**2)}t.DragdropHandler=l}),ace.define(`ace/mouse/touch_handler`,[`require`,`exports`,`module`,`ace/mouse/mouse_event`,`ace/lib/event`,`ace/lib/dom`],function(e,t,n){var r=e(`./mouse_event`).MouseEvent,i=e(`../lib/event`),a=e(`../lib/dom`);t.addTouchListeners=function(e,t){var n=`scroll`,o,s,c,l,u,d,f=0,p,m=0,h=0,g=0,_,v;function y(){var e=window.navigator&&window.navigator.clipboard,r=!1,i=function(){var n=t.getCopyText(),i=t.session.getUndoManager().hasUndo();v.replaceChild(a.buildDom(r?[`span`,!n&&o(`selectall`)&&[`span`,{class:`ace_mobile-button`,action:`selectall`},`Select All`],n&&o(`copy`)&&[`span`,{class:`ace_mobile-button`,action:`copy`},`Copy`],n&&o(`cut`)&&[`span`,{class:`ace_mobile-button`,action:`cut`},`Cut`],e&&o(`paste`)&&[`span`,{class:`ace_mobile-button`,action:`paste`},`Paste`],i&&o(`undo`)&&[`span`,{class:`ace_mobile-button`,action:`undo`},`Undo`],o(`find`)&&[`span`,{class:`ace_mobile-button`,action:`find`},`Find`],o(`openCommandPalette`)&&[`span`,{class:`ace_mobile-button`,action:`openCommandPalette`},`Palette`]]:[`span`]),v.firstChild)},o=function(e){return t.commands.canExecute(e,t)},s=function(n){var a=n.target.getAttribute(`action`);if(a==`more`||!r)return r=!r,i();a==`paste`?e.readText().then(function(e){t.execCommand(a,e)}):a&&((a==`cut`||a==`copy`)&&(e?e.writeText(t.getCopyText()):document.execCommand(`copy`)),t.execCommand(a)),v.firstChild.style.display=`none`,r=!1,a!=`openCommandPalette`&&t.focus()};v=a.buildDom([`div`,{class:`ace_mobile-menu`,ontouchstart:function(e){n=`menu`,e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),s(e)},onclick:s},[`span`],[`span`,{class:`ace_mobile-button`,action:`more`},`...`]],t.container)}function b(){if(!t.getOption(`enableMobileMenu`)){v&&x();return}v||y();var e=t.selection.cursor,n=t.renderer.textToScreenCoordinates(e.row,e.column),r=t.renderer.textToScreenCoordinates(0,0).pageX,i=t.renderer.scrollLeft,a=t.container.getBoundingClientRect();v.style.top=n.pageY-a.top-3+`px`,n.pageX-a.left=2?t.selection.getLineRange(p.row):t.session.getBracketRange(p);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),n=`wait`}i.addListener(e,`contextmenu`,function(e){_&&t.textInput.getElement().focus()},t),i.addListener(e,`touchstart`,function(e){var i=e.touches;if(u||i.length>1){clearTimeout(u),u=null,c=-1,n=`zoom`;return}_=t.$mouseHandler.isMousePressed=!0;var a=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,v=e.timeStamp;l=v;var y=i[0],b=y.clientX,x=y.clientY;if(Math.abs(o-b)+Math.abs(s-x)>a&&(c=-1),o=e.clientX=b,s=e.clientY=x,h=g=0,p=new r(e,t).getDocumentPosition(),v-c<500&&i.length==1&&!f)m++,e.preventDefault(),e.button=0,C();else{m=0;var w=t.selection.cursor,T=t.selection.isEmpty()?w:t.selection.anchor,E=t.renderer.$cursorLayer.getPixelPosition(w,!0),D=t.renderer.$cursorLayer.getPixelPosition(T,!0),O=t.renderer.scroller.getBoundingClientRect(),k=t.renderer.layerConfig.offset,A=t.renderer.scrollLeft,j=function(e,t){return e/=d,t=t/a-.75,e*e+t*t};if(e.clientXee?`cursor`:`anchor`),n=ee<3.5?`anchor`:M<3.5?`cursor`:`scroll`,u=setTimeout(S,450)}c=v},t),i.addListener(e,`touchend`,function(e){_=t.$mouseHandler.isMousePressed=!1,d&&clearInterval(d),n==`zoom`?(n=``,f=0):u?(t.selection.moveToPosition(p),f=0,b()):n==`scroll`?(w(),x()):b(),clearTimeout(u),u=null},t),i.addListener(e,`touchmove`,function(e){u&&(clearTimeout(u),u=null);var i=e.touches;if(!(i.length>1||n==`zoom`)){var a=i[0],c=o-a.clientX,d=s-a.clientY;if(n==`wait`)if(c*c+d*d>4)n=`cursor`;else return e.preventDefault();o=a.clientX,s=a.clientY,e.clientX=a.clientX,e.clientY=a.clientY;var f=e.timeStamp,p=f-l;if(l=f,n==`scroll`){var m=new r(e,t);m.speed=1,m.wheelX=c,m.wheelY=d,10*Math.abs(c)0)if(g==16){for(S=x;S-1){for(S=x;S=0&&u[T]==b;T--)t[T]=r}}}function te(e,t,n){if(!(i=e){for(c=s+1;c=e;)c++;for(l=s,u=c-1;l=t.length||(l=n[i-1])!=m&&l!=h||(u=t[i+1])!=m&&u!=h?g:(a&&(u=h),u==l?u:g);case S:return l=i>0?n[i-1]:_,l==m&&i+10&&n[i-1]==m)return m;if(a)return g;for(j=i+1,d=t.length;j=1425&&M<=2303||M==64286;if(l=t[j],ee&&(l==p||l==y))return p}return i<1||(l=t[i-1])==_?g:n[i-1];case _:return a=!1,o=!0,r;case v:return s=!0,g;case T:case E:case O:case k:case D:a=!1;case A:return g}}function N(e){var t=e.charCodeAt(0),n=t>>8;return n==0?t>191?f:j[t]:n==5?/[\u0591-\u05f4]/.test(e)?p:f:n==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?w:/[\u0660-\u0669\u066b-\u066c]/.test(e)?h:t==1642?C:/[\u06f0-\u06f9]/.test(e)?m:y:n==32&&t<=8287?M[t&255]:n==254&&t>=65136?y:g}t.L=f,t.R=p,t.EN=m,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT=`·`,t.doBidiReorder=function(e,n,i){if(e.length<2)return{};var a=e.split(``),o=Array(a.length),s=Array(a.length),c=[];r=i?d:u,ee(a,c,a.length,n);for(var l=0;ly&&n[l]0&&a[l-1]===`ل`&&/\u0622|\u0623|\u0625|\u0627/.test(a[l])&&(c[l-1]=c[l]=t.R_H,l++);a[a.length-1]===t.DOT&&(c[a.length-1]=t.B),a[0]===`‫`&&(c[0]=t.RLE);for(var l=0;l=0&&(e=this.session.$docRowCache[n])}return e},e.prototype.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,r=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1),n===r);)r=n,e++;else e=this.currentRow;return e},e.prototype.updateRowLine=function(e,t){e===void 0&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var a=this.session.$wrapData[e];a&&(t===void 0&&(t=this.getSplitIndex()),t>0&&a.length?(this.wrapIndent=a.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),a=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&a[i]%2!=0&&i++;for(var s=0;st&&a[i]%2==0&&(o+=this.charWidths[a[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},e.prototype.getSelections=function(e,t){var n=this.bidiMap,r=n.bidiLevels,i,a=[],o=0,s=Math.min(e,t)-this.wrapIndent,c=Math.max(e,t)-this.wrapIndent,l=!1,u=!1,d=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var f,p=0;p=s&&fn+a/2;){if(n+=a,r===i.length-1){a=0;break}a=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!=0&&i[r]%2==0?(e0&&i[r-1]%2==0&&i[r]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&a===0&&i[r-1]%2==0||!this.isRtlDir&&r===0&&i[r]%2!=0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!=0&&a!==0&&r--,t=this.bidiMap.logicalFromVisual[r]),t===0&&this.isRtlDir&&t++,t+this.wrapIndent},e}()}),ace.define(`ace/selection`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/lang`,`ace/lib/event_emitter`,`ace/range`],function(e,t,n){var r=e(`./lib/oop`),i=e(`./lib/lang`),a=e(`./lib/event_emitter`).EventEmitter,o=e(`./range`).Range,s=function(){function e(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on(`change`,function(e){t.$cursorChanged=!0,t.$silent||t._emit(`changeCursor`),!t.$isEmpty&&!t.$silent&&t._emit(`changeSelection`),!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column&&(t.$desiredColumn=null)}),this.anchor.on(`change`,function(){t.$anchorChanged=!0,!t.$isEmpty&&!t.$silent&&t._emit(`changeSelection`)})}return e.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},e.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},e.prototype.getCursor=function(){return this.lead.getPosition()},e.prototype.setAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},e.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},e.prototype.getSelectionLead=function(){return this.lead.getPosition()},e.prototype.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},e.prototype.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},e.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit(`changeSelection`))},e.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},e.prototype.setRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},e.prototype.$setSelection=function(e,t,n,r){if(!this.$silent){var i=this.$isEmpty,a=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit(`changeCursor`),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||a)&&this._emit(`changeSelection`)}},e.prototype.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},e.prototype.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},e.prototype.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},e.prototype.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},e.prototype.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},e.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},e.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},e.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},e.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},e.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},e.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},e.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},e.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},e.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},e.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},e.prototype.getWordRange=function(e,t){if(t===void 0){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},e.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},e.prototype.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},e.prototype.getLineRange=function(e,t){var n=typeof e==`number`?e:this.lead.row,r,i=this.session.getFoldLine(n);return i?(n=i.start.row,r=i.end.row):r=n,t===!0?new o(n,0,r,this.session.getLine(r).length):new o(n,0,r+1,0)},e.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},e.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},e.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},e.prototype.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(` `).length-1==t},e.prototype.moveCursorLeft=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,-1))this.moveCursorTo(t.start.row,t.start.column);else if(e.column===0)e.row>0&&this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(e,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},e.prototype.moveCursorRight=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,1))this.moveCursorTo(t.end.row,t.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},e.prototype.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},e.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},e.prototype.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i){this.moveCursorTo(i.end.row,i.end.column);return}if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t)),t>=n.length){this.moveCursorTo(e,n.length),this.moveCursorRight(),e0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(a)&&(t-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)},e.prototype.$shortWordEndIndex=function(e){var t=0,n,r=/\s/,i=this.session.tokenRe;if(i.lastIndex=0,this.session.tokenRe.exec(e))t=this.session.tokenRe.lastIndex;else{for(;(n=e[t])&&r.test(n);)t++;if(t<1){for(i.lastIndex=0;(n=e[t])&&!i.test(n);)if(i.lastIndex=0,t++,r.test(n))if(t>2){t--;break}else{for(;(n=e[t])&&r.test(n);)t++;if(t>2)break}}}return i.lastIndex=0,t},e.prototype.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var a=this.doc.getLength();do e++,r=this.doc.getLine(e);while(e0&&/^\s*$/.test(r));t=r.length,/\s+$/.test(r)||(r=``)}var a=i.stringReverse(r),o=this.$shortWordEndIndex(a);return this.moveCursorTo(e,t-o)},e.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},e.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},e.prototype.moveCursorBy=function(e,t){var n=this.session.documentToScreenPosition(this.lead.row,this.lead.column),r;if(t===0&&(e!==0&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(r=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(r/this.session.$bidiHandler.charWidths[0])):r=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column),e!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var i=this.session.lineWidgets[this.lead.row];e<0?e-=i.rowsAbove||0:e>0&&(e+=i.rowCount-(i.rowsAbove||0))}var a=this.session.screenToDocumentPosition(n.row+e,n.column,r);e!==0&&t===0&&a.row===this.lead.row&&(a.column,this.lead.column),this.moveCursorTo(a.row,a.column+t,t===0)},e.prototype.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},e.prototype.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?--t:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},e.prototype.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},e.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},e.prototype.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},e.prototype.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},e.prototype.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch{return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},e.prototype.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e},e.prototype.fromJSON=function(e){if(e.start==null)if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}else e=e[0];this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},e.prototype.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0},e}();s.prototype.setSelectionAnchor=s.prototype.setAnchor,s.prototype.getSelectionAnchor=s.prototype.getAnchor,s.prototype.setSelectionRange=s.prototype.setRange,r.implement(s.prototype,a),t.Selection=s}),ace.define(`ace/tokenizer`,[`require`,`exports`,`module`,`ace/lib/report_error`],function(e,t,n){var r=e(`./lib/report_error`).reportError,i=2e3,a=function(){function e(e){for(var t in this.splitRegex,this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],r=[],i=0,a=this.matchMappings[t]={defaultToken:`text`},o=`g`,s=[],c=0;c1?l.onMatch=this.$applyToken:l.onMatch=l.token),d>1&&(/\\\d/.test(l.regex)?u=l.regex.replace(/\\([0-9]+)/g,function(e,t){return`\\`+(parseInt(t,10)+i+1)}):(d=1,u=this.removeCapturingGroups(l.regex)),!l.splitRegex&&typeof l.token!=`string`&&s.push(l)),a[i]=c,i+=d,r.push(u),l.onMatch||(l.onMatch=null)}}r.length||(a[0]=0,r.push(`$`)),s.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=RegExp(`(`+r.join(`)|(`)+`)|($)`,o)}}return e.prototype.$setMaxTokenCount=function(e){i=e|0},e.prototype.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if(typeof n==`string`)return[{type:n,value:e}];for(var r=[],i=0,a=n.length;iu){var _=e.substring(u,g-h.length);f.type==p?f.value+=_:(f.type&&l.push(f),f={type:p,value:_})}for(var v=0;vi){for(d>2*e.length&&this.reportError(`infinite loop with in ace tokenizer`,{startState:t,line:e});u1&&n[0]!==r&&n.unshift(`#tmp`,r),{tokens:l,state:n.length?n:r}},e}();a.prototype.reportError=r,t.Tokenizer=a}),ace.define(`ace/mode/text_highlight_rules`,[`require`,`exports`,`module`,`ace/lib/deep_copy`],function(e,t,n){var r=e(`../lib/deep_copy`).deepCopy,i=function(){this.$rules={start:[{token:`empty_line`,regex:`^$`},{defaultToken:`text`}]}};(function(){this.addRules=function(e,t){if(!t){for(var n in e)this.$rules[n]=e[n];return}for(var n in e){for(var r=e[n],i=0;i=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},e.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},e.prototype.getCurrentTokenRow=function(){return this.$row},e.prototype.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(n!==void 0)return n;for(n=0;t>0;)--t,n+=e[t].value.length;return n},e.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},e.prototype.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)},e}()}),ace.define(`ace/mode/behaviour/cstyle`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/mode/behaviour`,`ace/token_iterator`,`ace/lib/lang`],function(e,t,n){var r=e(`../../lib/oop`),i=e(`../behaviour`).Behaviour,a=e(`../../token_iterator`).TokenIterator,o=e(`../../lib/lang`),s=[`text`,`paren.rparen`,`rparen`,`paren`,`punctuation.operator`],c=[`text`,`paren.rparen`,`rparen`,`paren`,`punctuation.operator`,`comment`],l,u={},d={'"':`"`,"'":`'`},f=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,u.rangeCount!=e.multiSelect.rangeCount&&(u={rangeCount:e.multiSelect.rangeCount})),u[t])return l=u[t];l=u[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:``,maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:``,maybeInsertedLineEnd:``}},p=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},m=function(e){e=e||{},this.add(`braces`,`insertion`,function(t,n,r,i,a){var s=r.getCursorPosition(),c=i.doc.getLine(s.row);if(a==`{`){f(r);var u=r.getSelectionRange(),d=i.doc.getTextRange(u),h=i.getTokenAt(s.row,s.column);if(d!==``&&d!==`{`&&r.getWrapBehavioursEnabled())return p(u,d,`{`,`}`);if(h&&/(?:string)\.quasi|\.xml/.test(h.type))return[/tag\-(?:open|name)/,/attribute\-name/].some(function(e){return e.test(h.type)})||/(string)\.quasi/.test(h.type)&&h.value[s.column-h.start-1]!==`$`?void 0:(m.recordAutoInsert(r,i,`}`),{text:`{}`,selection:[1,1]});if(m.isSaneInsertion(r,i))return/[\]\}\)]/.test(c[s.column])||r.inMultiSelectMode||e.braces?(m.recordAutoInsert(r,i,`}`),{text:`{}`,selection:[1,1]}):(m.recordMaybeInsert(r,i,`{`),{text:`{`,selection:[1,1]})}else if(a==`}`){f(r);var g=c.substring(s.column,s.column+1);if(g==`}`&&i.$findOpeningBracket(`}`,{column:s.column+1,row:s.row})!==null&&m.isAutoInsertedClosing(s,c,a))return m.popAutoInsertedClosing(),{text:``,selection:[1,1]}}else if(a==` `||a==`\r `){f(r);var _=``;m.isMaybeInsertedClosing(s,c)&&(_=o.stringRepeat(`}`,l.maybeInsertedBrackets),m.clearMaybeInsertedClosing());var g=c.substring(s.column,s.column+1);if(g===`}`){var v=i.findMatchingBracket({row:s.row,column:s.column+1},`}`);if(!v)return null;var y=this.$getIndent(i.getLine(v.row))}else if(_)var y=this.$getIndent(c);else{m.clearMaybeInsertedClosing();return}var b=y+i.getTabString();return{text:` `+b+` `+y+_,selection:[1,b.length,1,b.length]}}else m.clearMaybeInsertedClosing()}),this.add(`braces`,`deletion`,function(e,t,n,r,i){var a=r.doc.getTextRange(i);if(!i.isMultiLine()&&a==`{`){if(f(n),r.doc.getLine(i.start.row).substring(i.end.column,i.end.column+1)==`}`)return i.end.column++,i;l.maybeInsertedBrackets--}}),this.add(`parens`,`insertion`,function(e,t,n,r,i){if(i==`(`){f(n);var a=n.getSelectionRange(),o=r.doc.getTextRange(a);if(o!==``&&n.getWrapBehavioursEnabled())return p(a,o,`(`,`)`);if(m.isSaneInsertion(n,r))return m.recordAutoInsert(n,r,`)`),{text:`()`,selection:[1,1]}}else if(i==`)`){f(n);var s=n.getCursorPosition(),c=r.doc.getLine(s.row);if(c.substring(s.column,s.column+1)==`)`&&r.$findOpeningBracket(`)`,{column:s.column+1,row:s.row})!==null&&m.isAutoInsertedClosing(s,c,i))return m.popAutoInsertedClosing(),{text:``,selection:[1,1]}}}),this.add(`parens`,`deletion`,function(e,t,n,r,i){var a=r.doc.getTextRange(i);if(!i.isMultiLine()&&a==`(`&&(f(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==`)`))return i.end.column++,i}),this.add(`brackets`,`insertion`,function(e,t,n,r,i){if(i==`[`){f(n);var a=n.getSelectionRange(),o=r.doc.getTextRange(a);if(o!==``&&n.getWrapBehavioursEnabled())return p(a,o,`[`,`]`);if(m.isSaneInsertion(n,r))return m.recordAutoInsert(n,r,`]`),{text:`[]`,selection:[1,1]}}else if(i==`]`){f(n);var s=n.getCursorPosition(),c=r.doc.getLine(s.row);if(c.substring(s.column,s.column+1)==`]`&&r.$findOpeningBracket(`]`,{column:s.column+1,row:s.row})!==null&&m.isAutoInsertedClosing(s,c,i))return m.popAutoInsertedClosing(),{text:``,selection:[1,1]}}}),this.add(`brackets`,`deletion`,function(e,t,n,r,i){var a=r.doc.getTextRange(i);if(!i.isMultiLine()&&a==`[`&&(f(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==`]`))return i.end.column++,i}),this.add(`string_dquotes`,`insertion`,function(e,t,n,r,i){var a=r.$mode.$quotes||d;if(i.length==1&&a[i]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(i)!=-1)return;f(n);var o=i,s=n.getSelectionRange(),c=r.doc.getTextRange(s);if(c!==``&&(c.length!=1||!a[c])&&n.getWrapBehavioursEnabled())return p(s,c,o,o);if(!c){var l=n.getCursorPosition(),u=r.doc.getLine(l.row),m=u.substring(l.column-1,l.column),h=u.substring(l.column,l.column+1),g=r.getTokenAt(l.row,l.column),_=r.getTokenAt(l.row,l.column+1);if(m==`\\`&&g&&/escape/.test(g.type))return null;var v=g&&/string|escape/.test(g.type),y=!_||/string|escape/.test(_.type),b;if(h==o)b=v!==y,b&&/string\.end/.test(_.type)&&(b=!1);else{if(v&&!y||v&&y)return null;var x=r.$mode.tokenRe;x.lastIndex=0;var S=x.test(m);x.lastIndex=0;var C=x.test(h),w=r.$mode.$pairQuotesAfter;if(!(w&&w[o]&&w[o].test(m))&&S||C||h&&!/[\s;,.})\]\\]/.test(h))return null;var T=u[l.column-2];if(m==o&&(T==o||x.test(T)))return null;b=!0}return{text:b?o+o:``,selection:[1,1]}}}}),this.add(`string_dquotes`,`deletion`,function(e,t,n,r,i){var a=r.$mode.$quotes||d,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&a.hasOwnProperty(o)&&(f(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==o))return i.end.column++,i}),e.closeDocComment!==!1&&this.add(`doc comment end`,`insertion`,function(e,t,n,r,i){if(e===`doc-start`&&(i===` `||i===`\r `)&&n.selection.isEmpty()){var a=n.getCursorPosition();if(a.column===0)return;for(var o=r.doc.getLine(a.row),s=r.doc.getLine(a.row+1),c=r.getTokens(a.row),l=0,u=0;u=a.column){if(l===a.column){if(!/\.doc/.test(d.type))return;if(/\*\//.test(d.value)){var f=c[u+1];if(!f||!/\.doc/.test(f.type))return}}var p=a.column-(l-d.value.length),m=d.value.indexOf(`*/`),h=d.value.indexOf(`/**`,m>-1?m+2:0);if(h!==-1&&p>h&&p=m&&p<=h||!/\.doc/.test(d.type))return;break}}var g=this.$getIndent(o);if(/\s*\*/.test(s))return/^\s*\*/.test(o)?{text:i+g+`* `,selection:[1,2+g.length,1,2+g.length]}:{text:i+g+` * `,selection:[1,3+g.length,1,3+g.length]};if(/\/\*\*/.test(o.substring(0,a.column)))return{text:i+g+` * `+i+` `+g+`*/`,selection:[1,4+g.length,1,4+g.length]}}})};m.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new a(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||`text`,s)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new a(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||`text`,s))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||`text`,c)},m.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},m.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,l.autoInsertedLineEnd[0])||(l.autoInsertedBrackets=0),l.autoInsertedRow=r.row,l.autoInsertedLineEnd=n+i.substr(r.column),l.autoInsertedBrackets++},m.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(l.maybeInsertedBrackets=0),l.maybeInsertedRow=r.row,l.maybeInsertedLineStart=i.substr(0,r.column)+n,l.maybeInsertedLineEnd=i.substr(r.column),l.maybeInsertedBrackets++},m.isAutoInsertedClosing=function(e,t,n){return l.autoInsertedBrackets>0&&e.row===l.autoInsertedRow&&n===l.autoInsertedLineEnd[0]&&t.substr(e.column)===l.autoInsertedLineEnd},m.isMaybeInsertedClosing=function(e,t){return l.maybeInsertedBrackets>0&&e.row===l.maybeInsertedRow&&t.substr(e.column)===l.maybeInsertedLineEnd&&t.substr(0,e.column)==l.maybeInsertedLineStart},m.popAutoInsertedClosing=function(){l.autoInsertedLineEnd=l.autoInsertedLineEnd.substr(1),l.autoInsertedBrackets--},m.clearMaybeInsertedClosing=function(){l&&(l.maybeInsertedBrackets=0,l.maybeInsertedRow=-1)},r.inherits(m,i),t.CstyleBehaviour=m}),ace.define(`ace/unicode`,[`require`,`exports`,`module`],function(e,t,n){for(var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,a=[],o=0;o2?r%l!=l-1:r%l==0}}else{if(!this.blockComment)return!1;var f=this.blockComment.start,v=this.blockComment.end,d=RegExp(`^(\\s*)(?:`+c.escapeRegExp(f)+`)`),y=RegExp(`(?:`+c.escapeRegExp(v)+`)\\s*$`),h=function(e,t){g(e,t)||(!a||/\S/.test(e))&&(i.insertInLine({row:t,column:e.length},v),i.insertInLine({row:t,column:s},f))},p=function(e,t){var n;(n=e.match(y))&&i.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(d))&&i.removeInLine(t,n[1].length,n[0].length)},g=function(e,n){if(d.test(e))return!0;for(var r=t.getTokens(n),i=0;ie.length&&(x=e.length):(nt[n].column&&n++,a.unshift(n,0),t.splice.apply(t,a),this.$updateRows()}}},e.prototype.$updateRows=function(){var e=this.session.lineWidgets;if(e){var t=!0;e.forEach(function(e,n){if(e)for(t=!1,e.row=n;e.$oldWidget;)e.$oldWidget.row=n,e=e.$oldWidget}),t&&(this.session.lineWidgets=null)}},e.prototype.$registerLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];return t&&(e.$oldWidget=t,t.el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1)),this.session.lineWidgets[e.row]=e,e},e.prototype.addLineWidget=function(e){if(this.$registerLineWidget(e),e.session=this.session,!this.editor)return e;var t=this.editor.renderer;e.html&&!e.el&&(e.el=r.createElement(`div`),e.el.innerHTML=e.html),e.text&&!e.el&&(e.el=r.createElement(`div`),e.el.textContent=e.text),e.el&&(r.addCssClass(e.el,`ace_lineWidgetContainer`),e.className&&r.addCssClass(e.el,e.className),e.el.style.position=`absolute`,e.el.style.zIndex=`5`,t.container.appendChild(e.el),e._inDocument=!0,e.coverGutter||(e.el.style.zIndex=`3`),e.pixelHeight??(e.pixelHeight=e.el.offsetHeight)),e.rowCount??(e.rowCount=e.pixelHeight/t.layerConfig.lineHeight);var n=this.session.getFoldAt(e.row,0);if(e.$fold=n,n){var i=this.session.lineWidgets;e.row==n.end.row&&!i[n.start.row]?i[n.start.row]=e:e.hidden=!0}return this.session._emit(`changeFold`,{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),this.onWidgetChanged(e),e},e.prototype.removeLineWidget=function(e){if(e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),e.editor&&e.editor.destroy)try{e.editor.destroy()}catch{}if(this.session.lineWidgets){var t=this.session.lineWidgets[e.row];if(t==e)this.session.lineWidgets[e.row]=e.$oldWidget,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else for(;t;){if(t.$oldWidget==e){t.$oldWidget=e.$oldWidget;break}t=t.$oldWidget}}this.session._emit(`changeFold`,{data:{start:{row:e.row}}}),this.$updateRows()},e.prototype.getWidgetsAtRow=function(e){for(var t=this.session.lineWidgets,n=t&&t[e],r=[];n;)r.push(n),n=n.$oldWidget;return r},e.prototype.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},e.prototype.measureWidgets=function(e,t){var n=this.session._changedWidgets,r=t.layerConfig;if(!(!n||!n.length)){for(var i=1/0,a=0;a0&&!r[i];)i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=a;o++){var s=r[o];if(!(!s||!s.el)){if(s.hidden){s.el.style.top=-100-(s.pixelHeight||0)+`px`;continue}s._inDocument||(s._inDocument=!0,t.container.appendChild(s.el));var c=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;s.coverLine||(c+=n.lineHeight*this.session.getRowLineCount(s.row)),s.el.style.top=c-n.offset+`px`;var l=s.coverGutter?0:t.gutterWidth;s.fixedWidth||(l-=t.scrollLeft),s.el.style.left=l+`px`,s.fullWidth&&s.screenWidth&&(s.el.style.minWidth=n.width+2*n.padding+`px`),s.fixedWidth?s.el.style.right=t.scrollBar.getWidth()+`px`:s.el.style.right=``}}}},e}()}),ace.define(`ace/apply_delta`,[`require`,`exports`,`module`],function(e,t,n){t.applyDelta=function(e,t,n){var r=t.start.row,i=t.start.column,a=e[r]||``;switch(t.action){case`insert`:if(t.lines.length===1)e[r]=a.substring(0,i)+t.lines[0]+a.substring(i);else{var o=[r,1].concat(t.lines);e.splice.apply(e,o),e[r]=a.substring(0,i)+e[r],e[r+t.lines.length-1]+=a.substring(i)}break;case`remove`:var s=t.end.column,c=t.end.row;r===c?e[r]=a.substring(0,i)+a.substring(s):e.splice(r,c-r+1,a.substring(0,i)+e[c].substring(s));break}}}),ace.define(`ace/anchor`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/event_emitter`],function(e,t,n){var r=e(`./lib/oop`),i=e(`./lib/event_emitter`).EventEmitter,a=function(){function e(e,t,n){this.$onChange=this.onChange.bind(this),this.attach(e),typeof t==`number`?this.setPosition(t,n):this.setPosition(t.row,t.column)}return e.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},e.prototype.getDocument=function(){return this.document},e.prototype.onChange=function(e){if(!(e.start.row==e.end.row&&e.start.row!=this.row)&&!(e.start.row>this.row)){var t=s(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(t.row,t.column,!0)}},e.prototype.setPosition=function(e,t,n){var r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t);if(!(this.row==r.row&&this.column==r.column)){var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal(`change`,{old:i,value:r})}},e.prototype.detach=function(){this.document.off(`change`,this.$onChange)},e.prototype.attach=function(e){this.document=e||this.document,this.document.on(`change`,this.$onChange)},e.prototype.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n},e}();a.prototype.$insertRight=!1,r.implement(a.prototype,i);function o(e,t,n){var r=n?e.column<=t.column:e.column=n&&(e=n-1,t=void 0);var r=this.getLine(e);return t??(t=r.length),t=Math.min(Math.max(t,0),r.length),{row:e,column:t}},e.prototype.clonePos=function(e){return{row:e.row,column:e.column}},e.prototype.pos=function(e,t){return{row:e,column:t}},e.prototype.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},e.prototype.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var n=0;e0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:`remove`,lines:[``,``]})},e.prototype.replace=function(e,t){return e instanceof o||(e=o.fromPoints(e.start,e.end)),t.length===0&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},e.prototype.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},e.prototype.applyDelta=function(e,t){var n=e.action==`insert`;(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal(`change`,e)))},e.prototype.$safeApplyDelta=function(e){var t=this.$lines.length;(e.action==`remove`&&e.start.row20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,r==-1&&(r=t),a<=r&&n.fireUpdateEvent(a,r)}}}return e.prototype.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},e.prototype.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},e.prototype.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal(`update`,{data:n})},e.prototype.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},e.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},e.prototype.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(n===0)this.lines[t]=null;else if(e.action==`remove`)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},e.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},e.prototype.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},e.prototype.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||`start`},e.prototype.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+``==r.state+``?this.currentLine==e&&(this.currentLine=e+1):(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)),this.lines[e]=r.tokens},e.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},e}();r.implement(a.prototype,i),t.BackgroundTokenizer=a}),ace.define(`ace/search_highlight`,[`require`,`exports`,`module`,`ace/lib/lang`,`ace/range`],function(e,t,n){var r=e(`./lib/lang`),i=e(`./range`).Range,a=function(){function e(e,t,n){n===void 0&&(n=`text`),this.setRegexp(e),this.clazz=t,this.type=n,this.docLen=0}return e.prototype.setRegexp=function(e){this.regExp+``!=e+``&&(this.regExp=e,this.cache=[])},e.prototype.update=function(e,t,n,a){if(this.regExp){for(var o=a.firstRow,s=a.lastRow,c={},l=n.$editor&&n.$editor.$search,u=l&&l.$isMultilineSearch(n.$editor.getLastSearchOptions()),d=o;d<=s;d++){var f=this.cache[d];if(f==null||n.getValue().length!=this.docLen){if(u){f=[];var p=l.$multiLineForward(n,this.regExp,d,s);if(p){var m=p.endRow<=s?p.endRow-1:s;m>d&&(d=m),f.push(new i(p.startRow,p.startCol,p.endRow,p.endCol))}f.length>this.MAX_RANGES&&(f=f.slice(0,this.MAX_RANGES))}else f=r.getMatchOffsets(n.getLine(d),this.regExp),f.length>this.MAX_RANGES&&(f=f.slice(0,this.MAX_RANGES)),f=f.map(function(e){return new i(d,e.offset,d,e.offset+e.length)});this.cache[d]=f.length?f:``}if(f.length!==0)for(var h=f.length;h--;){var g=f[h].toScreenRange(n),_=g.toString();c[_]||(c[_]=!0,t.drawSingleLineMarker(e,g,this.clazz,a))}}this.docLen=n.getValue().length}},e}();a.prototype.MAX_RANGES=500,t.SearchHighlight=a}),ace.define(`ace/undomanager`,[`require`,`exports`,`module`,`ace/range`],function(e,t,n){var r=function(){function e(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return e.prototype.addSession=function(e){this.$session=e},e.prototype.add=function(e,t,n){if(!this.$fromUndo&&e!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),t===!1||!this.lastDeltas){this.lastDeltas=[];var r=this.$undoStack.length;r>this.$undoDepth-1&&this.$undoStack.splice(0,r-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev}(e.action==`remove`||e.action==`insert`)&&(this.$lastDelta=e),this.lastDeltas.push(e)}},e.prototype.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},e.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},e.prototype.markIgnored=function(e,t){t??(t=this.$rev+1);for(var n=this.$undoStack,r=n.length;r--;){var i=n[r][0];if(i.id<=e)break;i.id0},e.prototype.canRedo=function(){return this.$redoStack.length>0},e.prototype.bookmark=function(e){e??(e=this.$rev),this.mark=e},e.prototype.isAtBookmark=function(){return this.$rev===this.mark},e.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},e.prototype.fromJSON=function(e){this.reset(),this.$undoStack=e.$undoStack,this.$redoStack=e.$redoStack},e.prototype.$prettyPrint=function(e){return e?l(e):l(this.$undoStack)+` --- `+l(this.$redoStack)},e}();r.prototype.hasUndo=r.prototype.canUndo,r.prototype.hasRedo=r.prototype.canRedo,r.prototype.isClean=r.prototype.isAtBookmark,r.prototype.markClean=r.prototype.bookmark;function i(e,t){for(var n=t;n--;){var r=e[n];if(r&&!r[0].ignore){for(;n`+e.end.row+`:`+e.end.column}function d(e,t){var n=e.action==`insert`,r=t.action==`insert`;if(n&&r)if(o(t.start,e.end)>=0)m(t,e,-1);else if(o(t.start,e.start)<=0)m(e,t,1);else return null;else if(n&&!r)if(o(t.start,e.end)>=0)m(t,e,-1);else if(o(t.end,e.start)<=0)m(e,t,-1);else return null;else if(!n&&r)if(o(t.start,e.start)>=0)m(t,e,1);else if(o(t.start,e.start)<=0)m(e,t,1);else return null;else if(!n&&!r)if(o(t.start,e.start)>=0)m(t,e,1);else if(o(t.end,e.start)<=0)m(e,t,-1);else return null;return[t,e]}function f(e,t){for(var n=e.length;n--;)for(var r=0;r=0?m(e,t,-1):(o(e.start,t.start)<=0||m(e,a.fromPoints(t.start,e.start),-1),m(t,e,1));else if(!n&&r)o(t.start,e.end)>=0?m(t,e,-1):(o(t.start,e.start)<=0||m(t,a.fromPoints(e.start,t.start),-1),m(e,t,1));else if(!n&&!r)if(o(t.start,e.end)>=0)m(t,e,-1);else if(o(t.end,e.start)<=0)m(e,t,-1);else{var i,s;return o(e.start,t.start)<0&&(i=e,e=g(e,t.start)),o(e.end,t.end)>0&&(s=g(e,t.end)),h(t.end,e.start,e.end,-1),s&&!i&&(e.lines=s.lines,e.start=s.start,e.end=s.end,s=e),[t,i,s].filter(Boolean)}return[t,e]}function m(e,t,n){h(e.start,t.start,t.end,n),h(e.end,t.start,t.end,n)}function h(e,t,n,r){e.row==(r==1?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function g(e,t){var n=e.lines,r=e.end;e.end=s(t);var i=e.end.row-e.start.row,a=n.splice(i,n.length),o=i?t.column:t.column-e.start.column;return n.push(a[0].substring(0,o)),a[0]=a[0].substr(o),{start:s(t),end:r,lines:a,action:e.action}}function _(e,t){t=c(t);for(var n=e.length;n--;){for(var r=e[n],i=0;ithis.endRow)throw Error(`Can't add a fold to this FoldLine as it has no connection`);this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else if(e.end.row==this.start.row)this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column;else throw Error(`Trying to add fold to FoldRow that doesn't have a matching row`);e.foldLine=this},e.prototype.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},e.prototype.walk=function(e,t,n){var r=0,i=this.folds,a,o,s,c=!0;t??(t=this.end.row,n=this.end.column);for(var l=0;l0)){var c=r(e,o.start);return s===0?t&&c!==0?-a-2:a:c>0||c===0&&!t?a:-a-1}}return-a-1},e.prototype.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},e.prototype.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},e.prototype.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},e.prototype.merge=function(){var e=[],t=this.ranges;t=t.sort(function(e,t){return r(e.start,t.start)});for(var n=t[0],i,a=1;a=0},e.prototype.containsPoint=function(e){return this.pointIndex(e)>=0},e.prototype.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},e.prototype.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r)break}if(e.action==`insert`)for(var l=i-r,u=-t.column+n.column;or)break;if(c.start.row==r&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=u,c.start.row+=l)),c.end.row==r&&c.end.column>=t.column){if(c.end.column==t.column&&this.$bias<0)continue;c.end.column==t.column&&u>0&&oc.start.column&&c.end.column==a[o+1].start.column&&(c.end.column-=u),c.end.column+=u,c.end.row+=l}}else for(var l=r-i,u=t.column-n.column;oi)break;c.end.rowt.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=u,c.end.row+=l):c.end.row>i&&(c.end.row+=l),c.start.rowt.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=u,c.start.row+=l):c.start.row>i&&(c.start.row+=l)}if(l!=0&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;for(t&&(r=n.indexOf(t)),r==-1&&(r=0);r=e)return i}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,r=t-e+1,i=0;i=t){s=e?r-=t-s:r=0);break}else o>=e&&(s>=e?r-=o-s:r-=o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n=this.$foldData,r=!1,o;e instanceof a?o=e:(o=new a(t,e),o.collapseChildren=t.collapseChildren),this.$clipRangeToDocument(o.range);var s=o.start.row,c=o.start.column,l=o.end.row,u=o.end.column,d=this.getFoldAt(s,c,1),f=this.getFoldAt(l,u,-1);if(d&&f==d)return d.addSubFold(o);d&&!d.range.isStart(s,c)&&this.removeFold(d),f&&!f.range.isEnd(l,u)&&this.removeFold(f);var p=this.getFoldsInRange(o.range);p.length>0&&(this.removeFolds(p),o.collapseChildren||p.forEach(function(e){o.addSubFold(e)}));for(var m=0;m0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;if(e==null)n=new r(0,0,this.getLength(),0),t??(t=!0);else if(typeof e==`number`)n=new r(e,0,e,this.getLine(e).length);else if(`row`in e)n=r.fromPoints(e,e);else if(Array.isArray(e))return i=[],e.forEach(function(e){i=i.concat(this.unfold(e))},this),i;else n=e;i=this.getFoldsInRangeList(n);for(var a=i;i.length==1&&r.comparePoints(i[0].start,n.start)<0&&r.comparePoints(i[0].end,n.end)>0;)this.expandFolds(i),i=this.getFoldsInRangeList(n);if(t==0?this.expandFolds(i):this.removeFolds(i),a.length)return a},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){r??(r=e.start.row),i??(i=0),t??(t=e.end.row),n??(n=this.getLine(t).length);var a=this.doc,o=``;return e.walk(function(e,t,n,s){if(!(td)break;while(a&&c.test(a.type));a=i.stepBackward()}else a=i.getCurrentToken();return l.end.row=i.getCurrentTokenRow(),l.end.column=i.getCurrentTokenColumn(),l.start.row==l.end.row&&l.start.column>l.end.column?void 0:l}},this.foldAll=function(e,t,n,r){n??(n=1e5);var i=this.foldWidgets;if(i){t=t||this.getLength(),e=e||0;for(var a=e;a=e&&(a=o.end.row,o.collapseChildren=n,this.addFold(`...`,o))}}},this.foldToLevel=function(e){for(this.foldAll();e-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var e=this;this.foldAll(null,null,null,function(t){for(var n=e.getTokens(t),r=0;r=0;){var a=n[r];if(a??(a=n[r]=this.getFoldWidget(r)),a==`start`){var o=this.getFoldWidgetRange(r);if(i||(i=o),o&&o.end.row>=e)break}r--}return{range:r!==-1&&o,firstRange:i}},this.onFoldWidgetClick=function(e,t){t instanceof s&&(t=t.domEvent);var n={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var r=t.target||t.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=` ace_invalid`)}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),r=this.getLine(e),i=n===`end`?-1:1,a=this.getFoldAt(e,i===-1?0:r.length,i);if(a)return t.children||t.all?this.removeFold(a):this.expandFold(a),a;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(a=this.getFoldAt(o.start.row,o.start.column,1),a&&o.isEqual(a.range)))return this.removeFold(a),a;if(t.siblings){var s=this.getParentFoldRangeData(e);if(s.range)var c=s.range.start.row+1,l=s.range.end.row;this.foldAll(c,l,t.all?1e4:0)}else t.children?(l=o?o.end.row:this.getLength(),this.foldAll(e+1,l,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold(`...`,o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var r=this.getParentFoldRangeData(t,!0);if(n=r.range||r.firstRange,n){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold(`...`,n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(n===0)this.foldWidgets[t]=null;else if(e.action==`remove`)this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}t.Folding=c}),ace.define(`ace/edit_session/bracket_match`,[`require`,`exports`,`module`,`ace/token_iterator`,`ace/range`],function(e,t,n){var r=e(`../token_iterator`).TokenIterator,i=e(`../range`).Range;function a(){this.findMatchingBracket=function(e,t){if(e.column==0)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(n==``)return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t=this.getLine(e.row),n=!0,r,a=t.charAt(e.column-1),o=a&&a.match(/([\(\[\{])|([\)\]\}])/);if(o||(a=t.charAt(e.column),e={row:e.row,column:e.column+1},o=a&&a.match(/([\(\[\{])|([\)\]\}])/),n=!1),!o)return null;if(o[1]){var s=this.$findClosingBracket(o[1],e);if(!s)return null;r=i.fromPoints(e,s),n||(r.end.column++,r.start.column--),r.cursor=r.end}else{var s=this.$findOpeningBracket(o[2],e);if(!s)return null;r=i.fromPoints(s,e),n||(r.start.column++,r.end.column--),r.cursor=r.start}return r},this.getMatchingBracketRanges=function(e,t){var n=this.getLine(e.row),r=/([\(\[\{])|([\)\]\}])/,a=!t&&n.charAt(e.column-1),o=a&&a.match(r);if(o||(a=(t===void 0||t)&&n.charAt(e.column),e={row:e.row,column:e.column+1},o=a&&a.match(r)),!o)return null;var s=new i(e.row,e.column-1,e.row,e.column),c=o[1]?this.$findClosingBracket(o[1],e):this.$findOpeningBracket(o[2],e);return c?[s,new i(c.row,c.column,c.row,c.column+1)]:[s]},this.$brackets={")":`(`,"(":`)`,"]":`[`,"[":`]`,"{":`}`,"}":`{`,"<":`>`,">":`<`},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],a=1,o=new r(this,t.row,t.column),s=o.getCurrentToken();if(s||(s=o.stepForward()),s){n||(n=RegExp(`(\\.?`+s.type.replace(`.`,`\\.`).replace(`rparen`,`.paren`).replace(/\b(?:end)\b/,`(?:start|begin|end)`).replace(/-close\b/,`-(close|open)`)+`)+`));for(var c=t.column-o.getCurrentTokenColumn()-2,l=s.value;;){for(;c>=0;){var u=l.charAt(c);if(u==i){if(--a,a==0)return{row:o.getCurrentTokenRow(),column:c+o.getCurrentTokenColumn()}}else u==e&&(a+=1);--c}do s=o.stepBackward();while(s&&!n.test(s.type));if(s==null)break;l=s.value,c=l.length-1}return null}},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],a=1,o=new r(this,t.row,t.column),s=o.getCurrentToken();if(s||(s=o.stepForward()),s){n||(n=RegExp(`(\\.?`+s.type.replace(`.`,`\\.`).replace(`lparen`,`.paren`).replace(/\b(?:start|begin)\b/,`(?:start|begin|end)`).replace(/-open\b/,`-(close|open)`)+`)+`));for(var c=t.column-o.getCurrentTokenColumn();;){for(var l=s.value,u=l.length;c`?r=!0:t.type.indexOf(`tag-name`)!==-1&&(n=!0));while(t&&!n);return t},this.$findClosingTag=function(e,t){var n,r=t.value,a=t.value,o=0,s=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);t=e.stepForward();var c=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length),l=!1;do{if(n=t,n.type.indexOf(`tag-close`)!==-1&&!l){var u=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);l=!0}if(t=e.stepForward(),t){if(t.value===`>`&&!l){var u=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);l=!0}if(t.type.indexOf(`tag-name`)!==-1){if(r=t.value,a===r){if(n.value===`<`)o++;else if(n.value===``)var p=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);else return}}}else if(a===r&&t.value===`/>`&&(o--,o<0))var d=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2),f=d,p=f,u=new i(c.end.row,c.end.column,c.end.row,c.end.column+1)}}while(t&&o>=0);if(s&&u&&d&&p&&c&&f)return{openTag:new i(s.start.row,s.start.column,u.end.row,u.end.column),closeTag:new i(d.start.row,d.start.column,p.end.row,p.end.column),openTagName:c,closeTagName:f}},this.$findOpeningTag=function(e,t){var n=e.getCurrentToken(),r=t.value,a=0,o=e.getCurrentTokenRow(),s=e.getCurrentTokenColumn(),c=s+2,l=new i(o,s,o,c);e.stepForward();var u=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length);if(t.type.indexOf(`tag-close`)===-1&&(t=e.stepForward()),!(!t||t.value!==`>`)){var d=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);e.stepBackward(),e.stepBackward();do if(t=n,o=e.getCurrentTokenRow(),s=e.getCurrentTokenColumn(),c=s+t.value.length,n=e.stepBackward(),t){if(t.type.indexOf(`tag-name`)!==-1){if(r===t.value)if(n.value===`<`){if(a++,a>0){var f=new i(o,s,o,c),p=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);do t=e.stepForward();while(t&&t.value!==`>`);var m=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else n.value===``){for(var h=0,g=n;g;){if(g.type.indexOf(`tag-name`)!==-1&&g.value===r){a--;break}else if(g.value===`<`)break;g=e.stepBackward(),h++}for(var _=0;_n&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},e.prototype.$getRowCacheIndex=function(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>1,a=e[i];if(t>a)n=i+1;else if(t=t));a++);return r=n[a],r?(r.index=a,r.start=i-r.value.length,r):null},e.prototype.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},e.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},e.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},e.prototype.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(` `,this.getTabSize()):` `},e.prototype.setUseSoftTabs=function(e){this.setOption(`useSoftTabs`,e)},e.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},e.prototype.setTabSize=function(e){this.setOption(`tabSize`,e)},e.prototype.getTabSize=function(){return this.$tabSize},e.prototype.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},e.prototype.setNavigateWithinSoftTabs=function(e){this.setOption(`navigateWithinSoftTabs`,e)},e.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},e.prototype.setOverwrite=function(e){this.setOption(`overwrite`,e)},e.prototype.getOverwrite=function(){return this.$overwrite},e.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},e.prototype.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=``),this.$decorations[e]+=` `+t,this._signal(`changeBreakpoint`,{})},e.prototype.removeGutterCustomWidget=function(e){this.$editor&&this.$editor.renderer.$gutterLayer.$removeCustomWidget(e)},e.prototype.addGutterCustomWidget=function(e,t){this.$editor&&this.$editor.renderer.$gutterLayer.$addCustomWidget(e,t)},e.prototype.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||``).replace(` `+t,``),this._signal(`changeBreakpoint`,{})},e.prototype.getBreakpoints=function(){return this.$breakpoints},e.prototype.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe)),r)var i=this.tokenRe;else if(/^\s+$/.test(n.slice(t-1,t+1)))var i=/\s/;else var i=this.nonTokenRe;var a=t;if(a>0){do a--;while(a>=0&&n.charAt(a).match(i));a++}for(var o=t;oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},e.prototype.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,a=this.$foldData[i],o=a?a.start.row:1/0,s=t.length,c=0;co){if(c=a.end.row+1,c>=s)break;a=this.$foldData[i++],o=a?a.start.row:1/0}n[c]??(n[c]=this.$getStringScreenWidth(t[c])[0]),n[c]>r&&(r=n[c])}this.screenWidth=r}},e.prototype.getLine=function(e){return this.doc.getLine(e)},e.prototype.getLines=function(e,t){return this.doc.getLines(e,t)},e.prototype.getLength=function(){return this.doc.getLength()},e.prototype.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},e.prototype.insert=function(e,t){return this.doc.insert(e,t)},e.prototype.remove=function(e){return this.doc.remove(e)},e.prototype.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},e.prototype.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;n!=-1;n--){var r=e[n];r.action==`insert`||r.action==`remove`?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},e.prototype.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;ne.end.column&&(a.start.column+=s),a.end.row==e.end.row&&a.end.column>e.end.column&&(a.end.column+=s)),o&&a.start.row>=e.end.row&&(a.start.row+=o,a.end.row+=o)}if(a.end=this.insert(a.start,r),i.length){var c=e.start,l=a.start,o=l.row-c.row,s=l.column-c.column;this.addFolds(i.map(function(e){return e=e.clone(),e.start.row==c.row&&(e.start.column+=s),e.end.row==c.row&&(e.end.column+=s),e.start.row+=o,e.end.row+=o,e}))}return a},e.prototype.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},e.prototype.outdentRows=function(e){for(var t=e.collapseRows(),n=new u(0,0,0,0),r=this.getTabSize(),i=t.start.row;i<=t.end.row;++i){var a=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var r=this.getRowFoldEnd(t+n);if(r>this.doc.getLength()-1)return 0;var i=r-t}else{e=this.$clipRowToDocument(e),t=this.$clipRowToDocument(t);var i=t-e+1}var a=new u(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(a).map(function(e){return e=e.clone(),e.start.row+=i,e.end.row+=i,e}),s=n==0?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+i,s),o.length&&this.addFolds(o),i},e.prototype.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},e.prototype.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},e.prototype.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},e.prototype.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},e.prototype.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},e.prototype.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},e.prototype.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},e.prototype.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal(`changeWrapMode`)}},e.prototype.getUseWrapMode=function(){return this.$useWrapMode},e.prototype.setWrapLimitRange=function(e,t){(this.$wrapLimitRange.min!==e||this.$wrapLimitRange.max!==t)&&(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal(`changeWrapMode`))},e.prototype.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1?(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal(`changeWrapLimit`)),!0):!1},e.prototype.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},e.prototype.getWrapLimit=function(){return this.$wrapLimit},e.prototype.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},e.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},e.prototype.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,a=r.row,o=i.row,s=o-a,c=null;if(this.$updating=!0,s!=0)if(n===`remove`){this[t?`$wrapData`:`$rowLengthCache`].splice(a,s);var l=this.$foldData;c=this.getFoldsInRange(e),this.removeFolds(c);var u=this.getFoldLine(i.row),d=0;if(u){u.addRemoveChars(i.row,i.column,r.column-i.column),u.shiftRow(-s);var f=this.getFoldLine(a);f&&f!==u&&(f.merge(u),u=f),d=l.indexOf(u)+1}for(;d=i.row&&u.shiftRow(-s)}o=a}else{var p=Array(s);p.unshift(a,0);var m=t?this.$wrapData:this.$rowLengthCache;m.splice.apply(m,p);var l=this.$foldData,u=this.getFoldLine(a),d=0;if(u){var h=u.range.compareInside(r.row,r.column);h==0?(u=u.split(r.row,r.column),u&&(u.shiftRow(s),u.addRemoveChars(o,0,i.column-r.column))):h==-1&&(u.addRemoveChars(a,0,i.column-r.column),u.shiftRow(s)),d=l.indexOf(u)+1}for(;d=a&&u.shiftRow(s)}}else{s=Math.abs(e.start.column-e.end.column),n===`remove`&&(c=this.getFoldsInRange(e),this.removeFolds(c),s=-s);var u=this.getFoldLine(a);u&&u.addRemoveChars(a,r.column,s)}return t&&this.$wrapData.length!=this.doc.getLength()&&console.error(`doc.getLength() and $wrapData.length have to be the same!`),this.$updating=!1,t?this.$updateWrapData(a,o):this.$updateRowLengthCache(a,o),c},e.prototype.$updateRowLengthCache=function(e,t){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},e.prototype.$updateWrapData=function(e,t){var n=this.doc.getAllLines(),r=this.getTabSize(),i=this.$wrapData,a=this.$wrapLimit,o,s,c=e;for(t=Math.min(t,n.length-1);c<=t;)s=this.getFoldLine(c,s),s?(o=[],s.walk(function(e,t,r,i){var a;if(e!=null){a=this.$getDisplayTokens(e,o.length),a[0]=y;for(var s=1;st-f;){var p=a+t-f;if(e[p-1]>=S&&e[p]>=S){d(p);continue}if(e[p]==y||e[p]==b){for(;p!=a-1&&e[p]!=y;p--);if(p>a){d(p);continue}for(p=a+t;p>2)),a-1);p>m&&e[p]m&&e[p]m&&e[p]==x;)p--}else for(;p>m&&e[p]m){d(++p);continue}p=a+t,e[p]==v&&p--,d(p-f)}return r},e.prototype.$getDisplayTokens=function(e,t){var n=[],r;t=t||0;for(var i=0;i39&&a<48||a>57&&a<64?n.push(x):a>=4352&&T(a)?n.push(_,v):n.push(_)}return n},e.prototype.$getStringScreenWidth=function(e,t,n){if(t==0)return[0,0];t??(t=1/0),n=n||0;var r,i;for(i=0;i=4352&&T(r)?n+=2:n+=1,!(n>t));i++);return[n,i]},e.prototype.getRowLength=function(e){var t=1;return this.lineWidgets&&(t+=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0),!this.$useWrapMode||!this.$wrapData[e]?t:this.$wrapData[e].length+t},e.prototype.getRowLineCount=function(e){return!this.$useWrapMode||!this.$wrapData[e]?1:this.$wrapData[e].length+1},e.prototype.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0)var s=l[u],i=this.$docRowCache[u],f=e>l[d-1];else var f=!d;for(var p=this.getLength()-1,m=this.getNextFoldLine(i),h=m?m.start.row:1/0;s<=e&&(c=this.getRowLength(i),!(s+c>e||i>=p));)s+=c,i++,i>h&&(i=m.end.row+1,m=this.getNextFoldLine(i,m),h=m?m.start.row:1/0),f&&(this.$docRowCache.push(i),this.$screenRowCache.push(s));if(m&&m.start.row<=i)r=this.getFoldDisplayLine(m),i=m.start.row;else if(s+c<=e||i>p)return{row:p,column:this.getLine(p).length};else r=this.getLine(i),m=null;var g=0,_=Math.floor(e-s);if(this.$useWrapMode){var v=this.$wrapData[i];v&&(o=v[_],_>0&&v.length&&(g=v.indent,a=v[_-1]||v[v.length-1],r=r.substring(a)))}return n!==void 0&&this.$bidiHandler.isBidiRow(s+_,i,_)&&(t=this.$bidiHandler.offsetToCol(n)),a+=this.$getStringScreenWidth(r,t-g)[1],this.$useWrapMode&&a>=o&&(a=o-1),m?m.idxToPosition(a):{row:i,column:a}},e.prototype.documentToScreenPosition=function(e,t){if(t===void 0)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r=0,i=null,a=null;a=this.getFoldAt(e,t,1),a&&(e=a.start.row,t=a.start.column);var o,s=0,c=this.$docRowCache,l=this.$getRowCacheIndex(c,e),u=c.length;if(u&&l>=0)var s=c[l],r=this.$screenRowCache[l],d=e>c[u-1];else var d=!u;for(var f=this.getNextFoldLine(s),p=f?f.start.row:1/0;s=p){if(o=f.end.row+1,o>e)break;f=this.getNextFoldLine(o,f),p=f?f.start.row:1/0}else o=s+1;r+=this.getRowLength(s),s=o,d&&(this.$docRowCache.push(s),this.$screenRowCache.push(r))}var m=``;f&&s>=p?(m=this.getFoldDisplayLine(f,e,t),i=f.start.row):(m=this.getLine(e).substring(0,t),i=e);var h=0;if(this.$useWrapMode){var g=this.$wrapData[i];if(g){for(var _=0;m.length>=g[_];)r++,_++;m=m.substring(g[_-1]||0,m.length),h=_>0?g.indent:0}}return this.lineWidgets&&this.lineWidgets[s]&&this.lineWidgets[s].rowsAbove&&(r+=this.lineWidgets[s].rowsAbove),{row:r,column:h+this.$getStringScreenWidth(m)[0]}},e.prototype.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},e.prototype.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},e.prototype.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,r=0,i=0,t=this.$foldData[i++],a=t?t.start.row:1/0;ra&&(r=t.end.row+1,t=this.$foldData[i++],a=t?t.start.row:1/0)}else{e=this.getLength();for(var s=this.$foldData,i=0;in));a++);return[r,a]})},e.prototype.getPrecedingCharacter=function(){var e=this.selection.getCursor();return e.column===0?e.row===0?``:this.doc.getNewLineCharacter():this.getLine(e.row)[e.column-1]},e.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.endOperation(),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off(`change`,this.$onChange),this.selection&&(this.selection.off(`changeCursor`,this.$onSelectionChange),this.selection.off(`changeSelection`,this.$onSelectionChange)),this.selection.detach()},e}();g.$uid=0,g.prototype.$modes=o.$modes,g.prototype.getValue=g.prototype.toString,g.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},g.prototype.$overwrite=!1,g.prototype.$mode=null,g.prototype.$modeId=null,g.prototype.$scrollTop=0,g.prototype.$scrollLeft=0,g.prototype.$wrapLimit=80,g.prototype.$useWrapMode=!1,g.prototype.$wrapLimitRange={min:null,max:null},g.prototype.lineWidgets=null,g.prototype.isFullWidth=T,r.implement(g.prototype,s);var _=1,v=2,y=3,b=4,x=9,S=10,C=11,w=12;function T(e){return e<4352?!1:e>=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510}e(`./edit_session/folding`).Folding.call(g.prototype),e(`./edit_session/bracket_match`).BracketMatch.call(g.prototype),o.defineOptions(g.prototype,`session`,{wrap:{set:function(e){if(!e||e==`off`?e=!1:e==`free`?e=!0:e==`printMargin`?e=-1:typeof e==`string`&&(e=parseInt(e,10)||!1),this.$wrap!=e)if(this.$wrap=e,!e)this.setUseWrapMode(!1);else{var t=typeof e==`number`?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?`printMargin`:this.getWrapLimitRange().min?this.$wrap:`free`:`off`},handlesSet:!0},wrapMethod:{set:function(e){e=e==`auto`?this.$mode.type!=`text`:e!=`text`,e!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:`auto`},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal(`changeBreakpoint`)},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){e=parseInt(e),e>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal(`changeTabSize`))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal(`changeOverwrite`)},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=g}),ace.define(`ace/search`,[`require`,`exports`,`module`,`ace/lib/lang`,`ace/lib/oop`,`ace/range`],function(e,t,n){var r=e(`./lib/lang`),i=e(`./lib/oop`),a=e(`./range`).Range,o=function(){function e(){this.$options={}}return e.prototype.set=function(e){return i.mixin(this.$options,e),this},e.prototype.getOptions=function(){return r.copyObject(this.$options)},e.prototype.setOptions=function(e){this.$options=e},e.prototype.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new a(e,n,i,o),n==o&&t.start&&t.start.start&&t.skipCurrent!=0&&r.isEqual(t.start)?(r=null,!1):!0}),r},e.prototype.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],s=t.re;if(t.$isMultiLine){var c=s.length,l=i.length-c,u;outer:for(var d=s.offset||0;d<=l;d++){for(var f=0;fh||(o.push(u=new a(d,h,d+c-1,g)),c>2&&(d=d+c-2))}}else for(var _,v=0;vv&&(v=b),o.push(new a(_.startRow,_.startCol,_.endRow,_.endCol))}}else{_=r.getMatchOffsets(i[v],s);for(var f=0;f<_.length;f++){var x=_[f];o.push(new a(v,x.offset,v,x.offset+x.length))}}if(n){for(var S=n.start.column,C=n.end.column,v=0,f=o.length-1;vC&&o[f].end.row==w;)f--;for(o=o.slice(v,f+1),v=0,f=o.length;v=i){n+=`\\`;break}switch(e.charCodeAt(r)){case t.Backslash:n+=`\\`;break;case t.n:n+=` `;break;case t.t:n+=` `;break}continue}if(a===t.DollarSign){if(r++,r>=i){n+=`$`;break}var o=e.charCodeAt(r);if(o===t.DollarSign){n+=`$$`;continue}if(o===t.Digit0||o===t.Ampersand){n+=`$&`;continue}if(t.Digit1<=o&&o<=t.Digit9){n+=`$`+e[r];continue}}n+=e[r]}return n||e},e.prototype.replace=function(e,t){var n=this.$options,r=this.$assembleRegExp(n);if(n.$isMultiLine)return t;if(r){var i=this.$isMultilineSearch(n);i&&(e=e.replace(/\r\n|\r|\n/g,` `));var a=r.exec(e);if(!a||!i&&a[0].length!=e.length)return null;if(t=n.regExp?this.parseReplaceString(t):t.replace(/\$/g,`$$$$`),t=e.replace(r,t),n.preserveCase){t=t.split(``);for(var o=Math.min(e.length,e.length);o--;){var s=e[o];s&&s.toLowerCase()!=s?t[o]=t[o].toUpperCase():t[o]=t[o].toLowerCase()}t=t.join(``)}return t}},e.prototype.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var n=e.needle;if(!e.needle)return e.re=!1;e.regExp||(n=r.escapeRegExp(n));var i=e.caseSensitive?`gm`:`gmi`;try{new RegExp(n,`u`),e.$supportsUnicodeFlag=!0,i+=`u`}catch{e.$supportsUnicodeFlag=!1}if(e.wholeWord&&(n=s(n,e)),e.$isMultiLine=!t&&/[\n\r]/.test(n),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(n,i);try{var a=new RegExp(n,i)}catch{a=!1}return e.re=a},e.prototype.$assembleMultilineRegExp=function(e,t){for(var n=e.replace(/\r\n|\r|\n/g,`$ ^`).split(` `),r=[],i=0;ir);s++){var c=e.getLine(o++);i=i==null?c:i+` `+c}var u=t.exec(i);if(t.lastIndex=0,u){var d=i.slice(0,u.index).split(` `),f=u[0].split(` `),p=n+d.length-1,m=d[d.length-1].length;return{startRow:p,startCol:m,endRow:p+f.length-1,endCol:f.length==1?m+f[0].length:f[f.length-1].length}}}return null},e.prototype.$multiLineBackward=function(e,t,n,r,i){for(var a,o=l(e,r),s=e.getLine(r).length-n,u=r;u>=i;){for(var d=0;d=i;d++){var f=e.getLine(u--);a=a==null?f:f+` `+a}var p=c(a,t,s);if(p){var m=a.slice(0,p.index).split(` `),h=p[0].split(` `),g=u+m.length,_=m[m.length-1].length;return{startRow:g,startCol:_,endRow:g+h.length-1,endCol:h.length==1?_+h[0].length:h[h.length-1].length}}}return null},e.prototype.$matchIterator=function(e,t){var n=this.$assembleRegExp(t);if(!n)return!1;var i=this.$isMultilineSearch(t),a=this.$multiLineForward,o=this.$multiLineBackward,s=t.backwards==1,c=t.skipCurrent!=0,l=n.unicode,u=t.range,d=t.start;d||(d=u?u[s?`end`:`start`]:e.selection.getRange()),d.start&&(d=d[c==s?`start`:`end`]);var f=u?u.start.row:0,p=u?u.end.row:e.getLength()-1;if(s)var m=function(e){var n=d.row;if(!g(n,d.column,e)){for(n--;n>=f;n--)if(g(n,Number.MAX_VALUE,e))return;if(t.wrap!=0){for(n=p,f=d.row;n>=f;n--)if(g(n,Number.MAX_VALUE,e))return}}};else var m=function(e){var n=d.row;if(!g(n,d.column,e)){for(n+=1;n<=p;n++)if(g(n,0,e))return;if(t.wrap!=0){for(n=f,p=d.row;n<=p;n++)if(g(n,0,e))return}}};if(t.$isMultiLine)var h=n.length,g=function(t,r,i){var a=s?t-h+1:t;if(!(a<0||a+h>e.getLength())){var o=e.getLine(a),c=o.search(n[0]);if(!(!s&&cr)&&i(a,c,a+h-1,u))return!0}}};else if(s)var g=function(t,a,s){if(i){var c=o(e,n,a,t,f);if(!c)return!1;if(s(c.startRow,c.startCol,c.endRow,c.endCol))return!0}else{var u=e.getLine(t),d=[],p,m=0;for(n.lastIndex=0;p=n.exec(u);){var h=p[0].length;if(m=p.index,!h){if(m>=u.length)break;n.lastIndex=m+=r.skipEmptyMatch(u,m,l)}if(p.index+h>a)break;d.push(p.index,h)}for(var g=d.length-1;g>=0;g-=2){var _=d[g-1],h=d[g];if(s(t,_,t,_+h))return!0}}};else var g=function(t,o,s){if(n.lastIndex=o,i){var c=a(e,n,t,p);if(c){var u=c.endRow<=p?c.endRow-1:p;u>t&&(t=u)}if(!c)return!1;if(s(c.startRow,c.startCol,c.endRow,c.endCol))return!0}else for(var d=e.getLine(t),f,m;m=n.exec(d);){var h=m[0].length;if(f=m.index,s(t,f,t,f+h))return!0;if(!h&&(n.lastIndex=f+=r.skipEmptyMatch(d,f,l),f>=d.length))return!1}};return{forEach:m}},e}();function s(e,t){var n=r.supportsLookbehind();function i(e,r){return r===void 0&&(r=!0),(n&&t.$supportsUnicodeFlag?RegExp(`[\\p{L}\\p{N}_]`,`u`):RegExp(`\\w`)).test(e)||t.regExp?n&&t.$supportsUnicodeFlag?r?`(?<=^|[^\\p{L}\\p{N}_])`:`(?=[^\\p{L}\\p{N}_]|$)`:`\\b`:``}var a=Array.from(e),o=a[0],s=a[a.length-1];return i(o)+e+i(s,!1)}function c(e,t,n){for(var r=null,i=0;i<=e.length;){t.lastIndex=i;var a=t.exec(e);if(!a)break;var o=a.index+a[0].length;if(o>e.length-n)break;(!r||o>r.index+r[0].length)&&(r=a),i=a.index+1}return r}function l(e,t){var n=5e3,r={row:t,column:0},i=e.doc.positionToIndex(r)+n;return e.doc.indexToPosition(i).row+1}t.Search=o}),ace.define(`ace/keyboard/hash_handler`,[`require`,`exports`,`module`,`ace/lib/keys`,`ace/lib/useragent`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=e(`../lib/keys`),a=e(`../lib/useragent`),o=i.KEY_MODS,s=function(){function e(e,t){this.$init(e,t,!1)}return e.prototype.$init=function(e,t,n){this.platform=t||(a.isMac?`mac`:`win`),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=n},e.prototype.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},e.prototype.removeCommand=function(e,t){var n=e&&(typeof e==`string`?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var a=r[i];if(a==e)delete r[i];else if(Array.isArray(a)){var o=a.indexOf(e);o!=-1&&(a.splice(o,1),a.length==1&&(r[i]=a[0]))}}},e.prototype.bindKey=function(e,t,n){if(typeof e==`object`&&e&&(n??(n=e.position),e=e[this.platform]),e){if(typeof t==`function`)return this.addCommand({exec:t,bindKey:e,name:t.name||e});e.split(`|`).forEach(function(e){var r=``;if(e.indexOf(` `)!=-1){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=o[t.hashId]+t.key;r+=(r?` `:``)+n,this._addCommandToBinding(r,`chainKeys`)},this),r+=` `}var a=this.parseKeys(e),s=o[a.hashId]+a.key;this._addCommandToBinding(r+s,t,n)},this)}},e.prototype._addCommandToBinding=function(e,t,n){var r=this.commandKeyBinding,i;if(!t)delete r[e];else if(!r[e]||this.$singleCommand)r[e]=t;else{Array.isArray(r[e])?(i=r[e].indexOf(t))!=-1&&r[e].splice(i,1):r[e]=[r[e]],typeof n!=`number`&&(n=c(t));var a=r[e];for(i=0;in)break}a.splice(i,0,t)}},e.prototype.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(n){if(typeof n==`string`)return this.bindKey(n,t);typeof n==`function`&&(n={exec:n}),typeof n==`object`&&(n.name||(n.name=t),this.addCommand(n))}},this)},e.prototype.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},e.prototype.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},e.prototype._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},e.prototype.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),r=i[n];if(i.FUNCTION_KEYS[r])n=i.FUNCTION_KEYS[r].toLowerCase();else if(!t.length)return{key:n,hashId:-1};else if(t.length==1&&t[0]==`shift`)return{key:n.toUpperCase(),hashId:-1};for(var a=0,o=t.length;o--;){var s=i.KEY_MODS[t[o]];if(s==null)return typeof console<`u`&&console.error(`invalid modifier `+t[o]+` in `+e),!1;a|=s}return{key:n,hashId:a}},e.prototype.findKeyCommand=function(e,t){var n=o[e]+t;return this.commandKeyBinding[n]},e.prototype.handleKeyboard=function(e,t,n,r){if(!(r<0)){var i=o[t]+n,a=this.commandKeyBinding[i];return e.$keyChain&&(e.$keyChain+=` `+i,a=this.commandKeyBinding[e.$keyChain]||a),a&&(a==`chainKeys`||a[a.length-1]==`chainKeys`)?(e.$keyChain=e.$keyChain||i,{command:`null`}):(e.$keyChain&&((!t||t==4)&&n.length==1?e.$keyChain=e.$keyChain.slice(0,-i.length-1):(t==-1||r>0)&&(e.$keyChain=``)),{command:a})}},e.prototype.getStatusText=function(e,t){return t.$keyChain||``},e}();function c(e){return typeof e==`object`&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}var l=function(e){r(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.$singleCommand=!0,r}return t}(s);l.call=function(e,t,n){s.prototype.$init.call(e,t,n,!0)},s.call=function(e,t,n){s.prototype.$init.call(e,t,n,!1)},t.HashHandler=l,t.MultiHashHandler=s}),ace.define(`ace/commands/command_manager`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/keyboard/hash_handler`,`ace/lib/event_emitter`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=e(`../lib/oop`),a=e(`../keyboard/hash_handler`).MultiHashHandler,o=e(`../lib/event_emitter`).EventEmitter,s=function(e){r(t,e);function t(t,n){var r=e.call(this,n,t)||this;return r.byName=r.commands,r.setDefaultHandler(`exec`,function(e){return e.args?e.command.exec(e.editor,e.args,e.event,!1):e.command.exec(e.editor,{},e.event,!0)}),r}return t.prototype.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}typeof e==`string`&&(e=this.commands[e]);var i={editor:t,command:e,args:n};return this.canExecute(e,t)?(i.returnValue=this._emit(`exec`,i),this._signal(`afterExec`,i),i.returnValue!==!1):(this._signal(`commandUnavailable`,i),!1)},t.prototype.canExecute=function(e,t){return typeof e==`string`&&(e=this.commands[e]),!(!e||t&&t.$readOnly&&!e.readOnly||this.$checkCommandState!=0&&e.isAvailable&&!e.isAvailable(t))},t.prototype.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit(`changeStatus`),this.recording?(this.macro.pop(),this.off(`exec`,this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on(`exec`,this.$addCommandToMacro),this.recording=!0)},t.prototype.replay=function(e){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t==`string`?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},t.prototype.trimMacro=function(e){return e.map(function(e){return typeof e[0]!=`string`&&(e[0]=e[0].name),e[1]||(e=e[0]),e})},t}(a);i.implement(s.prototype,o),t.CommandManager=s}),ace.define(`ace/commands/default_commands`,[`require`,`exports`,`module`,`ace/lib/lang`,`ace/config`,`ace/range`],function(e,t,n){var r=e(`../lib/lang`),i=e(`../config`),a=e(`../range`).Range;function o(e,t){return{win:e,mac:t}}t.commands=[{name:`showSettingsMenu`,description:`Show settings menu`,bindKey:o(`Ctrl-,`,`Command-,`),exec:function(e){i.loadModule(`ace/ext/settings_menu`,function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:`goToNextError`,description:`Go to next error`,bindKey:o(`Alt-E`,`F4`),exec:function(e){i.loadModule(`ace/ext/error_marker`,function(t){t.showErrorMarker(e,1)})},scrollIntoView:`animate`,readOnly:!0},{name:`goToPreviousError`,description:`Go to previous error`,bindKey:o(`Alt-Shift-E`,`Shift-F4`),exec:function(e){i.loadModule(`ace/ext/error_marker`,function(t){t.showErrorMarker(e,-1)})},scrollIntoView:`animate`,readOnly:!0},{name:`selectall`,description:`Select all`,bindKey:o(`Ctrl-A`,`Command-A`),exec:function(e){e.selectAll()},readOnly:!0},{name:`centerselection`,description:`Center selection`,bindKey:o(null,`Ctrl-L`),exec:function(e){e.centerSelection()},readOnly:!0},{name:`gotoline`,description:`Go to line...`,bindKey:o(`Ctrl-L`,`Command-L`),exec:function(e,t){typeof t==`number`&&!isNaN(t)&&e.gotoLine(t),e.prompt({$type:`gotoLine`})},readOnly:!0},{name:`fold`,bindKey:o(`Alt-L|Ctrl-F1`,`Command-Alt-L|Command-F1`),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:`forEach`,scrollIntoView:`center`,readOnly:!0},{name:`unfold`,bindKey:o(`Alt-Shift-L|Ctrl-Shift-F1`,`Command-Alt-Shift-L|Command-Shift-F1`),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:`forEach`,scrollIntoView:`center`,readOnly:!0},{name:`toggleFoldWidget`,description:`Toggle fold widget`,bindKey:o(`F2`,`F2`),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:`forEach`,scrollIntoView:`center`,readOnly:!0},{name:`toggleParentFoldWidget`,description:`Toggle parent fold widget`,bindKey:o(`Alt-F2`,`Alt-F2`),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:`forEach`,scrollIntoView:`center`,readOnly:!0},{name:`foldall`,description:`Fold all`,bindKey:o(null,`Ctrl-Command-Option-0`),exec:function(e){e.session.foldAll()},scrollIntoView:`center`,readOnly:!0},{name:`foldAllComments`,description:`Fold all comments`,bindKey:o(null,`Ctrl-Command-Option-0`),exec:function(e){e.session.foldAllComments()},scrollIntoView:`center`,readOnly:!0},{name:`foldOther`,description:`Fold other`,bindKey:o(`Alt-0`,`Command-Option-0`),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:`center`,readOnly:!0},{name:`unfoldall`,description:`Unfold all`,bindKey:o(`Alt-Shift-0`,`Command-Option-Shift-0`),exec:function(e){e.session.unfold()},scrollIntoView:`center`,readOnly:!0},{name:`findnext`,description:`Find next`,bindKey:o(`Ctrl-K`,`Command-G`),exec:function(e){e.findNext()},multiSelectAction:`forEach`,scrollIntoView:`center`,readOnly:!0},{name:`findprevious`,description:`Find previous`,bindKey:o(`Ctrl-Shift-K`,`Command-Shift-G`),exec:function(e){e.findPrevious()},multiSelectAction:`forEach`,scrollIntoView:`center`,readOnly:!0},{name:`selectOrFindNext`,description:`Select or find next`,bindKey:o(`Alt-K`,`Ctrl-G`),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:`selectOrFindPrevious`,description:`Select or find previous`,bindKey:o(`Alt-Shift-K`,`Ctrl-Shift-G`),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:`find`,description:`Find`,bindKey:o(`Ctrl-F`,`Command-F`),exec:function(e){i.loadModule(`ace/ext/searchbox`,function(t){t.Search(e)})},readOnly:!0},{name:`overwrite`,description:`Overwrite`,bindKey:`Insert`,exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:`selecttostart`,description:`Select to start`,bindKey:o(`Ctrl-Shift-Home`,`Command-Shift-Home|Command-Shift-Up`),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:`forEach`,readOnly:!0,scrollIntoView:`animate`,aceCommandGroup:`fileJump`},{name:`gotostart`,description:`Go to start`,bindKey:o(`Ctrl-Home`,`Command-Home|Command-Up`),exec:function(e){e.navigateFileStart()},multiSelectAction:`forEach`,readOnly:!0,scrollIntoView:`animate`,aceCommandGroup:`fileJump`},{name:`selectup`,description:`Select up`,bindKey:o(`Shift-Up`,`Shift-Up|Ctrl-Shift-P`),exec:function(e){e.getSelection().selectUp()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`golineup`,description:`Go line up`,bindKey:o(`Up`,`Up|Ctrl-P`),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selecttoend`,description:`Select to end`,bindKey:o(`Ctrl-Shift-End`,`Command-Shift-End|Command-Shift-Down`),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:`forEach`,readOnly:!0,scrollIntoView:`animate`,aceCommandGroup:`fileJump`},{name:`gotoend`,description:`Go to end`,bindKey:o(`Ctrl-End`,`Command-End|Command-Down`),exec:function(e){e.navigateFileEnd()},multiSelectAction:`forEach`,readOnly:!0,scrollIntoView:`animate`,aceCommandGroup:`fileJump`},{name:`selectdown`,description:`Select down`,bindKey:o(`Shift-Down`,`Shift-Down|Ctrl-Shift-N`),exec:function(e){e.getSelection().selectDown()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`golinedown`,description:`Go line down`,bindKey:o(`Down`,`Down|Ctrl-N`),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selectwordleft`,description:`Select word left`,bindKey:o(`Ctrl-Shift-Left`,`Option-Shift-Left`),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`gotowordleft`,description:`Go to word left`,bindKey:o(`Ctrl-Left`,`Option-Left`),exec:function(e){e.navigateWordLeft()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selecttolinestart`,description:`Select to line start`,bindKey:o(`Alt-Shift-Left`,`Command-Shift-Left|Ctrl-Shift-A`),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`gotolinestart`,description:`Go to line start`,bindKey:o(`Alt-Left|Home`,`Command-Left|Home|Ctrl-A`),exec:function(e){e.navigateLineStart()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selectleft`,description:`Select left`,bindKey:o(`Shift-Left`,`Shift-Left|Ctrl-Shift-B`),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`gotoleft`,description:`Go to left`,bindKey:o(`Left`,`Left|Ctrl-B`),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selectwordright`,description:`Select word right`,bindKey:o(`Ctrl-Shift-Right`,`Option-Shift-Right`),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`gotowordright`,description:`Go to word right`,bindKey:o(`Ctrl-Right`,`Option-Right`),exec:function(e){e.navigateWordRight()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selecttolineend`,description:`Select to line end`,bindKey:o(`Alt-Shift-Right`,`Command-Shift-Right|Shift-End|Ctrl-Shift-E`),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`gotolineend`,description:`Go to line end`,bindKey:o(`Alt-Right|End`,`Command-Right|End|Ctrl-E`),exec:function(e){e.navigateLineEnd()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selectright`,description:`Select right`,bindKey:o(`Shift-Right`,`Shift-Right`),exec:function(e){e.getSelection().selectRight()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`gotoright`,description:`Go to right`,bindKey:o(`Right`,`Right|Ctrl-F`),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selectpagedown`,description:`Select page down`,bindKey:`Shift-PageDown`,exec:function(e){e.selectPageDown()},readOnly:!0},{name:`pagedown`,description:`Page down`,bindKey:o(null,`Option-PageDown`),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:`gotopagedown`,description:`Go to page down`,bindKey:o(`PageDown`,`PageDown|Ctrl-V`),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:`selectpageup`,description:`Select page up`,bindKey:`Shift-PageUp`,exec:function(e){e.selectPageUp()},readOnly:!0},{name:`pageup`,description:`Page up`,bindKey:o(null,`Option-PageUp`),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:`gotopageup`,description:`Go to page up`,bindKey:`PageUp`,exec:function(e){e.gotoPageUp()},readOnly:!0},{name:`scrollup`,description:`Scroll up`,bindKey:o(`Ctrl-Up`,null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:`scrolldown`,description:`Scroll down`,bindKey:o(`Ctrl-Down`,null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:`selectlinestart`,description:`Select line start`,bindKey:`Shift-Home`,exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selectlineend`,description:`Select line end`,bindKey:`Shift-End`,exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`togglerecording`,description:`Toggle recording`,bindKey:o(`Ctrl-Alt-E`,`Command-Option-E`),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:`replaymacro`,description:`Replay macro`,bindKey:o(`Ctrl-Shift-E`,`Command-Shift-E`),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:`jumptomatching`,description:`Jump to matching`,bindKey:o(`Ctrl-\\|Ctrl-P`,`Command-\\`),exec:function(e){e.jumpToMatching()},multiSelectAction:`forEach`,scrollIntoView:`animate`,readOnly:!0},{name:`selecttomatching`,description:`Select to matching`,bindKey:o(`Ctrl-Shift-\\|Ctrl-Shift-P`,`Command-Shift-\\`),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:`forEach`,scrollIntoView:`animate`,readOnly:!0},{name:`expandToMatching`,description:`Expand to matching`,bindKey:o(`Ctrl-Shift-M`,`Ctrl-Shift-M`),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:`forEach`,scrollIntoView:`animate`,readOnly:!0},{name:`passKeysToBrowser`,description:`Pass keys to browser`,bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:`copy`,description:`Copy`,exec:function(e){},readOnly:!0},{name:`cut`,description:`Cut`,exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit(`cut`,t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:`cursor`,multiSelectAction:`forEach`},{name:`paste`,description:`Paste`,exec:function(e,t){e.$handlePaste(t)},scrollIntoView:`cursor`},{name:`removeline`,description:`Remove line`,bindKey:o(`Ctrl-D`,`Command-D`),exec:function(e){e.removeLines()},scrollIntoView:`cursor`,multiSelectAction:`forEachLine`},{name:`duplicateSelection`,description:`Duplicate selection`,bindKey:o(`Ctrl-Shift-D`,`Command-Shift-D`),exec:function(e){e.duplicateSelection()},scrollIntoView:`cursor`,multiSelectAction:`forEach`},{name:`sortlines`,description:`Sort lines`,bindKey:o(`Ctrl-Alt-S`,`Command-Alt-S`),exec:function(e){e.sortLines()},scrollIntoView:`selection`,multiSelectAction:`forEachLine`},{name:`togglecomment`,description:`Toggle comment`,bindKey:o(`Ctrl-/`,`Command-/`),exec:function(e){e.toggleCommentLines()},multiSelectAction:`forEachLine`,scrollIntoView:`selectionPart`},{name:`toggleBlockComment`,description:`Toggle block comment`,bindKey:o(`Ctrl-Shift-/`,`Command-Shift-/`),exec:function(e){e.toggleBlockComment()},multiSelectAction:`forEach`,scrollIntoView:`selectionPart`},{name:`modifyNumberUp`,description:`Modify number up`,bindKey:o(`Ctrl-Shift-Up`,`Alt-Shift-Up`),exec:function(e){e.modifyNumber(1)},scrollIntoView:`cursor`,multiSelectAction:`forEach`},{name:`modifyNumberDown`,description:`Modify number down`,bindKey:o(`Ctrl-Shift-Down`,`Alt-Shift-Down`),exec:function(e){e.modifyNumber(-1)},scrollIntoView:`cursor`,multiSelectAction:`forEach`},{name:`replace`,description:`Replace`,bindKey:o(`Ctrl-H`,`Command-Option-F`),exec:function(e){i.loadModule(`ace/ext/searchbox`,function(t){t.Search(e,!0)})}},{name:`undo`,description:`Undo`,bindKey:o(`Ctrl-Z`,`Command-Z`),exec:function(e){e.undo()}},{name:`redo`,description:`Redo`,bindKey:o(`Ctrl-Shift-Z|Ctrl-Y`,`Command-Shift-Z|Command-Y`),exec:function(e){e.redo()}},{name:`copylinesup`,description:`Copy lines up`,bindKey:o(`Alt-Shift-Up`,`Command-Option-Up`),exec:function(e){e.copyLinesUp()},scrollIntoView:`cursor`},{name:`movelinesup`,description:`Move lines up`,bindKey:o(`Alt-Up`,`Option-Up`),exec:function(e){e.moveLinesUp()},scrollIntoView:`cursor`},{name:`copylinesdown`,description:`Copy lines down`,bindKey:o(`Alt-Shift-Down`,`Command-Option-Down`),exec:function(e){e.copyLinesDown()},scrollIntoView:`cursor`},{name:`movelinesdown`,description:`Move lines down`,bindKey:o(`Alt-Down`,`Option-Down`),exec:function(e){e.moveLinesDown()},scrollIntoView:`cursor`},{name:`del`,description:`Delete`,bindKey:o(`Delete`,`Delete|Ctrl-D|Shift-Delete`),exec:function(e){e.remove(`right`)},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`backspace`,description:`Backspace`,bindKey:o(`Shift-Backspace|Backspace`,`Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H`),exec:function(e){e.remove(`left`)},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`cut_or_delete`,description:`Cut or delete`,bindKey:o(`Shift-Delete`,null),exec:function(e){if(e.selection.isEmpty())e.remove(`left`);else return!1},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`removetolinestart`,description:`Remove to line start`,bindKey:o(`Alt-Backspace`,`Command-Backspace`),exec:function(e){e.removeToLineStart()},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`removetolineend`,description:`Remove to line end`,bindKey:o(`Alt-Delete`,`Ctrl-K|Command-Delete`),exec:function(e){e.removeToLineEnd()},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`removetolinestarthard`,description:`Remove to line start hard`,bindKey:o(`Ctrl-Shift-Backspace`,null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`removetolineendhard`,description:`Remove to line end hard`,bindKey:o(`Ctrl-Shift-Delete`,null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`removewordleft`,description:`Remove word left`,bindKey:o(`Ctrl-Backspace`,`Alt-Backspace|Ctrl-Alt-Backspace`),exec:function(e){e.removeWordLeft()},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`removewordright`,description:`Remove word right`,bindKey:o(`Ctrl-Delete`,`Alt-Delete`),exec:function(e){e.removeWordRight()},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`outdent`,description:`Outdent`,bindKey:o(`Shift-Tab`,`Shift-Tab`),exec:function(e){e.blockOutdent()},multiSelectAction:`forEach`,scrollIntoView:`selectionPart`},{name:`indent`,description:`Indent`,bindKey:o(`Tab`,`Tab`),exec:function(e){e.indent()},multiSelectAction:`forEach`,scrollIntoView:`selectionPart`},{name:`blockoutdent`,description:`Block outdent`,bindKey:o(`Ctrl-[`,`Ctrl-[`),exec:function(e){e.blockOutdent()},multiSelectAction:`forEachLine`,scrollIntoView:`selectionPart`},{name:`blockindent`,description:`Block indent`,bindKey:o(`Ctrl-]`,`Ctrl-]`),exec:function(e){e.blockIndent()},multiSelectAction:`forEachLine`,scrollIntoView:`selectionPart`},{name:`insertstring`,description:`Insert string`,exec:function(e,t){e.insert(t)},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`inserttext`,description:`Insert text`,exec:function(e,t){e.insert(r.stringRepeat(t.text||``,t.times||1))},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`splitline`,description:`Split line`,bindKey:o(null,`Ctrl-O`),exec:function(e){e.splitLine()},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`transposeletters`,description:`Transpose letters`,bindKey:o(`Alt-Shift-X`,`Ctrl-T`),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:`cursor`},{name:`touppercase`,description:`To uppercase`,bindKey:o(`Ctrl-U`,`Ctrl-U`),exec:function(e){e.toUpperCase()},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`tolowercase`,description:`To lowercase`,bindKey:o(`Ctrl-Shift-U`,`Ctrl-Shift-U`),exec:function(e){e.toLowerCase()},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`autoindent`,description:`Auto Indent`,bindKey:o(null,null),exec:function(e){e.autoIndent()},scrollIntoView:`animate`},{name:`expandtoline`,description:`Expand to line`,bindKey:o(`Ctrl-Shift-L`,`Command-Shift-L`),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`openlink`,bindKey:o(`Ctrl+F3`,`F3`),exec:function(e){e.openLink()}},{name:`joinlines`,description:`Join lines`,bindKey:o(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,s=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/,` `).length,c=e.session.doc.getLine(n.row),l=n.row+1;l<=i.row+1;l++){var u=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(l)));u.length!==0&&(u=` `+u),c+=u}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+s)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:`forEach`,readOnly:!0},{name:`invertSelection`,description:`Invert selection`,bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o0||e+t=0&&this.$isCustomWidgetVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isCustomWidgetVisible(e+t))return e+t;if(e-t>=0&&this.$isFoldWidgetVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(e+t))return e+t}return null},e.prototype.$findNearestAnnotation=function(e){if(this.$isAnnotationVisible(e))return e;for(var t=0;e-t>0||e+t=0&&this.$isAnnotationVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isAnnotationVisible(e+t))return e+t}return null},e.prototype.$focusFoldWidget=function(e){if(e!=null){var t=this.$getFoldWidget(e);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus()}},e.prototype.$focusCustomWidget=function(e){if(e!=null){var t=this.$getCustomWidget(e);t&&(t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus())}},e.prototype.$focusAnnotation=function(e){if(e!=null){var t=this.$getAnnotation(e);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus()}},e.prototype.$blurFoldWidget=function(e){var t=this.$getFoldWidget(e);t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur()},e.prototype.$blurCustomWidget=function(e){var t=this.$getCustomWidget(e);t&&(t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur())},e.prototype.$blurAnnotation=function(e){var t=this.$getAnnotation(e);t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur()},e.prototype.$moveFoldWidgetUp=function(){for(var e=this.activeRowIndex;e>0;)if(e--,this.$isFoldWidgetVisible(e)||this.$isCustomWidgetVisible(e)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=e,this.$isFoldWidgetVisible(e)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},e.prototype.$moveFoldWidgetDown=function(){for(var e=this.activeRowIndex;e0;)if(e--,this.$isAnnotationVisible(e)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,this.$focusAnnotation(this.activeRowIndex);return}},e.prototype.$moveAnnotationDown=function(){for(var e=this.activeRowIndex;e=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},i=e(`./lib/oop`),a=e(`./lib/dom`),o=e(`./lib/lang`),s=e(`./lib/useragent`),c=e(`./keyboard/textinput`).TextInput,l=e(`./mouse/mouse_handler`).MouseHandler,u=e(`./mouse/fold_handler`).FoldHandler,d=e(`./keyboard/keybinding`).KeyBinding,f=e(`./edit_session`).EditSession,p=e(`./search`).Search,m=e(`./range`).Range,h=e(`./lib/event_emitter`).EventEmitter,g=e(`./commands/command_manager`).CommandManager,_=e(`./commands/default_commands`).commands,v=e(`./config`),y=e(`./token_iterator`).TokenIterator,b=e(`./keyboard/gutter_handler`).GutterKeyboardHandler,x=e(`./config`).nls,S=e(`./clipboard`),C=e(`./lib/keys`),w=e(`./lib/event`),T=e(`./tooltip`).HoverTooltip,E=function(){function e(t,n,r){this.id=`editor`+ ++e.$uid,this.session,this.$toDestroy=[],this.container=t.getContainerElement(),this.renderer=t,this.commands=new g(s.isMac?`mac`:`win`,_),typeof document==`object`&&(this.textInput=new c(t.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new l(this),new u(this)),this.keyBinding=new d(this),this.$search=new p().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on(`exec`,this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=o.delayedCall(function(){this._signal(`input`,{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on(`change`,function(e,t){t._$emitInputEvent.schedule(31)}),this.setSession(n||r&&r.session||new f(``)),v.resetOptions(this),r&&this.setOptions(r),v._signal(`editor`,this)}return e.prototype.$initOperationListeners=function(){this.commands.on(`exec`,this.startOperation.bind(this),!0),this.commands.on(`afterExec`,this.endOperation.bind(this),!0)},e.prototype.startOperation=function(e){this.session.startOperation(e)},e.prototype.endOperation=function(e){this.session.endOperation(e)},e.prototype.onStartOperation=function(e){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,e||(this.previousCommand=null)},e.prototype.onEndOperation=function(e){if(this.curOp&&this.session){if(e&&e.returnValue===!1){this.curOp=null;return}if(this._signal(`beforeEndOperation`),!this.curOp)return;var t=this.curOp.command,n=t&&t.scrollIntoView;if(n){switch(n){case`center-animate`:n=`animate`;case`center`:this.renderer.scrollCursorIntoView(null,.5);break;case`animate`:case`cursor`:this.renderer.scrollCursorIntoView();break;case`selectionPart`:var r=this.selection.getRange(),i=this.renderer.layerConfig;(r.start.row>=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break;default:break}n==`animate`&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.$lastSel=this.session.selection.toJSON(),this.prevOp=this.curOp,this.curOp=null}},e.prototype.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if(e.command.name==`insertstring`){var i=e.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&n.indexOf(e.command.name)!==-1;this.$mergeUndoDeltas!=`always`&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:n.indexOf(e.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},e.prototype.setKeyboardHandler=function(e,t){if(e&&typeof e==`string`&&e!=`ace`){this.$keybindingId=e;var n=this;v.loadModule([`keybinding`,e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},e.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},e.prototype.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off(`change`,this.$onDocumentChange),this.session.off(`changeMode`,this.$onChangeMode),this.session.off(`tokenizerUpdate`,this.$onTokenizerUpdate),this.session.off(`changeTabSize`,this.$onChangeTabSize),this.session.off(`changeWrapLimit`,this.$onChangeWrapLimit),this.session.off(`changeWrapMode`,this.$onChangeWrapMode),this.session.off(`changeFold`,this.$onChangeFold),this.session.off(`changeFrontMarker`,this.$onChangeFrontMarker),this.session.off(`changeBackMarker`,this.$onChangeBackMarker),this.session.off(`changeBreakpoint`,this.$onChangeBreakpoint),this.session.off(`changeAnnotation`,this.$onChangeAnnotation),this.session.off(`changeOverwrite`,this.$onCursorChange),this.session.off(`changeScrollTop`,this.$onScrollTopChange),this.session.off(`changeScrollLeft`,this.$onScrollLeftChange),this.session.off(`startOperation`,this.$onStartOperation),this.session.off(`endOperation`,this.$onEndOperation);var n=this.session.getSelection();n.off(`changeCursor`,this.$onCursorChange),n.off(`changeSelection`,this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on(`change`,this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on(`changeMode`,this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on(`tokenizerUpdate`,this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on(`changeTabSize`,this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on(`changeWrapLimit`,this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on(`changeWrapMode`,this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on(`changeFold`,this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on(`changeFrontMarker`,this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on(`changeBackMarker`,this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on(`changeBreakpoint`,this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on(`changeAnnotation`,this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on(`changeOverwrite`,this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on(`changeScrollTop`,this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on(`changeScrollLeft`,this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on(`changeCursor`,this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on(`changeSelection`,this.$onSelectionChange),this.$onStartOperation=this.onStartOperation.bind(this),this.session.on(`startOperation`,this.$onStartOperation),this.$onEndOperation=this.onEndOperation.bind(this),this.session.on(`endOperation`,this.$onEndOperation),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal(`changeSession`,{session:e,oldSession:t}),this.curOp=null,t&&t._signal(`changeEditor`,{oldEditor:this}),t&&(t.$editor=null),e&&e._signal(`changeEditor`,{editor:this}),e&&(e.$editor=this),e&&!e.destroyed&&e.bgTokenizer.scheduleStart()}},e.prototype.getSession=function(){return this.session},e.prototype.setValue=function(e,t){return this.session.doc.setValue(e),t?t==1?this.navigateFileEnd():t==-1&&this.navigateFileStart():this.selectAll(),e},e.prototype.getValue=function(){return this.session.getValue()},e.prototype.getSelection=function(){return this.selection},e.prototype.resize=function(e){this.renderer.onResize(e)},e.prototype.setTheme=function(e,t){this.renderer.setTheme(e,t)},e.prototype.getTheme=function(){return this.renderer.getTheme()},e.prototype.setStyle=function(e,t){this.renderer.setStyle(e,t)},e.prototype.unsetStyle=function(e){this.renderer.unsetStyle(e)},e.prototype.getFontSize=function(){return this.getOption(`fontSize`)||a.computedStyle(this.container).fontSize},e.prototype.setFontSize=function(e){this.setOption(`fontSize`,e)},e.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(!(!t||t.destroyed)){t.$bracketHighlight&&(t.$bracketHighlight.markerIds.forEach(function(e){t.removeMarker(e)}),t.$bracketHighlight=null);var n=e.getCursorPosition(),r=e.getKeyboardHandler(),i=r&&r.$getDirectionForHighlight&&r.$getDirectionForHighlight(e),a=t.getMatchingBracketRanges(n,i);if(!a){var o=new y(t,n.row,n.column).getCurrentToken();if(o&&/\b(?:tag-open|tag-name)/.test(o.type)){var s=t.getMatchingTags(n);s&&(a=[s.openTagName.isEmpty()?s.openTag:s.openTagName,s.closeTagName.isEmpty()?s.closeTag:s.closeTagName])}}if(!a&&t.$mode.getMatching&&(a=t.$mode.getMatching(e.session)),!a){e.getHighlightIndentGuides()&&e.renderer.$textLayer.$highlightIndentGuide();return}var c=`ace_bracket`;Array.isArray(a)?a.length==1&&(c=`ace_error_bracket`):a=[a],a.length==2&&(m.comparePoints(a[0].end,a[1].start)==0?a=[m.fromPoints(a[0].start,a[1].end)]:m.comparePoints(a[0].start,a[1].end)==0&&(a=[m.fromPoints(a[1].start,a[0].end)])),t.$bracketHighlight={ranges:a,markerIds:a.map(function(e){return t.addMarker(e,c,`text`)})},e.getHighlightIndentGuides()&&e.renderer.$textLayer.$highlightIndentGuide()}},50)}},e.prototype.focus=function(){this.textInput.focus()},e.prototype.isFocused=function(){return this.textInput.isFocused()},e.prototype.blur=function(){this.textInput.blur()},e.prototype.onFocus=function(e){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit(`focus`,e))},e.prototype.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit(`blur`,e))},e.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},e.prototype.onDocumentChange=function(e){var t=this.session.$useWrapMode,n=e.start.row==e.end.row?e.end.row:1/0;this.renderer.updateLines(e.start.row,n,t),this._signal(`change`,e),this.$cursorChange()},e.prototype.onTokenizerUpdate=function(e){var t=e.data;this.renderer.updateLines(t.first,t.last)},e.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},e.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},e.prototype.onCursorChange=function(){this.$cursorChange(),this._signal(`changeSelection`)},e.prototype.$updateHighlightActiveLine=function(){var e=this.getSession(),t;if(this.$highlightActiveLine&&((this.$selectionStyle!=`line`||!this.selection.isMultiLine())&&(t=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(t=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(t=!1)),e.$highlightLineMarker&&!t)e.removeMarker(e.$highlightLineMarker.id),e.$highlightLineMarker=null;else if(!e.$highlightLineMarker&&t){var n=new m(t.row,t.column,t.row,1/0);n.id=e.addMarker(n,`ace_active-line`,`screenLine`),e.$highlightLineMarker=n}else t&&(e.$highlightLineMarker.start.row=t.row,e.$highlightLineMarker.end.row=t.row,e.$highlightLineMarker.start.column=t.column,e._signal(`changeBackMarker`))},e.prototype.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,`ace_selection`,r)}var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal(`changeSelection`)},e.prototype.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!(t.isEmpty()||t.isMultiLine())){var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),a=i.substring(n,r);if(!(a.length>5e3||!/[\w\d]/.test(a))){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:a}),s=i.substring(n-1,r+1);if(o.test(s))return o}}},e.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},e.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},e.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},e.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},e.prototype.onChangeMode=function(e){this.renderer.updateText(),this._emit(`changeMode`,e)},e.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},e.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},e.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},e.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},e.prototype.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var r=this.selection.getAllRanges(),i=0;is.search(/\S|$/)){var c=s.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+c)}}this.clearSelection();var l=i.column,u=n.getState(i.row),s=n.getLine(i.row),d=r.checkOutdent(u,s,e);if(n.insert(i,e),a&&a.selection&&(a.selection.length==2?this.selection.setSelectionRange(new m(i.row,l+a.selection[0],i.row,l+a.selection[1])):this.selection.setSelectionRange(new m(i.row+a.selection[0],a.selection[1],i.row+a.selection[2],a.selection[3]))),this.$enableAutoIndent){if(n.getDocument().isNewLine(e)){var f=r.getNextLineIndent(u,s.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},f)}d&&r.autoOutdent(u,n,i.row)}},e.prototype.autoIndent=function(){for(var e=this.session,t=e.getMode(),n=this.selection.isEmpty()?[new m(0,0,e.doc.getLength()-1,0)]:this.selection.getAllRanges(),r=``,i=``,a=``,o=e.getTabString(),s=0;s0&&(r=e.getState(u-1),i=e.getLine(u-1),a=t.getNextLineIndent(r,i,o));var d=e.getLine(u),f=t.$getIndent(d);if(a!==f){if(f.length>0){var p=new m(u,0,u,f.length);e.remove(p)}a.length>0&&e.insert({row:u,column:0},a)}t.autoOutdent(r,e,u)}},e.prototype.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:`insertstring`}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},e.prototype.applyComposition=function(e,t){if(t.extendLeft||t.extendRight){var n=this.selection.getRange();n.start.column-=t.extendLeft,n.end.column+=t.extendRight,n.start.column<0&&(n.start.row--,n.start.column+=this.session.getLine(n.start.row).length+1),this.selection.setRange(n),!e&&!n.isEmpty()&&this.remove()}if((e||!this.selection.isEmpty())&&this.insert(e,!0),t.restoreStart||t.restoreEnd){var n=this.selection.getRange();n.start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n)}},e.prototype.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},e.prototype.setOverwrite=function(e){this.session.setOverwrite(e)},e.prototype.getOverwrite=function(){return this.session.getOverwrite()},e.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},e.prototype.setScrollSpeed=function(e){this.setOption(`scrollSpeed`,e)},e.prototype.getScrollSpeed=function(){return this.getOption(`scrollSpeed`)},e.prototype.setDragDelay=function(e){this.setOption(`dragDelay`,e)},e.prototype.getDragDelay=function(){return this.getOption(`dragDelay`)},e.prototype.setSelectionStyle=function(e){this.setOption(`selectionStyle`,e)},e.prototype.getSelectionStyle=function(){return this.getOption(`selectionStyle`)},e.prototype.setHighlightActiveLine=function(e){this.setOption(`highlightActiveLine`,e)},e.prototype.getHighlightActiveLine=function(){return this.getOption(`highlightActiveLine`)},e.prototype.setHighlightGutterLine=function(e){this.setOption(`highlightGutterLine`,e)},e.prototype.getHighlightGutterLine=function(){return this.getOption(`highlightGutterLine`)},e.prototype.setHighlightSelectedWord=function(e){this.setOption(`highlightSelectedWord`,e)},e.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},e.prototype.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},e.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},e.prototype.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},e.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},e.prototype.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},e.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},e.prototype.setHighlightIndentGuides=function(e){this.renderer.setHighlightIndentGuides(e)},e.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},e.prototype.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},e.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},e.prototype.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},e.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},e.prototype.setReadOnly=function(e){this.setOption(`readOnly`,e)},e.prototype.getReadOnly=function(){return this.getOption(`readOnly`)},e.prototype.setBehavioursEnabled=function(e){this.setOption(`behavioursEnabled`,e)},e.prototype.getBehavioursEnabled=function(){return this.getOption(`behavioursEnabled`)},e.prototype.setWrapBehavioursEnabled=function(e){this.setOption(`wrapBehavioursEnabled`,e)},e.prototype.getWrapBehavioursEnabled=function(){return this.getOption(`wrapBehavioursEnabled`)},e.prototype.setShowFoldWidgets=function(e){this.setOption(`showFoldWidgets`,e)},e.prototype.getShowFoldWidgets=function(){return this.getOption(`showFoldWidgets`)},e.prototype.setFadeFoldWidgets=function(e){this.setOption(`fadeFoldWidgets`,e)},e.prototype.getFadeFoldWidgets=function(){return this.getOption(`fadeFoldWidgets`)},e.prototype.remove=function(e){this.selection.isEmpty()&&(e==`left`?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,`deletion`,this,n,t);if(t.end.column===0){var a=n.getTextRange(t);if(a[a.length-1]==` `){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},e.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},e.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert(` `),this.moveCursorToPosition(e)},e.prototype.setGhostText=function(e,t){this.renderer.setGhostText(e,t)},e.prototype.removeGhostText=function(){this.renderer.removeGhostText()},e.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(t!==0){var n=this.session.getLine(e.row),r,i;tt.toLowerCase()?1:0});for(var i=new m(0,0,0,0),r=e.first;r<=e.last;r++){var a=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=a.length,t.replace(i,n[r-e.first])}},e.prototype.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},e.prototype.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},e.prototype.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var r=this.session.getLine(e);n.lastIndex=t)return{value:i[0],start:i.index,end:i.index+i[0].length}}return null},e.prototype.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new m(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var a=this.getNumberAt(t,n);if(a){var o=a.value.indexOf(`.`)>=0?a.start+a.value.indexOf(`.`)+1:a.end,s=a.start+a.value.length-o,c=parseFloat(a.value);c*=10**s,o!==a.end&&n=s&&a<=c&&(n=t,l.selection.clearSelection(),l.moveCursorTo(e,s+r),l.selection.selectTo(e,c+r)),s=c});for(var u=this.$toggleWordPairs,d,f=0;f=s&&o<=c&&f.match(/((?:https?|ftp):\/\/[\S]+)/)){l=f.replace(/[\s:.,'";}\]]+$/,``);break}s=c}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}return l},e.prototype.openLink=function(){var e=this.selection.getCursor(),t=this.findLinkAt(e.row,e.column);return t&&window.open(t,`_blank`),t!=null},e.prototype.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last),this.clearSelection()},e.prototype.duplicateSelection=function(){var e=this.selection,t=this.session,n=e.getRange(),r=e.isBackwards();if(n.isEmpty()){var i=n.start.row;t.duplicateLines(i,i)}else{var a=r?n.start:n.end,o=t.insert(a,t.getTextRange(n));n.start=a,n.end=o,e.setSelectionRange(n,r)}},e.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},e.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},e.prototype.moveText=function(e,t,n){return this.session.moveText(e,t,n)},e.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},e.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},e.prototype.$moveLines=function(e,t){var n,r,i=this.selection;if(!i.inMultiSelectMode||this.inVirtualSelectionMode){var a=i.toOrientedRange();n=this.$getSelectedRows(a),r=this.session.$moveLines(n.first,n.last,t?0:e),t&&e==-1&&(r=0),a.moveBy(r,0),i.fromOrientedRange(a)}else{var o=i.rangeList.ranges;i.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var s=0,c=0,l=o.length,u=0;up+1)break;p=m.last}for(u--,s=this.session.$moveLines(f,p,t?0:e),t&&e==-1&&(d=u+1);d<=u;)o[d].moveBy(s,0),d++;t||(s=0),c+=s}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},e.prototype.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},e.prototype.onCompositionStart=function(e){this.renderer.showComposition(e)},e.prototype.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},e.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},e.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},e.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},e.prototype.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},e.prototype.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},e.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},e.prototype.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);t===!0?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):t===!1&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var a=n.scrollTop;n.scrollBy(0,i*r.lineHeight),t!=null&&n.scrollCursorIntoView(null,.5),n.animateScrolling(a)},e.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},e.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},e.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},e.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},e.prototype.scrollPageDown=function(){this.$moveByPage(1)},e.prototype.scrollPageUp=function(){this.$moveByPage(-1)},e.prototype.scrollToRow=function(e){this.renderer.scrollToRow(e)},e.prototype.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},e.prototype.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},e.prototype.getCursorPosition=function(){return this.selection.getCursor()},e.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},e.prototype.getSelectionRange=function(){return this.selection.getRange()},e.prototype.selectAll=function(){this.selection.selectAll()},e.prototype.clearSelection=function(){this.selection.clearSelection()},e.prototype.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},e.prototype.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},e.prototype.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new y(this.session,n.row,n.column),i=r.getCurrentToken(),a=0;i&&i.type.indexOf(`tag-name`)!==-1&&(i=r.stepBackward());var o=i||r.stepForward();if(o){var s,c=!1,l={},u=n.column-o.start,d,f={")":`(`,"(":`(`,"]":`[`,"[":`[`,"{":`{`,"}":`{`};do{if(o.value.match(/[{}()\[\]]/g)){for(;u1?l[o.value]++:i.value===`=0;--a)this.$tryReplace(n[a],e)&&r++;return this.selection.setSelectionRange(i),r},e.prototype.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return t=this.$search.replace(n,t),t===null?null:(e.end=this.session.replace(e,t),e)},e.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},e.prototype.find=function(e,t,n){t||(t={}),typeof e==`string`||e instanceof RegExp?t.needle=e:typeof e==`object`&&i.mixin(t,e);var r=this.selection.getRange();t.needle??(e=this.session.getTextRange(r)||this.$search.$options.needle,e||(r=this.session.getWordRange(r.start.row,r.start.column),e=this.session.getTextRange(r)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:r});var a=this.$search.find(this.session);if(t.preventScroll)return a;if(a)return this.revealRange(a,n),a;t.backwards?r.start=r.end:r.end=r.start,this.selection.setRange(r)},e.prototype.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},e.prototype.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},e.prototype.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),t!==!1&&this.renderer.animateScrolling(n)},e.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},e.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},e.prototype.destroy=function(){this.destroyed=!0,this.$toDestroy&&(this.$toDestroy.forEach(function(e){e.destroy()}),this.$toDestroy=[]),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal(`destroy`,this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},e.prototype.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement(`div`));var i=this.$scrollAnchor;i.style.cssText=`position:absolute`,this.container.insertBefore(i,this.container.firstChild);var a=this.on(`changeSelection`,function(){r=!0}),o=this.renderer.on(`beforeRender`,function(){r&&(t=n.renderer.container.getBoundingClientRect())}),s=this.renderer.on(`afterRender`,function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,a=e.$cursorLayer.$pixelPos,o=e.layerConfig,s=a.top-o.offset;r=a.top>=0&&s+t.top<0?!0:a.topwindow.innerHeight?!1:null,r!=null&&(i.style.top=s+`px`,i.style.left=a.left+`px`,i.style.height=o.lineHeight+`px`,i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off(`changeSelection`,a),this.renderer.off(`afterRender`,s),this.renderer.off(`beforeRender`,o))}}},e.prototype.$resetCursorStyle=function(){var e=this.$cursorStyle||`ace`,t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&e!=`wide`,a.setCssClass(t.element,`ace_slim-cursors`,/slim/.test(e)))},e.prototype.prompt=function(e,t,n){var r=this;v.loadModule(`ace/ext/prompt`,function(i){i.prompt(r,e,t,n)})},Object.defineProperty(e.prototype,`hoverTooltip`,{get:function(){return this.$hoverTooltip||(this.$hoverTooltip=new T(this.container))},set:function(e){this.$hoverTooltip&&this.$hoverTooltip.destroy(),this.$hoverTooltip=e},enumerable:!1,configurable:!0}),e}();E.$uid=0,E.prototype.curOp=null,E.prototype.prevOp={},E.prototype.$mergeableCommands=[`backspace`,`del`,`insertstring`],E.prototype.$toggleWordPairs=[[`first`,`last`],[`true`,`false`],[`yes`,`no`],[`width`,`height`],[`top`,`bottom`],[`right`,`left`],[`on`,`off`],[`x`,`y`],[`get`,`set`],[`max`,`min`],[`horizontal`,`vertical`],[`show`,`hide`],[`add`,`remove`],[`up`,`down`],[`before`,`after`],[`even`,`odd`],[`in`,`out`],[`inside`,`outside`],[`next`,`previous`],[`increase`,`decrease`],[`attach`,`detach`],[`&&`,`||`],[`==`,`!=`]],i.implement(E.prototype,h),v.defineOptions(E.prototype,`editor`,{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal(`changeSelectionStyle`,{data:e})},initialValue:`line`},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){var t=this;if(this.textInput.setReadOnly(e),!this.destroyed){this.$resetCursorStyle(),this.$readOnlyCallback||(this.$readOnlyCallback=function(e){var n=!1;if(e&&e.type==`keydown`){if(e&&e.key&&!e.ctrlKey&&!e.metaKey&&(e.key==` `&&e.preventDefault(),n=e.key.length==1),!n)return}else e&&e.type!==`exec`&&(n=!0);if(n){var r=a.createElement(`div`);r.textContent=x(`editor.tooltip.disable-editing`,`Editing is disabled`),t.hoverTooltip.isOpen||t.hoverTooltip.showForRange(t,t.getSelectionRange(),r)}else t.hoverTooltip&&t.hoverTooltip.isOpen&&t.hoverTooltip.hide()});var n=this.textInput.getElement();e?(w.addListener(n,`keydown`,this.$readOnlyCallback,this),this.commands.on(`exec`,this.$readOnlyCallback),this.commands.on(`commandUnavailable`,this.$readOnlyCallback)):(w.removeListener(n,`keydown`,this.$readOnlyCallback),this.commands.off(`exec`,this.$readOnlyCallback),this.commands.off(`commandUnavailable`,this.$readOnlyCallback))}},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:[`ace`,`slim`,`smooth`,`wide`],initialValue:`ace`},mergeUndoDeltas:{values:[!1,!0,`always`],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?D.attach(this):D.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?D.attach(this):D.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(e&&this.renderer.placeholderNode)this.renderer.off(`afterRender`,this.$updatePlaceholder),a.removeCssClass(this.container,`ace_hasPlaceholder`),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!e&&!this.renderer.placeholderNode){this.renderer.on(`afterRender`,this.$updatePlaceholder),a.addCssClass(this.container,`ace_hasPlaceholder`);var t=a.createElement(`div`);t.className=`ace_placeholder`,t.textContent=this.$placeholder||``,this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}else !e&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||``)}.bind(this),this.on(`input`,this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(e){var t={name:`blurTextInput`,description:`Set focus to the editor content div to allow tabbing through the page`,bindKey:`Esc`,exec:function(e){e.blur(),e.renderer.scroller.focus()},readOnly:!0},n=function(e){if(e.target==this.renderer.scroller&&e.keyCode===C.enter){e.preventDefault();var t=this.getCursorPosition().row;this.isRowVisible(t)||this.scrollToLine(t,!0,!0),this.focus()}},r;e?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName=`ace_keyboard-focus`,this.textInput.getElement().setAttribute(`tabindex`,-1),this.textInput.setNumberOfExtraLines(s.isWin?3:0),this.renderer.scroller.setAttribute(`tabindex`,0),this.renderer.scroller.setAttribute(`role`,`group`),this.renderer.scroller.setAttribute(`aria-roledescription`,x(`editor.scroller.aria-roledescription`,`editor`)),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute(`aria-label`,x(`editor.scroller.aria-label`,`Editor content, press Enter to start editing, press Escape to exit`)),this.renderer.scroller.addEventListener(`keyup`,n.bind(this)),this.commands.addCommand(t),this.renderer.$gutter.setAttribute(`tabindex`,0),this.renderer.$gutter.setAttribute(`aria-hidden`,!1),this.renderer.$gutter.setAttribute(`role`,`group`),this.renderer.$gutter.setAttribute(`aria-roledescription`,x(`editor.gutter.aria-roledescription`,`editor gutter`)),this.renderer.$gutter.setAttribute(`aria-label`,x(`editor.gutter.aria-label`,`Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit`)),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute(`aria-hidden`,!0),r||(r=new b(this)),r.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute(`tabindex`,0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute(`tabindex`,-1),this.renderer.scroller.removeAttribute(`role`),this.renderer.scroller.removeAttribute(`aria-roledescription`),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute(`aria-label`),this.renderer.scroller.removeEventListener(`keyup`,n.bind(this)),this.commands.removeCommand(t),this.renderer.content.removeAttribute(`aria-hidden`),this.renderer.$gutter.setAttribute(`tabindex`,-1),this.renderer.$gutter.setAttribute(`aria-hidden`,!0),this.renderer.$gutter.removeAttribute(`role`),this.renderer.$gutter.removeAttribute(`aria-roledescription`),this.renderer.$gutter.removeAttribute(`aria-label`),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),r&&r.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(e){this.$textInputAriaLabel=e},initialValue:``},enableMobileMenu:{set:function(e){this.$enableMobileMenu=e},initialValue:!0},customScrollbar:`renderer`,hScrollBarAlwaysVisible:`renderer`,vScrollBarAlwaysVisible:`renderer`,highlightGutterLine:`renderer`,animatedScroll:`renderer`,showInvisibles:`renderer`,showPrintMargin:`renderer`,printMarginColumn:`renderer`,printMargin:`renderer`,fadeFoldWidgets:`renderer`,showFoldWidgets:`renderer`,displayIndentGuides:`renderer`,highlightIndentGuides:`renderer`,showGutter:`renderer`,fontSize:`renderer`,fontFamily:`renderer`,maxLines:`renderer`,minLines:`renderer`,scrollPastEnd:`renderer`,fixedWidthGutter:`renderer`,theme:`renderer`,hasCssTransforms:`renderer`,maxPixelHeight:`renderer`,useTextareaForIME:`renderer`,useResizeObserver:`renderer`,useSvgGutterIcons:`renderer`,showFoldedAnnotations:`renderer`,scrollSpeed:`$mouseHandler`,dragDelay:`$mouseHandler`,dragEnabled:`$mouseHandler`,focusTimeout:`$mouseHandler`,firstLineNumber:`session`,overwrite:`session`,newLineMode:`session`,useWorker:`session`,useSoftTabs:`session`,navigateWithinSoftTabs:`session`,tabSize:`session`,wrap:`session`,indentedSoftWrap:`session`,foldStyle:`session`,mode:`session`});var D={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?`·`:``))+``},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on(`changeSelection`,this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off(`changeSelection`,this.update),this.update(null,e)}};t.Editor=E}),ace.define(`ace/layer/lines`,[`require`,`exports`,`module`,`ace/lib/dom`],function(e,t,n){var r=e(`../lib/dom`);t.Lines=function(){function e(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=this.canvasHeight*2+`px`,this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return e.prototype.moveContainer=function(e){r.translate(this.element,0,-(e.firstRowScreen*e.lineHeight%this.canvasHeight)-e.offset*this.$offsetCoefficient)},e.prototype.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},e.prototype.computeLineTop=function(e,t,n){var r=t.firstRowScreen*t.lineHeight,i=Math.floor(r/this.canvasHeight);return n.documentToScreenRow(e,0)*t.lineHeight-i*this.canvasHeight},e.prototype.computeLineHeight=function(e,t,n){return t.lineHeight*n.getRowLineCount(e)},e.prototype.getLength=function(){return this.cells.length},e.prototype.get=function(e){return this.cells[e]},e.prototype.shift=function(){this.$cacheCell(this.cells.shift())},e.prototype.pop=function(){this.$cacheCell(this.cells.pop())},e.prototype.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);for(var t=r.createFragment(this.element),n=0;na&&(c=i.end.row+1,i=t.getNextFoldLine(c,i),a=i?i.start.row:1/0),c>r){for(;this.$lines.getLength()>s+1;)this.$lines.pop();break}o=this.$lines.get(++s),o?o.row=c:(o=this.$lines.createCell(c,e,this.session,u),this.$lines.push(o)),this.$renderCell(o,e,i,c),c++}this._signal(`afterRender`),this.$updateGutterWidth(e),this.$showCursorMarker&&this.$highlightGutterLine&&this.$updateCursorMarker()},e.prototype.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:``;(this.$fixedWidth||t.$useWrapMode)&&(i=t.getLength()+r-1);var a=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();a+=o.left+o.right,a!==this.gutterWidth&&!isNaN(a)&&(this.gutterWidth=a,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+`px`,this._signal(`changeGutterWidth`,a))},e.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},e.prototype.updateLineHighlight=function(){if(this.$showCursorMarker&&this.$updateCursorMarker(),this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!(this.$cursorCell&&this.$cursorCell.row==e)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace(`ace_gutter-active-line `,``));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(n>0&&i&&i.start.row==t[n-1].row)r=t[n-1];else break}r.element.className=`ace_gutter-active-line `+r.element.className,this.$cursorCell=r;break}}}}},e.prototype.$updateCursorMarker=function(){if(this.session){var e=this.session;this.$highlightElement||(this.$highlightElement=r.createElement(`div`),this.$highlightElement.className=`ace_gutter-cursor`,this.$highlightElement.style.pointerEvents=`none`,this.element.appendChild(this.$highlightElement));var t=e.selection.cursor,n=this.config,i=this.$lines,a=n.firstRowScreen*n.lineHeight,o=Math.floor(a/i.canvasHeight),s=e.documentToScreenRow(t)*n.lineHeight-o*i.canvasHeight;r.setStyle(this.$highlightElement.style,`height`,n.lineHeight+`px`),r.setStyle(this.$highlightElement.style,`top`,s+`px`)}},e.prototype.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;if(this.oldLastRow=n,!t||r0;i--)this.$lines.shift();if(r>n)for(var i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal(`afterRender`),this.$updateGutterWidth(e)},e.prototype.$renderLines=function(e,t,n){for(var r=[],i=t,a=this.session.getNextFoldLine(i),o=a?a.start.row:1/0;i>o&&(i=a.end.row+1,a=this.session.getNextFoldLine(i,a),o=a?a.start.row:1/0),!(i>n);){var s=this.$lines.createCell(i,e,this.session,u);this.$renderCell(s,e,a,i),r.push(s),i++}return r},e.prototype.$renderCell=function(e,t,n,i){var a=e.element,o=this.session,s=a.childNodes[0],l=a.childNodes[1],u=a.childNodes[2],d=a.childNodes[3],f=u.firstChild,p=o.$firstLineNumber,m=o.$breakpoints,h=o.$decorations,g=o.gutterRenderer||this.$renderer,_=this.$showFoldWidgets&&o.foldWidgets,v=n?n.start.row:Number.MAX_VALUE,y=t.lineHeight+`px`,b=this.$useSvgGutterIcons?`ace_gutter-cell_svg-icons `:`ace_gutter-cell `,x=this.$useSvgGutterIcons?`ace_icon_svg`:`ace_icon`,S=(g?g.getText(o,i):i+p).toString();if(this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=v&&this.$cursorRow<=n.end.row)&&(b+=`ace_gutter-active-line `,this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace(`ace_gutter-active-line `,``)),this.$cursorCell=e)),m[i]&&(b+=m[i]),h[i]&&(b+=h[i]),this.$annotations[i]&&i!==v&&(b+=this.$annotations[i].className),_){var C=_[i];C??(C=_[i]=o.getFoldWidget(i))}if(C){var w=`ace_fold-widget ace_`+C,T=C==`start`&&i==v&&it[r].row)){for(;n<=r;){var i=Math.floor((n+r)/2),a=t[i];if(a.row>e)r=i-1;else if(a.rown.right-t.right)return`foldWidgets`},e}();l.prototype.$fixedWidth=!1,l.prototype.$highlightGutterLine=!0,l.prototype.$renderer=void 0,l.prototype.$showLineNumbers=!0,l.prototype.$showFoldWidgets=!0,i.implement(l.prototype,o);function u(e){var t=document.createTextNode(``);e.appendChild(t);var n=r.createElement(`span`);e.appendChild(n);var i=r.createElement(`span`);e.appendChild(i);var a=r.createElement(`span`);return i.appendChild(a),e}t.Gutter=l}),ace.define(`ace/layer/marker`,[`require`,`exports`,`module`,`ace/range`,`ace/lib/dom`],function(e,t,n){var r=e(`../range`).Range,i=e(`../lib/dom`),a=function(){function e(e){this.element=i.createElement(`div`),this.element.className=`ace_layer ace_marker-layer`,e.appendChild(this.element)}return e.prototype.setPadding=function(e){this.$padding=e},e.prototype.setSession=function(e){this.session=e},e.prototype.setMarkers=function(e){this.markers=e},e.prototype.elt=function(e,t){var n=this.i!=-1&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement(`div`),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},e.prototype.update=function(e){if(e){this.config=e,this.i=0;var t;for(var n in this.markers){var r=this.markers[n];if(!r.range){r.update(t,this,this.session,e);continue}var i=r.range.clipRows(e.firstRow,e.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),r.renderer){var a=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,a,e)}else r.type==`fullLine`?this.drawFullLineMarker(t,i,r.clazz,e):r.type==`screenLine`?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?r.type==`text`?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+` ace_start ace_br15`,e)}if(this.i!=-1)for(;this.ip,u==l),i,u==l?0:1,a)},e.prototype.drawMultiLineMarker=function(e,t,n,r,i){var a=this.$padding,o=r.lineHeight,s=this.$getTop(t.start.row,r),c=a+t.start.column*r.characterWidth;if(i=i||``,this.session.$bidiHandler.isBidiRow(t.start.row)){var l=t.clone();l.end.row=l.start.row,l.end.column=this.session.getLine(l.start.row).length,this.drawBidiSingleLineMarker(e,l,n+` ace_br1 ace_start`,r,null,i)}else this.elt(n+` ace_br1 ace_start`,`height:`+o+`px;right:`+a+`px;top:`+s+`px;left:`+c+`px;`+(i||``));if(this.session.$bidiHandler.isBidiRow(t.end.row)){var l=t.clone();l.start.row=l.end.row,l.start.column=0,this.drawBidiSingleLineMarker(e,l,n+` ace_br12`,r,null,i)}else{s=this.$getTop(t.end.row,r);var u=t.end.column*r.characterWidth;this.elt(n+` ace_br12`,`height:`+o+`px;width:`+u+`px;top:`+s+`px;left:`+a+`px;`+(i||``))}if(o=(t.end.row-t.start.row-1)*r.lineHeight,!(o<=0)){s=this.$getTop(t.start.row+1,r);var d=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(d?` ace_br`+d:``),`height:`+o+`px;right:`+a+`px;top:`+s+`px;left:`+a+`px;`+(i||``))}},e.prototype.drawSingleLineMarker=function(e,t,n,r,i,a){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,a);var o=r.lineHeight,s=(t.end.column+(i||0)-t.start.column)*r.characterWidth,c=this.$getTop(t.start.row,r),l=this.$padding+t.start.column*r.characterWidth;this.elt(n,`height:`+o+`px;width:`+s+`px;top:`+c+`px;left:`+l+`px;`+(a||``))},e.prototype.drawBidiSingleLineMarker=function(e,t,n,r,i,a){var o=r.lineHeight,s=this.$getTop(t.start.row,r),c=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(n,`height:`+o+`px;width:`+(e.width+(i||0))+`px;top:`+s+`px;left:`+(c+e.left)+`px;`+(a||``))},this)},e.prototype.drawFullLineMarker=function(e,t,n,r,i){var a=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-a),this.elt(n,`height:`+o+`px;top:`+a+`px;left:0;right:0;`+(i||``))},e.prototype.drawScreenLineMarker=function(e,t,n,r,i){var a=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,`height:`+o+`px;top:`+a+`px;left:0;right:0;`+(i||``))},e}();a.prototype.$padding=0;function o(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}t.Marker=a}),ace.define(`ace/layer/text_util`,[`require`,`exports`,`module`],function(e,t,n){var r=new Set([`text`,`rparen`,`lparen`]);t.isTextToken=function(e){return r.has(e)}}),ace.define(`ace/layer/text`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/dom`,`ace/lib/lang`,`ace/layer/lines`,`ace/lib/event_emitter`,`ace/config`,`ace/layer/text_util`],function(e,t,n){var r=e(`../lib/oop`),i=e(`../lib/dom`),a=e(`../lib/lang`),o=e(`./lines`).Lines,s=e(`../lib/event_emitter`).EventEmitter,c=e(`../config`).nls,l=e(`./text_util`).isTextToken,u=function(){function e(e){this.dom=i,this.element=this.dom.createElement(`div`),this.element.className=`ace_layer ace_text-layer`,e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)}return e.prototype.$updateEolChar=function(){var e=this.session.doc,t=e.getNewLineCharacter()==` `&&e.getNewLineMode()!=`windows`?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},e.prototype.setPadding=function(e){this.$padding=e,this.element.style.margin=`0 `+e+`px`},e.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},e.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},e.prototype.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on(`changeCharacterSize`,function(e){this._signal(`changeCharacterSize`,e)}.bind(this)),this.$pollSizeChanges()},e.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},e.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},e.prototype.setSession=function(e){this.session=e,e&&this.$computeTabString()},e.prototype.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,typeof e==`string`?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},e.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},e.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides===e?!1:(this.$highlightIndentGuides=e,e)},e.prototype.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;nu&&(s=c.end.row+1,c=this.session.getNextFoldLine(s,c),u=c?c.start.row:1/0),!(s>i);){var d=a[o++];if(d){this.dom.removeChildren(d),this.$renderLine(d,s,s==u?c:!1),l&&(d.style.top=this.$lines.computeLineTop(s,e,this.session)+`px`);var f=e.lineHeight*this.session.getRowLength(s)+`px`;d.style.height!=f&&(l=!0,d.style.height=f)}s++}if(l)for(;o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(var i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},e.prototype.$renderLinesFragment=function(e,t,n){for(var r=[],a=t,o=this.session.getNextFoldLine(a),s=o?o.start.row:1/0;a>s&&(a=o.end.row+1,o=this.session.getNextFoldLine(a,o),s=o?o.start.row:1/0),!(a>n);){var c=this.$lines.createCell(a,e,this.session),l=c.element;this.dom.removeChildren(l),i.setStyle(l.style,`height`,this.$lines.computeLineHeight(a,e,this.session)+`px`),i.setStyle(l.style,`top`,this.$lines.computeLineTop(a,e,this.session)+`px`),this.$renderLine(l,a,a==s?o:!1),this.$useLineGroups()?l.className=`ace_line_group`:l.className=`ace_line`,r.push(c),a++}return r},e.prototype.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,r=this.$lines;r.getLength();)r.pop();r.push(this.$renderLinesFragment(e,t,n))},e.prototype.$renderToken=function(e,t,n,r){for(var i=this,o=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069\u2060\u2061\u2062\u2063\u2064\u206A\u206B\u206B\u206C\u206D\u206E\u206F]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,s=this.dom.createFragment(this.element),u,d=0;u=o.exec(r);){var f=u[1],p=u[2],m=u[3],h=u[4],g=u[5];if(!(!i.showSpaces&&p)){var _=d==u.index?``:r.slice(d,u.index);if(d=u.index+u[0].length,_&&s.appendChild(this.dom.createTextNode(_,this.element)),f){var v=i.session.getScreenTabSize(t+u.index),y=i.$tabStrings[v].cloneNode(!0);y.charCount=1,s.appendChild(y),t+=v-1}else if(p)if(i.showSpaces){var b=this.dom.createElement(`span`);b.className=`ace_invisible ace_invisible_space`,b.textContent=a.stringRepeat(i.SPACE_CHAR,p.length),s.appendChild(b)}else s.appendChild(this.dom.createTextNode(p,this.element));else if(m){var b=this.dom.createElement(`span`);b.className=`ace_invisible ace_invisible_space ace_invalid`,b.textContent=a.stringRepeat(i.SPACE_CHAR,m.length),s.appendChild(b)}else if(h){t+=1;var b=this.dom.createElement(`span`);b.style.width=i.config.characterWidth*2+`px`,b.className=i.showSpaces?`ace_cjk ace_invisible ace_invisible_space`:`ace_cjk`,b.textContent=i.showSpaces?i.SPACE_CHAR:h,s.appendChild(b)}else if(g){t+=1;var b=this.dom.createElement(`span`);b.style.width=i.config.characterWidth*2+`px`,b.className=`ace_cjk`,b.textContent=g,s.appendChild(b)}}}if(s.appendChild(this.dom.createTextNode(d?r.slice(d):r,this.element)),l(n.type))e.appendChild(s);else{var x=`ace_`+n.type.replace(/\./g,` ace_`),b=this.dom.createElement(`span`);n.type==`fold`&&(b.style.width=n.value.length*this.config.characterWidth+`px`,b.setAttribute(`title`,c(`inline-fold.closed.title`,`Unfold code`))),b.className=x,b.appendChild(s),e.appendChild(b)}return t+r.length},e.prototype.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(t[0]==` `){r-=r%this.tabSize;for(var i=r/this.tabSize,a=0;ar[i].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&e[t.row]!==``&&t.column===e[t.row].length){this.$highlightIndentGuideMarker.dir=1;for(var i=t.row+1;i0)n=e.element.childNodes[0];else return;var r=n.childNodes;if(r){var i=r[t-1];i&&i.classList&&i.classList.contains(`ace_indent-guide`)&&i.classList.add(`ace_indent-guide-active`)}}},e.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var e=this.$lines.cells;this.$clearActiveIndentGuide();var t=this.$highlightIndentGuideMarker.indentLevel;if(t!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var n=0;n=this.$highlightIndentGuideMarker.start+1){if(r.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(r,t)}}else for(var n=e.length-1;n>=0;n--){var r=e[n];if(this.$highlightIndentGuideMarker.end&&r.row=o;){s=this.$renderToken(c,s,u,d.substring(0,o-r)),d=d.substring(o-r),r=o,c=this.$createLineElement(),e.appendChild(c);var f=this.dom.createTextNode(a.stringRepeat(`\xA0`,n.indent),this.element);f.charCount=0,c.appendChild(f),i++,s=0,o=n[i]||Number.MAX_VALUE}d.length!=0&&(r+=d.length,s=this.$renderToken(c,s,u,d))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(c,s,null,``,!0)},e.prototype.$renderSimpleLine=function(e,t){for(var n=0,r=0;rthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,i,a);n=this.$renderToken(e,n,i,a)}}},e.prototype.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var a=this.dom.createElement(`span`);a.className=`ace_inline_button ace_keyword ace_toggle_wrap`,a.textContent=i?``:``,e.appendChild(a)},e.prototype.$renderLine=function(e,t,n){if(!n&&n!=0&&(n=this.session.getFoldLine(t)),n)var r=this.$getFoldLineTokens(t,n);else var r=this.session.getTokens(t);var i=e;if(r.length){var a=this.session.getRowSplitData(t);if(a&&a.length){this.$renderWrappedLine(e,r,a);var i=e.lastChild}else{var i=e;this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r)}}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showEOL&&i){n&&(t=n.end.row);var o=this.dom.createElement(`span`);o.className=`ace_invisible ace_invisible_eol`,o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},e.prototype.$getFoldLineTokens=function(e,t){var n=this.session,r=[];function i(e,t,n){for(var i=0,a=0;a+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),a=t+o.length,i+=1}for(;an?r.push({type:e[i].type,value:o.substring(0,n-a)}):r.push(e[i]),a+=o.length,i+=1}}var a=n.getTokens(e);return t.walk(function(e,t,o,s,c){e==null?(c&&(a=n.getTokens(t)),a.length&&i(a,s,o)):r.push({type:`fold`,value:e})},t.end.row,this.session.getLine(t.end.row).length),r},e.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},e}();u.prototype.EOF_CHAR=`¶`,u.prototype.EOL_CHAR_LF=`¬`,u.prototype.EOL_CHAR_CRLF=`¤`,u.prototype.EOL_CHAR=u.prototype.EOL_CHAR_LF,u.prototype.TAB_CHAR=`—`,u.prototype.SPACE_CHAR=`·`,u.prototype.$padding=0,u.prototype.MAX_LINE_LENGTH=1e4,u.prototype.showInvisibles=!1,u.prototype.showSpaces=!1,u.prototype.showTabs=!1,u.prototype.showEOL=!1,u.prototype.displayIndentGuides=!0,u.prototype.$highlightIndentGuides=!0,u.prototype.$tabStrings=[],u.prototype.destroy={},u.prototype.onChangeTabSize=u.prototype.$computeTabString,r.implement(u.prototype,s),t.Text=u}),ace.define(`ace/layer/cursor`,[`require`,`exports`,`module`,`ace/lib/dom`],function(e,t,n){var r=e(`../lib/dom`),i=function(){function e(e){this.element=r.createElement(`div`),this.element.className=`ace_layer ace_cursor-layer`,e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,`ace_hidden-cursors`),this.$updateCursors=this.$updateOpacity.bind(this)}return e.prototype.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)r.setStyle(t[n].style,`opacity`,e?``:`0`)},e.prototype.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+`ms`;this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&r.addCssClass(this.element,`ace_animate-blinking`)}.bind(this))},e.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,r.removeCssClass(this.element,`ace_animate-blinking`)},e.prototype.setPadding=function(e){this.$padding=e},e.prototype.setSession=function(e){this.session=e},e.prototype.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},e.prototype.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},e.prototype.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,`ace_smooth-blinking`,e),this.$updateCursors(!0),this.restartTimer())},e.prototype.addCursor=function(){var e=r.createElement(`div`);return e.className=`ace_cursor`,this.element.appendChild(e),this.cursors.push(e),e},e.prototype.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},e.prototype.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,`ace_hidden-cursors`),this.restartTimer()},e.prototype.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,`ace_hidden-cursors`),this.restartTimer()},e.prototype.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,r.removeCssClass(this.element,`ace_smooth-blinking`)),e(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&r.addCssClass(this.element,`ace_smooth-blinking`)}.bind(this))),r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}},e.prototype.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},e.prototype.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)){var s=this.cursors[i++]||this.addCursor(),c=s.style;this.drawCursor?this.drawCursor(s,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(c,`display`,`block`),r.translate(s,o.left,o.top),r.setStyle(c,`width`,Math.round(e.characterWidth)+`px`),r.setStyle(c,`height`,e.lineHeight+`px`)):r.setStyle(c,`display`,`none`)}}for(;this.cursors.length>i;)this.removeCursor();var l=this.session.getOverwrite();this.$setOverwrite(l),this.$pixelPos=o,this.restartTimer()},e.prototype.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,`ace_overwrite-cursors`):r.removeCssClass(this.element,`ace_overwrite-cursors`))},e.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},e}();i.prototype.$padding=0,i.prototype.drawCursor=null,t.Cursor=i}),ace.define(`ace/scrollbar`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/dom`,`ace/lib/event`,`ace/lib/event_emitter`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=e(`./lib/oop`),a=e(`./lib/dom`),o=e(`./lib/event`),s=e(`./lib/event_emitter`).EventEmitter,c=32768,l=function(){function e(e,t){this.element=a.createElement(`div`),this.element.className=`ace_scrollbar ace_scrollbar`+t,this.inner=a.createElement(`div`),this.inner.className=`ace_scrollbar-inner`,this.inner.textContent=`\xA0`,this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,o.addListener(this.element,`scroll`,this.onScroll.bind(this)),o.addListener(this.element,`mousedown`,o.preventDefault)}return e.prototype.setVisible=function(e){this.element.style.display=e?``:`none`,this.isVisible=e,this.coeff=1},e}();i.implement(l.prototype,s);var u=function(e){r(t,e);function t(t,n){var r=e.call(this,t,`-v`)||this;return r.scrollTop=0,r.scrollHeight=0,n.$scrollbarWidth=r.width=a.scrollbarWidth(t.ownerDocument),r.inner.style.width=r.element.style.width=(r.width||15)+5+`px`,r.$minWidth=0,r}return t.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit(`scroll`,{data:this.scrollTop})}this.skipEvent=!1},t.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},t.prototype.setHeight=function(e){this.element.style.height=e+`px`},t.prototype.setScrollHeight=function(e){this.scrollHeight=e,e>c?(this.coeff=c/e,e=c):this.coeff!=1&&(this.coeff=1),this.inner.style.height=e+`px`},t.prototype.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)},t}(l);u.prototype.setInnerHeight=u.prototype.setScrollHeight;var d=function(e){r(t,e);function t(t,n){var r=e.call(this,t,`-h`)||this;return r.scrollLeft=0,r.height=n.$scrollbarWidth,r.inner.style.height=r.element.style.height=(r.height||15)+5+`px`,r}return t.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit(`scroll`,{data:this.scrollLeft})),this.skipEvent=!1},t.prototype.getHeight=function(){return this.isVisible?this.height:0},t.prototype.setWidth=function(e){this.element.style.width=e+`px`},t.prototype.setInnerWidth=function(e){this.inner.style.width=e+`px`},t.prototype.setScrollWidth=function(e){this.inner.style.width=e+`px`},t.prototype.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)},t}(l);t.ScrollBar=u,t.ScrollBarV=u,t.ScrollBarH=d,t.VScrollBar=u,t.HScrollBar=d}),ace.define(`ace/scrollbar_custom`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/dom`,`ace/lib/event`,`ace/lib/event_emitter`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=e(`./lib/oop`),a=e(`./lib/dom`),o=e(`./lib/event`),s=e(`./lib/event_emitter`).EventEmitter;a.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{ position: absolute; background: rgba(128, 128, 128, 0.6); -moz-box-sizing: border-box; box-sizing: border-box; border: 1px solid #bbb; border-radius: 2px; z-index: 8; } .ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h { position: absolute; z-index: 6; background: none; overflow: hidden!important; } .ace_editor>.ace_sb-v { z-index: 6; right: 0; top: 0; width: 12px; } .ace_editor>.ace_sb-v div { z-index: 8; right: 0; width: 100%; } .ace_editor>.ace_sb-h { bottom: 0; left: 0; height: 12px; } .ace_editor>.ace_sb-h div { bottom: 0; height: 100%; } .ace_editor>.ace_sb_grabbed { z-index: 8; background: #000; }`,`ace_scrollbar.css`,!1);var c=function(){function e(e,t){this.element=a.createElement(`div`),this.element.className=`ace_sb`+t,this.inner=a.createElement(`div`),this.inner.className=``,this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,o.addMultiMouseDownListener(this.element,[500,300,300],this,`onMouseDown`)}return e.prototype.setVisible=function(e){this.element.style.display=e?``:`none`,this.isVisible=e,this.coeff=1},e}();i.implement(c.prototype,s);var l=function(e){r(t,e);function t(t,n){var r=e.call(this,t,`-v`)||this;return r.scrollTop=0,r.scrollHeight=0,r.parent=t,r.width=r.VScrollWidth,r.renderer=n,r.inner.style.width=r.element.style.width=(r.width||15)+`px`,r.$minWidth=0,r}return t.prototype.onMouseDown=function(e,t){if(e===`mousedown`&&!(o.getButton(t)!==0||t.detail===2)){if(t.target===this.inner){var n=this,r=t.clientY,i=function(e){r=e.clientY},a=function(){clearInterval(u)},s=t.clientY,c=this.thumbTop,l=function(){if(r!==void 0){var e=n.scrollTopFromThumbTop(c+r-s);e!==n.scrollTop&&n._emit(`scroll`,{data:e})}};o.capture(this.inner,i,a);var u=setInterval(l,20);return o.preventDefault(t)}var d=t.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit(`scroll`,{data:this.scrollTopFromThumbTop(d)}),o.preventDefault(t)}},t.prototype.getHeight=function(){return this.height},t.prototype.scrollTopFromThumbTop=function(e){var t=e*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return t>>=0,t<0?t=0:t>this.pageHeight-this.viewHeight&&(t=this.pageHeight-this.viewHeight),t},t.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},t.prototype.setHeight=function(e){this.height=Math.max(0,e),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},t.prototype.setScrollHeight=function(e,t){this.pageHeight===e&&!t||(this.pageHeight=e,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+`px`,this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit(`scroll`,{data:this.scrollTop})))},t.prototype.setScrollTop=function(e){this.scrollTop=e,e<0&&(e=0),this.thumbTop=e*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+`px`},t}(c);l.prototype.setInnerHeight=l.prototype.setScrollHeight;var u=function(e){r(t,e);function t(t,n){var r=e.call(this,t,`-h`)||this;return r.scrollLeft=0,r.scrollWidth=0,r.height=r.HScrollHeight,r.inner.style.height=r.element.style.height=(r.height||12)+`px`,r.renderer=n,r}return t.prototype.onMouseDown=function(e,t){if(e===`mousedown`&&!(o.getButton(t)!==0||t.detail===2)){if(t.target===this.inner){var n=this,r=t.clientX,i=function(e){r=e.clientX},a=function(){clearInterval(u)},s=t.clientX,c=this.thumbLeft,l=function(){if(r!==void 0){var e=n.scrollLeftFromThumbLeft(c+r-s);e!==n.scrollLeft&&n._emit(`scroll`,{data:e})}};o.capture(this.inner,i,a);var u=setInterval(l,20);return o.preventDefault(t)}var d=t.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit(`scroll`,{data:this.scrollLeftFromThumbLeft(d)}),o.preventDefault(t)}},t.prototype.getHeight=function(){return this.isVisible?this.height:0},t.prototype.scrollLeftFromThumbLeft=function(e){var t=e*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return t>>=0,t<0?t=0:t>this.pageWidth-this.viewWidth&&(t=this.pageWidth-this.viewWidth),t},t.prototype.setWidth=function(e){this.width=Math.max(0,e),this.element.style.width=this.width+`px`,this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},t.prototype.setScrollWidth=function(e,t){this.pageWidth===e&&!t||(this.pageWidth=e,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+`px`,this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit(`scroll`,{data:this.scrollLeft})))},t.prototype.setScrollLeft=function(e){this.scrollLeft=e,e<0&&(e=0),this.thumbLeft=e*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+`px`},t}(c);u.prototype.setInnerWidth=u.prototype.setScrollWidth,t.ScrollBar=l,t.ScrollBarV=l,t.ScrollBarH=u,t.VScrollBar=l,t.HScrollBar=u}),ace.define(`ace/renderloop`,[`require`,`exports`,`module`,`ace/lib/event`],function(e,t,n){var r=e(`./lib/event`);t.RenderLoop=function(){function e(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(r.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}}return e.prototype.schedule=function(e){this.changes|=e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},e.prototype.clear=function(e){var t=this.changes;return this.changes=0,t},e}()}),ace.define(`ace/layer/font_metrics`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/dom`,`ace/lib/lang`,`ace/lib/event`,`ace/lib/useragent`,`ace/lib/event_emitter`],function(e,t,n){var r=e(`../lib/oop`),i=e(`../lib/dom`),a=e(`../lib/lang`),o=e(`../lib/event`),s=e(`../lib/useragent`),c=e(`../lib/event_emitter`).EventEmitter,l=512,u=typeof ResizeObserver==`function`,d=200,f=function(){function e(e){this.el=i.createElement(`div`),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement(`div`),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement(`div`),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.textContent=a.stringRepeat(`X`,l),this.$characterSize={width:0,height:0},u?this.$addObserver():this.checkForSizeChanges()}return e.prototype.$setMeasureNodeStyles=function(e,t){e.width=e.height=`auto`,e.left=e.top=`0px`,e.visibility=`hidden`,e.position=`absolute`,e.whiteSpace=`pre`,s.isIE<8?e[`font-family`]=`inherit`:e.font=`inherit`,e.overflow=t?`hidden`:`visible`},e.prototype.checkForSizeChanges=function(e){if(e===void 0&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight=`bold`;var t=this.$measureSizes();this.$measureNode.style.fontWeight=``,this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit(`changeCharacterSize`,{data:e})}},e.prototype.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){e.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},e.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},e.prototype.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},e.prototype.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/l};return t.width===0||t.height===0?null:t},e.prototype.$measureCharWidth=function(e){return this.$main.textContent=a.stringRepeat(e,l),this.$main.getBoundingClientRect().width/l},e.prototype.getCharacterWidth=function(e){var t=this.charSizes[e];return t===void 0&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},e.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.$getZoom=function(e){return!e||!e.parentElement?1:(Number(window.getComputedStyle(e).zoom)||1)*this.$getZoom(e.parentElement)},e.prototype.$initTransformMeasureNodes=function(){var e=function(e,t){return[`div`,{style:`position: absolute;top:`+e+`px;left:`+t+`px;`}]};this.els=i.buildDom([e(0,0),e(d,0),e(0,d),e(d,d)],this.el)},e.prototype.transformCoordinates=function(e,t){e&&(e=a(1/this.$getZoom(this.el),e));function n(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function i(e,t){return[e[0]+t[0],e[1]+t[1]]}function a(e,t){return[e*t[0],e*t[1]]}this.els||this.$initTransformMeasureNodes();function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}var s=o(this.els[0]),c=o(this.els[1]),l=o(this.els[2]),u=o(this.els[3]),f=n(r(u,c),r(u,l),r(i(c,l),i(u,s))),p=a(1+f[0],r(c,s)),m=a(1+f[1],r(l,s));if(t){var h=t,g=f[0]*h[0]/d+f[1]*h[1]/d+1,_=i(a(h[0],p),a(h[1],m));return i(a(1/g/d,_),s)}var v=r(e,s);return a(d,n(r(p,a(f[0],v)),r(m,a(f[1],v)),v))},e}();f.prototype.$characterSize={width:0,height:0},r.implement(f.prototype,c),t.FontMetrics=f}),ace.define(`ace/css/editor-css`,[`require`,`exports`,`module`],function(e,t,n){n.exports=` .ace_br1 {border-top-left-radius : 3px;} .ace_br2 {border-top-right-radius : 3px;} .ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;} .ace_br4 {border-bottom-right-radius: 3px;} .ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;} .ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;} .ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;} .ace_br8 {border-bottom-left-radius : 3px;} .ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;} .ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;} .ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_editor { position: relative; overflow: hidden; padding: 0; font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace; direction: ltr; text-align: left; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); forced-color-adjust: none; } .ace_scroller { position: absolute; overflow: hidden; top: 0; bottom: 0; background-color: inherit; -ms-user-select: none; -moz-user-select: none; -webkit-user-select: none; user-select: none; cursor: text; } .ace_content { position: absolute; box-sizing: border-box; min-width: 100%; contain: style size layout; font-variant-ligatures: no-common-ligatures; } .ace_invisible { font-variant-ligatures: none; } .ace_keyboard-focus:focus { box-shadow: inset 0 0 0 2px #5E9ED6; outline: none; } .ace_dragging .ace_scroller:before{ position: absolute; top: 0; left: 0; right: 0; bottom: 0; content: ''; background: rgba(250, 250, 250, 0.01); z-index: 1000; } .ace_dragging.ace_dark .ace_scroller:before{ background: rgba(0, 0, 0, 0.01); } .ace_gutter { position: absolute; overflow : hidden; width: auto; top: 0; bottom: 0; left: 0; cursor: default; z-index: 4; -ms-user-select: none; -moz-user-select: none; -webkit-user-select: none; user-select: none; contain: style size layout; } .ace_gutter-active-line { position: absolute; left: 0; right: 0; } .ace_scroller.ace_scroll-left:after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset; pointer-events: none; } .ace_gutter-cell, .ace_gutter-cell_svg-icons { position: absolute; top: 0; left: 0; right: 0; padding-left: 19px; padding-right: 6px; background-repeat: no-repeat; } .ace_gutter-cell_svg-icons .ace_gutter_annotation { margin-left: -14px; float: left; } .ace_gutter-cell .ace_gutter_annotation { margin-left: -19px; float: left; } .ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold, .ace_gutter-cell.ace_security, .ace_icon.ace_security, .ace_icon.ace_security_fold { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg=="); background-repeat: no-repeat; background-position: 2px center; } .ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg=="); background-repeat: no-repeat; background-position: 2px center; } .ace_gutter-cell.ace_info, .ace_icon.ace_info, .ace_gutter-cell.ace_hint, .ace_icon.ace_hint { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII="); background-repeat: no-repeat; background-position: 2px center; } .ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info, .ace_dark .ace_gutter-cell.ace_hint, .ace_dark .ace_icon.ace_hint { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC"); } .ace_icon_svg.ace_error { -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+"); background-color: crimson; } .ace_icon_svg.ace_security { -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0iZGFya29yYW5nZSIgZmlsbD0ibm9uZSIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iPgogICAgICAgIDxwYXRoIGNsYXNzPSJzdHJva2UtbGluZWpvaW4tcm91bmQiIGQ9Ik04IDE0LjgzMDdDOCAxNC44MzA3IDIgMTIuOTA0NyAyIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOEM3Ljk4OTk5IDEuMzQ5MTggMTAuNjkgMy4yNjU0OCAxNCAzLjI2NTQ4VjguMDg5OTJDMTQgMTIuOTA0NyA4IDE0LjgzMDcgOCAxNC44MzA3WiIvPgogICAgICAgIDxwYXRoIGQ9Ik0yIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOCIvPgogICAgICAgIDxwYXRoIGQ9Ik0xMy45OSA4LjA4OTkyVjMuMjY1NDhDMTAuNjggMy4yNjU0OCA4IDEuMzQ5MTggOCAxLjM0OTE4Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggNFY5Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggMTBWMTIiLz4KICAgIDwvZz4KPC9zdmc+"); background-color: crimson; } .ace_icon_svg.ace_warning { -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg=="); background-color: darkorange; } .ace_icon_svg.ace_info { -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg=="); background-color: royalblue; } .ace_icon_svg.ace_hint { -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0ic2lsdmVyIiBmaWxsPSJub25lIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTYgMTRIMTAiLz4KICAgICAgICA8cGF0aCBkPSJNOCAxMUg5QzkgOS40NzAwMiAxMiA4LjU0MDAyIDEyIDUuNzYwMDJDMTIuMDIgNC40MDAwMiAxMS4zOSAzLjM2MDAyIDEwLjQzIDIuNjcwMDJDOSAxLjY0MDAyIDcuMDAwMDEgMS42NDAwMiA1LjU3MDAxIDIuNjcwMDJDNC42MTAwMSAzLjM2MDAyIDMuOTggNC40MDAwMiA0IDUuNzYwMDJDNCA4LjU0MDAyIDcuMDAwMDEgOS40NzAwMiA3LjAwMDAxIDExSDhaIi8+CiAgICA8L2c+Cjwvc3ZnPg=="); background-color: silver; } .ace_icon_svg.ace_error_fold { -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4="); background-color: crimson; } .ace_icon_svg.ace_security_fold { -webkit-mask-image: url("data:image/svg+xml;base64,CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTcgMTQiIGZpbGw9Im5vbmUiPgogICAgPHBhdGggZD0iTTEwLjAwMDEgMTMuNjk5MkMxMC4wMDAxIDEzLjY5OTIgMTEuOTI0MSAxMy40NzYzIDEzIDEyLjY5OTJDMTQuNDEzOSAxMS42NzgxIDE2IDEwLjUgMTYuMTI1MSA2LjgxMTI2VjIuNTg5ODdDMTYuMTI1MSAyLjU0NzY4IDE2LjEyMjEgMi41MDYxOSAxNi4xMTY0IDIuNDY1NTlWMS43MTQ4NUgxNS4yNDE0TDE1LjIzMDcgMS43MTQ4NEwxNC42MjUxIDEuNjk5MjJWNi44MTEyM0MxNC42MjUxIDguNTEwNjEgMTQuNjI1MSA5LjQ2NDYxIDEyLjc4MjQgMTEuNzIxQzEyLjE1ODYgMTIuNDg0OCAxMC4wMDAxIDEzLjY5OTIgMTAuMDAwMSAxMy42OTkyWiIgZmlsbD0iY3JpbXNvbiIgc3Ryb2tlLXdpZHRoPSIyIi8+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuMzM2MDkgMC4zNjc0NzVDNy4wMzIxNCAwLjE1MjY1MiA2LjYyNTQ4IDAuMTUzNjE0IDYuMzIyNTMgMC4zNjk5OTdMNi4zMDg2OSAwLjM3OTU1NEM2LjI5NTUzIDAuMzg4NTg4IDYuMjczODggMC40MDMyNjYgNi4yNDQxNyAwLjQyMjc4OUM2LjE4NDcxIDAuNDYxODYgNi4wOTMyMSAwLjUyMDE3MSA1Ljk3MzEzIDAuNTkxMzczQzUuNzMyNTEgMC43MzQwNTkgNS4zNzk5IDAuOTI2ODY0IDQuOTQyNzkgMS4xMjAwOUM0LjA2MTQ0IDEuNTA5NyAyLjg3NTQxIDEuODgzNzcgMS41ODk4NCAxLjg4Mzc3SDAuNzE0ODQ0VjIuNzU4NzdWNi45ODAxNUMwLjcxNDg0NCA5LjQ5Mzc0IDIuMjg4NjYgMTEuMTk3MyAzLjcwMjU0IDEyLjIxODVDNC40MTg0NSAxMi43MzU1IDUuMTI4NzQgMTMuMTA1MyA1LjY1NzMzIDEzLjM0NTdDNS45MjI4NCAxMy40NjY0IDYuMTQ1NjYgMTMuNTU1OSA2LjMwNDY1IDEzLjYxNjFDNi4zODQyMyAxMy42NDYyIDYuNDQ4MDUgMTMuNjY5IDYuNDkzNDkgMTMuNjg0OEM2LjUxNjIyIDEzLjY5MjcgNi41MzQzOCAxMy42OTg5IDYuNTQ3NjQgMTMuNzAzM0w2LjU2MzgyIDEzLjcwODdMNi41NjkwOCAxMy43MTA0TDYuNTcwOTkgMTMuNzExTDYuODM5ODQgMTMuNzUzM0w2LjU3MjQyIDEzLjcxMTVDNi43NDYzMyAxMy43NjczIDYuOTMzMzUgMTMuNzY3MyA3LjEwNzI3IDEzLjcxMTVMNy4xMDg3IDEzLjcxMUw3LjExMDYxIDEzLjcxMDRMNy4xMTU4NyAxMy43MDg3TDcuMTMyMDUgMTMuNzAzM0M3LjE0NTMxIDEzLjY5ODkgNy4xNjM0NiAxMy42OTI3IDcuMTg2MTkgMTMuNjg0OEM3LjIzMTY0IDEzLjY2OSA3LjI5NTQ2IDEzLjY0NjIgNy4zNzUwMyAxMy42MTYxQzcuNTM0MDMgMTMuNTU1OSA3Ljc1Njg1IDEzLjQ2NjQgOC4wMjIzNiAxMy4zNDU3QzguNTUwOTUgMTMuMTA1MyA5LjI2MTIzIDEyLjczNTUgOS45NzcxNSAxMi4yMTg1QzExLjM5MSAxMS4xOTczIDEyLjk2NDggOS40OTM3NyAxMi45NjQ4IDYuOTgwMThWMi43NTg4QzEyLjk2NDggMi43MTY2IDEyLjk2MTkgMi42NzUxMSAxMi45NTYxIDIuNjM0NTFWMS44ODM3N0gxMi4wODExQzEyLjA3NzUgMS44ODM3NyAxMi4wNzQgMS44ODM3NyAxMi4wNzA0IDEuODgzNzdDMTAuNzk3OSAxLjg4MDA0IDkuNjE5NjIgMS41MTEwMiA4LjczODk0IDEuMTI0ODZDOC43MzUzNCAxLjEyMzI3IDguNzMxNzQgMS4xMjE2OCA4LjcyODE0IDEuMTIwMDlDOC4yOTEwMyAwLjkyNjg2NCA3LjkzODQyIDAuNzM0MDU5IDcuNjk3NzkgMC41OTEzNzNDNy41Nzc3MiAwLjUyMDE3MSA3LjQ4NjIyIDAuNDYxODYgNy40MjY3NiAwLjQyMjc4OUM3LjM5NzA1IDAuNDAzMjY2IDcuMzc1MzkgMC4zODg1ODggNy4zNjIyNCAwLjM3OTU1NEw3LjM0ODk2IDAuMzcwMzVDNy4zNDg5NiAwLjM3MDM1IDcuMzQ4NDcgMC4zNzAwMiA3LjM0NTYzIDAuMzc0MDU0TDcuMzM3NzkgMC4zNjg2NTlMNy4zMzYwOSAwLjM2NzQ3NVpNOC4wMzQ3MSAyLjcyNjkxQzguODYwNCAzLjA5MDYzIDkuOTYwNjYgMy40NjMwOSAxMS4yMDYxIDMuNTg5MDdWNi45ODAxNUgxMS4yMTQ4QzExLjIxNDggOC42Nzk1MyAxMC4xNjM3IDkuOTI1MDcgOC45NTI1NCAxMC43OTk4QzguMzU1OTUgMTEuMjMwNiA3Ljc1Mzc0IDExLjU0NTQgNy4yOTc5NiAxMS43NTI3QzcuMTE2NzEgMTEuODM1MSA2Ljk2MDYyIDExLjg5OTYgNi44Mzk4NCAxMS45NDY5QzYuNzE5MDYgMTEuODk5NiA2LjU2Mjk3IDExLjgzNTEgNi4zODE3MyAxMS43NTI3QzUuOTI1OTUgMTEuNTQ1NCA1LjMyMzczIDExLjIzMDYgNC43MjcxNSAxMC43OTk4QzMuNTE2MDMgOS45MjUwNyAyLjQ2NDg0IDguNjc5NTUgMi40NjQ4NCA2Ljk4MDE4VjMuNTg5MDlDMy43MTczOCAzLjQ2MjM5IDQuODIzMDggMy4wODYzOSA1LjY1MDMzIDIuNzIwNzFDNi4xNDIyOCAyLjUwMzI0IDYuNTQ0ODUgMi4yODUzNyA2LjgzMjU0IDIuMTE2MjRDNy4xMjE4MSAyLjI4NTM1IDcuNTI3IDIuNTAzNTIgOC4wMjE5NiAyLjcyMTMxQzguMDI2MiAyLjcyMzE3IDguMDMwNDUgMi43MjUwNCA4LjAzNDcxIDIuNzI2OTFaTTUuOTY0ODQgMy40MDE0N1Y3Ljc3NjQ3SDcuNzE0ODRWMy40MDE0N0g1Ljk2NDg0Wk01Ljk2NDg0IDEwLjQwMTVWOC42NTE0N0g3LjcxNDg0VjEwLjQwMTVINS45NjQ4NFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4="); background-color: crimson; } .ace_icon_svg.ace_warning_fold { -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4="); background-color: darkorange; } .ace_scrollbar { contain: strict; position: absolute; right: 0; bottom: 0; z-index: 6; } .ace_scrollbar-inner { position: absolute; cursor: text; left: 0; top: 0; } .ace_scrollbar-v{ overflow-x: hidden; overflow-y: scroll; top: 0; } .ace_scrollbar-h { overflow-x: scroll; overflow-y: hidden; left: 0; } .ace_print-margin { position: absolute; height: 100%; } .ace_text-input { position: absolute; z-index: 0; width: 0.5em; height: 1em; opacity: 0; background: transparent; -moz-appearance: none; appearance: none; border: none; resize: none; outline: none; overflow: hidden; font: inherit; padding: 0 1px; margin: 0 -1px; contain: strict; -ms-user-select: text; -moz-user-select: text; -webkit-user-select: text; user-select: text; /*with \`pre-line\` chrome inserts   instead of space*/ white-space: pre!important; } .ace_text-input.ace_composition { background: transparent; color: inherit; z-index: 1000; opacity: 1; } .ace_composition_placeholder { color: transparent } .ace_composition_marker { border-bottom: 1px solid; position: absolute; border-radius: 0; margin-top: 1px; } [ace_nocontext=true] { transform: none!important; filter: none!important; clip-path: none!important; mask : none!important; contain: none!important; perspective: none!important; mix-blend-mode: initial!important; z-index: auto; } .ace_layer { z-index: 1; position: absolute; overflow: hidden; /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/ word-wrap: normal; white-space: pre; height: 100%; width: 100%; box-sizing: border-box; /* setting pointer-events: auto; on node under the mouse, which changes during scroll, will break mouse wheel scrolling in Safari */ pointer-events: none; } .ace_gutter-layer { position: relative; width: auto; text-align: right; pointer-events: auto; height: 1000000px; contain: style size layout; } .ace_text-layer { font: inherit !important; position: absolute; height: 1000000px; width: 1000000px; contain: style size layout; } .ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group { contain: style size layout; position: absolute; top: 0; left: 0; right: 0; } .ace_hidpi .ace_text-layer, .ace_hidpi .ace_gutter-layer, .ace_hidpi .ace_content, .ace_hidpi .ace_gutter { contain: strict; } .ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group { contain: strict; } .ace_cjk { display: inline-block; text-align: center; } .ace_cursor-layer { z-index: 4; } .ace_cursor { z-index: 4; position: absolute; box-sizing: border-box; border-left: 2px solid; /* workaround for smooth cursor repaintng whole screen in chrome */ transform: translatez(0); } .ace_multiselect .ace_cursor { border-left-width: 1px; } .ace_slim-cursors .ace_cursor { border-left-width: 1px; } .ace_overwrite-cursors .ace_cursor { border-left-width: 0; border-bottom: 1px solid; } .ace_hidden-cursors .ace_cursor { opacity: 0.2; } .ace_hasPlaceholder .ace_hidden-cursors .ace_cursor { opacity: 0; } .ace_smooth-blinking .ace_cursor { transition: opacity 0.18s; } .ace_animate-blinking .ace_cursor { animation-duration: 1000ms; animation-timing-function: step-end; animation-name: blink-ace-animate; animation-iteration-count: infinite; } .ace_animate-blinking.ace_smooth-blinking .ace_cursor { animation-duration: 1000ms; animation-timing-function: ease-in-out; animation-name: blink-ace-animate-smooth; } @keyframes blink-ace-animate { from, to { opacity: 1; } 60% { opacity: 0; } } @keyframes blink-ace-animate-smooth { from, to { opacity: 1; } 45% { opacity: 1; } 60% { opacity: 0; } 85% { opacity: 0; } } .ace_marker-layer .ace_step, .ace_marker-layer .ace_stack { position: absolute; z-index: 3; } .ace_marker-layer .ace_selection { position: absolute; z-index: 5; } .ace_marker-layer .ace_bracket { position: absolute; z-index: 6; } .ace_marker-layer .ace_error_bracket { position: absolute; border-bottom: 1px solid #DE5555; border-radius: 0; } .ace_marker-layer .ace_active-line { position: absolute; z-index: 2; } .ace_marker-layer .ace_selected-word { position: absolute; z-index: 4; box-sizing: border-box; } .ace_line .ace_fold { box-sizing: border-box; display: inline-block; height: 11px; margin-top: -2px; vertical-align: middle; background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="), url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII="); background-repeat: no-repeat, repeat-x; background-position: center center, top left; color: transparent; border: 1px solid black; border-radius: 2px; cursor: pointer; pointer-events: auto; } .ace_dark .ace_fold { } .ace_fold:hover{ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="), url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC"); } .ace_tooltip { background-color: #f5f5f5; border: 1px solid gray; border-radius: 1px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); color: black; padding: 3px 4px; position: fixed; z-index: 999999; box-sizing: border-box; cursor: default; white-space: pre-wrap; word-wrap: break-word; line-height: normal; font-style: normal; font-weight: normal; letter-spacing: normal; pointer-events: none; overflow: auto; max-width: min(33em, 66vw); overscroll-behavior: contain; } .ace_tooltip pre { white-space: pre-wrap; } .ace_tooltip.ace_dark { background-color: #636363; color: #fff; } .ace_tooltip:focus { outline: 1px solid #5E9ED6; } .ace_icon { display: inline-block; width: 18px; vertical-align: top; } .ace_icon_svg { display: inline-block; width: 12px; vertical-align: top; -webkit-mask-repeat: no-repeat; -webkit-mask-size: 12px; -webkit-mask-position: center; } .ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons { padding-right: 13px; } .ace_fold-widget, .ace_custom-widget { box-sizing: border-box; margin: 0 -12px 0 1px; display: none; width: 11px; vertical-align: top; background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg=="); background-repeat: no-repeat; background-position: center; border-radius: 3px; border: 1px solid transparent; cursor: pointer; pointer-events: auto; } .ace_custom-widget { background: none; } .ace_folding-enabled .ace_fold-widget { display: inline-block; } .ace_fold-widget.ace_end { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg=="); } .ace_fold-widget.ace_closed { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA=="); } .ace_fold-widget:hover { border: 1px solid rgba(0, 0, 0, 0.3); background-color: rgba(255, 255, 255, 0.2); box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7); } .ace_fold-widget:active { border: 1px solid rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.05); box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); } /** * Dark version for fold widgets */ .ace_dark .ace_fold-widget { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC"); } .ace_dark .ace_fold-widget.ace_end { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg=="); } .ace_dark .ace_fold-widget.ace_closed { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg=="); } .ace_dark .ace_fold-widget:hover { box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); background-color: rgba(255, 255, 255, 0.1); } .ace_dark .ace_fold-widget:active { box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); } .ace_inline_button { border: 1px solid lightgray; display: inline-block; margin: -1px 8px; padding: 0 5px; pointer-events: auto; cursor: pointer; } .ace_inline_button:hover { border-color: gray; background: rgba(200,200,200,0.2); display: inline-block; pointer-events: auto; } .ace_fold-widget.ace_invalid { background-color: #FFB4B4; border-color: #DE5555; } .ace_fade-fold-widgets .ace_fold-widget { transition: opacity 0.4s ease 0.05s; opacity: 0; } .ace_fade-fold-widgets:hover .ace_fold-widget { transition: opacity 0.05s ease 0.05s; opacity:1; } .ace_underline { text-decoration: underline; } .ace_bold { font-weight: bold; } .ace_nobold .ace_bold { font-weight: normal; } .ace_italic { font-style: italic; } .ace_error-marker { background-color: rgba(255, 0, 0,0.2); position: absolute; z-index: 9; } .ace_highlight-marker { background-color: rgba(255, 255, 0,0.2); position: absolute; z-index: 8; } .ace_mobile-menu { position: absolute; line-height: 1.5; border-radius: 4px; -ms-user-select: none; -moz-user-select: none; -webkit-user-select: none; user-select: none; background: white; box-shadow: 1px 3px 2px grey; border: 1px solid #dcdcdc; color: black; } .ace_dark > .ace_mobile-menu { background: #333; color: #ccc; box-shadow: 1px 3px 2px grey; border: 1px solid #444; } .ace_mobile-button { padding: 2px; cursor: pointer; overflow: hidden; } .ace_mobile-button:hover { background-color: #eee; opacity:1; } .ace_mobile-button:active { background-color: #ddd; } .ace_placeholder { position: relative; font-family: arial; transform: scale(0.9); transform-origin: left; white-space: pre; opacity: 0.7; margin: 0 10px; z-index: 1; } .ace_ghost_text { opacity: 0.5; font-style: italic; } .ace_ghost_text_container > div { white-space: pre; } .ghost_text_line_wrapped::after { content: "↩"; position: absolute; } .ace_lineWidgetContainer.ace_ghost_text { margin: 0px 4px } .ace_screenreader-only { position:absolute; left:-10000px; top:auto; width:1px; height:1px; overflow:hidden; } .ace_hidden_token { display: none; }`}),ace.define(`ace/layer/decorators`,[`require`,`exports`,`module`,`ace/lib/dom`,`ace/lib/oop`,`ace/lib/event_emitter`],function(e,t,n){var r=e(`../lib/dom`),i=e(`../lib/oop`),a=e(`../lib/event_emitter`).EventEmitter,o=function(){function e(e,t){this.renderer=t,this.pixelRatio=1,this.maxHeight=t.layerConfig.maxHeight,this.lineHeight=t.layerConfig.lineHeight,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.colors={},this.colors.dark={error:`rgba(255, 18, 18, 1)`,warning:`rgba(18, 136, 18, 1)`,info:`rgba(18, 18, 136, 1)`},this.colors.light={error:`rgb(255,51,51)`,warning:`rgb(32,133,72)`,info:`rgb(35,68,138)`},this.setScrollBarV(e)}return e.prototype.$createCanvas=function(){this.canvas=r.createElement(`canvas`),this.canvas.style.top=`0px`,this.canvas.style.right=`0px`,this.canvas.style.zIndex=`7`,this.canvas.style.position=`absolute`},e.prototype.setScrollBarV=function(e){this.$createCanvas(),this.scrollbarV=e,e.element.appendChild(this.canvas),this.setDimensions()},e.prototype.$updateDecorators=function(e){if(typeof this.canvas.getContext!=`function`)return;var t=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;this.setDimensions(e);var n=this.canvas.getContext(`2d`);function r(e,t){return e.priorityt.priority?1:0}var i=this.renderer.session.$annotations;if(n.clearRect(0,0,this.canvas.width,this.canvas.height),i){var a={info:1,warning:2,error:3};i.forEach(function(e){e.priority=a[e.type]||null}),i=i.sort(r);for(var o=0;othis.canvasHeight&&(f=this.canvasHeight-p);var m=f-p,h=f+p-m;n.fillStyle=t[i[o].type]||null,n.fillRect(0,m,Math.round(this.oneZoneWidth-1),h)}}var g=this.renderer.session.selection.getCursor();if(g){var _=Math.round(this.getVerticalOffsetForRow(g.row)*this.heightRatio);n.fillStyle=`rgba(0, 0, 0, 0.5)`,n.fillRect(0,_,this.canvasWidth,2)}},e.prototype.getVerticalOffsetForRow=function(e){return e|=0,this.renderer.session.documentToScreenRow(e,0)*this.lineHeight},e.prototype.setDimensions=function(e){e=e||this.renderer.layerConfig,this.maxHeight=e.maxHeight,this.lineHeight=e.lineHeight,this.canvasHeight=e.height,this.canvasWidth=this.scrollbarV.width||this.canvasWidth,this.setZoneWidth(),this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.maxHeighte&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},e.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},e.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},e.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},e.prototype.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},e.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},e.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},e.prototype.onResize=function(e,t,n,r){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),!r&&this.$maxLines&&this.lineHeight>1&&(!i.style.height||i.style.height==`0px`)&&(i.style.height=`1px`,r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var a=this.$updateCachedSize(e,t,n,r);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(a|this.$changes,!0):this.$loop.schedule(a|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},e.prototype.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var a=0,o=this.$size,s={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if(r&&(e||o.height!=r)&&(o.height=r,a|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(o.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+`px`,a|=this.CHANGE_SCROLL),n&&(e||o.width!=n)){a|=this.CHANGE_SIZE,o.width=n,t??(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,`left`,t+`px`),i.setStyle(this.scroller.style,`left`,t+this.margin.left+`px`),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,`left`,this.margin.left+`px`);var c=this.scrollBarV.getWidth()+`px`;i.setStyle(this.scrollBarH.element.style,`right`,c),i.setStyle(this.scroller.style,`right`,c),i.setStyle(this.scroller.style,`bottom`,this.scrollBarH.getHeight()),this.scrollBarH.setWidth(o.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(a|=this.CHANGE_FULL)}return o.$dirty=!n||!r,a&&this._signal(`resize`,s),a},e.prototype.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},e.prototype.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-this.$padding*2,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},e.prototype.setAnimatedScroll=function(e){this.setOption(`animatedScroll`,e)},e.prototype.getAnimatedScroll=function(){return this.$animatedScroll},e.prototype.setShowInvisibles=function(e){this.setOption(`showInvisibles`,e),this.session.$bidiHandler.setShowInvisibles(e)},e.prototype.getShowInvisibles=function(){return this.getOption(`showInvisibles`)},e.prototype.getDisplayIndentGuides=function(){return this.getOption(`displayIndentGuides`)},e.prototype.setDisplayIndentGuides=function(e){this.setOption(`displayIndentGuides`,e)},e.prototype.getHighlightIndentGuides=function(){return this.getOption(`highlightIndentGuides`)},e.prototype.setHighlightIndentGuides=function(e){this.setOption(`highlightIndentGuides`,e)},e.prototype.setShowPrintMargin=function(e){this.setOption(`showPrintMargin`,e)},e.prototype.getShowPrintMargin=function(){return this.getOption(`showPrintMargin`)},e.prototype.setPrintMarginColumn=function(e){this.setOption(`printMarginColumn`,e)},e.prototype.getPrintMarginColumn=function(){return this.getOption(`printMarginColumn`)},e.prototype.getShowGutter=function(){return this.getOption(`showGutter`)},e.prototype.setShowGutter=function(e){return this.setOption(`showGutter`,e)},e.prototype.getFadeFoldWidgets=function(){return this.getOption(`fadeFoldWidgets`)},e.prototype.setFadeFoldWidgets=function(e){this.setOption(`fadeFoldWidgets`,e)},e.prototype.setHighlightGutterLine=function(e){this.setOption(`highlightGutterLine`,e)},e.prototype.getHighlightGutterLine=function(){return this.getOption(`highlightGutterLine`)},e.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var e=i.createElement(`div`);e.className=`ace_layer ace_print-margin-layer`,this.$printMarginEl=i.createElement(`div`),this.$printMarginEl.className=`ace_print-margin`,e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+`px`,t.visibility=this.$showPrintMargin?`visible`:`hidden`,this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},e.prototype.getContainerElement=function(){return this.container},e.prototype.getMouseEventTarget=function(){return this.scroller},e.prototype.getTextAreaContainer=function(){return this.container},e.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(!this.$keepTextAreaAtCursor&&!t){i.translate(this.textarea,-100,0);return}var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,a=n.top,o=n.left;a-=r.offset;var s=t&&t.useTextareaForIME||b.isMobile?this.lineHeight:1;if(a<0||a>r.height-s){i.translate(this.textarea,0,0);return}var c=1,l=this.$size.height-s;if(!t)a+=this.lineHeight;else if(t.useTextareaForIME){var u=this.textarea.value;c=this.characterWidth*this.session.$getStringScreenWidth(u)[0]}else a+=this.lineHeight+2;o-=this.scrollLeft,o>this.$size.scrollerWidth-c&&(o=this.$size.scrollerWidth-c),o+=this.gutterWidth+this.margin.left,i.setStyle(e,`height`,s+`px`),i.setStyle(e,`width`,c+`px`),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-c),Math.min(a,l))}}},e.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},e.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},e.prototype.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},e.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},e.prototype.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},e.prototype.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=e|0,i.bottom=t|0,i.right=r|0,i.left=n|0,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},e.prototype.setMargin=function(e,t,n,r){var i=this.margin;i.top=e|0,i.bottom=t|0,i.right=r|0,i.left=n|0,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},e.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},e.prototype.setHScrollBarAlwaysVisible=function(e){this.setOption(`hScrollBarAlwaysVisible`,e)},e.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},e.prototype.setVScrollBarAlwaysVisible=function(e){this.setOption(`vScrollBarAlwaysVisible`,e)},e.prototype.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},e.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},e.prototype.freeze=function(){this.$frozen=!0},e.prototype.unfreeze=function(){this.$frozen=!1},e.prototype.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!e&&!t){this.$changes|=e;return}if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal(`beforeRender`,e),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var a=n.width+2*this.$padding+`px`,o=n.minHeight+`px`;i.setStyle(this.content.style,`width`,a),i.setStyle(this.content.style,`height`,o)}if(e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?`ace_scroller `:`ace_scroller ace_scroll-left `,this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),e&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),this._signal(`afterRender`,e);return}if(e&this.CHANGE_SCROLL){this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),this._signal(`afterRender`,e);return}e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)):e&this.CHANGE_LINES?((this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)):e&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal(`afterRender`,e)},e.prototype.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){r!=this.$vScroll&&(this.$vScroll=r,this.scrollBarV.setVisible(r));var i=this.container.clientWidth;this.container.style.height=n+`px`,this.$updateCachedSize(!0,this.$gutterWidth,i,n),this.desiredHeight=n,this._signal(`autosize`)}},e.prototype.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,i=this.$getLongestLine(),a=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-i-2*this.$padding<0),o=this.$horizScroll!==a;o&&(this.$horizScroll=a,this.scrollBarH.setVisible(a));var s=this.$vScroll;this.$maxLines&&this.lineHeight>1&&(this.$autosize(),n=t.height<=2*this.lineHeight);var c=t.scrollerHeight+this.lineHeight,l=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=l;var u=this.scrollMargin;this.session.setScrollTop(Math.max(-u.top,Math.min(this.scrollTop,r-t.scrollerHeight+u.bottom))),this.session.setScrollLeft(Math.max(-u.left,Math.min(this.scrollLeft,i+2*this.$padding-t.scrollerWidth+u.right)));var d=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+l<0||this.scrollTop>u.top),f=s!==d;f&&(this.$vScroll=d,this.scrollBarV.setVisible(d));var p=this.scrollTop%this.lineHeight,m=Math.ceil(c/this.lineHeight)-1,h=Math.max(0,Math.round((this.scrollTop-p)/this.lineHeight)),g=h+m,_,v,y=this.lineHeight;h=e.screenToDocumentRow(h,0);var b=e.getFoldLine(h);b&&(h=b.start.row),_=e.documentToScreenRow(h,0),v=e.getRowLength(h)*y,g=Math.min(e.screenToDocumentRow(g,0),e.getLength()-1),c=t.scrollerHeight+e.getRowLength(g)*y+v,p=this.scrollTop-_*y,p<0&&_>0&&(_=Math.max(0,_+Math.floor(p/y)),p=this.scrollTop-_*y);var x=0;return(this.layerConfig.width!=i||o)&&(x=this.CHANGE_H_SCROLL),(o||f)&&(x|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal(`scrollbarVisibilityChanged`),f&&(i=this.$getLongestLine())),this.layerConfig={width:i,padding:this.$padding,firstRow:h,firstRowScreen:_,lastRow:g,lineHeight:y,characterWidth:this.characterWidth,minHeight:c,maxHeight:r,offset:p,gutterOffset:y?Math.max(0,Math.ceil((p+t.height-t.scrollerHeight)/y)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(i-this.$padding),x},e.prototype.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1)&&!(tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},e.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},e.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},e.prototype.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},e.prototype.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},e.prototype.updateBreakpoints=function(e){this._rows=e,this.$loop.schedule(this.CHANGE_GUTTER)},e.prototype.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},e.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},e.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},e.prototype.showCursor=function(){this.$cursorLayer.showCursor()},e.prototype.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},e.prototype.scrollCursorIntoView=function(e,t,n){if(this.$size.scrollerHeight!==0){var r=this.$cursorLayer.getPixelPosition(e),i=r.left,a=r.top,o=n&&n.top||0,s=n&&n.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var c=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;c+o>a?(t&&c+o>a+this.lineHeight&&(a-=t*this.$size.scrollerHeight),a===0&&(a=-this.scrollMargin.top),this.session.setScrollTop(a)):c+this.$size.scrollerHeight-s=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},e.prototype.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,a=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),s=this.$blockCursor?Math.floor(a):Math.round(a);return{row:o,column:s,side:a-s>0?1:-1,offsetX:i}},e.prototype.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,a=i/this.characterWidth,o=this.$blockCursor?Math.floor(a):Math.round(a),s=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(s,Math.max(o,0),i)},e.prototype.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),a=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+a-this.scrollTop}},e.prototype.visualizeFocus=function(){i.addCssClass(this.container,`ace_focus`)},e.prototype.visualizeBlur=function(){i.removeCssClass(this.container,`ace_focus`)},e.prototype.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),e.useTextareaForIME??(e.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(i.addCssClass(this.textarea,`ace_composition`),this.textarea.style.cssText=``,this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display=`none`):e.markerId=this.session.addMarker(e.markerRange,`ace_composition_marker`,`text`)},e.prototype.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,`composition_placeholder`,t.row,t.column),this.$moveTextAreaToCursor()},e.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,`ace_composition`),this.textarea.style.cssText=this.$composition.cssText;var e=this.session.selection.cursor;this.removeExtraToken(e.row,e.column),this.$composition=null,this.$cursorLayer.element.style.display=``}},e.prototype.setGhostText=function(e,t){var n=this.session.selection.cursor,r=t||{row:n.row,column:n.column};this.removeGhostText();var a=this.$calculateWrappedTextChunks(e,r);this.addToken(a[0].text,`ghost_text`,r.row,r.column),this.$ghostText={text:e,position:{row:r.row,column:r.column}};var o=i.createElement(`div`);if(a.length>1){var s=this.hideTokensAfterPosition(r.row,r.column),c;a.slice(1).forEach(function(e){var t=i.createElement(`div`),n=i.createElement(`span`);n.className=`ace_ghost_text`,e.wrapped&&(t.className=`ghost_text_line_wrapped`),e.text.length===0&&(e.text=` `),n.appendChild(i.createTextNode(e.text)),t.appendChild(n),o.appendChild(t),c=t}),s.forEach(function(e){var t=i.createElement(`span`);x(e.type)||(t.className=`ace_`+e.type.replace(/\./g,` ace_`)),t.appendChild(i.createTextNode(e.value)),c.appendChild(t)}),this.$ghostTextWidget={el:o,row:r.row,column:r.column,className:`ace_ghost_text_container`},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var l=this.$cursorLayer.getPixelPosition(r,!0),u=this.container.getBoundingClientRect().height,d=a.length*this.lineHeight;if(d0){var l=0;c.push(i[o].length);for(var u=0;u1||Math.abs(e.$size.height-r)>1?e.$resizeTimer.delay():e.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},e}();S.prototype.CHANGE_CURSOR=1,S.prototype.CHANGE_MARKER=2,S.prototype.CHANGE_GUTTER=4,S.prototype.CHANGE_SCROLL=8,S.prototype.CHANGE_LINES=16,S.prototype.CHANGE_TEXT=32,S.prototype.CHANGE_SIZE=64,S.prototype.CHANGE_MARKER_BACK=128,S.prototype.CHANGE_MARKER_FRONT=256,S.prototype.CHANGE_FULL=512,S.prototype.CHANGE_H_SCROLL=1024,S.prototype.$changes=0,S.prototype.$padding=null,S.prototype.$frozen=!1,S.prototype.STEPS=8,r.implement(S.prototype,_),o.defineOptions(S.prototype,`renderer`,{useResizeObserver:{set:function(e){!e&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):e&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){typeof e==`number`&&(this.$printMarginColumn=e),this.$showPrintMargin=!!e,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?`block`:`none`,this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(e){this.$gutterLayer.$useSvgGutterIcons=e},initialValue:!1},showFoldedAnnotations:{set:function(e){this.$gutterLayer.$showFoldedAnnotations=e},initialValue:!1},fadeFoldWidgets:{set:function(e){i.setCssClass(this.$gutter,`ace_fade-fold-widgets`,e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(e){this.$textLayer.setHighlightIndentGuides(e)==1?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(e){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){typeof e==`number`&&(e+=`px`),this.container.style.fontSize=e,this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e,this.updateFontSize()}},maxLines:{set:function(e){this.updateFull()}},minLines:{set:function(e){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){e=+e||0,this.$scrollPastEnd!=e&&(this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(e){this.$updateCustomScrollbar(e)},initialValue:!1},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:`./theme/textmate`,handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!b.isMobile&&!b.isIE}}),t.VirtualRenderer=S}),ace.define(`ace/worker/worker_client`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/net`,`ace/lib/event_emitter`,`ace/config`],function(e,t,n){var r=e(`../lib/oop`),i=e(`../lib/net`),a=e(`../lib/event_emitter`).EventEmitter,o=e(`../config`);function s(e){var t=`importScripts('`+i.qualifyURL(e)+`');`;try{return new Blob([t],{type:`application/javascript`})}catch{var n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return n.append(t),n.getBlob(`application/javascript`)}}function c(e){if(typeof Worker>`u`)return{postMessage:function(){},terminate:function(){}};if(o.get(`loadWorkerFromBlob`)){var t=s(e),n=(window.URL||window.webkitURL).createObjectURL(t);return new Worker(n)}return new Worker(e)}var l=function(e){e.postMessage||(e=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=e,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){r.implement(this,a),this.$createWorkerFromOldConfig=function(t,n,r,i,a){if(e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl),o.get(`packaged`)||!e.toUrl)i=i||o.moduleUrl(n,`worker`);else{var s=this.$normalizePath;i=i||s(e.toUrl(`ace/worker/worker.js`,null,`_`));var l={};t.forEach(function(t){l[t]=s(e.toUrl(t,null,`_`).replace(/(\.js)?(\?.*)?$/,``))})}return this.$worker=c(i),a&&this.send(`importScripts`,a),this.$worker.postMessage({init:!0,tlns:l,module:n,classname:r}),this.$worker},this.onMessage=function(e){var t=e.data;switch(t.type){case`event`:this._signal(t.name,{data:t.data});break;case`call`:var n=this.callbacks[t.id];n&&(n(t.data),delete this.callbacks[t.id]);break;case`error`:this.reportError(t.data);break;case`log`:window.console&&console.log&&console.log.apply(console,t.data);break}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return i.qualifyURL(e)},this.terminate=function(){this._signal(`terminate`,{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(e){e.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off(`change`,this.changeListener),this.$doc=null},this.send=function(e,t){this.$worker.postMessage({command:e,args:t})},this.call=function(e,t,n){if(n){var r=this.callbackId++;this.callbacks[r]=n,t.push(r)}this.send(e,t)},this.emit=function(e,t){try{t.data&&t.data.err&&(t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code}),this.$worker&&this.$worker.postMessage({event:e,data:{data:t.data}})}catch(e){console.error(e.stack)}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call(`setValue`,[e.getValue()]),e.on(`change`,this.changeListener,!0)},this.changeListener=function(e){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),e.action==`insert`?this.deltaQueue.push(e.start,e.lines):this.deltaQueue.push(e.start,e.end)},this.$sendDeltaQueue=function(){var e=this.deltaQueue;e&&(this.deltaQueue=null,e.length>50&&e.length>this.$doc.getLength()>>1?this.call(`setValue`,[this.$doc.getValue()]):this.emit(`change`,{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var r=null,i=!1,s=Object.create(a),c=[],u=new l({messageBuffer:c,terminate:function(){},postMessage:function(e){c.push(e),r&&(i?setTimeout(d):d())}});u.setEmitSync=function(e){i=e};var d=function(){var e=c.shift();e.command?r[e.command].apply(r,e.args):e.event&&s._signal(e.event,e.data)};return s.postMessage=function(e){u.onMessage({data:e})},s.callback=function(e,t){this.postMessage({type:`call`,id:t,data:e})},s.emit=function(e,t){this.postMessage({type:`event`,name:e,data:t})},o.loadModule([`worker`,t],function(e){for(r=new e[n](s);c.length;)d()}),u},t.WorkerClient=l,t.createWorker=c}),ace.define(`ace/placeholder`,[`require`,`exports`,`module`,`ace/range`,`ace/lib/event_emitter`,`ace/lib/oop`],function(e,t,n){var r=e(`./range`).Range,i=e(`./lib/event_emitter`).EventEmitter,a=e(`./lib/oop`),o=function(){function e(e,t,n,r,i,a){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=a,this.$onUpdate=this.onUpdate.bind(this),this.doc.on(`change`,this.$onUpdate,!0),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n,this.$undoStackDepth=(e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1}).length,this.setup(),e.selection.on(`changeCursor`,this.$onCursorChange)}return e.prototype.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},e.prototype.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})}},e.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,a=t.start.column-this.pos.column;if(this.updateAnchors(e),i&&(this.length+=n),i&&!this.session.$fromUndo){if(e.action===`insert`)for(var o=this.others.length-1;o>=0;o--){var s=this.others[o],c={row:s.row,column:s.column+a};this.doc.insertMergedLines(c,e.lines)}else if(e.action===`remove`)for(var o=this.others.length-1;o>=0;o--){var s=this.others[o],c={row:s.row,column:s.column+a};this.doc.remove(new r(c.row,c.column,c.row,c.column-n))}}this.$updating=!1,this.updateMarkers()}},e.prototype.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},e.prototype.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)}},e.prototype.onCursorChange=function(e){if(!(this.$updating||!this.session)){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit(`cursorEnter`,e)):(this.hideOtherMarkers(),this._emit(`cursorLeave`,e))}},e.prototype.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off(`change`,this.$onUpdate),this.session.selection.off(`changeCursor`,this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},e.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n1?e.multiSelect.joinSelections():e.multiSelect.splitIntoLines()},bindKey:{win:`Ctrl-Alt-L`,mac:`Ctrl-Alt-L`},readOnly:!0},{name:`splitSelectionIntoLines`,description:`Split into lines`,exec:function(e){e.multiSelect.splitIntoLines()},readOnly:!0},{name:`alignCursors`,description:`Align cursors`,exec:function(e){e.alignCursors()},bindKey:{win:`Ctrl-Alt-A`,mac:`Ctrl-Alt-A`},scrollIntoView:`cursor`},{name:`findAll`,description:`Find all`,exec:function(e){e.findAll()},bindKey:{win:`Ctrl-Alt-K`,mac:`Ctrl-Alt-G`},scrollIntoView:`cursor`,readOnly:!0}],t.multiSelectCommands=[{name:`singleSelection`,description:`Single selection`,bindKey:`esc`,exec:function(e){e.exitMultiSelectMode()},scrollIntoView:`cursor`,readOnly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var r=e(`../keyboard/hash_handler`).HashHandler;t.keyboardHandler=new r(t.multiSelectCommands)}),ace.define(`ace/multi_select`,[`require`,`exports`,`module`,`ace/range_list`,`ace/range`,`ace/selection`,`ace/mouse/multi_select_handler`,`ace/lib/event`,`ace/lib/lang`,`ace/commands/multi_select_commands`,`ace/search`,`ace/edit_session`,`ace/editor`,`ace/config`],function(e,t,n){var r=e(`./range_list`).RangeList,i=e(`./range`).Range,a=e(`./selection`).Selection,o=e(`./mouse/multi_select_handler`).onMouseDown,s=e(`./lib/event`),c=e(`./lib/lang`),l=e(`./commands/multi_select_commands`);t.commands=l.defaultCommands.concat(l.multiSelectCommands);var u=e(`./search`).Search,d=new u;function f(e,t,n){return d.$options.wrap=!0,d.$options.needle=t,d.$options.backwards=n==-1,d.find(e)}var p=e(`./edit_session`).EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(p.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&this.rangeCount===0){var n=this.toOrientedRange();if(this.rangeList.add(n),this.rangeList.add(e),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(n),this.$onAddRange(n)}e.cursor||(e.cursor=e.end);var r=this.rangeList.add(e);return this.$onAddRange(e),r.length&&this.$onRemoveRange(r),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal(`multiSelect`),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal(`addRange`,{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal(`removeRange`,{ranges:e}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal(`singleSelect`),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),t=t||this.ranges[0],t&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var e=this.ranges.length?this.ranges:[this.getRange()],t=[],n=0;n1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),a=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(r,a).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],a=e.column0;)_--;if(_>0)for(var v=0;r[v].isEmpty();)v++;for(var y=_;y>=v;y--)r[y].isEmpty()&&r.splice(y,1)}return r}}).call(a.prototype);var m=e(`./editor`).Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,`ace_selection`,t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);t!=-1&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var r=e[n];if(r.marker){this.session.removeMarker(r.marker);var i=t.indexOf(r);i!=-1&&t.splice(i,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle(`ace_multiselect`),this.keyBinding.addKeyboardHandler(l.keyboardHandler),this.commands.setDefaultHandler(`exec`,this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle(`ace_multiselect`),this.keyBinding.removeKeyboardHandler(l.keyboardHandler),this.commands.removeDefaultHandler(`exec`,this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit(`changeSelection`))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)t.multiSelectAction==`forEach`?r=n.forEachSelection(t,e.args):t.multiSelectAction==`forEachLine`?r=n.forEachSelection(t,e.args,!0):t.multiSelectAction==`single`?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});else{var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return r}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var r=n&&n.keepOrder,i=n==1||n&&n.$byLines,o=this.session,s=this.selection,c=s.rangeList,l=(r?s:c).ranges,u;if(!l.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var d=s._eventRegistry;s._eventRegistry={};var f=new a(o);this.inVirtualSelectionMode=!0;for(var p=l.length;p--;){if(i)for(;p>0&&l[p].start.row==l[p-1].end.row;)p--;f.fromOrientedRange(l[p]),f.index=p,this.selection=o.selection=f;var m=e.exec?e.exec(this,t||{}):e(this,t||{});!u&&m!==void 0&&(u=m),f.toOrientedRange(l[p])}f.detach(),this.selection=o.selection=s,this.inVirtualSelectionMode=!1,s._eventRegistry=d,s.mergeOverlappingRanges(),s.ranges[0]&&s.fromOrientedRange(s.ranges[0]);var h=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),h&&h.from==h.to&&this.renderer.animateScrolling(h.from),u}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e=``;if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],r=0;r0);s<0&&(s=0),l>=d&&(l=d-1)}var p=this.session.removeFullLines(s,l);p=this.$reAlignText(p,u),this.session.insert({row:s,column:0},p.join(` `)+` `),u||(o.start.column=0,o.end.column=p[p.length-1].length),this.selection.setRange(o)}else{a.forEach(function(e){t.substractPoint(e.cursor)});var m=0,h=1/0,g=n.map(function(t){var n=t.cursor,r=e.getLine(n.row).substr(n.column).search(/\S/g);return r==-1&&(r=0),n.column>m&&(m=n.column),ro?e.insert(r,c.stringRepeat(` `,a-o)):e.remove(new i(r.row,r.column,r.row,r.column-a+o)),t.start.column=t.end.column=m,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(e,t){var n=!0,r=!0,i,a,o;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?i==null?(i=t[1].length,a=t[2].length,o=t[3].length,t):(i+a+o!=t[1].length+t[2].length+t[3].length&&(r=!1),i!=t[1].length&&(n=!1),i>t[1].length&&(i=t[1].length),at[3].length&&(o=t[3].length),t):[e]}).map(t?l:n?r?u:l:d);function s(e){return c.stringRepeat(` `,e)}function l(e){return e[2]?s(i)+e[2]+s(a-e[2].length+o)+e[4].replace(/^([=:])\s+/,`$1 `):e[0]}function u(e){return e[2]?s(i+a-e[2].length)+e[2]+s(o)+e[4].replace(/^([=:])\s+/,`$1 `):e[0]}function d(e){return e[2]?s(i)+e[2]+s(o)+e[4].replace(/^([=:])\s+/,`$1 `):e[0]}}}).call(m.prototype);function h(e,t){return e.row==t.row&&e.column==t.column}t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off(`addRange`,this.$onAddRange),n.multiSelect.off(`removeRange`,this.$onRemoveRange),n.multiSelect.off(`multiSelect`,this.$onMultiSelect),n.multiSelect.off(`singleSelect`,this.$onSingleSelect),n.multiSelect.lead.off(`change`,this.$checkMultiselectChange),n.multiSelect.anchor.off(`change`,this.$checkMultiselectChange)),t&&(t.multiSelect.on(`addRange`,this.$onAddRange),t.multiSelect.on(`removeRange`,this.$onRemoveRange),t.multiSelect.on(`multiSelect`,this.$onMultiSelect),t.multiSelect.on(`singleSelect`,this.$onSingleSelect),t.multiSelect.lead.on(`change`,this.$checkMultiselectChange),t.multiSelect.anchor.on(`change`,this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function g(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on(`changeSession`,e.$multiselectOnSessionChange),e.on(`mousedown`,o),e.commands.addCommands(l.defaultCommands),_(e))}function _(e){if(!e.textInput)return;var t=e.textInput.getElement(),n=!1;s.addListener(t,`keydown`,function(t){var i=t.keyCode==18&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&i?n||(e.renderer.setMouseCursor(`crosshair`),n=!0):n&&r()},e),s.addListener(t,`keyup`,r,e),s.addListener(t,`blur`,r,e);function r(t){n&&(e.renderer.setMouseCursor(``),n=!1)}}t.MultiSelect=g,e(`./config`).defineOptions(m.prototype,`editor`,{enableMultiselect:{set:function(e){g(this),e?this.on(`mousedown`,o):this.off(`mousedown`,o)},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define(`ace/mode/folding/fold_mode`,[`require`,`exports`,`module`,`ace/range`],function(e,t,n){var r=e(`../../range`).Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?`start`:t==`markbeginend`&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?`end`:``},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,a=e.getLine(t),o=a.search(i);if(o!=-1){for(var s=n||a.length,c=e.getLength(),l=t,u=t;++tl){var p=e.getLine(u).length;return new r(l,s,u,p)}}},this.openingBracketBlock=function(e,t,n,i,a){var o={row:n,column:i+1},s=e.$findClosingBracket(t,o,a);if(s){var c=e.foldWidgets[s.row];return c??(c=e.getFoldWidget(s.row)),c==`start`&&s.row>o.row&&(s.row--,s.column=e.getLine(s.row).length),r.fromPoints(o,s)}},this.closingBracketBlock=function(e,t,n,i,a){var o={row:n,column:i},s=e.$findOpeningBracket(t,o);if(s)return s.column++,o.column--,r.fromPoints(s,o)}}).call(i.prototype)}),ace.define(`ace/ext/error_marker`,[`require`,`exports`,`module`,`ace/lib/dom`,`ace/range`,`ace/config`],function(e,t,n){var r=e(`../lib/dom`),i=e(`../range`).Range,a=e(`../config`).nls;function o(e,t,n){for(var r=0,i=e.length-1;r<=i;){var a=r+i>>1,o=n(t,e[a]);if(o>0)r=a+1;else if(o<0)i=a-1;else return a}return-(r+1)}function s(e,t,n){var r=e.getAnnotations().sort(i.comparePoints);if(r.length){var a=o(r,{row:t,column:-1},i.comparePoints);a<0&&(a=-a-1),a>=r.length?a=n>0?0:r.length-1:a===0&&n<0&&(a=r.length-1);var s=r[a];if(!(!s||!n)){if(s.row===t){do s=r[a+=n];while(s&&s.row===t);if(!s)return r.slice()}var c=[];t=s.row;do c[n<0?`unshift`:`push`](s),s=r[a+=n];while(s&&s.row==t);return c.length&&c}}}t.showErrorMarker=function(e,t){var n=e.session,i=e.getCursorPosition(),o=i.row,c=n.widgetManager.getWidgetsAtRow(o).filter(function(e){return e.type==`errorMarker`})[0];c?c.destroy():o-=t;var l=s(n,o,t),u;if(l){var d=l[0];i.column=(d.pos&&typeof d.column!=`number`?d.pos.sc:d.column)||0,i.row=d.row,u=e.renderer.$gutterLayer.$annotations[i.row]}else if(c)return;else u={displayText:[a(`error-marker.good-state`,`Looks good!`)],className:`ace_ok`};e.session.unfold(i.row),e.selection.moveToPosition(i);var f={row:i.row,fixedWidth:!0,coverGutter:!0,el:r.createElement(`div`),type:`errorMarker`},p=f.el.appendChild(r.createElement(`div`)),m=f.el.appendChild(r.createElement(`div`));m.className=`error_widget_arrow `+u.className;var h=e.renderer.$cursorLayer.getPixelPosition(i).left;m.style.left=h+e.renderer.gutterWidth-5+`px`,f.el.className=`error_widget_wrapper`,p.className=`error_widget `+u.className,u.displayText.forEach(function(e,t){p.appendChild(r.createTextNode(e)),t{ace.define(`ace/ext/themelist`,[`require`,`exports`,`module`],function(e,t,n){t.themesByName={},t.themes=[[`Chrome`],[`Clouds`],[`Crimson Editor`],[`Dawn`],[`Dreamweaver`],[`Eclipse`],[`GitHub Light Default`],[`GitHub (Legacy)`,`github`,`light`],[`IPlastic`],[`Solarized Light`],[`TextMate`],[`Tomorrow`],[`XCode`],[`Kuroir`],[`KatzenMilch`],[`SQL Server`,`sqlserver`,`light`],[`CloudEditor`,`cloud_editor`,`light`],[`Ambiance`,`ambiance`,`dark`],[`Chaos`,`chaos`,`dark`],[`Clouds Midnight`,`clouds_midnight`,`dark`],[`Dracula`,``,`dark`],[`Cobalt`,`cobalt`,`dark`],[`Gruvbox`,`gruvbox`,`dark`],[`Green on Black`,`gob`,`dark`],[`idle Fingers`,`idle_fingers`,`dark`],[`krTheme`,`kr_theme`,`dark`],[`Merbivore`,`merbivore`,`dark`],[`Merbivore Soft`,`merbivore_soft`,`dark`],[`Mono Industrial`,`mono_industrial`,`dark`],[`Monokai`,`monokai`,`dark`],[`Nord Dark`,`nord_dark`,`dark`],[`One Dark`,`one_dark`,`dark`],[`Pastel on dark`,`pastel_on_dark`,`dark`],[`Solarized Dark`,`solarized_dark`,`dark`],[`Terminal`,`terminal`,`dark`],[`Tomorrow Night`,`tomorrow_night`,`dark`],[`Tomorrow Night Blue`,`tomorrow_night_blue`,`dark`],[`Tomorrow Night Bright`,`tomorrow_night_bright`,`dark`],[`Tomorrow Night 80s`,`tomorrow_night_eighties`,`dark`],[`Twilight`,`twilight`,`dark`],[`Vibrant Ink`,`vibrant_ink`,`dark`],[`GitHub Dark`,`github_dark`,`dark`],[`CloudEditor Dark`,`cloud_editor_dark`,`dark`]].map(function(e){var n=e[1]||e[0].replace(/ /g,`_`).toLowerCase(),r={caption:e[0],theme:`ace/theme/`+n,isDark:e[2]==`dark`,name:n};return t.themesByName[n]=r,r})}),(function(){ace.require([`ace/ext/themelist`],function(n){typeof t==`object`&&typeof e==`object`&&t&&(t.exports=n)})})()}));t(Ww(),1);var Kw=Gw(),qw=()=>document.documentElement.className||He,Jw=e=>{let t=document.documentElement;e?t.className=e:t.className=Yw()},Yw=()=>window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,Xw=e=>(e.startsWith(`ace/theme/`)||(e=`ace/theme/${e}`),Kw.themesByName[e.replace(`ace/theme/`,``)]===void 0?qw()===`dark`?`ace/theme/twilight`:`ace/theme/chrome`:e),Zw={key:1,class:`row`},Qw={class:`column`},$w={class:`card-title`},eT={class:`card-content`},tT={class:`small`},nT={for:`minimumPasswordLength`},rT={class:`small`},iT={key:0},aT={class:`small`},oT={class:`link`,target:`_blank`,href:`https://filebrowser.org/configuration.html#custom-branding`},sT={for:`theme`},cT={for:`branding-name`},lT={for:`branding-files`},uT={class:`small`},dT={class:`tusConditionalSettings`},fT={for:`tus-chunkSize`},pT={for:`tus-retryCount`},mT={class:`card-action`},hT=[`value`],gT={class:`column`},_T={class:`card-title`},vT={class:`card-content`},yT={class:`small`},bT={class:`card-action`},xT=[`value`],ST={class:`column`},CT={class:`card-title`},wT={class:`card-content`},TT={class:`link`,target:`_blank`,href:`https://filebrowser.org/configuration.html#command-runner`},ET=[`id`],DT=[`for`],OT={class:`collapse`},kT=[`onUpdate:modelValue`],AT={class:`card-action`},jT=[`value`],MT=s({__name:`Global`,setup(e){let t=z(null),n=z(null),i=z(null),s=z(null),c=z({}),l=z(``),u=L(`$showError`),p=L(`$showSuccess`),{t:m}=B(),h=X(),g=W({get(){return i?.value?.tus?.chunkSize?T(i?.value?.tus?.chunkSize):``},set(e){s.value&&clearTimeout(s.value),s.value=window.setTimeout(()=>{i.value&&(i.value.tus.chunkSize=C(e))},1500)}}),_=(e,t=`_`)=>{t===`caps`&&(t=/(?=[A-Z])/);let n=e.split(t);e=``;for(let t=0;t{if(i.value===null)return!1;let e={...i.value,shell:i.value?.shell.join(` `).trim().split(` `).filter(e=>e!==``)??[],commands:{}},t=Object.keys(i.value.commands);for(let n of t){let t=c.value[n];t&&(Array.isArray(t)?e.commands[n]=t:n in c.value&&(e.commands[n]=t.split(` `).filter(e=>e!==``)))}e.shell=l.value.trim().split(` `).filter(e=>e!==``),e.branding.theme!==qw()&&Jw(e.branding.theme);try{await Hh(e),p(m(`settings.settingsUpdated`))}catch(e){u(e)}return!0},C=e=>{let t=e.match(/^(\d+)(\.\d+)?(B|K|KB|M|MB|G|GB|T|TB)?$/i);if(t){let e=parseFloat(t[1].concat(t[2]||``)),n=t[3].toUpperCase();return n.endsWith(`B`)||(n+=`B`),e*({KB:1024,MB:1024**2,GB:1024**3,TB:1024**4}[n]||1)}else return 1024**2},T=e=>{let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r{try{h.loading=!0;let e=await Vh(),t={...e,commands:{}},r=Object.keys(e.commands);for(let n of r)t.commands[n]=e.commands[n],c.value[n]=e.commands[n].join(` `);n.value=e,i.value=t,l.value=t.shell.join(` `)}catch(e){e instanceof Error&&(t.value=e)}finally{h.loading=!1}}),f(()=>{s.value&&clearTimeout(s.value)}),(e,n)=>{let s=w(`vue-number-input`),u=w(`i18n-t`);return t.value?(a(),U(Cx,{key:0,errorCode:t.value.status},null,8,[`errorCode`])):!F(h).loading&&i.value!==null?(a(),o(`div`,Zw,[M(`div`,Qw,[M(`form`,{class:`card`,onSubmit:ie(S,[`prevent`])},[M(`div`,$w,[M(`h2`,null,G(F(m)(`settings.globalSettings`)),1)]),M(`div`,eT,[M(`p`,null,[r(M(`input`,{type:`checkbox`,"onUpdate:modelValue":n[0]||(n[0]=e=>i.value.signup=e)},null,512),[[V,i.value.signup]]),H(` `+G(F(m)(`settings.allowSignup`)),1)]),M(`p`,null,[r(M(`input`,{type:`checkbox`,"onUpdate:modelValue":n[1]||(n[1]=e=>i.value.createUserDir=e)},null,512),[[V,i.value.createUserDir]]),H(` `+G(F(m)(`settings.createUserDir`)),1)]),M(`p`,null,[r(M(`input`,{type:`checkbox`,"onUpdate:modelValue":n[2]||(n[2]=e=>i.value.hideLoginButton=e)},null,512),[[V,i.value.hideLoginButton]]),H(` `+G(F(m)(`settings.hideLoginButton`)),1)]),M(`p`,null,[M(`label`,tT,G(F(m)(`settings.userHomeBasePath`)),1),r(M(`input`,{class:`input input--block`,type:`text`,"onUpdate:modelValue":n[3]||(n[3]=e=>i.value.userHomeBasePath=e)},null,512),[[N,i.value.userHomeBasePath]])]),M(`p`,null,[M(`label`,nT,G(F(m)(`settings.minimumPasswordLength`)),1),x(s,{controls:``,modelValue:i.value.minimumPasswordLength,"onUpdate:modelValue":n[4]||(n[4]=e=>i.value.minimumPasswordLength=e),modelModifiers:{number:!0},id:`minimumPasswordLength`,min:1},null,8,[`modelValue`])]),M(`h3`,null,G(F(m)(`settings.rules`)),1),M(`p`,rT,G(F(m)(`settings.globalRules`)),1),x(GC,{rules:i.value.rules,"onUpdate:rules":n[5]||(n[5]=e=>i.value.rules=e)},null,8,[`rules`]),F(Ge)?(a(),o(`div`,iT,[M(`h3`,null,G(F(m)(`settings.executeOnShell`)),1),M(`p`,aT,G(F(m)(`settings.executeOnShellDescription`)),1),r(M(`input`,{class:`input input--block`,type:`text`,placeholder:`bash -c, cmd /c, ...`,"onUpdate:modelValue":n[6]||(n[6]=e=>l.value=e)},null,512),[[N,l.value]])])):b(``,!0),M(`h3`,null,G(F(m)(`settings.branding`)),1),x(u,{keypath:`settings.brandingHelp`,tag:`p`,class:`small`,scope:`global`},{default:v(()=>[M(`a`,oT,G(F(m)(`settings.documentation`)),1)]),_:1}),M(`p`,null,[r(M(`input`,{type:`checkbox`,"onUpdate:modelValue":n[7]||(n[7]=e=>i.value.branding.disableExternal=e),id:`branding-links`},null,512),[[V,i.value.branding.disableExternal]]),H(` `+G(F(m)(`settings.disableExternalLinks`)),1)]),M(`p`,null,[r(M(`input`,{type:`checkbox`,"onUpdate:modelValue":n[8]||(n[8]=e=>i.value.branding.disableUsedPercentage=e),id:`branding-used-disk`},null,512),[[V,i.value.branding.disableUsedPercentage]]),H(` `+G(F(m)(`settings.disableUsedDiskPercentage`)),1)]),M(`p`,null,[M(`label`,sT,G(F(m)(`settings.themes.title`)),1),x(Uw,{class:`input input--block`,theme:i.value.branding.theme,"onUpdate:theme":n[9]||(n[9]=e=>i.value.branding.theme=e),id:`theme`},null,8,[`theme`])]),M(`p`,null,[M(`label`,cT,G(F(m)(`settings.instanceName`)),1),r(M(`input`,{class:`input input--block`,type:`text`,"onUpdate:modelValue":n[10]||(n[10]=e=>i.value.branding.name=e),id:`branding-name`},null,512),[[N,i.value.branding.name]])]),M(`p`,null,[M(`label`,lT,G(F(m)(`settings.brandingDirectoryPath`)),1),r(M(`input`,{class:`input input--block`,type:`text`,"onUpdate:modelValue":n[11]||(n[11]=e=>i.value.branding.files=e),id:`branding-files`},null,512),[[N,i.value.branding.files]])]),M(`h3`,null,G(F(m)(`settings.tusUploads`)),1),M(`p`,uT,G(F(m)(`settings.tusUploadsHelp`)),1),M(`div`,dT,[M(`p`,null,[M(`label`,fT,G(F(m)(`settings.tusUploadsChunkSize`)),1),r(M(`input`,{class:`input input--block`,type:`text`,"onUpdate:modelValue":n[12]||(n[12]=e=>g.value=e),id:`tus-chunkSize`},null,512),[[N,g.value]])]),M(`p`,null,[M(`label`,pT,G(F(m)(`settings.tusUploadsRetryCount`)),1),x(s,{controls:``,modelValue:i.value.tus.retryCount,"onUpdate:modelValue":n[13]||(n[13]=e=>i.value.tus.retryCount=e),modelModifiers:{number:!0},id:`tus-retryCount`,min:0},null,8,[`modelValue`])])])]),M(`div`,mT,[M(`input`,{class:`button button--flat`,type:`submit`,value:F(m)(`buttons.update`)},null,8,hT)])],32)]),M(`div`,gT,[M(`form`,{class:`card`,onSubmit:ie(S,[`prevent`])},[M(`div`,_T,[M(`h2`,null,G(F(m)(`settings.userDefaults`)),1)]),M(`div`,vT,[M(`p`,yT,G(F(m)(`settings.defaultUserDescription`)),1),x(xw,{isNew:!1,isDefault:!0,user:i.value.defaults,"onUpdate:user":n[14]||(n[14]=e=>i.value.defaults=e)},null,8,[`user`])]),M(`div`,bT,[M(`input`,{class:`button button--flat`,type:`submit`,value:F(m)(`buttons.update`)},null,8,xT)])],32)]),M(`div`,ST,[F(Ge)?(a(),o(`form`,{key:0,class:`card`,onSubmit:ie(S,[`prevent`])},[M(`div`,CT,[M(`h2`,null,G(F(m)(`settings.commandRunner`)),1)]),M(`div`,wT,[x(u,{keypath:`settings.commandRunnerHelp`,tag:`p`,class:`small`,scope:`global`},{default:v(()=>[n[15]||(n[15]=M(`code`,null,`FILE`,-1)),n[16]||(n[16]=M(`code`,null,`SCOPE`,-1)),M(`a`,TT,G(F(m)(`settings.documentation`)),1)]),_:1}),(a(!0),o(P,null,d(i.value.commands,(e,t)=>(a(),o(`div`,{key:t,class:`collapsible`},[M(`input`,{id:t,type:`checkbox`},null,8,ET),M(`label`,{for:t},[M(`p`,null,G(_(t)),1),n[17]||(n[17]=M(`i`,{class:`material-icons`},`arrow_drop_down`,-1))],8,DT),M(`div`,OT,[r(M(`textarea`,{class:`input input--block input--textarea`,"onUpdate:modelValue":e=>c.value[t]=e},null,8,kT),[[N,c.value[t],void 0,{trim:!0}]])])]))),128))]),M(`div`,AT,[M(`input`,{class:`button button--flat`,type:`submit`,value:F(m)(`buttons.update`)},null,8,jT)])],32)):b(``,!0)])])):b(``,!0)}}}),NT=[`value`],PT=[`value`],FT=s({__name:`AceEditorTheme`,props:{aceEditorTheme:{}},emits:[`update:aceEditorTheme`],setup(e,{emit:t}){let n=t,r=e=>{n(`update:aceEditorTheme`,e.target?.value)};return(t,n)=>(a(),o(`select`,{name:`selectAceEditorTheme`,onChange:r,value:e.aceEditorTheme},[(a(!0),o(P,null,d(F(Kw.themes),e=>(a(),o(`option`,{value:e.theme,key:e.theme},G(e.name),9,PT))),128))],40,NT))}}),IT={class:`row`},LT={class:`column`},RT={class:`card-title`},zT={class:`card-content`},BT={class:`card-action`},VT=[`value`],HT={key:0,class:`column`},UT={class:`card-title`},WT={class:`card-content`},GT=[`placeholder`],KT=[`placeholder`],qT=[`placeholder`],JT={class:`card-action`},YT=[`value`],XT=s({__name:`Profile`,setup(e){let t=X(),n=hd(),{t:i}=B(),s=L(`$showSuccess`),c=L(`$showError`),l=z(``),u=z(``),d=z(``),f=z(!1),p=z(!1),m=z(!1),h=z(!1),g=z(!1),_=z(``),v=z(``),S=W(()=>{let e=`input input--block`;return l.value===``&&u.value===``?e:l.value===u.value?`${e} input--green`:`${e} input--red`});y(async()=>(t.loading=!0,n.user===null?!1:(_.value=n.user.locale,p.value=n.user.hideDotfiles,m.value=n.user.singleClick,h.value=n.user.redirectAfterCopyMove,g.value=n.user.dateFormat,v.value=n.user.aceEditorTheme,t.loading=!1,f.value=ze==`json`,!0)));let C=async e=>{if(e.preventDefault(),!(l.value!==u.value||l.value===``||d.value===``||n.user===null))try{let e={...n.user,id:n.user.id,password:l.value};await zh(e,[`password`],d.value),n.updateUser(e),s(i(`settings.passwordUpdated`))}catch(e){c(e)}finally{l.value=u.value=``}},w=async e=>{e.preventDefault();try{if(n.user===null)throw Error(`User is not set!`);let e={...n.user,id:n.user.id,locale:_.value,hideDotfiles:p.value,singleClick:m.value,redirectAfterCopyMove:h.value,dateFormat:g.value,aceEditorTheme:v.value};await zh(e,[`locale`,`hideDotfiles`,`singleClick`,`redirectAfterCopyMove`,`dateFormat`,`aceEditorTheme`]),n.updateUser(e),s(i(`settings.settingsUpdated`))}catch(e){e instanceof Error&&c(e)}};return(e,t)=>(a(),o(`div`,IT,[M(`div`,LT,[M(`form`,{class:`card`,onSubmit:w},[M(`div`,RT,[M(`h2`,null,G(F(i)(`settings.profileSettings`)),1)]),M(`div`,zT,[M(`p`,null,[r(M(`input`,{type:`checkbox`,name:`hideDotfiles`,"onUpdate:modelValue":t[0]||(t[0]=e=>p.value=e)},null,512),[[V,p.value]]),H(` `+G(F(i)(`settings.hideDotfiles`)),1)]),M(`p`,null,[r(M(`input`,{type:`checkbox`,name:`singleClick`,"onUpdate:modelValue":t[1]||(t[1]=e=>m.value=e)},null,512),[[V,m.value]]),H(` `+G(F(i)(`settings.singleClick`)),1)]),M(`p`,null,[r(M(`input`,{type:`checkbox`,name:`redirectAfterCopyMove`,"onUpdate:modelValue":t[2]||(t[2]=e=>h.value=e)},null,512),[[V,h.value]]),H(` `+G(F(i)(`settings.redirectAfterCopyMove`)),1)]),M(`p`,null,[r(M(`input`,{type:`checkbox`,name:`dateFormat`,"onUpdate:modelValue":t[3]||(t[3]=e=>g.value=e)},null,512),[[V,g.value]]),H(` `+G(F(i)(`settings.setDateFormat`)),1)]),M(`h3`,null,G(F(i)(`settings.language`)),1),x(IC,{class:`input input--block`,locale:_.value,"onUpdate:locale":t[4]||(t[4]=e=>_.value=e)},null,8,[`locale`]),M(`h3`,null,G(F(i)(`settings.aceEditorTheme`)),1),x(FT,{class:`input input--block`,aceEditorTheme:v.value,"onUpdate:aceEditorTheme":t[5]||(t[5]=e=>v.value=e),id:`aceTheme`},null,8,[`aceEditorTheme`])]),M(`div`,BT,[M(`input`,{class:`button button--flat`,type:`submit`,name:`submitProfile`,value:F(i)(`buttons.update`)},null,8,VT)])],32)]),F(Re)?b(``,!0):(a(),o(`div`,HT,[F(n).user?.lockPassword?b(``,!0):(a(),o(`form`,{key:0,class:`card`,onSubmit:C},[M(`div`,UT,[M(`h2`,null,G(F(i)(`settings.changePassword`)),1)]),M(`div`,WT,[r(M(`input`,{class:k(S.value),type:`password`,placeholder:F(i)(`settings.newPassword`),"onUpdate:modelValue":t[6]||(t[6]=e=>l.value=e),name:`password`},null,10,GT),[[N,l.value]]),r(M(`input`,{class:k(S.value),type:`password`,placeholder:F(i)(`settings.newPasswordConfirm`),"onUpdate:modelValue":t[7]||(t[7]=e=>u.value=e),name:`passwordConf`},null,10,KT),[[N,u.value]]),f.value?r((a(),o(`input`,{key:0,class:k(S.value),type:`password`,placeholder:F(i)(`settings.currentPassword`),"onUpdate:modelValue":t[8]||(t[8]=e=>d.value=e),name:`current_password`,autocomplete:`current-password`},null,10,qT)),[[N,d.value]]):b(``,!0)]),M(`div`,JT,[M(`input`,{class:`button button--flat`,type:`submit`,name:`submitPassword`,value:F(i)(`buttons.update`)},null,8,YT)])],32))]))]))}}),ZT={key:1,class:`row`},QT={class:`column`},$T={class:`card`},eE={class:`card-title`},tE={key:0,class:`card-content full`},nE={key:0},rE=[`href`],iE={key:0},aE={class:`small`},oE=[`onClick`,`aria-label`,`title`],sE={class:`small`},cE=[`aria-label`,`title`,`onClick`],lE={key:1,class:`message`},uE=s({__name:`Shares`,setup(e){let t=L(`$showError`),n=L(`$showSuccess`),{t:r}=B(),i=X(),s=hd(),c=z(null),l=z([]);y(async()=>{i.loading=!0;try{let e=await jh();if(s.user?.perm.admin){let t=new Map;for(let e of await Ih())t.set(e.id,e.username);for(let n of e)n.userID&&t.has(n.userID)&&(n.username=t.get(n.userID))}l.value=e}catch(e){e instanceof Error&&(c.value=e)}finally{i.loading=!1}});let u=e=>{_y({text:e}).then(()=>{n(r(`success.linkCopied`))},()=>{_y({text:e},{permission:!0}).then(()=>{n(r(`success.linkCopied`))},e=>{t(e)})})},f=async(e,a)=>{e.preventDefault(),i.showHover({prompt:`share-delete`,confirm:()=>{i.closeHovers();try{Nh(a.hash),l.value=l.value.filter(e=>e.hash!==a.hash),n(r(`settings.shareDeleted`))}catch(e){e instanceof Error&&t(e)}}})},p=e=>(0,T_.default)(e*1e3).fromNow(),m=e=>Fh(e);return(e,t)=>c.value?(a(),U(Cx,{key:0,errorCode:c.value.status},null,8,[`errorCode`])):F(i).loading?b(``,!0):(a(),o(`div`,ZT,[M(`div`,QT,[M(`div`,$T,[M(`div`,eE,[M(`h2`,null,G(F(r)(`settings.shareManagement`)),1)]),l.value.length>0?(a(),o(`div`,tE,[M(`table`,null,[M(`tr`,null,[M(`th`,null,G(F(r)(`settings.path`)),1),M(`th`,null,G(F(r)(`settings.shareDuration`)),1),F(s).user?.perm.admin?(a(),o(`th`,nE,G(F(r)(`settings.username`)),1)):b(``,!0),t[0]||(t[0]=M(`th`,null,null,-1)),t[1]||(t[1]=M(`th`,null,null,-1))]),(a(!0),o(P,null,d(l.value,e=>(a(),o(`tr`,{key:e.hash},[M(`td`,null,[M(`a`,{href:m(e),target:`_blank`},G(e.path),9,rE)]),M(`td`,null,[e.expire===0?(a(),o(P,{key:1},[H(G(F(r)(`permanent`)),1)],64)):(a(),o(P,{key:0},[H(G(p(e.expire)),1)],64))]),F(s).user?.perm.admin?(a(),o(`td`,iE,G(e.username),1)):b(``,!0),M(`td`,aE,[M(`button`,{class:`action`,onClick:t=>f(t,e),"aria-label":F(r)(`buttons.delete`),title:F(r)(`buttons.delete`)},[...t[2]||(t[2]=[M(`i`,{class:`material-icons`},`delete`,-1)])],8,oE)]),M(`td`,sE,[M(`button`,{class:`action copy-clipboard`,"aria-label":F(r)(`buttons.copyToClipboard`),title:F(r)(`buttons.copyToClipboard`),onClick:t=>u(m(e))},[...t[3]||(t[3]=[M(`i`,{class:`material-icons`},`content_paste`,-1)])],8,cE)])]))),128))])])):(a(),o(`h2`,lE,[t[4]||(t[4]=M(`i`,{class:`material-icons`},`sentiment_dissatisfied`,-1)),M(`span`,null,G(F(r)(`files.lonely`)),1)]))])])]))}}),dE={Login:`sidebar.login`,Share:`buttons.share`,Files:`files.files`,Settings:`sidebar.settings`,ProfileSettings:`settings.profileSettings`,Shares:`settings.shareManagement`,GlobalSettings:`settings.globalSettings`,Users:`settings.users`,User:`settings.user`,Forbidden:`errors.forbidden`,NotFound:`errors.notFound`,InternalServerError:`errors.internal`},fE=[{path:`/login`,name:`Login`,component:Wd},{path:`/share`,component:px,children:[{path:`:path*`,name:`Share`,component:xC}]},{path:`/files`,component:px,meta:{requiresAuth:!0},children:[{path:`:path*`,name:`Files`,component:pS}]},{path:`/settings`,component:px,meta:{requiresAuth:!0},children:[{path:``,name:`Settings`,component:Rw,redirect:{path:`/settings/profile`},children:[{path:`profile`,name:`ProfileSettings`,component:XT},{path:`shares`,name:`Shares`,component:uE},{path:`global`,name:`GlobalSettings`,component:MT,meta:{requiresAdmin:!0}},{path:`users`,name:`Users`,component:jC,meta:{requiresAdmin:!0}},{path:`users/:id`,name:`User`,component:Mw,meta:{requiresAdmin:!0}}]}]},{path:`/403`,name:`Forbidden`,component:Cx,props:{errorCode:403,showHeader:!0}},{path:`/404`,name:`NotFound`,component:Cx,props:{errorCode:404,showHeader:!0}},{path:`/500`,name:`InternalServerError`,component:Cx,props:{errorCode:500,showHeader:!0}},{path:`/:catchAll(.*)*`,redirect:e=>`/files/${[...e.params.catchAll].join(`/`)}`}];async function pE(){Ve?await xd():await Sd(``,``,``),Ne&&await new Promise(e=>{let t=()=>{window.grecaptcha===void 0?setTimeout(t,100):e()};t()})}var mE=co({history:Da(je),routes:fE});mE.beforeResolve(async(e,t,n)=>{let r=le.global.t(dE[e.name]);document.title=r+` - `+Oe;let i=hd();if(t.name==null)try{await pE()}catch(e){console.error(e)}if(e.path.endsWith(`/login`)&&i.isLoggedIn){n({path:`/files/`});return}if(e.matched.some(e=>e.meta.requiresAuth)){if(!i.isLoggedIn){n({path:`/login`,query:{redirect:e.fullPath}});return}if(e.matched.some(e=>e.meta.requiresAdmin)&&(i.user===null||!i.user.perm.admin)){n({path:`/403`});return}}n()});var hE=s({__name:`App`,setup(e){let{locale:t}=B(),n=z(qw()||Yw());return y(()=>{Jw(n.value),ae(t.value);let e=document.getElementById(`loading`);e?.classList.add(`done`),setTimeout(function(){e?.parentNode?.removeChild(e)},200)}),T(t,e=>{e&&ae(e)}),(e,t)=>{let n=w(`router-view`);return a(),o(`div`,null,[x(n)])}}}),gE={class:`t-container`},_E=Q(s({__name:`CustomToast`,props:{message:{},reportText:{},isReport:{type:Boolean}},setup(e){let t=()=>{window.open(`https://github.com/filebrowser/filebrowser/issues/new/choose`)};return(n,r)=>(a(),o(`div`,gE,[M(`span`,null,G(e.message),1),e.isReport?(a(),o(`button`,{key:0,class:`action`,onClick:ie(t,[`stop`])},G(e.reportText),1)):b(``,!0)]))}}),[[`__scopeId`,`data-v-50e7ff04`]]),vE=t(Ee(),1),yE=t(De(),1),bE=t(we(),1);T_.default.extend(bE.default),T_.default.extend(yE.default),T_.default.extend(vE.default);var xE=ni(mE),SE=oe(hE);SE.component(et.name||`vue-number-input`,et),SE.use(Vt),SE.use(vr,{transition:`Vue-Toastification__bounce`,maxToasts:10,newestOnTop:!0}),SE.use(le),SE.use(xE),SE.use(mE),SE.mixin({mounted(){this.$el.__vue__=this}}),SE.directive(`focus`,{mounted:async e=>{e.focus()}});var CE={position:vn.BOTTOM_CENTER,timeout:4e3,closeOnClick:!0,pauseOnFocusLoss:!0,pauseOnHover:!0,draggable:!0,draggablePercent:.6,showCloseButtonOnHover:!1,hideProgressBar:!1,closeButton:`button`,icon:!0};SE.provide(`$showSuccess`,e=>{_r().success({component:_E,props:{message:e}},{...CE,rtl:ge()})}),SE.provide(`$showError`,(e,t=!0)=>{_r().error({component:_E,props:{message:e.message||e,isReport:!ke&&t,reportText:le.global.t(`buttons.reportIssue`)}},{...CE,timeout:0,rtl:ge()})}),mE.isReady().then(()=>SE.mount(`#app`));export{hd as C,vi as D,yi as E,We as O,kd as S,va as T,dh as _,vx as a,X as b,vy as c,Qh as d,gh as f,yh as g,kh as h,bx as i,w_ as l,Oh as m,qw as n,$ as o,Dh as p,Ww as r,_y as s,Xw as t,Q as u,fh as v,md as w,Pd as x,Z as y};