12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- var __defProp2=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp2=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp2.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__objRest=(e,t)=>{var n={};for(var i in e)__hasOwnProp2.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&__getOwnPropSymbols)for(var i of __getOwnPropSymbols(e))t.indexOf(i)<0&&__propIsEnum.call(e,i)&&(n[i]=e[i]);return n},__publicField=(e,t,n)=>(__defNormalProp(e,"symbol"!=typeof t?t+"":t,n),n),__async=(e,t,n)=>new Promise(((i,o)=>{var r=e=>{try{a(n.next(e))}catch(t){o(t)}},s=e=>{try{a(n.throw(e))}catch(t){o(t)}},a=e=>e.done?i(e.value):Promise.resolve(e.value).then(r,s);a((n=n.apply(e,t)).next())}));const p$1=function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerpolicy&&(t.referrerPolicy=e.referrerpolicy),"use-credentials"===e.crossorigin?t.credentials="include":"anonymous"===e.crossorigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}};function makeMap(e,t){const n=Object.create(null),i=e.split(",");for(let o=0;o<i.length;o++)n[i[o]]=!0;return t?e=>!!n[e.toLowerCase()]:e=>!!n[e]}p$1();const GLOBALS_WHITE_LISTED="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt",isGloballyWhitelisted=makeMap(GLOBALS_WHITE_LISTED),specialBooleanAttrs="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",isSpecialBooleanAttr=makeMap(specialBooleanAttrs);function includeBooleanAttr(e){return!!e||""===e}function normalizeStyle(e){if(isArray$7(e)){const t={};for(let n=0;n<e.length;n++){const i=e[n],o=isString$6(i)?parseStringStyle(i):normalizeStyle(i);if(o)for(const e in o)t[e]=o[e]}return t}return isString$6(e)||isObject$7(e)?e:void 0}const listDelimiterRE=/;(?![^(]*\))/g,propertyDelimiterRE=/:(.+)/;function parseStringStyle(e){const t={};return e.split(listDelimiterRE).forEach((e=>{if(e){const n=e.split(propertyDelimiterRE);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function normalizeClass(e){let t="";if(isString$6(e))t=e;else if(isArray$7(e))for(let n=0;n<e.length;n++){const i=normalizeClass(e[n]);i&&(t+=i+" ")}else if(isObject$7(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function normalizeProps(e){if(!e)return null;let{class:t,style:n}=e;return t&&!isString$6(t)&&(e.class=normalizeClass(t)),n&&(e.style=normalizeStyle(n)),e}function looseCompareArrays(e,t){if(e.length!==t.length)return!1;let n=!0;for(let i=0;n&&i<e.length;i++)n=looseEqual(e[i],t[i]);return n}function looseEqual(e,t){if(e===t)return!0;let n=isDate$2(e),i=isDate$2(t);if(n||i)return!(!n||!i)&&e.getTime()===t.getTime();if(n=isSymbol$2(e),i=isSymbol$2(t),n||i)return e===t;if(n=isArray$7(e),i=isArray$7(t),n||i)return!(!n||!i)&&looseCompareArrays(e,t);if(n=isObject$7(e),i=isObject$7(t),n||i){if(!n||!i)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){const i=e.hasOwnProperty(n),o=t.hasOwnProperty(n);if(i&&!o||!i&&o||!looseEqual(e[n],t[n]))return!1}}return String(e)===String(t)}function looseIndexOf(e,t){return e.findIndex((e=>looseEqual(e,t)))}const toDisplayString$1=e=>isString$6(e)?e:null==e?"":isArray$7(e)||isObject$7(e)&&(e.toString===objectToString$2||!isFunction$5(e.toString))?JSON.stringify(e,replacer,2):String(e),replacer=(e,t)=>t&&t.__v_isRef?replacer(e,t.value):isMap$2(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n])=>(e[`${t} =>`]=n,e)),{})}:isSet$2(t)?{[`Set(${t.size})`]:[...t.values()]}:!isObject$7(t)||isArray$7(t)||isPlainObject$4(t)?t:String(t),EMPTY_OBJ={},EMPTY_ARR=[],NOOP=()=>{},NO=()=>!1,onRE$1=/^on[^a-z]/,isOn$1=e=>onRE$1.test(e),isModelListener=e=>e.startsWith("onUpdate:"),extend$1=Object.assign,remove=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},hasOwnProperty$k=Object.prototype.hasOwnProperty,hasOwn$3=(e,t)=>hasOwnProperty$k.call(e,t),isArray$7=Array.isArray,isMap$2=e=>"[object Map]"===toTypeString$1(e),isSet$2=e=>"[object Set]"===toTypeString$1(e),isDate$2=e=>"[object Date]"===toTypeString$1(e),isFunction$5=e=>"function"==typeof e,isString$6=e=>"string"==typeof e,isSymbol$2=e=>"symbol"==typeof e,isObject$7=e=>null!==e&&"object"==typeof e,isPromise$1=e=>isObject$7(e)&&isFunction$5(e.then)&&isFunction$5(e.catch),objectToString$2=Object.prototype.toString,toTypeString$1=e=>objectToString$2.call(e),toRawType=e=>toTypeString$1(e).slice(8,-1),isPlainObject$4=e=>"[object Object]"===toTypeString$1(e),isIntegerKey=e=>isString$6(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,isReservedProp=makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),cacheStringFunction$1=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},camelizeRE$1=/-(\w)/g,camelize$1=cacheStringFunction$1((e=>e.replace(camelizeRE$1,((e,t)=>t?t.toUpperCase():"")))),hyphenateRE$1=/\B([A-Z])/g,hyphenate$1=cacheStringFunction$1((e=>e.replace(hyphenateRE$1,"-$1").toLowerCase())),capitalize=cacheStringFunction$1((e=>e.charAt(0).toUpperCase()+e.slice(1))),toHandlerKey=cacheStringFunction$1((e=>e?`on${capitalize(e)}`:"")),hasChanged=(e,t)=>!Object.is(e,t),invokeArrayFns=(e,t)=>{for(let n=0;n<e.length;n++)e[n](t)},def=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},toNumber$1=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let _globalThis$1;const getGlobalThis$1=()=>_globalThis$1||(_globalThis$1="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});let activeEffectScope;class EffectScope{constructor(e=!1){this.active=!0,this.effects=[],this.cleanups=[],!e&&activeEffectScope&&(this.parent=activeEffectScope,this.index=(activeEffectScope.scopes||(activeEffectScope.scopes=[])).push(this)-1)}run(e){if(this.active){const t=activeEffectScope;try{return activeEffectScope=this,e()}finally{activeEffectScope=t}}}on(){activeEffectScope=this}off(){activeEffectScope=this.parent}stop(e){if(this.active){let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);if(this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.active=!1}}}function effectScope(e){return new EffectScope(e)}function recordEffectScope(e,t=activeEffectScope){t&&t.active&&t.effects.push(e)}function getCurrentScope(){return activeEffectScope}function onScopeDispose(e){activeEffectScope&&activeEffectScope.cleanups.push(e)}const createDep=e=>{const t=new Set(e);return t.w=0,t.n=0,t},wasTracked=e=>(e.w&trackOpBit)>0,newTracked=e=>(e.n&trackOpBit)>0,initDepMarkers=({deps:e})=>{if(e.length)for(let t=0;t<e.length;t++)e[t].w|=trackOpBit},finalizeDepMarkers=e=>{const{deps:t}=e;if(t.length){let n=0;for(let i=0;i<t.length;i++){const o=t[i];wasTracked(o)&&!newTracked(o)?o.delete(e):t[n++]=o,o.w&=~trackOpBit,o.n&=~trackOpBit}t.length=n}},targetMap=new WeakMap;let effectTrackDepth=0,trackOpBit=1;const maxMarkerBits=30;let activeEffect;const ITERATE_KEY=Symbol(""),MAP_KEY_ITERATE_KEY=Symbol("");class ReactiveEffect{constructor(e,t=null,n){this.fn=e,this.scheduler=t,this.active=!0,this.deps=[],this.parent=void 0,recordEffectScope(this,n)}run(){if(!this.active)return this.fn();let e=activeEffect,t=shouldTrack;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=activeEffect,activeEffect=this,shouldTrack=!0,trackOpBit=1<<++effectTrackDepth,effectTrackDepth<=maxMarkerBits?initDepMarkers(this):cleanupEffect(this),this.fn()}finally{effectTrackDepth<=maxMarkerBits&&finalizeDepMarkers(this),trackOpBit=1<<--effectTrackDepth,activeEffect=this.parent,shouldTrack=t,this.parent=void 0,this.deferStop&&this.stop()}}stop(){activeEffect===this?this.deferStop=!0:this.active&&(cleanupEffect(this),this.onStop&&this.onStop(),this.active=!1)}}function cleanupEffect(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}function effect(e,t){e.effect&&(e=e.effect.fn);const n=new ReactiveEffect(e);t&&(extend$1(n,t),t.scope&&recordEffectScope(n,t.scope)),t&&t.lazy||n.run();const i=n.run.bind(n);return i.effect=n,i}function stop(e){e.effect.stop()}let shouldTrack=!0;const trackStack=[];function pauseTracking(){trackStack.push(shouldTrack),shouldTrack=!1}function resetTracking(){const e=trackStack.pop();shouldTrack=void 0===e||e}function track(e,t,n){if(shouldTrack&&activeEffect){let t=targetMap.get(e);t||targetMap.set(e,t=new Map);let i=t.get(n);i||t.set(n,i=createDep()),trackEffects(i)}}function trackEffects(e,t){let n=!1;effectTrackDepth<=maxMarkerBits?newTracked(e)||(e.n|=trackOpBit,n=!wasTracked(e)):n=!e.has(activeEffect),n&&(e.add(activeEffect),activeEffect.deps.push(e))}function trigger$1(e,t,n,i,o,r){const s=targetMap.get(e);if(!s)return;let a=[];if("clear"===t)a=[...s.values()];else if("length"===n&&isArray$7(e))s.forEach(((e,t)=>{("length"===t||t>=i)&&a.push(e)}));else switch(void 0!==n&&a.push(s.get(n)),t){case"add":isArray$7(e)?isIntegerKey(n)&&a.push(s.get("length")):(a.push(s.get(ITERATE_KEY)),isMap$2(e)&&a.push(s.get(MAP_KEY_ITERATE_KEY)));break;case"delete":isArray$7(e)||(a.push(s.get(ITERATE_KEY)),isMap$2(e)&&a.push(s.get(MAP_KEY_ITERATE_KEY)));break;case"set":isMap$2(e)&&a.push(s.get(ITERATE_KEY))}if(1===a.length)a[0]&&triggerEffects(a[0]);else{const e=[];for(const t of a)t&&e.push(...t);triggerEffects(createDep(e))}}function triggerEffects(e,t){const n=isArray$7(e)?e:[...e];for(const i of n)i.computed&&triggerEffect(i);for(const i of n)i.computed||triggerEffect(i)}function triggerEffect(e,t){(e!==activeEffect||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}const isNonTrackableKeys=makeMap("__proto__,__v_isRef,__isVue"),builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(isSymbol$2)),get$3=createGetter(),shallowGet=createGetter(!1,!0),readonlyGet=createGetter(!0),shallowReadonlyGet=createGetter(!0,!0),arrayInstrumentations=createArrayInstrumentations();function createArrayInstrumentations(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=toRaw(this);for(let t=0,o=this.length;t<o;t++)track(n,"get",t+"");const i=n[t](...e);return-1===i||!1===i?n[t](...e.map(toRaw)):i}})),["push","pop","shift","unshift","splice"].forEach((t=>{e[t]=function(...e){pauseTracking();const n=toRaw(this)[t].apply(this,e);return resetTracking(),n}})),e}function createGetter(e=!1,t=!1){return function(n,i,o){if("__v_isReactive"===i)return!e;if("__v_isReadonly"===i)return e;if("__v_isShallow"===i)return t;if("__v_raw"===i&&o===(e?t?shallowReadonlyMap:readonlyMap:t?shallowReactiveMap:reactiveMap).get(n))return n;const r=isArray$7(n);if(!e&&r&&hasOwn$3(arrayInstrumentations,i))return Reflect.get(arrayInstrumentations,i,o);const s=Reflect.get(n,i,o);return(isSymbol$2(i)?builtInSymbols.has(i):isNonTrackableKeys(i))?s:(e||track(n,"get",i),t?s:isRef(s)?r&&isIntegerKey(i)?s:s.value:isObject$7(s)?e?readonly(s):reactive(s):s)}}const set$1=createSetter(),shallowSet=createSetter(!0);function createSetter(e=!1){return function(t,n,i,o){let r=t[n];if(isReadonly(r)&&isRef(r)&&!isRef(i))return!1;if(!e&&!isReadonly(i)&&(isShallow(i)||(i=toRaw(i),r=toRaw(r)),!isArray$7(t)&&isRef(r)&&!isRef(i)))return r.value=i,!0;const s=isArray$7(t)&&isIntegerKey(n)?Number(n)<t.length:hasOwn$3(t,n),a=Reflect.set(t,n,i,o);return t===toRaw(o)&&(s?hasChanged(i,r)&&trigger$1(t,"set",n,i):trigger$1(t,"add",n,i)),a}}function deleteProperty(e,t){const n=hasOwn$3(e,t);e[t];const i=Reflect.deleteProperty(e,t);return i&&n&&trigger$1(e,"delete",t,void 0),i}function has(e,t){const n=Reflect.has(e,t);return isSymbol$2(t)&&builtInSymbols.has(t)||track(e,"has",t),n}function ownKeys$2(e){return track(e,"iterate",isArray$7(e)?"length":ITERATE_KEY),Reflect.ownKeys(e)}const mutableHandlers={get:get$3,set:set$1,deleteProperty:deleteProperty,has:has,ownKeys:ownKeys$2},readonlyHandlers={get:readonlyGet,set:(e,t)=>!0,deleteProperty:(e,t)=>!0},shallowReactiveHandlers=extend$1({},mutableHandlers,{get:shallowGet,set:shallowSet}),shallowReadonlyHandlers=extend$1({},readonlyHandlers,{get:shallowReadonlyGet}),toShallow=e=>e,getProto=e=>Reflect.getPrototypeOf(e);function get$1$1(e,t,n=!1,i=!1){const o=toRaw(e=e.__v_raw),r=toRaw(t);n||(t!==r&&track(o,"get",t),track(o,"get",r));const{has:s}=getProto(o),a=i?toShallow:n?toReadonly:toReactive$1;return s.call(o,t)?a(e.get(t)):s.call(o,r)?a(e.get(r)):void(e!==o&&e.get(t))}function has$1(e,t=!1){const n=this.__v_raw,i=toRaw(n),o=toRaw(e);return t||(e!==o&&track(i,"has",e),track(i,"has",o)),e===o?n.has(e):n.has(e)||n.has(o)}function size$1(e,t=!1){return e=e.__v_raw,!t&&track(toRaw(e),"iterate",ITERATE_KEY),Reflect.get(e,"size",e)}function add(e){e=toRaw(e);const t=toRaw(this);return getProto(t).has.call(t,e)||(t.add(e),trigger$1(t,"add",e,e)),this}function set$1$1(e,t){t=toRaw(t);const n=toRaw(this),{has:i,get:o}=getProto(n);let r=i.call(n,e);r||(e=toRaw(e),r=i.call(n,e));const s=o.call(n,e);return n.set(e,t),r?hasChanged(t,s)&&trigger$1(n,"set",e,t):trigger$1(n,"add",e,t),this}function deleteEntry(e){const t=toRaw(this),{has:n,get:i}=getProto(t);let o=n.call(t,e);o||(e=toRaw(e),o=n.call(t,e)),i&&i.call(t,e);const r=t.delete(e);return o&&trigger$1(t,"delete",e,void 0),r}function clear(){const e=toRaw(this),t=0!==e.size,n=e.clear();return t&&trigger$1(e,"clear",void 0,void 0),n}function createForEach(e,t){return function(n,i){const o=this,r=o.__v_raw,s=toRaw(r),a=t?toShallow:e?toReadonly:toReactive$1;return!e&&track(s,"iterate",ITERATE_KEY),r.forEach(((e,t)=>n.call(i,a(e),a(t),o)))}}function createIterableMethod(e,t,n){return function(...i){const o=this.__v_raw,r=toRaw(o),s=isMap$2(r),a="entries"===e||e===Symbol.iterator&&s,l="keys"===e&&s,c=o[e](...i),d=n?toShallow:t?toReadonly:toReactive$1;return!t&&track(r,"iterate",l?MAP_KEY_ITERATE_KEY:ITERATE_KEY),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[d(e[0]),d(e[1])]:d(e),done:t}},[Symbol.iterator](){return this}}}}function createReadonlyMethod(e){return function(...t){return"delete"!==e&&this}}function createInstrumentations(){const e={get(e){return get$1$1(this,e)},get size(){return size$1(this)},has:has$1,add:add,set:set$1$1,delete:deleteEntry,clear:clear,forEach:createForEach(!1,!1)},t={get(e){return get$1$1(this,e,!1,!0)},get size(){return size$1(this)},has:has$1,add:add,set:set$1$1,delete:deleteEntry,clear:clear,forEach:createForEach(!1,!0)},n={get(e){return get$1$1(this,e,!0)},get size(){return size$1(this,!0)},has(e){return has$1.call(this,e,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!1)},i={get(e){return get$1$1(this,e,!0,!0)},get size(){return size$1(this,!0)},has(e){return has$1.call(this,e,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((o=>{e[o]=createIterableMethod(o,!1,!1),n[o]=createIterableMethod(o,!0,!1),t[o]=createIterableMethod(o,!1,!0),i[o]=createIterableMethod(o,!0,!0)})),[e,n,t,i]}const[mutableInstrumentations,readonlyInstrumentations,shallowInstrumentations,shallowReadonlyInstrumentations]=createInstrumentations();function createInstrumentationGetter(e,t){const n=t?e?shallowReadonlyInstrumentations:shallowInstrumentations:e?readonlyInstrumentations:mutableInstrumentations;return(t,i,o)=>"__v_isReactive"===i?!e:"__v_isReadonly"===i?e:"__v_raw"===i?t:Reflect.get(hasOwn$3(n,i)&&i in t?n:t,i,o)}const mutableCollectionHandlers={get:createInstrumentationGetter(!1,!1)},shallowCollectionHandlers={get:createInstrumentationGetter(!1,!0)},readonlyCollectionHandlers={get:createInstrumentationGetter(!0,!1)},shallowReadonlyCollectionHandlers={get:createInstrumentationGetter(!0,!0)},reactiveMap=new WeakMap,shallowReactiveMap=new WeakMap,readonlyMap=new WeakMap,shallowReadonlyMap=new WeakMap;function targetTypeMap(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function getTargetType(e){return e.__v_skip||!Object.isExtensible(e)?0:targetTypeMap(toRawType(e))}function reactive(e){return isReadonly(e)?e:createReactiveObject(e,!1,mutableHandlers,mutableCollectionHandlers,reactiveMap)}function shallowReactive(e){return createReactiveObject(e,!1,shallowReactiveHandlers,shallowCollectionHandlers,shallowReactiveMap)}function readonly(e){return createReactiveObject(e,!0,readonlyHandlers,readonlyCollectionHandlers,readonlyMap)}function shallowReadonly(e){return createReactiveObject(e,!0,shallowReadonlyHandlers,shallowReadonlyCollectionHandlers,shallowReadonlyMap)}function createReactiveObject(e,t,n,i,o){if(!isObject$7(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const r=o.get(e);if(r)return r;const s=getTargetType(e);if(0===s)return e;const a=new Proxy(e,2===s?i:n);return o.set(e,a),a}function isReactive(e){return isReadonly(e)?isReactive(e.__v_raw):!(!e||!e.__v_isReactive)}function isReadonly(e){return!(!e||!e.__v_isReadonly)}function isShallow(e){return!(!e||!e.__v_isShallow)}function isProxy(e){return isReactive(e)||isReadonly(e)}function toRaw(e){const t=e&&e.__v_raw;return t?toRaw(t):e}function markRaw(e){return def(e,"__v_skip",!0),e}const toReactive$1=e=>isObject$7(e)?reactive(e):e,toReadonly=e=>isObject$7(e)?readonly(e):e;function trackRefValue(e){shouldTrack&&activeEffect&&trackEffects((e=toRaw(e)).dep||(e.dep=createDep()))}function triggerRefValue(e,t){(e=toRaw(e)).dep&&triggerEffects(e.dep)}function isRef(e){return!(!e||!0!==e.__v_isRef)}function ref(e){return createRef$1(e,!1)}function shallowRef(e){return createRef$1(e,!0)}function createRef$1(e,t){return isRef(e)?e:new RefImpl(e,t)}class RefImpl{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:toRaw(e),this._value=t?e:toReactive$1(e)}get value(){return trackRefValue(this),this._value}set value(e){e=this.__v_isShallow?e:toRaw(e),hasChanged(e,this._rawValue)&&(this._rawValue=e,this._value=this.__v_isShallow?e:toReactive$1(e),triggerRefValue(this))}}function triggerRef(e){triggerRefValue(e)}function unref(e){return isRef(e)?e.value:e}const shallowUnwrapHandlers={get:(e,t,n)=>unref(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const o=e[t];return isRef(o)&&!isRef(n)?(o.value=n,!0):Reflect.set(e,t,n,i)}};function proxyRefs(e){return isReactive(e)?e:new Proxy(e,shallowUnwrapHandlers)}class CustomRefImpl{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:t,set:n}=e((()=>trackRefValue(this)),(()=>triggerRefValue(this)));this._get=t,this._set=n}get value(){return this._get()}set value(e){this._set(e)}}function customRef(e){return new CustomRefImpl(e)}function toRefs(e){const t=isArray$7(e)?new Array(e.length):{};for(const n in e)t[n]=toRef(e,n);return t}class ObjectRefImpl{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}}function toRef(e,t,n){const i=e[t];return isRef(i)?i:new ObjectRefImpl(e,t,n)}class ComputedRefImpl{constructor(e,t,n,i){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this._dirty=!0,this.effect=new ReactiveEffect(e,(()=>{this._dirty||(this._dirty=!0,triggerRefValue(this))})),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=n}get value(){const e=toRaw(this);return trackRefValue(e),!e._dirty&&e._cacheable||(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function computed$1(e,t,n=!1){let i,o;const r=isFunction$5(e);r?(i=e,o=NOOP):(i=e.get,o=e.set);return new ComputedRefImpl(i,o,r||!o,n)}const stack=[];function warn$1(e,...t){pauseTracking();const n=stack.length?stack[stack.length-1].component:null,i=n&&n.appContext.config.warnHandler,o=getComponentTrace();if(i)callWithErrorHandling(i,n,11,[e+t.join(""),n&&n.proxy,o.map((({vnode:e})=>`at <${formatComponentName(n,e.type)}>`)).join("\n"),o]);else{const n=[`[Vue warn]: ${e}`,...t];o.length&&n.push("\n",...formatTrace(o))}resetTracking()}function getComponentTrace(){let e=stack[stack.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const i=e.component&&e.component.parent;e=i&&i.vnode}return t}function formatTrace(e){const t=[];return e.forEach(((e,n)=>{t.push(...0===n?[]:["\n"],...formatTraceEntry(e))})),t}function formatTraceEntry({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",i=!!e.component&&null==e.component.parent,o=` at <${formatComponentName(e.component,e.type,i)}`,r=">"+n;return e.props?[o,...formatProps(e.props),r]:[o+r]}function formatProps(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach((n=>{t.push(...formatProp(n,e[n]))})),n.length>3&&t.push(" ..."),t}function formatProp(e,t,n){return isString$6(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):"number"==typeof t||"boolean"==typeof t||null==t?n?t:[`${e}=${t}`]:isRef(t)?(t=formatProp(e,toRaw(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):isFunction$5(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=toRaw(t),n?t:[`${e}=`,t])}function callWithErrorHandling(e,t,n,i){let o;try{o=i?e(...i):e()}catch(r){handleError(r,t,n)}return o}function callWithAsyncErrorHandling(e,t,n,i){if(isFunction$5(e)){const o=callWithErrorHandling(e,t,n,i);return o&&isPromise$1(o)&&o.catch((e=>{handleError(e,t,n)})),o}const o=[];for(let r=0;r<e.length;r++)o.push(callWithAsyncErrorHandling(e[r],t,n,i));return o}function handleError(e,t,n,i=!0){const o=t?t.vnode:null;if(t){let i=t.parent;const o=t.proxy,r=n;for(;i;){const t=i.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,o,r))return;i=i.parent}const s=t.appContext.config.errorHandler;if(s)return void callWithErrorHandling(s,null,10,[e,o,r])}logError(e,n,o,i)}function logError(e,t,n,i=!0){}let isFlushing=!1,isFlushPending=!1;const queue=[];let flushIndex=0;const pendingPreFlushCbs=[];let activePreFlushCbs=null,preFlushIndex=0;const pendingPostFlushCbs=[];let activePostFlushCbs=null,postFlushIndex=0;const resolvedPromise=Promise.resolve();let currentFlushPromise=null,currentPreFlushParentJob=null;function nextTick(e){const t=currentFlushPromise||resolvedPromise;return e?t.then(this?e.bind(this):e):t}function findInsertionIndex(e){let t=flushIndex+1,n=queue.length;for(;t<n;){const i=t+n>>>1;getId(queue[i])<e?t=i+1:n=i}return t}function queueJob(e){queue.length&&queue.includes(e,isFlushing&&e.allowRecurse?flushIndex+1:flushIndex)||e===currentPreFlushParentJob||(null==e.id?queue.push(e):queue.splice(findInsertionIndex(e.id),0,e),queueFlush())}function queueFlush(){isFlushing||isFlushPending||(isFlushPending=!0,currentFlushPromise=resolvedPromise.then(flushJobs))}function invalidateJob(e){const t=queue.indexOf(e);t>flushIndex&&queue.splice(t,1)}function queueCb(e,t,n,i){isArray$7(e)?n.push(...e):t&&t.includes(e,e.allowRecurse?i+1:i)||n.push(e),queueFlush()}function queuePreFlushCb(e){queueCb(e,activePreFlushCbs,pendingPreFlushCbs,preFlushIndex)}function queuePostFlushCb(e){queueCb(e,activePostFlushCbs,pendingPostFlushCbs,postFlushIndex)}function flushPreFlushCbs(e,t=null){if(pendingPreFlushCbs.length){for(currentPreFlushParentJob=t,activePreFlushCbs=[...new Set(pendingPreFlushCbs)],pendingPreFlushCbs.length=0,preFlushIndex=0;preFlushIndex<activePreFlushCbs.length;preFlushIndex++)activePreFlushCbs[preFlushIndex]();activePreFlushCbs=null,preFlushIndex=0,currentPreFlushParentJob=null,flushPreFlushCbs(e,t)}}function flushPostFlushCbs(e){if(flushPreFlushCbs(),pendingPostFlushCbs.length){const e=[...new Set(pendingPostFlushCbs)];if(pendingPostFlushCbs.length=0,activePostFlushCbs)return void activePostFlushCbs.push(...e);for(activePostFlushCbs=e,activePostFlushCbs.sort(((e,t)=>getId(e)-getId(t))),postFlushIndex=0;postFlushIndex<activePostFlushCbs.length;postFlushIndex++)activePostFlushCbs[postFlushIndex]();activePostFlushCbs=null,postFlushIndex=0}}const getId=e=>null==e.id?Infinity:e.id;function flushJobs(e){isFlushPending=!1,isFlushing=!0,flushPreFlushCbs(e),queue.sort(((e,t)=>getId(e)-getId(t)));try{for(flushIndex=0;flushIndex<queue.length;flushIndex++){const e=queue[flushIndex];e&&!1!==e.active&&callWithErrorHandling(e,null,14)}}finally{flushIndex=0,queue.length=0,flushPostFlushCbs(),isFlushing=!1,currentFlushPromise=null,(queue.length||pendingPreFlushCbs.length||pendingPostFlushCbs.length)&&flushJobs(e)}}let devtools$1,buffer=[];function setDevtoolsHook(e,t){var n,i;if(devtools$1=e,devtools$1)devtools$1.enabled=!0,buffer.forEach((({event:e,args:t})=>devtools$1.emit(e,...t))),buffer=[];else if("undefined"!=typeof window&&window.HTMLElement&&!(null===(i=null===(n=window.navigator)||void 0===n?void 0:n.userAgent)||void 0===i?void 0:i.includes("jsdom"))){(t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push((e=>{setDevtoolsHook(e,t)})),setTimeout((()=>{devtools$1||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,buffer=[])}),3e3)}else buffer=[]}function emit$1(e,t,...n){if(e.isUnmounted)return;const i=e.vnode.props||EMPTY_OBJ;let o=n;const r=t.startsWith("update:"),s=r&&t.slice(7);if(s&&s in i){const e=`${"modelValue"===s?"model":s}Modifiers`,{number:t,trim:r}=i[e]||EMPTY_OBJ;r&&(o=n.map((e=>e.trim()))),t&&(o=n.map(toNumber$1))}let a,l=i[a=toHandlerKey(t)]||i[a=toHandlerKey(camelize$1(t))];!l&&r&&(l=i[a=toHandlerKey(hyphenate$1(t))]),l&&callWithAsyncErrorHandling(l,e,6,o);const c=i[a+"Once"];if(c){if(e.emitted){if(e.emitted[a])return}else e.emitted={};e.emitted[a]=!0,callWithAsyncErrorHandling(c,e,6,o)}}function normalizeEmitsOptions(e,t,n=!1){const i=t.emitsCache,o=i.get(e);if(void 0!==o)return o;const r=e.emits;let s={},a=!1;if(!isFunction$5(e)){const i=e=>{const n=normalizeEmitsOptions(e,t,!0);n&&(a=!0,extend$1(s,n))};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}return r||a?(isArray$7(r)?r.forEach((e=>s[e]=null)):extend$1(s,r),i.set(e,s),s):(i.set(e,null),null)}function isEmitListener(e,t){return!(!e||!isOn$1(t))&&(t=t.slice(2).replace(/Once$/,""),hasOwn$3(e,t[0].toLowerCase()+t.slice(1))||hasOwn$3(e,hyphenate$1(t))||hasOwn$3(e,t))}let currentRenderingInstance=null,currentScopeId=null;function setCurrentRenderingInstance(e){const t=currentRenderingInstance;return currentRenderingInstance=e,currentScopeId=e&&e.type.__scopeId||null,t}function pushScopeId(e){currentScopeId=e}function popScopeId(){currentScopeId=null}const withScopeId=e=>withCtx;function withCtx(e,t=currentRenderingInstance,n){if(!t)return e;if(e._n)return e;const i=(...n)=>{i._d&&setBlockTracking(-1);const o=setCurrentRenderingInstance(t),r=e(...n);return setCurrentRenderingInstance(o),i._d&&setBlockTracking(1),r};return i._n=!0,i._c=!0,i._d=!0,i}function markAttrsAccessed(){}function renderComponentRoot(e){const{type:t,vnode:n,proxy:i,withProxy:o,props:r,propsOptions:[s],slots:a,attrs:l,emit:c,render:d,renderCache:u,data:h,setupState:g,ctx:p,inheritAttrs:f}=e;let m,v;const _=setCurrentRenderingInstance(e);try{if(4&n.shapeFlag){const e=o||i;m=normalizeVNode(d.call(e,e,u,r,g,h,p)),v=l}else{const e=t;0,m=normalizeVNode(e.length>1?e(r,{attrs:l,slots:a,emit:c}):e(r,null)),v=t.props?l:getFunctionalFallthrough(l)}}catch(b){blockStack.length=0,handleError(b,e,1),m=createVNode(Comment)}let C=m;if(v&&!1!==f){const e=Object.keys(v),{shapeFlag:t}=C;e.length&&7&t&&(s&&e.some(isModelListener)&&(v=filterModelListeners(v,s)),C=cloneVNode(C,v))}return n.dirs&&(C=cloneVNode(C),C.dirs=C.dirs?C.dirs.concat(n.dirs):n.dirs),n.transition&&(C.transition=n.transition),m=C,setCurrentRenderingInstance(_),m}function filterSingleRoot(e){let t;for(let n=0;n<e.length;n++){const i=e[n];if(!isVNode(i))return;if(i.type!==Comment||"v-if"===i.children){if(t)return;t=i}}return t}const getFunctionalFallthrough=e=>{let t;for(const n in e)("class"===n||"style"===n||isOn$1(n))&&((t||(t={}))[n]=e[n]);return t},filterModelListeners=(e,t)=>{const n={};for(const i in e)isModelListener(i)&&i.slice(9)in t||(n[i]=e[i]);return n};function shouldUpdateComponent(e,t,n){const{props:i,children:o,component:r}=e,{props:s,children:a,patchFlag:l}=t,c=r.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!o&&!a||a&&a.$stable)||i!==s&&(i?!s||hasPropsChanged(i,s,c):!!s);if(1024&l)return!0;if(16&l)return i?hasPropsChanged(i,s,c):!!s;if(8&l){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(s[n]!==i[n]&&!isEmitListener(c,n))return!0}}return!1}function hasPropsChanged(e,t,n){const i=Object.keys(t);if(i.length!==Object.keys(e).length)return!0;for(let o=0;o<i.length;o++){const r=i[o];if(t[r]!==e[r]&&!isEmitListener(n,r))return!0}return!1}function updateHOCHostEl({vnode:e,parent:t},n){for(;t&&t.subTree===e;)(e=t.vnode).el=n,t=t.parent}const isSuspense=e=>e.__isSuspense,SuspenseImpl={name:"Suspense",__isSuspense:!0,process(e,t,n,i,o,r,s,a,l,c){null==e?mountSuspense(t,n,i,o,r,s,a,l,c):patchSuspense(e,t,n,i,o,s,a,l,c)},hydrate:hydrateSuspense,create:createSuspenseBoundary,normalize:normalizeSuspenseChildren},Suspense=SuspenseImpl;function triggerEvent(e,t){const n=e.props&&e.props[t];isFunction$5(n)&&n()}function mountSuspense(e,t,n,i,o,r,s,a,l){const{p:c,o:{createElement:d}}=l,u=d("div"),h=e.suspense=createSuspenseBoundary(e,o,i,t,u,n,r,s,a,l);c(null,h.pendingBranch=e.ssContent,u,null,i,h,r,s),h.deps>0?(triggerEvent(e,"onPending"),triggerEvent(e,"onFallback"),c(null,e.ssFallback,t,n,i,null,r,s),setActiveBranch(h,e.ssFallback)):h.resolve()}function patchSuspense(e,t,n,i,o,r,s,a,{p:l,um:c,o:{createElement:d}}){const u=t.suspense=e.suspense;u.vnode=t,t.el=e.el;const h=t.ssContent,g=t.ssFallback,{activeBranch:p,pendingBranch:f,isInFallback:m,isHydrating:v}=u;if(f)u.pendingBranch=h,isSameVNodeType(h,f)?(l(f,h,u.hiddenContainer,null,o,u,r,s,a),u.deps<=0?u.resolve():m&&(l(p,g,n,i,o,null,r,s,a),setActiveBranch(u,g))):(u.pendingId++,v?(u.isHydrating=!1,u.activeBranch=f):c(f,o,u),u.deps=0,u.effects.length=0,u.hiddenContainer=d("div"),m?(l(null,h,u.hiddenContainer,null,o,u,r,s,a),u.deps<=0?u.resolve():(l(p,g,n,i,o,null,r,s,a),setActiveBranch(u,g))):p&&isSameVNodeType(h,p)?(l(p,h,n,i,o,u,r,s,a),u.resolve(!0)):(l(null,h,u.hiddenContainer,null,o,u,r,s,a),u.deps<=0&&u.resolve()));else if(p&&isSameVNodeType(h,p))l(p,h,n,i,o,u,r,s,a),setActiveBranch(u,h);else if(triggerEvent(t,"onPending"),u.pendingBranch=h,u.pendingId++,l(null,h,u.hiddenContainer,null,o,u,r,s,a),u.deps<=0)u.resolve();else{const{timeout:e,pendingId:t}=u;e>0?setTimeout((()=>{u.pendingId===t&&u.fallback(g)}),e):0===e&&u.fallback(g)}}function createSuspenseBoundary(e,t,n,i,o,r,s,a,l,c,d=!1){const{p:u,m:h,um:g,n:p,o:{parentNode:f,remove:m}}=c,v=toNumber$1(e.props&&e.props.timeout),_={vnode:e,parent:t,parentComponent:n,isSVG:s,container:i,hiddenContainer:o,anchor:r,deps:0,pendingId:0,timeout:"number"==typeof v?v:-1,activeBranch:null,pendingBranch:null,isInFallback:!0,isHydrating:d,isUnmounted:!1,effects:[],resolve(e=!1){const{vnode:t,activeBranch:n,pendingBranch:i,pendingId:o,effects:r,parentComponent:s,container:a}=_;if(_.isHydrating)_.isHydrating=!1;else if(!e){const e=n&&i.transition&&"out-in"===i.transition.mode;e&&(n.transition.afterLeave=()=>{o===_.pendingId&&h(i,a,t,0)});let{anchor:t}=_;n&&(t=p(n),g(n,s,_,!0)),e||h(i,a,t,0)}setActiveBranch(_,i),_.pendingBranch=null,_.isInFallback=!1;let l=_.parent,c=!1;for(;l;){if(l.pendingBranch){l.effects.push(...r),c=!0;break}l=l.parent}c||queuePostFlushCb(r),_.effects=[],triggerEvent(t,"onResolve")},fallback(e){if(!_.pendingBranch)return;const{vnode:t,activeBranch:n,parentComponent:i,container:o,isSVG:r}=_;triggerEvent(t,"onFallback");const s=p(n),c=()=>{_.isInFallback&&(u(null,e,o,s,i,null,r,a,l),setActiveBranch(_,e))},d=e.transition&&"out-in"===e.transition.mode;d&&(n.transition.afterLeave=c),_.isInFallback=!0,g(n,i,null,!0),d||c()},move(e,t,n){_.activeBranch&&h(_.activeBranch,e,t,n),_.container=e},next:()=>_.activeBranch&&p(_.activeBranch),registerDep(e,t){const n=!!_.pendingBranch;n&&_.deps++;const i=e.vnode.el;e.asyncDep.catch((t=>{handleError(t,e,0)})).then((o=>{if(e.isUnmounted||_.isUnmounted||_.pendingId!==e.suspenseId)return;e.asyncResolved=!0;const{vnode:r}=e;handleSetupResult(e,o,!1),i&&(r.el=i);const a=!i&&e.subTree.el;t(e,r,f(i||e.subTree.el),i?null:p(e.subTree),_,s,l),a&&m(a),updateHOCHostEl(e,r.el),n&&0==--_.deps&&_.resolve()}))},unmount(e,t){_.isUnmounted=!0,_.activeBranch&&g(_.activeBranch,n,e,t),_.pendingBranch&&g(_.pendingBranch,n,e,t)}};return _}function hydrateSuspense(e,t,n,i,o,r,s,a,l){const c=t.suspense=createSuspenseBoundary(t,i,n,e.parentNode,document.createElement("div"),null,o,r,s,a,!0),d=l(e,c.pendingBranch=t.ssContent,n,c,r,s);return 0===c.deps&&c.resolve(),d}function normalizeSuspenseChildren(e){const{shapeFlag:t,children:n}=e,i=32&t;e.ssContent=normalizeSuspenseSlot(i?n.default:n),e.ssFallback=i?normalizeSuspenseSlot(n.fallback):createVNode(Comment)}function normalizeSuspenseSlot(e){let t;if(isFunction$5(e)){const n=isBlockTreeEnabled&&e._c;n&&(e._d=!1,openBlock()),e=e(),n&&(e._d=!0,t=currentBlock,closeBlock())}if(isArray$7(e)){const t=filterSingleRoot(e);e=t}return e=normalizeVNode(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter((t=>t!==e))),e}function queueEffectWithSuspense(e,t){t&&t.pendingBranch?isArray$7(e)?t.effects.push(...e):t.effects.push(e):queuePostFlushCb(e)}function setActiveBranch(e,t){e.activeBranch=t;const{vnode:n,parentComponent:i}=e,o=n.el=t.el;i&&i.subTree===n&&(i.vnode.el=o,updateHOCHostEl(i,o))}function provide(e,t){if(currentInstance){let n=currentInstance.provides;const i=currentInstance.parent&¤tInstance.parent.provides;i===n&&(n=currentInstance.provides=Object.create(i)),n[e]=t}else;}function inject(e,t,n=!1){const i=currentInstance||currentRenderingInstance;if(i){const o=null==i.parent?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides;if(o&&e in o)return o[e];if(arguments.length>1)return n&&isFunction$5(t)?t.call(i.proxy):t}}function watchEffect(e,t){return doWatch(e,null,t)}function watchPostEffect(e,t){return doWatch(e,null,{flush:"post"})}function watchSyncEffect(e,t){return doWatch(e,null,{flush:"sync"})}const INITIAL_WATCHER_VALUE={};function watch(e,t,n){return doWatch(e,t,n)}function doWatch(e,t,{immediate:n,deep:i,flush:o,onTrack:r,onTrigger:s}=EMPTY_OBJ){const a=currentInstance;let l,c,d=!1,u=!1;if(isRef(e)?(l=()=>e.value,d=isShallow(e)):isReactive(e)?(l=()=>e,i=!0):isArray$7(e)?(u=!0,d=e.some((e=>isReactive(e)||isShallow(e))),l=()=>e.map((e=>isRef(e)?e.value:isReactive(e)?traverse(e):isFunction$5(e)?callWithErrorHandling(e,a,2):void 0))):l=isFunction$5(e)?t?()=>callWithErrorHandling(e,a,2):()=>{if(!a||!a.isUnmounted)return c&&c(),callWithAsyncErrorHandling(e,a,3,[h])}:NOOP,t&&i){const e=l;l=()=>traverse(e())}let h=e=>{c=m.onStop=()=>{callWithErrorHandling(e,a,4)}};if(isInSSRComponentSetup)return h=NOOP,t?n&&callWithAsyncErrorHandling(t,a,3,[l(),u?[]:void 0,h]):l(),NOOP;let g=u?[]:INITIAL_WATCHER_VALUE;const p=()=>{if(m.active)if(t){const e=m.run();(i||d||(u?e.some(((e,t)=>hasChanged(e,g[t]))):hasChanged(e,g)))&&(c&&c(),callWithAsyncErrorHandling(t,a,3,[e,g===INITIAL_WATCHER_VALUE?void 0:g,h]),g=e)}else m.run()};let f;p.allowRecurse=!!t,f="sync"===o?p:"post"===o?()=>queuePostRenderEffect(p,a&&a.suspense):()=>queuePreFlushCb(p);const m=new ReactiveEffect(l,f);return t?n?p():g=m.run():"post"===o?queuePostRenderEffect(m.run.bind(m),a&&a.suspense):m.run(),()=>{m.stop(),a&&a.scope&&remove(a.scope.effects,m)}}function instanceWatch(e,t,n){const i=this.proxy,o=isString$6(e)?e.includes(".")?createPathGetter(i,e):()=>i[e]:e.bind(i,i);let r;isFunction$5(t)?r=t:(r=t.handler,n=t);const s=currentInstance;setCurrentInstance(this);const a=doWatch(o,r.bind(i),n);return s?setCurrentInstance(s):unsetCurrentInstance(),a}function createPathGetter(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}function traverse(e,t){if(!isObject$7(e)||e.__v_skip)return e;if((t=t||new Set).has(e))return e;if(t.add(e),isRef(e))traverse(e.value,t);else if(isArray$7(e))for(let n=0;n<e.length;n++)traverse(e[n],t);else if(isSet$2(e)||isMap$2(e))e.forEach((e=>{traverse(e,t)}));else if(isPlainObject$4(e))for(const n in e)traverse(e[n],t);return e}function useTransitionState(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return onMounted((()=>{e.isMounted=!0})),onBeforeUnmount((()=>{e.isUnmounting=!0})),e}const TransitionHookValidator=[Function,Array],BaseTransitionImpl={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:TransitionHookValidator,onEnter:TransitionHookValidator,onAfterEnter:TransitionHookValidator,onEnterCancelled:TransitionHookValidator,onBeforeLeave:TransitionHookValidator,onLeave:TransitionHookValidator,onAfterLeave:TransitionHookValidator,onLeaveCancelled:TransitionHookValidator,onBeforeAppear:TransitionHookValidator,onAppear:TransitionHookValidator,onAfterAppear:TransitionHookValidator,onAppearCancelled:TransitionHookValidator},setup(e,{slots:t}){const n=getCurrentInstance(),i=useTransitionState();let o;return()=>{const r=t.default&&getTransitionRawChildren(t.default(),!0);if(!r||!r.length)return;let s=r[0];if(r.length>1)for(const e of r)if(e.type!==Comment){s=e;break}const a=toRaw(e),{mode:l}=a;if(i.isLeaving)return emptyPlaceholder(s);const c=getKeepAliveChild(s);if(!c)return emptyPlaceholder(s);const d=resolveTransitionHooks(c,a,i,n);setTransitionHooks(c,d);const u=n.subTree,h=u&&getKeepAliveChild(u);let g=!1;const{getTransitionKey:p}=c.type;if(p){const e=p();void 0===o?o=e:e!==o&&(o=e,g=!0)}if(h&&h.type!==Comment&&(!isSameVNodeType(c,h)||g)){const e=resolveTransitionHooks(h,a,i,n);if(setTransitionHooks(h,e),"out-in"===l)return i.isLeaving=!0,e.afterLeave=()=>{i.isLeaving=!1,n.update()},emptyPlaceholder(s);"in-out"===l&&c.type!==Comment&&(e.delayLeave=(e,t,n)=>{getLeavingNodesForType(i,h)[String(h.key)]=h,e._leaveCb=()=>{t(),e._leaveCb=void 0,delete d.delayedLeave},d.delayedLeave=n})}return s}}},BaseTransition=BaseTransitionImpl;function getLeavingNodesForType(e,t){const{leavingVNodes:n}=e;let i=n.get(t.type);return i||(i=Object.create(null),n.set(t.type,i)),i}function resolveTransitionHooks(e,t,n,i){const{appear:o,mode:r,persisted:s=!1,onBeforeEnter:a,onEnter:l,onAfterEnter:c,onEnterCancelled:d,onBeforeLeave:u,onLeave:h,onAfterLeave:g,onLeaveCancelled:p,onBeforeAppear:f,onAppear:m,onAfterAppear:v,onAppearCancelled:_}=t,C=String(e.key),b=getLeavingNodesForType(n,e),y=(e,t)=>{e&&callWithAsyncErrorHandling(e,i,9,t)},S=(e,t)=>{const n=t[1];y(e,t),isArray$7(e)?e.every((e=>e.length<=1))&&n():e.length<=1&&n()},w={mode:r,persisted:s,beforeEnter(t){let i=a;if(!n.isMounted){if(!o)return;i=f||a}t._leaveCb&&t._leaveCb(!0);const r=b[C];r&&isSameVNodeType(e,r)&&r.el._leaveCb&&r.el._leaveCb(),y(i,[t])},enter(e){let t=l,i=c,r=d;if(!n.isMounted){if(!o)return;t=m||l,i=v||c,r=_||d}let s=!1;const a=e._enterCb=t=>{s||(s=!0,y(t?r:i,[e]),w.delayedLeave&&w.delayedLeave(),e._enterCb=void 0)};t?S(t,[e,a]):a()},leave(t,i){const o=String(e.key);if(t._enterCb&&t._enterCb(!0),n.isUnmounting)return i();y(u,[t]);let r=!1;const s=t._leaveCb=n=>{r||(r=!0,i(),y(n?p:g,[t]),t._leaveCb=void 0,b[o]===e&&delete b[o])};b[o]=e,h?S(h,[t,s]):s()},clone:e=>resolveTransitionHooks(e,t,n,i)};return w}function emptyPlaceholder(e){if(isKeepAlive(e))return(e=cloneVNode(e)).children=null,e}function getKeepAliveChild(e){return isKeepAlive(e)?e.children?e.children[0]:void 0:e}function setTransitionHooks(e,t){6&e.shapeFlag&&e.component?setTransitionHooks(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function getTransitionRawChildren(e,t=!1,n){let i=[],o=0;for(let r=0;r<e.length;r++){let s=e[r];const a=null==n?s.key:String(n)+String(null!=s.key?s.key:r);s.type===Fragment?(128&s.patchFlag&&o++,i=i.concat(getTransitionRawChildren(s.children,t,a))):(t||s.type!==Comment)&&i.push(null!=a?cloneVNode(s,{key:a}):s)}if(o>1)for(let r=0;r<i.length;r++)i[r].patchFlag=-2;return i}function defineComponent(e){return isFunction$5(e)?{setup:e,name:e.name}:e}const isAsyncWrapper=e=>!!e.type.__asyncLoader;function defineAsyncComponent(e){isFunction$5(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:i,delay:o=200,timeout:r,suspensible:s=!0,onError:a}=e;let l,c=null,d=0;const u=()=>{let e;return c||(e=c=t().catch((e=>{if(e=e instanceof Error?e:new Error(String(e)),a)return new Promise(((t,n)=>{a(e,(()=>t((d++,c=null,u()))),(()=>n(e)),d+1)}));throw e})).then((t=>e!==c&&c?c:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),l=t,t))))};return defineComponent({name:"AsyncComponentWrapper",__asyncLoader:u,get __asyncResolved(){return l},setup(){const e=currentInstance;if(l)return()=>createInnerComp(l,e);const t=t=>{c=null,handleError(t,e,13,!i)};if(s&&e.suspense||isInSSRComponentSetup)return u().then((t=>()=>createInnerComp(t,e))).catch((e=>(t(e),()=>i?createVNode(i,{error:e}):null)));const a=ref(!1),d=ref(),h=ref(!!o);return o&&setTimeout((()=>{h.value=!1}),o),null!=r&&setTimeout((()=>{if(!a.value&&!d.value){const e=new Error(`Async component timed out after ${r}ms.`);t(e),d.value=e}}),r),u().then((()=>{a.value=!0,e.parent&&isKeepAlive(e.parent.vnode)&&queueJob(e.parent.update)})).catch((e=>{t(e),d.value=e})),()=>a.value&&l?createInnerComp(l,e):d.value&&i?createVNode(i,{error:d.value}):n&&!h.value?createVNode(n):void 0}})}function createInnerComp(e,{vnode:{ref:t,props:n,children:i,shapeFlag:o},parent:r}){const s=createVNode(e,n,i);return s.ref=t,s}const isKeepAlive=e=>e.type.__isKeepAlive,KeepAliveImpl={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=getCurrentInstance(),i=n.ctx;if(!i.renderer)return()=>{const e=t.default&&t.default();return e&&1===e.length?e[0]:e};const o=new Map,r=new Set;let s=null;const a=n.suspense,{renderer:{p:l,m:c,um:d,o:{createElement:u}}}=i,h=u("div");function g(e){resetShapeFlag(e),d(e,n,a,!0)}function p(e){o.forEach(((t,n)=>{const i=getComponentName(t.type);!i||e&&e(i)||f(n)}))}function f(e){const t=o.get(e);s&&t.type===s.type?s&&resetShapeFlag(s):g(t),o.delete(e),r.delete(e)}i.activate=(e,t,n,i,o)=>{const r=e.component;c(e,t,n,0,a),l(r.vnode,e,t,n,r,a,i,e.slotScopeIds,o),queuePostRenderEffect((()=>{r.isDeactivated=!1,r.a&&invokeArrayFns(r.a);const t=e.props&&e.props.onVnodeMounted;t&&invokeVNodeHook(t,r.parent,e)}),a)},i.deactivate=e=>{const t=e.component;c(e,h,null,1,a),queuePostRenderEffect((()=>{t.da&&invokeArrayFns(t.da);const n=e.props&&e.props.onVnodeUnmounted;n&&invokeVNodeHook(n,t.parent,e),t.isDeactivated=!0}),a)},watch((()=>[e.include,e.exclude]),(([e,t])=>{e&&p((t=>matches(e,t))),t&&p((e=>!matches(t,e)))}),{flush:"post",deep:!0});let m=null;const v=()=>{null!=m&&o.set(m,getInnerChild(n.subTree))};return onMounted(v),onUpdated(v),onBeforeUnmount((()=>{o.forEach((e=>{const{subTree:t,suspense:i}=n,o=getInnerChild(t);if(e.type!==o.type)g(e);else{resetShapeFlag(o);const e=o.component.da;e&&queuePostRenderEffect(e,i)}}))})),()=>{if(m=null,!t.default)return null;const n=t.default(),i=n[0];if(n.length>1)return s=null,n;if(!(isVNode(i)&&(4&i.shapeFlag||128&i.shapeFlag)))return s=null,i;let a=getInnerChild(i);const l=a.type,c=getComponentName(isAsyncWrapper(a)?a.type.__asyncResolved||{}:l),{include:d,exclude:u,max:h}=e;if(d&&(!c||!matches(d,c))||u&&c&&matches(u,c))return s=a,i;const g=null==a.key?l:a.key,p=o.get(g);return a.el&&(a=cloneVNode(a),128&i.shapeFlag&&(i.ssContent=a)),m=g,p?(a.el=p.el,a.component=p.component,a.transition&&setTransitionHooks(a,a.transition),a.shapeFlag|=512,r.delete(g),r.add(g)):(r.add(g),h&&r.size>parseInt(h,10)&&f(r.values().next().value)),a.shapeFlag|=256,s=a,isSuspense(i.type)?i:a}}},KeepAlive=KeepAliveImpl;function matches(e,t){return isArray$7(e)?e.some((e=>matches(e,t))):isString$6(e)?e.split(",").includes(t):!!e.test&&e.test(t)}function onActivated(e,t){registerKeepAliveHook(e,"a",t)}function onDeactivated(e,t){registerKeepAliveHook(e,"da",t)}function registerKeepAliveHook(e,t,n=currentInstance){const i=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(injectHook(t,i,n),n){let e=n.parent;for(;e&&e.parent;)isKeepAlive(e.parent.vnode)&&injectToKeepAliveRoot(i,t,n,e),e=e.parent}}function injectToKeepAliveRoot(e,t,n,i){const o=injectHook(t,e,i,!0);onUnmounted((()=>{remove(i[t],o)}),n)}function resetShapeFlag(e){let t=e.shapeFlag;256&t&&(t-=256),512&t&&(t-=512),e.shapeFlag=t}function getInnerChild(e){return 128&e.shapeFlag?e.ssContent:e}function injectHook(e,t,n=currentInstance,i=!1){if(n){const o=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...i)=>{if(n.isUnmounted)return;pauseTracking(),setCurrentInstance(n);const o=callWithAsyncErrorHandling(t,n,e,i);return unsetCurrentInstance(),resetTracking(),o});return i?o.unshift(r):o.push(r),r}}const createHook=e=>(t,n=currentInstance)=>(!isInSSRComponentSetup||"sp"===e)&&injectHook(e,t,n),onBeforeMount=createHook("bm"),onMounted=createHook("m"),onBeforeUpdate=createHook("bu"),onUpdated=createHook("u"),onBeforeUnmount=createHook("bum"),onUnmounted=createHook("um"),onServerPrefetch=createHook("sp"),onRenderTriggered=createHook("rtg"),onRenderTracked=createHook("rtc");function onErrorCaptured(e,t=currentInstance){injectHook("ec",e,t)}function withDirectives(e,t){const n=currentRenderingInstance;if(null===n)return e;const i=getExposeProxy(n)||n.proxy,o=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[e,n,s,a=EMPTY_OBJ]=t[r];isFunction$5(e)&&(e={mounted:e,updated:e}),e.deep&&traverse(n),o.push({dir:e,instance:i,value:n,oldValue:void 0,arg:s,modifiers:a})}return e}function invokeDirectiveHook(e,t,n,i){const o=e.dirs,r=t&&t.dirs;for(let s=0;s<o.length;s++){const a=o[s];r&&(a.oldValue=r[s].value);let l=a.dir[i];l&&(pauseTracking(),callWithAsyncErrorHandling(l,n,8,[e.el,a,e,t]),resetTracking())}}const COMPONENTS="components",DIRECTIVES="directives";function resolveComponent(e,t){return resolveAsset(COMPONENTS,e,!0,t)||e}const NULL_DYNAMIC_COMPONENT=Symbol();function resolveDynamicComponent(e){return isString$6(e)?resolveAsset(COMPONENTS,e,!1)||e:e||NULL_DYNAMIC_COMPONENT}function resolveDirective(e){return resolveAsset(DIRECTIVES,e)}function resolveAsset(e,t,n=!0,i=!1){const o=currentRenderingInstance||currentInstance;if(o){const n=o.type;if(e===COMPONENTS){const e=getComponentName(n,!1);if(e&&(e===t||e===camelize$1(t)||e===capitalize(camelize$1(t))))return n}const r=resolve$1(o[e]||n[e],t)||resolve$1(o.appContext[e],t);return!r&&i?n:r}}function resolve$1(e,t){return e&&(e[t]||e[camelize$1(t)]||e[capitalize(camelize$1(t))])}function renderList(e,t,n,i){let o;const r=n&&n[i];if(isArray$7(e)||isString$6(e)){o=new Array(e.length);for(let n=0,i=e.length;n<i;n++)o[n]=t(e[n],n,void 0,r&&r[n])}else if("number"==typeof e){o=new Array(e);for(let n=0;n<e;n++)o[n]=t(n+1,n,void 0,r&&r[n])}else if(isObject$7(e))if(e[Symbol.iterator])o=Array.from(e,((e,n)=>t(e,n,void 0,r&&r[n])));else{const n=Object.keys(e);o=new Array(n.length);for(let i=0,s=n.length;i<s;i++){const s=n[i];o[i]=t(e[s],s,i,r&&r[i])}}else o=[];return n&&(n[i]=o),o}function createSlots(e,t){for(let n=0;n<t.length;n++){const i=t[n];if(isArray$7(i))for(let t=0;t<i.length;t++)e[i[t].name]=i[t].fn;else i&&(e[i.name]=i.fn)}return e}function renderSlot(e,t,n={},i,o){if(currentRenderingInstance.isCE||currentRenderingInstance.parent&&isAsyncWrapper(currentRenderingInstance.parent)&¤tRenderingInstance.parent.isCE)return createVNode("slot","default"===t?null:{name:t},i&&i());let r=e[t];r&&r._c&&(r._d=!1),openBlock();const s=r&&ensureValidVNode(r(n)),a=createBlock(Fragment,{key:n.key||`_${t}`},s||(i?i():[]),s&&1===e._?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),r&&r._c&&(r._d=!0),a}function ensureValidVNode(e){return e.some((e=>!isVNode(e)||e.type!==Comment&&!(e.type===Fragment&&!ensureValidVNode(e.children))))?e:null}function toHandlers(e){const t={};for(const n in e)t[toHandlerKey(n)]=e[n];return t}const getPublicInstance=e=>e?isStatefulComponent(e)?getExposeProxy(e)||e.proxy:getPublicInstance(e.parent):null,publicPropertiesMap=extend$1(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>getPublicInstance(e.parent),$root:e=>getPublicInstance(e.root),$emit:e=>e.emit,$options:e=>resolveMergedOptions(e),$forceUpdate:e=>e.f||(e.f=()=>queueJob(e.update)),$nextTick:e=>e.n||(e.n=nextTick.bind(e.proxy)),$watch:e=>instanceWatch.bind(e)}),PublicInstanceProxyHandlers={get({_:e},t){const{ctx:n,setupState:i,data:o,props:r,accessCache:s,type:a,appContext:l}=e;let c;if("$"!==t[0]){const a=s[t];if(void 0!==a)switch(a){case 1:return i[t];case 2:return o[t];case 4:return n[t];case 3:return r[t]}else{if(i!==EMPTY_OBJ&&hasOwn$3(i,t))return s[t]=1,i[t];if(o!==EMPTY_OBJ&&hasOwn$3(o,t))return s[t]=2,o[t];if((c=e.propsOptions[0])&&hasOwn$3(c,t))return s[t]=3,r[t];if(n!==EMPTY_OBJ&&hasOwn$3(n,t))return s[t]=4,n[t];shouldCacheAccess&&(s[t]=0)}}const d=publicPropertiesMap[t];let u,h;return d?("$attrs"===t&&track(e,"get",t),d(e)):(u=a.__cssModules)&&(u=u[t])?u:n!==EMPTY_OBJ&&hasOwn$3(n,t)?(s[t]=4,n[t]):(h=l.config.globalProperties,hasOwn$3(h,t)?h[t]:void 0)},set({_:e},t,n){const{data:i,setupState:o,ctx:r}=e;return o!==EMPTY_OBJ&&hasOwn$3(o,t)?(o[t]=n,!0):i!==EMPTY_OBJ&&hasOwn$3(i,t)?(i[t]=n,!0):!hasOwn$3(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(r[t]=n,!0))},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:o,propsOptions:r}},s){let a;return!!n[s]||e!==EMPTY_OBJ&&hasOwn$3(e,s)||t!==EMPTY_OBJ&&hasOwn$3(t,s)||(a=r[0])&&hasOwn$3(a,s)||hasOwn$3(i,s)||hasOwn$3(publicPropertiesMap,s)||hasOwn$3(o.config.globalProperties,s)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:hasOwn$3(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},RuntimeCompiledPublicInstanceProxyHandlers=extend$1({},PublicInstanceProxyHandlers,{get(e,t){if(t!==Symbol.unscopables)return PublicInstanceProxyHandlers.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!isGloballyWhitelisted(t)});let shouldCacheAccess=!0;function applyOptions(e){const t=resolveMergedOptions(e),n=e.proxy,i=e.ctx;shouldCacheAccess=!1,t.beforeCreate&&callHook$1(t.beforeCreate,e,"bc");const{data:o,computed:r,methods:s,watch:a,provide:l,inject:c,created:d,beforeMount:u,mounted:h,beforeUpdate:g,updated:p,activated:f,deactivated:m,beforeDestroy:v,beforeUnmount:_,destroyed:C,unmounted:b,render:y,renderTracked:S,renderTriggered:w,errorCaptured:E,serverPrefetch:x,expose:T,inheritAttrs:I,components:k,directives:L,filters:D}=t;if(c&&resolveInjections(c,i,null,e.appContext.config.unwrapInjectedRef),s)for(const O in s){const e=s[O];isFunction$5(e)&&(i[O]=e.bind(n))}if(o){const t=o.call(n,n);isObject$7(t)&&(e.data=reactive(t))}if(shouldCacheAccess=!0,r)for(const O in r){const e=r[O],t=isFunction$5(e)?e.bind(n,n):isFunction$5(e.get)?e.get.bind(n,n):NOOP,o=!isFunction$5(e)&&isFunction$5(e.set)?e.set.bind(n):NOOP,s=computed({get:t,set:o});Object.defineProperty(i,O,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(a)for(const O in a)createWatcher(a[O],i,n,O);if(l){const e=isFunction$5(l)?l.call(n):l;Reflect.ownKeys(e).forEach((t=>{provide(t,e[t])}))}function N(e,t){isArray$7(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(d&&callHook$1(d,e,"c"),N(onBeforeMount,u),N(onMounted,h),N(onBeforeUpdate,g),N(onUpdated,p),N(onActivated,f),N(onDeactivated,m),N(onErrorCaptured,E),N(onRenderTracked,S),N(onRenderTriggered,w),N(onBeforeUnmount,_),N(onUnmounted,b),N(onServerPrefetch,x),isArray$7(T))if(T.length){const t=e.exposed||(e.exposed={});T.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});y&&e.render===NOOP&&(e.render=y),null!=I&&(e.inheritAttrs=I),k&&(e.components=k),L&&(e.directives=L)}function resolveInjections(e,t,n=NOOP,i=!1){isArray$7(e)&&(e=normalizeInject(e));for(const o in e){const n=e[o];let r;r=isObject$7(n)?"default"in n?inject(n.from||o,n.default,!0):inject(n.from||o):inject(n),isRef(r)&&i?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[o]=r}}function callHook$1(e,t,n){callWithAsyncErrorHandling(isArray$7(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function createWatcher(e,t,n,i){const o=i.includes(".")?createPathGetter(n,i):()=>n[i];if(isString$6(e)){const n=t[e];isFunction$5(n)&&watch(o,n)}else if(isFunction$5(e))watch(o,e.bind(n));else if(isObject$7(e))if(isArray$7(e))e.forEach((e=>createWatcher(e,t,n,i)));else{const i=isFunction$5(e.handler)?e.handler.bind(n):t[e.handler];isFunction$5(i)&&watch(o,i,e)}}function resolveMergedOptions(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:o,optionsCache:r,config:{optionMergeStrategies:s}}=e.appContext,a=r.get(t);let l;return a?l=a:o.length||n||i?(l={},o.length&&o.forEach((e=>mergeOptions$1(l,e,s,!0))),mergeOptions$1(l,t,s)):l=t,r.set(t,l),l}function mergeOptions$1(e,t,n,i=!1){const{mixins:o,extends:r}=t;r&&mergeOptions$1(e,r,n,!0),o&&o.forEach((t=>mergeOptions$1(e,t,n,!0)));for(const s in t)if(i&&"expose"===s);else{const i=internalOptionMergeStrats[s]||n&&n[s];e[s]=i?i(e[s],t[s]):t[s]}return e}const internalOptionMergeStrats={data:mergeDataFn,props:mergeObjectOptions,emits:mergeObjectOptions,methods:mergeObjectOptions,computed:mergeObjectOptions,beforeCreate:mergeAsArray,created:mergeAsArray,beforeMount:mergeAsArray,mounted:mergeAsArray,beforeUpdate:mergeAsArray,updated:mergeAsArray,beforeDestroy:mergeAsArray,beforeUnmount:mergeAsArray,destroyed:mergeAsArray,unmounted:mergeAsArray,activated:mergeAsArray,deactivated:mergeAsArray,errorCaptured:mergeAsArray,serverPrefetch:mergeAsArray,components:mergeObjectOptions,directives:mergeObjectOptions,watch:mergeWatchOptions,provide:mergeDataFn,inject:mergeInject};function mergeDataFn(e,t){return t?e?function(){return extend$1(isFunction$5(e)?e.call(this,this):e,isFunction$5(t)?t.call(this,this):t)}:t:e}function mergeInject(e,t){return mergeObjectOptions(normalizeInject(e),normalizeInject(t))}function normalizeInject(e){if(isArray$7(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function mergeAsArray(e,t){return e?[...new Set([].concat(e,t))]:t}function mergeObjectOptions(e,t){return e?extend$1(extend$1(Object.create(null),e),t):t}function mergeWatchOptions(e,t){if(!e)return t;if(!t)return e;const n=extend$1(Object.create(null),e);for(const i in t)n[i]=mergeAsArray(e[i],t[i]);return n}function initProps(e,t,n,i=!1){const o={},r={};def(r,InternalObjectKey,1),e.propsDefaults=Object.create(null),setFullProps(e,t,o,r);for(const s in e.propsOptions[0])s in o||(o[s]=void 0);n?e.props=i?o:shallowReactive(o):e.type.props?e.props=o:e.props=r,e.attrs=r}function updateProps(e,t,n,i){const{props:o,attrs:r,vnode:{patchFlag:s}}=e,a=toRaw(o),[l]=e.propsOptions;let c=!1;if(!(i||s>0)||16&s){let i;setFullProps(e,t,o,r)&&(c=!0);for(const r in a)t&&(hasOwn$3(t,r)||(i=hyphenate$1(r))!==r&&hasOwn$3(t,i))||(l?!n||void 0===n[r]&&void 0===n[i]||(o[r]=resolvePropValue$1(l,a,r,void 0,e,!0)):delete o[r]);if(r!==a)for(const e in r)t&&hasOwn$3(t,e)||(delete r[e],c=!0)}else if(8&s){const n=e.vnode.dynamicProps;for(let i=0;i<n.length;i++){let s=n[i];if(isEmitListener(e.emitsOptions,s))continue;const d=t[s];if(l)if(hasOwn$3(r,s))d!==r[s]&&(r[s]=d,c=!0);else{const t=camelize$1(s);o[t]=resolvePropValue$1(l,a,t,d,e,!1)}else d!==r[s]&&(r[s]=d,c=!0)}}c&&trigger$1(e,"set","$attrs")}function setFullProps(e,t,n,i){const[o,r]=e.propsOptions;let s,a=!1;if(t)for(let l in t){if(isReservedProp(l))continue;const c=t[l];let d;o&&hasOwn$3(o,d=camelize$1(l))?r&&r.includes(d)?(s||(s={}))[d]=c:n[d]=c:isEmitListener(e.emitsOptions,l)||l in i&&c===i[l]||(i[l]=c,a=!0)}if(r){const t=toRaw(n),i=s||EMPTY_OBJ;for(let s=0;s<r.length;s++){const a=r[s];n[a]=resolvePropValue$1(o,t,a,i[a],e,!hasOwn$3(i,a))}}return a}function resolvePropValue$1(e,t,n,i,o,r){const s=e[n];if(null!=s){const e=hasOwn$3(s,"default");if(e&&void 0===i){const e=s.default;if(s.type!==Function&&isFunction$5(e)){const{propsDefaults:r}=o;n in r?i=r[n]:(setCurrentInstance(o),i=r[n]=e.call(null,t),unsetCurrentInstance())}else i=e}s[0]&&(r&&!e?i=!1:!s[1]||""!==i&&i!==hyphenate$1(n)||(i=!0))}return i}function normalizePropsOptions(e,t,n=!1){const i=t.propsCache,o=i.get(e);if(o)return o;const r=e.props,s={},a=[];let l=!1;if(!isFunction$5(e)){const i=e=>{l=!0;const[n,i]=normalizePropsOptions(e,t,!0);extend$1(s,n),i&&a.push(...i)};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}if(!r&&!l)return i.set(e,EMPTY_ARR),EMPTY_ARR;if(isArray$7(r))for(let d=0;d<r.length;d++){const e=camelize$1(r[d]);validatePropName(e)&&(s[e]=EMPTY_OBJ)}else if(r)for(const d in r){const e=camelize$1(d);if(validatePropName(e)){const t=r[d],n=s[e]=isArray$7(t)||isFunction$5(t)?{type:t}:t;if(n){const t=getTypeIndex(Boolean,n.type),i=getTypeIndex(String,n.type);n[0]=t>-1,n[1]=i<0||t<i,(t>-1||hasOwn$3(n,"default"))&&a.push(e)}}}const c=[s,a];return i.set(e,c),c}function validatePropName(e){return"$"!==e[0]}function getType(e){const t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:null===e?"null":""}function isSameType(e,t){return getType(e)===getType(t)}function getTypeIndex(e,t){return isArray$7(t)?t.findIndex((t=>isSameType(t,e))):isFunction$5(t)&&isSameType(t,e)?0:-1}const isInternalKey=e=>"_"===e[0]||"$stable"===e,normalizeSlotValue=e=>isArray$7(e)?e.map(normalizeVNode):[normalizeVNode(e)],normalizeSlot$1=(e,t,n)=>{if(t._n)return t;const i=withCtx(((...e)=>normalizeSlotValue(t(...e))),n);return i._c=!1,i},normalizeObjectSlots=(e,t,n)=>{const i=e._ctx;for(const o in e){if(isInternalKey(o))continue;const n=e[o];if(isFunction$5(n))t[o]=normalizeSlot$1(o,n,i);else if(null!=n){const e=normalizeSlotValue(n);t[o]=()=>e}}},normalizeVNodeSlots=(e,t)=>{const n=normalizeSlotValue(t);e.slots.default=()=>n},initSlots=(e,t)=>{if(32&e.vnode.shapeFlag){const n=t._;n?(e.slots=toRaw(t),def(t,"_",n)):normalizeObjectSlots(t,e.slots={})}else e.slots={},t&&normalizeVNodeSlots(e,t);def(e.slots,InternalObjectKey,1)},updateSlots=(e,t,n)=>{const{vnode:i,slots:o}=e;let r=!0,s=EMPTY_OBJ;if(32&i.shapeFlag){const e=t._;e?n&&1===e?r=!1:(extend$1(o,t),n||1!==e||delete o._):(r=!t.$stable,normalizeObjectSlots(t,o)),s=t}else t&&(normalizeVNodeSlots(e,t),s={default:1});if(r)for(const a in o)isInternalKey(a)||a in s||delete o[a]};function createAppContext(){return{app:null,config:{isNativeTag:NO,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let uid$1=0;function createAppAPI(e,t){return function(n,i=null){isFunction$5(n)||(n=Object.assign({},n)),null==i||isObject$7(i)||(i=null);const o=createAppContext(),r=new Set;let s=!1;const a=o.app={_uid:uid$1++,_component:n,_props:i,_container:null,_context:o,_instance:null,version:version,get config(){return o.config},set config(e){},use:(e,...t)=>(r.has(e)||(e&&isFunction$5(e.install)?(r.add(e),e.install(a,...t)):isFunction$5(e)&&(r.add(e),e(a,...t))),a),mixin:e=>(o.mixins.includes(e)||o.mixins.push(e),a),component:(e,t)=>t?(o.components[e]=t,a):o.components[e],directive:(e,t)=>t?(o.directives[e]=t,a):o.directives[e],mount(r,l,c){if(!s){const d=createVNode(n,i);return d.appContext=o,l&&t?t(d,r):e(d,r,c),s=!0,a._container=r,r.__vue_app__=a,getExposeProxy(d.component)||d.component.proxy}},unmount(){s&&(e(null,a._container),delete a._container.__vue_app__)},provide:(e,t)=>(o.provides[e]=t,a)};return a}}function setRef(e,t,n,i,o=!1){if(isArray$7(e))return void e.forEach(((e,r)=>setRef(e,t&&(isArray$7(t)?t[r]:t),n,i,o)));if(isAsyncWrapper(i)&&!o)return;const r=4&i.shapeFlag?getExposeProxy(i.component)||i.component.proxy:i.el,s=o?null:r,{i:a,r:l}=e,c=t&&t.r,d=a.refs===EMPTY_OBJ?a.refs={}:a.refs,u=a.setupState;if(null!=c&&c!==l&&(isString$6(c)?(d[c]=null,hasOwn$3(u,c)&&(u[c]=null)):isRef(c)&&(c.value=null)),isFunction$5(l))callWithErrorHandling(l,a,12,[s,d]);else{const t=isString$6(l),i=isRef(l);if(t||i){const a=()=>{if(e.f){const n=t?d[l]:l.value;o?isArray$7(n)&&remove(n,r):isArray$7(n)?n.includes(r)||n.push(r):t?(d[l]=[r],hasOwn$3(u,l)&&(u[l]=d[l])):(l.value=[r],e.k&&(d[e.k]=l.value))}else t?(d[l]=s,hasOwn$3(u,l)&&(u[l]=s)):i&&(l.value=s,e.k&&(d[e.k]=s))};s?(a.id=-1,queuePostRenderEffect(a,n)):a()}}}let hasMismatch=!1;const isSVGContainer=e=>/svg/.test(e.namespaceURI)&&"foreignObject"!==e.tagName,isComment=e=>8===e.nodeType;function createHydrationFunctions(e){const{mt:t,p:n,o:{patchProp:i,createText:o,nextSibling:r,parentNode:s,remove:a,insert:l,createComment:c}}=e,d=(n,i,a,c,m,v=!1)=>{const _=isComment(n)&&"["===n.data,C=()=>p(n,i,a,c,m,_),{type:b,ref:y,shapeFlag:S,patchFlag:w}=i,E=n.nodeType;i.el=n,-2===w&&(v=!1,i.dynamicChildren=null);let x=null;switch(b){case Text$1:3!==E?""===i.children?(l(i.el=o(""),s(n),n),x=n):x=C():(n.data!==i.children&&(hasMismatch=!0,n.data=i.children),x=r(n));break;case Comment:x=8!==E||_?C():r(n);break;case Static:if(1===E||3===E){x=n;const e=!i.children.length;for(let t=0;t<i.staticCount;t++)e&&(i.children+=1===x.nodeType?x.outerHTML:x.data),t===i.staticCount-1&&(i.anchor=x),x=r(x);return x}x=C();break;case Fragment:x=_?g(n,i,a,c,m,v):C();break;default:if(1&S)x=1!==E||i.type.toLowerCase()!==n.tagName.toLowerCase()?C():u(n,i,a,c,m,v);else if(6&S){i.slotScopeIds=m;const e=s(n);if(t(i,e,null,a,c,isSVGContainer(e),v),x=_?f(n):r(n),x&&isComment(x)&&"teleport end"===x.data&&(x=r(x)),isAsyncWrapper(i)){let t;_?(t=createVNode(Fragment),t.anchor=x?x.previousSibling:e.lastChild):t=3===n.nodeType?createTextVNode(""):createVNode("div"),t.el=n,i.component.subTree=t}}else 64&S?x=8!==E?C():i.type.hydrate(n,i,a,c,m,v,e,h):128&S&&(x=i.type.hydrate(n,i,a,c,isSVGContainer(s(n)),m,v,e,d))}return null!=y&&setRef(y,null,c,i),x},u=(e,t,n,o,r,s)=>{s=s||!!t.dynamicChildren;const{type:l,props:c,patchFlag:d,shapeFlag:u,dirs:g}=t,p="input"===l&&g||"option"===l;if(p||-1!==d){if(g&&invokeDirectiveHook(t,null,n,"created"),c)if(p||!s||48&d)for(const t in c)(p&&t.endsWith("value")||isOn$1(t)&&!isReservedProp(t))&&i(e,t,null,c[t],!1,void 0,n);else c.onClick&&i(e,"onClick",null,c.onClick,!1,void 0,n);let l;if((l=c&&c.onVnodeBeforeMount)&&invokeVNodeHook(l,n,t),g&&invokeDirectiveHook(t,null,n,"beforeMount"),((l=c&&c.onVnodeMounted)||g)&&queueEffectWithSuspense((()=>{l&&invokeVNodeHook(l,n,t),g&&invokeDirectiveHook(t,null,n,"mounted")}),o),16&u&&(!c||!c.innerHTML&&!c.textContent)){let i=h(e.firstChild,t,e,n,o,r,s);for(;i;){hasMismatch=!0;const e=i;i=i.nextSibling,a(e)}}else 8&u&&e.textContent!==t.children&&(hasMismatch=!0,e.textContent=t.children)}return e.nextSibling},h=(e,t,i,o,r,s,a)=>{a=a||!!t.dynamicChildren;const l=t.children,c=l.length;for(let u=0;u<c;u++){const t=a?l[u]:l[u]=normalizeVNode(l[u]);if(e)e=d(e,t,o,r,s,a);else{if(t.type===Text$1&&!t.children)continue;hasMismatch=!0,n(null,t,i,null,o,r,isSVGContainer(i),s)}}return e},g=(e,t,n,i,o,a)=>{const{slotScopeIds:d}=t;d&&(o=o?o.concat(d):d);const u=s(e),g=h(r(e),t,u,n,i,o,a);return g&&isComment(g)&&"]"===g.data?r(t.anchor=g):(hasMismatch=!0,l(t.anchor=c("]"),u,g),g)},p=(e,t,i,o,l,c)=>{if(hasMismatch=!0,t.el=null,c){const t=f(e);for(;;){const n=r(e);if(!n||n===t)break;a(n)}}const d=r(e),u=s(e);return a(e),n(null,t,u,d,i,o,isSVGContainer(u),l),d},f=e=>{let t=0;for(;e;)if((e=r(e))&&isComment(e)&&("["===e.data&&t++,"]"===e.data)){if(0===t)return r(e);t--}return e};return[(e,t)=>{if(!t.hasChildNodes())return n(null,e,t),flushPostFlushCbs(),void(t._vnode=e);hasMismatch=!1,d(t.firstChild,e,null,null,null),flushPostFlushCbs(),t._vnode=e},d]}const queuePostRenderEffect=queueEffectWithSuspense;function createRenderer(e){return baseCreateRenderer(e)}function createHydrationRenderer(e){return baseCreateRenderer(e,createHydrationFunctions)}function baseCreateRenderer(e,t){getGlobalThis$1().__VUE__=!0;const{insert:n,remove:i,patchProp:o,createElement:r,createText:s,createComment:a,setText:l,setElementText:c,parentNode:d,nextSibling:u,setScopeId:h=NOOP,cloneNode:g,insertStaticContent:p}=e,f=(e,t,n,i=null,o=null,r=null,s=!1,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!isSameVNodeType(e,t)&&(i=W(e),M(e,o,r,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:d,shapeFlag:u}=t;switch(c){case Text$1:m(e,t,n,i);break;case Comment:v(e,t,n,i);break;case Static:null==e&&_(t,n,i,s);break;case Fragment:T(e,t,n,i,o,r,s,a,l);break;default:1&u?C(e,t,n,i,o,r,s,a,l):6&u?I(e,t,n,i,o,r,s,a,l):(64&u||128&u)&&c.process(e,t,n,i,o,r,s,a,l,z)}null!=d&&o&&setRef(d,e&&e.ref,r,t||e,!t)},m=(e,t,i,o)=>{if(null==e)n(t.el=s(t.children),i,o);else{const n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},v=(e,t,i,o)=>{null==e?n(t.el=a(t.children||""),i,o):t.el=e.el},_=(e,t,n,i)=>{[e.el,e.anchor]=p(e.children,t,n,i,e.el,e.anchor)},C=(e,t,n,i,o,r,s,a,l)=>{s=s||"svg"===t.type,null==e?b(t,n,i,o,r,s,a,l):w(e,t,o,r,s,a,l)},b=(e,t,i,s,a,l,d,u)=>{let h,p;const{type:f,props:m,shapeFlag:v,transition:_,patchFlag:C,dirs:b}=e;if(e.el&&void 0!==g&&-1===C)h=e.el=g(e.el);else{if(h=e.el=r(e.type,l,m&&m.is,m),8&v?c(h,e.children):16&v&&S(e.children,h,null,s,a,l&&"foreignObject"!==f,d,u),b&&invokeDirectiveHook(e,null,s,"created"),m){for(const t in m)"value"===t||isReservedProp(t)||o(h,t,null,m[t],l,e.children,s,a,V);"value"in m&&o(h,"value",null,m.value),(p=m.onVnodeBeforeMount)&&invokeVNodeHook(p,s,e)}y(h,e,e.scopeId,d,s)}b&&invokeDirectiveHook(e,null,s,"beforeMount");const w=(!a||a&&!a.pendingBranch)&&_&&!_.persisted;w&&_.beforeEnter(h),n(h,t,i),((p=m&&m.onVnodeMounted)||w||b)&&queuePostRenderEffect((()=>{p&&invokeVNodeHook(p,s,e),w&&_.enter(h),b&&invokeDirectiveHook(e,null,s,"mounted")}),a)},y=(e,t,n,i,o)=>{if(n&&h(e,n),i)for(let r=0;r<i.length;r++)h(e,i[r]);if(o){if(t===o.subTree){const t=o.vnode;y(e,t,t.scopeId,t.slotScopeIds,o.parent)}}},S=(e,t,n,i,o,r,s,a,l=0)=>{for(let c=l;c<e.length;c++){const l=e[c]=a?cloneIfMounted(e[c]):normalizeVNode(e[c]);f(null,l,t,n,i,o,r,s,a)}},w=(e,t,n,i,r,s,a)=>{const l=t.el=e.el;let{patchFlag:d,dynamicChildren:u,dirs:h}=t;d|=16&e.patchFlag;const g=e.props||EMPTY_OBJ,p=t.props||EMPTY_OBJ;let f;n&&toggleRecurse(n,!1),(f=p.onVnodeBeforeUpdate)&&invokeVNodeHook(f,n,t,e),h&&invokeDirectiveHook(t,e,n,"beforeUpdate"),n&&toggleRecurse(n,!0);const m=r&&"foreignObject"!==t.type;if(u?E(e.dynamicChildren,u,l,n,i,m,s):a||O(e,t,l,null,n,i,m,s,!1),d>0){if(16&d)x(l,t,g,p,n,i,r);else if(2&d&&g.class!==p.class&&o(l,"class",null,p.class,r),4&d&&o(l,"style",g.style,p.style,r),8&d){const s=t.dynamicProps;for(let t=0;t<s.length;t++){const a=s[t],c=g[a],d=p[a];d===c&&"value"!==a||o(l,a,c,d,r,e.children,n,i,V)}}1&d&&e.children!==t.children&&c(l,t.children)}else a||null!=u||x(l,t,g,p,n,i,r);((f=p.onVnodeUpdated)||h)&&queuePostRenderEffect((()=>{f&&invokeVNodeHook(f,n,t,e),h&&invokeDirectiveHook(t,e,n,"updated")}),i)},E=(e,t,n,i,o,r,s)=>{for(let a=0;a<t.length;a++){const l=e[a],c=t[a],u=l.el&&(l.type===Fragment||!isSameVNodeType(l,c)||70&l.shapeFlag)?d(l.el):n;f(l,c,u,null,i,o,r,s,!0)}},x=(e,t,n,i,r,s,a)=>{if(n!==i){for(const l in i){if(isReservedProp(l))continue;const c=i[l],d=n[l];c!==d&&"value"!==l&&o(e,l,d,c,a,t.children,r,s,V)}if(n!==EMPTY_OBJ)for(const l in n)isReservedProp(l)||l in i||o(e,l,n[l],null,a,t.children,r,s,V);"value"in i&&o(e,"value",n.value,i.value)}},T=(e,t,i,o,r,a,l,c,d)=>{const u=t.el=e?e.el:s(""),h=t.anchor=e?e.anchor:s("");let{patchFlag:g,dynamicChildren:p,slotScopeIds:f}=t;f&&(c=c?c.concat(f):f),null==e?(n(u,i,o),n(h,i,o),S(t.children,i,h,r,a,l,c,d)):g>0&&64&g&&p&&e.dynamicChildren?(E(e.dynamicChildren,p,i,r,a,l,c),(null!=t.key||r&&t===r.subTree)&&traverseStaticChildren(e,t,!0)):O(e,t,i,h,r,a,l,c,d)},I=(e,t,n,i,o,r,s,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?o.ctx.activate(t,n,i,s,l):k(t,n,i,o,r,s,l):L(e,t,l)},k=(e,t,n,i,o,r,s)=>{const a=e.component=createComponentInstance(e,i,o);if(isKeepAlive(e)&&(a.ctx.renderer=z),setupComponent(a),a.asyncDep){if(o&&o.registerDep(a,D),!e.el){const e=a.subTree=createVNode(Comment);v(null,e,t,n)}}else D(a,e,t,n,o,r,s)},L=(e,t,n)=>{const i=t.component=e.component;if(shouldUpdateComponent(e,t,n)){if(i.asyncDep&&!i.asyncResolved)return void N(i,t,n);i.next=t,invalidateJob(i.update),i.update()}else t.el=e.el,i.vnode=t},D=(e,t,n,i,o,r,s)=>{const a=e.effect=new ReactiveEffect((()=>{if(e.isMounted){let t,{next:n,bu:i,u:a,parent:l,vnode:c}=e,u=n;toggleRecurse(e,!1),n?(n.el=c.el,N(e,n,s)):n=c,i&&invokeArrayFns(i),(t=n.props&&n.props.onVnodeBeforeUpdate)&&invokeVNodeHook(t,l,n,c),toggleRecurse(e,!0);const h=renderComponentRoot(e),g=e.subTree;e.subTree=h,f(g,h,d(g.el),W(g),e,o,r),n.el=h.el,null===u&&updateHOCHostEl(e,h.el),a&&queuePostRenderEffect(a,o),(t=n.props&&n.props.onVnodeUpdated)&&queuePostRenderEffect((()=>invokeVNodeHook(t,l,n,c)),o)}else{let s;const{el:a,props:l}=t,{bm:c,m:d,parent:u}=e,h=isAsyncWrapper(t);if(toggleRecurse(e,!1),c&&invokeArrayFns(c),!h&&(s=l&&l.onVnodeBeforeMount)&&invokeVNodeHook(s,u,t),toggleRecurse(e,!0),a&&j){const n=()=>{e.subTree=renderComponentRoot(e),j(a,e.subTree,e,o,null)};h?t.type.__asyncLoader().then((()=>!e.isUnmounted&&n())):n()}else{const s=e.subTree=renderComponentRoot(e);f(null,s,n,i,e,o,r),t.el=s.el}if(d&&queuePostRenderEffect(d,o),!h&&(s=l&&l.onVnodeMounted)){const e=t;queuePostRenderEffect((()=>invokeVNodeHook(s,u,e)),o)}(256&t.shapeFlag||u&&isAsyncWrapper(u.vnode)&&256&u.vnode.shapeFlag)&&e.a&&queuePostRenderEffect(e.a,o),e.isMounted=!0,t=n=i=null}}),(()=>queueJob(l)),e.scope),l=e.update=()=>a.run();l.id=e.uid,toggleRecurse(e,!0),l()},N=(e,t,n)=>{t.component=e;const i=e.vnode.props;e.vnode=t,e.next=null,updateProps(e,t.props,i,n),updateSlots(e,t.children,n),pauseTracking(),flushPreFlushCbs(void 0,e.update),resetTracking()},O=(e,t,n,i,o,r,s,a,l=!1)=>{const d=e&&e.children,u=e?e.shapeFlag:0,h=t.children,{patchFlag:g,shapeFlag:p}=t;if(g>0){if(128&g)return void P(d,h,n,i,o,r,s,a,l);if(256&g)return void A(d,h,n,i,o,r,s,a,l)}8&p?(16&u&&V(d,o,r),h!==d&&c(n,h)):16&u?16&p?P(d,h,n,i,o,r,s,a,l):V(d,o,r,!0):(8&u&&c(n,""),16&p&&S(h,n,i,o,r,s,a,l))},A=(e,t,n,i,o,r,s,a,l)=>{t=t||EMPTY_ARR;const c=(e=e||EMPTY_ARR).length,d=t.length,u=Math.min(c,d);let h;for(h=0;h<u;h++){const i=t[h]=l?cloneIfMounted(t[h]):normalizeVNode(t[h]);f(e[h],i,n,null,o,r,s,a,l)}c>d?V(e,o,r,!0,!1,u):S(t,n,i,o,r,s,a,l,u)},P=(e,t,n,i,o,r,s,a,l)=>{let c=0;const d=t.length;let u=e.length-1,h=d-1;for(;c<=u&&c<=h;){const i=e[c],d=t[c]=l?cloneIfMounted(t[c]):normalizeVNode(t[c]);if(!isSameVNodeType(i,d))break;f(i,d,n,null,o,r,s,a,l),c++}for(;c<=u&&c<=h;){const i=e[u],c=t[h]=l?cloneIfMounted(t[h]):normalizeVNode(t[h]);if(!isSameVNodeType(i,c))break;f(i,c,n,null,o,r,s,a,l),u--,h--}if(c>u){if(c<=h){const e=h+1,u=e<d?t[e].el:i;for(;c<=h;)f(null,t[c]=l?cloneIfMounted(t[c]):normalizeVNode(t[c]),n,u,o,r,s,a,l),c++}}else if(c>h)for(;c<=u;)M(e[c],o,r,!0),c++;else{const g=c,p=c,m=new Map;for(c=p;c<=h;c++){const e=t[c]=l?cloneIfMounted(t[c]):normalizeVNode(t[c]);null!=e.key&&m.set(e.key,c)}let v,_=0;const C=h-p+1;let b=!1,y=0;const S=new Array(C);for(c=0;c<C;c++)S[c]=0;for(c=g;c<=u;c++){const i=e[c];if(_>=C){M(i,o,r,!0);continue}let d;if(null!=i.key)d=m.get(i.key);else for(v=p;v<=h;v++)if(0===S[v-p]&&isSameVNodeType(i,t[v])){d=v;break}void 0===d?M(i,o,r,!0):(S[d-p]=c+1,d>=y?y=d:b=!0,f(i,t[d],n,null,o,r,s,a,l),_++)}const w=b?getSequence(S):EMPTY_ARR;for(v=w.length-1,c=C-1;c>=0;c--){const e=p+c,u=t[e],h=e+1<d?t[e+1].el:i;0===S[c]?f(null,u,n,h,o,r,s,a,l):b&&(v<0||c!==w[v]?R(u,n,h,2):v--)}}},R=(e,t,i,o,r=null)=>{const{el:s,type:a,transition:l,children:c,shapeFlag:d}=e;if(6&d)return void R(e.component.subTree,t,i,o);if(128&d)return void e.suspense.move(t,i,o);if(64&d)return void a.move(e,t,i,z);if(a===Fragment){n(s,t,i);for(let e=0;e<c.length;e++)R(c[e],t,i,o);return void n(e.anchor,t,i)}if(a===Static)return void(({el:e,anchor:t},i,o)=>{let r;for(;e&&e!==t;)r=u(e),n(e,i,o),e=r;n(t,i,o)})(e,t,i);if(2!==o&&1&d&&l)if(0===o)l.beforeEnter(s),n(s,t,i),queuePostRenderEffect((()=>l.enter(s)),r);else{const{leave:e,delayLeave:o,afterLeave:r}=l,a=()=>n(s,t,i),c=()=>{e(s,(()=>{a(),r&&r()}))};o?o(s,a,c):c()}else n(s,t,i)},M=(e,t,n,i=!1,o=!1)=>{const{type:r,props:s,ref:a,children:l,dynamicChildren:c,shapeFlag:d,patchFlag:u,dirs:h}=e;if(null!=a&&setRef(a,null,n,e,!0),256&d)return void t.ctx.deactivate(e);const g=1&d&&h,p=!isAsyncWrapper(e);let f;if(p&&(f=s&&s.onVnodeBeforeUnmount)&&invokeVNodeHook(f,t,e),6&d)B(e.component,n,i);else{if(128&d)return void e.suspense.unmount(n,i);g&&invokeDirectiveHook(e,null,t,"beforeUnmount"),64&d?e.type.remove(e,t,n,o,z,i):c&&(r!==Fragment||u>0&&64&u)?V(c,t,n,!1,!0):(r===Fragment&&384&u||!o&&16&d)&&V(l,t,n),i&&$(e)}(p&&(f=s&&s.onVnodeUnmounted)||g)&&queuePostRenderEffect((()=>{f&&invokeVNodeHook(f,t,e),g&&invokeDirectiveHook(e,null,t,"unmounted")}),n)},$=e=>{const{type:t,el:n,anchor:o,transition:r}=e;if(t===Fragment)return void F(n,o);if(t===Static)return void(({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=u(e),i(e),e=n;i(t)})(e);const s=()=>{i(n),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){const{leave:t,delayLeave:i}=r,o=()=>t(n,s);i?i(e.el,s,o):o()}else s()},F=(e,t)=>{let n;for(;e!==t;)n=u(e),i(e),e=n;i(t)},B=(e,t,n)=>{const{bum:i,scope:o,update:r,subTree:s,um:a}=e;i&&invokeArrayFns(i),o.stop(),r&&(r.active=!1,M(s,e,t,n)),a&&queuePostRenderEffect(a,t),queuePostRenderEffect((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},V=(e,t,n,i=!1,o=!1,r=0)=>{for(let s=r;s<e.length;s++)M(e[s],t,n,i,o)},W=e=>6&e.shapeFlag?W(e.component.subTree):128&e.shapeFlag?e.suspense.next():u(e.anchor||e.el),H=(e,t,n)=>{null==e?t._vnode&&M(t._vnode,null,null,!0):f(t._vnode||null,e,t,null,null,null,n),flushPostFlushCbs(),t._vnode=e},z={p:f,um:M,m:R,r:$,mt:k,mc:S,pc:O,pbc:E,n:W,o:e};let K,j;return t&&([K,j]=t(z)),{render:H,hydrate:K,createApp:createAppAPI(H,K)}}function toggleRecurse({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function traverseStaticChildren(e,t,n=!1){const i=e.children,o=t.children;if(isArray$7(i)&&isArray$7(o))for(let r=0;r<i.length;r++){const e=i[r];let t=o[r];1&t.shapeFlag&&!t.dynamicChildren&&((t.patchFlag<=0||32===t.patchFlag)&&(t=o[r]=cloneIfMounted(o[r]),t.el=e.el),n||traverseStaticChildren(e,t))}}function getSequence(e){const t=e.slice(),n=[0];let i,o,r,s,a;const l=e.length;for(i=0;i<l;i++){const l=e[i];if(0!==l){if(o=n[n.length-1],e[o]<l){t[i]=o,n.push(i);continue}for(r=0,s=n.length-1;r<s;)a=r+s>>1,e[n[a]]<l?r=a+1:s=a;l<e[n[r]]&&(r>0&&(t[i]=n[r-1]),n[r]=i)}}for(r=n.length,s=n[r-1];r-- >0;)n[r]=s,s=t[s];return n}const isTeleport=e=>e.__isTeleport,isTeleportDisabled=e=>e&&(e.disabled||""===e.disabled),isTargetSVG=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,resolveTarget=(e,t)=>{const n=e&&e.to;if(isString$6(n)){if(t){return t(n)}return null}return n},TeleportImpl={__isTeleport:!0,process(e,t,n,i,o,r,s,a,l,c){const{mc:d,pc:u,pbc:h,o:{insert:g,querySelector:p,createText:f,createComment:m}}=c,v=isTeleportDisabled(t.props);let{shapeFlag:_,children:C,dynamicChildren:b}=t;if(null==e){const e=t.el=f(""),c=t.anchor=f("");g(e,n,i),g(c,n,i);const u=t.target=resolveTarget(t.props,p),h=t.targetAnchor=f("");u&&(g(h,u),s=s||isTargetSVG(u));const m=(e,t)=>{16&_&&d(C,e,t,o,r,s,a,l)};v?m(n,c):u&&m(u,h)}else{t.el=e.el;const i=t.anchor=e.anchor,d=t.target=e.target,g=t.targetAnchor=e.targetAnchor,f=isTeleportDisabled(e.props),m=f?n:d,_=f?i:g;if(s=s||isTargetSVG(d),b?(h(e.dynamicChildren,b,m,o,r,s,a),traverseStaticChildren(e,t,!0)):l||u(e,t,m,_,o,r,s,a,!1),v)f||moveTeleport(t,n,i,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=t.target=resolveTarget(t.props,p);e&&moveTeleport(t,e,null,c,0)}else f&&moveTeleport(t,d,g,c,1)}},remove(e,t,n,i,{um:o,o:{remove:r}},s){const{shapeFlag:a,children:l,anchor:c,targetAnchor:d,target:u,props:h}=e;if(u&&r(d),(s||!isTeleportDisabled(h))&&(r(c),16&a))for(let g=0;g<l.length;g++){const e=l[g];o(e,t,n,!0,!!e.dynamicChildren)}},move:moveTeleport,hydrate:hydrateTeleport};function moveTeleport(e,t,n,{o:{insert:i},m:o},r=2){0===r&&i(e.targetAnchor,t,n);const{el:s,anchor:a,shapeFlag:l,children:c,props:d}=e,u=2===r;if(u&&i(s,t,n),(!u||isTeleportDisabled(d))&&16&l)for(let h=0;h<c.length;h++)o(c[h],t,n,2);u&&i(a,t,n)}function hydrateTeleport(e,t,n,i,o,r,{o:{nextSibling:s,parentNode:a,querySelector:l}},c){const d=t.target=resolveTarget(t.props,l);if(d){const l=d._lpa||d.firstChild;if(16&t.shapeFlag)if(isTeleportDisabled(t.props))t.anchor=c(s(e),t,a(e),n,i,o,r),t.targetAnchor=l;else{t.anchor=s(e);let a=l;for(;a;)if(a=s(a),a&&8===a.nodeType&&"teleport anchor"===a.data){t.targetAnchor=a,d._lpa=t.targetAnchor&&s(t.targetAnchor);break}c(l,t,d,n,i,o,r)}}return t.anchor&&s(t.anchor)}const Teleport=TeleportImpl,Fragment=Symbol(void 0),Text$1=Symbol(void 0),Comment=Symbol(void 0),Static=Symbol(void 0),blockStack=[];let currentBlock=null;function openBlock(e=!1){blockStack.push(currentBlock=e?null:[])}function closeBlock(){blockStack.pop(),currentBlock=blockStack[blockStack.length-1]||null}let isBlockTreeEnabled=1;function setBlockTracking(e){isBlockTreeEnabled+=e}function setupBlock(e){return e.dynamicChildren=isBlockTreeEnabled>0?currentBlock||EMPTY_ARR:null,closeBlock(),isBlockTreeEnabled>0&¤tBlock&¤tBlock.push(e),e}function createElementBlock(e,t,n,i,o,r){return setupBlock(createBaseVNode(e,t,n,i,o,r,!0))}function createBlock(e,t,n,i,o){return setupBlock(createVNode(e,t,n,i,o,!0))}function isVNode(e){return!!e&&!0===e.__v_isVNode}function isSameVNodeType(e,t){return e.type===t.type&&e.key===t.key}function transformVNodeArgs(e){}const InternalObjectKey="__vInternal",normalizeKey=({key:e})=>null!=e?e:null,normalizeRef=({ref:e,ref_key:t,ref_for:n})=>null!=e?isString$6(e)||isRef(e)||isFunction$5(e)?{i:currentRenderingInstance,r:e,k:t,f:!!n}:e:null;function createBaseVNode(e,t=null,n=null,i=0,o=null,r=(e===Fragment?0:1),s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&normalizeKey(t),ref:t&&normalizeRef(t),scopeId:currentScopeId,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:o,dynamicChildren:null,appContext:null};return a?(normalizeChildren(l,n),128&r&&e.normalize(l)):n&&(l.shapeFlag|=isString$6(n)?8:16),isBlockTreeEnabled>0&&!s&¤tBlock&&(l.patchFlag>0||6&r)&&32!==l.patchFlag&¤tBlock.push(l),l}const createVNode=_createVNode;function _createVNode(e,t=null,n=null,i=0,o=null,r=!1){if(e&&e!==NULL_DYNAMIC_COMPONENT||(e=Comment),isVNode(e)){const i=cloneVNode(e,t,!0);return n&&normalizeChildren(i,n),isBlockTreeEnabled>0&&!r&¤tBlock&&(6&i.shapeFlag?currentBlock[currentBlock.indexOf(e)]=i:currentBlock.push(i)),i.patchFlag|=-2,i}if(isClassComponent(e)&&(e=e.__vccOpts),t){t=guardReactiveProps(t);let{class:e,style:n}=t;e&&!isString$6(e)&&(t.class=normalizeClass(e)),isObject$7(n)&&(isProxy(n)&&!isArray$7(n)&&(n=extend$1({},n)),t.style=normalizeStyle(n))}return createBaseVNode(e,t,n,i,o,isString$6(e)?1:isSuspense(e)?128:isTeleport(e)?64:isObject$7(e)?4:isFunction$5(e)?2:0,r,!0)}function guardReactiveProps(e){return e?isProxy(e)||InternalObjectKey in e?extend$1({},e):e:null}function cloneVNode(e,t,n=!1){const{props:i,ref:o,patchFlag:r,children:s}=e,a=t?mergeProps(i||{},t):i;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:a,key:a&&normalizeKey(a),ref:t&&t.ref?n&&o?isArray$7(o)?o.concat(normalizeRef(t)):[o,normalizeRef(t)]:normalizeRef(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Fragment?-1===r?16:16|r:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&cloneVNode(e.ssContent),ssFallback:e.ssFallback&&cloneVNode(e.ssFallback),el:e.el,anchor:e.anchor}}function createTextVNode(e=" ",t=0){return createVNode(Text$1,null,e,t)}function createStaticVNode(e,t){const n=createVNode(Static,null,e);return n.staticCount=t,n}function createCommentVNode(e="",t=!1){return t?(openBlock(),createBlock(Comment,null,e)):createVNode(Comment,null,e)}function normalizeVNode(e){return null==e||"boolean"==typeof e?createVNode(Comment):isArray$7(e)?createVNode(Fragment,null,e.slice()):"object"==typeof e?cloneIfMounted(e):createVNode(Text$1,null,String(e))}function cloneIfMounted(e){return null===e.el||e.memo?e:cloneVNode(e)}function normalizeChildren(e,t){let n=0;const{shapeFlag:i}=e;if(null==t)t=null;else if(isArray$7(t))n=16;else if("object"==typeof t){if(65&i){const n=t.default;return void(n&&(n._c&&(n._d=!1),normalizeChildren(e,n()),n._c&&(n._d=!0)))}{n=32;const i=t._;i||InternalObjectKey in t?3===i&¤tRenderingInstance&&(1===currentRenderingInstance.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=currentRenderingInstance}}else isFunction$5(t)?(t={default:t,_ctx:currentRenderingInstance},n=32):(t=String(t),64&i?(n=16,t=[createTextVNode(t)]):n=8);e.children=t,e.shapeFlag|=n}function mergeProps(...e){const t={};for(let n=0;n<e.length;n++){const i=e[n];for(const e in i)if("class"===e)t.class!==i.class&&(t.class=normalizeClass([t.class,i.class]));else if("style"===e)t.style=normalizeStyle([t.style,i.style]);else if(isOn$1(e)){const n=t[e],o=i[e];!o||n===o||isArray$7(n)&&n.includes(o)||(t[e]=n?[].concat(n,o):o)}else""!==e&&(t[e]=i[e])}return t}function invokeVNodeHook(e,t,n,i=null){callWithAsyncErrorHandling(e,t,7,[n,i])}const emptyAppContext=createAppContext();let uid$1$1=0;function createComponentInstance(e,t,n){const i=e.type,o=(t?t.appContext:e.appContext)||emptyAppContext,r={uid:uid$1$1++,vnode:e,type:i,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,scope:new EffectScope(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:normalizePropsOptions(i,o),emitsOptions:normalizeEmitsOptions(i,o),emit:null,emitted:null,propsDefaults:EMPTY_OBJ,inheritAttrs:i.inheritAttrs,ctx:EMPTY_OBJ,data:EMPTY_OBJ,props:EMPTY_OBJ,attrs:EMPTY_OBJ,slots:EMPTY_OBJ,refs:EMPTY_OBJ,setupState:EMPTY_OBJ,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return r.ctx={_:r},r.root=t?t.root:r,r.emit=emit$1.bind(null,r),e.ce&&e.ce(r),r}let currentInstance=null;const getCurrentInstance=()=>currentInstance||currentRenderingInstance,setCurrentInstance=e=>{currentInstance=e,e.scope.on()},unsetCurrentInstance=()=>{currentInstance&¤tInstance.scope.off(),currentInstance=null};function isStatefulComponent(e){return 4&e.vnode.shapeFlag}let isInSSRComponentSetup=!1,compile$2,installWithProxy;function setupComponent(e,t=!1){isInSSRComponentSetup=t;const{props:n,children:i}=e.vnode,o=isStatefulComponent(e);initProps(e,n,o,t),initSlots(e,i);const r=o?setupStatefulComponent(e,t):void 0;return isInSSRComponentSetup=!1,r}function setupStatefulComponent(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=markRaw(new Proxy(e.ctx,PublicInstanceProxyHandlers));const{setup:i}=n;if(i){const n=e.setupContext=i.length>1?createSetupContext(e):null;setCurrentInstance(e),pauseTracking();const o=callWithErrorHandling(i,e,0,[e.props,n]);if(resetTracking(),unsetCurrentInstance(),isPromise$1(o)){if(o.then(unsetCurrentInstance,unsetCurrentInstance),t)return o.then((n=>{handleSetupResult(e,n,t)})).catch((t=>{handleError(t,e,0)}));e.asyncDep=o}else handleSetupResult(e,o,t)}else finishComponentSetup(e,t)}function handleSetupResult(e,t,n){isFunction$5(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:isObject$7(t)&&(e.setupState=proxyRefs(t)),finishComponentSetup(e,n)}function registerRuntimeCompiler(e){compile$2=e,installWithProxy=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,RuntimeCompiledPublicInstanceProxyHandlers))}}const isRuntimeOnly=()=>!compile$2;function finishComponentSetup(e,t,n){const i=e.type;if(!e.render){if(!t&&compile$2&&!i.render){const t=i.template;if(t){const{isCustomElement:n,compilerOptions:o}=e.appContext.config,{delimiters:r,compilerOptions:s}=i,a=extend$1(extend$1({isCustomElement:n,delimiters:r},o),s);i.render=compile$2(t,a)}}e.render=i.render||NOOP,installWithProxy&&installWithProxy(e)}setCurrentInstance(e),pauseTracking(),applyOptions(e),resetTracking(),unsetCurrentInstance()}function createAttrsProxy(e){return new Proxy(e.attrs,{get:(t,n)=>(track(e,"get","$attrs"),t[n])})}function createSetupContext(e){const t=t=>{e.exposed=t||{}};let n;return{get attrs(){return n||(n=createAttrsProxy(e))},slots:e.slots,emit:e.emit,expose:t}}function getExposeProxy(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(proxyRefs(markRaw(e.exposed)),{get:(t,n)=>n in t?t[n]:n in publicPropertiesMap?publicPropertiesMap[n](e):void 0}))}const classifyRE=/(?:^|[-_])(\w)/g,classify=e=>e.replace(classifyRE,(e=>e.toUpperCase())).replace(/[-_]/g,"");function getComponentName(e,t=!0){return isFunction$5(e)?e.displayName||e.name:e.name||t&&e.__name}function formatComponentName(e,t,n=!1){let i=getComponentName(t);if(!i&&t.__file){const e=t.__file.match(/([^/\\]+)\.\w+$/);e&&(i=e[1])}if(!i&&e&&e.parent){const n=e=>{for(const n in e)if(e[n]===t)return n};i=n(e.components||e.parent.type.components)||n(e.appContext.components)}return i?classify(i):n?"App":"Anonymous"}function isClassComponent(e){return isFunction$5(e)&&"__vccOpts"in e}const computed=(e,t)=>computed$1(e,t,isInSSRComponentSetup);function defineProps(){return null}function defineEmits(){return null}function defineExpose(e){}function withDefaults(e,t){return null}function useSlots(){return getContext().slots}function useAttrs(){return getContext().attrs}function getContext(){const e=getCurrentInstance();return e.setupContext||(e.setupContext=createSetupContext(e))}function mergeDefaults(e,t){const n=isArray$7(e)?e.reduce(((e,t)=>(e[t]={},e)),{}):e;for(const i in t){const e=n[i];e?isArray$7(e)||isFunction$5(e)?n[i]={type:e,default:t[i]}:e.default=t[i]:null===e&&(n[i]={default:t[i]})}return n}function createPropsRestProxy(e,t){const n={};for(const i in e)t.includes(i)||Object.defineProperty(n,i,{enumerable:!0,get:()=>e[i]});return n}function withAsyncContext(e){const t=getCurrentInstance();let n=e();return unsetCurrentInstance(),isPromise$1(n)&&(n=n.catch((e=>{throw setCurrentInstance(t),e}))),[n,()=>setCurrentInstance(t)]}function h$1(e,t,n){const i=arguments.length;return 2===i?isObject$7(t)&&!isArray$7(t)?isVNode(t)?createVNode(e,null,[t]):createVNode(e,t):createVNode(e,null,t):(i>3?n=Array.prototype.slice.call(arguments,2):3===i&&isVNode(n)&&(n=[n]),createVNode(e,t,n))}const ssrContextKey=Symbol(""),useSSRContext=()=>{{const e=inject(ssrContextKey);return e||warn$1("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function initCustomFormatter(){}function withMemo(e,t,n,i){const o=n[i];if(o&&isMemoSame(o,e))return o;const r=t();return r.memo=e.slice(),n[i]=r}function isMemoSame(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let i=0;i<n.length;i++)if(hasChanged(n[i],t[i]))return!1;return isBlockTreeEnabled>0&¤tBlock&¤tBlock.push(e),!0}const version="3.2.37",_ssrUtils={createComponentInstance:createComponentInstance,setupComponent:setupComponent,renderComponentRoot:renderComponentRoot,setCurrentRenderingInstance:setCurrentRenderingInstance,isVNode:isVNode,normalizeVNode:normalizeVNode},ssrUtils=_ssrUtils,resolveFilter=null,compatUtils=null,svgNS="http://www.w3.org/2000/svg",doc="undefined"!=typeof document?document:null,templateContainer=doc&&doc.createElement("template"),nodeOps={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const o=t?doc.createElementNS(svgNS,e):doc.createElement(e,n?{is:n}:void 0);return"select"===e&&i&&null!=i.multiple&&o.setAttribute("multiple",i.multiple),o},createText:e=>doc.createTextNode(e),createComment:e=>doc.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>doc.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},cloneNode(e){const t=e.cloneNode(!0);return"_value"in e&&(t._value=e._value),t},insertStaticContent(e,t,n,i,o,r){const s=n?n.previousSibling:t.lastChild;if(o&&(o===r||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),o!==r&&(o=o.nextSibling););else{templateContainer.innerHTML=i?`<svg>${e}</svg>`:e;const o=templateContainer.content;if(i){const e=o.firstChild;for(;e.firstChild;)o.appendChild(e.firstChild);o.removeChild(e)}t.insertBefore(o,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};function patchClass(e,t,n){const i=e._vtc;i&&(t=(t?[t,...i]:[...i]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}function patchStyle(e,t,n){const i=e.style,o=isString$6(n);if(n&&!o){for(const e in n)setStyle$1(i,e,n[e]);if(t&&!isString$6(t))for(const e in t)null==n[e]&&setStyle$1(i,e,"")}else{const r=i.display;o?t!==n&&(i.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(i.display=r)}}const importantRE=/\s*!important$/;function setStyle$1(e,t,n){if(isArray$7(n))n.forEach((n=>setStyle$1(e,t,n)));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=autoPrefix(e,t);importantRE.test(n)?e.setProperty(hyphenate$1(i),n.replace(importantRE,""),"important"):e[i]=n}}const prefixes=["Webkit","Moz","ms"],prefixCache={};function autoPrefix(e,t){const n=prefixCache[t];if(n)return n;let i=camelize$1(t);if("filter"!==i&&i in e)return prefixCache[t]=i;i=capitalize(i);for(let o=0;o<prefixes.length;o++){const n=prefixes[o]+i;if(n in e)return prefixCache[t]=n}return t}const xlinkNS="http://www.w3.org/1999/xlink";function patchAttr(e,t,n,i,o){if(i&&t.startsWith("xlink:"))null==n?e.removeAttributeNS(xlinkNS,t.slice(6,t.length)):e.setAttributeNS(xlinkNS,t,n);else{const i=isSpecialBooleanAttr(t);null==n||i&&!includeBooleanAttr(n)?e.removeAttribute(t):e.setAttribute(t,i?"":n)}}function patchDOMProp(e,t,n,i,o,r,s){if("innerHTML"===t||"textContent"===t)return i&&s(i,o,r),void(e[t]=null==n?"":n);if("value"===t&&"PROGRESS"!==e.tagName&&!e.tagName.includes("-")){e._value=n;const i=null==n?"":n;return e.value===i&&"OPTION"!==e.tagName||(e.value=i),void(null==n&&e.removeAttribute(t))}let a=!1;if(""===n||null==n){const i=typeof e[t];"boolean"===i?n=includeBooleanAttr(n):null==n&&"string"===i?(n="",a=!0):"number"===i&&(n=0,a=!0)}try{e[t]=n}catch(l){}a&&e.removeAttribute(t)}const[_getNow,skipTimestampCheck]=(()=>{let e=Date.now,t=!1;if("undefined"!=typeof window){Date.now()>document.createEvent("Event").timeStamp&&(e=performance.now.bind(performance));const n=navigator.userAgent.match(/firefox\/(\d+)/i);t=!!(n&&Number(n[1])<=53)}return[e,t]})();let cachedNow=0;const p=Promise.resolve(),reset$1=()=>{cachedNow=0},getNow=()=>cachedNow||(p.then(reset$1),cachedNow=_getNow());function addEventListener$2(e,t,n,i){e.addEventListener(t,n,i)}function removeEventListener$1(e,t,n,i){e.removeEventListener(t,n,i)}function patchEvent(e,t,n,i,o=null){const r=e._vei||(e._vei={}),s=r[t];if(i&&s)s.value=i;else{const[n,a]=parseName(t);if(i){addEventListener$2(e,n,r[t]=createInvoker(i,o),a)}else s&&(removeEventListener$1(e,n,s,a),r[t]=void 0)}}const optionsModifierRE=/(?:Once|Passive|Capture)$/;function parseName(e){let t;if(optionsModifierRE.test(e)){let n;for(t={};n=e.match(optionsModifierRE);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[hyphenate$1(e.slice(2)),t]}function createInvoker(e,t){const n=e=>{const i=e.timeStamp||_getNow();(skipTimestampCheck||i>=n.attached-1)&&callWithAsyncErrorHandling(patchStopImmediatePropagation(e,n.value),t,5,[e])};return n.value=e,n.attached=getNow(),n}function patchStopImmediatePropagation(e,t){if(isArray$7(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e&&e(t)))}return t}const nativeOnRE=/^on[a-z]/,patchProp=(e,t,n,i,o=!1,r,s,a,l)=>{"class"===t?patchClass(e,i,o):"style"===t?patchStyle(e,n,i):isOn$1(t)?isModelListener(t)||patchEvent(e,t,n,i,s):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):shouldSetAsProp(e,t,i,o))?patchDOMProp(e,t,i,r,s,a,l):("true-value"===t?e._trueValue=i:"false-value"===t&&(e._falseValue=i),patchAttr(e,t,i,o))};function shouldSetAsProp(e,t,n,i){return i?"innerHTML"===t||"textContent"===t||!!(t in e&&nativeOnRE.test(t)&&isFunction$5(n)):"spellcheck"!==t&&"draggable"!==t&&"translate"!==t&&("form"!==t&&(("list"!==t||"INPUT"!==e.tagName)&&(("type"!==t||"TEXTAREA"!==e.tagName)&&((!nativeOnRE.test(t)||!isString$6(n))&&t in e))))}function defineCustomElement(e,t){const n=defineComponent(e);class i extends VueElement{constructor(e){super(n,e,t)}}return i.def=n,i}const defineSSRCustomElement=e=>defineCustomElement(e,hydrate),BaseClass="undefined"!=typeof HTMLElement?HTMLElement:class{};class VueElement extends BaseClass{constructor(e,t={},n){super(),this._def=e,this._props=t,this._instance=null,this._connected=!1,this._resolved=!1,this._numberProps=null,this.shadowRoot&&n?n(this._createVNode(),this.shadowRoot):this.attachShadow({mode:"open"})}connectedCallback(){this._connected=!0,this._instance||this._resolveDef()}disconnectedCallback(){this._connected=!1,nextTick((()=>{this._connected||(render(null,this.shadowRoot),this._instance=null)}))}_resolveDef(){if(this._resolved)return;this._resolved=!0;for(let n=0;n<this.attributes.length;n++)this._setAttr(this.attributes[n].name);new MutationObserver((e=>{for(const t of e)this._setAttr(t.attributeName)})).observe(this,{attributes:!0});const e=e=>{const{props:t,styles:n}=e,i=!isArray$7(t),o=t?i?Object.keys(t):t:[];let r;if(i)for(const s in this._props){const e=t[s];(e===Number||e&&e.type===Number)&&(this._props[s]=toNumber$1(this._props[s]),(r||(r=Object.create(null)))[s]=!0)}this._numberProps=r;for(const s of Object.keys(this))"_"!==s[0]&&this._setProp(s,this[s],!0,!1);for(const s of o.map(camelize$1))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(e){this._setProp(s,e)}});this._applyStyles(n),this._update()},t=this._def.__asyncLoader;t?t().then(e):e(this._def)}_setAttr(e){let t=this.getAttribute(e);this._numberProps&&this._numberProps[e]&&(t=toNumber$1(t)),this._setProp(camelize$1(e),t,!1)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,i=!0){t!==this._props[e]&&(this._props[e]=t,i&&this._instance&&this._update(),n&&(!0===t?this.setAttribute(hyphenate$1(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(hyphenate$1(e),t+""):t||this.removeAttribute(hyphenate$1(e))))}_update(){render(this._createVNode(),this.shadowRoot)}_createVNode(){const e=createVNode(this._def,extend$1({},this._props));return this._instance||(e.ce=e=>{this._instance=e,e.isCE=!0,e.emit=(e,...t)=>{this.dispatchEvent(new CustomEvent(e,{detail:t}))};let t=this;for(;t=t&&(t.parentNode||t.host);)if(t instanceof VueElement){e.parent=t._instance;break}}),e}_applyStyles(e){e&&e.forEach((e=>{const t=document.createElement("style");t.textContent=e,this.shadowRoot.appendChild(t)}))}}function useCssModule(e="$style"){{const t=getCurrentInstance();if(!t)return EMPTY_OBJ;const n=t.type.__cssModules;if(!n)return EMPTY_OBJ;const i=n[e];return i||EMPTY_OBJ}}function useCssVars(e){const t=getCurrentInstance();if(!t)return;const n=()=>setVarsOnVNode(t.subTree,e(t.proxy));watchPostEffect(n),onMounted((()=>{const e=new MutationObserver(n);e.observe(t.subTree.el.parentNode,{childList:!0}),onUnmounted((()=>e.disconnect()))}))}function setVarsOnVNode(e,t){if(128&e.shapeFlag){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push((()=>{setVarsOnVNode(n.activeBranch,t)}))}for(;e.component;)e=e.component.subTree;if(1&e.shapeFlag&&e.el)setVarsOnNode(e.el,t);else if(e.type===Fragment)e.children.forEach((e=>setVarsOnVNode(e,t)));else if(e.type===Static){let{el:n,anchor:i}=e;for(;n&&(setVarsOnNode(n,t),n!==i);)n=n.nextSibling}}function setVarsOnNode(e,t){if(1===e.nodeType){const n=e.style;for(const e in t)n.setProperty(`--${e}`,t[e])}}const TRANSITION="transition",ANIMATION="animation",Transition=(e,{slots:t})=>h$1(BaseTransition,resolveTransitionProps(e),t);Transition.displayName="Transition";const DOMTransitionPropsValidators={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},TransitionPropsValidators=Transition.props=extend$1({},BaseTransition.props,DOMTransitionPropsValidators),callHook=(e,t=[])=>{isArray$7(e)?e.forEach((e=>e(...t))):e&&e(...t)},hasExplicitCallback=e=>!!e&&(isArray$7(e)?e.some((e=>e.length>1)):e.length>1);function resolveTransitionProps(e){const t={};for(const k in e)k in DOMTransitionPropsValidators||(t[k]=e[k]);if(!1===e.css)return t;const{name:n="v",type:i,duration:o,enterFromClass:r=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=r,appearActiveClass:c=s,appearToClass:d=a,leaveFromClass:u=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:g=`${n}-leave-to`}=e,p=normalizeDuration(o),f=p&&p[0],m=p&&p[1],{onBeforeEnter:v,onEnter:_,onEnterCancelled:C,onLeave:b,onLeaveCancelled:y,onBeforeAppear:S=v,onAppear:w=_,onAppearCancelled:E=C}=t,x=(e,t,n)=>{removeTransitionClass(e,t?d:a),removeTransitionClass(e,t?c:s),n&&n()},T=(e,t)=>{e._isLeaving=!1,removeTransitionClass(e,u),removeTransitionClass(e,g),removeTransitionClass(e,h),t&&t()},I=e=>(t,n)=>{const o=e?w:_,s=()=>x(t,e,n);callHook(o,[t,s]),nextFrame((()=>{removeTransitionClass(t,e?l:r),addTransitionClass(t,e?d:a),hasExplicitCallback(o)||whenTransitionEnds(t,i,f,s)}))};return extend$1(t,{onBeforeEnter(e){callHook(v,[e]),addTransitionClass(e,r),addTransitionClass(e,s)},onBeforeAppear(e){callHook(S,[e]),addTransitionClass(e,l),addTransitionClass(e,c)},onEnter:I(!1),onAppear:I(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>T(e,t);addTransitionClass(e,u),forceReflow(),addTransitionClass(e,h),nextFrame((()=>{e._isLeaving&&(removeTransitionClass(e,u),addTransitionClass(e,g),hasExplicitCallback(b)||whenTransitionEnds(e,i,m,n))})),callHook(b,[e,n])},onEnterCancelled(e){x(e,!1),callHook(C,[e])},onAppearCancelled(e){x(e,!0),callHook(E,[e])},onLeaveCancelled(e){T(e),callHook(y,[e])}})}function normalizeDuration(e){if(null==e)return null;if(isObject$7(e))return[NumberOf(e.enter),NumberOf(e.leave)];{const t=NumberOf(e);return[t,t]}}function NumberOf(e){return toNumber$1(e)}function addTransitionClass(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.add(t))),(e._vtc||(e._vtc=new Set)).add(t)}function removeTransitionClass(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.remove(t)));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function nextFrame(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}let endId=0;function whenTransitionEnds(e,t,n,i){const o=e._endId=++endId,r=()=>{o===e._endId&&i()};if(n)return setTimeout(r,n);const{type:s,timeout:a,propCount:l}=getTransitionInfo(e,t);if(!s)return i();const c=s+"end";let d=0;const u=()=>{e.removeEventListener(c,h),r()},h=t=>{t.target===e&&++d>=l&&u()};setTimeout((()=>{d<l&&u()}),a+1),e.addEventListener(c,h)}function getTransitionInfo(e,t){const n=window.getComputedStyle(e),i=e=>(n[e]||"").split(", "),o=i(TRANSITION+"Delay"),r=i(TRANSITION+"Duration"),s=getTimeout(o,r),a=i(ANIMATION+"Delay"),l=i(ANIMATION+"Duration"),c=getTimeout(a,l);let d=null,u=0,h=0;t===TRANSITION?s>0&&(d=TRANSITION,u=s,h=r.length):t===ANIMATION?c>0&&(d=ANIMATION,u=c,h=l.length):(u=Math.max(s,c),d=u>0?s>c?TRANSITION:ANIMATION:null,h=d?d===TRANSITION?r.length:l.length:0);return{type:d,timeout:u,propCount:h,hasTransform:d===TRANSITION&&/\b(transform|all)(,|$)/.test(n[TRANSITION+"Property"])}}function getTimeout(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map(((t,n)=>toMs(t)+toMs(e[n]))))}function toMs(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function forceReflow(){return document.body.offsetHeight}const positionMap=new WeakMap,newPositionMap=new WeakMap,TransitionGroupImpl={name:"TransitionGroup",props:extend$1({},TransitionPropsValidators,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=getCurrentInstance(),i=useTransitionState();let o,r;return onUpdated((()=>{if(!o.length)return;const t=e.moveClass||`${e.name||"v"}-move`;if(!hasCSSTransform(o[0].el,n.vnode.el,t))return;o.forEach(callPendingCbs),o.forEach(recordPosition);const i=o.filter(applyTranslation);forceReflow(),i.forEach((e=>{const n=e.el,i=n.style;addTransitionClass(n,t),i.transform=i.webkitTransform=i.transitionDuration="";const o=n._moveCb=e=>{e&&e.target!==n||e&&!/transform$/.test(e.propertyName)||(n.removeEventListener("transitionend",o),n._moveCb=null,removeTransitionClass(n,t))};n.addEventListener("transitionend",o)}))})),()=>{const s=toRaw(e),a=resolveTransitionProps(s);let l=s.tag||Fragment;o=r,r=t.default?getTransitionRawChildren(t.default()):[];for(let e=0;e<r.length;e++){const t=r[e];null!=t.key&&setTransitionHooks(t,resolveTransitionHooks(t,a,i,n))}if(o)for(let e=0;e<o.length;e++){const t=o[e];setTransitionHooks(t,resolveTransitionHooks(t,a,i,n)),positionMap.set(t,t.el.getBoundingClientRect())}return createVNode(l,null,r)}}},TransitionGroup=TransitionGroupImpl;function callPendingCbs(e){const t=e.el;t._moveCb&&t._moveCb(),t._enterCb&&t._enterCb()}function recordPosition(e){newPositionMap.set(e,e.el.getBoundingClientRect())}function applyTranslation(e){const t=positionMap.get(e),n=newPositionMap.get(e),i=t.left-n.left,o=t.top-n.top;if(i||o){const t=e.el.style;return t.transform=t.webkitTransform=`translate(${i}px,${o}px)`,t.transitionDuration="0s",e}}function hasCSSTransform(e,t,n){const i=e.cloneNode();e._vtc&&e._vtc.forEach((e=>{e.split(/\s+/).forEach((e=>e&&i.classList.remove(e)))})),n.split(/\s+/).forEach((e=>e&&i.classList.add(e))),i.style.display="none";const o=1===t.nodeType?t:t.parentNode;o.appendChild(i);const{hasTransform:r}=getTransitionInfo(i);return o.removeChild(i),r}const getModelAssigner=e=>{const t=e.props["onUpdate:modelValue"]||!1;return isArray$7(t)?e=>invokeArrayFns(t,e):t};function onCompositionStart$1(e){e.target.composing=!0}function onCompositionEnd$1(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const vModelText={created(e,{modifiers:{lazy:t,trim:n,number:i}},o){e._assign=getModelAssigner(o);const r=i||o.props&&"number"===o.props.type;addEventListener$2(e,t?"change":"input",(t=>{if(t.target.composing)return;let i=e.value;n&&(i=i.trim()),r&&(i=toNumber$1(i)),e._assign(i)})),n&&addEventListener$2(e,"change",(()=>{e.value=e.value.trim()})),t||(addEventListener$2(e,"compositionstart",onCompositionStart$1),addEventListener$2(e,"compositionend",onCompositionEnd$1),addEventListener$2(e,"change",onCompositionEnd$1))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:i,number:o}},r){if(e._assign=getModelAssigner(r),e.composing)return;if(document.activeElement===e&&"range"!==e.type){if(n)return;if(i&&e.value.trim()===t)return;if((o||"number"===e.type)&&toNumber$1(e.value)===t)return}const s=null==t?"":t;e.value!==s&&(e.value=s)}},vModelCheckbox={deep:!0,created(e,t,n){e._assign=getModelAssigner(n),addEventListener$2(e,"change",(()=>{const t=e._modelValue,n=getValue$4(e),i=e.checked,o=e._assign;if(isArray$7(t)){const e=looseIndexOf(t,n),r=-1!==e;if(i&&!r)o(t.concat(n));else if(!i&&r){const n=[...t];n.splice(e,1),o(n)}}else if(isSet$2(t)){const e=new Set(t);i?e.add(n):e.delete(n),o(e)}else o(getCheckboxValue(e,i))}))},mounted:setChecked,beforeUpdate(e,t,n){e._assign=getModelAssigner(n),setChecked(e,t,n)}};function setChecked(e,{value:t,oldValue:n},i){e._modelValue=t,isArray$7(t)?e.checked=looseIndexOf(t,i.props.value)>-1:isSet$2(t)?e.checked=t.has(i.props.value):t!==n&&(e.checked=looseEqual(t,getCheckboxValue(e,!0)))}const vModelRadio={created(e,{value:t},n){e.checked=looseEqual(t,n.props.value),e._assign=getModelAssigner(n),addEventListener$2(e,"change",(()=>{e._assign(getValue$4(e))}))},beforeUpdate(e,{value:t,oldValue:n},i){e._assign=getModelAssigner(i),t!==n&&(e.checked=looseEqual(t,i.props.value))}},vModelSelect={deep:!0,created(e,{value:t,modifiers:{number:n}},i){const o=isSet$2(t);addEventListener$2(e,"change",(()=>{const t=Array.prototype.filter.call(e.options,(e=>e.selected)).map((e=>n?toNumber$1(getValue$4(e)):getValue$4(e)));e._assign(e.multiple?o?new Set(t):t:t[0])})),e._assign=getModelAssigner(i)},mounted(e,{value:t}){setSelected(e,t)},beforeUpdate(e,t,n){e._assign=getModelAssigner(n)},updated(e,{value:t}){setSelected(e,t)}};function setSelected(e,t){const n=e.multiple;if(!n||isArray$7(t)||isSet$2(t)){for(let i=0,o=e.options.length;i<o;i++){const o=e.options[i],r=getValue$4(o);if(n)isArray$7(t)?o.selected=looseIndexOf(t,r)>-1:o.selected=t.has(r);else if(looseEqual(getValue$4(o),t))return void(e.selectedIndex!==i&&(e.selectedIndex=i))}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function getValue$4(e){return"_value"in e?e._value:e.value}function getCheckboxValue(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const vModelDynamic={created(e,t,n){callModelHook(e,t,n,null,"created")},mounted(e,t,n){callModelHook(e,t,n,null,"mounted")},beforeUpdate(e,t,n,i){callModelHook(e,t,n,i,"beforeUpdate")},updated(e,t,n,i){callModelHook(e,t,n,i,"updated")}};function resolveDynamicModel(e,t){switch(e){case"SELECT":return vModelSelect;case"TEXTAREA":return vModelText;default:switch(t){case"checkbox":return vModelCheckbox;case"radio":return vModelRadio;default:return vModelText}}}function callModelHook(e,t,n,i,o){const r=resolveDynamicModel(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,i)}function initVModelForSSR(){vModelText.getSSRProps=({value:e})=>({value:e}),vModelRadio.getSSRProps=({value:e},t)=>{if(t.props&&looseEqual(t.props.value,e))return{checked:!0}},vModelCheckbox.getSSRProps=({value:e},t)=>{if(isArray$7(e)){if(t.props&&looseIndexOf(e,t.props.value)>-1)return{checked:!0}}else if(isSet$2(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},vModelDynamic.getSSRProps=(e,t)=>{if("string"!=typeof t.type)return;const n=resolveDynamicModel(t.type.toUpperCase(),t.props&&t.props.type);return n.getSSRProps?n.getSSRProps(e,t):void 0}}const systemModifiers=["ctrl","shift","alt","meta"],modifierGuards={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>systemModifiers.some((n=>e[`${n}Key`]&&!t.includes(n)))},withModifiers=(e,t)=>(n,...i)=>{for(let e=0;e<t.length;e++){const i=modifierGuards[t[e]];if(i&&i(n,t))return}return e(n,...i)},keyNames={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},withKeys=(e,t)=>n=>{if(!("key"in n))return;const i=hyphenate$1(n.key);return t.some((e=>e===i||keyNames[e]===i))?e(n):void 0},vShow={beforeMount(e,{value:t},{transition:n}){e._vod="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):setDisplay(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:i}){!t!=!n&&(i?t?(i.beforeEnter(e),setDisplay(e,!0),i.enter(e)):i.leave(e,(()=>{setDisplay(e,!1)})):setDisplay(e,t))},beforeUnmount(e,{value:t}){setDisplay(e,t)}};function setDisplay(e,t){e.style.display=t?e._vod:"none"}function initVShowForSSR(){vShow.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const rendererOptions=extend$1({patchProp:patchProp},nodeOps);let renderer,enabledHydration=!1;function ensureRenderer(){return renderer||(renderer=createRenderer(rendererOptions))}function ensureHydrationRenderer(){return renderer=enabledHydration?renderer:createHydrationRenderer(rendererOptions),enabledHydration=!0,renderer}const render=(...e)=>{ensureRenderer().render(...e)},hydrate=(...e)=>{ensureHydrationRenderer().hydrate(...e)},createApp=(...e)=>{const t=ensureRenderer().createApp(...e),{mount:n}=t;return t.mount=e=>{const i=normalizeContainer(e);if(!i)return;const o=t._component;isFunction$5(o)||o.render||o.template||(o.template=i.innerHTML),i.innerHTML="";const r=n(i,!1,i instanceof SVGElement);return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),r},t},createSSRApp=(...e)=>{const t=ensureHydrationRenderer().createApp(...e),{mount:n}=t;return t.mount=e=>{const t=normalizeContainer(e);if(t)return n(t,!0,t instanceof SVGElement)},t};function normalizeContainer(e){if(isString$6(e)){return document.querySelector(e)}return e}let ssrDirectiveInitialized=!1;const initDirectivesForSSR=()=>{ssrDirectiveInitialized||(ssrDirectiveInitialized=!0,initVModelForSSR(),initVShowForSSR())},compile$1=()=>{};var vue_runtime_esmBundler=Object.freeze(Object.defineProperty({__proto__:null,compile:compile$1,EffectScope:EffectScope,ReactiveEffect:ReactiveEffect,customRef:customRef,effect:effect,effectScope:effectScope,getCurrentScope:getCurrentScope,isProxy:isProxy,isReactive:isReactive,isReadonly:isReadonly,isRef:isRef,isShallow:isShallow,markRaw:markRaw,onScopeDispose:onScopeDispose,proxyRefs:proxyRefs,reactive:reactive,readonly:readonly,ref:ref,shallowReactive:shallowReactive,shallowReadonly:shallowReadonly,shallowRef:shallowRef,stop:stop,toRaw:toRaw,toRef:toRef,toRefs:toRefs,triggerRef:triggerRef,unref:unref,camelize:camelize$1,capitalize:capitalize,normalizeClass:normalizeClass,normalizeProps:normalizeProps,normalizeStyle:normalizeStyle,toDisplayString:toDisplayString$1,toHandlerKey:toHandlerKey,BaseTransition:BaseTransition,Comment:Comment,Fragment:Fragment,KeepAlive:KeepAlive,Static:Static,Suspense:Suspense,Teleport:Teleport,Text:Text$1,callWithAsyncErrorHandling:callWithAsyncErrorHandling,callWithErrorHandling:callWithErrorHandling,cloneVNode:cloneVNode,compatUtils:compatUtils,computed:computed,createBlock:createBlock,createCommentVNode:createCommentVNode,createElementBlock:createElementBlock,createElementVNode:createBaseVNode,createHydrationRenderer:createHydrationRenderer,createPropsRestProxy:createPropsRestProxy,createRenderer:createRenderer,createSlots:createSlots,createStaticVNode:createStaticVNode,createTextVNode:createTextVNode,createVNode:createVNode,defineAsyncComponent:defineAsyncComponent,defineComponent:defineComponent,defineEmits:defineEmits,defineExpose:defineExpose,defineProps:defineProps,get devtools(){return devtools$1},getCurrentInstance:getCurrentInstance,getTransitionRawChildren:getTransitionRawChildren,guardReactiveProps:guardReactiveProps,h:h$1,handleError:handleError,initCustomFormatter:initCustomFormatter,inject:inject,isMemoSame:isMemoSame,isRuntimeOnly:isRuntimeOnly,isVNode:isVNode,mergeDefaults:mergeDefaults,mergeProps:mergeProps,nextTick:nextTick,onActivated:onActivated,onBeforeMount:onBeforeMount,onBeforeUnmount:onBeforeUnmount,onBeforeUpdate:onBeforeUpdate,onDeactivated:onDeactivated,onErrorCaptured:onErrorCaptured,onMounted:onMounted,onRenderTracked:onRenderTracked,onRenderTriggered:onRenderTriggered,onServerPrefetch:onServerPrefetch,onUnmounted:onUnmounted,onUpdated:onUpdated,openBlock:openBlock,popScopeId:popScopeId,provide:provide,pushScopeId:pushScopeId,queuePostFlushCb:queuePostFlushCb,registerRuntimeCompiler:registerRuntimeCompiler,renderList:renderList,renderSlot:renderSlot,resolveComponent:resolveComponent,resolveDirective:resolveDirective,resolveDynamicComponent:resolveDynamicComponent,resolveFilter:resolveFilter,resolveTransitionHooks:resolveTransitionHooks,setBlockTracking:setBlockTracking,setDevtoolsHook:setDevtoolsHook,setTransitionHooks:setTransitionHooks,ssrContextKey:ssrContextKey,ssrUtils:ssrUtils,toHandlers:toHandlers,transformVNodeArgs:transformVNodeArgs,useAttrs:useAttrs,useSSRContext:useSSRContext,useSlots:useSlots,useTransitionState:useTransitionState,version:version,warn:warn$1,watch:watch,watchEffect:watchEffect,watchPostEffect:watchPostEffect,watchSyncEffect:watchSyncEffect,withAsyncContext:withAsyncContext,withCtx:withCtx,withDefaults:withDefaults,withDirectives:withDirectives,withMemo:withMemo,withScopeId:withScopeId,Transition:Transition,TransitionGroup:TransitionGroup,VueElement:VueElement,createApp:createApp,createSSRApp:createSSRApp,defineCustomElement:defineCustomElement,defineSSRCustomElement:defineSSRCustomElement,hydrate:hydrate,initDirectivesForSSR:initDirectivesForSSR,render:render,useCssModule:useCssModule,useCssVars:useCssVars,vModelCheckbox:vModelCheckbox,vModelDynamic:vModelDynamic,vModelRadio:vModelRadio,vModelSelect:vModelSelect,vModelText:vModelText,vShow:vShow,withKeys:withKeys,withModifiers:withModifiers},Symbol.toStringTag,{value:"Module"})),_export_sfc=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n};const _sfc_main$x={};function _sfc_render$2(e,t){const n=resolveComponent("router-view");return openBlock(),createBlock(n)}var App=_export_sfc(_sfc_main$x,[["render",_sfc_render$2]]);
- /*!
- * vue-router v4.1.2
- * (c) 2022 Eduardo San Martin Morote
- * @license MIT
- */const isBrowser$1="undefined"!=typeof window;function isESModule(e){return e.__esModule||"Module"===e[Symbol.toStringTag]}const assign$2=Object.assign;function applyToParams(e,t){const n={};for(const i in t){const o=t[i];n[i]=isArray$6(o)?o.map(e):e(o)}return n}const noop$5=()=>{},isArray$6=Array.isArray,TRAILING_SLASH_RE=/\/$/,removeTrailingSlash=e=>e.replace(TRAILING_SLASH_RE,"");function parseURL(e,t,n="/"){let i,o={},r="",s="";const a=t.indexOf("#");let l=t.indexOf("?");return a<l&&a>=0&&(l=-1),l>-1&&(i=t.slice(0,l),r=t.slice(l+1,a>-1?a:t.length),o=e(r)),a>-1&&(i=i||t.slice(0,a),s=t.slice(a,t.length)),i=resolveRelativePath(null!=i?i:t,n),{fullPath:i+(r&&"?")+r+s,path:i,query:o,hash:s}}function stringifyURL(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function stripBase(e,t){return t&&e.toLowerCase().startsWith(t.toLowerCase())?e.slice(t.length)||"/":e}function isSameRouteLocation(e,t,n){const i=t.matched.length-1,o=n.matched.length-1;return i>-1&&i===o&&isSameRouteRecord(t.matched[i],n.matched[o])&&isSameRouteLocationParams(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function isSameRouteRecord(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function isSameRouteLocationParams(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!isSameRouteLocationParamsValue(e[n],t[n]))return!1;return!0}function isSameRouteLocationParamsValue(e,t){return isArray$6(e)?isEquivalentArray(e,t):isArray$6(t)?isEquivalentArray(t,e):e===t}function isEquivalentArray(e,t){return isArray$6(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):1===e.length&&e[0]===t}function resolveRelativePath(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),i=e.split("/");let o,r,s=n.length-1;for(o=0;o<i.length;o++)if(r=i[o],"."!==r){if(".."!==r)break;s>1&&s--}return n.slice(0,s).join("/")+"/"+i.slice(o-(o===i.length?1:0)).join("/")}var NavigationType,NavigationType2,NavigationDirection,NavigationDirection2;function normalizeBase(e){if(!e)if(isBrowser$1){const t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e[0]&&"#"!==e[0]&&(e="/"+e),removeTrailingSlash(e)}NavigationType2=NavigationType||(NavigationType={}),NavigationType2.pop="pop",NavigationType2.push="push",NavigationDirection2=NavigationDirection||(NavigationDirection={}),NavigationDirection2.back="back",NavigationDirection2.forward="forward",NavigationDirection2.unknown="";const BEFORE_HASH_RE=/^[^#]+#/;function createHref(e,t){return e.replace(BEFORE_HASH_RE,"#")+t}function getElementPosition(e,t){const n=document.documentElement.getBoundingClientRect(),i=e.getBoundingClientRect();return{behavior:t.behavior,left:i.left-n.left-(t.left||0),top:i.top-n.top-(t.top||0)}}const computeScrollPosition=()=>({left:window.pageXOffset,top:window.pageYOffset});function scrollToPosition(e){let t;if("el"in e){const n=e.el,i="string"==typeof n&&n.startsWith("#"),o="string"==typeof n?i?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=getElementPosition(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(null!=t.left?t.left:window.pageXOffset,null!=t.top?t.top:window.pageYOffset)}function getScrollKey(e,t){return(history.state?history.state.position-t:-1)+e}const scrollPositions=new Map;function saveScrollPosition(e,t){scrollPositions.set(e,t)}function getSavedScrollPosition(e){const t=scrollPositions.get(e);return scrollPositions.delete(e),t}let createBaseLocation=()=>location.protocol+"//"+location.host;function createCurrentLocation(e,t){const{pathname:n,search:i,hash:o}=t,r=e.indexOf("#");if(r>-1){let t=o.includes(e.slice(r))?e.slice(r).length:1,n=o.slice(t);return"/"!==n[0]&&(n="/"+n),stripBase(n,"")}return stripBase(n,e)+i+o}function useHistoryListeners(e,t,n,i){let o=[],r=[],s=null;const a=({state:r})=>{const a=createCurrentLocation(e,location),l=n.value,c=t.value;let d=0;if(r){if(n.value=a,t.value=r,s&&s===l)return void(s=null);d=c?r.position-c.position:0}else i(a);o.forEach((e=>{e(n.value,l,{delta:d,type:NavigationType.pop,direction:d?d>0?NavigationDirection.forward:NavigationDirection.back:NavigationDirection.unknown})}))};function l(){const{history:e}=window;e.state&&e.replaceState(assign$2({},e.state,{scroll:computeScrollPosition()}),"")}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",l),{pauseListeners:function(){s=n.value},listen:function(e){o.push(e);const t=()=>{const t=o.indexOf(e);t>-1&&o.splice(t,1)};return r.push(t),t},destroy:function(){for(const e of r)e();r=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",l)}}}function buildState(e,t,n,i=!1,o=!1){return{back:e,current:t,forward:n,replaced:i,position:window.history.length,scroll:o?computeScrollPosition():null}}function useHistoryStateNavigation(e){const{history:t,location:n}=window,i={value:createCurrentLocation(e,n)},o={value:t.state};function r(i,r,s){const a=e.indexOf("#"),l=a>-1?(n.host&&document.querySelector("base")?e:e.slice(a))+i:createBaseLocation()+e+i;try{t[s?"replaceState":"pushState"](r,"",l),o.value=r}catch(c){n[s?"replace":"assign"](l)}}return o.value||r(i.value,{back:null,current:i.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0),{location:i,state:o,push:function(e,n){const s=assign$2({},o.value,t.state,{forward:e,scroll:computeScrollPosition()});r(s.current,s,!0),r(e,assign$2({},buildState(i.value,e,null),{position:s.position+1},n),!1),i.value=e},replace:function(e,n){r(e,assign$2({},t.state,buildState(o.value.back,e,o.value.forward,!0),n,{position:o.value.position}),!0),i.value=e}}}function createWebHistory(e){const t=useHistoryStateNavigation(e=normalizeBase(e)),n=useHistoryListeners(e,t.state,t.location,t.replace);const i=assign$2({location:"",base:e,go:function(e,t=!0){t||n.pauseListeners(),history.go(e)},createHref:createHref.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}function createWebHashHistory(e){return(e=location.host?e||location.pathname+location.search:"").includes("#")||(e+="#"),createWebHistory(e)}function isRouteLocation(e){return"string"==typeof e||e&&"object"==typeof e}function isRouteName(e){return"string"==typeof e||"symbol"==typeof e}const START_LOCATION_NORMALIZED={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},NavigationFailureSymbol=Symbol("");var NavigationFailureType,NavigationFailureType2;function createRouterError(e,t){return assign$2(new Error,{type:e,[NavigationFailureSymbol]:!0},t)}function isNavigationFailure(e,t){return e instanceof Error&&NavigationFailureSymbol in e&&(null==t||!!(e.type&t))}NavigationFailureType2=NavigationFailureType||(NavigationFailureType={}),NavigationFailureType2[NavigationFailureType2.aborted=4]="aborted",NavigationFailureType2[NavigationFailureType2.cancelled=8]="cancelled",NavigationFailureType2[NavigationFailureType2.duplicated=16]="duplicated";const BASE_PARAM_PATTERN="[^/]+?",BASE_PATH_PARSER_OPTIONS={sensitive:!1,strict:!1,start:!0,end:!0},REGEX_CHARS_RE=/[.+*?^${}()[\]/\\]/g;function tokensToParser(e,t){const n=assign$2({},BASE_PATH_PARSER_OPTIONS,t),i=[];let o=n.start?"^":"";const r=[];for(const l of e){const e=l.length?[]:[90];n.strict&&!l.length&&(o+="/");for(let t=0;t<l.length;t++){const i=l[t];let s=40+(n.sensitive?.25:0);if(0===i.type)t||(o+="/"),o+=i.value.replace(REGEX_CHARS_RE,"\\$&"),s+=40;else if(1===i.type){const{value:e,repeatable:n,optional:c,regexp:d}=i;r.push({name:e,repeatable:n,optional:c});const u=d||BASE_PARAM_PATTERN;if(u!==BASE_PARAM_PATTERN){s+=10;try{new RegExp(`(${u})`)}catch(a){throw new Error(`Invalid custom RegExp for param "${e}" (${u}): `+a.message)}}let h=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;t||(h=c&&l.length<2?`(?:/${h})`:"/"+h),c&&(h+="?"),o+=h,s+=20,c&&(s+=-8),n&&(s+=-20),".*"===u&&(s+=-50)}e.push(s)}i.push(e)}if(n.strict&&n.end){const e=i.length-1;i[e][i[e].length-1]+=.7000000000000001}n.strict||(o+="/?"),n.end?o+="$":n.strict&&(o+="(?:/|$)");const s=new RegExp(o,n.sensitive?"":"i");return{re:s,score:i,keys:r,parse:function(e){const t=e.match(s),n={};if(!t)return null;for(let i=1;i<t.length;i++){const e=t[i]||"",o=r[i-1];n[o.name]=e&&o.repeatable?e.split("/"):e}return n},stringify:function(t){let n="",i=!1;for(const o of e){i&&n.endsWith("/")||(n+="/"),i=!1;for(const r of o)if(0===r.type)n+=r.value;else if(1===r.type){const{value:s,repeatable:a,optional:l}=r,c=s in t?t[s]:"";if(isArray$6(c)&&!a)throw new Error(`Provided param "${s}" is an array but it is not repeatable (* or + modifiers)`);const d=isArray$6(c)?c.join("/"):c;if(!d){if(!l)throw new Error(`Missing required param "${s}"`);o.length<2&&e.length>1&&(n.endsWith("/")?n=n.slice(0,-1):i=!0)}n+=d}}return n}}}function compareScoreArray(e,t){let n=0;for(;n<e.length&&n<t.length;){const i=t[n]-e[n];if(i)return i;n++}return e.length<t.length?1===e.length&&80===e[0]?-1:1:e.length>t.length?1===t.length&&80===t[0]?1:-1:0}function comparePathParserScore(e,t){let n=0;const i=e.score,o=t.score;for(;n<i.length&&n<o.length;){const e=compareScoreArray(i[n],o[n]);if(e)return e;n++}if(1===Math.abs(o.length-i.length)){if(isLastScoreNegative(i))return 1;if(isLastScoreNegative(o))return-1}return o.length-i.length}function isLastScoreNegative(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const ROOT_TOKEN={type:0,value:""},VALID_PARAM_RE=/[a-zA-Z0-9_]/;function tokenizePath(e){if(!e)return[[]];if("/"===e)return[[ROOT_TOKEN]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(e){throw new Error(`ERR (${n})/"${c}": ${e}`)}let n=0,i=n;const o=[];let r;function s(){r&&o.push(r),r=[]}let a,l=0,c="",d="";function u(){c&&(0===n?r.push({type:0,value:c}):1===n||2===n||3===n?(r.length>1&&("*"===a||"+"===a)&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:c,regexp:d,repeatable:"*"===a||"+"===a,optional:"*"===a||"?"===a})):t("Invalid state to consume buffer"),c="")}function h(){c+=a}for(;l<e.length;)if(a=e[l++],"\\"!==a||2===n)switch(n){case 0:"/"===a?(c&&u(),s()):":"===a?(u(),n=1):h();break;case 4:h(),n=i;break;case 1:"("===a?n=2:VALID_PARAM_RE.test(a)?h():(u(),n=0,"*"!==a&&"?"!==a&&"+"!==a&&l--);break;case 2:")"===a?"\\"==d[d.length-1]?d=d.slice(0,-1)+a:n=3:d+=a;break;case 3:u(),n=0,"*"!==a&&"?"!==a&&"+"!==a&&l--,d="";break;default:t("Unknown state")}else i=n,n=4;return 2===n&&t(`Unfinished custom RegExp for param "${c}"`),u(),s(),o}function createRouteRecordMatcher(e,t,n){const i=tokensToParser(tokenizePath(e.path),n),o=assign$2(i,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function createRouterMatcher(e,t){const n=[],i=new Map;function o(e,n,i){const a=!i,l=normalizeRouteRecord(e);l.aliasOf=i&&i.record;const c=mergeOptions(t,e),d=[l];if("alias"in e){const t="string"==typeof e.alias?[e.alias]:e.alias;for(const e of t)d.push(assign$2({},l,{components:i?i.record.components:l.components,path:e,aliasOf:i?i.record:l}))}let u,h;for(const t of d){const{path:d}=t;if(n&&"/"!==d[0]){const e=n.record.path,i="/"===e[e.length-1]?"":"/";t.path=n.record.path+(d&&i+d)}if(u=createRouteRecordMatcher(t,n,c),i?i.alias.push(u):(h=h||u,h!==u&&h.alias.push(u),a&&e.name&&!isAliasRecord(u)&&r(e.name)),l.children){const e=l.children;for(let t=0;t<e.length;t++)o(e[t],u,i&&i.children[t])}i=i||u,s(u)}return h?()=>{r(h)}:noop$5}function r(e){if(isRouteName(e)){const t=i.get(e);t&&(i.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(r),t.alias.forEach(r))}else{const t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&i.delete(e.record.name),e.children.forEach(r),e.alias.forEach(r))}}function s(e){let t=0;for(;t<n.length&&comparePathParserScore(e,n[t])>=0&&(e.record.path!==n[t].record.path||!isRecordChildOf(e,n[t]));)t++;n.splice(t,0,e),e.record.name&&!isAliasRecord(e)&&i.set(e.record.name,e)}return t=mergeOptions({strict:!1,end:!0,sensitive:!1},t),e.forEach((e=>o(e))),{addRoute:o,resolve:function(e,t){let o,r,s,a={};if("name"in e&&e.name){if(o=i.get(e.name),!o)throw createRouterError(1,{location:e});s=o.record.name,a=assign$2(paramsFromLocation(t.params,o.keys.filter((e=>!e.optional)).map((e=>e.name))),e.params),r=o.stringify(a)}else if("path"in e)r=e.path,o=n.find((e=>e.re.test(r))),o&&(a=o.parse(r),s=o.record.name);else{if(o=t.name?i.get(t.name):n.find((e=>e.re.test(t.path))),!o)throw createRouterError(1,{location:e,currentLocation:t});s=o.record.name,a=assign$2({},t.params,e.params),r=o.stringify(a)}const l=[];let c=o;for(;c;)l.unshift(c.record),c=c.parent;return{name:s,path:r,params:a,matched:l,meta:mergeMetaFields(l)}},removeRoute:r,getRoutes:function(){return n},getRecordMatcher:function(e){return i.get(e)}}}function paramsFromLocation(e,t){const n={};for(const i of t)i in e&&(n[i]=e[i]);return n}function normalizeRouteRecord(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:normalizeRecordProps(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function normalizeRecordProps(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const i in e.components)t[i]="boolean"==typeof n?n:n[i];return t}function isAliasRecord(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function mergeMetaFields(e){return e.reduce(((e,t)=>assign$2(e,t.meta)),{})}function mergeOptions(e,t){const n={};for(const i in e)n[i]=i in t?t[i]:e[i];return n}function isRecordChildOf(e,t){return t.children.some((t=>t===e||isRecordChildOf(e,t)))}const HASH_RE=/#/g,AMPERSAND_RE=/&/g,SLASH_RE=/\//g,EQUAL_RE=/=/g,IM_RE=/\?/g,PLUS_RE=/\+/g,ENC_BRACKET_OPEN_RE=/%5B/g,ENC_BRACKET_CLOSE_RE=/%5D/g,ENC_CARET_RE=/%5E/g,ENC_BACKTICK_RE=/%60/g,ENC_CURLY_OPEN_RE=/%7B/g,ENC_PIPE_RE=/%7C/g,ENC_CURLY_CLOSE_RE=/%7D/g,ENC_SPACE_RE=/%20/g;function commonEncode(e){return encodeURI(""+e).replace(ENC_PIPE_RE,"|").replace(ENC_BRACKET_OPEN_RE,"[").replace(ENC_BRACKET_CLOSE_RE,"]")}function encodeHash(e){return commonEncode(e).replace(ENC_CURLY_OPEN_RE,"{").replace(ENC_CURLY_CLOSE_RE,"}").replace(ENC_CARET_RE,"^")}function encodeQueryValue(e){return commonEncode(e).replace(PLUS_RE,"%2B").replace(ENC_SPACE_RE,"+").replace(HASH_RE,"%23").replace(AMPERSAND_RE,"%26").replace(ENC_BACKTICK_RE,"`").replace(ENC_CURLY_OPEN_RE,"{").replace(ENC_CURLY_CLOSE_RE,"}").replace(ENC_CARET_RE,"^")}function encodeQueryKey(e){return encodeQueryValue(e).replace(EQUAL_RE,"%3D")}function encodePath(e){return commonEncode(e).replace(HASH_RE,"%23").replace(IM_RE,"%3F")}function encodeParam(e){return null==e?"":encodePath(e).replace(SLASH_RE,"%2F")}function decode(e){try{return decodeURIComponent(""+e)}catch(t){}return""+e}function parseQuery(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let i=0;i<n.length;++i){const e=n[i].replace(PLUS_RE," "),o=e.indexOf("="),r=decode(o<0?e:e.slice(0,o)),s=o<0?null:decode(e.slice(o+1));if(r in t){let e=t[r];isArray$6(e)||(e=t[r]=[e]),e.push(s)}else t[r]=s}return t}function stringifyQuery(e){let t="";for(let n in e){const i=e[n];if(n=encodeQueryKey(n),null==i){void 0!==i&&(t+=(t.length?"&":"")+n);continue}(isArray$6(i)?i.map((e=>e&&encodeQueryValue(e))):[i&&encodeQueryValue(i)]).forEach((e=>{void 0!==e&&(t+=(t.length?"&":"")+n,null!=e&&(t+="="+e))}))}return t}function normalizeQuery(e){const t={};for(const n in e){const i=e[n];void 0!==i&&(t[n]=isArray$6(i)?i.map((e=>null==e?null:""+e)):null==i?i:""+i)}return t}const matchedRouteKey=Symbol(""),viewDepthKey=Symbol(""),routerKey=Symbol(""),routeLocationKey=Symbol(""),routerViewLocationKey=Symbol("");function useCallbacks(){let e=[];return{add:function(t){return e.push(t),()=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)}},list:()=>e,reset:function(){e=[]}}}function registerGuard(e,t,n){const i=()=>{e[t].delete(n)};onUnmounted(i),onDeactivated(i),onActivated((()=>{e[t].add(n)})),e[t].add(n)}function onBeforeRouteUpdate(e){const t=inject(matchedRouteKey,{}).value;t&®isterGuard(t,"updateGuards",e)}function guardToPromiseFn(e,t,n,i,o){const r=i&&(i.enterCallbacks[o]=i.enterCallbacks[o]||[]);return()=>new Promise(((s,a)=>{const l=e=>{!1===e?a(createRouterError(4,{from:n,to:t})):e instanceof Error?a(e):isRouteLocation(e)?a(createRouterError(2,{from:t,to:e})):(r&&i.enterCallbacks[o]===r&&"function"==typeof e&&r.push(e),s())},c=e.call(i&&i.instances[o],t,n,l);let d=Promise.resolve(c);e.length<3&&(d=d.then(l)),d.catch((e=>a(e)))}))}function extractComponentsGuards(e,t,n,i){const o=[];for(const r of e)for(const e in r.components){let s=r.components[e];if("beforeRouteEnter"===t||r.instances[e])if(isRouteComponent(s)){const a=(s.__vccOpts||s)[t];a&&o.push(guardToPromiseFn(a,n,i,r,e))}else{let a=s();o.push((()=>a.then((o=>{if(!o)return Promise.reject(new Error(`Couldn't resolve component "${e}" at "${r.path}"`));const s=isESModule(o)?o.default:o;r.components[e]=s;const a=(s.__vccOpts||s)[t];return a&&guardToPromiseFn(a,n,i,r,e)()}))))}}return o}function isRouteComponent(e){return"object"==typeof e||"displayName"in e||"props"in e||"__vccOpts"in e}function useLink(e){const t=inject(routerKey),n=inject(routeLocationKey),i=computed((()=>t.resolve(unref(e.to)))),o=computed((()=>{const{matched:e}=i.value,{length:t}=e,o=e[t-1],r=n.matched;if(!o||!r.length)return-1;const s=r.findIndex(isSameRouteRecord.bind(null,o));if(s>-1)return s;const a=getOriginalPath(e[t-2]);return t>1&&getOriginalPath(o)===a&&r[r.length-1].path!==a?r.findIndex(isSameRouteRecord.bind(null,e[t-2])):s})),r=computed((()=>o.value>-1&&includesParams(n.params,i.value.params))),s=computed((()=>o.value>-1&&o.value===n.matched.length-1&&isSameRouteLocationParams(n.params,i.value.params)));return{route:i,href:computed((()=>i.value.href)),isActive:r,isExactActive:s,navigate:function(n={}){return guardEvent(n)?t[unref(e.replace)?"replace":"push"](unref(e.to)).catch(noop$5):Promise.resolve()}}}const RouterLinkImpl=defineComponent({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"}},useLink:useLink,setup(e,{slots:t}){const n=reactive(useLink(e)),{options:i}=inject(routerKey),o=computed((()=>({[getLinkClass(e.activeClass,i.linkActiveClass,"router-link-active")]:n.isActive,[getLinkClass(e.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive})));return()=>{const i=t.default&&t.default(n);return e.custom?i:h$1("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},i)}}}),RouterLink=RouterLinkImpl;function guardEvent(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||e.defaultPrevented||void 0!==e.button&&0!==e.button)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function includesParams(e,t){for(const n in t){const i=t[n],o=e[n];if("string"==typeof i){if(i!==o)return!1}else if(!isArray$6(o)||o.length!==i.length||i.some(((e,t)=>e!==o[t])))return!1}return!0}function getOriginalPath(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const getLinkClass=(e,t,n)=>null!=e?e:null!=t?t:n,RouterViewImpl=defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const i=inject(routerViewLocationKey),o=computed((()=>e.route||i.value)),r=inject(viewDepthKey,0),s=computed((()=>{let e=unref(r);const{matched:t}=o.value;let n;for(;(n=t[e])&&!n.components;)e++;return e})),a=computed((()=>o.value.matched[s.value]));provide(viewDepthKey,computed((()=>s.value+1))),provide(matchedRouteKey,a),provide(routerViewLocationKey,o);const l=ref();return watch((()=>[l.value,a.value,e.name]),(([e,t,n],[i,o,r])=>{t&&(t.instances[n]=e,o&&o!==t&&e&&e===i&&(t.leaveGuards.size||(t.leaveGuards=o.leaveGuards),t.updateGuards.size||(t.updateGuards=o.updateGuards))),!e||!t||o&&isSameRouteRecord(t,o)&&i||(t.enterCallbacks[n]||[]).forEach((t=>t(e)))}),{flush:"post"}),()=>{const i=o.value,r=a.value,s=r&&r.components[e.name],c=e.name;if(!s)return normalizeSlot(n.default,{Component:s,route:i});const d=r.props[e.name],u=d?!0===d?i.params:"function"==typeof d?d(i):d:null,h=h$1(s,assign$2({},u,t,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(r.instances[c]=null)},ref:l}));return normalizeSlot(n.default,{Component:h,route:i})||h}}});function normalizeSlot(e,t){if(!e)return null;const n=e(t);return 1===n.length?n[0]:n}const RouterView=RouterViewImpl;function createRouter(e){const t=createRouterMatcher(e.routes,e),n=e.parseQuery||parseQuery,i=e.stringifyQuery||stringifyQuery,o=e.history,r=useCallbacks(),s=useCallbacks(),a=useCallbacks(),l=shallowRef(START_LOCATION_NORMALIZED);let c=START_LOCATION_NORMALIZED;isBrowser$1&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=applyToParams.bind(null,(e=>""+e)),u=applyToParams.bind(null,encodeParam),h=applyToParams.bind(null,decode);function g(e,r){if(r=assign$2({},r||l.value),"string"==typeof e){const i=parseURL(n,e,r.path),s=t.resolve({path:i.path},r),a=o.createHref(i.fullPath);return assign$2(i,s,{params:h(s.params),hash:decode(i.hash),redirectedFrom:void 0,href:a})}let s;if("path"in e)s=assign$2({},e,{path:parseURL(n,e.path,r.path).path});else{const t=assign$2({},e.params);for(const e in t)null==t[e]&&delete t[e];s=assign$2({},e,{params:u(e.params)}),r.params=u(r.params)}const a=t.resolve(s,r),c=e.hash||"";a.params=d(h(a.params));const g=stringifyURL(i,assign$2({},e,{hash:encodeHash(c),path:a.path})),p=o.createHref(g);return assign$2({fullPath:g,hash:c,query:i===stringifyQuery?normalizeQuery(e.query):e.query||{}},a,{redirectedFrom:void 0,href:p})}function p(e){return"string"==typeof e?parseURL(n,e,l.value.path):assign$2({},e)}function f(e,t){if(c!==e)return createRouterError(8,{from:t,to:e})}function m(e){return _(e)}function v(e){const t=e.matched[e.matched.length-1];if(t&&t.redirect){const{redirect:n}=t;let i="function"==typeof n?n(e):n;return"string"==typeof i&&(i=i.includes("?")||i.includes("#")?i=p(i):{path:i},i.params={}),assign$2({query:e.query,hash:e.hash,params:"path"in i?{}:e.params},i)}}function _(e,t){const n=c=g(e),o=l.value,r=e.state,s=e.force,a=!0===e.replace,d=v(n);if(d)return _(assign$2(p(d),{state:r,force:s,replace:a}),t||n);const u=n;let h;return u.redirectedFrom=t,!s&&isSameRouteLocation(i,o,n)&&(h=createRouterError(16,{to:u,from:o}),L(o,o,!0,!1)),(h?Promise.resolve(h):b(u,o)).catch((e=>isNavigationFailure(e)?isNavigationFailure(e,2)?e:k(e):I(e,u,o))).then((e=>{if(e){if(isNavigationFailure(e,2))return _(assign$2(p(e.to),{state:r,force:s,replace:a}),t||u)}else e=S(u,o,!0,a,r);return y(u,o,e),e}))}function C(e,t){const n=f(e,t);return n?Promise.reject(n):Promise.resolve()}function b(e,t){let n;const[i,o,a]=extractChangingRecords(e,t);n=extractComponentsGuards(i.reverse(),"beforeRouteLeave",e,t);for(const r of i)r.leaveGuards.forEach((i=>{n.push(guardToPromiseFn(i,e,t))}));const l=C.bind(null,e,t);return n.push(l),runGuardQueue(n).then((()=>{n=[];for(const i of r.list())n.push(guardToPromiseFn(i,e,t));return n.push(l),runGuardQueue(n)})).then((()=>{n=extractComponentsGuards(o,"beforeRouteUpdate",e,t);for(const i of o)i.updateGuards.forEach((i=>{n.push(guardToPromiseFn(i,e,t))}));return n.push(l),runGuardQueue(n)})).then((()=>{n=[];for(const i of e.matched)if(i.beforeEnter&&!t.matched.includes(i))if(isArray$6(i.beforeEnter))for(const o of i.beforeEnter)n.push(guardToPromiseFn(o,e,t));else n.push(guardToPromiseFn(i.beforeEnter,e,t));return n.push(l),runGuardQueue(n)})).then((()=>(e.matched.forEach((e=>e.enterCallbacks={})),n=extractComponentsGuards(a,"beforeRouteEnter",e,t),n.push(l),runGuardQueue(n)))).then((()=>{n=[];for(const i of s.list())n.push(guardToPromiseFn(i,e,t));return n.push(l),runGuardQueue(n)})).catch((e=>isNavigationFailure(e,8)?e:Promise.reject(e)))}function y(e,t,n){for(const i of a.list())i(e,t,n)}function S(e,t,n,i,r){const s=f(e,t);if(s)return s;const a=t===START_LOCATION_NORMALIZED,c=isBrowser$1?history.state:{};n&&(i||a?o.replace(e.fullPath,assign$2({scroll:a&&c&&c.scroll},r)):o.push(e.fullPath,r)),l.value=e,L(e,t,n,a),k()}let w;let E,x=useCallbacks(),T=useCallbacks();function I(e,t,n){k(e);const i=T.list();return i.length&&i.forEach((i=>i(e,t,n))),Promise.reject(e)}function k(e){return E||(E=!e,w||(w=o.listen(((e,t,n)=>{if(!A.listening)return;const i=g(e),r=v(i);if(r)return void _(assign$2(r,{replace:!0}),i).catch(noop$5);c=i;const s=l.value;isBrowser$1&&saveScrollPosition(getScrollKey(s.fullPath,n.delta),computeScrollPosition()),b(i,s).catch((e=>isNavigationFailure(e,12)?e:isNavigationFailure(e,2)?(_(e.to,i).then((e=>{isNavigationFailure(e,20)&&!n.delta&&n.type===NavigationType.pop&&o.go(-1,!1)})).catch(noop$5),Promise.reject()):(n.delta&&o.go(-n.delta,!1),I(e,i,s)))).then((e=>{(e=e||S(i,s,!1))&&(n.delta?o.go(-n.delta,!1):n.type===NavigationType.pop&&isNavigationFailure(e,20)&&o.go(-1,!1)),y(i,s,e)})).catch(noop$5)}))),x.list().forEach((([t,n])=>e?n(e):t())),x.reset()),e}function L(t,n,i,o){const{scrollBehavior:r}=e;if(!isBrowser$1||!r)return Promise.resolve();const s=!i&&getSavedScrollPosition(getScrollKey(t.fullPath,0))||(o||!i)&&history.state&&history.state.scroll||null;return nextTick().then((()=>r(t,n,s))).then((e=>e&&scrollToPosition(e))).catch((e=>I(e,t,n)))}const D=e=>o.go(e);let N;const O=new Set,A={currentRoute:l,listening:!0,addRoute:function(e,n){let i,o;return isRouteName(e)?(i=t.getRecordMatcher(e),o=n):o=e,t.addRoute(o,i)},removeRoute:function(e){const n=t.getRecordMatcher(e);n&&t.removeRoute(n)},hasRoute:function(e){return!!t.getRecordMatcher(e)},getRoutes:function(){return t.getRoutes().map((e=>e.record))},resolve:g,options:e,push:m,replace:function(e){return m(assign$2(p(e),{replace:!0}))},go:D,back:()=>D(-1),forward:()=>D(1),beforeEach:r.add,beforeResolve:s.add,afterEach:a.add,onError:T.add,isReady:function(){return E&&l.value!==START_LOCATION_NORMALIZED?Promise.resolve():new Promise(((e,t)=>{x.add([e,t])}))},install(e){e.component("RouterLink",RouterLink),e.component("RouterView",RouterView),e.config.globalProperties.$router=this,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>unref(l)}),isBrowser$1&&!N&&l.value===START_LOCATION_NORMALIZED&&(N=!0,m(o.location).catch((e=>{})));const t={};for(const i in START_LOCATION_NORMALIZED)t[i]=computed((()=>l.value[i]));e.provide(routerKey,this),e.provide(routeLocationKey,reactive(t)),e.provide(routerViewLocationKey,l);const n=e.unmount;O.add(e),e.unmount=function(){O.delete(e),O.size<1&&(c=START_LOCATION_NORMALIZED,w&&w(),w=null,l.value=START_LOCATION_NORMALIZED,N=!1,E=!1),n()}}};return A}function runGuardQueue(e){return e.reduce(((e,t)=>e.then((()=>t()))),Promise.resolve())}function extractChangingRecords(e,t){const n=[],i=[],o=[],r=Math.max(t.matched.length,e.matched.length);for(let s=0;s<r;s++){const r=t.matched[s];r&&(e.matched.find((e=>isSameRouteRecord(e,r)))?i.push(r):n.push(r));const a=e.matched[s];a&&(t.matched.find((e=>isSameRouteRecord(e,a)))||o.push(a))}return[n,i,o]}function useRouter(){return inject(routerKey)}function useRoute(){return inject(routeLocationKey)}const scriptRel="modulepreload",seen={},base="./",__vitePreload=function(e,t){return t&&0!==t.length?Promise.all(t.map((e=>{if((e=`${base}${e}`)in seen)return;seen[e]=!0;const t=e.endsWith(".css"),n=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${n}`))return;const i=document.createElement("link");return i.rel=t?"stylesheet":scriptRel,t||(i.as="script",i.crossOrigin=""),i.href=e,document.head.appendChild(i),t?new Promise(((t,n)=>{i.addEventListener("load",t),i.addEventListener("error",(()=>n(new Error(`Unable to preload CSS for ${e}`))))})):void 0}))).then((()=>e())):e()};function _defineProperty$P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ownKeys$1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function _objectSpread2$1(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$1(Object(n),!0).forEach((function(t){_defineProperty$P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$1(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},_extends$1.apply(this,arguments)}function _typeof$3(e){return(_typeof$3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var isFunction$4=function(e){return"function"==typeof e},isArray$5=Array.isArray,isString$5=function(e){return"string"==typeof e},isObject$6=function(e){return null!==e&&"object"===_typeof$3(e)},onRE=/^on[^a-z]/,isOn=function(e){return onRE.test(e)},cacheStringFunction=function(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}},camelizeRE=/-(\w)/g,camelize=cacheStringFunction((function(e){return e.replace(camelizeRE,(function(e,t){return t?t.toUpperCase():""}))})),hyphenateRE=/\B([A-Z])/g,hyphenate=cacheStringFunction((function(e){return e.replace(hyphenateRE,"-$1").toLowerCase()})),hasOwnProperty$j=Object.prototype.hasOwnProperty,hasOwn$2=function(e,t){return hasOwnProperty$j.call(e,t)};function resolvePropValue(e,t,n,i){var o=e[n];if(null!=o){var r=hasOwn$2(o,"default");if(r&&void 0===i){var s=o.default;i=o.type!==Function&&isFunction$4(s)?s():s}o.type===Boolean&&(hasOwn$2(t,n)||r?""===i&&(i=!0):i=!1)}return i}function toPx(e){return"number"==typeof e?"".concat(e,"px"):e}function renderHelper(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return"function"==typeof e?e(t):null!=e?e:n}function classNames(){for(var e=[],t=0;t<arguments.length;t++){var n=t<0||arguments.length<=t?void 0:arguments[t];if(n)if(isString$5(n))e.push(n);else if(isArray$5(n))for(var i=0;i<n.length;i++){var o=classNames(n[i]);o&&e.push(o)}else if(isObject$6(n))for(var r in n)n[r]&&e.push(r)}return e.join(" ")}var MapShim=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,i){return e[0]===t&&(n=i,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(t,n){var i=e(this.__entries__,t);~i?this.__entries__[i][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,i=e(n,t);~i&&n.splice(i,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,i=this.__entries__;n<i.length;n++){var o=i[n];e.call(t,o[1],o[0])}},t}()}(),isBrowser="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,global$1="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),requestAnimationFrame$1="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(global$1):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},trailingTimeout=2;function throttle(e,t){var n=!1,i=!1,o=0;function r(){n&&(n=!1,e()),i&&a()}function s(){requestAnimationFrame$1(r)}function a(){var e=Date.now();if(n){if(e-o<trailingTimeout)return;i=!0}else n=!0,i=!1,setTimeout(s,t);o=e}return a}var REFRESH_DELAY=20,transitionKeys=["top","right","bottom","left","width","height","size","weight"],mutationObserverSupported="undefined"!=typeof MutationObserver,ResizeObserverController=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=throttle(this.refresh.bind(this),REFRESH_DELAY)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){isBrowser&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mutationObserverSupported?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){isBrowser&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;transitionKeys.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),defineConfigurable=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var o=i[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},getWindowOf=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||global$1},emptyRect=createRectInit(0,0,0,0);function toFloat(e){return parseFloat(e)||0}function getBordersSize(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+toFloat(e["border-"+n+"-width"])}),0)}function getPaddings(e){for(var t={},n=0,i=["top","right","bottom","left"];n<i.length;n++){var o=i[n],r=e["padding-"+o];t[o]=toFloat(r)}return t}function getSVGContentRect(e){var t=e.getBBox();return createRectInit(0,0,t.width,t.height)}function getHTMLElementContentRect(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return emptyRect;var i=getWindowOf(e).getComputedStyle(e),o=getPaddings(i),r=o.left+o.right,s=o.top+o.bottom,a=toFloat(i.width),l=toFloat(i.height);if("border-box"===i.boxSizing&&(Math.round(a+r)!==t&&(a-=getBordersSize(i,"left","right")+r),Math.round(l+s)!==n&&(l-=getBordersSize(i,"top","bottom")+s)),!isDocumentElement(e)){var c=Math.round(a+r)-t,d=Math.round(l+s)-n;1!==Math.abs(c)&&(a-=c),1!==Math.abs(d)&&(l-=d)}return createRectInit(o.left,o.top,a,l)}var isSVGGraphicsElement="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof getWindowOf(e).SVGGraphicsElement}:function(e){return e instanceof getWindowOf(e).SVGElement&&"function"==typeof e.getBBox};function isDocumentElement(e){return e===getWindowOf(e).document.documentElement}function getContentRect(e){return isBrowser?isSVGGraphicsElement(e)?getSVGContentRect(e):getHTMLElementContentRect(e):emptyRect}function createReadOnlyRect(e){var t=e.x,n=e.y,i=e.width,o=e.height,r="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,s=Object.create(r.prototype);return defineConfigurable(s,{x:t,y:n,width:i,height:o,top:n,right:t+i,bottom:o+n,left:t}),s}function createRectInit(e,t,n,i){return{x:e,y:t,width:n,height:i}}var ResizeObservation=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=createRectInit(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=getContentRect(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),ResizeObserverEntry=function(e,t){var n=createReadOnlyRect(t);defineConfigurable(this,{target:e,contentRect:n})},ResizeObserverSPI=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new MapShim,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof getWindowOf(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new ResizeObservation(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof getWindowOf(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new ResizeObserverEntry(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),observers="undefined"!=typeof WeakMap?new WeakMap:new MapShim,ResizeObserver$2=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=ResizeObserverController.getInstance(),i=new ResizeObserverSPI(t,n,this);observers.set(this,i)};["observe","unobserve","disconnect"].forEach((function(e){ResizeObserver$2.prototype[e]=function(){var t;return(t=observers.get(this))[e].apply(t,arguments)}}));var index$v=void 0!==global$1.ResizeObserver?global$1.ResizeObserver:ResizeObserver$2;function _arrayWithHoles$2(e){if(Array.isArray(e))return e}function _iterableToArrayLimit$2(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,o,r=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(i=n.next()).done)&&(r.push(i.value),!t||r.length!==t);s=!0);}catch(l){a=!0,o=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return r}}function _arrayLikeToArray$2(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function _unsupportedIterableToArray$2(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray$2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray$2(e,t):void 0}}function _nonIterableRest$2(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _slicedToArray$2(e,t){return _arrayWithHoles$2(e)||_iterableToArrayLimit$2(e,t)||_unsupportedIterableToArray$2(e,t)||_nonIterableRest$2()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray$2(e)}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toConsumableArray$2(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray$2(e)||_nonIterableSpread()}var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeGlobal$1=freeGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal$1||freeSelf||Function("return this")(),root$1=root,Symbol$1=root$1.Symbol,Symbol$2=Symbol$1,objectProto$f=Object.prototype,hasOwnProperty$i=objectProto$f.hasOwnProperty,nativeObjectToString$1=objectProto$f.toString,symToStringTag$1=Symbol$2?Symbol$2.toStringTag:void 0;function getRawTag(e){var t=hasOwnProperty$i.call(e,symToStringTag$1),n=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var i=!0}catch(r){}var o=nativeObjectToString$1.call(e);return i&&(t?e[symToStringTag$1]=n:delete e[symToStringTag$1]),o}var objectProto$e=Object.prototype,nativeObjectToString=objectProto$e.toString;function objectToString$1(e){return nativeObjectToString.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$2?Symbol$2.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString$1(e)}function overArg(e,t){return function(n){return e(t(n))}}var getPrototype=overArg(Object.getPrototypeOf,Object),getPrototype$1=getPrototype;function isObjectLike(e){return null!=e&&"object"==typeof e}var objectTag$4="[object Object]",funcProto$2=Function.prototype,objectProto$d=Object.prototype,funcToString$2=funcProto$2.toString,hasOwnProperty$h=objectProto$d.hasOwnProperty,objectCtorString=funcToString$2.call(Object);function isPlainObject$3(e){if(!isObjectLike(e)||baseGetTag(e)!=objectTag$4)return!1;var t=getPrototype$1(e);if(null===t)return!0;var n=hasOwnProperty$h.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&funcToString$2.call(n)==objectCtorString}var isValid$2=function(e){return null!=e&&""!==e},isValid$3=isValid$2,initDefaultProps=function(e,t){var n=_extends$1({},e);return Object.keys(t).forEach((function(e){var i=n[e];if(!i)throw new Error("not have ".concat(e," prop"));i.type||i.default?i.default=t[e]:i.def?i.def(t[e]):n[e]={type:i,default:t[e]}})),n},initDefaultProps$1=initDefaultProps,splitAttrs=function(e){for(var t=Object.keys(e),n={},i={},o={},r=0,s=t.length;r<s;r++){var a=t[r];isOn(a)?(n[a[2].toLowerCase()+a.slice(3)]=e[a],i[a]=e[a]):o[a]=e[a]}return{onEvents:i,events:n,extraAttrs:o}},parseStyleText=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n={},i=/;(?![^(]*\))/g,o=/:(.+)/;return"object"===_typeof$3(e)?e:(e.split(i).forEach((function(e){if(e){var i=e.split(o);if(i.length>1){var r=t?camelize(i[0].trim()):i[0].trim();n[r]=i[1].trim()}}})),n)},hasProp=function(e,t){return void 0!==e[t]},flattenChildren=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=Array.isArray(t)?t:[t],o=[];return i.forEach((function(t){Array.isArray(t)?o.push.apply(o,_toConsumableArray$2(e(t,n))):t&&t.type===Fragment?o.push.apply(o,_toConsumableArray$2(e(t.children,n))):t&&isVNode(t)?n&&!isEmptyElement(t)?o.push(t):n||o.push(t):isValid$3(t)&&o.push(t)})),o},getSlot=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(isVNode(e))return e.type===Fragment?"default"===t?flattenChildren(e.children):[]:e.children&&e.children[t]?flattenChildren(e.children[t](n)):[];var i=e.$slots[t]&&e.$slots[t](n);return flattenChildren(i)},findDOMNode=function(e){for(var t,n=(null===(t=null==e?void 0:e.vnode)||void 0===t?void 0:t.el)||e&&(e.$el||e);n&&!n.tagName;)n=n.nextSibling;return n},getOptionProps=function(e){var t={};if(e.$&&e.$.vnode){var n=e.$.vnode.props||{};Object.keys(e.$props).forEach((function(i){var o=e.$props[i],r=hyphenate(i);(void 0!==o||r in n)&&(t[i]=o)}))}else if(isVNode(e)&&"object"===_typeof$3(e.type)){var i=e.props||{},o={};Object.keys(i).forEach((function(e){o[camelize(e)]=i[e]}));var r=e.type.props||{};Object.keys(r).forEach((function(e){var n=resolvePropValue(r,o,e,o[e]);(void 0!==n||e in o)&&(t[e]=n)}))}return t},getComponent=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=void 0;if(e.$){var r=e[t];if(void 0!==r)return"function"==typeof r&&i?r(n):r;o=e.$slots[t],o=i&&o?o(n):o}else if(isVNode(e)){var s=e.props&&e.props[t];if(void 0!==s&&null!==e.props)return"function"==typeof s&&i?s(n):s;e.type===Fragment?o=e.children:e.children&&e.children[t]&&(o=e.children[t],o=i&&o?o(n):o)}return Array.isArray(o)&&(o=0===(o=1===(o=flattenChildren(o)).length?o[0]:o).length?void 0:o),o};function getEvents(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n={};return n=e.$?_extends$1(_extends$1({},n),e.$attrs):_extends$1(_extends$1({},n),e.props),splitAttrs(n)[t?"onEvents":"events"]}function getStyle(e,t){var n=((isVNode(e)?e.props:e.$attrs)||{}).style||{};if("string"==typeof n)n=parseStyleText(n,t);else if(t&&n){var i={};return Object.keys(n).forEach((function(e){return i[camelize(e)]=n[e]})),i}return n}function isEmptyContent(e){return null==e||""===e||Array.isArray(e)&&0===e.length}function isEmptyElement(e){return e&&(e.type===Comment||e.type===Fragment&&0===e.children.length||e.type===Text$1&&""===e.children.trim())}function isStringElement(e){return e&&e.type===Text$1}function filterEmpty(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[];return e.forEach((function(e){Array.isArray(e)?t.push.apply(t,_toConsumableArray$2(e)):(null==e?void 0:e.type)===Fragment?t.push.apply(t,_toConsumableArray$2(filterEmpty(e.children))):t.push(e)})),t.filter((function(e){return!isEmptyElement(e)}))}function filterEmptyWithUndefined(e){if(e){var t=filterEmpty(e);return t.length?t:void 0}return e}function isValidElement(e){return Array.isArray(e)&&1===e.length&&(e=e[0]),e&&e.__v_isVNode&&"symbol"!==_typeof$3(e.type)}function getPropsSlot(e,t){var n,i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"default";return null!==(n=t[o])&&void 0!==n?n:null===(i=e[o])||void 0===i?void 0:i.call(e)}var ResizeObserver$1=defineComponent({name:"ResizeObserver",props:{disabled:Boolean,onResize:Function},emits:["resize"],setup:function(e,t){var n=t.slots,i=reactive({width:0,height:0,offsetHeight:0,offsetWidth:0}),o=null,r=null,s=function(){r&&(r.disconnect(),r=null)},a=function(t){var n=e.onResize,o=t[0].target,r=o.getBoundingClientRect(),s=r.width,a=r.height,l=o.offsetWidth,c=o.offsetHeight,d=Math.floor(s),u=Math.floor(a);if(i.width!==d||i.height!==u||i.offsetWidth!==l||i.offsetHeight!==c){var h={width:d,height:u,offsetWidth:l,offsetHeight:c};_extends$1(i,h),n&&Promise.resolve().then((function(){n(_extends$1(_extends$1({},h),{offsetWidth:l,offsetHeight:c}),o)}))}},l=getCurrentInstance(),c=function(){if(e.disabled)s();else{var t=findDOMNode(l);t!==o&&(s(),o=t),!r&&t&&(r=new index$v(a)).observe(t)}};return onMounted((function(){c()})),onUpdated((function(){c()})),onUnmounted((function(){s()})),watch((function(){return e.disabled}),(function(){c()}),{flush:"post"}),function(){var e;return null===(e=n.default)||void 0===e?void 0:e.call(n)[0]}}}),raf$1=function(e){return setTimeout(e,16)},caf=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(raf$1=function(e){return window.requestAnimationFrame(e)},caf=function(e){return window.cancelAnimationFrame(e)});var rafUUID=0,rafIds=new Map;function cleanup(e){rafIds.delete(e)}function wrapperRaf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=rafUUID+=1;function i(t){if(0===t)cleanup(n),e();else{var o=raf$1((function(){i(t-1)}));rafIds.set(n,o)}}return i(t),n}wrapperRaf.cancel=function(e){var t=rafIds.get(e);return cleanup(t),caf(t)};var tuple=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t},withInstall=function(e){var t=e;return t.install=function(n){n.component(t.displayName||t.name,e)},e},supportsPassive=!1;try{var opts=Object.defineProperty({},"passive",{get:function(){supportsPassive=!0}});window.addEventListener("testPassive",null,opts),window.removeEventListener("testPassive",null,opts)}catch(e2){}var supportsPassive$1=supportsPassive;function addEventListenerWrap(e,t,n,i){if(e&&e.addEventListener){var o=i;void 0!==o||!supportsPassive$1||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o={passive:!1}),e.addEventListener(t,n,o)}return{remove:function(){e&&e.removeEventListener&&e.removeEventListener(t,n)}}}var enUS$1={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages"},locale$2={locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"Ok",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"},CalendarLocale=locale$2,locale$1={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},TimePicker=locale$1,locale={lang:_extends$1({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},CalendarLocale),timePickerLocale:_extends$1({},TimePicker)},enUS=locale,typeTemplate$1="${label} is not a valid ${type}",localeValues={locale:"en",Pagination:enUS$1,DatePicker:enUS,TimePicker:TimePicker,Calendar:enUS,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No Data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand"},PageHeader:{back:"Back"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:typeTemplate$1,method:typeTemplate$1,array:typeTemplate$1,object:typeTemplate$1,number:typeTemplate$1,date:typeTemplate$1,boolean:typeTemplate$1,integer:typeTemplate$1,float:typeTemplate$1,regexp:typeTemplate$1,email:typeTemplate$1,url:typeTemplate$1,hex:typeTemplate$1},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"}},defaultLocale=localeValues,LocaleReceiver=defineComponent({name:"LocaleReceiver",props:{componentName:String,defaultLocale:{type:[Object,Function]},children:{type:Function}},setup:function(e,t){var n=t.slots,i=inject("localeData",{}),o=computed((function(){var t=e.componentName,n=void 0===t?"global":t,o=e.defaultLocale||defaultLocale[n||"global"],r=i.antLocale,s=n&&r?r[n]:{};return _extends$1(_extends$1({},"function"==typeof o?o():o),s||{})})),r=computed((function(){var e=i.antLocale,t=e&&e.locale;return e&&e.exist&&!t?defaultLocale.locale:t}));return function(){var t=e.children||n.default,s=i.antLocale;return null==t?void 0:t(o.value,r.value,s)}}});function useLocaleReceiver(e,t,n){var i=inject("localeData",{});return[computed((function(){var o=i.antLocale,r=unref(t)||defaultLocale[e||"global"],s=e&&o?o[e]:{};return _extends$1(_extends$1(_extends$1({},"function"==typeof r?r():r),s||{}),unref(n)||{})}))]}var Empty$1=function(){var e=(0,useConfigInject("empty",{}).getPrefixCls)("empty-img-default");return createVNode("svg",{class:e,width:"184",height:"152",viewBox:"0 0 184 152"},[createVNode("g",{fill:"none","fill-rule":"evenodd"},[createVNode("g",{transform:"translate(24 31.67)"},[createVNode("ellipse",{class:"".concat(e,"-ellipse"),cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"},null),createVNode("path",{class:"".concat(e,"-path-1"),d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"},null),createVNode("path",{class:"".concat(e,"-path-2"),d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",transform:"translate(13.56)"},null),createVNode("path",{class:"".concat(e,"-path-3"),d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"},null),createVNode("path",{class:"".concat(e,"-path-4"),d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"},null)]),createVNode("path",{class:"".concat(e,"-path-5"),d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"},null),createVNode("g",{class:"".concat(e,"-g"),transform:"translate(149.65 15.383)"},[createVNode("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"},null),createVNode("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"},null)])])])};Empty$1.PRESENTED_IMAGE_DEFAULT=!0;var DefaultEmptyImg=Empty$1,Simple=function(){var e=(0,useConfigInject("empty",{}).getPrefixCls)("empty-img-simple");return createVNode("svg",{class:e,width:"64",height:"41",viewBox:"0 0 64 41"},[createVNode("g",{transform:"translate(0 1)",fill:"none","fill-rule":"evenodd"},[createVNode("ellipse",{class:"".concat(e,"-ellipse"),fill:"#F5F5F5",cx:"32",cy:"33",rx:"32",ry:"7"},null),createVNode("g",{class:"".concat(e,"-g"),"fill-rule":"nonzero",stroke:"#D9D9D9"},[createVNode("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"},null),createVNode("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:"#FAFAFA",class:"".concat(e,"-path")},null)])])])};Simple.PRESENTED_IMAGE_SIMPLE=!0;var SimpleEmptyImg=Simple;function e$1(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function t$1(e,t,n){return t&&e$1(e.prototype,t),n&&e$1(e,n),e}function n$1(){return(n$1=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function r$1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function i(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)t.indexOf(n=r[i])>=0||(o[n]=e[n]);return o}function o(e){return 1==(null!=(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);var t}var u=Object.prototype,a=u.toString,f=u.hasOwnProperty,c=/^\s*function (\w+)/;function l(e){var t,n=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(n){var i=n.toString().match(c);return i?i[1]:""}return""}var s=function(e){var t,n;return!1!==o(e)&&"function"==typeof(t=e.constructor)&&!1!==o(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")},v=function(e){return e},y=v,d=function(e,t){return f.call(e,t)},h=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},b=Array.isArray||function(e){return"[object Array]"===a.call(e)},O=function(e){return"[object Function]"===a.call(e)},g=function(e){return s(e)&&d(e,"_vueTypes_name")},m=function(e){return s(e)&&(d(e,"type")||["_vueTypes_name","validator","default","required"].some((function(t){return d(e,t)})))};function j(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function _(e,t,n){var i;void 0===n&&(n=!1);var o=!0,r="";i=s(e)?e:{type:e};var a=g(i)?i._vueTypes_name+" - ":"";if(m(i)&&null!==i.type){if(void 0===i.type||!0===i.type)return o;if(!i.required&&void 0===t)return o;b(i.type)?(o=i.type.some((function(e){return!0===_(e,t,!0)})),r=i.type.map((function(e){return l(e)})).join(" or ")):o="Array"===(r=l(i))?b(t):"Object"===r?s(t):"String"===r||"Number"===r||"Boolean"===r||"Function"===r?function(e){if(null==e)return"";var t=e.constructor.toString().match(c);return t?t[1]:""}(t)===r:t instanceof i.type}if(!o){var u=a+'value "'+t+'" should be of type "'+r+'"';return!1===n?(y(u),!1):u}if(d(i,"validator")&&O(i.validator)){var h=y,p=[];if(y=function(e){p.push(e)},o=i.validator(t),y=h,!o){var f=(p.length>1?"* ":"")+p.join("\n* ");return p.length=0,!1===n?(y(f),o):f}}return o}function T(e,t){var n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get:function(){return this.required=!0,this}},def:{value:function(e){return void 0!==e||this.default?O(e)||!0===_(this,e,!0)?(this.default=b(e)?function(){return[].concat(e)}:s(e)?function(){return Object.assign({},e)}:e,this):(y(this._vueTypes_name+' - invalid default value: "'+e+'"'),this):this}}}),i=n.validator;return O(i)&&(n.validator=j(i,n)),n}function w(e,t){var n=T(e,t);return Object.defineProperty(n,"validate",{value:function(e){return O(this.validator)&&y(this._vueTypes_name+" - calling .validate() will overwrite the current custom validator function. Validator info:\n"+JSON.stringify(this)),this.validator=j(e,this),this}})}function k(e,t,n){var o,r,a=(o=t,r={},Object.getOwnPropertyNames(o).forEach((function(e){r[e]=Object.getOwnPropertyDescriptor(o,e)})),Object.defineProperties({},r));if(a._vueTypes_name=e,!s(n))return a;var l,c,d=n.validator,u=i(n,["validator"]);if(O(d)){var h=a.validator;h&&(h=null!==(c=(l=h).__original)&&void 0!==c?c:l),a.validator=j(h?function(e){return h.call(this,e)&&d.call(this,e)}:d,a)}return Object.assign(a,u)}function P(e){return e.replace(/^(?!\s*$)/gm," ")}var x=function(){return w("any",{})},A=function(){return w("function",{type:Function})},E=function(){return w("boolean",{type:Boolean})},N=function(){return w("string",{type:String})},q=function(){return w("number",{type:Number})},S=function(){return w("array",{type:Array})},V=function(){return w("object",{type:Object})},F=function(){return T("integer",{type:Number,validator:function(e){return h(e)}})},D=function(){return T("symbol",{validator:function(e){return"symbol"==typeof e}})};function L(e,t){if(void 0===t&&(t="custom validation failed"),"function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return T(e.name||"<<anonymous function>>",{validator:function(n){var i=e(n);return i||y(this._vueTypes_name+" - "+t),i}})}function Y(e){if(!b(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");var t='oneOf - value should be one of "'+e.join('", "')+'".',n=e.reduce((function(e,t){if(null!=t){var n=t.constructor;-1===e.indexOf(n)&&e.push(n)}return e}),[]);return T("oneOf",{type:n.length>0?n:void 0,validator:function(n){var i=-1!==e.indexOf(n);return i||y(t),i}})}function B(e){if(!b(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");for(var t=!1,n=[],i=0;i<e.length;i+=1){var o=e[i];if(m(o)){if(g(o)&&"oneOf"===o._vueTypes_name){n=n.concat(o.type);continue}if(O(o.validator)&&(t=!0),!0!==o.type&&o.type){n=n.concat(o.type);continue}}n.push(o)}return n=n.filter((function(e,t){return n.indexOf(e)===t})),T("oneOfType",t?{type:n,validator:function(t){var n=[],i=e.some((function(e){var i=_(g(e)&&"oneOf"===e._vueTypes_name?e.type||null:e,t,!0);return"string"==typeof i&&n.push(i),!0===i}));return i||y("oneOfType - provided value does not match any of the "+n.length+" passed-in validators:\n"+P(n.join("\n"))),i}}:{type:n})}function I(e){return T("arrayOf",{type:Array,validator:function(t){var n,i=t.every((function(t){return!0===(n=_(e,t,!0))}));return i||y("arrayOf - value validation error:\n"+P(n)),i}})}function J(e){return T("instanceOf",{type:e})}function M(e){return T("objectOf",{type:Object,validator:function(t){var n,i=Object.keys(t).every((function(i){return!0===(n=_(e,t[i],!0))}));return i||y("objectOf - value validation error:\n"+P(n)),i}})}function R(e){var t=Object.keys(e),n=t.filter((function(t){var n;return!!(null===(n=e[t])||void 0===n?void 0:n.required)})),i=T("shape",{type:Object,validator:function(i){var o=this;if(!s(i))return!1;var r=Object.keys(i);if(n.length>0&&n.some((function(e){return-1===r.indexOf(e)}))){var a=n.filter((function(e){return-1===r.indexOf(e)}));return y(1===a.length?'shape - required property "'+a[0]+'" is not defined.':'shape - required properties "'+a.join('", "')+'" are not defined.'),!1}return r.every((function(n){if(-1===t.indexOf(n))return!0===o._vueTypes_isLoose||(y('shape - shape definition does not include a "'+n+'" property. Allowed keys: "'+t.join('", "')+'".'),!1);var r=_(e[n],i[n],!0);return"string"==typeof r&&y('shape - "'+n+'" property validation error:\n '+P(r)),!0===r}))}});return Object.defineProperty(i,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(i,"loose",{get:function(){return this._vueTypes_isLoose=!0,this}}),i}var $$d=function(){function e(){}return e.extend=function(e){var t=this;if(b(e))return e.forEach((function(e){return t.extend(e)})),this;var n=e.name,o=e.validate,r=void 0!==o&&o,s=e.getter,a=void 0!==s&&s,l=i(e,["name","validate","getter"]);if(d(this,n))throw new TypeError('[VueTypes error]: Type "'+n+'" already defined');var c,u=l.type;return g(u)?(delete l.type,Object.defineProperty(this,n,a?{get:function(){return k(n,u,l)}}:{value:function(){var e,t=k(n,u,l);return t.validator&&(t.validator=(e=t.validator).bind.apply(e,[t].concat([].slice.call(arguments)))),t}})):(c=a?{get:function(){var e=Object.assign({},l);return r?w(n,e):T(n,e)},enumerable:!0}:{value:function(){var e,t,i=Object.assign({},l);return e=r?w(n,i):T(n,i),i.validator&&(e.validator=(t=i.validator).bind.apply(t,[e].concat([].slice.call(arguments)))),e},enumerable:!0},Object.defineProperty(this,n,c))},t$1(e,null,[{key:"any",get:function(){return x()}},{key:"func",get:function(){return A().def(this.defaults.func)}},{key:"bool",get:function(){return E().def(this.defaults.bool)}},{key:"string",get:function(){return N().def(this.defaults.string)}},{key:"number",get:function(){return q().def(this.defaults.number)}},{key:"array",get:function(){return S().def(this.defaults.array)}},{key:"object",get:function(){return V().def(this.defaults.object)}},{key:"integer",get:function(){return F().def(this.defaults.integer)}},{key:"symbol",get:function(){return D()}}]),e}();function z(e){var t;return void 0===e&&(e={func:function(){},bool:!0,string:"",number:0,array:function(){return[]},object:function(){return{}},integer:0}),(t=function(t){function n(){return t.apply(this,arguments)||this}return r$1(n,t),t$1(n,null,[{key:"sensibleDefaults",get:function(){return n$1({},this.defaults)},set:function(t){this.defaults=!1!==t?n$1({},!0!==t?t:e):{}}}]),n}($$d)).defaults=n$1({},e),t}$$d.defaults={},$$d.custom=L,$$d.oneOf=Y,$$d.instanceOf=J,$$d.oneOfType=B,$$d.arrayOf=I,$$d.objectOf=M,$$d.shape=R,$$d.utils={validate:function(e,t){return!0===_(t,e,!0)},toType:function(e,t,n){return void 0===n&&(n=!1),n?w(e,t):T(e,t)}},function(e){function t(){return e.apply(this,arguments)||this}r$1(t,e)}(z());var PropTypes=z({func:void 0,bool:void 0,string:void 0,number:void 0,array:void 0,object:void 0,integer:void 0});PropTypes.extend([{name:"looseBool",getter:!0,type:Boolean,default:void 0},{name:"style",getter:!0,type:[String,Object],default:void 0},{name:"VueNode",getter:!0,type:null}]);var PropTypes$1=PropTypes,__rest$E=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},defaultEmptyImg=createVNode(DefaultEmptyImg,null,null),simpleEmptyImg=createVNode(SimpleEmptyImg,null,null),Empty=function(e,t){var n,i=t.slots,o=void 0===i?{}:i,r=t.attrs,s=useConfigInject("empty",e),a=s.direction,l=s.prefixCls.value,c=_extends$1(_extends$1({},e),r),d=c.image,u=void 0===d?defaultEmptyImg:d,h=c.description,g=void 0===h?(null===(n=o.description)||void 0===n?void 0:n.call(o))||void 0:h,p=c.imageStyle,f=c.class,m=void 0===f?"":f,v=__rest$E(c,["image","description","imageStyle","class"]);return createVNode(LocaleReceiver,{componentName:"Empty",children:function(e){var t,n=void 0!==g?g:e.description,i=null;return i="string"==typeof u?createVNode("img",{alt:"string"==typeof n?n:"empty",src:u},null):u,createVNode("div",_objectSpread2$1({class:classNames(l,m,(t={},_defineProperty$P(t,"".concat(l,"-normal"),u===simpleEmptyImg),_defineProperty$P(t,"".concat(l,"-rtl"),"rtl"===a.value),t))},v),[createVNode("div",{class:"".concat(l,"-image"),style:p},[i]),n&&createVNode("p",{class:"".concat(l,"-description")},[n]),o.default&&createVNode("div",{class:"".concat(l,"-footer")},[filterEmpty(o.default())])])}},null)};Empty.displayName="AEmpty",Empty.PRESENTED_IMAGE_DEFAULT=defaultEmptyImg,Empty.PRESENTED_IMAGE_SIMPLE=simpleEmptyImg,Empty.inheritAttrs=!1,Empty.props={prefixCls:String,image:PropTypes$1.any,description:PropTypes$1.any,imageStyle:{type:Object,default:void 0}};var __unplugin_components_0$7=withInstall(Empty),RenderEmpty=function(e){var t=useConfigInject("empty",e).prefixCls;return function(e){switch(e){case"Table":case"List":return createVNode(__unplugin_components_0$7,{image:__unplugin_components_0$7.PRESENTED_IMAGE_SIMPLE},null);case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return createVNode(__unplugin_components_0$7,{image:__unplugin_components_0$7.PRESENTED_IMAGE_SIMPLE,class:"".concat(t.value,"-small")},null);default:return createVNode(__unplugin_components_0$7,null,null)}}(e.componentName)};function renderEmpty(e){return createVNode(RenderEmpty,{componentName:e},null)}var warned={};function warning$3(e,t){}function call(e,t,n){t||warned[n]||(e(!1,n),warned[n]=!0)}function warningOnce(e,t){call(warning$3,e,t)}var warning$2=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";warningOnce(e,"[antdv: ".concat(t,"] ").concat(n))},ANT_MARK="internalMark",LocaleProvider=defineComponent({name:"ALocaleProvider",props:{locale:{type:Object},ANT_MARK__:String},setup:function(e,t){var n=t.slots;warning$2(e.ANT_MARK__===ANT_MARK,"LocaleProvider","`LocaleProvider` is deprecated. Please use `locale` with `ConfigProvider` instead");var i=reactive({antLocale:_extends$1(_extends$1({},e.locale),{exist:!0}),ANT_MARK__:ANT_MARK});return provide("localeData",i),watch((function(){return e.locale}),(function(){i.antLocale=_extends$1(_extends$1({},e.locale),{exist:!0})}),{immediate:!0}),function(){var e;return null===(e=n.default)||void 0===e?void 0:e.call(n)}}});LocaleProvider.install=function(e){return e.component(LocaleProvider.name,LocaleProvider),e};var LocaleProvider$1=withInstall(LocaleProvider);tuple("bottomLeft","bottomRight","topLeft","topRight");var getTransitionProps=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=_extends$1(e?{name:e,appear:!0,enterFromClass:"".concat(e,"-enter ").concat(e,"-enter-prepare"),enterActiveClass:"".concat(e,"-enter ").concat(e,"-enter-prepare"),enterToClass:"".concat(e,"-enter ").concat(e,"-enter-active"),leaveFromClass:" ".concat(e,"-leave"),leaveActiveClass:"".concat(e,"-leave ").concat(e,"-leave-active"),leaveToClass:"".concat(e,"-leave ").concat(e,"-leave-active")}:{css:!1},t);return n},getTransitionGroupProps=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=_extends$1(e?{name:e,appear:!0,appearActiveClass:"".concat(e),appearToClass:"".concat(e,"-appear ").concat(e,"-appear-active"),enterFromClass:"".concat(e,"-appear ").concat(e,"-enter ").concat(e,"-appear-prepare ").concat(e,"-enter-prepare"),enterActiveClass:"".concat(e),enterToClass:"".concat(e,"-enter ").concat(e,"-appear ").concat(e,"-appear-active ").concat(e,"-enter-active"),leaveActiveClass:"".concat(e," ").concat(e,"-leave"),leaveToClass:"".concat(e,"-leave-active")}:{css:!1},t);return n},getTransitionName$2=function(e,t,n){return void 0!==n?n:"".concat(e,"-").concat(t)},Notice=defineComponent({name:"Notice",inheritAttrs:!1,props:["prefixCls","duration","updateMark","noticeKey","closeIcon","closable","props","onClick","onClose","holder","visible"],setup:function(e,t){var n,i=t.attrs,o=t.slots,r=computed((function(){return void 0===e.duration?1.5:e.duration})),s=function(){r.value&&(n=setTimeout((function(){l()}),1e3*r.value))},a=function(){n&&(clearTimeout(n),n=null)},l=function(t){t&&t.stopPropagation(),a();var n=e.onClose,i=e.noticeKey;n&&n(i)};return onMounted((function(){s()})),onUnmounted((function(){a()})),watch([r,function(){return e.updateMark},function(){return e.visible}],(function(e,t){var n=_slicedToArray$2(e,3),i=n[0],o=n[1],r=n[2],l=_slicedToArray$2(t,3),c=l[0],d=l[1],u=l[2];(i!==c||o!==d||r!==u&&u)&&(a(),s())}),{flush:"post"}),function(){var t,n,r=e.prefixCls,c=e.closable,d=e.closeIcon,u=void 0===d?null===(t=o.closeIcon)||void 0===t?void 0:t.call(o):d,h=e.onClick,g=e.holder,p=i.class,f=i.style,m="".concat(r,"-notice"),v=Object.keys(i).reduce((function(e,t){return"data-"!==t.substr(0,5)&&"aria-"!==t.substr(0,5)&&"role"!==t||(e[t]=i[t]),e}),{}),_=createVNode("div",_objectSpread2$1({class:classNames(m,p,_defineProperty$P({},"".concat(m,"-closable"),c)),style:f,onMouseenter:a,onMouseleave:s,onClick:h},v),[createVNode("div",{class:"".concat(m,"-content")},[null===(n=o.default)||void 0===n?void 0:n.call(o)]),c?createVNode("a",{tabindex:0,onClick:l,class:"".concat(m,"-close")},[u||createVNode("span",{class:"".concat(m,"-close-x")},null)]):null]);return g?createVNode(Teleport,{to:g},{default:function(){return _}}):_}}}),__rest$D=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},seed=0,now$3=Date.now();function getUuid(){var e=seed;return seed+=1,"rcNotification_".concat(now$3,"_").concat(e)}var Notification=defineComponent({name:"Notification",inheritAttrs:!1,props:["prefixCls","transitionName","animation","maxCount","closeIcon"],setup:function(e,t){var n=t.attrs,i=t.expose,o=t.slots,r=new Map,s=ref([]),a=computed((function(){var t=e.prefixCls,n=e.animation,i=void 0===n?"fade":n,o=e.transitionName;return!o&&i&&(o="".concat(t,"-").concat(i)),getTransitionGroupProps(o)})),l=function(e){s.value=s.value.filter((function(t){var n=t.notice,i=n.key;return(n.userPassKey||i)!==e}))};return i({add:function(t,n){var i=t.key||getUuid(),o=_extends$1(_extends$1({},t),{key:i}),r=e.maxCount,a=s.value.map((function(e){return e.notice.key})).indexOf(i),l=s.value.concat();-1!==a?l.splice(a,1,{notice:o,holderCallback:n}):(r&&s.value.length>=r&&(o.key=l[0].notice.key,o.updateMark=getUuid(),o.userPassKey=i,l.shift()),l.push({notice:o,holderCallback:n})),s.value=l},remove:l,notices:s}),function(){var t,i,c=e.prefixCls,d=e.closeIcon,u=void 0===d?null===(i=o.closeIcon)||void 0===i?void 0:i.call(o,{prefixCls:c}):d,h=s.value.map((function(e,t){var n=e.notice,i=e.holderCallback,o=t===s.value.length-1?n.updateMark:void 0,a=n.key,d=n.userPassKey,h=n.content,g=_extends$1(_extends$1(_extends$1({prefixCls:c,closeIcon:"function"==typeof u?u({prefixCls:c}):u},n),n.props),{key:a,noticeKey:d||a,updateMark:o,onClose:function(e){var t;l(e),null===(t=n.onClose)||void 0===t||t.call(n)},onClick:n.onClick});return i?createVNode("div",{key:a,class:"".concat(c,"-hook-holder"),ref:function(e){void 0!==a&&(e?(r.set(a,e),i(e,g)):r.delete(a))}},null):createVNode(Notice,g,{default:function(){return["function"==typeof h?h({prefixCls:c}):h]}})})),g=(_defineProperty$P(t={},c,1),_defineProperty$P(t,n.class,!!n.class),t);return createVNode("div",{class:g,style:n.style||{top:"65px",left:"50%"}},[createVNode(TransitionGroup,_objectSpread2$1({tag:"div"},a.value),{default:function(){return[h]}})])}}});Notification.newInstance=function(e,t){var n=e||{},i=n.name,o=void 0===i?"notification":i,r=n.getContainer,s=n.appContext,a=n.prefixCls,l=n.rootPrefixCls,c=n.transitionName,d=n.hasTransitionName,u=__rest$D(n,["name","getContainer","appContext","prefixCls","rootPrefixCls","transitionName","hasTransitionName"]),h=document.createElement("div");r?r().appendChild(h):document.body.appendChild(h);var g=defineComponent({name:"NotificationWrapper",setup:function(e,n){var i=n.attrs,r=ref();return onMounted((function(){t({notice:function(e){var t;null===(t=r.value)||void 0===t||t.add(e)},removeNotice:function(e){var t;null===(t=r.value)||void 0===t||t.remove(e)},destroy:function(){render(null,h),h.parentNode&&h.parentNode.removeChild(h)},component:r})})),function(){var e=globalConfigForApi,t=e.getPrefixCls(o,a),n=e.getRootPrefixCls(l,t),s=d?c:"".concat(n,"-").concat(c);return createVNode(ConfigProvider,_objectSpread2$1(_objectSpread2$1({},e),{},{notUpdateGlobalConfig:!0,prefixCls:n}),{default:function(){return[createVNode(Notification,_objectSpread2$1(_objectSpread2$1({ref:r},i),{},{prefixCls:t,transitionName:s}),null)]}})}}}),p=createVNode(g,u);p.appContext=s||p.appContext,render(p,h)};var Notification$1=Notification,LoadingOutlined$2={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},LoadingOutlinedSvg=LoadingOutlined$2;function bound01(e,t){isOnePointZero(e)&&(e="100%");var n=isPercentage(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function clamp01(e){return Math.min(1,Math.max(0,e))}function isOnePointZero(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)}function isPercentage(e){return"string"==typeof e&&-1!==e.indexOf("%")}function boundAlpha(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function convertToPercentage(e){return e<=1?"".concat(100*Number(e),"%"):e}function pad2(e){return 1===e.length?"0"+e:String(e)}function rgbToRgb(e,t,n){return{r:255*bound01(e,255),g:255*bound01(t,255),b:255*bound01(n,255)}}function rgbToHsl(e,t,n){e=bound01(e,255),t=bound01(t,255),n=bound01(n,255);var i=Math.max(e,t,n),o=Math.min(e,t,n),r=0,s=0,a=(i+o)/2;if(i===o)s=0,r=0;else{var l=i-o;switch(s=a>.5?l/(2-i-o):l/(i+o),i){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:s,l:a}}function hue2rgb(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function hslToRgb(e,t,n){var i,o,r;if(e=bound01(e,360),t=bound01(t,100),n=bound01(n,100),0===t)o=n,r=n,i=n;else{var s=n<.5?n*(1+t):n+t-n*t,a=2*n-s;i=hue2rgb(a,s,e+1/3),o=hue2rgb(a,s,e),r=hue2rgb(a,s,e-1/3)}return{r:255*i,g:255*o,b:255*r}}function rgbToHsv(e,t,n){e=bound01(e,255),t=bound01(t,255),n=bound01(n,255);var i=Math.max(e,t,n),o=Math.min(e,t,n),r=0,s=i,a=i-o,l=0===i?0:a/i;if(i===o)r=0;else{switch(i){case e:r=(t-n)/a+(t<n?6:0);break;case t:r=(n-e)/a+2;break;case n:r=(e-t)/a+4}r/=6}return{h:r,s:l,v:s}}function hsvToRgb(e,t,n){e=6*bound01(e,360),t=bound01(t,100),n=bound01(n,100);var i=Math.floor(e),o=e-i,r=n*(1-t),s=n*(1-o*t),a=n*(1-(1-o)*t),l=i%6;return{r:255*[n,s,r,r,a,n][l],g:255*[a,n,n,s,r,r][l],b:255*[r,r,a,n,n,s][l]}}function rgbToHex(e,t,n,i){var o=[pad2(Math.round(e).toString(16)),pad2(Math.round(t).toString(16)),pad2(Math.round(n).toString(16))];return i&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function rgbaToHex(e,t,n,i,o){var r=[pad2(Math.round(e).toString(16)),pad2(Math.round(t).toString(16)),pad2(Math.round(n).toString(16)),pad2(convertDecimalToHex(i))];return o&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))&&r[3].startsWith(r[3].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0)+r[3].charAt(0):r.join("")}function convertDecimalToHex(e){return Math.round(255*parseFloat(e)).toString(16)}function convertHexToDecimal(e){return parseIntFromHex(e)/255}function parseIntFromHex(e){return parseInt(e,16)}function numberInputToObject(e){return{r:e>>16,g:(65280&e)>>8,b:255&e}}var names={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function inputToRGB(e){var t={r:0,g:0,b:0},n=1,i=null,o=null,r=null,s=!1,a=!1;return"string"==typeof e&&(e=stringInputToObject(e)),"object"==typeof e&&(isValidCSSUnit(e.r)&&isValidCSSUnit(e.g)&&isValidCSSUnit(e.b)?(t=rgbToRgb(e.r,e.g,e.b),s=!0,a="%"===String(e.r).substr(-1)?"prgb":"rgb"):isValidCSSUnit(e.h)&&isValidCSSUnit(e.s)&&isValidCSSUnit(e.v)?(i=convertToPercentage(e.s),o=convertToPercentage(e.v),t=hsvToRgb(e.h,i,o),s=!0,a="hsv"):isValidCSSUnit(e.h)&&isValidCSSUnit(e.s)&&isValidCSSUnit(e.l)&&(i=convertToPercentage(e.s),r=convertToPercentage(e.l),t=hslToRgb(e.h,i,r),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=boundAlpha(n),{ok:s,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var CSS_INTEGER="[-\\+]?\\d+%?",CSS_NUMBER="[-\\+]?\\d*\\.\\d+%?",CSS_UNIT="(?:".concat(CSS_NUMBER,")|(?:").concat(CSS_INTEGER,")"),PERMISSIVE_MATCH3="[\\s|\\(]+(".concat(CSS_UNIT,")[,|\\s]+(").concat(CSS_UNIT,")[,|\\s]+(").concat(CSS_UNIT,")\\s*\\)?"),PERMISSIVE_MATCH4="[\\s|\\(]+(".concat(CSS_UNIT,")[,|\\s]+(").concat(CSS_UNIT,")[,|\\s]+(").concat(CSS_UNIT,")[,|\\s]+(").concat(CSS_UNIT,")\\s*\\)?"),matchers={CSS_UNIT:new RegExp(CSS_UNIT),rgb:new RegExp("rgb"+PERMISSIVE_MATCH3),rgba:new RegExp("rgba"+PERMISSIVE_MATCH4),hsl:new RegExp("hsl"+PERMISSIVE_MATCH3),hsla:new RegExp("hsla"+PERMISSIVE_MATCH4),hsv:new RegExp("hsv"+PERMISSIVE_MATCH3),hsva:new RegExp("hsva"+PERMISSIVE_MATCH4),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function stringInputToObject(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(names[e])e=names[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=matchers.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=matchers.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=matchers.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=matchers.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=matchers.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=matchers.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=matchers.hex8.exec(e))?{r:parseIntFromHex(n[1]),g:parseIntFromHex(n[2]),b:parseIntFromHex(n[3]),a:convertHexToDecimal(n[4]),format:t?"name":"hex8"}:(n=matchers.hex6.exec(e))?{r:parseIntFromHex(n[1]),g:parseIntFromHex(n[2]),b:parseIntFromHex(n[3]),format:t?"name":"hex"}:(n=matchers.hex4.exec(e))?{r:parseIntFromHex(n[1]+n[1]),g:parseIntFromHex(n[2]+n[2]),b:parseIntFromHex(n[3]+n[3]),a:convertHexToDecimal(n[4]+n[4]),format:t?"name":"hex8"}:!!(n=matchers.hex3.exec(e))&&{r:parseIntFromHex(n[1]+n[1]),g:parseIntFromHex(n[2]+n[2]),b:parseIntFromHex(n[3]+n[3]),format:t?"name":"hex"}}function isValidCSSUnit(e){return Boolean(matchers.CSS_UNIT.exec(String(e)))}var TinyColor=function(){function e(t,n){var i;if(void 0===t&&(t=""),void 0===n&&(n={}),t instanceof e)return t;"number"==typeof t&&(t=numberInputToObject(t)),this.originalInput=t;var o=inputToRGB(t);this.originalInput=t,this.r=o.r,this.g=o.g,this.b=o.b,this.a=o.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(i=n.format)&&void 0!==i?i:o.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=o.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,i=e.b/255;return.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=boundAlpha(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var e=rgbToHsv(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=rgbToHsv(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),i=Math.round(100*e.v);return 1===this.a?"hsv(".concat(t,", ").concat(n,"%, ").concat(i,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=rgbToHsl(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=rgbToHsl(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),i=Math.round(100*e.l);return 1===this.a?"hsl(".concat(t,", ").concat(n,"%, ").concat(i,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),rgbToHex(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),rgbaToHex(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*bound01(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*bound01(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+rgbToHex(this.r,this.g,this.b,!1),t=0,n=Object.entries(names);t<n.length;t++){var i=n[t],o=i[0];if(e===i[1])return o}return!1},e.prototype.toString=function(e){var t=Boolean(e);e=null!=e?e:this.format;var n=!1,i=this.a<1&&this.a>=0;return t||!i||!e.startsWith("hex")&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this.a?this.toName():this.toRgbString()},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=clamp01(n.l),new e(n)},e.prototype.brighten=function(t){void 0===t&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),new e(n)},e.prototype.darken=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=clamp01(n.l),new e(n)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=clamp01(n.s),new e(n)},e.prototype.saturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=clamp01(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),i=(n.h+t)%360;return n.h=i<0?360+i:i,new e(n)},e.prototype.mix=function(t,n){void 0===n&&(n=50);var i=this.toRgb(),o=new e(t).toRgb(),r=n/100;return new e({r:(o.r-i.r)*r+i.r,g:(o.g-i.g)*r+i.g,b:(o.b-i.b)*r+i.b,a:(o.a-i.a)*r+i.a})},e.prototype.analogous=function(t,n){void 0===t&&(t=6),void 0===n&&(n=30);var i=this.toHsl(),o=360/n,r=[this];for(i.h=(i.h-(o*t>>1)+720)%360;--t;)i.h=(i.h+o)%360,r.push(new e(i));return r},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var n=this.toHsv(),i=n.h,o=n.s,r=n.v,s=[],a=1/t;t--;)s.push(new e({h:i,s:o,v:r})),r=(r+a)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),i=new e(t).toRgb();return new e({r:i.r+(n.r-i.r)*n.a,g:i.g+(n.g-i.g)*n.a,b:i.b+(n.b-i.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),i=n.h,o=[this],r=360/t,s=1;s<t;s++)o.push(new e({h:(i+s*r)%360,s:n.s,l:n.l}));return o},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}(),hueStep=2,saturationStep=.16,saturationStep2=.05,brightnessStep1=.05,brightnessStep2=.15,lightColorCount=5,darkColorCount=4,darkColorMap=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function toHsv(e){var t=rgbToHsv(e.r,e.g,e.b);return{h:360*t.h,s:t.s,v:t.v}}function toHex(e){var t=e.r,n=e.g,i=e.b;return"#".concat(rgbToHex(t,n,i,!1))}function mix$1(e,t,n){var i=n/100;return{r:(t.r-e.r)*i+e.r,g:(t.g-e.g)*i+e.g,b:(t.b-e.b)*i+e.b}}function getHue(e,t,n){var i;return(i=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-hueStep*t:Math.round(e.h)+hueStep*t:n?Math.round(e.h)+hueStep*t:Math.round(e.h)-hueStep*t)<0?i+=360:i>=360&&(i-=360),i}function getSaturation(e,t,n){return 0===e.h&&0===e.s?e.s:((i=n?e.s-saturationStep*t:t===darkColorCount?e.s+saturationStep:e.s+saturationStep2*t)>1&&(i=1),n&&t===lightColorCount&&i>.1&&(i=.1),i<.06&&(i=.06),Number(i.toFixed(2)));var i}function getValue$3(e,t,n){var i;return(i=n?e.v+brightnessStep1*t:e.v-brightnessStep2*t)>1&&(i=1),Number(i.toFixed(2))}function generate$2(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],i=inputToRGB(e),o=lightColorCount;o>0;o-=1){var r=toHsv(i),s=toHex(inputToRGB({h:getHue(r,o,!0),s:getSaturation(r,o,!0),v:getValue$3(r,o,!0)}));n.push(s)}n.push(toHex(i));for(var a=1;a<=darkColorCount;a+=1){var l=toHsv(i),c=toHex(inputToRGB({h:getHue(l,a),s:getSaturation(l,a),v:getValue$3(l,a)}));n.push(c)}return"dark"===t.theme?darkColorMap.map((function(e){var i=e.index,o=e.opacity;return toHex(mix$1(inputToRGB(t.backgroundColor||"#141414"),inputToRGB(n[i]),100*o))})):n}var presetPrimaryColors={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},presetPalettes={},presetDarkPalettes={};Object.keys(presetPrimaryColors).forEach((function(e){presetPalettes[e]=generate$2(presetPrimaryColors[e]),presetPalettes[e].primary=presetPalettes[e][5],presetDarkPalettes[e]=generate$2(presetPrimaryColors[e],{theme:"dark",backgroundColor:"#141414"}),presetDarkPalettes[e].primary=presetDarkPalettes[e][5]}));var containers=[],styleElements=[],usage="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function createStyleElement(){var e=document.createElement("style");return e.setAttribute("type","text/css"),e}function insertCss(e,t){if(t=t||{},void 0===e)throw new Error(usage);var n,i=!0===t.prepend?"prepend":"append",o=void 0!==t.container?t.container:document.querySelector("head"),r=containers.indexOf(o);return-1===r&&(r=containers.push(o)-1,styleElements[r]={}),void 0!==styleElements[r]&&void 0!==styleElements[r][i]?n=styleElements[r][i]:(n=styleElements[r][i]=createStyleElement(),"prepend"===i?o.insertBefore(n,o.childNodes[0]):o.appendChild(n)),65279===e.charCodeAt(0)&&(e=e.substr(1,e.length)),n.styleSheet?n.styleSheet.cssText+=e:n.textContent+=e,n}function _objectSpread$N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$O(e,t,n[t])}))}return e}function _defineProperty$O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function warning$1(e,t){}function isIconDefinition(e){return"object"==typeof e&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"==typeof e.icon||"function"==typeof e.icon)}function generate$1(e,t,n){return h$1(e.tag,n?_objectSpread$N({key:t},n,e.attrs):_objectSpread$N({key:t},e.attrs),(e.children||[]).map((function(n,i){return generate$1(n,"".concat(t,"-").concat(e.tag,"-").concat(i))})))}function getSecondaryColor(e){return generate$2(e)[0]}function normalizeTwoToneColors(e){return e?Array.isArray(e)?e:[e]:[]}var iconStyles="\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n",cssInjectedFlag=!1,useInsertStyles=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:iconStyles;nextTick((function(){cssInjectedFlag||("undefined"!=typeof window&&window.document&&window.document.documentElement&&insertCss(e,{prepend:!0}),cssInjectedFlag=!0)}))},_excluded$1=["icon","primaryColor","secondaryColor"];function _objectWithoutProperties$1(e,t){if(null==e)return{};var n,i,o=_objectWithoutPropertiesLoose$1(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function _objectWithoutPropertiesLoose$1(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}function _objectSpread$M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$N(e,t,n[t])}))}return e}function _defineProperty$N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var twoToneColorPalette={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function setTwoToneColors(e){var t=e.primaryColor,n=e.secondaryColor;twoToneColorPalette.primaryColor=t,twoToneColorPalette.secondaryColor=n||getSecondaryColor(t),twoToneColorPalette.calculated=!!n}function getTwoToneColors(){return _objectSpread$M({},twoToneColorPalette)}var IconBase=function(e,t){var n=_objectSpread$M({},e,t.attrs),i=n.icon,o=n.primaryColor,r=n.secondaryColor,s=_objectWithoutProperties$1(n,_excluded$1),a=twoToneColorPalette;if(o&&(a={primaryColor:o,secondaryColor:r||getSecondaryColor(o)}),useInsertStyles(),warning$1(isIconDefinition(i)),!isIconDefinition(i))return null;var l=i;return l&&"function"==typeof l.icon&&(l=_objectSpread$M({},l,{icon:l.icon(a.primaryColor,a.secondaryColor)})),generate$1(l.icon,"svg-".concat(l.name),_objectSpread$M({},s,{"data-icon":l.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"}))};IconBase.props={icon:Object,primaryColor:String,secondaryColor:String,focusable:String},IconBase.inheritAttrs=!1,IconBase.displayName="IconBase",IconBase.getTwoToneColors=getTwoToneColors,IconBase.setTwoToneColors=setTwoToneColors;var VueIcon=IconBase;function _slicedToArray$1(e,t){return _arrayWithHoles$1(e)||_iterableToArrayLimit$1(e,t)||_unsupportedIterableToArray$1(e,t)||_nonIterableRest$1()}function _nonIterableRest$1(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray$1(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray$1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray$1(e,t):void 0}}function _arrayLikeToArray$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function _iterableToArrayLimit$1(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,o,r=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(i=n.next()).done)&&(r.push(i.value),!t||r.length!==t);s=!0);}catch(l){a=!0,o=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return r}}function _arrayWithHoles$1(e){if(Array.isArray(e))return e}function setTwoToneColor(e){var t=_slicedToArray$1(normalizeTwoToneColors(e),2),n=t[0],i=t[1];return VueIcon.setTwoToneColors({primaryColor:n,secondaryColor:i})}function getTwoToneColor(){var e=VueIcon.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var _excluded=["class","icon","spin","rotate","tabindex","twoToneColor","onClick"];function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,o,r=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(i=n.next()).done)&&(r.push(i.value),!t||r.length!==t);s=!0);}catch(l){a=!0,o=l}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return r}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _objectSpread$L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$M(e,t,n[t])}))}return e}function _defineProperty$M(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _objectWithoutProperties(e,t){if(null==e)return{};var n,i,o=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}setTwoToneColor("#1890ff");var Icon=function(e,t){var n,i=_objectSpread$L({},e,t.attrs),o=i.class,r=i.icon,s=i.spin,a=i.rotate,l=i.tabindex,c=i.twoToneColor,d=i.onClick,u=_objectWithoutProperties(i,_excluded),h=(_defineProperty$M(n={anticon:!0},"anticon-".concat(r.name),Boolean(r.name)),_defineProperty$M(n,o,o),n),g=""===s||s||"loading"===r.name?"anticon-spin":"",p=l;void 0===p&&d&&(p=-1,u.tabindex=p);var f=a?{msTransform:"rotate(".concat(a,"deg)"),transform:"rotate(".concat(a,"deg)")}:void 0,m=_slicedToArray(normalizeTwoToneColors(c),2),v=m[0],_=m[1];return createVNode("span",_objectSpread$L({role:"img","aria-label":r.name},u,{onClick:d,class:h}),[createVNode(VueIcon,{class:g,icon:r,primaryColor:v,secondaryColor:_,style:f},null)])};Icon.props={spin:Boolean,rotate:Number,icon:Object,twoToneColor:String},Icon.displayName="AntdIcon",Icon.inheritAttrs=!1,Icon.getTwoToneColor=getTwoToneColor,Icon.setTwoToneColor=setTwoToneColor;var AntdIcon=Icon;function _objectSpread$K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$L(e,t,n[t])}))}return e}function _defineProperty$L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var LoadingOutlined=function(e,t){var n=_objectSpread$K({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$K({},n,{icon:LoadingOutlinedSvg}),null)};LoadingOutlined.displayName="LoadingOutlined",LoadingOutlined.inheritAttrs=!1;var LoadingOutlined$1=LoadingOutlined,ExclamationCircleFilled$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},ExclamationCircleFilledSvg=ExclamationCircleFilled$2;function _objectSpread$J(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$K(e,t,n[t])}))}return e}function _defineProperty$K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ExclamationCircleFilled=function(e,t){var n=_objectSpread$J({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$J({},n,{icon:ExclamationCircleFilledSvg}),null)};ExclamationCircleFilled.displayName="ExclamationCircleFilled",ExclamationCircleFilled.inheritAttrs=!1;var ExclamationCircleFilled$1=ExclamationCircleFilled,CloseCircleFilled$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"}}]},name:"close-circle",theme:"filled"},CloseCircleFilledSvg=CloseCircleFilled$2;function _objectSpread$I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$J(e,t,n[t])}))}return e}function _defineProperty$J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var CloseCircleFilled=function(e,t){var n=_objectSpread$I({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$I({},n,{icon:CloseCircleFilledSvg}),null)};CloseCircleFilled.displayName="CloseCircleFilled",CloseCircleFilled.inheritAttrs=!1;var CloseCircleFilled$1=CloseCircleFilled,CheckCircleFilled$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"},CheckCircleFilledSvg=CheckCircleFilled$2;function _objectSpread$H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$I(e,t,n[t])}))}return e}function _defineProperty$I(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var CheckCircleFilled=function(e,t){var n=_objectSpread$H({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$H({},n,{icon:CheckCircleFilledSvg}),null)};CheckCircleFilled.displayName="CheckCircleFilled",CheckCircleFilled.inheritAttrs=!1;var CheckCircleFilled$1=CheckCircleFilled,InfoCircleFilled$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},InfoCircleFilledSvg=InfoCircleFilled$2;function _objectSpread$G(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$H(e,t,n[t])}))}return e}function _defineProperty$H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var InfoCircleFilled=function(e,t){var n=_objectSpread$G({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$G({},n,{icon:InfoCircleFilledSvg}),null)};InfoCircleFilled.displayName="InfoCircleFilled",InfoCircleFilled.inheritAttrs=!1;var InfoCircleFilled$1=InfoCircleFilled,defaultDuration$1=3,defaultTop$1,messageInstance,key=1,localPrefixCls="",transitionName="move-up",hasTransitionName=!1,getContainer$1=function(){return document.body},maxCount$1,rtl$1=!1;function getKeyThenIncreaseKey(){return key++}function setMessageConfig(e){void 0!==e.top&&(defaultTop$1=e.top,messageInstance=null),void 0!==e.duration&&(defaultDuration$1=e.duration),void 0!==e.prefixCls&&(localPrefixCls=e.prefixCls),void 0!==e.getContainer&&(getContainer$1=e.getContainer,messageInstance=null),void 0!==e.transitionName&&(transitionName=e.transitionName,messageInstance=null,hasTransitionName=!0),void 0!==e.maxCount&&(maxCount$1=e.maxCount,messageInstance=null),void 0!==e.rtl&&(rtl$1=e.rtl)}function getMessageInstance(e,t){messageInstance?t(messageInstance):Notification$1.newInstance({appContext:e.appContext,prefixCls:e.prefixCls||localPrefixCls,rootPrefixCls:e.rootPrefixCls,transitionName:transitionName,hasTransitionName:hasTransitionName,style:{top:defaultTop$1},getContainer:getContainer$1||e.getPopupContainer,maxCount:maxCount$1,name:"message"},(function(e){messageInstance?t(messageInstance):(messageInstance=e,t(e))}))}var typeToIcon$1={info:InfoCircleFilled$1,success:CheckCircleFilled$1,error:CloseCircleFilled$1,warning:ExclamationCircleFilled$1,loading:LoadingOutlined$1};function notice$1(e){var t=void 0!==e.duration?e.duration:defaultDuration$1,n=e.key||getKeyThenIncreaseKey(),i=new Promise((function(i){var o=function(){return"function"==typeof e.onClose&&e.onClose(),i(!0)};getMessageInstance(e,(function(i){i.notice({key:n,duration:t,style:e.style||{},class:e.class,content:function(t){var n,i=t.prefixCls,o=typeToIcon$1[e.type],r=o?createVNode(o,null,null):"",s=classNames("".concat(i,"-custom-content"),(_defineProperty$P(n={},"".concat(i,"-").concat(e.type),e.type),_defineProperty$P(n,"".concat(i,"-rtl"),!0===rtl$1),n));return createVNode("div",{class:s},["function"==typeof e.icon?e.icon():e.icon||r,createVNode("span",null,["function"==typeof e.content?e.content():e.content])])},onClose:o,onClick:e.onClick})}))})),o=function(){messageInstance&&messageInstance.removeNotice(n)};return o.then=function(e,t){return i.then(e,t)},o.promise=i,o}function isArgsProps(e){return"[object Object]"===Object.prototype.toString.call(e)&&!!e.content}var api$2={open:notice$1,config:setMessageConfig,destroy:function(e){messageInstance&&(e?(0,messageInstance.removeNotice)(e):((0,messageInstance.destroy)(),messageInstance=null))}};function attachTypeApi(e,t){e[t]=function(n,i,o){return isArgsProps(n)?e.open(_extends$1(_extends$1({},n),{type:t})):("function"==typeof i&&(o=i,i=void 0),e.open({content:n,duration:i,type:t,onClose:o}))}}["success","info","warning","error","loading"].forEach((function(e){return attachTypeApi(api$2,e)})),api$2.warn=api$2.warning;var message=api$2,commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getAugmentedNamespace(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})})),t}var regeneratorRuntime$1={exports:{}},_typeof$2={exports:{}};!function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(_typeof$2),function(e){var t=_typeof$2.exports.default;function n(){
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
- e.exports=n=function(){return i},e.exports.__esModule=!0,e.exports.default=e.exports;var i={},o=Object.prototype,r=o.hasOwnProperty,s="function"==typeof Symbol?Symbol:{},a=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(L){d=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var o,r,s,a,l=t&&t.prototype instanceof p?t:p,c=Object.create(l.prototype),d=new T(i||[]);return c._invoke=(o=e,r=n,s=d,a="suspendedStart",function(e,t){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===e)throw t;return{value:void 0,done:!0}}for(s.method=e,s.arg=t;;){var n=s.delegate;if(n){var i=w(n,s);if(i){if(i===g)continue;return i}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if("suspendedStart"===a)throw a="completed",s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);a="executing";var l=h(o,r,s);if("normal"===l.type){if(a=s.done?"completed":"suspendedYield",l.arg===g)continue;return{value:l.arg,done:s.done}}"throw"===l.type&&(a="completed",s.method="throw",s.arg=l.arg)}}),c}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(L){return{type:"throw",arg:L}}}i.wrap=u;var g={};function p(){}function f(){}function m(){}var v={};d(v,a,(function(){return this}));var _=Object.getPrototypeOf,C=_&&_(_(I([])));C&&C!==o&&r.call(C,a)&&(v=C);var b=m.prototype=p.prototype=Object.create(v);function y(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,n){function i(o,s,a,l){var c=h(e[o],e,s);if("throw"!==c.type){var d=c.arg,u=d.value;return u&&"object"==t(u)&&r.call(u,"__await")?n.resolve(u.__await).then((function(e){i("next",e,a,l)}),(function(e){i("throw",e,a,l)})):n.resolve(u).then((function(e){d.value=e,a(d)}),(function(e){return i("throw",e,a,l)}))}l(c.arg)}var o;this._invoke=function(e,t){function r(){return new n((function(n,o){i(e,t,n,o)}))}return o=o?o.then(r,r):r()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var i=h(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,g;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,g):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function E(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 x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function I(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=m,d(b,"constructor",m),d(m,"constructor",f),f.displayName=d(m,c,"GeneratorFunction"),i.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,d(e,c,"GeneratorFunction")),e.prototype=Object.create(b),e},i.awrap=function(e){return{__await:e}},y(S.prototype),d(S.prototype,l,(function(){return this})),i.AsyncIterator=S,i.async=function(e,t,n,o,r){void 0===r&&(r=Promise);var s=new S(u(e,t,n,o),r);return i.isGeneratorFunction(t)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},y(b),d(b,c,"Generator"),d(b,a,(function(){return this})),d(b,"toString",(function(){return"[object Generator]"})),i.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},i.values=I,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,i){return s.type="throw",s.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(a&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(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 i=n.completion;if("throw"===i.type){var o=i.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:I(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),g}},i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(regeneratorRuntime$1);var runtime=regeneratorRuntime$1.exports(),regenerator=runtime;try{regeneratorRuntime=runtime}catch(accidentalStrictMode){"object"==typeof globalThis?globalThis.regeneratorRuntime=runtime:Function("r","regeneratorRuntime = r")(runtime)}var CheckCircleOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},CheckCircleOutlinedSvg=CheckCircleOutlined$2;function _objectSpread$F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$G(e,t,n[t])}))}return e}function _defineProperty$G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var CheckCircleOutlined=function(e,t){var n=_objectSpread$F({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$F({},n,{icon:CheckCircleOutlinedSvg}),null)};CheckCircleOutlined.displayName="CheckCircleOutlined",CheckCircleOutlined.inheritAttrs=!1;var CheckCircleOutlined$1=CheckCircleOutlined,InfoCircleOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"},InfoCircleOutlinedSvg=InfoCircleOutlined$2;function _objectSpread$E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$F(e,t,n[t])}))}return e}function _defineProperty$F(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var InfoCircleOutlined=function(e,t){var n=_objectSpread$E({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$E({},n,{icon:InfoCircleOutlinedSvg}),null)};InfoCircleOutlined.displayName="InfoCircleOutlined",InfoCircleOutlined.inheritAttrs=!1;var InfoCircleOutlined$1=InfoCircleOutlined,CloseCircleOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 00-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z"}},{tag:"path",attrs:{d:"M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"close-circle",theme:"outlined"},CloseCircleOutlinedSvg=CloseCircleOutlined$2;function _objectSpread$D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$E(e,t,n[t])}))}return e}function _defineProperty$E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var CloseCircleOutlined=function(e,t){var n=_objectSpread$D({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$D({},n,{icon:CloseCircleOutlinedSvg}),null)};CloseCircleOutlined.displayName="CloseCircleOutlined",CloseCircleOutlined.inheritAttrs=!1;var CloseCircleOutlined$1=CloseCircleOutlined,ExclamationCircleOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},ExclamationCircleOutlinedSvg=ExclamationCircleOutlined$2;function _objectSpread$C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$D(e,t,n[t])}))}return e}function _defineProperty$D(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ExclamationCircleOutlined=function(e,t){var n=_objectSpread$C({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$C({},n,{icon:ExclamationCircleOutlinedSvg}),null)};ExclamationCircleOutlined.displayName="ExclamationCircleOutlined",ExclamationCircleOutlined.inheritAttrs=!1;var ExclamationCircleOutlined$1=ExclamationCircleOutlined,CloseOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}}]},name:"close",theme:"outlined"},CloseOutlinedSvg=CloseOutlined$2;function _objectSpread$B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$C(e,t,n[t])}))}return e}function _defineProperty$C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var CloseOutlined=function(e,t){var n=_objectSpread$B({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$B({},n,{icon:CloseOutlinedSvg}),null)};CloseOutlined.displayName="CloseOutlined",CloseOutlined.inheritAttrs=!1;var CloseOutlined$1=CloseOutlined;globalThis&&globalThis.__awaiter;var notificationInstance={},defaultDuration=4.5,defaultTop="24px",defaultBottom="24px",defaultPrefixCls$1="",defaultPlacement="topRight",defaultGetContainer=function(){return document.body},defaultCloseIcon=null,rtl=!1,maxCount;function setNotificationConfig(e){var t=e.duration,n=e.placement,i=e.bottom,o=e.top,r=e.getContainer,s=e.closeIcon,a=e.prefixCls;void 0!==a&&(defaultPrefixCls$1=a),void 0!==t&&(defaultDuration=t),void 0!==n&&(defaultPlacement=n),void 0!==i&&(defaultBottom="number"==typeof i?"".concat(i,"px"):i),void 0!==o&&(defaultTop="number"==typeof o?"".concat(o,"px"):o),void 0!==r&&(defaultGetContainer=r),void 0!==s&&(defaultCloseIcon=s),void 0!==e.rtl&&(rtl=e.rtl),void 0!==e.maxCount&&(maxCount=e.maxCount)}function getPlacementStyle(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:defaultTop,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:defaultBottom;switch(e){case"topLeft":t={left:"0px",top:n,bottom:"auto"};break;case"topRight":t={right:"0px",top:n,bottom:"auto"};break;case"bottomLeft":t={left:"0px",top:"auto",bottom:i};break;default:t={right:"0px",top:"auto",bottom:i}}return t}function getNotificationInstance(e,t){var n=e.prefixCls,i=e.placement,o=void 0===i?defaultPlacement:i,r=e.getContainer,s=void 0===r?defaultGetContainer:r,a=e.top,l=e.bottom,c=e.closeIcon,d=void 0===c?defaultCloseIcon:c,u=e.appContext,h=(0,globalConfig().getPrefixCls)("notification",n||defaultPrefixCls$1),g="".concat(h,"-").concat(o,"-").concat(rtl),p=notificationInstance[g];if(p)Promise.resolve(p).then((function(e){t(e)}));else{var f=classNames("".concat(h,"-").concat(o),_defineProperty$P({},"".concat(h,"-rtl"),!0===rtl));Notification$1.newInstance({name:"notification",prefixCls:n||defaultPrefixCls$1,class:f,style:getPlacementStyle(o,a,l),appContext:u,getContainer:s,closeIcon:function(e){var t=e.prefixCls;return createVNode("span",{class:"".concat(t,"-close-x")},[renderHelper(d,{},createVNode(CloseOutlined$1,{class:"".concat(t,"-close-icon")},null))])},maxCount:maxCount,hasTransitionName:!0},(function(e){notificationInstance[g]=e,t(e)}))}}var typeToIcon={success:CheckCircleOutlined$1,info:InfoCircleOutlined$1,error:CloseCircleOutlined$1,warning:ExclamationCircleOutlined$1};function notice(e){var t=e.icon,n=e.type,i=e.description,o=e.message,r=e.btn,s=void 0===e.duration?defaultDuration:e.duration;getNotificationInstance(e,(function(a){a.notice({content:function(e){var s=e.prefixCls,a="".concat(s,"-notice"),l=null;if(t)l=function(){return createVNode("span",{class:"".concat(a,"-icon")},[renderHelper(t)])};else if(n){var c=typeToIcon[n];l=function(){return createVNode(c,{class:"".concat(a,"-icon ").concat(a,"-icon-").concat(n)},null)}}return createVNode("div",{class:l?"".concat(a,"-with-icon"):""},[l&&l(),createVNode("div",{class:"".concat(a,"-message")},[!i&&l?createVNode("span",{class:"".concat(a,"-message-single-line-auto-margin")},null):null,renderHelper(o)]),createVNode("div",{class:"".concat(a,"-description")},[renderHelper(i)]),r?createVNode("span",{class:"".concat(a,"-btn")},[renderHelper(r)]):null])},duration:s,closable:!0,onClose:e.onClose,onClick:e.onClick,key:e.key,style:e.style||{},class:e.class})}))}var api$1={open:notice,close:function(e){Object.keys(notificationInstance).forEach((function(t){return Promise.resolve(notificationInstance[t]).then((function(t){t.removeNotice(e)}))}))},config:setNotificationConfig,destroy:function(){Object.keys(notificationInstance).forEach((function(e){Promise.resolve(notificationInstance[e]).then((function(e){e.destroy()})),delete notificationInstance[e]}))}},iconTypes=["success","info","warning","error"];iconTypes.forEach((function(e){api$1[e]=function(t){return api$1.open(_extends$1(_extends$1({},t),{type:e}))}})),api$1.warn=api$1.warning;var notification=api$1;function canUseDom(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}var MARK_KEY="vc-util-key";function getMark(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):MARK_KEY}function getContainer(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function injectCSS(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!canUseDom())return null;var o=document.createElement("style");(null===(t=i.csp)||void 0===t?void 0:t.nonce)&&(o.nonce=null===(n=i.csp)||void 0===n?void 0:n.nonce),o.innerHTML=e;var r=getContainer(i),s=r.firstChild;return i.prepend&&r.prepend?r.prepend(o):i.prepend&&s?r.insertBefore(o,s):r.appendChild(o),o}var containerCache=new Map;function findExistNode(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=getContainer(t);return Array.from(containerCache.get(n).children).find((function(n){return"STYLE"===n.tagName&&n.getAttribute(getMark(t))===e}))}function updateCSS(e,t){var n,i,o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=getContainer(r);if(!containerCache.has(s)){var a=injectCSS("",r),l=a.parentNode;containerCache.set(s,l),l.removeChild(a)}var c=findExistNode(t,r);if(c)return(null===(n=r.csp)||void 0===n?void 0:n.nonce)&&c.nonce!==(null===(i=r.csp)||void 0===i?void 0:i.nonce)&&(c.nonce=null===(o=r.csp)||void 0===o?void 0:o.nonce),c.innerHTML!==e&&(c.innerHTML=e),c;var d=injectCSS(e,r);return d.setAttribute(getMark(r),t),d}var devWarning=function(e,t,n){warningOnce(e,"[ant-design-vue: ".concat(t,"] ").concat(n))},dynamicStyleMark="-ant-".concat(Date.now(),"-").concat(Math.random());function registerTheme(e,t){var n={},i=function(e,t){var n=e.clone();return(n=(null==t?void 0:t(n))||n).toRgbString()},o=function(e,t){var o=new TinyColor(e),r=generate$2(o.toRgbString());n["".concat(t,"-color")]=i(o),n["".concat(t,"-color-disabled")]=r[1],n["".concat(t,"-color-hover")]=r[4],n["".concat(t,"-color-active")]=r[6],n["".concat(t,"-color-outline")]=o.clone().setAlpha(.2).toRgbString(),n["".concat(t,"-color-deprecated-bg")]=r[1],n["".concat(t,"-color-deprecated-border")]=r[3]};if(t.primaryColor){o(t.primaryColor,"primary");var r=new TinyColor(t.primaryColor),s=generate$2(r.toRgbString());s.forEach((function(e,t){n["primary-".concat(t+1)]=e})),n["primary-color-deprecated-l-35"]=i(r,(function(e){return e.lighten(35)})),n["primary-color-deprecated-l-20"]=i(r,(function(e){return e.lighten(20)})),n["primary-color-deprecated-t-20"]=i(r,(function(e){return e.tint(20)})),n["primary-color-deprecated-t-50"]=i(r,(function(e){return e.tint(50)})),n["primary-color-deprecated-f-12"]=i(r,(function(e){return e.setAlpha(.12*e.getAlpha())}));var a=new TinyColor(s[0]);n["primary-color-active-deprecated-f-30"]=i(a,(function(e){return e.setAlpha(.3*e.getAlpha())})),n["primary-color-active-deprecated-d-02"]=i(a,(function(e){return e.darken(2)}))}t.successColor&&o(t.successColor,"success"),t.warningColor&&o(t.warningColor,"warning"),t.errorColor&&o(t.errorColor,"error"),t.infoColor&&o(t.infoColor,"info");var l=Object.keys(n).map((function(t){return"--".concat(e,"-").concat(t,": ").concat(n[t],";")}));canUseDom()?updateCSS("\n :root {\n ".concat(l.join("\n"),"\n }\n "),"".concat(dynamicStyleMark,"-dynamic-theme")):devWarning(!1,"ConfigProvider","SSR do not support dynamic theme with css variables.")}var GlobalFormContextKey=Symbol("GlobalFormContextKey"),useProvideGlobalForm=function(e){provide(GlobalFormContextKey,e)},useInjectGlobalForm=function(){return inject(GlobalFormContextKey,{validateMessages:computed((function(){}))})},configProviderProps=function(){return{getTargetContainer:{type:Function},getPopupContainer:{type:Function},prefixCls:String,getPrefixCls:{type:Function},renderEmpty:{type:Function},transformCellText:{type:Function},csp:{type:Object,default:void 0},input:{type:Object},autoInsertSpaceInButton:{type:Boolean,default:void 0},locale:{type:Object,default:void 0},pageHeader:{type:Object},componentSize:{type:String},direction:{type:String},space:{type:Object},virtual:{type:Boolean,default:void 0},dropdownMatchSelectWidth:{type:[Number,Boolean],default:!0},form:{type:Object,default:void 0},notUpdateGlobalConfig:Boolean}},defaultPrefixCls="ant";function getGlobalPrefixCls(){return globalConfigForApi.prefixCls||defaultPrefixCls}var globalConfigByCom=reactive({}),globalConfigBySet=reactive({}),globalConfigForApi=reactive({}),stopWatchEffect;watchEffect((function(){_extends$1(globalConfigForApi,globalConfigByCom,globalConfigBySet),globalConfigForApi.prefixCls=getGlobalPrefixCls(),globalConfigForApi.getPrefixCls=function(e,t){return t||(e?"".concat(globalConfigForApi.prefixCls,"-").concat(e):globalConfigForApi.prefixCls)},globalConfigForApi.getRootPrefixCls=function(e,t){return e||(globalConfigForApi.prefixCls?globalConfigForApi.prefixCls:t&&t.includes("-")?t.replace(/^(.*)-[^-]*$/,"$1"):getGlobalPrefixCls())}}));var setGlobalConfig=function(e){stopWatchEffect&&stopWatchEffect(),stopWatchEffect=watchEffect((function(){_extends$1(globalConfigBySet,reactive(e))})),e.theme&®isterTheme(getGlobalPrefixCls(),e.theme)},globalConfig=function(){return{getPrefixCls:function(e,t){return t||(e?"".concat(getGlobalPrefixCls(),"-").concat(e):getGlobalPrefixCls())},getRootPrefixCls:function(e,t){return e||(globalConfigForApi.prefixCls?globalConfigForApi.prefixCls:t&&t.includes("-")?t.replace(/^(.*)-[^-]*$/,"$1"):getGlobalPrefixCls())}}},ConfigProvider=defineComponent({name:"AConfigProvider",inheritAttrs:!1,props:configProviderProps(),setup:function(e,t){var n=t.slots,i=reactive(_extends$1(_extends$1({},e),{getPrefixCls:function(t,n){var i=e.prefixCls;if(n)return n;var o=i||function(t,n){var i=e.prefixCls,o=void 0===i?"ant":i;return n||(t?"".concat(o,"-").concat(t):o)}("");return t?"".concat(o,"-").concat(t):o},renderEmpty:function(t){return(e.renderEmpty||n.renderEmpty||renderEmpty)(t)}}));Object.keys(e).forEach((function(t){watch((function(){return e[t]}),(function(){i[t]=e[t]}))})),e.notUpdateGlobalConfig||(_extends$1(globalConfigByCom,i),watch(i,(function(){_extends$1(globalConfigByCom,i)})));var o=computed((function(){var t,n,i={};return e.locale&&(i=(null===(t=e.locale.Form)||void 0===t?void 0:t.defaultValidateMessages)||(null===(n=defaultLocale.Form)||void 0===n?void 0:n.defaultValidateMessages)||{}),e.form&&e.form.validateMessages&&(i=_extends$1(_extends$1({},i),e.form.validateMessages)),i}));useProvideGlobalForm({validateMessages:o}),provide("configProvider",i);return watchEffect((function(){e.direction&&(message.config({rtl:"rtl"===e.direction}),notification.config({rtl:"rtl"===e.direction}))})),function(){return createVNode(LocaleReceiver,{children:function(t,i,o){return function(t){var i;return createVNode(LocaleProvider$1,{locale:e.locale||t,ANT_MARK__:ANT_MARK},{default:function(){return[null===(i=n.default)||void 0===i?void 0:i.call(n)]}})}(o)}},null)}}}),defaultConfigProvider=reactive({getPrefixCls:function(e,t){return t||(e?"ant-".concat(e):"ant")},renderEmpty:renderEmpty,direction:"ltr"});ConfigProvider.config=setGlobalConfig,ConfigProvider.install=function(e){e.component(ConfigProvider.name,ConfigProvider)};var useConfigInject=function(e,t){var n=inject("configProvider",defaultConfigProvider),i=computed((function(){return n.getPrefixCls(e,t.prefixCls)})),o=computed((function(){var e;return null!==(e=t.direction)&&void 0!==e?e:n.direction})),r=computed((function(){return n.getPrefixCls()})),s=computed((function(){return n.autoInsertSpaceInButton})),a=computed((function(){return n.renderEmpty})),l=computed((function(){return n.space})),c=computed((function(){return n.pageHeader})),d=computed((function(){return n.form})),u=computed((function(){return t.getTargetContainer||n.getTargetContainer})),h=computed((function(){return t.getPopupContainer||n.getPopupContainer})),g=computed((function(){var e;return null!==(e=t.dropdownMatchSelectWidth)&&void 0!==e?e:n.dropdownMatchSelectWidth})),p=computed((function(){return(void 0===t.virtual?!1!==n.virtual:!1!==t.virtual)&&!1!==g.value})),f=computed((function(){return t.size||n.componentSize})),m=computed((function(){var e;return t.autocomplete||(null===(e=n.input)||void 0===e?void 0:e.autocomplete)})),v=computed((function(){return n.csp}));return{configProvider:n,prefixCls:i,direction:o,size:f,getTargetContainer:u,getPopupContainer:h,space:l,pageHeader:c,form:d,autoInsertSpaceInButton:s,renderEmpty:a,virtual:p,dropdownMatchSelectWidth:g,rootPrefixCls:r,getPrefixCls:n.getPrefixCls,autocomplete:m,csp:v}};function omit$2(e,t){for(var n=_extends$1({},e),i=0;i<t.length;i+=1){delete n[t[i]]}return n}function isWindow$1(e){return null!=e&&e===e.window}function getScroll$2(e,t){var n;if("undefined"==typeof window)return 0;var i=t?"scrollTop":"scrollLeft",o=0;return isWindow$1(e)?o=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?o=e.documentElement[i]:e&&(o=e[i]),e&&!isWindow$1(e)&&"number"!=typeof o&&(o=null===(n=(e.ownerDocument||e).documentElement)||void 0===n?void 0:n[i]),o}function easeInOutCubic(e,t,n,i){var o=n-t;return(e/=i/2)<1?o/2*e*e*e+t:o/2*((e-=2)*e*e+2)+t}function scrollTo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getContainer,i=void 0===n?function(){return window}:n,o=t.callback,r=t.duration,s=void 0===r?450:r,a=i(),l=getScroll$2(a,!0),c=Date.now(),d=function t(){var n=Date.now()-c,i=easeInOutCubic(n>s?s:n,l,e,s);isWindow$1(a)?a.scrollTo(window.pageXOffset,i):a instanceof HTMLDocument||"HTMLDocument"===a.constructor.name?a.documentElement.scrollTop=i:a.scrollTop=i,n<s?wrapperRaf(t):"function"==typeof o&&o()};wrapperRaf(d)}function _toArray(e){return _arrayWithHoles$2(e)||_iterableToArray(e)||_unsupportedIterableToArray$2(e)||_nonIterableRest$2()}function getKey$2(e,t){var n,i=e.key;return"value"in e&&(n=e.value),null!=i?i:void 0!==n?n:"rc-index-key-".concat(t)}function fillFieldNames$2(e,t){var n=e||{};return{label:n.label||(t?"children":"label"),value:n.value||"value",options:n.options||"options"}}function flattenOptions(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fieldNames,i=t.childrenAsData,o=[],r=fillFieldNames$2(n,!1),s=r.label,a=r.value,l=r.options;function c(e,t){e.forEach((function(e){var n=e[s];if(t||!(l in e)){var r=e[a];o.push({key:getKey$2(e,o.length),groupOption:t,data:e,label:n,value:r})}else{var d=n;void 0===d&&i&&(d=e.label),o.push({key:getKey$2(e,o.length),group:!0,data:e,label:d}),c(e[l],!0)}}))}return c(e,!1),o}function injectPropsWithOption(e){var t=_extends$1({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return t}}),t}function getSeparatedContent(e,t){if(!t||!t.length)return null;var n=!1;var i=function e(t,i){var o=_toArray(i),r=o[0],s=o.slice(1);if(!r)return[t];var a=t.split(r);return n=n||a.length>1,a.reduce((function(t,n){return[].concat(_toConsumableArray$2(t),_toConsumableArray$2(e(n,s)))}),[]).filter((function(e){return e}))}(e,t);return n?i:null}function contains(e,t){return!!e&&e.contains(t)}var availablePrefixs=["moz","ms","webkit"];function requestAnimationFramePolyfill(){var e=0;return function(t){var n=(new Date).getTime(),i=Math.max(0,16-(n-e)),o=window.setTimeout((function(){t(n+i)}),i);return e=n+i,o}}function getRequestAnimationFrame(){if("undefined"==typeof window)return function(){};if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);var e=availablePrefixs.filter((function(e){return"".concat(e,"RequestAnimationFrame")in window}))[0];return e?window["".concat(e,"RequestAnimationFrame")]:requestAnimationFramePolyfill()}function cancelRequestAnimationFrame(e){if("undefined"==typeof window)return null;if(window.cancelAnimationFrame)return window.cancelAnimationFrame(e);var t=availablePrefixs.filter((function(e){return"".concat(e,"CancelAnimationFrame")in window||"".concat(e,"CancelRequestAnimationFrame")in window}))[0];return t?(window["".concat(t,"CancelAnimationFrame")]||window["".concat(t,"CancelRequestAnimationFrame")]).call(this,e):clearTimeout(e)}var raf=getRequestAnimationFrame(),cancelAnimationTimeout=function(e){return cancelRequestAnimationFrame(e.id)},requestAnimationTimeout=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Date.now();function i(){Date.now()-n>=t?e.call():o.id=raf(i)}var o={id:raf(i)};return o},innerProps={visible:Boolean,prefixCls:String,zIndex:Number,destroyPopupOnHide:Boolean,forceRender:Boolean,animation:[String,Object],transitionName:String,stretch:{type:String},align:{type:Object},point:{type:Object},getRootDomNode:{type:Function},getClassNameFromAlign:{type:Function},onMouseenter:{type:Function},onMouseleave:{type:Function},onMousedown:{type:Function},onTouchstart:{type:Function}},mobileProps=_extends$1(_extends$1({},innerProps),{mobile:{type:Object}}),popupProps=_extends$1(_extends$1({},innerProps),{mask:Boolean,mobile:{type:Object},maskAnimation:String,maskTransitionName:String});function getMotion(e){var t=e.prefixCls,n=e.animation,i=e.transitionName;return n?{name:"".concat(t,"-").concat(n)}:i?{name:i}:{}}function Mask$1(e){var t=e.prefixCls,n=e.visible,i=e.zIndex,o=e.mask,r=e.maskAnimation,s=e.maskTransitionName;if(!o)return null;var a={};return(s||r)&&(a=getMotion({prefixCls:t,transitionName:s,animation:r})),createVNode(Transition,_objectSpread2$1({appear:!0},a),{default:function(){return[withDirectives(createVNode("div",{style:{zIndex:i},class:"".concat(t,"-mask")},null),[[resolveDirective("if"),n]])]}})}Mask$1.displayName="Mask";var MobilePopupInner=defineComponent({name:"MobilePopupInner",inheritAttrs:!1,props:mobileProps,emits:["mouseenter","mouseleave","mousedown","touchstart","align"],setup:function(e,t){var n=t.expose,i=t.slots,o=ref();return n({forceAlign:function(){},getElement:function(){return o.value}}),function(){var t,n=e.zIndex,r=e.visible,s=e.prefixCls,a=e.mobile,l=(a=void 0===a?{}:a).popupClassName,c=a.popupStyle,d=a.popupMotion,u=void 0===d?{}:d,h=a.popupRender,g=_extends$1({zIndex:n},c),p=flattenChildren(null===(t=i.default)||void 0===t?void 0:t.call(i));p.length>1&&(p=createVNode("div",{class:"".concat(s,"-content")},[p])),h&&(p=h(p));var f=classNames(s,l);return createVNode(Transition,_objectSpread2$1({ref:o},u),{default:function(){return[r?createVNode("div",{class:f,style:g},[p]):null]}})}}}),__awaiter$1a=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},StatusQueue=["measure","align",null,"motion"],useVisibleStatus=function(e,t){var n=ref(null),i=ref(),o=ref(!1);function r(e){o.value||(n.value=e)}function s(){wrapperRaf.cancel(i.value)}return watch(e,(function(){r("measure")}),{immediate:!0,flush:"post"}),onMounted((function(){watch(n,(function(){if("measure"===n.value)t();n.value&&(i.value=wrapperRaf((function(){return __awaiter$1a(void 0,void 0,void 0,regenerator.mark((function e(){var t,i;return regenerator.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=StatusQueue.indexOf(n.value),(i=StatusQueue[t+1])&&-1!==t&&r(i);case 3:case"end":return e.stop()}}),e)})))})))}),{immediate:!0,flush:"post"})})),onBeforeUnmount((function(){o.value=!0,s()})),[n,function(e){s(),i.value=wrapperRaf((function(){var t=n.value;switch(n.value){case"align":t="motion";break;case"motion":t="stable"}r(t),null==e||e()}))}]},useStretchStyle=function(e){var t=ref({width:0,height:0});return[computed((function(){var n={};if(e.value){var i=t.value,o=i.width,r=i.height;-1!==e.value.indexOf("height")&&r?n.height="".concat(r,"px"):-1!==e.value.indexOf("minHeight")&&r&&(n.minHeight="".concat(r,"px")),-1!==e.value.indexOf("width")&&o?n.width="".concat(o,"px"):-1!==e.value.indexOf("minWidth")&&o&&(n.minWidth="".concat(o,"px"))}return n})),function(e){t.value={width:e.offsetWidth,height:e.offsetHeight}}]},vendorPrefix;function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach((function(t){_defineProperty$B(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _typeof$1(e){return(_typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty$B(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var jsCssMap={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function getVendorPrefix(){if(void 0!==vendorPrefix)return vendorPrefix;vendorPrefix="";var e=document.createElement("p").style;for(var t in jsCssMap)t+"Transform"in e&&(vendorPrefix=t);return vendorPrefix}function getTransitionName$1(){return getVendorPrefix()?"".concat(getVendorPrefix(),"TransitionProperty"):"transitionProperty"}function getTransformName(){return getVendorPrefix()?"".concat(getVendorPrefix(),"Transform"):"transform"}function setTransitionProperty(e,t){var n=getTransitionName$1();n&&(e.style[n]=t,"transitionProperty"!==n&&(e.style.transitionProperty=t))}function setTransform(e,t){var n=getTransformName();n&&(e.style[n]=t,"transform"!==n&&(e.style.transform=t))}function getTransitionProperty(e){return e.style.transitionProperty||e.style[getTransitionName$1()]}function getTransformXY(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("transform")||t.getPropertyValue(getTransformName());if(n&&"none"!==n){var i=n.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(i[12]||i[4],0),y:parseFloat(i[13]||i[5],0)}}return{x:0,y:0}}var matrix2d=/matrix\((.*)\)/,matrix3d=/matrix3d\((.*)\)/;function setTransformXY(e,t){var n=window.getComputedStyle(e,null),i=n.getPropertyValue("transform")||n.getPropertyValue(getTransformName());if(i&&"none"!==i){var o,r=i.match(matrix2d);if(r)(o=(r=r[1]).split(",").map((function(e){return parseFloat(e,10)})))[4]=t.x,o[5]=t.y,setTransform(e,"matrix(".concat(o.join(","),")"));else(o=i.match(matrix3d)[1].split(",").map((function(e){return parseFloat(e,10)})))[12]=t.x,o[13]=t.y,setTransform(e,"matrix3d(".concat(o.join(","),")"))}else setTransform(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}var RE_NUM=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,getComputedStyleX;function forceRelayout(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function css(e,t,n){var i=n;if("object"!==_typeof$1(t))return void 0!==i?("number"==typeof i&&(i="".concat(i,"px")),void(e.style[t]=i)):getComputedStyleX(e,t);for(var o in t)t.hasOwnProperty(o)&&css(e,o,t[o])}function getClientPosition(e){var t,n,i,o=e.ownerDocument,r=o.body,s=o&&o.documentElement;return t=e.getBoundingClientRect(),n=Math.floor(t.left),i=Math.floor(t.top),{left:n-=s.clientLeft||r.clientLeft||0,top:i-=s.clientTop||r.clientTop||0}}function getScroll$1(e,t){var n=e["page".concat(t?"Y":"X","Offset")],i="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var o=e.document;"number"!=typeof(n=o.documentElement[i])&&(n=o.body[i])}return n}function getScrollLeft(e){return getScroll$1(e)}function getScrollTop(e){return getScroll$1(e,!0)}function getOffset$2(e){var t=getClientPosition(e),n=e.ownerDocument,i=n.defaultView||n.parentWindow;return t.left+=getScrollLeft(i),t.top+=getScrollTop(i),t}function isWindow(e){return null!=e&&e==e.window}function getDocument(e){return isWindow(e)?e.document:9===e.nodeType?e:e.ownerDocument}function _getComputedStyle(e,t,n){var i=n,o="",r=getDocument(e);return(i=i||r.defaultView.getComputedStyle(e,null))&&(o=i.getPropertyValue(t)||i[t]),o}var _RE_NUM_NO_PX=new RegExp("^(".concat(RE_NUM,")(?!px)[a-z%]+$"),"i"),RE_POS=/^(top|right|bottom|left)$/,CURRENT_STYLE="currentStyle",RUNTIME_STYLE="runtimeStyle",LEFT="left",PX="px";function _getComputedStyleIE(e,t){var n=e[CURRENT_STYLE]&&e[CURRENT_STYLE][t];if(_RE_NUM_NO_PX.test(n)&&!RE_POS.test(t)){var i=e.style,o=i[LEFT],r=e[RUNTIME_STYLE][LEFT];e[RUNTIME_STYLE][LEFT]=e[CURRENT_STYLE][LEFT],i[LEFT]="fontSize"===t?"1em":n||0,n=i.pixelLeft+PX,i[LEFT]=o,e[RUNTIME_STYLE][LEFT]=r}return""===n?"auto":n}function getOffsetDirection(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function oppositeOffsetDirection(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function setLeftTop(e,t,n){"static"===css(e,"position")&&(e.style.position="relative");var i=-999,o=-999,r=getOffsetDirection("left",n),s=getOffsetDirection("top",n),a=oppositeOffsetDirection(r),l=oppositeOffsetDirection(s);"left"!==r&&(i=999),"top"!==s&&(o=999);var c="",d=getOffset$2(e);("left"in t||"top"in t)&&(c=getTransitionProperty(e)||"",setTransitionProperty(e,"none")),"left"in t&&(e.style[a]="",e.style[r]="".concat(i,"px")),"top"in t&&(e.style[l]="",e.style[s]="".concat(o,"px")),forceRelayout(e);var u=getOffset$2(e),h={};for(var g in t)if(t.hasOwnProperty(g)){var p=getOffsetDirection(g,n),f="left"===g?i:o,m=d[g]-u[g];h[p]=p===g?f+m:f-m}css(e,h),forceRelayout(e),("left"in t||"top"in t)&&setTransitionProperty(e,c);var v={};for(var _ in t)if(t.hasOwnProperty(_)){var C=getOffsetDirection(_,n),b=t[_]-d[_];v[C]=_===C?h[C]+b:h[C]-b}css(e,v)}function setTransform$1(e,t){var n=getOffset$2(e),i=getTransformXY(e),o={x:i.x,y:i.y};"left"in t&&(o.x=i.x+t.left-n.left),"top"in t&&(o.y=i.y+t.top-n.top),setTransformXY(e,o)}function setOffset(e,t,n){if(n.ignoreShake){var i=getOffset$2(e),o=i.left.toFixed(0),r=i.top.toFixed(0),s=t.left.toFixed(0),a=t.top.toFixed(0);if(o===s&&r===a)return}n.useCssRight||n.useCssBottom?setLeftTop(e,t,n):n.useCssTransform&&getTransformName()in document.body.style?setTransform$1(e,t):setLeftTop(e,t,n)}function each(e,t){for(var n=0;n<e.length;n++)t(e[n])}function isBorderBoxFn(e){return"border-box"===getComputedStyleX(e,"boxSizing")}"undefined"!=typeof window&&(getComputedStyleX=window.getComputedStyle?_getComputedStyle:_getComputedStyleIE);var BOX_MODELS=["margin","border","padding"],CONTENT_INDEX=-1,PADDING_INDEX=2,BORDER_INDEX=1,MARGIN_INDEX=0;function swap(e,t,n){var i,o={},r=e.style;for(i in t)t.hasOwnProperty(i)&&(o[i]=r[i],r[i]=t[i]);for(i in n.call(e),t)t.hasOwnProperty(i)&&(r[i]=o[i])}function getPBMWidth(e,t,n){var i,o,r,s=0;for(o=0;o<t.length;o++)if(i=t[o])for(r=0;r<n.length;r++){var a=void 0;a="border"===i?"".concat(i).concat(n[r],"Width"):i+n[r],s+=parseFloat(getComputedStyleX(e,a))||0}return s}var domUtils={getParent:function(e){var t=e;do{t=11===t.nodeType&&t.host?t.host:t.parentNode}while(t&&1!==t.nodeType&&9!==t.nodeType);return t}};function getWH(e,t,n){var i=n;if(isWindow(e))return"width"===t?domUtils.viewportWidth(e):domUtils.viewportHeight(e);if(9===e.nodeType)return"width"===t?domUtils.docWidth(e):domUtils.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),s=isBorderBoxFn(e),a=0;(null==r||r<=0)&&(r=void 0,(null==(a=getComputedStyleX(e,t))||Number(a)<0)&&(a=e.style[t]||0),a=parseFloat(a)||0),void 0===i&&(i=s?BORDER_INDEX:CONTENT_INDEX);var l=void 0!==r||s,c=r||a;return i===CONTENT_INDEX?l?c-getPBMWidth(e,["border","padding"],o):a:l?i===BORDER_INDEX?c:c+(i===PADDING_INDEX?-getPBMWidth(e,["border"],o):getPBMWidth(e,["margin"],o)):a+getPBMWidth(e,BOX_MODELS.slice(i),o)}each(["Width","Height"],(function(e){domUtils["doc".concat(e)]=function(t){var n=t.document;return Math.max(n.documentElement["scroll".concat(e)],n.body["scroll".concat(e)],domUtils["viewport".concat(e)](n))},domUtils["viewport".concat(e)]=function(t){var n="client".concat(e),i=t.document,o=i.body,r=i.documentElement[n];return"CSS1Compat"===i.compatMode&&r||o&&o[n]||r}}));var cssShow={position:"absolute",visibility:"hidden",display:"block"};function getWHIgnoreDisplay(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i,o=t[0];return 0!==o.offsetWidth?i=getWH.apply(void 0,t):swap(o,cssShow,(function(){i=getWH.apply(void 0,t)})),i}function mix(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}each(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);domUtils["outer".concat(t)]=function(t,n){return t&&getWHIgnoreDisplay(t,e,n?MARGIN_INDEX:BORDER_INDEX)};var n="width"===e?["Left","Right"]:["Top","Bottom"];domUtils[e]=function(t,i){var o=i;return void 0!==o?t?(isBorderBoxFn(t)&&(o+=getPBMWidth(t,["padding","border"],n)),css(t,e,o)):void 0:t&&getWHIgnoreDisplay(t,e,CONTENT_INDEX)}}));var utils$i={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:getDocument,offset:function(e,t,n){if(void 0===t)return getOffset$2(e);setOffset(e,t,n||{})},isWindow:isWindow,each:each,css:css,clone:function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);if(e.overflow)for(t in e)e.hasOwnProperty(t)&&(n.overflow[t]=e.overflow[t]);return n},mix:mix,getWindowScrollLeft:function(e){return getScrollLeft(e)},getWindowScrollTop:function(e){return getScrollTop(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)utils$i.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};mix(utils$i,domUtils);var getParent$1=utils$i.getParent;function getOffsetParent(e){if(utils$i.isWindow(e)||9===e.nodeType)return null;var t,n=utils$i.getDocument(e).body,i=utils$i.css(e,"position");if(!("fixed"===i||"absolute"===i))return"html"===e.nodeName.toLowerCase()?null:getParent$1(e);for(t=getParent$1(e);t&&t!==n&&9!==t.nodeType;t=getParent$1(t))if("static"!==(i=utils$i.css(t,"position")))return t;return null}var getParent$1$1=utils$i.getParent;function isAncestorFixed(e){if(utils$i.isWindow(e)||9===e.nodeType)return!1;var t=utils$i.getDocument(e),n=t.body,i=null;for(i=getParent$1$1(e);i&&i!==n&&i!==t;i=getParent$1$1(i)){if("fixed"===utils$i.css(i,"position"))return!0}return!1}function getVisibleRectForElement(e,t){for(var n={left:0,right:Infinity,top:0,bottom:Infinity},i=getOffsetParent(e),o=utils$i.getDocument(e),r=o.defaultView||o.parentWindow,s=o.body,a=o.documentElement;i;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===i.clientWidth||i===s||i===a||"visible"===utils$i.css(i,"overflow")){if(i===s||i===a)break}else{var l=utils$i.offset(i);l.left+=i.clientLeft,l.top+=i.clientTop,n.top=Math.max(n.top,l.top),n.right=Math.min(n.right,l.left+i.clientWidth),n.bottom=Math.min(n.bottom,l.top+i.clientHeight),n.left=Math.max(n.left,l.left)}i=getOffsetParent(i)}var c=null;utils$i.isWindow(e)||9===e.nodeType||(c=e.style.position,"absolute"===utils$i.css(e,"position")&&(e.style.position="fixed"));var d=utils$i.getWindowScrollLeft(r),u=utils$i.getWindowScrollTop(r),h=utils$i.viewportWidth(r),g=utils$i.viewportHeight(r),p=a.scrollWidth,f=a.scrollHeight,m=window.getComputedStyle(s);if("hidden"===m.overflowX&&(p=r.innerWidth),"hidden"===m.overflowY&&(f=r.innerHeight),e.style&&(e.style.position=c),t||isAncestorFixed(e))n.left=Math.max(n.left,d),n.top=Math.max(n.top,u),n.right=Math.min(n.right,d+h),n.bottom=Math.min(n.bottom,u+g);else{var v=Math.max(p,d+h);n.right=Math.min(n.right,v);var _=Math.max(f,u+g);n.bottom=Math.min(n.bottom,_)}return n.top>=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function adjustForViewport(e,t,n,i){var o=utils$i.clone(e),r={width:t.width,height:t.height};return i.adjustX&&o.left<n.left&&(o.left=n.left),i.resizeWidth&&o.left>=n.left&&o.left+r.width>n.right&&(r.width-=o.left+r.width-n.right),i.adjustX&&o.left+r.width>n.right&&(o.left=Math.max(n.right-r.width,n.left)),i.adjustY&&o.top<n.top&&(o.top=n.top),i.resizeHeight&&o.top>=n.top&&o.top+r.height>n.bottom&&(r.height-=o.top+r.height-n.bottom),i.adjustY&&o.top+r.height>n.bottom&&(o.top=Math.max(n.bottom-r.height,n.top)),utils$i.mix(o,r)}function getRegion(e){var t,n,i;if(utils$i.isWindow(e)||9===e.nodeType){var o=utils$i.getWindow(e);t={left:utils$i.getWindowScrollLeft(o),top:utils$i.getWindowScrollTop(o)},n=utils$i.viewportWidth(o),i=utils$i.viewportHeight(o)}else t=utils$i.offset(e),n=utils$i.outerWidth(e),i=utils$i.outerHeight(e);return t.width=n,t.height=i,t}function getAlignOffset(e,t){var n=t.charAt(0),i=t.charAt(1),o=e.width,r=e.height,s=e.left,a=e.top;return"c"===n?a+=r/2:"b"===n&&(a+=r),"c"===i?s+=o/2:"r"===i&&(s+=o),{left:s,top:a}}function getElFuturePos(e,t,n,i,o){var r=getAlignOffset(t,n[1]),s=getAlignOffset(e,n[0]),a=[s.left-r.left,s.top-r.top];return{left:Math.round(e.left-a[0]+i[0]-o[0]),top:Math.round(e.top-a[1]+i[1]-o[1])}}function isFailX(e,t,n){return e.left<n.left||e.left+t.width>n.right}function isFailY(e,t,n){return e.top<n.top||e.top+t.height>n.bottom}function isCompleteFailX(e,t,n){return e.left>n.right||e.left+t.width<n.left}function isCompleteFailY(e,t,n){return e.top>n.bottom||e.top+t.height<n.top}function flip(e,t,n){var i=[];return utils$i.each(e,(function(e){i.push(e.replace(t,(function(e){return n[e]})))})),i}function flipOffset(e,t){return e[t]=-e[t],e}function convertOffset(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function normalizeOffset(e,t){e[0]=convertOffset(e[0],t.width),e[1]=convertOffset(e[1],t.height)}function doAlign(e,t,n,i){var o=n.points,r=n.offset||[0,0],s=n.targetOffset||[0,0],a=n.overflow,l=n.source||e;r=[].concat(r),s=[].concat(s);var c={},d=0,u=getVisibleRectForElement(l,!(!(a=a||{})||!a.alwaysByViewport)),h=getRegion(l);normalizeOffset(r,h),normalizeOffset(s,t);var g=getElFuturePos(h,t,o,r,s),p=utils$i.merge(h,g);if(u&&(a.adjustX||a.adjustY)&&i){if(a.adjustX&&isFailX(g,h,u)){var f=flip(o,/[lr]/gi,{l:"r",r:"l"}),m=flipOffset(r,0),v=flipOffset(s,0);isCompleteFailX(getElFuturePos(h,t,f,m,v),h,u)||(d=1,o=f,r=m,s=v)}if(a.adjustY&&isFailY(g,h,u)){var _=flip(o,/[tb]/gi,{t:"b",b:"t"}),C=flipOffset(r,1),b=flipOffset(s,1);isCompleteFailY(getElFuturePos(h,t,_,C,b),h,u)||(d=1,o=_,r=C,s=b)}d&&(g=getElFuturePos(h,t,o,r,s),utils$i.mix(p,g));var y=isFailX(g,h,u),S=isFailY(g,h,u);if(y||S){var w=o;y&&(w=flip(o,/[lr]/gi,{l:"r",r:"l"})),S&&(w=flip(o,/[tb]/gi,{t:"b",b:"t"})),o=w,r=n.offset||[0,0],s=n.targetOffset||[0,0]}c.adjustX=a.adjustX&&y,c.adjustY=a.adjustY&&S,(c.adjustX||c.adjustY)&&(p=adjustForViewport(g,h,u,c))}return p.width!==h.width&&utils$i.css(l,"width",utils$i.width(l)+p.width-h.width),p.height!==h.height&&utils$i.css(l,"height",utils$i.height(l)+p.height-h.height),utils$i.offset(l,{left:p.left,top:p.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:o,offset:r,targetOffset:s,overflow:c}}function isOutOfVisibleRect(e,t){var n=getVisibleRectForElement(e,t),i=getRegion(e);return!n||i.left+i.width<=n.left||i.top+i.height<=n.top||i.left>=n.right||i.top>=n.bottom}function alignElement(e,t,n){var i=n.target||t;return doAlign(e,getRegion(i),n,!isOutOfVisibleRect(i,n.overflow&&n.overflow.alwaysByViewport))}function alignPoint(e,t,n){var i,o,r=utils$i.getDocument(e),s=r.defaultView||r.parentWindow,a=utils$i.getWindowScrollLeft(s),l=utils$i.getWindowScrollTop(s),c=utils$i.viewportWidth(s),d=utils$i.viewportHeight(s),u={left:i="pageX"in t?t.pageX:a+t.clientX,top:o="pageY"in t?t.pageY:l+t.clientY,width:0,height:0},h=i>=0&&i<=a+c&&o>=0&&o<=l+d,g=[n.points[0],"cc"];return doAlign(e,u,_objectSpread2(_objectSpread2({},n),{},{points:g}),h)}function cloneElement(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=e;if(Array.isArray(e)&&(o=filterEmpty(e)[0]),!o)return null;var r=cloneVNode(o,t,i);return r.props=n?_extends$1(_extends$1({},r.props),t):r.props,warning$2("object"!==_typeof$3(r.props.class),"class must be string"),r}alignElement.__getOffsetParent=getOffsetParent,alignElement.__getVisibleRectForElement=getVisibleRectForElement;var isVisible=function(e){if(!e)return!1;if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox();if(t.width||t.height)return!0}if(e.getBoundingClientRect){var n=e.getBoundingClientRect();if(n.width||n.height)return!0}return!1};function isSamePoint(e,t){return e===t||!(!e||!t)&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&(e.clientX===t.clientX&&e.clientY===t.clientY))}function restoreFocus(e,t){e!==document.activeElement&&contains(t,e)&&"function"==typeof e.focus&&e.focus()}function monitorResize(e,t){var n=null,i=null;var o=new index$v((function(e){var o=_slicedToArray$2(e,1)[0].target;if(document.documentElement.contains(o)){var r=o.getBoundingClientRect(),s=r.width,a=r.height,l=Math.floor(s),c=Math.floor(a);n===l&&i===c||Promise.resolve().then((function(){t({width:l,height:c})})),n=l,i=c}}));return e&&o.observe(e),function(){o.disconnect()}}var useBuffer=function(e,t){var n=!1,i=null;function o(){clearTimeout(i)}return[function r(s){if(n&&!0!==s)o(),i=setTimeout((function(){n=!1,r()}),t.value);else{if(!1===e())return;n=!0,o(),i=setTimeout((function(){n=!1}),t.value)}},function(){n=!1,o()}]};function listCacheClear(){this.__data__=[],this.size=0}function eq(e,t){return e===t||e!=e&&t!=t}function assocIndexOf(e,t){for(var n=e.length;n--;)if(eq(e[n][0],t))return n;return-1}var arrayProto=Array.prototype,splice$2=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,n=assocIndexOf(t,e);return!(n<0)&&(n==t.length-1?t.pop():splice$2.call(t,n,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,n=assocIndexOf(t,e);return n<0?void 0:t[n][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var n=this.__data__,i=assocIndexOf(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function ListCache(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function stackGet(e){return this.__data__.get(e)}function stackHas(e){return this.__data__.has(e)}function isObject$5(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var asyncTag="[object AsyncFunction]",funcTag$2="[object Function]",genTag$1="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$3(e){if(!isObject$5(e))return!1;var t=baseGetTag(e);return t==funcTag$2||t==genTag$1||t==asyncTag||t==proxyTag}var coreJsData=root$1["__core-js_shared__"],coreJsData$1=coreJsData,maskSrcKey=(uid2=/[^.]+$/.exec(coreJsData$1&&coreJsData$1.keys&&coreJsData$1.keys.IE_PROTO||""),uid2?"Symbol(src)_1."+uid2:""),uid2;function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(e){if(null!=e){try{return funcToString$1.call(e)}catch(e2){}try{return e+""}catch(e2){}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$c=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$g=objectProto$c.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$g).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(e){return!(!isObject$5(e)||isMasked(e))&&(isFunction$3(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue$2(e,t){return null==e?void 0:e[t]}function getNative(e,t){var n=getValue$2(e,t);return baseIsNative(n)?n:void 0}var Map$1=getNative(root$1,"Map"),Map$2=Map$1,nativeCreate=getNative(Object,"create"),nativeCreate$1=nativeCreate;function hashClear(){this.__data__=nativeCreate$1?nativeCreate$1(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$b=Object.prototype,hasOwnProperty$f=objectProto$b.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate$1){var n=t[e];return n===HASH_UNDEFINED$2?void 0:n}return hasOwnProperty$f.call(t,e)?t[e]:void 0}var objectProto$a=Object.prototype,hasOwnProperty$e=objectProto$a.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate$1?void 0!==t[e]:hasOwnProperty$e.call(t,e)}var HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=nativeCreate$1&&void 0===t?HASH_UNDEFINED$1:t,this}function Hash(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$2||ListCache),string:new Hash}}function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var n=e.__data__;return isKeyable(t)?n["string"==typeof t?"string":"hash"]:n.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var n=getMapData(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}function MapCache(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var LARGE_ARRAY_SIZE$1=200;function stackSet(e,t){var n=this.__data__;if(n instanceof ListCache){var i=n.__data__;if(!Map$2||i.length<LARGE_ARRAY_SIZE$1-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new MapCache(i)}return n.set(e,t),this.size=n.size,this}function Stack$1(e){var t=this.__data__=new ListCache(e);this.size=t.size}Stack$1.prototype.clear=stackClear,Stack$1.prototype.delete=stackDelete,Stack$1.prototype.get=stackGet,Stack$1.prototype.has=stackHas,Stack$1.prototype.set=stackSet;var HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd(e){return this.__data__.set(e,HASH_UNDEFINED),this}function setCacheHas(e){return this.__data__.has(e)}function SetCache(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new MapCache;++t<n;)this.add(e[t])}function arraySome(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function cacheHas(e,t){return e.has(t)}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;var COMPARE_PARTIAL_FLAG$5=1,COMPARE_UNORDERED_FLAG$3=2;function equalArrays(e,t,n,i,o,r){var s=n&COMPARE_PARTIAL_FLAG$5,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=r.get(e),d=r.get(t);if(c&&d)return c==t&&d==e;var u=-1,h=!0,g=n&COMPARE_UNORDERED_FLAG$3?new SetCache:void 0;for(r.set(e,t),r.set(t,e);++u<a;){var p=e[u],f=t[u];if(i)var m=s?i(f,p,u,t,e,r):i(p,f,u,e,t,r);if(void 0!==m){if(m)continue;h=!1;break}if(g){if(!arraySome(t,(function(e,t){if(!cacheHas(g,t)&&(p===e||o(p,e,n,i,r)))return g.push(t)}))){h=!1;break}}else if(p!==f&&!o(p,f,n,i,r)){h=!1;break}}return r.delete(e),r.delete(t),h}var Uint8Array$1=root$1.Uint8Array,Uint8Array$2=Uint8Array$1;function mapToArray(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function setToArray(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var COMPARE_PARTIAL_FLAG$4=1,COMPARE_UNORDERED_FLAG$2=2,boolTag$3="[object Boolean]",dateTag$3="[object Date]",errorTag$2="[object Error]",mapTag$5="[object Map]",numberTag$3="[object Number]",regexpTag$3="[object RegExp]",setTag$5="[object Set]",stringTag$4="[object String]",symbolTag$3="[object Symbol]",arrayBufferTag$3="[object ArrayBuffer]",dataViewTag$4="[object DataView]",symbolProto$2=Symbol$2?Symbol$2.prototype:void 0,symbolValueOf$1=symbolProto$2?symbolProto$2.valueOf:void 0;function equalByTag(e,t,n,i,o,r,s){switch(n){case dataViewTag$4:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case arrayBufferTag$3:return!(e.byteLength!=t.byteLength||!r(new Uint8Array$2(e),new Uint8Array$2(t)));case boolTag$3:case dateTag$3:case numberTag$3:return eq(+e,+t);case errorTag$2:return e.name==t.name&&e.message==t.message;case regexpTag$3:case stringTag$4:return e==t+"";case mapTag$5:var a=mapToArray;case setTag$5:var l=i&COMPARE_PARTIAL_FLAG$4;if(a||(a=setToArray),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;i|=COMPARE_UNORDERED_FLAG$2,s.set(e,t);var d=equalArrays(a(e),a(t),i,o,r,s);return s.delete(e),d;case symbolTag$3:if(symbolValueOf$1)return symbolValueOf$1.call(e)==symbolValueOf$1.call(t)}return!1}function arrayPush$1(e,t){for(var n=-1,i=t.length,o=e.length;++n<i;)e[o+n]=t[n];return e}var isArray$3=Array.isArray,isArray$4=isArray$3;function baseGetAllKeys(e,t,n){var i=t(e);return isArray$4(e)?i:arrayPush$1(i,n(e))}function arrayFilter(e,t){for(var n=-1,i=null==e?0:e.length,o=0,r=[];++n<i;){var s=e[n];t(s,n,e)&&(r[o++]=s)}return r}function stubArray(){return[]}var objectProto$9=Object.prototype,propertyIsEnumerable$1=objectProto$9.propertyIsEnumerable,nativeGetSymbols$1=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols$1?function(e){return null==e?[]:(e=Object(e),arrayFilter(nativeGetSymbols$1(e),(function(t){return propertyIsEnumerable$1.call(e,t)})))}:stubArray,getSymbols$1=getSymbols;function baseTimes(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}var argsTag$3="[object Arguments]";function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==argsTag$3}var objectProto$8=Object.prototype,hasOwnProperty$d=objectProto$8.hasOwnProperty,propertyIsEnumerable=objectProto$8.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&hasOwnProperty$d.call(e,"callee")&&!propertyIsEnumerable.call(e,"callee")},isArguments$1=isArguments;function stubFalse(){return!1}var freeExports$2="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$2=freeExports$2&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports$2=freeModule$2&&freeModule$2.exports===freeExports$2,Buffer$2=moduleExports$2?root$1.Buffer:void 0,nativeIsBuffer=Buffer$2?Buffer$2.isBuffer:void 0,isBuffer$1=nativeIsBuffer||stubFalse,isBuffer$2=isBuffer$1,MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var n=typeof e;return!!(t=null==t?MAX_SAFE_INTEGER$1:t)&&("number"==n||"symbol"!=n&&reIsUint.test(e))&&e>-1&&e%1==0&&e<t}var MAX_SAFE_INTEGER=9007199254740991;function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER}var argsTag$2="[object Arguments]",arrayTag$2="[object Array]",boolTag$2="[object Boolean]",dateTag$2="[object Date]",errorTag$1="[object Error]",funcTag$1="[object Function]",mapTag$4="[object Map]",numberTag$2="[object Number]",objectTag$3="[object Object]",regexpTag$2="[object RegExp]",setTag$4="[object Set]",stringTag$3="[object String]",weakMapTag$2="[object WeakMap]",arrayBufferTag$2="[object ArrayBuffer]",dataViewTag$3="[object DataView]",float32Tag$2="[object Float32Array]",float64Tag$2="[object Float64Array]",int8Tag$2="[object Int8Array]",int16Tag$2="[object Int16Array]",int32Tag$2="[object Int32Array]",uint8Tag$2="[object Uint8Array]",uint8ClampedTag$2="[object Uint8ClampedArray]",uint16Tag$2="[object Uint16Array]",uint32Tag$2="[object Uint32Array]",typedArrayTags={};function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!typedArrayTags[baseGetTag(e)]}function baseUnary(e){return function(t){return e(t)}}typedArrayTags[float32Tag$2]=typedArrayTags[float64Tag$2]=typedArrayTags[int8Tag$2]=typedArrayTags[int16Tag$2]=typedArrayTags[int32Tag$2]=typedArrayTags[uint8Tag$2]=typedArrayTags[uint8ClampedTag$2]=typedArrayTags[uint16Tag$2]=typedArrayTags[uint32Tag$2]=!0,typedArrayTags[argsTag$2]=typedArrayTags[arrayTag$2]=typedArrayTags[arrayBufferTag$2]=typedArrayTags[boolTag$2]=typedArrayTags[dataViewTag$3]=typedArrayTags[dateTag$2]=typedArrayTags[errorTag$1]=typedArrayTags[funcTag$1]=typedArrayTags[mapTag$4]=typedArrayTags[numberTag$2]=typedArrayTags[objectTag$3]=typedArrayTags[regexpTag$2]=typedArrayTags[setTag$4]=typedArrayTags[stringTag$3]=typedArrayTags[weakMapTag$2]=!1;var freeExports$1="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,freeProcess=moduleExports$1&&freeGlobal$1.process,nodeUtil=function(){try{var e=freeModule$1&&freeModule$1.require&&freeModule$1.require("util").types;return e||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e2){}}(),nodeUtil$1=nodeUtil,nodeIsTypedArray=nodeUtil$1&&nodeUtil$1.isTypedArray,isTypedArray$1=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,isTypedArray$2=isTypedArray$1,objectProto$7=Object.prototype,hasOwnProperty$c=objectProto$7.hasOwnProperty;function arrayLikeKeys(e,t){var n=isArray$4(e),i=!n&&isArguments$1(e),o=!n&&!i&&isBuffer$2(e),r=!n&&!i&&!o&&isTypedArray$2(e),s=n||i||o||r,a=s?baseTimes(e.length,String):[],l=a.length;for(var c in e)!t&&!hasOwnProperty$c.call(e,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||isIndex(c,l))||a.push(c);return a}var objectProto$6=Object.prototype;function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto$6)}var nativeKeys=overArg(Object.keys,Object),nativeKeys$1=nativeKeys,objectProto$5=Object.prototype,hasOwnProperty$b=objectProto$5.hasOwnProperty;function baseKeys(e){if(!isPrototype(e))return nativeKeys$1(e);var t=[];for(var n in Object(e))hasOwnProperty$b.call(e,n)&&"constructor"!=n&&t.push(n);return t}function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction$3(e)}function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}function getAllKeys$1(e){return baseGetAllKeys(e,keys,getSymbols$1)}var COMPARE_PARTIAL_FLAG$3=1,objectProto$4=Object.prototype,hasOwnProperty$a=objectProto$4.hasOwnProperty;function equalObjects(e,t,n,i,o,r){var s=n&COMPARE_PARTIAL_FLAG$3,a=getAllKeys$1(e),l=a.length;if(l!=getAllKeys$1(t).length&&!s)return!1;for(var c=l;c--;){var d=a[c];if(!(s?d in t:hasOwnProperty$a.call(t,d)))return!1}var u=r.get(e),h=r.get(t);if(u&&h)return u==t&&h==e;var g=!0;r.set(e,t),r.set(t,e);for(var p=s;++c<l;){var f=e[d=a[c]],m=t[d];if(i)var v=s?i(m,f,d,t,e,r):i(f,m,d,e,t,r);if(!(void 0===v?f===m||o(f,m,n,i,r):v)){g=!1;break}p||(p="constructor"==d)}if(g&&!p){var _=e.constructor,C=t.constructor;_==C||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof C&&C instanceof C||(g=!1)}return r.delete(e),r.delete(t),g}var DataView$1=getNative(root$1,"DataView"),DataView$2=DataView$1,Promise$1=getNative(root$1,"Promise"),Promise$2=Promise$1,Set$1=getNative(root$1,"Set"),Set$2=Set$1,WeakMap$1=getNative(root$1,"WeakMap"),WeakMap$2=WeakMap$1,mapTag$3="[object Map]",objectTag$2="[object Object]",promiseTag="[object Promise]",setTag$3="[object Set]",weakMapTag$1="[object WeakMap]",dataViewTag$2="[object DataView]",dataViewCtorString=toSource(DataView$2),mapCtorString=toSource(Map$2),promiseCtorString=toSource(Promise$2),setCtorString=toSource(Set$2),weakMapCtorString=toSource(WeakMap$2),getTag=baseGetTag;(DataView$2&&getTag(new DataView$2(new ArrayBuffer(1)))!=dataViewTag$2||Map$2&&getTag(new Map$2)!=mapTag$3||Promise$2&&getTag(Promise$2.resolve())!=promiseTag||Set$2&&getTag(new Set$2)!=setTag$3||WeakMap$2&&getTag(new WeakMap$2)!=weakMapTag$1)&&(getTag=function(e){var t=baseGetTag(e),n=t==objectTag$2?e.constructor:void 0,i=n?toSource(n):"";if(i)switch(i){case dataViewCtorString:return dataViewTag$2;case mapCtorString:return mapTag$3;case promiseCtorString:return promiseTag;case setCtorString:return setTag$3;case weakMapCtorString:return weakMapTag$1}return t});var getTag$1=getTag,COMPARE_PARTIAL_FLAG$2=1,argsTag$1="[object Arguments]",arrayTag$1="[object Array]",objectTag$1="[object Object]",objectProto$3=Object.prototype,hasOwnProperty$9=objectProto$3.hasOwnProperty;function baseIsEqualDeep(e,t,n,i,o,r){var s=isArray$4(e),a=isArray$4(t),l=s?arrayTag$1:getTag$1(e),c=a?arrayTag$1:getTag$1(t),d=(l=l==argsTag$1?objectTag$1:l)==objectTag$1,u=(c=c==argsTag$1?objectTag$1:c)==objectTag$1,h=l==c;if(h&&isBuffer$2(e)){if(!isBuffer$2(t))return!1;s=!0,d=!1}if(h&&!d)return r||(r=new Stack$1),s||isTypedArray$2(e)?equalArrays(e,t,n,i,o,r):equalByTag(e,t,l,n,i,o,r);if(!(n&COMPARE_PARTIAL_FLAG$2)){var g=d&&hasOwnProperty$9.call(e,"__wrapped__"),p=u&&hasOwnProperty$9.call(t,"__wrapped__");if(g||p){var f=g?e.value():e,m=p?t.value():t;return r||(r=new Stack$1),o(f,m,n,i,r)}}return!!h&&(r||(r=new Stack$1),equalObjects(e,t,n,i,o,r))}function baseIsEqual(e,t,n,i,o){return e===t||(null==e||null==t||!isObjectLike(e)&&!isObjectLike(t)?e!=e&&t!=t:baseIsEqualDeep(e,t,n,i,baseIsEqual,o))}function isEqual$1(e,t){return baseIsEqual(e,t)}var alignProps={align:Object,target:[Object,Function],onAlign:Function,monitorBufferTime:Number,monitorWindowResize:Boolean,disabled:Boolean};function getElement(e){return"function"!=typeof e?null:e()}function getPoint(e){return"object"===_typeof$3(e)&&e?e:null}var Align=defineComponent({name:"Align",props:alignProps,emits:["align"],setup:function(e,t){var n=t.expose,i=t.slots,o=ref({}),r=ref(),s=_slicedToArray$2(useBuffer((function(){var t=e.disabled,n=e.target,i=e.align,s=e.onAlign;if(!t&&n&&r.value){var a,l=r.value,c=getElement(n),d=getPoint(n);o.value.element=c,o.value.point=d,o.value.align=i;var u=document.activeElement;return c&&isVisible(c)?a=alignElement(l,c,i):d&&(a=alignPoint(l,d,i)),restoreFocus(u,l),s&&a&&s(l,a),!0}return!1}),computed((function(){return e.monitorBufferTime}))),2),a=s[0],l=s[1],c=ref({cancel:function(){}}),d=ref({cancel:function(){}}),u=function(){var t=e.target,n=getElement(t),i=getPoint(t);r.value!==d.value.element&&(d.value.cancel(),d.value.element=r.value,d.value.cancel=monitorResize(r.value,a)),o.value.element===n&&isSamePoint(o.value.point,i)&&isEqual$1(o.value.align,e.align)||(a(),c.value.element!==n&&(c.value.cancel(),c.value.element=n,c.value.cancel=monitorResize(n,a)))};onMounted((function(){nextTick((function(){u()}))})),onUpdated((function(){nextTick((function(){u()}))})),watch((function(){return e.disabled}),(function(e){e?l():a()}),{immediate:!0,flush:"post"});var h=ref(null);return watch((function(){return e.monitorWindowResize}),(function(e){e?h.value||(h.value=addEventListenerWrap(window,"resize",a)):h.value&&(h.value.remove(),h.value=null)}),{flush:"post"}),onUnmounted((function(){c.value.cancel(),d.value.cancel(),h.value&&h.value.remove(),l()})),n({forceAlign:function(){return a(!0)}}),function(){var e=null==i?void 0:i.default();return e?cloneElement(e[0],{ref:r},!0,!0):null}}}),PopupInner=defineComponent({name:"PopupInner",inheritAttrs:!1,props:innerProps,emits:["mouseenter","mouseleave","mousedown","touchstart","align"],setup:function(e,t){var n,i=t.expose,o=t.attrs,r=t.slots,s=ref(),a=ref(),l=ref(),c=_slicedToArray$2(useStretchStyle(toRef(e,"stretch")),2),d=c[0],u=c[1],h=ref(!1);watch((function(){return e.visible}),(function(t){clearTimeout(n),t?n=setTimeout((function(){h.value=e.visible})):h.value=!1}),{immediate:!0});var g=_slicedToArray$2(useVisibleStatus(h,(function(){e.stretch&&u(e.getRootDomNode())})),2),p=g[0],f=g[1],m=ref(),v=function(){var e;null===(e=s.value)||void 0===e||e.forceAlign()},_=function(t,n){var i,o=e.getClassNameFromAlign(n),r=l.value;l.value!==o&&(l.value=o),"align"===p.value&&(r!==o?Promise.resolve().then((function(){v()})):f((function(){var e;null===(e=m.value)||void 0===e||e.call(m)})),null===(i=e.onAlign)||void 0===i||i.call(e,t,n))},C=computed((function(){var t="object"===_typeof$3(e.animation)?e.animation:getMotion(e);return["onAfterEnter","onAfterLeave"].forEach((function(e){var n=t[e];t[e]=function(e){f(),p.value="stable",null==n||n(e)}})),t})),b=function(){return new Promise((function(e){m.value=e}))};watch([C,p],(function(){C.value||"motion"!==p.value||f()}),{immediate:!0}),i({forceAlign:v,getElement:function(){return a.value.$el||a.value}});var y=computed((function(){var t;return!(null===(t=e.align)||void 0===t?void 0:t.points)||"align"!==p.value&&"stable"!==p.value}));return function(){var t,n=e.zIndex,i=e.align,c=e.prefixCls,u=e.destroyPopupOnHide,g=e.onMouseenter,f=e.onMouseleave,m=e.onTouchstart,v=void 0===m?function(){}:m,S=e.onMousedown,w=p.value,E=[_extends$1(_extends$1({},d.value),{zIndex:n,opacity:"motion"!==w&&"stable"!==w&&h.value?0:null,pointerEvents:h.value||"stable"===w?null:"none"}),o.style],x=flattenChildren(null===(t=r.default)||void 0===t?void 0:t.call(r,{visible:e.visible}));x.length>1&&(x=createVNode("div",{class:"".concat(c,"-content")},[x]));var T=classNames(c,o.class,l.value),I=h.value||!e.visible?getTransitionProps(C.value.name,C.value):{};return createVNode(Transition,_objectSpread2$1(_objectSpread2$1({ref:a},I),{},{onBeforeEnter:b}),{default:function(){return!u||e.visible?withDirectives(createVNode(Align,{target:e.point?e.point:e.getRootDomNode,key:"popup",ref:s,monitorWindowResize:!0,disabled:y.value,align:i,onAlign:_},{default:function(){return createVNode("div",_objectSpread2$1(_objectSpread2$1({class:T,onMouseenter:g,onMouseleave:f,onMousedown:withModifiers(S,["capture"])},_defineProperty$P({},supportsPassive$1?"onTouchstartPassive":"onTouchstart",withModifiers(v,["capture"]))),{},{style:E}),[x])}}),[[vShow,h.value]]):null}})}}}),Popup=defineComponent({name:"Popup",inheritAttrs:!1,props:popupProps,setup:function(e,t){var n=t.attrs,i=t.slots,o=t.expose,r=ref(!1),s=ref(!1),a=ref();return watch([function(){return e.visible},function(){return e.mobile}],(function(){r.value=e.visible,e.visible&&e.mobile&&(s.value=!0)}),{immediate:!0,flush:"post"}),o({forceAlign:function(){var e;null===(e=a.value)||void 0===e||e.forceAlign()},getElement:function(){var e;return null===(e=a.value)||void 0===e?void 0:e.getElement()}}),function(){var t=_extends$1(_extends$1(_extends$1({},e),n),{visible:r.value}),o=s.value?createVNode(MobilePopupInner,_objectSpread2$1(_objectSpread2$1({},t),{},{mobile:e.mobile,ref:a}),{default:i.default}):createVNode(PopupInner,_objectSpread2$1(_objectSpread2$1({},t),{},{ref:a}),{default:i.default});return createVNode("div",null,[createVNode(Mask$1,t,null),o])}}});function isPointsEq(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function getAlignFromPlacement(e,t,n){return _extends$1(_extends$1({},e[t]||{}),n)}function getAlignPopupClassName(e,t,n,i){for(var o=n.points,r=Object.keys(e),s=0;s<r.length;s+=1){var a=r[s];if(isPointsEq(e[a].points,o,i))return"".concat(t,"-placement-").concat(a)}return""}var BaseMixin={methods:{setState:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n="function"==typeof e?e(this.$data,this.$props):e;if(this.getDerivedStateFromProps){var i=this.getDerivedStateFromProps(getOptionProps(this),_extends$1(_extends$1({},this.$data),n));if(null===i)return;n=_extends$1(_extends$1({},n),i||{})}_extends$1(this.$data,n),this._.isMounted&&this.$forceUpdate(),nextTick((function(){t&&t()}))},__emit:function(){var e=[].slice.call(arguments,0),t=e[0];t="on".concat(t[0].toUpperCase()).concat(t.substring(1));var n=this.$props[t]||this.$attrs[t];if(e.length&&n)if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)n[i].apply(n,_toConsumableArray$2(e.slice(1)));else n.apply(void 0,_toConsumableArray$2(e.slice(1)))}}},TriggerContextKey=Symbol("TriggerContextKey"),useInjectTrigger=function(){return inject(TriggerContextKey,{setPortal:function(){},popPortal:!1})},PortalContextKey=Symbol("PortalContextKey"),useProvidePortal=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{inTriggerContext:!0};provide(PortalContextKey,{inTriggerContext:t.inTriggerContext,shouldRender:computed((function(){var t=e||{},n=t.sPopupVisible,i=t.popupRef,o=t.forceRender,r=t.autoDestroy,s=!1;return(n||i||o)&&(s=!0),!n&&r&&(s=!1),s}))})},useInjectPortal=function(){useProvidePortal({},{inTriggerContext:!1});var e=inject(PortalContextKey,{shouldRender:computed((function(){return!1})),inTriggerContext:!1});return{shouldRender:computed((function(){return e.shouldRender.value||!1===e.inTriggerContext}))}},Portal$1=defineComponent({name:"Portal",inheritAttrs:!1,props:{getContainer:PropTypes$1.func.isRequired,didUpdate:Function},setup:function(e,t){var n,i=t.slots,o=!0,r=useInjectPortal().shouldRender;onBeforeMount((function(){o=!1,r.value&&(n=e.getContainer())}));var s=watch(r,(function(){r.value&&!n&&(n=e.getContainer()),n&&s()}));return onUpdated((function(){nextTick((function(){var t;r.value&&(null===(t=e.didUpdate)||void 0===t||t.call(e,e))}))})),onBeforeUnmount((function(){n&&n.parentNode&&n.parentNode.removeChild(n)})),function(){var e;return r.value?o?null===(e=i.default)||void 0===e?void 0:e.call(i):n?createVNode(Teleport,{to:n},i):null:null}}});function noop$4(){}function returnEmptyString(){return""}function returnDocument(e){return e?e.ownerDocument:window.document}var ALL_HANDLERS=["onClick","onMousedown","onTouchstart","onMouseenter","onMouseleave","onFocus","onBlur","onContextmenu"],Trigger=defineComponent({name:"Trigger",mixins:[BaseMixin],inheritAttrs:!1,props:{action:PropTypes$1.oneOfType([PropTypes$1.string,PropTypes$1.arrayOf(PropTypes$1.string)]).def([]),showAction:PropTypes$1.any.def([]),hideAction:PropTypes$1.any.def([]),getPopupClassNameFromAlign:PropTypes$1.any.def(returnEmptyString),onPopupVisibleChange:Function,afterPopupVisibleChange:PropTypes$1.func.def(noop$4),popup:PropTypes$1.any,popupStyle:{type:Object,default:void 0},prefixCls:PropTypes$1.string.def("rc-trigger-popup"),popupClassName:PropTypes$1.string.def(""),popupPlacement:String,builtinPlacements:PropTypes$1.object,popupTransitionName:String,popupAnimation:PropTypes$1.any,mouseEnterDelay:PropTypes$1.number.def(0),mouseLeaveDelay:PropTypes$1.number.def(.1),zIndex:Number,focusDelay:PropTypes$1.number.def(0),blurDelay:PropTypes$1.number.def(.15),getPopupContainer:Function,getDocument:PropTypes$1.func.def(returnDocument),forceRender:{type:Boolean,default:void 0},destroyPopupOnHide:{type:Boolean,default:!1},mask:{type:Boolean,default:!1},maskClosable:{type:Boolean,default:!0},popupAlign:PropTypes$1.object.def((function(){return{}})),popupVisible:{type:Boolean,default:void 0},defaultPopupVisible:{type:Boolean,default:!1},maskTransitionName:String,maskAnimation:String,stretch:String,alignPoint:{type:Boolean,default:void 0},autoDestroy:{type:Boolean,default:!1},mobile:Object,getTriggerDOMNode:Function},setup:function(e){var t=computed((function(){var t=e.popupPlacement,n=e.popupAlign,i=e.builtinPlacements;return t&&i?getAlignFromPlacement(i,t,n):n})),n=useInjectTrigger(),i=n.setPortal,o=n.popPortal,r=ref(null);return{popPortal:o,setPortal:i,vcTriggerContext:inject("vcTriggerContext",{}),popupRef:r,setPopupRef:function(e){r.value=e},triggerRef:ref(null),align:t,focusTime:null,clickOutsideHandler:null,contextmenuOutsideHandler1:null,contextmenuOutsideHandler2:null,touchOutsideHandler:null,attachId:null,delayTimer:null,hasPopupMouseDown:!1,preClickTime:null,preTouchTime:null,mouseDownTimeout:null,childOriginEvents:{}}},data:function(){var e,t,n=this,i=this.$props;return t=void 0!==this.popupVisible?!!i.popupVisible:!!i.defaultPopupVisible,ALL_HANDLERS.forEach((function(e){n["fire".concat(e)]=function(t){n.fireEvents(e,t)}})),null===(e=this.setPortal)||void 0===e||e.call(this,createVNode(Portal$1,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},{default:this.getComponent})),{prevPopupVisible:t,sPopupVisible:t,point:null}},watch:{popupVisible:function(e){void 0!==e&&(this.prevPopupVisible=this.sPopupVisible,this.sPopupVisible=e)}},created:function(){provide("vcTriggerContext",{onPopupMouseDown:this.onPopupMouseDown}),useProvidePortal(this)},deactivated:function(){this.setPopupVisible(!1)},mounted:function(){var e=this;this.$nextTick((function(){e.updatedCal()}))},updated:function(){var e=this;this.$nextTick((function(){e.updatedCal()}))},beforeUnmount:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),wrapperRaf.cancel(this.attachId)},methods:{updatedCal:function(){var e,t=this.$props;this.$data.sPopupVisible?(this.clickOutsideHandler||!this.isClickToHide()&&!this.isContextmenuToShow()||(e=t.getDocument(this.getRootDomNode()),this.clickOutsideHandler=addEventListenerWrap(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=addEventListenerWrap(e,"touchstart",this.onDocumentClick,!!supportsPassive$1&&{passive:!1})),!this.contextmenuOutsideHandler1&&this.isContextmenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextmenuOutsideHandler1=addEventListenerWrap(e,"scroll",this.onContextmenuClose)),!this.contextmenuOutsideHandler2&&this.isContextmenuToShow()&&(this.contextmenuOutsideHandler2=addEventListenerWrap(window,"blur",this.onContextmenuClose))):this.clearOutsideHandler()},onMouseenter:function(e){var t=this.$props.mouseEnterDelay;this.fireEvents("onMouseenter",e),this.delaySetPopupVisible(!0,t,t?null:e)},onMouseMove:function(e){this.fireEvents("onMousemove",e),this.setPoint(e)},onMouseleave:function(e){this.fireEvents("onMouseleave",e),this.delaySetPopupVisible(!1,this.$props.mouseLeaveDelay)},onPopupMouseenter:function(){this.clearDelayTimer()},onPopupMouseleave:function(e){var t;e&&e.relatedTarget&&!e.relatedTarget.setTimeout&&contains(null===(t=this.popupRef)||void 0===t?void 0:t.getElement(),e.relatedTarget)||this.delaySetPopupVisible(!1,this.$props.mouseLeaveDelay)},onFocus:function(e){this.fireEvents("onFocus",e),this.clearDelayTimer(),this.isFocusToShow()&&(this.focusTime=Date.now(),this.delaySetPopupVisible(!0,this.$props.focusDelay))},onMousedown:function(e){this.fireEvents("onMousedown",e),this.preClickTime=Date.now()},onTouchstart:function(e){this.fireEvents("onTouchstart",e),this.preTouchTime=Date.now()},onBlur:function(e){contains(e.target,e.relatedTarget||document.activeElement)||(this.fireEvents("onBlur",e),this.clearDelayTimer(),this.isBlurToHide()&&this.delaySetPopupVisible(!1,this.$props.blurDelay))},onContextmenu:function(e){e.preventDefault(),this.fireEvents("onContextmenu",e),this.setPopupVisible(!0,e)},onContextmenuClose:function(){this.isContextmenuToShow()&&this.close()},onClick:function(e){if(this.fireEvents("onClick",e),this.focusTime){var t;if(this.preClickTime&&this.preTouchTime?t=Math.min(this.preClickTime,this.preTouchTime):this.preClickTime?t=this.preClickTime:this.preTouchTime&&(t=this.preTouchTime),Math.abs(t-this.focusTime)<20)return;this.focusTime=0}this.preClickTime=0,this.preTouchTime=0,this.isClickToShow()&&(this.isClickToHide()||this.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault(),e&&e.domEvent&&e.domEvent.preventDefault();var n=!this.$data.sPopupVisible;(this.isClickToHide()&&!n||n&&this.isClickToShow())&&this.setPopupVisible(!this.$data.sPopupVisible,e)},onPopupMouseDown:function(){var e=this,t=this.vcTriggerContext,n=void 0===t?{}:t;this.hasPopupMouseDown=!0,clearTimeout(this.mouseDownTimeout),this.mouseDownTimeout=setTimeout((function(){e.hasPopupMouseDown=!1}),0),n.onPopupMouseDown&&n.onPopupMouseDown.apply(n,arguments)},onDocumentClick:function(e){if(!this.$props.mask||this.$props.maskClosable){var t=e.target,n=this.getRootDomNode(),i=this.getPopupDomNode();contains(n,t)&&!this.isContextMenuOnly()||contains(i,t)||this.hasPopupMouseDown||this.delaySetPopupVisible(!1,.1)}},getPopupDomNode:function(){var e;return(null===(e=this.popupRef)||void 0===e?void 0:e.getElement())||null},getRootDomNode:function(){var e=this.$props.getTriggerDOMNode;if(e){var t=findDOMNode(this.triggerRef);return findDOMNode(e(t))}try{var n=findDOMNode(this.triggerRef);if(n)return n}catch(i){}return findDOMNode(this)},handleGetPopupClassFromAlign:function(e){var t=[],n=this.$props,i=n.popupPlacement,o=n.builtinPlacements,r=n.prefixCls,s=n.alignPoint,a=n.getPopupClassNameFromAlign;return i&&o&&t.push(getAlignPopupClassName(o,r,e,s)),a&&t.push(a(e)),t.join(" ")},getPopupAlign:function(){var e=this.$props,t=e.popupPlacement,n=e.popupAlign,i=e.builtinPlacements;return t&&i?getAlignFromPlacement(i,t,n):n},getComponent:function(){var e=this,t={};this.isMouseEnterToShow()&&(t.onMouseenter=this.onPopupMouseenter),this.isMouseLeaveToHide()&&(t.onMouseleave=this.onPopupMouseleave),t.onMousedown=this.onPopupMouseDown,t[supportsPassive$1?"onTouchstartPassive":"onTouchstart"]=this.onPopupMouseDown;var n=this.handleGetPopupClassFromAlign,i=this.getRootDomNode,o=this.getContainer,r=this.$attrs,s=this.$props,a=s.prefixCls,l=s.destroyPopupOnHide,c=s.popupClassName,d=s.popupAnimation,u=s.popupTransitionName,h=s.popupStyle,g=s.mask,p=s.maskAnimation,f=s.maskTransitionName,m=s.zIndex,v=s.stretch,_=s.alignPoint,C=s.mobile,b=s.forceRender,y=this.$data,S=y.sPopupVisible,w=y.point,E=_extends$1(_extends$1({prefixCls:a,destroyPopupOnHide:l,visible:S,point:_?w:null,align:this.align,animation:d,getClassNameFromAlign:n,stretch:v,getRootDomNode:i,mask:g,zIndex:m,transitionName:u,maskAnimation:p,maskTransitionName:f,getContainer:o,class:c,style:h,onAlign:r.onPopupAlign||noop$4},t),{ref:this.setPopupRef,mobile:C,forceRender:b});return createVNode(Popup,E,{default:this.$slots.popup||function(){return getComponent(e,"popup")}})},attachParent:function(e){var t=this;wrapperRaf.cancel(this.attachId);var n,i=this.$props,o=i.getPopupContainer,r=i.getDocument,s=this.getRootDomNode();o?(s||0===o.length)&&(n=o(s)):n=r(this.getRootDomNode()).body,n?n.appendChild(e):this.attachId=wrapperRaf((function(){t.attachParent(e)}))},getContainer:function(){var e=(0,this.$props.getDocument)(this.getRootDomNode()).createElement("div");return e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",this.attachParent(e),e},setPopupVisible:function(e,t){var n=this.alignPoint,i=this.sPopupVisible,o=this.onPopupVisibleChange;this.clearDelayTimer(),i!==e&&(hasProp(this,"popupVisible")||this.setState({sPopupVisible:e,prevPopupVisible:i}),o&&o(e)),n&&t&&e&&this.setPoint(t)},setPoint:function(e){this.$props.alignPoint&&e&&this.setState({point:{pageX:e.pageX,pageY:e.pageY}})},handlePortalUpdate:function(){this.prevPopupVisible!==this.sPopupVisible&&this.afterPopupVisibleChange(this.sPopupVisible)},delaySetPopupVisible:function(e,t,n){var i=this,o=1e3*t;if(this.clearDelayTimer(),o){var r=n?{pageX:n.pageX,pageY:n.pageY}:null;this.delayTimer=requestAnimationTimeout((function(){i.setPopupVisible(e,r),i.clearDelayTimer()}),o)}else this.setPopupVisible(e,n)},clearDelayTimer:function(){this.delayTimer&&(cancelAnimationTimeout(this.delayTimer),this.delayTimer=null)},clearOutsideHandler:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextmenuOutsideHandler1&&(this.contextmenuOutsideHandler1.remove(),this.contextmenuOutsideHandler1=null),this.contextmenuOutsideHandler2&&(this.contextmenuOutsideHandler2.remove(),this.contextmenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)},createTwoChains:function(e){var t=function(){},n=getEvents(this);return this.childOriginEvents[e]&&n[e]?this["fire".concat(e)]:t=this.childOriginEvents[e]||n[e]||t},isClickToShow:function(){var e=this.$props,t=e.action,n=e.showAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")},isContextMenuOnly:function(){var e=this.$props.action;return"contextmenu"===e||1===e.length&&"contextmenu"===e[0]},isContextmenuToShow:function(){var e=this.$props,t=e.action,n=e.showAction;return-1!==t.indexOf("contextmenu")||-1!==n.indexOf("contextmenu")},isClickToHide:function(){var e=this.$props,t=e.action,n=e.hideAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")},isMouseEnterToShow:function(){var e=this.$props,t=e.action,n=e.showAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseenter")},isMouseLeaveToHide:function(){var e=this.$props,t=e.action,n=e.hideAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseleave")},isFocusToShow:function(){var e=this.$props,t=e.action,n=e.showAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("focus")},isBlurToHide:function(){var e=this.$props,t=e.action,n=e.hideAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("blur")},forcePopupAlign:function(){var e;this.$data.sPopupVisible&&(null===(e=this.popupRef)||void 0===e||e.forceAlign())},fireEvents:function(e,t){this.childOriginEvents[e]&&this.childOriginEvents[e](t);var n=this.$props[e]||this.$attrs[e];n&&n(t)},close:function(){this.setPopupVisible(!1)}},render:function(){var e=this,t=this.$attrs,n=filterEmpty(getSlot(this)),i=this.$props.alignPoint,o=n[0];this.childOriginEvents=getEvents(o);var r={key:"trigger"};this.isContextmenuToShow()?r.onContextmenu=this.onContextmenu:r.onContextmenu=this.createTwoChains("onContextmenu"),this.isClickToHide()||this.isClickToShow()?(r.onClick=this.onClick,r.onMousedown=this.onMousedown,r[supportsPassive$1?"onTouchstartPassive":"onTouchstart"]=this.onTouchstart):(r.onClick=this.createTwoChains("onClick"),r.onMousedown=this.createTwoChains("onMousedown"),r[supportsPassive$1?"onTouchstartPassive":"onTouchstart"]=this.createTwoChains("onTouchstart")),this.isMouseEnterToShow()?(r.onMouseenter=this.onMouseenter,i&&(r.onMousemove=this.onMouseMove)):r.onMouseenter=this.createTwoChains("onMouseenter"),this.isMouseLeaveToHide()?r.onMouseleave=this.onMouseleave:r.onMouseleave=this.createTwoChains("onMouseleave"),this.isFocusToShow()||this.isBlurToHide()?(r.onFocus=this.onFocus,r.onBlur=this.onBlur):(r.onFocus=this.createTwoChains("onFocus"),r.onBlur=function(t){!t||t.relatedTarget&&contains(t.target,t.relatedTarget)||e.createTwoChains("onBlur")(t)});var s=classNames(o&&o.props&&o.props.class,t.class);s&&(r.class=s);var a=cloneElement(o,_extends$1(_extends$1({},r),{ref:"triggerRef"}),!0,!0);if(this.popPortal)return a;var l=createVNode(Portal$1,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},{default:this.getComponent});return createVNode(Fragment,null,[l,a])}}),__rest$C=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},getBuiltInPlacements=function(e){var t=!0===e?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1}}}},SelectTrigger=defineComponent({name:"SelectTrigger",inheritAttrs:!1,props:{dropdownAlign:Object,visible:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},dropdownClassName:String,dropdownStyle:PropTypes$1.object,placement:String,empty:{type:Boolean,default:void 0},prefixCls:String,popupClassName:String,animation:String,transitionName:String,getPopupContainer:Function,dropdownRender:Function,containerWidth:Number,dropdownMatchSelectWidth:PropTypes$1.oneOfType([Number,Boolean]).def(!0),popupElement:PropTypes$1.any,direction:String,getTriggerDOMNode:Function,onPopupVisibleChange:Function,onPopupMouseEnter:Function},setup:function(e,t){var n=t.slots,i=t.attrs,o=t.expose,r=computed((function(){var t=e.dropdownMatchSelectWidth;return getBuiltInPlacements(t)})),s=ref();return o({getPopupElement:function(){return s.value}}),function(){var t=_extends$1(_extends$1({},e),i),o=t.empty,a=void 0!==o&&o,l=__rest$C(t,["empty"]),c=l.visible,d=l.dropdownAlign,u=l.prefixCls,h=l.popupElement,g=l.dropdownClassName,p=l.dropdownStyle,f=l.direction,m=void 0===f?"ltr":f,v=l.placement,_=l.dropdownMatchSelectWidth,C=l.containerWidth,b=l.dropdownRender,y=l.animation,S=l.transitionName,w=l.getPopupContainer,E=l.getTriggerDOMNode,x=l.onPopupVisibleChange,T=l.onPopupMouseEnter,I="".concat(u,"-dropdown"),k=h;b&&(k=b({menuNode:h,props:e}));var L=y?"".concat(I,"-").concat(y):S,D=_extends$1({minWidth:"".concat(C,"px")},p);return"number"==typeof _?D.width="".concat(_,"px"):_&&(D.width="".concat(C,"px")),createVNode(Trigger,_objectSpread2$1(_objectSpread2$1({},e),{},{showAction:x?["click"]:[],hideAction:x?["click"]:[],popupPlacement:v||("rtl"===m?"bottomRight":"bottomLeft"),builtinPlacements:r.value,prefixCls:I,popupTransitionName:L,popupAlign:d,popupVisible:c,getPopupContainer:w,popupClassName:classNames(g,_defineProperty$P({},"".concat(I,"-empty"),a)),popupStyle:D,getTriggerDOMNode:E,onPopupVisibleChange:x}),{default:n.default,popup:function(){return createVNode("div",{ref:s,onMouseenter:T},[k])}})}}}),SelectTrigger$1=SelectTrigger,KeyCode$2={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=KeyCode$2.F1&&t<=KeyCode$2.F12)return!1;switch(t){case KeyCode$2.ALT:case KeyCode$2.CAPS_LOCK:case KeyCode$2.CONTEXT_MENU:case KeyCode$2.CTRL:case KeyCode$2.DOWN:case KeyCode$2.END:case KeyCode$2.ESC:case KeyCode$2.HOME:case KeyCode$2.INSERT:case KeyCode$2.LEFT:case KeyCode$2.MAC_FF_META:case KeyCode$2.META:case KeyCode$2.NUMLOCK:case KeyCode$2.NUM_CENTER:case KeyCode$2.PAGE_DOWN:case KeyCode$2.PAGE_UP:case KeyCode$2.PAUSE:case KeyCode$2.PRINT_SCREEN:case KeyCode$2.RIGHT:case KeyCode$2.SHIFT:case KeyCode$2.UP:case KeyCode$2.WIN_KEY:case KeyCode$2.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=KeyCode$2.ZERO&&e<=KeyCode$2.NINE)return!0;if(e>=KeyCode$2.NUM_ZERO&&e<=KeyCode$2.NUM_MULTIPLY)return!0;if(e>=KeyCode$2.A&&e<=KeyCode$2.Z)return!0;if(-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case KeyCode$2.SPACE:case KeyCode$2.QUESTION_MARK:case KeyCode$2.NUM_PLUS:case KeyCode$2.NUM_MINUS:case KeyCode$2.NUM_PERIOD:case KeyCode$2.NUM_DIVISION:case KeyCode$2.SEMICOLON:case KeyCode$2.DASH:case KeyCode$2.EQUALS:case KeyCode$2.COMMA:case KeyCode$2.PERIOD:case KeyCode$2.SLASH:case KeyCode$2.APOSTROPHE:case KeyCode$2.SINGLE_QUOTE:case KeyCode$2.OPEN_SQUARE_BRACKET:case KeyCode$2.BACKSLASH:case KeyCode$2.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},KeyCode$3=KeyCode$2,TransBtn=function(e,t){var n,i,o=t.slots,r=e.class,s=e.customizeIcon,a=e.customizeIconProps,l=e.onMousedown,c=e.onClick;return i="function"==typeof s?s(a):s,createVNode("span",{class:r,onMousedown:function(e){e.preventDefault(),l&&l(e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:c,"aria-hidden":!0},[void 0!==i?i:createVNode("span",{class:r.split(/\s+/).map((function(e){return"".concat(e,"-icon")}))},[null===(n=o.default)||void 0===n?void 0:n.call(o)])])};TransBtn.inheritAttrs=!1,TransBtn.displayName="TransBtn",TransBtn.props={class:String,customizeIcon:PropTypes$1.any,customizeIconProps:PropTypes$1.any,onMousedown:Function,onClick:Function};var TransBtn$1=TransBtn;function onCompositionStart(e){e.target.composing=!0}function onCompositionEnd(e){e.target.composing&&(e.target.composing=!1,trigger(e.target,"input"))}function trigger(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function addEventListener$1(e,t,n,i){e.addEventListener(t,n,i)}var antInput={created:function(e,t){t.modifiers&&t.modifiers.lazy||(addEventListener$1(e,"compositionstart",onCompositionStart),addEventListener$1(e,"compositionend",onCompositionEnd),addEventListener$1(e,"change",onCompositionEnd))}},antInputDirective=antInput,inputProps$2={inputRef:PropTypes$1.any,prefixCls:String,id:String,inputElement:PropTypes$1.VueNode,disabled:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},autocomplete:String,editable:{type:Boolean,default:void 0},activeDescendantId:String,value:String,open:{type:Boolean,default:void 0},tabindex:PropTypes$1.oneOfType([PropTypes$1.number,PropTypes$1.string]),attrs:PropTypes$1.object,onKeydown:{type:Function},onMousedown:{type:Function},onChange:{type:Function},onPaste:{type:Function},onCompositionstart:{type:Function},onCompositionend:{type:Function},onFocus:{type:Function},onBlur:{type:Function}},Input$1=defineComponent({name:"Input",inheritAttrs:!1,props:inputProps$2,setup:function(e){var t=null,n=inject("VCSelectContainerEvent");return function(){var i,o=e.prefixCls,r=e.id,s=e.inputElement,a=e.disabled,l=e.tabindex,c=e.autofocus,d=e.autocomplete,u=e.editable,h=e.activeDescendantId,g=e.value,p=e.onKeydown,f=e.onMousedown,m=e.onChange,v=e.onPaste,_=e.onCompositionstart,C=e.onCompositionend,b=e.onFocus,y=e.onBlur,S=e.open,w=e.inputRef,E=e.attrs,x=s||withDirectives(createVNode("input",null,null),[[antInputDirective]]),T=x.props||{},I=T.onKeydown,k=T.onInput,L=T.onFocus,D=T.onBlur,N=T.onMousedown,O=T.onCompositionstart,A=T.onCompositionend,P=T.style;return x=cloneElement(x,_extends$1(_extends$1(_extends$1(_extends$1(_extends$1({type:"search"},T),{id:r,ref:w,disabled:a,tabindex:l,autocomplete:d||"off",autofocus:c,class:classNames("".concat(o,"-selection-search-input"),null===(i=null==x?void 0:x.props)||void 0===i?void 0:i.class),role:"combobox","aria-expanded":S,"aria-haspopup":"listbox","aria-owns":"".concat(r,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(r,"_list"),"aria-activedescendant":h}),E),{value:u?g:"",readonly:!u,unselectable:u?null:"on",style:_extends$1(_extends$1({},P),{opacity:u?null:0}),onKeydown:function(e){p(e),I&&I(e)},onMousedown:function(e){f(e),N&&N(e)},onInput:function(e){m(e),k&&k(e)},onCompositionstart:function(e){_(e),O&&O(e)},onCompositionend:function(e){C(e),A&&A(e)},onPaste:v,onFocus:function(){clearTimeout(t),L&&L(arguments.length<=0?void 0:arguments[0]),b&&b(arguments.length<=0?void 0:arguments[0]),null==n||n.focus(arguments.length<=0?void 0:arguments[0])},onBlur:function(){for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];t=setTimeout((function(){D&&D(i[0]),y&&y(i[0]),null==n||n.blur(i[0])}),100)}}),"textarea"===x.type?{}:{type:"search"}),!0,!0),x}}}),Input$2=Input$1,attributes="accept acceptcharset accesskey action allowfullscreen allowtransparency\nalt async autocomplete autofocus autoplay capture cellpadding cellspacing challenge\ncharset checked classid classname colspan cols content contenteditable contextmenu\ncontrols coords crossorigin data datetime default defer dir disabled download draggable\nenctype form formaction formenctype formmethod formnovalidate formtarget frameborder\nheaders height hidden high href hreflang htmlfor for httpequiv icon id inputmode integrity\nis keyparams keytype kind label lang list loop low manifest marginheight marginwidth max maxlength media\nmediagroup method min minlength multiple muted name novalidate nonce open\noptimum pattern placeholder poster preload radiogroup readonly rel required\nreversed role rowspan rows sandbox scope scoped scrolling seamless selected\nshape size sizes span spellcheck src srcdoc srclang srcset start step style\nsummary tabindex target title type usemap value width wmode wrap",eventsName="onCopy onCut onPaste onCompositionend onCompositionstart onCompositionupdate onKeydown\n onKeypress onKeyup onFocus onBlur onChange onInput onSubmit onClick onContextmenu onDoubleclick onDblclick\n onDrag onDragend onDragenter onDragexit onDragleave onDragover onDragstart onDrop onMousedown\n onMouseenter onMouseleave onMousemove onMouseout onMouseover onMouseup onSelect onTouchcancel\n onTouchend onTouchmove onTouchstart onTouchstartPassive onTouchmovePassive onScroll onWheel onAbort onCanplay onCanplaythrough\n onDurationchange onEmptied onEncrypted onEnded onError onLoadeddata onLoadedmetadata\n onLoadstart onPause onPlay onPlaying onProgress onRatechange onSeeked onSeeking onStalled onSuspend onTimeupdate onVolumechange onWaiting onLoad onError",propList="".concat(attributes," ").concat(eventsName).split(/[\s\n]+/),ariaPrefix="aria-",dataPrefix="data-";function match$2(e,t){return 0===e.indexOf(t)}function pickAttrs(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t=!1===n?{aria:!0,data:!0,attr:!0}:!0===n?{aria:!0}:_extends$1({},n);var i={};return Object.keys(e).forEach((function(n){(t.aria&&("role"===n||match$2(n,ariaPrefix))||t.data&&match$2(n,dataPrefix)||t.attr&&(propList.includes(n)||propList.includes(n.toLowerCase())))&&(i[n]=e[n])})),i}var OverflowContextProviderKey=Symbol("OverflowContextProviderKey"),OverflowContextProvider=defineComponent({name:"OverflowContextProvider",inheritAttrs:!1,props:{value:{type:Object}},setup:function(e,t){var n=t.slots;return provide(OverflowContextProviderKey,computed((function(){return e.value}))),function(){var e;return null===(e=n.default)||void 0===e?void 0:e.call(n)}}}),useInjectOverflowContext=function(){return inject(OverflowContextProviderKey,computed((function(){return null})))},__rest$B=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},UNDEFINED=void 0,Item$2=defineComponent({name:"Item",props:{prefixCls:String,item:PropTypes$1.any,renderItem:Function,responsive:Boolean,itemKey:{type:[String,Number]},registerSize:Function,display:Boolean,order:Number,component:PropTypes$1.any,invalidate:Boolean},setup:function(e,t){var n=t.slots,i=t.expose,o=computed((function(){return e.responsive&&!e.display})),r=ref();function s(t){e.registerSize(e.itemKey,t)}return i({itemNodeRef:r}),onUnmounted((function(){s(null)})),function(){var t,i=e.prefixCls,a=e.invalidate,l=e.item,c=e.renderItem,d=e.responsive;e.registerSize,e.itemKey,e.display;var u,h=e.order,g=e.component,p=void 0===g?"div":g,f=__rest$B(e,["prefixCls","invalidate","item","renderItem","responsive","registerSize","itemKey","display","order","component"]),m=null===(t=n.default)||void 0===t?void 0:t.call(n),v=c&&l!==UNDEFINED?c(l):m;a||(u={opacity:o.value?0:1,height:o.value?0:UNDEFINED,overflowY:o.value?"hidden":UNDEFINED,order:d?h:UNDEFINED,pointerEvents:o.value?"none":UNDEFINED,position:o.value?"absolute":UNDEFINED});var _={};return o.value&&(_["aria-hidden"]=!0),createVNode(ResizeObserver$1,{disabled:!d,onResize:function(e){s(e.offsetWidth)}},{default:function(){return createVNode(p,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({class:classNames(!a&&i),style:u},_),f),{},{ref:r}),{default:function(){return[v]}})}})}}}),__rest$A=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},RawItem=defineComponent({name:"RawItem",inheritAttrs:!1,props:{component:PropTypes$1.any,title:PropTypes$1.any,id:String,onMouseenter:{type:Function},onMouseleave:{type:Function},onClick:{type:Function},onKeydown:{type:Function},onFocus:{type:Function}},setup:function(e,t){var n=t.slots,i=t.attrs,o=useInjectOverflowContext();return function(){var t;if(!o.value){var r=e.component,s=void 0===r?"div":r,a=__rest$A(e,["component"]);return createVNode(s,_objectSpread2$1(_objectSpread2$1({},a),i),{default:function(){return[null===(t=n.default)||void 0===t?void 0:t.call(n)]}})}var l=o.value,c=l.className,d=__rest$A(l,["className"]),u=i.class,h=__rest$A(i,["class"]);return createVNode(OverflowContextProvider,{value:null},{default:function(){return[createVNode(Item$2,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({class:classNames(c,u)},d),h),e),n)]}})}}}),__rest$z=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},RESPONSIVE="responsive",INVALIDATE="invalidate";function defaultRenderRest(e){return"+ ".concat(e.length," ...")}var overflowProps=function(){return{id:String,prefixCls:String,data:Array,itemKey:[String,Number,Function],itemWidth:{type:Number,default:10},renderItem:Function,renderRawItem:Function,maxCount:[Number,String],renderRest:Function,renderRawRest:Function,suffix:PropTypes$1.any,component:String,itemComponent:PropTypes$1.any,onVisibleChange:Function,ssr:String,onMousedown:Function}},Overflow=defineComponent({name:"Overflow",inheritAttrs:!1,props:overflowProps(),emits:["visibleChange"],setup:function(e,t){var n=t.attrs,i=t.emit,o=t.slots,r=computed((function(){return"full"===e.ssr})),s=ref(null),a=computed((function(){return s.value||0})),l=ref(new Map),c=ref(0),d=ref(0),u=ref(0),h=ref(null),g=ref(null),p=computed((function(){return null===g.value&&r.value?Number.MAX_SAFE_INTEGER:g.value||0})),f=ref(!1),m=computed((function(){return"".concat(e.prefixCls,"-item")})),v=computed((function(){return Math.max(c.value,d.value)})),_=computed((function(){return!(!e.data.length||e.maxCount!==RESPONSIVE)})),C=computed((function(){return e.maxCount===INVALIDATE})),b=computed((function(){return _.value||"number"==typeof e.maxCount&&e.data.length>e.maxCount})),y=computed((function(){var t=e.data;return _.value?t=null===s.value&&r.value?e.data:e.data.slice(0,Math.min(e.data.length,a.value/e.itemWidth)):"number"==typeof e.maxCount&&(t=e.data.slice(0,e.maxCount)),t})),S=computed((function(){return _.value?e.data.slice(p.value+1):e.data.slice(y.value.length)})),w=function(t,n){var i,o;return"function"==typeof e.itemKey?e.itemKey(t):null!==(o=e.itemKey&&(null===(i=t)||void 0===i?void 0:i[e.itemKey]))&&void 0!==o?o:n},E=computed((function(){return e.renderItem||function(e){return e}})),x=function(t,n){g.value=t,n||(f.value=t<e.data.length-1,i("visibleChange",t))},T=function(e,t){s.value=t.clientWidth},I=function(e,t){var n=new Map(l.value);null===t?n.delete(e):n.set(e,t),l.value=n},k=function(e,t){c.value=d.value,d.value=t},L=function(e,t){u.value=t},D=function(e){return l.value.get(w(y.value[e],e))};return watch([a,l,d,u,function(){return e.itemKey},y],(function(){if(a.value&&v.value&&y.value){var t=u.value,n=y.value.length,i=n-1;if(!n)return x(0),void(h.value=null);for(var o=0;o<n;o+=1){var r=D(o);if(void 0===r){x(o-1,!0);break}if(t+=r,0===i&&t<=a.value||o===i-1&&t+D(i)<=a.value){x(i),h.value=null;break}if(t+v.value>a.value){x(o-1),h.value=t-r-u.value+d.value;break}}e.suffix&&D(0)+u.value>a.value&&(h.value=null)}})),function(){var t=f.value&&!!S.value.length,i=e.itemComponent,r=e.renderRawItem,s=e.renderRawRest,a=e.renderRest,l=e.prefixCls,c=void 0===l?"rc-overflow":l,d=e.suffix,u=e.component,g=void 0===u?"div":u,v=e.id,x=e.onMousedown,D=n.class,N=n.style,O=__rest$z(n,["class","style"]),A={};null!==h.value&&_.value&&(A={position:"absolute",left:"".concat(h.value,"px"),top:0});var P={prefixCls:m.value,responsive:_.value,component:i,invalidate:C.value},R=r?function(e,t){var n=w(e,t);return createVNode(OverflowContextProvider,{key:n,value:_extends$1(_extends$1({},P),{order:t,item:e,itemKey:n,registerSize:I,display:t<=p.value})},{default:function(){return[r(e,t)]}})}:function(e,t){var n=w(e,t);return createVNode(Item$2,_objectSpread2$1(_objectSpread2$1({},P),{},{order:t,key:n,item:e,renderItem:E.value,itemKey:n,registerSize:I,display:t<=p.value}),null)},M=function(){return null},$={order:t?p.value:Number.MAX_SAFE_INTEGER,className:"".concat(m.value," ").concat(m.value,"-rest"),registerSize:k,display:t};if(s)s&&(M=function(){return createVNode(OverflowContextProvider,{value:_extends$1(_extends$1({},P),$)},{default:function(){return[s(S.value)]}})});else{var F=a||defaultRenderRest;M=function(){return createVNode(Item$2,_objectSpread2$1(_objectSpread2$1({},P),$),{default:function(){return"function"==typeof F?F(S.value):F}})}}return createVNode(ResizeObserver$1,{disabled:!_.value,onResize:T},{default:function(){var e;return createVNode(g,_objectSpread2$1({id:v,class:classNames(!C.value&&c,D),style:N,onMousedown:x},O),{default:function(){return[y.value.map(R),b.value?M():null,d&&createVNode(Item$2,_objectSpread2$1(_objectSpread2$1({},P),{},{order:p.value,class:"".concat(m.value,"-suffix"),registerSize:L,display:!0,style:A}),{default:function(){return d}}),null===(e=o.default)||void 0===e?void 0:e.call(o)]}})}})}}});Overflow.Item=RawItem,Overflow.RESPONSIVE=RESPONSIVE,Overflow.INVALIDATE=INVALIDATE;var Overflow$1=Overflow,TreeSelectLegacyContextPropsKey=Symbol("TreeSelectLegacyContextPropsKey");function useProvideLegacySelectContext(e){return provide(TreeSelectLegacyContextPropsKey,e)}function useInjectLegacySelectContext(){return inject(TreeSelectLegacyContextPropsKey,{})}var props$1={id:String,prefixCls:String,values:PropTypes$1.array,open:{type:Boolean,default:void 0},searchValue:String,inputRef:PropTypes$1.any,placeholder:PropTypes$1.any,disabled:{type:Boolean,default:void 0},mode:String,showSearch:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},autocomplete:String,activeDescendantId:String,tabindex:PropTypes$1.oneOfType([PropTypes$1.number,PropTypes$1.string]),removeIcon:PropTypes$1.any,choiceTransitionName:String,maxTagCount:PropTypes$1.oneOfType([PropTypes$1.number,PropTypes$1.string]),maxTagTextLength:Number,maxTagPlaceholder:PropTypes$1.any.def((function(){return function(e){return"+ ".concat(e.length," ...")}})),tagRender:Function,onToggleOpen:{type:Function},onRemove:Function,onInputChange:Function,onInputPaste:Function,onInputKeyDown:Function,onInputMouseDown:Function,onInputCompositionStart:Function,onInputCompositionEnd:Function},onPreventMouseDown=function(e){e.preventDefault(),e.stopPropagation()},SelectSelector=defineComponent({name:"MultipleSelectSelector",inheritAttrs:!1,props:props$1,setup:function(e){var t=ref(),n=ref(0),i=ref(!1),o=useInjectLegacySelectContext(),r=computed((function(){return"".concat(e.prefixCls,"-selection")})),s=computed((function(){return e.open||"tags"===e.mode?e.searchValue:""})),a=computed((function(){return"tags"===e.mode||e.showSearch&&(e.open||i.value)}));function l(t,n,i,o,s){return createVNode("span",{class:classNames("".concat(r.value,"-item"),_defineProperty$P({},"".concat(r.value,"-item-disabled"),i)),title:"string"==typeof t||"number"==typeof t?t.toString():void 0},[createVNode("span",{class:"".concat(r.value,"-item-content")},[n]),o&&createVNode(TransBtn$1,{class:"".concat(r.value,"-item-remove"),onMousedown:onPreventMouseDown,onClick:s,customizeIcon:e.removeIcon},{default:function(){return[createTextVNode("×")]}})])}function c(t){var n=t.disabled,i=t.label,r=t.value,s=t.option,a=!e.disabled&&!n,c=i;if("number"==typeof e.maxTagTextLength&&("string"==typeof i||"number"==typeof i)){var d=String(c);d.length>e.maxTagTextLength&&(c="".concat(d.slice(0,e.maxTagTextLength),"..."))}var u=function(n){var i;n&&n.stopPropagation(),null===(i=e.onRemove)||void 0===i||i.call(e,t)};return"function"==typeof e.tagRender?function(t,n,i,r,s,a){var l,c=a;return o.keyEntities&&(c=(null===(l=o.keyEntities[t])||void 0===l?void 0:l.node)||{}),createVNode("span",{key:t,onMousedown:function(t){onPreventMouseDown(t),e.onToggleOpen(!open)}},[e.tagRender({label:n,value:t,disabled:i,closable:r,onClose:s,option:c})])}(r,c,n,a,u,s):l(i,c,n,a,u)}function d(t){var n=e.maxTagPlaceholder,i=void 0===n?function(e){return"+ ".concat(e.length," ...")}:n,o="function"==typeof i?i(t):i;return l(o,o,!1)}return onMounted((function(){watch(s,(function(){n.value=t.value.scrollWidth}),{flush:"post",immediate:!0})})),function(){var o=e.id,l=e.prefixCls,u=e.values,h=e.open,g=e.inputRef,p=e.placeholder,f=e.disabled,m=e.autofocus,v=e.autocomplete,_=e.activeDescendantId,C=e.tabindex,b=e.onInputChange,y=e.onInputPaste,S=e.onInputKeyDown,w=e.onInputMouseDown,E=e.onInputCompositionStart,x=e.onInputCompositionEnd,T=createVNode("div",{class:"".concat(r.value,"-search"),style:{width:n.value+"px"},key:"input"},[createVNode(Input$2,{inputRef:g,open:h,prefixCls:l,id:o,inputElement:null,disabled:f,autofocus:m,autocomplete:v,editable:a.value,activeDescendantId:_,value:s.value,onKeydown:S,onMousedown:w,onChange:b,onPaste:y,onCompositionstart:E,onCompositionend:x,tabindex:C,attrs:pickAttrs(e,!0),onFocus:function(){return i.value=!0},onBlur:function(){return i.value=!1}},null),createVNode("span",{ref:t,class:"".concat(r.value,"-search-mirror"),"aria-hidden":!0},[s.value,createTextVNode(" ")])]),I=createVNode(Overflow$1,{prefixCls:"".concat(r.value,"-overflow"),data:u,renderItem:c,renderRest:d,suffix:T,itemKey:"key",maxCount:e.maxTagCount,key:"overflow"},null);return createVNode(Fragment,null,[I,!u.length&&!s.value&&createVNode("span",{class:"".concat(r.value,"-placeholder")},[p])])}}}),MultipleSelector=SelectSelector,props={inputElement:PropTypes$1.any,id:String,prefixCls:String,values:PropTypes$1.array,open:{type:Boolean,default:void 0},searchValue:String,inputRef:PropTypes$1.any,placeholder:PropTypes$1.any,disabled:{type:Boolean,default:void 0},mode:String,showSearch:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},autocomplete:String,activeDescendantId:String,tabindex:PropTypes$1.oneOfType([PropTypes$1.number,PropTypes$1.string]),activeValue:String,backfill:{type:Boolean,default:void 0},optionLabelRender:Function,onInputChange:Function,onInputPaste:Function,onInputKeyDown:Function,onInputMouseDown:Function,onInputCompositionStart:Function,onInputCompositionEnd:Function},SingleSelector=defineComponent({name:"SingleSelector",setup:function(e){var t=ref(!1),n=computed((function(){return"combobox"===e.mode})),i=computed((function(){return n.value||e.showSearch})),o=computed((function(){var i=e.searchValue||"";return n.value&&e.activeValue&&!t.value&&(i=e.activeValue),i})),r=useInjectLegacySelectContext();watch([n,function(){return e.activeValue}],(function(){n.value&&(t.value=!1)}),{immediate:!0});var s=computed((function(){return!("combobox"!==e.mode&&!e.open&&!e.showSearch)&&!!o.value})),a=computed((function(){var t=e.values[0];return!t||"string"!=typeof t.label&&"number"!=typeof t.label?void 0:t.label.toString()})),l=function(){if(e.values[0])return null;var t=s.value?{visibility:"hidden"}:void 0;return createVNode("span",{class:"".concat(e.prefixCls,"-selection-placeholder"),style:t},[e.placeholder])};return function(){var c,d,u,h,g=e.inputElement,p=e.prefixCls,f=e.id,m=e.values,v=e.inputRef,_=e.disabled,C=e.autofocus,b=e.autocomplete,y=e.activeDescendantId,S=e.open,w=e.tabindex,E=e.optionLabelRender,x=e.onInputKeyDown,T=e.onInputMouseDown,I=e.onInputChange,k=e.onInputPaste,L=e.onInputCompositionStart,D=e.onInputCompositionEnd,N=m[0],O=null;if(N&&r.customSlots){var A=null!==(c=N.key)&&void 0!==c?c:N.value,P=(null===(d=r.keyEntities[A])||void 0===d?void 0:d.node)||{};"function"==typeof(O=r.customSlots[null===(u=P.slots)||void 0===u?void 0:u.title]||r.customSlots.title||N.label)&&(O=O(P))}else O=E&&N?E(N.option):null==N?void 0:N.label;return createVNode(Fragment,null,[createVNode("span",{class:"".concat(p,"-selection-search")},[createVNode(Input$2,{inputRef:v,prefixCls:p,id:f,open:S,inputElement:g,disabled:_,autofocus:C,autocomplete:b,editable:i.value,activeDescendantId:y,value:o.value,onKeydown:x,onMousedown:T,onChange:function(e){t.value=!0,I(e)},onPaste:k,onCompositionstart:L,onCompositionend:D,tabindex:w,attrs:pickAttrs(e,!0)},null)]),!n.value&&N&&!s.value&&createVNode("span",{class:"".concat(p,"-selection-item"),title:a.value},[createVNode(Fragment,{key:null!==(h=N.key)&&void 0!==h?h:N.value},[O])]),l()])}}});SingleSelector.props=props,SingleSelector.inheritAttrs=!1;var SingleSelector$1=SingleSelector;function isValidateOpenKey(e){return![KeyCode$3.ESC,KeyCode$3.SHIFT,KeyCode$3.BACKSPACE,KeyCode$3.TAB,KeyCode$3.WIN_KEY,KeyCode$3.ALT,KeyCode$3.META,KeyCode$3.WIN_KEY_RIGHT,KeyCode$3.CTRL,KeyCode$3.SEMICOLON,KeyCode$3.EQUALS,KeyCode$3.CAPS_LOCK,KeyCode$3.CONTEXT_MENU,KeyCode$3.F1,KeyCode$3.F2,KeyCode$3.F3,KeyCode$3.F4,KeyCode$3.F5,KeyCode$3.F6,KeyCode$3.F7,KeyCode$3.F8,KeyCode$3.F9,KeyCode$3.F10,KeyCode$3.F11,KeyCode$3.F12].includes(e)}function useLock(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,n=null;function i(i){(i||null===n)&&(n=i),clearTimeout(e),e=setTimeout((function(){n=null}),t)}return onBeforeUnmount((function(){clearTimeout(e)})),[function(){return n},i]}function createRef(){return function e(t){e.current=t}}var Selector=defineComponent({name:"Selector",inheritAttrs:!1,props:{id:String,prefixCls:String,showSearch:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},values:PropTypes$1.array,multiple:{type:Boolean,default:void 0},mode:String,searchValue:String,activeValue:String,inputElement:PropTypes$1.any,autofocus:{type:Boolean,default:void 0},activeDescendantId:String,tabindex:PropTypes$1.oneOfType([PropTypes$1.number,PropTypes$1.string]),disabled:{type:Boolean,default:void 0},placeholder:PropTypes$1.any,removeIcon:PropTypes$1.any,maxTagCount:PropTypes$1.oneOfType([PropTypes$1.number,PropTypes$1.string]),maxTagTextLength:Number,maxTagPlaceholder:PropTypes$1.any,tagRender:Function,optionLabelRender:Function,tokenWithEnter:{type:Boolean,default:void 0},choiceTransitionName:String,onToggleOpen:{type:Function},onSearch:Function,onSearchSubmit:Function,onRemove:Function,onInputKeyDown:{type:Function},domRef:Function},setup:function(e,t){var n=t.expose,i=createRef(),o=!1,r=_slicedToArray$2(useLock(0),2),s=r[0],a=r[1],l=function(t){var n=t.which;n!==KeyCode$3.UP&&n!==KeyCode$3.DOWN||t.preventDefault(),e.onInputKeyDown&&e.onInputKeyDown(t),n!==KeyCode$3.ENTER||"tags"!==e.mode||o||e.open||e.onSearchSubmit(t.target.value),isValidateOpenKey(n)&&e.onToggleOpen(!0)},c=function(){a(!0)},d=null,u=function(t){!1!==e.onSearch(t,!0,o)&&e.onToggleOpen(!0)},h=function(){o=!0},g=function(t){o=!1,"combobox"!==e.mode&&u(t.target.value)},p=function(t){var n=t.target.value;if(e.tokenWithEnter&&d&&/[\r\n]/.test(d)){var i=d.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");n=n.replace(i,d)}d=null,u(n)},f=function(e){var t=e.clipboardData.getData("text");d=t},m=function(e){e.target!==i.current&&(void 0!==document.body.style.msTouchAction?setTimeout((function(){i.current.focus()})):i.current.focus())},v=function(t){var n=s();t.target===i.current||n||t.preventDefault(),("combobox"===e.mode||e.showSearch&&n)&&e.open||(e.open&&e.onSearch("",!0,!1),e.onToggleOpen())};return n({focus:function(){i.current.focus()},blur:function(){i.current.blur()}}),function(){var t=e.prefixCls,n=e.domRef,o=e.mode,r={inputRef:i,onInputKeyDown:l,onInputMouseDown:c,onInputChange:p,onInputPaste:f,onInputCompositionStart:h,onInputCompositionEnd:g},s=createVNode("multiple"===o||"tags"===o?MultipleSelector:SingleSelector$1,_objectSpread2$1(_objectSpread2$1({},e),r),null);return createVNode("div",{ref:n,class:"".concat(t,"-selector"),onClick:m,onMousedown:v},[s])}}}),Selector$1=Selector;function useSelectTriggerControl(e,t,n){function i(i){var o,r,s,a=i.target;a.shadowRoot&&i.composed&&(a=i.composedPath()[0]||a);var l=[null===(o=e[0])||void 0===o?void 0:o.value,null===(s=null===(r=e[1])||void 0===r?void 0:r.value)||void 0===s?void 0:s.getPopupElement()];t.value&&l.every((function(e){return e&&!e.contains(a)&&e!==a}))&&n(!1)}onMounted((function(){window.addEventListener("mousedown",i)})),onBeforeUnmount((function(){window.removeEventListener("mousedown",i)}))}function useDelayReset(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=ref(!1),i=function(){clearTimeout(e)};onMounted((function(){i()}));var o=function(o,r){i(),e=setTimeout((function(){n.value=o,r&&r()}),t)};return[n,o,i]}var BaseSelectContextKey=Symbol("BaseSelectContextKey");function useProvideBaseSelectProps(e){return provide(BaseSelectContextKey,e)}function useBaseProps(){return inject(BaseSelectContextKey,{})}var isMobile$2=function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4)))};function toReactive(e){return isRef(e)?reactive(new Proxy({},{get:function(t,n,i){return Reflect.get(e.value,n,i)},set:function(t,n,i){return e.value[n]=i,!0},deleteProperty:function(t,n){return Reflect.deleteProperty(e.value,n)},has:function(t,n){return Reflect.has(e.value,n)},ownKeys:function(){return Object.keys(e.value)},getOwnPropertyDescriptor:function(){return{enumerable:!0,configurable:!0}}})):reactive(e)}var __rest$y=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},DEFAULT_OMIT_PROPS=["value","onChange","removeIcon","placeholder","autofocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabindex","OptionList","notFoundContent"],baseSelectPrivateProps=function(){return{prefixCls:String,id:String,omitDomProps:Array,displayValues:Array,onDisplayValuesChange:Function,activeValue:String,activeDescendantId:String,onActiveValueChange:Function,searchValue:String,onSearch:Function,onSearchSplit:Function,maxLength:Number,OptionList:PropTypes$1.any,emptyOptions:Boolean}},baseSelectPropsWithoutPrivate=function(){return{showSearch:{type:Boolean,default:void 0},tagRender:{type:Function},optionLabelRender:{type:Function},direction:{type:String},tabindex:Number,autofocus:Boolean,notFoundContent:PropTypes$1.any,placeholder:PropTypes$1.any,onClear:Function,choiceTransitionName:String,mode:String,disabled:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},onDropdownVisibleChange:{type:Function},getInputElement:{type:Function},getRawInputElement:{type:Function},maxTagTextLength:Number,maxTagCount:{type:[String,Number]},maxTagPlaceholder:PropTypes$1.any,tokenSeparators:{type:Array},allowClear:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:void 0},inputIcon:PropTypes$1.any,clearIcon:PropTypes$1.any,removeIcon:PropTypes$1.any,animation:String,transitionName:String,dropdownStyle:{type:Object},dropdownClassName:String,dropdownMatchSelectWidth:{type:[Boolean,Number],default:void 0},dropdownRender:{type:Function},dropdownAlign:Object,placement:{type:String},getPopupContainer:{type:Function},showAction:{type:Array},onBlur:{type:Function},onFocus:{type:Function},onKeyup:Function,onKeydown:Function,onMousedown:Function,onPopupScroll:Function,onInputKeyDown:Function,onMouseenter:Function,onMouseleave:Function,onClick:Function}},baseSelectProps=function(){return _extends$1(_extends$1({},baseSelectPrivateProps()),baseSelectPropsWithoutPrivate())};function isMultiple(e){return"tags"===e||"multiple"===e}var BaseSelect=defineComponent({name:"BaseSelect",inheritAttrs:!1,props:initDefaultProps$1(baseSelectProps(),{showAction:[],notFoundContent:"Not Found"}),setup:function(e,t){var n=t.attrs,i=t.expose,o=t.slots,r=computed((function(){return isMultiple(e.mode)})),s=computed((function(){return void 0!==e.showSearch?e.showSearch:r.value||"combobox"===e.mode})),a=ref(!1);onMounted((function(){a.value=isMobile$2()}));var l=useInjectLegacySelectContext(),c=ref(null),d=createRef(),u=ref(null),h=ref(null),g=ref(null),p=_slicedToArray$2(useDelayReset(),3),f=p[0],m=p[1],v=p[2];i({focus:function(){var e;null===(e=h.value)||void 0===e||e.focus()},blur:function(){var e;null===(e=h.value)||void 0===e||e.blur()},scrollTo:function(e){var t;return null===(t=g.value)||void 0===t?void 0:t.scrollTo(e)}});var _=computed((function(){var t;if("combobox"!==e.mode)return e.searchValue;var n=null===(t=e.displayValues[0])||void 0===t?void 0:t.value;return"string"==typeof n||"number"==typeof n?String(n):""})),C=void 0!==e.open?e.open:e.defaultOpen,b=ref(C),y=ref(C),S=function(t){b.value=void 0!==e.open?e.open:t,y.value=b.value};watch((function(){return e.open}),(function(){S(e.open)}));var w=computed((function(){return!e.notFoundContent&&e.emptyOptions}));watchEffect((function(){y.value=b.value,(e.disabled||w.value&&y.value&&"combobox"===e.mode)&&(y.value=!1)}));var E=computed((function(){return!w.value&&y.value})),x=function(t){var n=void 0!==t?t:!y.value;b.value===n||e.disabled||(S(n),e.onDropdownVisibleChange&&e.onDropdownVisibleChange(n))},T=computed((function(){return(e.tokenSeparators||[]).some((function(e){return["\n","\r\n"].includes(e)}))})),I=function(t,n,i){var o,r,s=!0,a=t;null===(o=e.onActiveValueChange)||void 0===o||o.call(e,null);var l=i?null:getSeparatedContent(t,e.tokenSeparators);return"combobox"!==e.mode&&l&&(a="",null===(r=e.onSearchSplit)||void 0===r||r.call(e,l),x(!1),s=!1),e.onSearch&&_.value!==a&&e.onSearch(a,{source:n?"typing":"effect"}),s},k=function(t){var n;t&&t.trim()&&(null===(n=e.onSearch)||void 0===n||n.call(e,t,{source:"submit"}))};watch(y,(function(){y.value||r.value||"combobox"===e.mode||I("",!1,!1)}),{immediate:!0,flush:"post"}),watch((function(){return e.disabled}),(function(){b.value&&e.disabled&&S(!1)}),{immediate:!0});var L=_slicedToArray$2(useLock(),2),D=L[0],N=L[1],O=function(t){var n,i,o,s=D(),a=t.which;if(a===KeyCode$3.ENTER&&("combobox"!==e.mode&&t.preventDefault(),y.value||x(!0)),N(!!_.value),a===KeyCode$3.BACKSPACE&&!s&&r.value&&!_.value&&e.displayValues.length){for(var l=_toConsumableArray$2(e.displayValues),c=null,d=l.length-1;d>=0;d-=1){var u=l[d];if(!u.disabled){l.splice(d,1),c=u;break}}c&&e.onDisplayValuesChange(l,{type:"remove",values:[c]})}for(var h=arguments.length,p=new Array(h>1?h-1:0),f=1;f<h;f++)p[f-1]=arguments[f];y.value&&g.value&&(o=g.value).onKeydown.apply(o,[t].concat(p));null===(i=e.onKeydown)||void 0===i||(n=i).call.apply(n,[e,t].concat(p))},A=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];var r;y.value&&g.value&&(r=g.value).onKeyup.apply(r,[t].concat(i));e.onKeyup&&e.onKeyup.apply(e,[t].concat(i))},P=function(t){var n=e.displayValues.filter((function(e){return e!==t}));e.onDisplayValuesChange(n,{type:"remove",values:[t]})},R=ref(!1);provide("VCSelectContainerEvent",{focus:function(){m(!0),e.disabled||(e.onFocus&&!R.value&&e.onFocus.apply(e,arguments),e.showAction&&e.showAction.includes("focus")&&x(!0)),R.value=!0},blur:function(){if(m(!1,(function(){R.value=!1,x(!1)})),!e.disabled){var t=_.value;t&&("tags"===e.mode?e.onSearch(t,{source:"submit"}):"multiple"===e.mode&&e.onSearch("",{source:"blur"})),e.onBlur&&e.onBlur.apply(e,arguments)}}});var M=[];onMounted((function(){M.forEach((function(e){return clearTimeout(e)})),M.splice(0,M.length)})),onBeforeUnmount((function(){M.forEach((function(e){return clearTimeout(e)})),M.splice(0,M.length)}));var $=function(t){var n,i,o,r=t.target,s=null===(i=u.value)||void 0===i?void 0:i.getPopupElement();if(s&&s.contains(r)){var l=setTimeout((function(){var e,t=M.indexOf(l);-1!==t&&M.splice(t,1),v(),a.value||s.contains(document.activeElement)||null===(e=h.value)||void 0===e||e.focus()}));M.push(l)}for(var c=arguments.length,d=new Array(c>1?c-1:0),g=1;g<c;g++)d[g-1]=arguments[g];null===(o=e.onMousedown)||void 0===o||(n=o).call.apply(n,[e,t].concat(d))},F=ref(null),B=getCurrentInstance(),V=function(){B.update()};return onMounted((function(){watch(E,(function(){var e;if(E.value){var t=Math.ceil(null===(e=c.value)||void 0===e?void 0:e.offsetWidth);F.value===t||Number.isNaN(t)||(F.value=t)}}),{immediate:!0,flush:"post"})})),useSelectTriggerControl([c,u],E,x),useProvideBaseSelectProps(toReactive(_extends$1(_extends$1({},toRefs(e)),{open:y,triggerOpen:E,showSearch:s,multiple:r,toggleOpen:x}))),function(){var t,i=_extends$1(_extends$1({},e),n),a=i.prefixCls,p=i.id;i.open,i.defaultOpen;var m=i.mode;i.showSearch,i.searchValue,i.onSearch;var v=i.allowClear,C=i.clearIcon,b=i.showArrow,S=i.inputIcon,w=i.disabled,L=i.loading,D=i.getInputElement,N=i.getPopupContainer,R=i.placement,M=i.animation,B=i.transitionName,W=i.dropdownStyle,H=i.dropdownClassName,z=i.dropdownMatchSelectWidth,K=i.dropdownRender,j=i.dropdownAlign;i.showAction;var U=i.direction;i.tokenSeparators;var G=i.tagRender,q=i.optionLabelRender;i.onPopupScroll,i.onDropdownVisibleChange,i.onFocus,i.onBlur,i.onKeyup,i.onKeydown,i.onMousedown;var Y,X=i.onClear,Z=i.omitDomProps,Q=i.getRawInputElement,J=i.displayValues,ee=i.onDisplayValuesChange,te=i.emptyOptions,ne=i.activeDescendantId,ie=i.activeValue,oe=i.OptionList,re=__rest$y(i,["prefixCls","id","open","defaultOpen","mode","showSearch","searchValue","onSearch","allowClear","clearIcon","showArrow","inputIcon","disabled","loading","getInputElement","getPopupContainer","placement","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","showAction","direction","tokenSeparators","tagRender","optionLabelRender","onPopupScroll","onDropdownVisibleChange","onFocus","onBlur","onKeyup","onKeydown","onMousedown","onClear","omitDomProps","getRawInputElement","displayValues","onDisplayValuesChange","emptyOptions","activeDescendantId","activeValue","OptionList"]),se="combobox"===m&&D&&D()||null,ae="function"==typeof Q&&Q(),le=_extends$1({},re);ae&&(Y=function(e){x(e)}),DEFAULT_OMIT_PROPS.forEach((function(e){delete le[e]})),null==Z||Z.forEach((function(e){delete le[e]}));var ce,de,ue=void 0!==b?b:L||!r.value&&"combobox"!==m;ue&&(ce=createVNode(TransBtn$1,{class:classNames("".concat(a,"-arrow"),_defineProperty$P({},"".concat(a,"-arrow-loading"),L)),customizeIcon:S,customizeIconProps:{loading:L,searchValue:_.value,open:y.value,focused:f.value,showSearch:s.value}},null));!w&&v&&(J.length||_.value)&&(de=createVNode(TransBtn$1,{class:"".concat(a,"-clear"),onMousedown:function(){null==X||X(),ee([],{type:"clear",values:J}),I("",!1,!1)},customizeIcon:C},{default:function(){return[createTextVNode("×")]}}));var he=createVNode(oe,{ref:g},_extends$1(_extends$1({},l.customSlots),{option:o.option})),ge=classNames(a,n.class,(_defineProperty$P(t={},"".concat(a,"-focused"),f.value),_defineProperty$P(t,"".concat(a,"-multiple"),r.value),_defineProperty$P(t,"".concat(a,"-single"),!r.value),_defineProperty$P(t,"".concat(a,"-allow-clear"),v),_defineProperty$P(t,"".concat(a,"-show-arrow"),ue),_defineProperty$P(t,"".concat(a,"-disabled"),w),_defineProperty$P(t,"".concat(a,"-loading"),L),_defineProperty$P(t,"".concat(a,"-open"),y.value),_defineProperty$P(t,"".concat(a,"-customize-input"),se),_defineProperty$P(t,"".concat(a,"-show-search"),s.value),t)),pe=createVNode(SelectTrigger$1,{ref:u,disabled:w,prefixCls:a,visible:E.value,popupElement:he,containerWidth:F.value,animation:M,transitionName:B,dropdownStyle:W,dropdownClassName:H,direction:U,dropdownMatchSelectWidth:z,dropdownRender:K,dropdownAlign:j,placement:R,getPopupContainer:N,empty:te,getTriggerDOMNode:function(){return d.current},onPopupVisibleChange:Y,onPopupMouseEnter:V},{default:function(){return ae?isValidElement(ae)&&cloneElement(ae,{ref:d},!1,!0):createVNode(Selector$1,_objectSpread2$1(_objectSpread2$1({},e),{},{domRef:d,prefixCls:a,inputElement:se,ref:h,id:p,showSearch:s.value,mode:m,activeDescendantId:ne,tagRender:G,optionLabelRender:q,values:J,open:y.value,onToggleOpen:x,activeValue:ie,searchValue:_.value,onSearch:I,onSearchSubmit:k,onRemove:P,tokenWithEnter:T.value}),null)}});return ae?pe:createVNode("div",_objectSpread2$1(_objectSpread2$1({},le),{},{class:ge,ref:c,onMousedown:$,onKeydown:O,onKeyup:A}),[f.value&&!y.value&&createVNode("span",{style:{width:0,height:0,display:"flex",overflow:"hidden",opacity:0},"aria-live":"polite"},["".concat(J.map((function(e){var t=e.label,n=e.value;return["number","string"].includes(_typeof$3(t))?t:n})).join(", "))]),pe,ce,de])}}}),Filter=function(e,t){var n,i=e.height,o=e.offset,r=e.prefixCls,s=e.onInnerResize,a=t.slots,l={},c={display:"flex",flexDirection:"column"};return void 0!==o&&(l={height:"".concat(i,"px"),position:"relative",overflow:"hidden"},c=_extends$1(_extends$1({},c),{transform:"translateY(".concat(o,"px)"),position:"absolute",left:0,right:0,top:0})),createVNode("div",{style:l},[createVNode(ResizeObserver$1,{onResize:function(e){e.offsetHeight&&s&&s()}},{default:function(){return[createVNode("div",{style:c,class:classNames(_defineProperty$P({},"".concat(r,"-holder-inner"),r))},[null===(n=a.default)||void 0===n?void 0:n.call(a)])]}})])};Filter.displayName="Filter",Filter.inheritAttrs=!1,Filter.props={prefixCls:String,height:Number,offset:Number,onInnerResize:Function};var Filler=Filter,Item=function(e,t){var n,i=e.setRef,o=t.slots,r=flattenChildren(null===(n=o.default)||void 0===n?void 0:n.call(o));return r&&r.length?cloneVNode(r[0],{ref:i}):r};Item.props={setRef:{type:Function,default:function(){}}};var Item$1=Item,MIN_SIZE=20;function getPageY(e){return"touches"in e?e.touches[0].pageY:e.pageY}var ScrollBar=defineComponent({name:"ScrollBar",inheritAttrs:!1,props:{prefixCls:String,scrollTop:Number,scrollHeight:Number,height:Number,count:Number,onScroll:{type:Function},onStartMove:{type:Function},onStopMove:{type:Function}},setup:function(){return{moveRaf:null,scrollbarRef:createRef(),thumbRef:createRef(),visibleTimeout:null,state:reactive({dragging:!1,pageY:null,startTop:null,visible:!1})}},watch:{scrollTop:{handler:function(){this.delayHidden()},flush:"post"}},mounted:function(){var e,t;null===(e=this.scrollbarRef.current)||void 0===e||e.addEventListener("touchstart",this.onScrollbarTouchStart,!!supportsPassive$1&&{passive:!1}),null===(t=this.thumbRef.current)||void 0===t||t.addEventListener("touchstart",this.onMouseDown,!!supportsPassive$1&&{passive:!1})},beforeUnmount:function(){this.removeEvents(),clearTimeout(this.visibleTimeout)},methods:{delayHidden:function(){var e=this;clearTimeout(this.visibleTimeout),this.state.visible=!0,this.visibleTimeout=setTimeout((function(){e.state.visible=!1}),2e3)},onScrollbarTouchStart:function(e){e.preventDefault()},onContainerMouseDown:function(e){e.stopPropagation(),e.preventDefault()},patchEvents:function(){window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onMouseUp),this.thumbRef.current.addEventListener("touchmove",this.onMouseMove,!!supportsPassive$1&&{passive:!1}),this.thumbRef.current.addEventListener("touchend",this.onMouseUp)},removeEvents:function(){window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp),this.scrollbarRef.current.removeEventListener("touchstart",this.onScrollbarTouchStart,!!supportsPassive$1&&{passive:!1}),this.thumbRef.current.removeEventListener("touchstart",this.onMouseDown,!!supportsPassive$1&&{passive:!1}),this.thumbRef.current.removeEventListener("touchmove",this.onMouseMove,!!supportsPassive$1&&{passive:!1}),this.thumbRef.current.removeEventListener("touchend",this.onMouseUp),wrapperRaf.cancel(this.moveRaf)},onMouseDown:function(e){var t=this.$props.onStartMove;_extends$1(this.state,{dragging:!0,pageY:getPageY(e),startTop:this.getTop()}),t(),this.patchEvents(),e.stopPropagation(),e.preventDefault()},onMouseMove:function(e){var t=this.state,n=t.dragging,i=t.pageY,o=t.startTop,r=this.$props.onScroll;if(wrapperRaf.cancel(this.moveRaf),n){var s=o+(getPageY(e)-i),a=this.getEnableScrollRange(),l=this.getEnableHeightRange(),c=l?s/l:0,d=Math.ceil(c*a);this.moveRaf=wrapperRaf((function(){r(d)}))}},onMouseUp:function(){var e=this.$props.onStopMove;this.state.dragging=!1,e(),this.removeEvents()},getSpinHeight:function(){var e=this.$props,t=e.height,n=t/e.count*10;return n=Math.max(n,MIN_SIZE),n=Math.min(n,t/2),Math.floor(n)},getEnableScrollRange:function(){var e=this.$props;return e.scrollHeight-e.height||0},getEnableHeightRange:function(){return this.$props.height-this.getSpinHeight()||0},getTop:function(){var e=this.$props.scrollTop,t=this.getEnableScrollRange(),n=this.getEnableHeightRange();return 0===e||0===t?0:e/t*n},showScroll:function(){var e=this.$props,t=e.height;return e.scrollHeight>t}},render:function(){var e=this.state,t=e.dragging,n=e.visible,i=this.$props.prefixCls,o=this.getSpinHeight()+"px",r=this.getTop()+"px",s=this.showScroll(),a=s&&n;return createVNode("div",{ref:this.scrollbarRef,class:classNames("".concat(i,"-scrollbar"),_defineProperty$P({},"".concat(i,"-scrollbar-show"),s)),style:{width:"8px",top:0,bottom:0,right:0,position:"absolute",display:a?void 0:"none"},onMousedown:this.onContainerMouseDown,onMousemove:this.delayHidden},[createVNode("div",{ref:this.thumbRef,class:classNames("".concat(i,"-scrollbar-thumb"),_defineProperty$P({},"".concat(i,"-scrollbar-thumb-moving"),t)),style:{width:"100%",height:o,top:r,left:0,position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:"99px",cursor:"pointer",userSelect:"none"},onMousedown:this.onMouseDown},null)])}});function useHeights(e,t,n,i){var o=new Map,r=new Map,s=ref(Symbol("update"));watch(e,(function(){s.value=Symbol("update")}));var a=0;function l(){var e=a+=1;Promise.resolve().then((function(){e===a&&o.forEach((function(e,t){if(e&&e.offsetParent){var n=e.offsetHeight;r.get(t)!==n&&(s.value=Symbol("update"),r.set(t,e.offsetHeight))}}))}))}return[function(e,r){var s=t(e),a=o.get(s);r?(o.set(s,r.$el||r),l()):o.delete(s),!a!=!r&&(r?null==n||n(e):null==i||i(e))},l,r,s]}function useScrollTo(e,t,n,i,o,r,s,a){var l;return function(c){if(null!=c){wrapperRaf.cancel(l);var d=t.value,u=i.itemHeight;if("number"==typeof c)s(c);else if(c&&"object"===_typeof$3(c)){var h,g=c.align;h="index"in c?c.index:d.findIndex((function(e){return o(e)===c.key}));var p=c.offset,f=void 0===p?0:p;!function t(i,a){if(!(i<0)&&e.value){var c=e.value.clientHeight,p=!1,m=a;if(c){for(var v=a||g,_=0,C=0,b=0,y=Math.min(d.length,h),S=0;S<=y;S+=1){var w=o(d[S]);C=_;var E=n.get(w);_=b=C+(void 0===E?u:E),S===h&&void 0===E&&(p=!0)}var x=e.value.scrollTop,T=null;switch(v){case"top":T=C-f;break;case"bottom":T=b-c+f;break;default:C<x?m="top":b>x+c&&(m="bottom")}null!==T&&T!==x&&s(T)}l=wrapperRaf((function(){p&&r(),t(i-1,m)}))}}(5)}}else a()}}var isFF="object"===("undefined"==typeof navigator?"undefined":_typeof$3(navigator))&&/Firefox/i.test(navigator.userAgent),isFF$1=isFF,useOriginScroll=function(e,t){var n=!1,i=null;function o(){clearTimeout(i),n=!0,i=setTimeout((function(){n=!1}),50)}return function(r){var s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=r<0&&e.value||r>0&&t.value;return s&&a?(clearTimeout(i),n=!1):a&&!n||o(),!n&&a}};function useFrameWheel(e,t,n,i){var o=0,r=null,s=null,a=!1,l=useOriginScroll(t,n);return[function(t){if(e.value){wrapperRaf.cancel(r);var n=t.deltaY;o+=n,s=n,l(n)||(isFF$1||t.preventDefault(),r=wrapperRaf((function(){i(o*(a?10:1)),o=0})))}},function(t){e.value&&(a=t.detail===s)}]}var SMOOTH_PTG=14/15;function useMobileTouchMove(e,t,n){var i=!1,o=0,r=null,s=null,a=function(){r&&(r.removeEventListener("touchmove",l),r.removeEventListener("touchend",c))},l=function(e){if(i){var t=Math.ceil(e.touches[0].pageY),r=o-t;o=t,n(r)&&e.preventDefault(),clearInterval(s),s=setInterval((function(){(!n(r*=SMOOTH_PTG,!0)||Math.abs(r)<=.1)&&clearInterval(s)}),16)}},c=function(){i=!1,a()},d=function(e){a(),1!==e.touches.length||i||(i=!0,o=Math.ceil(e.touches[0].pageY),(r=e.target).addEventListener("touchmove",l,{passive:!1}),r.addEventListener("touchend",c))},u=function(){};onMounted((function(){document.addEventListener("touchmove",u,{passive:!1}),watch(e,(function(e){t.value.removeEventListener("touchstart",d),a(),clearInterval(s),e&&t.value.addEventListener("touchstart",d,{passive:!1})}),{immediate:!0})})),onBeforeUnmount((function(){document.removeEventListener("touchmove",u)}))}var __rest$x=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},EMPTY_DATA$1=[],ScrollStyle={overflowY:"auto",overflowAnchor:"none"};function renderChildren(e,t,n,i,o,r){var s=r.getKey;return e.slice(t,n+1).map((function(e,n){var r=o(e,t+n,{}),a=s(e);return createVNode(Item$1,{key:a,setRef:function(t){return i(e,t)}},{default:function(){return[r]}})}))}var List$1=defineComponent({name:"List",inheritAttrs:!1,props:{prefixCls:String,data:PropTypes$1.array,height:Number,itemHeight:Number,fullHeight:{type:Boolean,default:void 0},itemKey:{type:[String,Number,Function],required:!0},component:{type:[String,Object]},virtual:{type:Boolean,default:void 0},children:Function,onScroll:Function,onMousedown:Function,onMouseenter:Function,onVisibleChange:Function},setup:function(e,t){var n=t.expose,i=computed((function(){var t=e.height,n=e.itemHeight;return!(!1===e.virtual||!t||!n)})),o=computed((function(){var t=e.height,n=e.itemHeight,o=e.data;return i.value&&o&&n*o.length>t})),r=reactive({scrollTop:0,scrollMoving:!1}),s=computed((function(){return e.data||EMPTY_DATA$1})),a=shallowRef([]);watch(s,(function(){a.value=toRaw(s.value).slice()}),{immediate:!0});var l=shallowRef((function(e){}));watch((function(){return e.itemKey}),(function(e){l.value="function"==typeof e?e:function(t){return null==t?void 0:t[e]}}),{immediate:!0});var c=ref(),d=ref(),u=ref(),h=function(e){return l.value(e)},g={getKey:h};function p(e){var t=function(e){var t=e;Number.isNaN(S.value)||(t=Math.min(t,S.value));return t=Math.max(t,0)}("function"==typeof e?e(r.scrollTop):e);c.value&&(c.value.scrollTop=t),r.scrollTop=t}var f=_slicedToArray$2(useHeights(a,h,null,null),4),m=f[0],v=f[1],_=f[2],C=f[3],b=reactive({scrollHeight:void 0,start:0,end:0,offset:void 0}),y=ref(0);onMounted((function(){nextTick((function(){var e;y.value=(null===(e=d.value)||void 0===e?void 0:e.offsetHeight)||0}))})),onUpdated((function(){nextTick((function(){var e;y.value=(null===(e=d.value)||void 0===e?void 0:e.offsetHeight)||0}))})),watch([i,a],(function(){i.value||_extends$1(b,{scrollHeight:void 0,start:0,end:a.value.length-1,offset:void 0})}),{immediate:!0}),watch([i,a,y,o],(function(){i.value&&!o.value&&_extends$1(b,{scrollHeight:y.value,start:0,end:a.value.length-1,offset:void 0})}),{immediate:!0}),watch([o,i,function(){return r.scrollTop},a,C,function(){return e.height},y],(function(){if(i.value&&o.value){for(var t,n,s,l=0,c=a.value.length,d=a.value,u=r.scrollTop,g=e.itemHeight,p=u+e.height,f=0;f<c;f+=1){var m=d[f],v=h(m),C=_.get(v);void 0===C&&(C=g);var y=l+C;void 0===t&&y>=u&&(t=f,n=l),void 0===s&&y>p&&(s=f),l=y}void 0===t&&(t=0,n=0),void 0===s&&(s=c-1),s=Math.min(s+1,c),_extends$1(b,{scrollHeight:l,start:t,end:s,offset:n})}}),{immediate:!0});var S=computed((function(){return b.scrollHeight-e.height}));var w=computed((function(){return r.scrollTop<=0})),E=computed((function(){return r.scrollTop>=S.value})),x=useOriginScroll(w,E);var T=_slicedToArray$2(useFrameWheel(i,w,E,(function(e){p((function(t){return t+e}))})),2),I=T[0],k=T[1];function L(e){i.value&&e.preventDefault()}useMobileTouchMove(i,c,(function(e,t){return!x(e,t)&&(I({preventDefault:function(){},deltaY:e}),!0)}));var D=function(){c.value&&(c.value.removeEventListener("wheel",I,!!supportsPassive$1&&{passive:!1}),c.value.removeEventListener("DOMMouseScroll",k),c.value.removeEventListener("MozMousePixelScroll",L))};watchEffect((function(){nextTick((function(){c.value&&(D(),c.value.addEventListener("wheel",I,!!supportsPassive$1&&{passive:!1}),c.value.addEventListener("DOMMouseScroll",k),c.value.addEventListener("MozMousePixelScroll",L))}))})),onBeforeUnmount((function(){D()})),n({scrollTo:useScrollTo(c,a,_,e,h,v,p,(function(){var e;null===(e=u.value)||void 0===e||e.delayHidden()}))});var N=computed((function(){var t=null;return e.height&&(t=_extends$1(_defineProperty$P({},e.fullHeight?"height":"maxHeight",e.height+"px"),ScrollStyle),i.value&&(t.overflowY="hidden",r.scrollMoving&&(t.pointerEvents="none"))),t}));return watch([function(){return b.start},function(){return b.end},a],(function(){if(e.onVisibleChange){var t=a.value.slice(b.start,b.end+1);e.onVisibleChange(t,a.value)}}),{flush:"post"}),{state:r,mergedData:a,componentStyle:N,onFallbackScroll:function(t){var n,i=t.currentTarget.scrollTop;Math.abs(i-r.scrollTop)>=1&&p(i),null===(n=e.onScroll)||void 0===n||n.call(e,t)},onScrollBar:function(e){p(e)},componentRef:c,useVirtual:i,calRes:b,collectHeight:v,setInstance:m,sharedConfig:g,scrollBarRef:u,fillerInnerRef:d}},render:function(){var e=this,t=_extends$1(_extends$1({},this.$props),this.$attrs),n=t.prefixCls,i=void 0===n?"rc-virtual-list":n,o=t.height;t.itemHeight,t.fullHeight,t.data,t.itemKey,t.virtual;var r=t.component,s=void 0===r?"div":r;t.onScroll;var a=t.children,l=void 0===a?this.$slots.default:a,c=t.style,d=t.class,u=__rest$x(t,["prefixCls","height","itemHeight","fullHeight","data","itemKey","virtual","component","onScroll","children","style","class"]),h=classNames(i,d),g=this.state.scrollTop,p=this.calRes,f=p.scrollHeight,m=p.offset,v=p.start,_=p.end,C=this.componentStyle,b=this.onFallbackScroll,y=this.onScrollBar,S=this.useVirtual,w=this.collectHeight,E=this.sharedConfig,x=this.setInstance,T=this.mergedData;return createVNode("div",_objectSpread2$1({style:_extends$1(_extends$1({},c),{position:"relative"}),class:h},u),[createVNode(s,{class:"".concat(i,"-holder"),style:C,ref:"componentRef",onScroll:b},{default:function(){return[createVNode(Filler,{prefixCls:i,height:f,offset:m,onInnerResize:w,ref:"fillerInnerRef"},{default:function(){return renderChildren(T,v,_,x,l,E)}})]}}),S&&createVNode(ScrollBar,{ref:"scrollBarRef",prefixCls:i,scrollTop:g,height:o,scrollHeight:f,count:T.length,onScroll:y,onStartMove:function(){e.state.scrollMoving=!0},onStopMove:function(){e.state.scrollMoving=!1}},null)])}}),List$2=List$1;function useMemo(e,t,n){var i=ref(e());return watch(t,(function(t,o){n?n(t,o)&&(i.value=e()):i.value=e()})),i}function isPlatformMac(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var SelectContextKey=Symbol("SelectContextKey");function useProvideSelectProps(e){return provide(SelectContextKey,e)}function useSelectProps(){return inject(SelectContextKey,{})}var __rest$w=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function isTitleType(e){return"string"==typeof e||"number"==typeof e}var OptionList$1=defineComponent({name:"OptionList",inheritAttrs:!1,slots:["option"],setup:function(e,t){var n=t.expose,i=t.slots,o=useBaseProps(),r=useSelectProps(),s=computed((function(){return"".concat(o.prefixCls,"-item")})),a=useMemo((function(){return r.flattenOptions}),[function(){return o.open},function(){return r.flattenOptions}],(function(e){return e[0]})),l=createRef(),c=function(e){e.preventDefault()},d=function(e){l.current&&l.current.scrollTo("number"==typeof e?{index:e}:e)},u=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=a.value.length,i=0;i<n;i+=1){var o=(e+i*t+n)%n,r=a.value[o],s=r.group,l=r.data;if(!s&&!l.disabled)return o}return-1},h=reactive({activeIndex:u(0)}),g=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];h.activeIndex=e;var n={source:t?"keyboard":"mouse"},i=a.value[e];i?r.onActiveValue(i.value,e,n):r.onActiveValue(null,-1,n)};watch([function(){return a.value.length},function(){return o.searchValue}],(function(){g(!1!==r.defaultActiveFirstOption?u(0):-1)}),{immediate:!0});var p=function(e){return r.rawValues.has(e)&&"combobox"!==o.mode};watch([function(){return o.open},function(){return o.searchValue}],(function(){if(!o.multiple&&o.open&&1===r.rawValues.size){var e=Array.from(r.rawValues)[0],t=toRaw(a.value).findIndex((function(t){return t.data[r.fieldNames.value]===e}));-1!==t&&(g(t),nextTick((function(){d(t)})))}o.open&&nextTick((function(){var e;null===(e=l.current)||void 0===e||e.scrollTo(void 0)}))}),{immediate:!0,flush:"post"});var f=function(e){void 0!==e&&r.onSelect(e,{selected:!r.rawValues.has(e)}),o.multiple||o.toggleOpen(!1)},m=function(e){return"function"==typeof e.label?e.label():e.label};function v(e){var t=a.value[e];if(!t)return null;var n=t.data||{},i=n.value,r=t.group,s=pickAttrs(n,!0),l=m(t);return t?createVNode("div",_objectSpread2$1(_objectSpread2$1({"aria-label":"string"!=typeof l||r?null:l},s),{},{key:e,role:r?"presentation":"option",id:"".concat(o.id,"_list_").concat(e),"aria-selected":p(i)}),[i]):null}return n({onKeydown:function(e){var t=e.which,n=e.ctrlKey;switch(t){case KeyCode$3.N:case KeyCode$3.P:case KeyCode$3.UP:case KeyCode$3.DOWN:var i=0;if(t===KeyCode$3.UP?i=-1:t===KeyCode$3.DOWN?i=1:isPlatformMac()&&n&&(t===KeyCode$3.N?i=1:t===KeyCode$3.P&&(i=-1)),0!==i){var r=u(h.activeIndex+i,i);d(r),g(r,!0)}break;case KeyCode$3.ENTER:var s=a.value[h.activeIndex];s&&!s.data.disabled?f(s.value):f(void 0),o.open&&e.preventDefault();break;case KeyCode$3.ESC:o.toggleOpen(!1),o.open&&e.stopPropagation()}},onKeyup:function(){},scrollTo:function(e){d(e)}}),function(){var e=o.id,t=o.notFoundContent,n=o.onPopupScroll,d=r.menuItemSelectedIcon,u=r.fieldNames,_=r.virtual,C=r.listHeight,b=r.listItemHeight,y=i.option,S=h.activeIndex,w=Object.keys(u).map((function(e){return u[e]}));return 0===a.value.length?createVNode("div",{role:"listbox",id:"".concat(e,"_list"),class:"".concat(s.value,"-empty"),onMousedown:c},[t]):createVNode(Fragment,null,[createVNode("div",{role:"listbox",id:"".concat(e,"_list"),style:{height:0,width:0,overflow:"hidden"}},[v(S-1),v(S),v(S+1)]),createVNode(List$2,{itemKey:"key",ref:l,data:a.value,height:C,itemHeight:b,fullHeight:!1,onMousedown:c,onScroll:n,virtual:_},{default:function(e,t){var n,i,o=e.group,r=e.groupOption,a=e.data,l=e.value,c=a.key,u="function"==typeof e.label?e.label():e.label;if(o){var h=null!==(i=a.title)&&void 0!==i?i:isTitleType(u)&&u;return createVNode("div",{class:classNames(s.value,"".concat(s.value,"-group")),title:h},[y?y(a):void 0!==u?u:c])}var v=a.disabled,_=a.title;a.children;var C=a.style,b=a.class,E=a.className,x=__rest$w(a,["disabled","title","children","style","class","className"]),T=omit$2(x,w),I=p(l),k="".concat(s.value,"-option"),L=classNames(s.value,k,b,E,(_defineProperty$P(n={},"".concat(k,"-grouped"),r),_defineProperty$P(n,"".concat(k,"-active"),S===t&&!v),_defineProperty$P(n,"".concat(k,"-disabled"),v),_defineProperty$P(n,"".concat(k,"-selected"),I),n)),D=m(e),N=!d||"function"==typeof d||I,O="number"==typeof D?D:D||l,A=isTitleType(O)?O.toString():void 0;return void 0!==_&&(A=_),createVNode("div",_objectSpread2$1(_objectSpread2$1({},T),{},{"aria-selected":I,class:L,title:A,onMousemove:function(e){x.onMousemove&&x.onMousemove(e),S===t||v||g(t)},onClick:function(e){v||f(l),x.onClick&&x.onClick(e)},style:C}),[createVNode("div",{class:"".concat(k,"-content")},[y?y(a):O]),isValidElement(d)||I,N&&createVNode(TransBtn$1,{class:"".concat(s.value,"-option-state"),customizeIcon:d,customizeIconProps:{isSelected:I}},{default:function(){return[I?"✓":null]}})])}})])}}}),OptionList$2=OptionList$1,__rest$v=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function convertNodeToOption(e){var t=e,n=t.key,i=t.children,o=t.props,r=o.value,s=o.disabled,a=__rest$v(o,["value","disabled"]);return _extends$1({key:n,value:void 0!==r?r:n,children:null==i?void 0:i.default,disabled:s||""===s},a)}function convertChildrenToData$1(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=flattenChildren(e).map((function(e,n){var i;if(!isValidElement(e)||!e.type)return null;var o=e.type.isSelectOptGroup,r=e.key,s=e.children,a=e.props;if(t||!o)return convertNodeToOption(e);var l=s&&s.default?s.default():void 0,c=(null==a?void 0:a.label)||(null===(i=s.label)||void 0===i?void 0:i.call(s))||r;return _extends$1(_extends$1({key:"__RC_SELECT_GRP__".concat(null===r?n:String(r),"__")},a),{label:c,options:convertChildrenToData$1(l||[])})})).filter((function(e){return e}));return n}function useOptions(e,t,n){var i=shallowRef(),o=shallowRef(),r=shallowRef(),s=shallowRef([]);return watch([e,t],(function(){e.value?s.value=toRaw(e.value).slice():s.value=convertChildrenToData$1(t.value)}),{immediate:!0,deep:!0}),watchEffect((function(){var e=s.value,t=new Map,a=new Map,l=n.value;!function e(n){for(var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=0;o<n.length;o+=1){var r=n[o];!r[l.options]||i?(t.set(r[l.value],r),a.set(r[l.label],r)):e(r[l.options],!0)}}(e),i.value=e,o.value=t,r.value=a})),{options:i,valueOptions:o,labelOptions:r}}var uuid$3=0,isBrowserClient=canUseDom();function getUUID$1(){var e;return isBrowserClient?(e=uuid$3,uuid$3+=1):e="TEST_OR_SSR",e}function useId(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ref(""),t="rc_select_".concat(getUUID$1());return e.value||t}function toArray$6(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}function includes(e,t){return toArray$6(e).join("").toUpperCase().includes(t)}var useFilterOptions=function(e,t,n,i,o){return computed((function(){var r=n.value,s=null==o?void 0:o.value,a=null==i?void 0:i.value;if(!r||!1===a)return e.value;var l=t.value,c=l.options,d=l.label,u=l.value,h=[],g="function"==typeof a,p=r.toUpperCase(),f=g?a:function(e,t){return s?includes(t[s],p):t[c]?includes(t["children"!==d?d:"label"],p):includes(t[u],p)},m=g?function(e){return injectPropsWithOption(e)}:function(e){return e};return e.value.forEach((function(e){if(e[c])if(f(r,m(e)))h.push(e);else{var t=e[c].filter((function(e){return f(r,m(e))}));t.length&&h.push(_extends$1(_extends$1({},e),_defineProperty$P({},c,t)))}else f(r,m(e))&&h.push(e)})),h}))},useCache$1=function(e,t){var n=shallowRef({values:new Map,options:new Map});return[computed((function(){var i=n.value,o=i.values,r=i.options,s=e.value.map((function(e){var t;return void 0===e.label?_extends$1(_extends$1({},e),{label:null===(t=o.get(e.value))||void 0===t?void 0:t.label}):e})),a=new Map,l=new Map;return s.forEach((function(e){a.set(e.value,e),l.set(e.value,t.value.get(e.value)||r.get(e.value))})),n.value.values=a,n.value.options=l,s})),function(e){return t.value.get(e)||n.value.options.get(e)}]};function useMergedState(e,t){var n=t||{},i=n.defaultValue,o=n.value,r=void 0===o?ref():o,s="function"==typeof e?e():e;void 0!==r.value&&(s=unref(r)),void 0!==i&&(s="function"==typeof i?i():i);var a=ref(s),l=ref(s);return watchEffect((function(){var e=void 0!==r.value?r.value:a.value;t.postState&&(e=t.postState(e)),l.value=e})),watch(r,(function(){a.value=r.value})),[l,function(e){var n=l.value;a.value=e,toRaw(l.value)!==e&&t.onChange&&t.onChange(e,n)}]}function useState(e){var t=ref("function"==typeof e?e():e);return[t,function(e){t.value=e}]}var OMIT_DOM_PROPS=["inputValue"];function selectProps$1(){return _extends$1(_extends$1({},baseSelectPropsWithoutPrivate()),{prefixCls:String,id:String,backfill:{type:Boolean,default:void 0},fieldNames:Object,inputValue:String,searchValue:String,onSearch:Function,autoClearSearchValue:{type:Boolean,default:void 0},onSelect:Function,onDeselect:Function,filterOption:{type:[Boolean,Function],default:void 0},filterSort:Function,optionFilterProp:String,optionLabelProp:String,options:Array,defaultActiveFirstOption:{type:Boolean,default:void 0},virtual:{type:Boolean,default:void 0},listHeight:Number,listItemHeight:Number,menuItemSelectedIcon:PropTypes$1.any,mode:String,labelInValue:{type:Boolean,default:void 0},value:PropTypes$1.any,defaultValue:PropTypes$1.any,onChange:Function,children:Array})}function isRawValue$1(e){return!e||"object"!==_typeof$3(e)}var Select$1=defineComponent({name:"Select",inheritAttrs:!1,props:initDefaultProps$1(selectProps$1(),{prefixCls:"vc-select",autoClearSearchValue:!0,listHeight:200,listItemHeight:20,dropdownMatchSelectWidth:!0}),setup:function(e,t){var n=t.expose,i=t.attrs,o=t.slots,r=useId(toRef(e,"id")),s=computed((function(){return isMultiple(e.mode)})),a=computed((function(){return!(e.options||!e.children)})),l=computed((function(){return(void 0!==e.filterOption||"combobox"!==e.mode)&&e.filterOption})),c=computed((function(){return fillFieldNames$2(e.fieldNames,a.value)})),d=_slicedToArray$2(useMergedState("",{value:computed((function(){return void 0!==e.searchValue?e.searchValue:e.inputValue})),postState:function(e){return e||""}}),2),u=d[0],h=d[1],g=useOptions(toRef(e,"options"),toRef(e,"children"),c),p=g.valueOptions,f=g.labelOptions,m=g.options,v=function(t){return toArray$6(t).map((function(t){var n,i,o,r,s,a;isRawValue$1(t)?o=t:(s=t.key,r=t.label,o=null!==(n=t.value)&&void 0!==n?n:s);var l=p.value.get(o);return l&&(void 0===r&&(r=null==l?void 0:l[e.optionLabelProp||c.value.label]),void 0===s&&(s=null!==(i=null==l?void 0:l.key)&&void 0!==i?i:o),a=null==l?void 0:l.disabled),{label:r,value:o,key:s,disabled:a,option:l}}))},_=_slicedToArray$2(useMergedState(e.defaultValue,{value:toRef(e,"value")}),2),C=_[0],b=_[1],y=computed((function(){var t,n=v(C.value);return"combobox"!==e.mode||(null===(t=n[0])||void 0===t?void 0:t.value)?n:[]})),S=_slicedToArray$2(useCache$1(y,p),2),w=S[0],E=S[1],x=computed((function(){if(!e.mode&&1===w.value.length){var t=w.value[0];if(null===t.value&&(null===t.label||void 0===t.label))return[]}return w.value.map((function(e){var t;return _extends$1(_extends$1({},e),{label:null!==(t="function"==typeof e.label?e.label():e.label)&&void 0!==t?t:e.value})}))})),T=computed((function(){return new Set(w.value.map((function(e){return e.value})))}));watchEffect((function(){var t;if("combobox"===e.mode){var n=null===(t=w.value[0])||void 0===t?void 0:t.value;null!=n&&h(String(n))}}),{flush:"post"});var I=function(e,t){var n,i=null!=t?t:e;return _defineProperty$P(n={},c.value.value,e),_defineProperty$P(n,c.value.label,i),n},k=shallowRef();watchEffect((function(){if("tags"===e.mode){var t=m.value.slice();_toConsumableArray$2(w.value).sort((function(e,t){return e.value<t.value?-1:1})).forEach((function(e){var n=e.value;(function(e){return p.value.has(e)})(n)||t.push(I(n,e.label))})),k.value=t}else k.value=m.value}));var L=useFilterOptions(k,c,u,l,toRef(e,"optionFilterProp")),D=computed((function(){return"tags"!==e.mode||!u.value||L.value.some((function(t){return t[e.optionFilterProp||"value"]===u.value}))?L.value:[I(u.value)].concat(_toConsumableArray$2(L.value))})),N=computed((function(){return e.filterSort?_toConsumableArray$2(D.value).sort((function(t,n){return e.filterSort(t,n)})):D.value})),O=computed((function(){return flattenOptions(N.value,{fieldNames:c.value,childrenAsData:a.value})})),A=function(t){var n=v(t);if(b(n),e.onChange&&(n.length!==w.value.length||n.some((function(e,t){var n;return(null===(n=w.value[t])||void 0===n?void 0:n.value)!==(null==e?void 0:e.value)})))){var i=e.labelInValue?n.map((function(e){return _extends$1(_extends$1({},e),{originLabel:e.label,label:"function"==typeof e.label?e.label():e.label})})):n.map((function(e){return e.value})),o=n.map((function(e){return injectPropsWithOption(E(e.value))}));e.onChange(s.value?i:i[0],s.value?o:o[0])}},P=_slicedToArray$2(useState(null),2),R=P[0],M=P[1],$=_slicedToArray$2(useState(0),2),F=$[0],B=$[1],V=computed((function(){return void 0!==e.defaultActiveFirstOption?e.defaultActiveFirstOption:"combobox"!==e.mode})),W=function(t,n){var i=function(){var n,i=E(t),o=null==i?void 0:i[c.value.label];return[e.labelInValue?{label:"function"==typeof o?o():o,originLabel:o,value:t,key:null!==(n=null==i?void 0:i.key)&&void 0!==n?n:t}:t,injectPropsWithOption(i)]};if(n&&e.onSelect){var o=_slicedToArray$2(i(),2),r=o[0],s=o[1];e.onSelect(r,s)}else if(!n&&e.onDeselect){var a=_slicedToArray$2(i(),2),l=a[0],d=a[1];e.onDeselect(l,d)}},H=function(e,t){A(e),"remove"!==t.type&&"clear"!==t.type||t.values.forEach((function(e){W(e.value,!1)}))},z=function(t,n){var i;if(h(t),M(null),"submit"!==n.source)"blur"!==n.source&&("combobox"===e.mode&&A(t),null===(i=e.onSearch)||void 0===i||i.call(e,t));else{var o=(t||"").trim();if(o){var r=Array.from(new Set([].concat(_toConsumableArray$2(T.value),[o])));A(r),W(o,!0),h("")}}},K=function(t){var n=t;"tags"!==e.mode&&(n=t.map((function(e){var t=f.value.get(e);return null==t?void 0:t.value})).filter((function(e){return void 0!==e})));var i=Array.from(new Set([].concat(_toConsumableArray$2(T.value),_toConsumableArray$2(n))));A(i),i.forEach((function(e){W(e,!0)}))},j=computed((function(){return!1!==e.virtual&&!1!==e.dropdownMatchSelectWidth}));useProvideSelectProps(toReactive(_extends$1(_extends$1({},g),{flattenOptions:O,onActiveValue:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.source,r=void 0===o?"keyboard":o;B(n),e.backfill&&"combobox"===e.mode&&null!==t&&"keyboard"===r&&M(String(t))},defaultActiveFirstOption:V,onSelect:function(t,n){var i,o=!s.value||n.selected;i=o?s.value?[].concat(_toConsumableArray$2(w.value),[t]):[t]:w.value.filter((function(e){return e.value!==t})),A(i),W(t,o),"combobox"===e.mode?M(""):s.value&&!e.autoClearSearchValue||(h(""),M(""))},menuItemSelectedIcon:toRef(e,"menuItemSelectedIcon"),rawValues:T,fieldNames:c,virtual:j,listHeight:toRef(e,"listHeight"),listItemHeight:toRef(e,"listItemHeight"),childrenAsData:a})));var U=ref();n({focus:function(){var e;null===(e=U.value)||void 0===e||e.focus()},blur:function(){var e;null===(e=U.value)||void 0===e||e.blur()},scrollTo:function(e){var t;null===(t=U.value)||void 0===t||t.scrollTo(e)}});var G=computed((function(){return omit$2(e,["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"])}));return function(){return createVNode(BaseSelect,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},G.value),i),{},{id:r,prefixCls:e.prefixCls,ref:U,omitDomProps:OMIT_DOM_PROPS,mode:e.mode,displayValues:x.value,onDisplayValuesChange:H,searchValue:u.value,onSearch:z,onSearchSplit:K,dropdownMatchSelectWidth:e.dropdownMatchSelectWidth,OptionList:OptionList$2,emptyOptions:!O.value.length,activeValue:R.value,activeDescendantId:"".concat(r,"_list_").concat(F.value)}),o)}}}),Option$2=function(){return null};Option$2.isSelectOption=!0,Option$2.displayName="ASelectOption";var Option$3=Option$2,OptGroup$2=function(){return null};OptGroup$2.isSelectOptGroup=!0,OptGroup$2.displayName="ASelectOptGroup";var OptGroup$3=OptGroup$2,DownOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},DownOutlinedSvg=DownOutlined$2;function _objectSpread$A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$A(e,t,n[t])}))}return e}function _defineProperty$A(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var DownOutlined=function(e,t){var n=_objectSpread$A({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$A({},n,{icon:DownOutlinedSvg}),null)};DownOutlined.displayName="DownOutlined",DownOutlined.inheritAttrs=!1;var DownOutlined$1=DownOutlined,CheckOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},CheckOutlinedSvg=CheckOutlined$2;function _objectSpread$z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$z(e,t,n[t])}))}return e}function _defineProperty$z(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var CheckOutlined=function(e,t){var n=_objectSpread$z({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$z({},n,{icon:CheckOutlinedSvg}),null)};CheckOutlined.displayName="CheckOutlined",CheckOutlined.inheritAttrs=!1;var CheckOutlined$1=CheckOutlined,SearchOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},SearchOutlinedSvg=SearchOutlined$2;function _objectSpread$y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$y(e,t,n[t])}))}return e}function _defineProperty$y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var SearchOutlined=function(e,t){var n=_objectSpread$y({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$y({},n,{icon:SearchOutlinedSvg}),null)};SearchOutlined.displayName="SearchOutlined",SearchOutlined.inheritAttrs=!1;var SearchOutlined$1=SearchOutlined;function getIcons(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.loading,i=e.multiple,o=e.prefixCls,r=e.suffixIcon||t.suffixIcon&&t.suffixIcon(),s=e.clearIcon||t.clearIcon&&t.clearIcon(),a=e.menuItemSelectedIcon||t.menuItemSelectedIcon&&t.menuItemSelectedIcon(),l=e.removeIcon||t.removeIcon&&t.removeIcon(),c=s;s||(c=createVNode(CloseCircleFilled$1,null,null));var d=null;if(void 0!==r)d=r;else if(n)d=createVNode(LoadingOutlined$1,{spin:!0},null);else{var u="".concat(o,"-suffix");d=function(e){var t=e.open,n=e.showSearch;return createVNode(t&&n?SearchOutlined$1:DownOutlined$1,{class:u},null)}}return{clearIcon:c,suffixIcon:d,itemIcon:void 0!==a?a:i?createVNode(CheckOutlined$1,null,null):null,removeIcon:void 0!==l?l:createVNode(CloseOutlined$1,null,null)}}var ContextKey$2=Symbol("ContextProps"),InternalContextKey=Symbol("InternalContextProps"),useProvideFormItemContext=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:computed((function(){return!0})),n=ref(new Map),i=function(e,t){n.value.set(e,t),n.value=new Map(n.value)},o=function(e){n.value.delete(e),n.value=new Map(n.value)};watch([t,n],(function(){})),provide(ContextKey$2,e),provide(InternalContextKey,{addFormItemField:i,removeFormItemField:o})},defaultContext={id:computed((function(){})),onFieldBlur:function(){},onFieldChange:function(){},clearValidate:function(){}},defaultInternalContext={addFormItemField:function(){},removeFormItemField:function(){}},useInjectFormItemContext=function(){var e=inject(InternalContextKey,defaultInternalContext),t=Symbol("FormItemFieldKey"),n=getCurrentInstance();return e.addFormItemField(t,n.type),onBeforeUnmount((function(){e.removeFormItemField(t)})),provide(InternalContextKey,defaultInternalContext),provide(ContextKey$2,defaultContext),inject(ContextKey$2,defaultContext)},FormItemRest=defineComponent({name:"AFormItemRest",setup:function(e,t){var n=t.slots;return provide(InternalContextKey,defaultInternalContext),provide(ContextKey$2,defaultContext),function(){var e;return null===(e=n.default)||void 0===e?void 0:e.call(n)}}}),selectProps=function(){return _extends$1(_extends$1({},omit$2(selectProps$1(),["inputIcon","mode","getInputElement","getRawInputElement","backfill"])),{value:{type:[Array,Object,String,Number]},defaultValue:{type:[Array,Object,String,Number]},notFoundContent:PropTypes$1.any,suffixIcon:PropTypes$1.any,itemIcon:PropTypes$1.any,size:String,mode:String,bordered:{type:Boolean,default:!0},transitionName:String,choiceTransitionName:{type:String,default:""},"onUpdate:value":Function})},SECRET_COMBOBOX_MODE_DO_NOT_USE="SECRET_COMBOBOX_MODE_DO_NOT_USE",Select=defineComponent({name:"ASelect",Option:Option$3,OptGroup:OptGroup$3,inheritAttrs:!1,props:initDefaultProps$1(selectProps(),{listHeight:256,listItemHeight:24}),SECRET_COMBOBOX_MODE_DO_NOT_USE:SECRET_COMBOBOX_MODE_DO_NOT_USE,slots:["notFoundContent","suffixIcon","itemIcon","removeIcon","clearIcon","dropdownRender","option","placeholder","tagRender","maxTagPlaceholder","optionLabel"],setup:function(e,t){var n=t.attrs,i=t.emit,o=t.slots,r=t.expose,s=ref(),a=useInjectFormItemContext(),l=computed((function(){var t=e.mode;if("combobox"!==t)return t===SECRET_COMBOBOX_MODE_DO_NOT_USE?"combobox":t})),c=useConfigInject("select",e),d=c.prefixCls,u=c.direction,h=c.configProvider,g=c.size,p=c.getPrefixCls,f=computed((function(){return p()})),m=computed((function(){return getTransitionName$2(f.value,"slide-up",e.transitionName)})),v=computed((function(){var t;return classNames((_defineProperty$P(t={},"".concat(d.value,"-lg"),"large"===g.value),_defineProperty$P(t,"".concat(d.value,"-sm"),"small"===g.value),_defineProperty$P(t,"".concat(d.value,"-rtl"),"rtl"===u.value),_defineProperty$P(t,"".concat(d.value,"-borderless"),!e.bordered),t))})),_=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];i("update:value",t[0]),i.apply(void 0,["change"].concat(t)),a.onFieldChange()},C=function(e){i("blur",e),a.onFieldBlur()};r({blur:function(){var e;null===(e=s.value)||void 0===e||e.blur()},focus:function(){var e;null===(e=s.value)||void 0===e||e.focus()},scrollTo:function(e){var t;null===(t=s.value)||void 0===t||t.scrollTo(e)}});var b=computed((function(){return"multiple"===l.value||"tags"===l.value}));return function(){var t,i,r,c=e.notFoundContent,g=e.listHeight,p=void 0===g?256:g,f=e.listItemHeight,y=void 0===f?24:f,S=e.getPopupContainer,w=e.dropdownClassName,E=e.virtual,x=e.dropdownMatchSelectWidth,T=e.id,I=void 0===T?a.id.value:T,k=e.placeholder,L=void 0===k?null===(t=o.placeholder)||void 0===t?void 0:t.call(o):k,D=h.renderEmpty,N=h.getPopupContainer;r=void 0!==c?c:o.notFoundContent?o.notFoundContent():"combobox"===l.value?null:D("Select");var O=getIcons(_extends$1(_extends$1({},e),{multiple:b.value,prefixCls:d.value}),o),A=O.suffixIcon,P=O.itemIcon,R=O.removeIcon,M=O.clearIcon,$=omit$2(e,["prefixCls","suffixIcon","itemIcon","removeIcon","clearIcon","size","bordered"]),F=classNames(w,_defineProperty$P({},"".concat(d.value,"-dropdown-").concat(u.value),"rtl"===u.value));return createVNode(Select$1,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({ref:s,virtual:E,dropdownMatchSelectWidth:x},$),n),{},{placeholder:L,listHeight:p,listItemHeight:y,mode:l.value,prefixCls:d.value,direction:u.value,inputIcon:A,menuItemSelectedIcon:P,removeIcon:R,clearIcon:M,notFoundContent:r,class:[v.value,n.class],getPopupContainer:S||N,dropdownClassName:F,onChange:_,onBlur:C,id:I,dropdownRender:$.dropdownRender||o.dropdownRender,transitionName:m.value,children:null===(i=o.default)||void 0===i?void 0:i.call(o),tagRender:e.tagRender||o.tagRender,optionLabelRender:o.optionLabel,maxTagPlaceholder:e.maxTagPlaceholder||o.maxTagPlaceholder}),{option:o.option})}}});Select.install=function(e){return e.component(Select.name,Select),e.component(Select.Option.displayName,Select.Option),e.component(Select.OptGroup.displayName,Select.OptGroup),e};var SelectOption=Select.Option,SelectOptGroup=Select.OptGroup,__unplugin_components_3=Select,Option=function(){return null};Option.isSelectOption=!0,Option.displayName="AAutoCompleteOption";var Option$1=Option,OptGroup=function(){return null};OptGroup.isSelectOptGroup=!0,OptGroup.displayName="AAutoCompleteOptGroup";var OptGroup$1=OptGroup;function isSelectOptionOrSelectOptGroup(e){var t,n;return(null===(t=null==e?void 0:e.type)||void 0===t?void 0:t.isSelectOption)||(null===(n=null==e?void 0:e.type)||void 0===n?void 0:n.isSelectOptGroup)}var autoCompleteProps=function(){return _extends$1(_extends$1({},omit$2(selectProps(),["loading","mode","optionLabelProp","labelInValue"])),{dataSource:Array,dropdownMenuStyle:{type:Object,default:void 0},dropdownMatchSelectWidth:{type:[Number,Boolean],default:!0},prefixCls:String,showSearch:{type:Boolean,default:void 0},transitionName:String,choiceTransitionName:{type:String,default:"zoom"},autofocus:{type:Boolean,default:void 0},backfill:{type:Boolean,default:void 0},filterOption:{type:[Boolean,Function],default:!1},defaultActiveFirstOption:{type:Boolean,default:!0}})},AutoComplete=defineComponent({name:"AAutoComplete",inheritAttrs:!1,props:autoCompleteProps(),slots:["option"],setup:function(e,t){var n=t.slots,i=t.attrs,o=t.expose;warning$2(!("dataSource"in n),"AutoComplete","`dataSource` slot is deprecated, please use props `options` instead."),warning$2(!("options"in n),"AutoComplete","`options` slot is deprecated, please use props `options` instead.");var r=ref(),s=function(){var e,t=flattenChildren(null===(e=n.default)||void 0===e?void 0:e.call(n));return t.length?t[0]:void 0};o({focus:function(){var e;null===(e=r.value)||void 0===e||e.focus()},blur:function(){var e;null===(e=r.value)||void 0===e||e.blur()}});var a=useConfigInject("select",e).prefixCls;return function(){var t,o,l,c,d,u=e.size,h=e.dataSource,g=e.notFoundContent,p=void 0===g?null===(o=n.notFoundContent)||void 0===o?void 0:o.call(n):g,f=i.class,m=(_defineProperty$P(t={},f,!!f),_defineProperty$P(t,"".concat(a.value,"-lg"),"large"===u),_defineProperty$P(t,"".concat(a.value,"-sm"),"small"===u),_defineProperty$P(t,"".concat(a.value,"-show-search"),!0),_defineProperty$P(t,"".concat(a.value,"-auto-complete"),!0),t);if(void 0===e.options){var v=(null===(l=n.dataSource)||void 0===l?void 0:l.call(n))||(null===(c=n.options)||void 0===c?void 0:c.call(n))||[];d=v.length&&isSelectOptionOrSelectOptGroup(v[0])?v:h?h.map((function(e){if(isValidElement(e))return e;switch(_typeof$3(e)){case"string":return createVNode(Option$1,{key:e,value:e},{default:function(){return[e]}});case"object":return createVNode(Option$1,{key:e.value,value:e.value},{default:function(){return[e.text]}});default:throw new Error("AutoComplete[dataSource] only supports type `string[] | Object[]`.")}})):[]}var _=omit$2(_extends$1(_extends$1(_extends$1({},e),i),{mode:__unplugin_components_3.SECRET_COMBOBOX_MODE_DO_NOT_USE,getInputElement:s,notFoundContent:p,class:m,ref:r}),["dataSource","loading"]);return createVNode(__unplugin_components_3,_,_objectSpread2$1({default:function(){return[d]}},omit$2(n,["default","dataSource","options"])))}}}),__unplugin_components_1$3=_extends$1(AutoComplete,{Option:Option$1,OptGroup:OptGroup$1,install:function(e){return e.component(AutoComplete.name,AutoComplete),e.component(Option$1.displayName,Option$1),e.component(OptGroup$1.displayName,OptGroup$1),e}}),iconMapFilled={success:CheckCircleFilled$1,info:InfoCircleFilled$1,error:CloseCircleFilled$1,warning:ExclamationCircleFilled$1},iconMapOutlined={success:CheckCircleOutlined$1,info:InfoCircleOutlined$1,error:CloseCircleOutlined$1,warning:ExclamationCircleOutlined$1},AlertTypes=tuple("success","info","warning","error"),alertProps=function(){return{type:PropTypes$1.oneOf(AlertTypes),closable:{type:Boolean,default:void 0},closeText:PropTypes$1.any,message:PropTypes$1.any,description:PropTypes$1.any,afterClose:Function,showIcon:{type:Boolean,default:void 0},prefixCls:String,banner:{type:Boolean,default:void 0},icon:PropTypes$1.any,closeIcon:PropTypes$1.any,onClose:Function}},Alert=defineComponent({name:"AAlert",inheritAttrs:!1,props:alertProps(),setup:function(e,t){var n=t.slots,i=t.emit,o=t.attrs,r=t.expose,s=useConfigInject("alert",e),a=s.prefixCls,l=s.direction,c=ref(!1),d=ref(!1),u=ref(),h=function(e){e.preventDefault();var t=u.value;t.style.height="".concat(t.offsetHeight,"px"),t.style.height="".concat(t.offsetHeight,"px"),c.value=!0,i("close",e)},g=function(){var t;c.value=!1,d.value=!0,null===(t=e.afterClose)||void 0===t||t.call(e)};r({animationEnd:g});var p=ref({});return function(){var t,i,r=e.banner,s=e.closeIcon,f=void 0===s?null===(i=n.closeIcon)||void 0===i?void 0:i.call(n):s,m=e.closable,v=e.type,_=e.showIcon,C=getPropsSlot(n,e,"closeText"),b=getPropsSlot(n,e,"description"),y=getPropsSlot(n,e,"message"),S=getPropsSlot(n,e,"icon");_=!(!r||void 0!==_)||_;var w=(b?iconMapOutlined:iconMapFilled)[v=r&&void 0===v?"warning":v||"info"]||null;C&&(m=!0);var E=a.value,x=classNames(E,(_defineProperty$P(t={},"".concat(E,"-").concat(v),!0),_defineProperty$P(t,"".concat(E,"-closing"),c.value),_defineProperty$P(t,"".concat(E,"-with-description"),!!b),_defineProperty$P(t,"".concat(E,"-no-icon"),!_),_defineProperty$P(t,"".concat(E,"-banner"),!!r),_defineProperty$P(t,"".concat(E,"-closable"),m),_defineProperty$P(t,"".concat(E,"-rtl"),"rtl"===l.value),t)),T=m?createVNode("button",{type:"button",onClick:h,class:"".concat(E,"-close-icon"),tabindex:0},[C?createVNode("span",{class:"".concat(E,"-close-text")},[C]):void 0===f?createVNode(CloseOutlined$1,null,null):f]):null,I=S&&(isValidElement(S)?cloneElement(S,{class:"".concat(E,"-icon")}):createVNode("span",{class:"".concat(E,"-icon")},[S]))||createVNode(w,{class:"".concat(E,"-icon")},null),k=getTransitionProps("".concat(E,"-motion"),{appear:!1,css:!0,onAfterLeave:g,onBeforeLeave:function(e){e.style.maxHeight="".concat(e.offsetHeight,"px")},onLeave:function(e){e.style.maxHeight="0px"}});return d.value?null:createVNode(Transition,k,{default:function(){return[withDirectives(createVNode("div",_objectSpread2$1(_objectSpread2$1({role:"alert"},o),{},{style:[o.style,p.value],class:[o.class,x],"data-show":!c.value,ref:u}),[_?I:null,createVNode("div",{class:"".concat(E,"-content")},[y?createVNode("div",{class:"".concat(E,"-message")},[y]):null,b?createVNode("div",{class:"".concat(E,"-description")},[b]):null]),T]),[[vShow,!c.value]])]}})}}}),__unplugin_components_0$6=withInstall(Alert),responsiveArray=["xxxl","xxl","xl","lg","md","sm","xs"],responsiveMap={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)",xxxl:"(min-width: 2000px)"},subscribers=new Map,subUid=-1,screens={},responsiveObserve={matchHandlers:{},dispatch:function(e){return screens=e,subscribers.forEach((function(e){return e(screens)})),subscribers.size>=1},subscribe:function(e){return subscribers.size||this.register(),subUid+=1,subscribers.set(subUid,e),e(screens),subUid},unsubscribe:function(e){subscribers.delete(e),subscribers.size||this.unregister()},unregister:function(){var e=this;Object.keys(responsiveMap).forEach((function(t){var n=responsiveMap[t],i=e.matchHandlers[n];null==i||i.mql.removeListener(null==i?void 0:i.listener)})),subscribers.clear()},register:function(){var e=this;Object.keys(responsiveMap).forEach((function(t){var n=responsiveMap[t],i=function(n){var i=n.matches;e.dispatch(_extends$1(_extends$1({},screens),_defineProperty$P({},t,i)))},o=window.matchMedia(n);o.addListener(i),e.matchHandlers[n]={mql:o,listener:i},i(o)}))}},ResponsiveObserve=responsiveObserve;function useBreakpoint(){var e=ref({}),t=null;return onMounted((function(){t=ResponsiveObserve.subscribe((function(t){e.value=t}))})),onUnmounted((function(){ResponsiveObserve.unsubscribe(t)})),e}var sizeProvider=Symbol("SizeProvider"),useProvideSize=function(e){var t=inject("configProvider",defaultConfigProvider),n=computed((function(){return e.size||t.componentSize}));return provide(sizeProvider,n),n},useInjectSize=function(e){return e?computed((function(){return e.size})):inject(sizeProvider,computed((function(){return"default"})))};function eagerComputed(e){var t=shallowRef();return watchEffect((function(){t.value=e()}),{flush:"sync"}),t}var autoAdjustOverflow$2={adjustX:1,adjustY:1},targetOffset$2=[0,0],placements$3={left:{points:["cr","cl"],overflow:autoAdjustOverflow$2,offset:[-4,0],targetOffset:targetOffset$2},right:{points:["cl","cr"],overflow:autoAdjustOverflow$2,offset:[4,0],targetOffset:targetOffset$2},top:{points:["bc","tc"],overflow:autoAdjustOverflow$2,offset:[0,-4],targetOffset:targetOffset$2},bottom:{points:["tc","bc"],overflow:autoAdjustOverflow$2,offset:[0,4],targetOffset:targetOffset$2},topLeft:{points:["bl","tl"],overflow:autoAdjustOverflow$2,offset:[0,-4],targetOffset:targetOffset$2},leftTop:{points:["tr","tl"],overflow:autoAdjustOverflow$2,offset:[-4,0],targetOffset:targetOffset$2},topRight:{points:["br","tr"],overflow:autoAdjustOverflow$2,offset:[0,-4],targetOffset:targetOffset$2},rightTop:{points:["tl","tr"],overflow:autoAdjustOverflow$2,offset:[4,0],targetOffset:targetOffset$2},bottomRight:{points:["tr","br"],overflow:autoAdjustOverflow$2,offset:[0,4],targetOffset:targetOffset$2},rightBottom:{points:["bl","br"],overflow:autoAdjustOverflow$2,offset:[4,0],targetOffset:targetOffset$2},bottomLeft:{points:["tl","bl"],overflow:autoAdjustOverflow$2,offset:[0,4],targetOffset:targetOffset$2},leftBottom:{points:["br","bl"],overflow:autoAdjustOverflow$2,offset:[-4,0],targetOffset:targetOffset$2}},tooltipContentProps={prefixCls:String,id:String,overlayInnerStyle:PropTypes$1.any},Content$1=defineComponent({name:"Content",props:tooltipContentProps,slots:["overlay"],setup:function(e,t){var n=t.slots;return function(){var t;return createVNode("div",{class:"".concat(e.prefixCls,"-inner"),id:e.id,role:"tooltip",style:e.overlayInnerStyle},[null===(t=n.overlay)||void 0===t?void 0:t.call(n)])}}}),__rest$u=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function noop$3(){}var Tooltip=defineComponent({name:"Tooltip",inheritAttrs:!1,props:{trigger:PropTypes$1.any.def(["hover"]),defaultVisible:{type:Boolean,default:void 0},visible:{type:Boolean,default:void 0},placement:PropTypes$1.string.def("right"),transitionName:String,animation:PropTypes$1.any,afterVisibleChange:PropTypes$1.func.def((function(){})),overlayStyle:{type:Object,default:void 0},overlayClassName:String,prefixCls:PropTypes$1.string.def("rc-tooltip"),mouseEnterDelay:PropTypes$1.number.def(.1),mouseLeaveDelay:PropTypes$1.number.def(.1),getPopupContainer:Function,destroyTooltipOnHide:{type:Boolean,default:!1},align:PropTypes$1.object.def((function(){return{}})),arrowContent:PropTypes$1.any.def(null),tipId:String,builtinPlacements:PropTypes$1.object,overlayInnerStyle:{type:Object,default:void 0},popupVisible:{type:Boolean,default:void 0},onVisibleChange:Function,onPopupAlign:Function},slots:["arrowContent","overlay"],setup:function(e,t){var n=t.slots,i=t.attrs,o=t.expose,r=ref(),s=function(){var t=e.prefixCls,i=e.tipId,o=e.overlayInnerStyle;return[createVNode("div",{class:"".concat(t,"-arrow"),key:"arrow"},[getPropsSlot(n,e,"arrowContent")]),createVNode(Content$1,{key:"content",prefixCls:t,id:i,overlayInnerStyle:o},{overlay:n.overlay})]};o({getPopupDomNode:function(){return r.value.getPopupDomNode()},triggerDOM:r,forcePopupAlign:function(){var e;return null===(e=r.value)||void 0===e?void 0:e.forcePopupAlign()}});var a=ref(!1),l=ref(!1);return watchEffect((function(){var t=e.destroyTooltipOnHide;if("boolean"==typeof t)a.value=t;else if(t&&"object"===_typeof$3(t)){var n=t.keepParent;a.value=!0===n,l.value=!1===n}})),function(){var t=e.overlayClassName,o=e.trigger,c=e.mouseEnterDelay,d=e.mouseLeaveDelay,u=e.overlayStyle,h=e.prefixCls,g=e.afterVisibleChange,p=e.transitionName,f=e.animation,m=e.placement,v=e.align;e.destroyTooltipOnHide;var _=e.defaultVisible,C=_extends$1({},__rest$u(e,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible"]));void 0!==e.visible&&(C.popupVisible=e.visible);var b=_extends$1(_extends$1(_extends$1({popupClassName:t,prefixCls:h,action:o,builtinPlacements:placements$3,popupPlacement:m,popupAlign:v,afterPopupVisibleChange:g,popupTransitionName:p,popupAnimation:f,defaultPopupVisible:_,destroyPopupOnHide:a.value,autoDestroy:l.value,mouseLeaveDelay:d,popupStyle:u,mouseEnterDelay:c},C),i),{onPopupVisibleChange:e.onVisibleChange||noop$3,onPopupAlign:e.onPopupAlign||noop$3,ref:r,popup:s()});return createVNode(Trigger,b,{default:n.default})}}}),PresetStatusColorTypes=tuple("success","processing","error","default","warning"),PresetColorTypes=tuple("pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime"),abstractTooltipProps=function(){return{trigger:[String,Array],visible:{type:Boolean,default:void 0},defaultVisible:{type:Boolean,default:void 0},placement:String,color:String,transitionName:String,overlayStyle:{type:Object,default:void 0},overlayClassName:String,openClassName:String,prefixCls:String,mouseEnterDelay:Number,mouseLeaveDelay:Number,getPopupContainer:Function,arrowPointAtCenter:{type:Boolean,default:void 0},autoAdjustOverflow:{type:[Boolean,Object],default:void 0},destroyTooltipOnHide:{type:Boolean,default:void 0},align:{type:Object,default:void 0},builtinPlacements:{type:Object,default:void 0},children:Array,onVisibleChange:Function,"onUpdate:visible":Function}},autoAdjustOverflowEnabled={adjustX:1,adjustY:1},autoAdjustOverflowDisabled={adjustX:0,adjustY:0},targetOffset$1=[0,0];function getOverflowOptions(e){return"boolean"==typeof e?e?autoAdjustOverflowEnabled:autoAdjustOverflowDisabled:_extends$1(_extends$1({},autoAdjustOverflowDisabled),e)}function getPlacements(e){var t=e.arrowWidth,n=void 0===t?4:t,i=e.horizontalArrowShift,o=void 0===i?16:i,r=e.verticalArrowShift,s=void 0===r?8:r,a=e.autoAdjustOverflow,l=e.arrowPointAtCenter,c={left:{points:["cr","cl"],offset:[-4,0]},right:{points:["cl","cr"],offset:[4,0]},top:{points:["bc","tc"],offset:[0,-4]},bottom:{points:["tc","bc"],offset:[0,4]},topLeft:{points:["bl","tc"],offset:[-(o+n),-4]},leftTop:{points:["tr","cl"],offset:[-4,-(s+n)]},topRight:{points:["br","tc"],offset:[o+n,-4]},rightTop:{points:["tl","cr"],offset:[4,-(s+n)]},bottomRight:{points:["tr","bc"],offset:[o+n,4]},rightBottom:{points:["bl","cr"],offset:[4,s+n]},bottomLeft:{points:["tl","bc"],offset:[-(o+n),4]},leftBottom:{points:["br","cl"],offset:[-4,s+n]}};return Object.keys(c).forEach((function(e){c[e]=l?_extends$1(_extends$1({},c[e]),{overflow:getOverflowOptions(a),targetOffset:targetOffset$1}):_extends$1(_extends$1({},placements$3[e]),{overflow:getOverflowOptions(a)}),c[e].ignoreShake=!0})),c}function firstNotUndefined(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=0,n=e.length;t<n;t++)if(void 0!==e[t])return e[t]}var splitObject=function(e,t){var n={},i=_extends$1({},e);return t.forEach((function(t){e&&t in e&&(n[t]=e[t],delete i[t])})),{picked:n,omitted:i}},PresetColorRegex$1=new RegExp("^(".concat(PresetColorTypes.join("|"),")(-inverse)?$")),tooltipProps=function(){return _extends$1(_extends$1({},abstractTooltipProps()),{title:PropTypes$1.any})},tooltipDefaultProps=function(){return{trigger:"hover",transitionName:"zoom-big-fast",align:{},placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0}},ToolTip=defineComponent({name:"ATooltip",inheritAttrs:!1,props:initDefaultProps$1(tooltipProps(),{trigger:"hover",transitionName:"zoom-big-fast",align:{},placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0}),slots:["title"],setup:function(e,t){var n,i=t.slots,o=t.emit,r=t.attrs,s=t.expose,a=useConfigInject("tooltip",e),l=a.prefixCls,c=a.getPopupContainer,d=ref(firstNotUndefined([e.visible,e.defaultVisible])),u=ref();onMounted((function(){warning$2(void 0===e.defaultVisible,"Tooltip","'defaultVisible' is deprecated, please use 'v-model:visible'")})),watch((function(){return e.visible}),(function(e){wrapperRaf.cancel(n),n=wrapperRaf((function(){d.value=!!e}))}));var h=function(){var t,n=null!==(t=e.title)&&void 0!==t?t:i.title;return!n&&0!==n},g=function(t){var n=h();void 0===e.visible&&(d.value=!n&&t),n||(o("update:visible",t),o("visibleChange",t))};s({getPopupDomNode:function(){return u.value.getPopupDomNode()},visible:d,forcePopupAlign:function(){var e;return null===(e=u.value)||void 0===e?void 0:e.forcePopupAlign()}});var p=computed((function(){var t=e.builtinPlacements,n=e.arrowPointAtCenter,i=e.autoAdjustOverflow;return t||getPlacements({arrowPointAtCenter:n,autoAdjustOverflow:i})})),f=function(e){return e||""===e},m=function(){var t,n;return null!==(t=e.title)&&void 0!==t?t:null===(n=i.title)||void 0===n?void 0:n.call(i)},v=function(e,t){var n=p.value,i=Object.keys(n).filter((function(e){return n[e].points[0]===t.points[0]&&n[e].points[1]===t.points[1]}))[0];if(i){var o=e.getBoundingClientRect(),r={top:"50%",left:"50%"};i.indexOf("top")>=0||i.indexOf("Bottom")>=0?r.top="".concat(o.height-t.offset[1],"px"):(i.indexOf("Top")>=0||i.indexOf("bottom")>=0)&&(r.top="".concat(-t.offset[1],"px")),i.indexOf("left")>=0||i.indexOf("Right")>=0?r.left="".concat(o.width-t.offset[0],"px"):(i.indexOf("right")>=0||i.indexOf("Left")>=0)&&(r.left="".concat(-t.offset[0],"px")),e.style.transformOrigin="".concat(r.left," ").concat(r.top)}};return function(){var t,n,o,s=e.openClassName,a=e.color,_=e.overlayClassName,C=null!==(o=filterEmpty(null===(n=i.default)||void 0===n?void 0:n.call(i)))&&void 0!==o?o:null;C=1===C.length?C[0]:C;var b=d.value;if(void 0===e.visible&&h()&&(b=!1),!C)return null;var y,S,w=function(e){var t=e.type;if("object"===_typeof$3(t)&&e.props&&((!0===t.__ANT_BUTTON||"button"===t)&&f(e.props.disabled)||!0===t.__ANT_SWITCH&&(f(e.props.disabled)||f(e.props.loading)))){var n=splitObject(getStyle(e),["position","left","right","top","bottom","float","display","zIndex"]),i=n.picked,o=n.omitted,r=_extends$1(_extends$1({display:"inline-block"},i),{cursor:"not-allowed",lineHeight:1,width:e.props&&e.props.block?"100%":null}),s=cloneElement(e,{style:_extends$1(_extends$1({},o),{pointerEvents:"none"})},!0);return createVNode("span",{style:r,class:"".concat(l.value,"-disabled-compatible-wrapper")},[s])}return e}(isValidElement(C)?C:createVNode("span",null,[C])),E=classNames((_defineProperty$P(t={},s||"".concat(l.value,"-open"),!0),_defineProperty$P(t,w.props&&w.props.class,w.props&&w.props.class),t)),x=classNames(_,_defineProperty$P({},"".concat(l.value,"-").concat(a),a&&PresetColorRegex$1.test(a)));a&&!PresetColorRegex$1.test(a)&&(y={backgroundColor:a},S={backgroundColor:a});var T=_extends$1(_extends$1(_extends$1({},r),e),{prefixCls:l.value,getPopupContainer:c.value,builtinPlacements:p.value,visible:b,ref:u,overlayClassName:x,overlayInnerStyle:y,onVisibleChange:g,onPopupAlign:v});return createVNode(Tooltip,T,{default:function(){return[d.value?cloneElement(w,{class:E}):w]},arrowContent:function(){return createVNode("span",{class:"".concat(l.value,"-arrow-content"),style:S},null)},overlay:m})}}}),__unplugin_components_2$3=withInstall(ToolTip),popoverProps=function(){return _extends$1(_extends$1({},abstractTooltipProps()),{content:PropTypes$1.any,title:PropTypes$1.any})},Popover=defineComponent({name:"APopover",props:initDefaultProps$1(popoverProps(),_extends$1(_extends$1({},tooltipDefaultProps()),{trigger:"hover",transitionName:"zoom-big",placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1})),setup:function(e,t){var n=t.expose,i=t.slots,o=ref();n({getPopupDomNode:function(){var e,t;return null===(t=null===(e=o.value)||void 0===e?void 0:e.getPopupDomNode)||void 0===t?void 0:t.call(e)}});var r=useConfigInject("popover",e),s=r.prefixCls,a=r.configProvider,l=computed((function(){return a.getPrefixCls()})),c=function(){var t,n,o=e.title,r=void 0===o?filterEmpty(null===(t=i.title)||void 0===t?void 0:t.call(i)):o,a=e.content,l=void 0===a?filterEmpty(null===(n=i.content)||void 0===n?void 0:n.call(i)):a,c=!!(Array.isArray(r)?r.length:r),d=!!(Array.isArray(l)?l.length:r);if(c||d)return createVNode(Fragment,null,[c&&createVNode("div",{class:"".concat(s.value,"-title")},[r]),createVNode("div",{class:"".concat(s.value,"-inner-content")},[l])])};return function(){return createVNode(__unplugin_components_2$3,_objectSpread2$1(_objectSpread2$1({},omit$2(e,["title","content"])),{},{prefixCls:s.value,ref:o,transitionName:getTransitionName$2(l.value,"zoom-big",e.transitionName)}),{title:c,default:i.default})}}}),__unplugin_components_2$2=withInstall(Popover);function UnitNumber(e){var t,n=e.prefixCls,i=e.value,o=e.current,r=e.offset,s=void 0===r?0:r;return s&&(t={position:"absolute",top:"".concat(s,"00%"),left:0}),createVNode("p",{style:t,class:classNames("".concat(n,"-only-unit"),{current:o})},[i])}function getOffset$1(e,t,n){for(var i=e,o=0;(i+10)%10!==t;)i+=n,o+=n;return o}var SingleNumber=defineComponent({name:"SingleNumber",props:{prefixCls:String,value:String,count:Number},setup:function(e){var t=computed((function(){return Number(e.value)})),n=computed((function(){return Math.abs(e.count)})),i=reactive({prevValue:t.value,prevCount:n.value}),o=function(){i.prevValue=t.value,i.prevCount=n.value},r=ref();return watch(t,(function(){clearTimeout(r.value),r.value=setTimeout((function(){o()}),1e3)}),{flush:"post"}),onUnmounted((function(){clearTimeout(r.value)})),function(){var r,s={},a=t.value;if(i.prevValue===a||Number.isNaN(a)||Number.isNaN(i.prevValue))r=[UnitNumber(_extends$1(_extends$1({},e),{current:!0}))],s={transition:"none"};else{r=[];for(var l=a+10,c=[],d=a;d<=l;d+=1)c.push(d);var u=c.findIndex((function(e){return e%10===i.prevValue}));r=c.map((function(t,n){var i=t%10;return UnitNumber(_extends$1(_extends$1({},e),{value:i,offset:n-u,current:n===u}))}));var h=i.prevCount<n.value?1:-1;s={transform:"translateY(".concat(-getOffset$1(i.prevValue,a,h),"00%)")}}return createVNode("span",{class:"".concat(e.prefixCls,"-only"),style:s,onTransitionend:function(){return o()}},[r])}}}),__rest$t=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},scrollNumberProps={prefixCls:String,count:PropTypes$1.any,component:String,title:PropTypes$1.any,show:Boolean},ScrollNumber=defineComponent({name:"ScrollNumber",inheritAttrs:!1,props:scrollNumberProps,setup:function(e,t){var n=t.attrs,i=t.slots,o=useConfigInject("scroll-number",e).prefixCls;return function(){var t,r=_extends$1(_extends$1({},e),n);r.prefixCls;var s=r.count,a=r.title;r.show;var l=r.component,c=void 0===l?"sup":l,d=r.class,u=r.style,h=_extends$1(_extends$1({},__rest$t(r,["prefixCls","count","title","show","component","class","style"])),{style:u,"data-show":e.show,class:classNames(o.value,d),title:a}),g=s;if(s&&Number(s)%1==0){var p=String(s).split("");g=p.map((function(e,t){return createVNode(SingleNumber,{prefixCls:o.value,count:Number(s),value:e,key:p.length-t},null)}))}u&&u.borderColor&&(h.style=_extends$1(_extends$1({},u),{boxShadow:"0 0 0 1px ".concat(u.borderColor," inset")}));var f=filterEmpty(null===(t=i.default)||void 0===t?void 0:t.call(i));return f&&f.length?cloneElement(f,{class:classNames("".concat(o.value,"-custom-component"))},!1):createVNode(c,h,{default:function(){return[g]}})}}});function isPresetColor(e){return-1!==PresetColorTypes.indexOf(e)}var __rest$s=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},ribbonProps=function(){return{prefix:String,color:{type:String},text:PropTypes$1.any,placement:{type:String,default:"end"}}},Ribbon=defineComponent({name:"ABadgeRibbon",inheritAttrs:!1,props:ribbonProps(),slots:["text"],setup:function(e,t){var n=t.attrs,i=t.slots,o=useConfigInject("ribbon",e),r=o.prefixCls,s=o.direction,a=computed((function(){return isPresetColor(e.color)})),l=computed((function(){var t;return[r.value,"".concat(r.value,"-placement-").concat(e.placement),(t={},_defineProperty$P(t,"".concat(r.value,"-rtl"),"rtl"===s.value),_defineProperty$P(t,"".concat(r.value,"-color-").concat(e.color),a.value),t)]}));return function(){var t,o,s=n.class,c=n.style,d=__rest$s(n,["class","style"]),u={},h={};return e.color&&!a.value&&(u.background=e.color,h.color=e.color),createVNode("div",_objectSpread2$1({class:"".concat(r.value,"-wrapper")},d),[null===(t=i.default)||void 0===t?void 0:t.call(i),createVNode("div",{class:[l.value,s],style:_extends$1(_extends$1({},u),c)},[createVNode("span",{class:"".concat(r.value,"-text")},[e.text||(null===(o=i.text)||void 0===o?void 0:o.call(i))]),createVNode("div",{class:"".concat(r.value,"-corner"),style:h},null)])])}}}),isNumeric=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},isNumeric$1=isNumeric,badgeProps=function(){return{count:PropTypes$1.any,showZero:{type:Boolean,default:void 0},overflowCount:{type:Number,default:99},dot:{type:Boolean,default:void 0},prefixCls:String,scrollNumberPrefixCls:String,status:{type:String},size:{type:String,default:"default"},color:String,text:PropTypes$1.any,offset:Array,numberStyle:{type:Object,default:void 0},title:String}},Badge=defineComponent({name:"ABadge",Ribbon:Ribbon,inheritAttrs:!1,props:badgeProps(),slots:["text","count"],setup:function(e,t){var n=t.slots,i=t.attrs,o=useConfigInject("badge",e),r=o.prefixCls,s=o.direction,a=computed((function(){return e.count>e.overflowCount?"".concat(e.overflowCount,"+"):e.count})),l=computed((function(){return null!==e.status&&void 0!==e.status||null!==e.color&&void 0!==e.color})),c=computed((function(){return"0"===a.value||0===a.value})),d=computed((function(){return e.dot&&!c.value})),u=computed((function(){return d.value?"":a.value})),h=computed((function(){return(null===u.value||void 0===u.value||""===u.value||c.value&&!e.showZero)&&!d.value})),g=ref(e.count),p=ref(u.value),f=ref(d.value);watch([function(){return e.count},u,d],(function(){h.value||(g.value=e.count,p.value=u.value,f.value=d.value)}),{immediate:!0});var m=computed((function(){var t;return _defineProperty$P(t={},"".concat(r.value,"-status-dot"),l.value),_defineProperty$P(t,"".concat(r.value,"-status-").concat(e.status),!!e.status),_defineProperty$P(t,"".concat(r.value,"-status-").concat(e.color),isPresetColor(e.color)),t})),v=computed((function(){return e.color&&!isPresetColor(e.color)?{background:e.color}:{}})),_=computed((function(){var t;return _defineProperty$P(t={},"".concat(r.value,"-dot"),f.value),_defineProperty$P(t,"".concat(r.value,"-count"),!f.value),_defineProperty$P(t,"".concat(r.value,"-count-sm"),"small"===e.size),_defineProperty$P(t,"".concat(r.value,"-multiple-words"),!f.value&&p.value&&p.value.toString().length>1),_defineProperty$P(t,"".concat(r.value,"-status-").concat(e.status),!!e.status),_defineProperty$P(t,"".concat(r.value,"-status-").concat(e.color),isPresetColor(e.color)),t}));return function(){var t,o,a,c=e.offset,d=e.title,u=e.color,f=i.style,C=getPropsSlot(n,e,"text"),b=r.value,y=g.value,S=flattenChildren(null===(o=n.default)||void 0===o?void 0:o.call(n));S=S.length?S:null;var w=!(h.value&&!n.count),E=function(){if(!c)return _extends$1({},f);var e={marginTop:isNumeric$1(c[1])?"".concat(c[1],"px"):c[1]};return"rtl"===s.value?e.left="".concat(parseInt(c[0],10),"px"):e.right="".concat(-parseInt(c[0],10),"px"),_extends$1(_extends$1({},e),f)}(),x=null!=d?d:"string"==typeof y||"number"==typeof y?y:void 0,T=w||!C?null:createVNode("span",{class:"".concat(b,"-status-text")},[C]),I="object"===_typeof$3(y)||void 0===y&&n.count?cloneElement(null!=y?y:null===(a=n.count)||void 0===a?void 0:a.call(n),{style:E},!1):null,k=classNames(b,(_defineProperty$P(t={},"".concat(b,"-status"),l.value),_defineProperty$P(t,"".concat(b,"-not-a-wrapper"),!S),_defineProperty$P(t,"".concat(b,"-rtl"),"rtl"===s.value),t),i.class);if(!S&&l.value){var L=E.color;return createVNode("span",_objectSpread2$1(_objectSpread2$1({},i),{},{class:k,style:E}),[createVNode("span",{class:m.value,style:v.value},null),createVNode("span",{style:{color:L},class:"".concat(b,"-status-text")},[C])])}var D=getTransitionProps(S?"".concat(b,"-zoom"):"",{appear:!1}),N=_extends$1(_extends$1({},E),e.numberStyle);return u&&!isPresetColor(u)&&((N=N||{}).background=u),createVNode("span",_objectSpread2$1(_objectSpread2$1({},i),{},{class:k}),[S,createVNode(Transition,D,{default:function(){return[withDirectives(createVNode(ScrollNumber,{prefixCls:e.scrollNumberPrefixCls,show:w,class:_.value,count:p.value,title:x,style:N,key:"scrollNumber"},{default:function(){return[I]}}),[[vShow,w]])]}}),T])}}});Badge.install=function(e){return e.component(Badge.name,Badge),e.component(Ribbon.name,Ribbon),e};var autoAdjustOverflow$1={adjustX:1,adjustY:1},targetOffset=[0,0],placements$1={topLeft:{points:["bl","tl"],overflow:autoAdjustOverflow$1,offset:[0,-4],targetOffset:targetOffset},topCenter:{points:["bc","tc"],overflow:autoAdjustOverflow$1,offset:[0,-4],targetOffset:targetOffset},topRight:{points:["br","tr"],overflow:autoAdjustOverflow$1,offset:[0,-4],targetOffset:targetOffset},bottomLeft:{points:["tl","bl"],overflow:autoAdjustOverflow$1,offset:[0,4],targetOffset:targetOffset},bottomCenter:{points:["tc","bc"],overflow:autoAdjustOverflow$1,offset:[0,4],targetOffset:targetOffset},bottomRight:{points:["tr","br"],overflow:autoAdjustOverflow$1,offset:[0,4],targetOffset:targetOffset}},placements$2=placements$1,__rest$r=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},Dropdown$2=defineComponent({props:{minOverlayWidthMatchTrigger:{type:Boolean,default:void 0},arrow:{type:Boolean,default:!1},prefixCls:PropTypes$1.string.def("rc-dropdown"),transitionName:String,overlayClassName:PropTypes$1.string.def(""),openClassName:String,animation:PropTypes$1.any,align:PropTypes$1.object,overlayStyle:{type:Object,default:void 0},placement:PropTypes$1.string.def("bottomLeft"),overlay:PropTypes$1.any,trigger:PropTypes$1.oneOfType([PropTypes$1.string,PropTypes$1.arrayOf(PropTypes$1.string)]).def("hover"),alignPoint:{type:Boolean,default:void 0},showAction:PropTypes$1.array,hideAction:PropTypes$1.array,getPopupContainer:Function,visible:{type:Boolean,default:void 0},defaultVisible:{type:Boolean,default:!1},mouseEnterDelay:PropTypes$1.number.def(.15),mouseLeaveDelay:PropTypes$1.number.def(.1)},emits:["visibleChange","overlayClick"],slots:["overlay"],setup:function(e,t){var n=t.slots,i=t.emit,o=t.expose,r=ref(!!e.visible);watch((function(){return e.visible}),(function(e){void 0!==e&&(r.value=e)}));var s=ref();o({triggerRef:s});var a=function(t){void 0===e.visible&&(r.value=!1),i("overlayClick",t)},l=function(t){void 0===e.visible&&(r.value=t),i("visibleChange",t)},c=function(){var t,i=null===(t=n.overlay)||void 0===t?void 0:t.call(n),o={prefixCls:"".concat(e.prefixCls,"-menu"),onClick:a,getPopupContainer:function(){return s.value.getPopupDomNode()}};return createVNode(Fragment,null,[e.arrow&&createVNode("div",{class:"".concat(e.prefixCls,"-arrow")},null),cloneElement(i,o,!1)])},d=computed((function(){var t=e.minOverlayWidthMatchTrigger;return void 0===t?!e.alignPoint:t})),u=function(){var t,i=null===(t=n.default)||void 0===t?void 0:t.call(n);return r.value&&i?cloneElement(i[0],{class:e.openClassName||"".concat(e.prefixCls,"-open")},!1):i},h=computed((function(){return e.hideAction||-1===e.trigger.indexOf("contextmenu")?e.hideAction:["click"]}));return function(){var t=e.prefixCls,n=e.arrow,i=e.showAction,o=e.overlayStyle,a=e.trigger,g=e.placement,p=e.align,f=e.getPopupContainer,m=e.transitionName,v=e.animation,_=e.overlayClassName,C=__rest$r(e,["prefixCls","arrow","showAction","overlayStyle","trigger","placement","align","getPopupContainer","transitionName","animation","overlayClassName"]);return createVNode(Trigger,_objectSpread2$1(_objectSpread2$1({},C),{},{prefixCls:t,ref:s,popupClassName:classNames(_,_defineProperty$P({},"".concat(t,"-show-arrow"),n)),popupStyle:o,builtinPlacements:placements$2,action:a,showAction:i,hideAction:h.value||[],popupPlacement:g,popupAlign:p,popupTransitionName:m,popupAnimation:v,popupVisible:r.value,stretch:d.value?"minWidth":"",onPopupVisibleChange:l,getPopupContainer:f}),{popup:c,default:u})}}}),START_EVENT_NAME_MAP={transitionstart:{transition:"transitionstart",WebkitTransition:"webkitTransitionStart",MozTransition:"mozTransitionStart",OTransition:"oTransitionStart",msTransition:"MSTransitionStart"},animationstart:{animation:"animationstart",WebkitAnimation:"webkitAnimationStart",MozAnimation:"mozAnimationStart",OAnimation:"oAnimationStart",msAnimation:"MSAnimationStart"}},END_EVENT_NAME_MAP={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},startEvents=[],endEvents=[];function detectEvents(){var e=document.createElement("div").style;function t(t,n){for(var i in t)if(t.hasOwnProperty(i)){var o=t[i];for(var r in o)if(r in e){n.push(o[r]);break}}}"AnimationEvent"in window||(delete START_EVENT_NAME_MAP.animationstart.animation,delete END_EVENT_NAME_MAP.animationend.animation),"TransitionEvent"in window||(delete START_EVENT_NAME_MAP.transitionstart.transition,delete END_EVENT_NAME_MAP.transitionend.transition),t(START_EVENT_NAME_MAP,startEvents),t(END_EVENT_NAME_MAP,endEvents)}function addEventListener(e,t,n){e.addEventListener(t,n,!1)}function removeEventListener(e,t,n){e.removeEventListener(t,n,!1)}"undefined"!=typeof window&&"undefined"!=typeof document&&detectEvents();var TransitionEvents={startEvents:startEvents,addStartEventListener:function(e,t){0!==startEvents.length?startEvents.forEach((function(n){addEventListener(e,n,t)})):setTimeout(t,0)},removeStartEventListener:function(e,t){0!==startEvents.length&&startEvents.forEach((function(n){removeEventListener(e,n,t)}))},endEvents:endEvents,addEndEventListener:function(e,t){0!==endEvents.length?endEvents.forEach((function(n){addEventListener(e,n,t)})):setTimeout(t,0)},removeEndEventListener:function(e,t){0!==endEvents.length&&endEvents.forEach((function(n){removeEventListener(e,n,t)}))}},TransitionEvents$1=TransitionEvents,styleForPesudo;function isHidden(e){return!e||null===e.offsetParent}function isNotGrey(e){var t=(e||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\.\d]*)?\)/);return!(t&&t[1]&&t[2]&&t[3])||!(t[1]===t[2]&&t[2]===t[3])}var Wave=defineComponent({name:"Wave",props:{insertExtraNode:Boolean,disabled:Boolean},setup:function(e,t){var n=t.slots,i=t.expose,o=getCurrentInstance(),r=useConfigInject("",e),s=r.csp,a=r.prefixCls;i({csp:s});var l=null,c=null,d=null,u=!1,h=null,g=!1,p=function(e){if(!g){var t=findDOMNode(o);e&&e.target===t&&(u||v(t))}},f=function(e){e&&"fadeEffect"===e.animationName&&v(e.target)},m=function(){var t=e.insertExtraNode;return"".concat(a.value,t?"-click-animating":"-click-animating-without-extra-node")},v=function(t){if(t&&t!==h&&t instanceof Element){var n=e.insertExtraNode,i=m();t.setAttribute(i,"false"),styleForPesudo&&(styleForPesudo.innerHTML=""),n&&h&&t.contains(h)&&t.removeChild(h),TransitionEvents$1.removeStartEventListener(t,p),TransitionEvents$1.removeEndEventListener(t,f)}},_=function(t){if(t&&t.getAttribute&&!t.getAttribute("disabled")&&!(t.className.indexOf("disabled")>=0)){var n=function(n){if("INPUT"!==n.target.tagName&&!isHidden(n.target)){v(t);var i=getComputedStyle(t).getPropertyValue("border-top-color")||getComputedStyle(t).getPropertyValue("border-color")||getComputedStyle(t).getPropertyValue("background-color");c=setTimeout((function(){return function(t,n){var i,o=e.insertExtraNode;if(!(e.disabled||!t||isHidden(t)||t.className.indexOf("-leave")>=0)){(h=document.createElement("div")).className="".concat(a.value,"-click-animating-node");var r=m();t.removeAttribute(r),t.setAttribute(r,"true"),styleForPesudo=styleForPesudo||document.createElement("style"),n&&"#ffffff"!==n&&"rgb(255, 255, 255)"!==n&&isNotGrey(n)&&!/rgba\(\d*, \d*, \d*, 0\)/.test(n)&&"transparent"!==n&&((null===(i=s.value)||void 0===i?void 0:i.nonce)&&(styleForPesudo.nonce=s.value.nonce),h.style.borderColor=n,styleForPesudo.innerHTML="\n [".concat(a.value,"-click-animating-without-extra-node='true']::after, .").concat(a.value,"-click-animating-node {\n --antd-wave-shadow-color: ").concat(n,";\n }"),document.body.contains(styleForPesudo)||document.body.appendChild(styleForPesudo)),o&&t.appendChild(h),TransitionEvents$1.addStartEventListener(t,p),TransitionEvents$1.addEndEventListener(t,f)}}(t,i)}),0),wrapperRaf.cancel(d),u=!0,d=wrapperRaf((function(){u=!1}),10)}};return t.addEventListener("click",n,!0),{cancel:function(){t.removeEventListener("click",n,!0)}}}};return onMounted((function(){nextTick((function(){var e=findDOMNode(o);1===e.nodeType&&(l=_(e))}))})),onBeforeUnmount((function(){l&&l.cancel(),clearTimeout(c),g=!0})),function(){var e;return null===(e=n.default)||void 0===e?void 0:e.call(n)[0]}}});function convertLegacyProps(e){return"danger"===e?{danger:!0}:{type:e}}var buttonProps=function(){return{prefixCls:String,type:String,htmlType:{type:String,default:"button"},shape:{type:String},size:{type:String},loading:{type:[Boolean,Object],default:function(){return!1}},disabled:{type:Boolean,default:void 0},ghost:{type:Boolean,default:void 0},block:{type:Boolean,default:void 0},danger:{type:Boolean,default:void 0},icon:PropTypes$1.any,href:String,target:String,title:String,onClick:{type:Function},onMousedown:{type:Function}}},buttonTypes=buttonProps,getCollapsedWidth=function(e){e&&(e.style.width="0px",e.style.opacity="0",e.style.transform="scale(0)")},getRealWidth=function(e){nextTick((function(){e&&(e.style.width="".concat(e.scrollWidth,"px"),e.style.opacity="1",e.style.transform="scale(1)")}))},resetStyle=function(e){e&&e.style&&(e.style.width=null,e.style.opacity=null,e.style.transform=null)},LoadingIcon=defineComponent({name:"LoadingIcon",props:{prefixCls:String,loading:[Boolean,Object],existIcon:Boolean},setup:function(e){return function(){var t=e.existIcon,n=e.prefixCls,i=e.loading;if(t)return createVNode("span",{class:"".concat(n,"-loading-icon")},[createVNode(LoadingOutlined$1,null,null)]);var o=!!i;return createVNode(Transition,{name:"".concat(n,"-loading-icon-motion"),onBeforeEnter:getCollapsedWidth,onEnter:getRealWidth,onAfterEnter:resetStyle,onBeforeLeave:getRealWidth,onLeave:function(e){setTimeout((function(){getCollapsedWidth(e)}))},onAfterLeave:resetStyle},{default:function(){return[o?createVNode("span",{class:"".concat(n,"-loading-icon")},[createVNode(LoadingOutlined$1,null,null)]):null]}})}}}),rxTwoCNChar=/^[\u4e00-\u9fa5]{2}$/,isTwoCNChar=rxTwoCNChar.test.bind(rxTwoCNChar);function isUnborderedButtonType(e){return"text"===e||"link"===e}var Button$2=defineComponent({name:"AButton",inheritAttrs:!1,__ANT_BUTTON:!0,props:initDefaultProps$1(buttonTypes(),{type:"default"}),slots:["icon"],setup:function(e,t){var n=t.slots,i=t.attrs,o=t.emit,r=useConfigInject("btn",e),s=r.prefixCls,a=r.autoInsertSpaceInButton,l=r.direction,c=r.size,d=ref(null),u=ref(void 0),h=!1,g=ref(!1),p=ref(!1),f=computed((function(){return!1!==a.value})),m=computed((function(){return"object"===_typeof$3(e.loading)&&e.loading.delay?e.loading.delay||!0:!!e.loading}));watch(m,(function(e){clearTimeout(u.value),"number"==typeof m.value?u.value=setTimeout((function(){g.value=e}),m.value):g.value=e}),{immediate:!0});var v=computed((function(){var t,n=e.type,i=e.shape,o=void 0===i?"default":i,r=e.ghost,a=e.block,d=e.danger,u=s.value,h=c.value,m=h&&{large:"lg",small:"sm",middle:void 0}[h]||"";return _defineProperty$P(t={},"".concat(u),!0),_defineProperty$P(t,"".concat(u,"-").concat(n),n),_defineProperty$P(t,"".concat(u,"-").concat(o),"default"!==o&&o),_defineProperty$P(t,"".concat(u,"-").concat(m),m),_defineProperty$P(t,"".concat(u,"-loading"),g.value),_defineProperty$P(t,"".concat(u,"-background-ghost"),r&&!isUnborderedButtonType(n)),_defineProperty$P(t,"".concat(u,"-two-chinese-chars"),p.value&&f.value),_defineProperty$P(t,"".concat(u,"-block"),a),_defineProperty$P(t,"".concat(u,"-dangerous"),!!d),_defineProperty$P(t,"".concat(u,"-rtl"),"rtl"===l.value),t})),_=function(){var e=d.value;if(e&&!1!==a.value){var t=e.textContent;h&&isTwoCNChar(t)?p.value||(p.value=!0):p.value&&(p.value=!1)}},C=function(t){g.value||e.disabled?t.preventDefault():o("click",t)};return watchEffect((function(){devWarning(!(e.ghost&&isUnborderedButtonType(e.type)),"Button","`link` or `text` button can't be a `ghost` button.")})),onMounted(_),onUpdated(_),onBeforeUnmount((function(){u.value&&clearTimeout(u.value)})),function(){var t,o,r=e.icon,a=void 0===r?null===(t=n.icon)||void 0===t?void 0:t.call(n):r,l=flattenChildren(null===(o=n.default)||void 0===o?void 0:o.call(n));h=1===l.length&&!a&&!isUnborderedButtonType(e.type);var c=e.type,u=e.htmlType,p=e.disabled,m=e.href,_=e.title,b=e.target,y=e.onMousedown,S=g.value?"loading":a,w=_extends$1(_extends$1({},i),{title:_,disabled:p,class:[v.value,i.class,_defineProperty$P({},"".concat(s.value,"-icon-only"),0===l.length&&!!S)],onClick:C,onMousedown:y});p||delete w.disabled;var E=a&&!g.value?a:createVNode(LoadingIcon,{existIcon:!!a,prefixCls:s.value,loading:!!g.value},null),x=l.map((function(e){return function(e,t){var n=t?" ":"";if(e.type===Text$1){var i=e.children.trim();return isTwoCNChar(i)&&(i=i.split("").join(n)),createVNode("span",null,[i])}return e}(e,h&&f.value)}));if(void 0!==m)return createVNode("a",_objectSpread2$1(_objectSpread2$1({},w),{},{href:m,target:b,ref:d}),[E,x]);var T=createVNode("button",_objectSpread2$1(_objectSpread2$1({},w),{},{ref:d,type:u}),[E,x]);return isUnborderedButtonType(c)?T:createVNode(Wave,{ref:"wave",disabled:!!g.value},{default:function(){return[T]}})}}});function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var UnreachableException=_createClass((function e(t){_classCallCheck(this,e),this.error=new Error("unreachable case: ".concat(JSON.stringify(t)))})),buttonGroupProps=function(){return{prefixCls:String,size:{type:String}}},ButtonGroup$1=defineComponent({name:"AButtonGroup",props:buttonGroupProps(),setup:function(e,t){var n=t.slots,i=useConfigInject("btn-group",e),o=i.prefixCls,r=i.direction,s=computed((function(){var t,n="";switch(e.size){case"large":n="lg";break;case"small":n="sm"}return _defineProperty$P(t={},"".concat(o.value),!0),_defineProperty$P(t,"".concat(o.value,"-").concat(n),n),_defineProperty$P(t,"".concat(o.value,"-rtl"),"rtl"===r.value),t}));return function(){var e;return createVNode("div",{class:s.value},[flattenChildren(null===(e=n.default)||void 0===e?void 0:e.call(n))])}}});Button$2.Group=ButtonGroup$1,Button$2.install=function(e){return e.component(Button$2.name,Button$2),e.component(ButtonGroup$1.name,ButtonGroup$1),e};var dropdownProps=function(){return{arrow:{type:[Boolean,Object],default:void 0},trigger:{type:[Array,String]},overlay:PropTypes$1.any,visible:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},align:{type:Object},getPopupContainer:Function,prefixCls:String,transitionName:String,placement:String,overlayClassName:String,overlayStyle:{type:Object,default:void 0},forceRender:{type:Boolean,default:void 0},mouseEnterDelay:Number,mouseLeaveDelay:Number,openClassName:String,minOverlayWidthMatchTrigger:{type:Boolean,default:void 0},destroyPopupOnHide:{type:Boolean,default:void 0},onVisibleChange:{type:Function},"onUpdate:visible":{type:Function}}},buttonTypesProps=buttonTypes(),dropdownButtonProps=function(){return _extends$1(_extends$1({},dropdownProps()),{type:buttonTypesProps.type,size:String,htmlType:buttonTypesProps.htmlType,href:String,disabled:{type:Boolean,default:void 0},prefixCls:String,icon:PropTypes$1.any,title:String,loading:buttonTypesProps.loading,onClick:{type:Function}})},EllipsisOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},EllipsisOutlinedSvg=EllipsisOutlined$2;function _objectSpread$x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$x(e,t,n[t])}))}return e}function _defineProperty$x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var EllipsisOutlined=function(e,t){var n=_objectSpread$x({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$x({},n,{icon:EllipsisOutlinedSvg}),null)};EllipsisOutlined.displayName="EllipsisOutlined",EllipsisOutlined.inheritAttrs=!1;var EllipsisOutlined$1=EllipsisOutlined,__rest$q=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},ButtonGroup=Button$2.Group,DropdownButton=defineComponent({name:"ADropdownButton",inheritAttrs:!1,__ANT_BUTTON:!0,props:initDefaultProps$1(dropdownButtonProps(),{trigger:"hover",placement:"bottomRight",type:"default"}),slots:["icon","leftButton","rightButton","overlay"],setup:function(e,t){var n=t.slots,i=t.attrs,o=t.emit,r=function(e){o("update:visible",e),o("visibleChange",e)},s=useConfigInject("dropdown-button",e),a=s.prefixCls,l=s.direction,c=s.getPopupContainer;return function(){var t,o,s=_extends$1(_extends$1({},e),i),d=s.type,u=void 0===d?"default":d,h=s.disabled,g=s.loading,p=s.htmlType,f=s.class,m=void 0===f?"":f,v=s.overlay,_=void 0===v?null===(t=n.overlay)||void 0===t?void 0:t.call(n):v,C=s.trigger,b=s.align,y=s.visible;s.onVisibleChange;var S=s.placement,w=void 0===S?"rtl"===l.value?"bottomLeft":"bottomRight":S,E=s.href,x=s.title,T=s.icon,I=void 0===T?(null===(o=n.icon)||void 0===o?void 0:o.call(n))||createVNode(EllipsisOutlined$1,null,null):T,k=s.mouseEnterDelay,L=s.mouseLeaveDelay,D=s.overlayClassName,N=s.overlayStyle,O=s.destroyPopupOnHide,A=s.onClick;s["onUpdate:visible"];var P=__rest$q(s,["type","disabled","loading","htmlType","class","overlay","trigger","align","visible","onVisibleChange","placement","href","title","icon","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","onClick","onUpdate:visible"]),R={align:b,disabled:h,trigger:h?[]:C,placement:w,getPopupContainer:c.value,onVisibleChange:r,mouseEnterDelay:k,mouseLeaveDelay:L,visible:y,overlayClassName:D,overlayStyle:N,destroyPopupOnHide:O},M=createVNode(Button$2,{type:u,disabled:h,loading:g,onClick:A,htmlType:p,href:E,title:x},{default:n.default}),$=createVNode(Button$2,{type:u,icon:I},null);return createVNode(ButtonGroup,_objectSpread2$1(_objectSpread2$1({},P),{},{class:classNames(a.value,m)}),{default:function(){return[n.leftButton?n.leftButton({button:M}):M,createVNode(Dropdown$1,R,{default:function(){return[n.rightButton?n.rightButton({button:$}):$]},overlay:function(){return _}})]}})}}}),RightOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},RightOutlinedSvg=RightOutlined$2;function _objectSpread$w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$w(e,t,n[t])}))}return e}function _defineProperty$w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var RightOutlined=function(e,t){var n=_objectSpread$w({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$w({},n,{icon:RightOutlinedSvg}),null)};RightOutlined.displayName="RightOutlined",RightOutlined.inheritAttrs=!1;var RightOutlined$1=RightOutlined,Dropdown=defineComponent({name:"ADropdown",inheritAttrs:!1,props:initDefaultProps$1(dropdownProps(),{mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:"bottomLeft",trigger:"hover"}),slots:["overlay"],setup:function(e,t){var n=t.slots,i=t.attrs,o=t.emit,r=useConfigInject("dropdown",e),s=r.prefixCls,a=r.rootPrefixCls,l=r.direction,c=r.getPopupContainer,d=computed((function(){var t=e.placement,n=void 0===t?"":t,i=e.transitionName;return void 0!==i?i:n.indexOf("top")>=0?"".concat(a.value,"-slide-down"):"".concat(a.value,"-slide-up")})),u=function(){var t,i,o,r=e.overlay||(null===(t=n.overlay)||void 0===t?void 0:t.call(n)),a=Array.isArray(r)?r[0]:r;if(!a)return null;var l=a.props||{};devWarning(!l.mode||"vertical"===l.mode,"Dropdown",'mode="'.concat(l.mode,"\" is not supported for Dropdown's Menu."));var c=l.selectable,d=void 0!==c&&c,u=l.expandIcon,h=void 0===u?null===(o=null===(i=a.children)||void 0===i?void 0:i.expandIcon)||void 0===o?void 0:o.call(i):u,g=void 0!==h&&isValidElement(h)?h:createVNode("span",{class:"".concat(s.value,"-menu-submenu-arrow")},[createVNode(RightOutlined$1,{class:"".concat(s.value,"-menu-submenu-arrow-icon")},null)]);return isValidElement(a)?cloneElement(a,{mode:"vertical",selectable:d,expandIcon:function(){return g}}):a},h=computed((function(){var t=e.placement;if(!t)return"rtl"===l.value?"bottomRight":"bottomLeft";if(t.includes("Center")){var n=t.slice(0,t.indexOf("Center"));return devWarning(!t.includes("Center"),"Dropdown","You are using '".concat(t,"' placement in Dropdown, which is deprecated. Try to use '").concat(n,"' instead.")),n}return t})),g=function(e){o("update:visible",e),o("visibleChange",e)};return function(){var t,o,r,a=e.arrow,p=e.trigger,f=e.disabled,m=e.overlayClassName,v=null===(t=n.default)||void 0===t?void 0:t.call(n)[0],_=cloneElement(v,_extends$1({class:classNames(null===(o=null==v?void 0:v.props)||void 0===o?void 0:o.class,_defineProperty$P({},"".concat(s.value,"-rtl"),"rtl"===l.value),"".concat(s.value,"-trigger"))},f?{disabled:f}:{})),C=classNames(m,_defineProperty$P({},"".concat(s.value,"-rtl"),"rtl"===l.value)),b=f?[]:p;b&&-1!==b.indexOf("contextmenu")&&(r=!0);var y=getPlacements({arrowPointAtCenter:"object"===_typeof$3(a)&&a.pointAtCenter,autoAdjustOverflow:!0}),S=omit$2(_extends$1(_extends$1(_extends$1({},e),i),{builtinPlacements:y,overlayClassName:C,arrow:a,alignPoint:r,prefixCls:s.value,getPopupContainer:c.value,transitionName:d.value,trigger:b,onVisibleChange:g,placement:h.value}),["overlay","onUpdate:visible"]);return createVNode(Dropdown$2,S,{default:function(){return[_]},overlay:u})}}});Dropdown.Button=DropdownButton;var Dropdown$1=Dropdown;function shallowEqual(e,t,n,i){var o=n?n.call(i,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!==_typeof$3(e)||!e||"object"!==_typeof$3(t)||!t)return!1;var r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),l=0;l<r.length;l++){var c=r[l];if(!a(c))return!1;var d=e[c],u=t[c];if(!1===(o=n?n.call(i,d,u,c):void 0)||void 0===o&&d!==u)return!1}return!0}function shallowequal(e,t,n,i){return shallowEqual(toRaw(e),toRaw(t),n,i)}var MenuContextKey=Symbol("menuContextKey"),useProvideMenu=function(e){provide(MenuContextKey,e)},useInjectMenu=function(){return inject(MenuContextKey)},ForceRenderKey=Symbol("ForceRenderKey"),useProvideForceRender=function(e){provide(ForceRenderKey,e)},useInjectForceRender=function(){return inject(ForceRenderKey,!1)},MenuFirstLevelContextKey=Symbol("menuFirstLevelContextKey"),useProvideFirstLevel=function(e){provide(MenuFirstLevelContextKey,e)},useInjectFirstLevel=function(){return inject(MenuFirstLevelContextKey,!0)},MenuContextProvider=defineComponent({name:"MenuContextProvider",inheritAttrs:!1,props:{mode:{type:String,default:void 0},overflowDisabled:{type:Boolean,default:void 0},isRootMenu:{type:Boolean,default:void 0}},setup:function(e,t){var n=t.slots,i=_extends$1({},useInjectMenu());return void 0!==e.mode&&(i.mode=toRef(e,"mode")),void 0!==e.isRootMenu&&(i.isRootMenu=toRef(e,"isRootMenu")),void 0!==e.overflowDisabled&&(i.overflowDisabled=toRef(e,"overflowDisabled")),useProvideMenu(i),function(){var e;return null===(e=n.default)||void 0===e?void 0:e.call(n)}}}),useProvideMenu$1=useProvideMenu;function baseFindIndex(e,t,n,i){for(var o=e.length,r=n+(i?1:-1);i?r--:++r<o;)if(t(e[r],r,e))return r;return-1}function baseIsNaN(e){return e!=e}function strictIndexOf(e,t,n){for(var i=n-1,o=e.length;++i<o;)if(e[i]===t)return i;return-1}function baseIndexOf(e,t,n){return t==t?strictIndexOf(e,t,n):baseFindIndex(e,baseIsNaN,n)}function arrayIncludes(e,t){return!!(null==e?0:e.length)&&baseIndexOf(e,t,0)>-1}function arrayIncludesWith(e,t,n){for(var i=-1,o=null==e?0:e.length;++i<o;)if(n(t,e[i]))return!0;return!1}function noop$2(){}var INFINITY$3=1/0,createSet=Set$2&&1/setToArray(new Set$2([,-0]))[1]==INFINITY$3?function(e){return new Set$2(e)}:noop$2,createSet$1=createSet,LARGE_ARRAY_SIZE=200;function baseUniq(e,t,n){var i=-1,o=arrayIncludes,r=e.length,s=!0,a=[],l=a;if(n)s=!1,o=arrayIncludesWith;else if(r>=LARGE_ARRAY_SIZE){var c=t?null:createSet$1(e);if(c)return setToArray(c);s=!1,o=cacheHas,l=new SetCache}else l=t?[]:a;e:for(;++i<r;){var d=e[i],u=t?t(d):d;if(d=n||0!==d?d:0,s&&u==u){for(var h=l.length;h--;)if(l[h]===u)continue e;t&&l.push(u),a.push(d)}else o(l,u,n)||(l!==a&&l.push(u),a.push(d))}return a}function uniq(e){return e&&e.length?baseUniq(e):[]}var SiderCollapsedKey=Symbol("siderCollapsed"),OVERFLOW_KEY="$$__vc-menu-more__key",KeyPathContext=Symbol("KeyPathContext"),useInjectKeyPath=function(){return inject(KeyPathContext,{parentEventKeys:computed((function(){return[]})),parentKeys:computed((function(){return[]})),parentInfo:{}})},useProvideKeyPath=function(e,t,n){var i=useInjectKeyPath(),o=i.parentEventKeys,r=i.parentKeys,s=computed((function(){return[].concat(_toConsumableArray$2(o.value),[e])})),a=computed((function(){return[].concat(_toConsumableArray$2(r.value),[t])}));return provide(KeyPathContext,{parentEventKeys:s,parentKeys:a,parentInfo:n}),a},measure$1=Symbol("measure"),PathContext=defineComponent({setup:function(e,t){var n=t.slots;return provide(measure$1,!0),function(){var e;return null===(e=n.default)||void 0===e?void 0:e.call(n)}}}),useMeasure=function(){return inject(measure$1,!1)},useProvideKeyPath$1=useProvideKeyPath;function useDirectionStyle(e){var t=useInjectMenu(),n=t.mode,i=t.rtl,o=t.inlineIndent;return computed((function(){return"inline"!==n.value?null:i.value?{paddingRight:"".concat(e.value*o.value,"px")}:{paddingLeft:"".concat(e.value*o.value,"px")}}))}var indexGuid$3=0,menuItemProps=function(){return{id:String,role:String,disabled:Boolean,danger:Boolean,title:{type:[String,Boolean],default:void 0},icon:PropTypes$1.any,onMouseenter:Function,onMouseleave:Function,onClick:Function,onKeydown:Function,onFocus:Function}},__unplugin_components_0$5=defineComponent({name:"AMenuItem",inheritAttrs:!1,props:menuItemProps(),slots:["icon","title"],setup:function(e,t){var n=t.slots,i=t.emit,o=t.attrs,r=getCurrentInstance(),s=useMeasure(),a="symbol"===_typeof$3(r.vnode.key)?String(r.vnode.key):r.vnode.key;devWarning("symbol"!==_typeof$3(r.vnode.key),"MenuItem",'MenuItem `:key="'.concat(String(a),'"` not support Symbol type'));var l="menu_item_".concat(++indexGuid$3,"_$$_").concat(a),c=useInjectKeyPath(),d=c.parentEventKeys,u=c.parentKeys,h=useInjectMenu(),g=h.prefixCls,p=h.activeKeys,f=h.disabled,m=h.changeActiveKeys,v=h.rtl,_=h.inlineCollapsed,C=h.siderCollapsed,b=h.onItemClick,y=h.selectedKeys,S=h.registerMenuInfo,w=h.unRegisterMenuInfo,E=useInjectFirstLevel(),x=ref(!1),T=computed((function(){return[].concat(_toConsumableArray$2(u.value),[a])}));S(l,{eventKey:l,key:a,parentEventKeys:d,parentKeys:u,isLeaf:!0}),onBeforeUnmount((function(){w(l)})),watch(p,(function(){x.value=!!p.value.find((function(e){return e===a}))}),{immediate:!0});var I=computed((function(){return f.value||e.disabled})),k=computed((function(){return y.value.includes(a)})),L=computed((function(){var t,n="".concat(g.value,"-item");return _defineProperty$P(t={},"".concat(n),!0),_defineProperty$P(t,"".concat(n,"-danger"),e.danger),_defineProperty$P(t,"".concat(n,"-active"),x.value),_defineProperty$P(t,"".concat(n,"-selected"),k.value),_defineProperty$P(t,"".concat(n,"-disabled"),I.value),t})),D=function(t){return{key:a,eventKey:l,keyPath:T.value,eventKeyPath:[].concat(_toConsumableArray$2(d.value),[l]),domEvent:t,item:_extends$1(_extends$1({},e),o)}},N=function(e){if(!I.value){var t=D(e);i("click",e),b(t)}},O=function(e){I.value||(m(T.value),i("mouseenter",e))},A=function(e){I.value||(m([]),i("mouseleave",e))},P=function(e){if(i("keydown",e),e.which===KeyCode$3.ENTER){var t=D(e);i("click",e),b(t)}},R=function(e){m(T.value),i("focus",e)},M=function(e,t){var n=createVNode("span",{class:"".concat(g.value,"-title-content")},[t]);return(!e||isValidElement(t)&&"span"===t.type)&&t&&_.value&&E&&"string"==typeof t?createVNode("div",{class:"".concat(g.value,"-inline-collapsed-noicon")},[t.charAt(0)]):n},$=useDirectionStyle(computed((function(){return T.value.length})));return function(){var t,i,r,l;if(s)return null;var c=null!==(i=e.title)&&void 0!==i?i:null===(r=n.title)||void 0===r?void 0:r.call(n),d=flattenChildren(null===(l=n.default)||void 0===l?void 0:l.call(n)),u=d.length,h=c;void 0===c?h=E&&u?d:"":!1===c&&(h="");var p={title:h};C.value||_.value||(p.title=null,p.visible=!1);var f={};"option"===e.role&&(f["aria-selected"]=k.value);var m=getPropsSlot(n,e,"icon");return createVNode(__unplugin_components_2$3,_objectSpread2$1(_objectSpread2$1({},p),{},{placement:v.value?"left":"right",overlayClassName:"".concat(g.value,"-inline-collapsed-tooltip")}),{default:function(){return[createVNode(Overflow$1.Item,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({component:"li"},o),{},{id:e.id,style:_extends$1(_extends$1({},o.style||{}),$.value),class:[L.value,(t={},_defineProperty$P(t,"".concat(o.class),!!o.class),_defineProperty$P(t,"".concat(g.value,"-item-only-child"),1===(m?u+1:u)),t)],role:e.role||"menuitem",tabindex:e.disabled?null:-1,"data-menu-id":a,"aria-disabled":e.disabled},f),{},{onMouseenter:O,onMouseleave:A,onClick:N,onKeydown:P,onFocus:R,title:"string"==typeof c?c:void 0}),{default:function(){return[cloneElement(m,{class:"".concat(g.value,"-item-icon")},!1),M(m,d)]}})]}})}}}),autoAdjustOverflow={adjustX:1,adjustY:1},placements={topLeft:{points:["bl","tl"],overflow:autoAdjustOverflow,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:autoAdjustOverflow,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:autoAdjustOverflow,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:autoAdjustOverflow,offset:[4,0]}},placementsRtl={topLeft:{points:["bl","tl"],overflow:autoAdjustOverflow,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:autoAdjustOverflow,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:autoAdjustOverflow,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:autoAdjustOverflow,offset:[4,0]}},popupPlacementMap={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},PopupTrigger=defineComponent({name:"PopupTrigger",inheritAttrs:!1,props:{prefixCls:String,mode:String,visible:Boolean,popupClassName:String,popupOffset:Array,disabled:Boolean,onVisibleChange:Function},slots:["popup"],emits:["visibleChange"],setup:function(e,t){var n=t.slots,i=t.emit,o=ref(!1),r=useInjectMenu(),s=r.getPopupContainer,a=r.rtl,l=r.subMenuOpenDelay,c=r.subMenuCloseDelay,d=r.builtinPlacements,u=r.triggerSubMenuAction,h=r.isRootMenu,g=r.forceSubMenuRender,p=r.motion,f=r.defaultMotions,m=useInjectForceRender(),v=computed((function(){return a.value?_extends$1(_extends$1({},placementsRtl),d.value):_extends$1(_extends$1({},placements),d.value)})),_=computed((function(){return popupPlacementMap[e.mode]})),C=ref();watch((function(){return e.visible}),(function(e){wrapperRaf.cancel(C.value),C.value=wrapperRaf((function(){o.value=e}))}),{immediate:!0}),onBeforeUnmount((function(){wrapperRaf.cancel(C.value)}));var b=function(e){i("visibleChange",e)},y=computed((function(){var t,n,i=p.value||(null===(t=f.value)||void 0===t?void 0:t[e.mode])||(null===(n=f.value)||void 0===n?void 0:n.other),o="function"==typeof i?i():i;return o?getTransitionProps(o.name,{css:!0}):void 0}));return function(){var t=e.prefixCls,i=e.popupClassName,r=e.mode,d=e.popupOffset,p=e.disabled;return createVNode(Trigger,{prefixCls:t,popupClassName:classNames("".concat(t,"-popup"),_defineProperty$P({},"".concat(t,"-rtl"),a.value),i),stretch:"horizontal"===r?"minWidth":null,getPopupContainer:h.value?s.value:function(e){return e.parentNode},builtinPlacements:v.value,popupPlacement:_.value,popupVisible:o.value,popupAlign:d&&{offset:d},action:p?[]:[u.value],mouseEnterDelay:l.value,mouseLeaveDelay:c.value,onPopupVisibleChange:b,forceRender:m||g.value,popupAnimation:y.value},{popup:n.popup,default:n.default})}}}),InternalSubMenuList=function(e,t){var n,i=t.slots,o=t.attrs,r=useInjectMenu(),s=r.prefixCls,a=r.mode;return createVNode("ul",_objectSpread2$1(_objectSpread2$1({},o),{},{class:classNames(s.value,"".concat(s.value,"-sub"),"".concat(s.value,"-").concat("inline"===a.value?"inline":"vertical")),"data-menu-list":!0}),[null===(n=i.default)||void 0===n?void 0:n.call(i)])};InternalSubMenuList.displayName="SubMenuList";var SubMenuList=InternalSubMenuList,InlineSubMenuList=defineComponent({name:"InlineSubMenuList",inheritAttrs:!1,props:{id:String,open:Boolean,keyPath:Array},setup:function(e,t){var n=t.slots,i=computed((function(){return"inline"})),o=useInjectMenu(),r=o.motion,s=o.mode,a=o.defaultMotions,l=computed((function(){return s.value===i.value})),c=ref(!l.value),d=computed((function(){return!!l.value&&e.open}));watch(s,(function(){l.value&&(c.value=!1)}),{flush:"post"});var u=computed((function(){var t,n,o=r.value||(null===(t=a.value)||void 0===t?void 0:t[i.value])||(null===(n=a.value)||void 0===n?void 0:n.other);return _extends$1(_extends$1({},"function"==typeof o?o():o),{appear:e.keyPath.length<=1})}));return function(){var t;return c.value?null:createVNode(MenuContextProvider,{mode:i.value},{default:function(){return[createVNode(Transition,u.value,{default:function(){return[withDirectives(createVNode(SubMenuList,{id:e.id},{default:function(){return[null===(t=n.default)||void 0===t?void 0:t.call(n)]}}),[[vShow,d.value]])]}})]}})}}}),indexGuid$2=0,subMenuProps=function(){return{icon:PropTypes$1.any,title:PropTypes$1.any,disabled:Boolean,level:Number,popupClassName:String,popupOffset:Array,internalPopupClose:Boolean,eventKey:String,expandIcon:Function,onMouseenter:Function,onMouseleave:Function,onTitleClick:Function}},__unplugin_components_0$4=defineComponent({name:"ASubMenu",inheritAttrs:!1,props:subMenuProps(),slots:["icon","title","expandIcon"],setup:function(e,t){var n,i,o=t.slots,r=t.attrs,s=t.emit;useProvideFirstLevel(!1);var a=useMeasure(),l=getCurrentInstance(),c="symbol"===_typeof$3(l.vnode.key)?String(l.vnode.key):l.vnode.key;devWarning("symbol"!==_typeof$3(l.vnode.key),"SubMenu",'SubMenu `:key="'.concat(String(c),'"` not support Symbol type'));var d=isValid$3(c)?c:"sub_menu_".concat(++indexGuid$2,"_$$_not_set_key"),u=null!==(n=e.eventKey)&&void 0!==n?n:isValid$3(c)?"sub_menu_".concat(++indexGuid$2,"_$$_").concat(c):d,h=useInjectKeyPath(),g=h.parentEventKeys,p=h.parentInfo,f=h.parentKeys,m=computed((function(){return[].concat(_toConsumableArray$2(f.value),[d])})),v=ref([]),_={eventKey:u,key:d,parentEventKeys:g,childrenEventKeys:v,parentKeys:f};null===(i=p.childrenEventKeys)||void 0===i||i.value.push(u),onBeforeUnmount((function(){var e;p.childrenEventKeys&&(p.childrenEventKeys.value=null===(e=p.childrenEventKeys)||void 0===e?void 0:e.value.filter((function(e){return e!=u})))})),useProvideKeyPath$1(u,d,_);var C=useInjectMenu(),b=C.prefixCls,y=C.activeKeys,S=C.disabled,w=C.changeActiveKeys,E=C.mode,x=C.inlineCollapsed,T=C.antdMenuTheme,I=C.openKeys,k=C.overflowDisabled,L=C.onOpenChange,D=C.registerMenuInfo,N=C.unRegisterMenuInfo,O=C.selectedSubMenuKeys,A=C.expandIcon,P=null!=c,R=!a&&(useInjectForceRender()||!P);useProvideForceRender(R),(a&&P||!a&&!P||R)&&(D(u,_),onBeforeUnmount((function(){N(u)})));var M=computed((function(){return"".concat(b.value,"-submenu")})),$=computed((function(){return S.value||e.disabled})),F=ref(),B=ref(),V=computed((function(){return I.value.includes(d)})),W=computed((function(){return!k.value&&V.value})),H=computed((function(){return O.value.includes(d)})),z=ref(!1);watch(y,(function(){z.value=!!y.value.find((function(e){return e===d}))}),{immediate:!0});var K=function(e){$.value||(s("titleClick",e,d),"inline"===E.value&&L(d,!V.value))},j=function(e){$.value||(w(m.value),s("mouseenter",e))},U=function(e){$.value||(w([]),s("mouseleave",e))},G=useDirectionStyle(computed((function(){return m.value.length}))),q=function(e){"inline"!==E.value&&L(d,e)},Y=function(){w(m.value)},X=u&&"".concat(u,"-popup"),Z=computed((function(){return classNames(b.value,"".concat(b.value,"-").concat(T.value),e.popupClassName)})),Q=computed((function(){return"inline"!==E.value&&m.value.length>1?"vertical":E.value})),J=computed((function(){return"horizontal"===E.value?"vertical":E.value})),ee=computed((function(){return"horizontal"===Q.value?"vertical":Q.value})),te=function(){var t=M.value,n=getPropsSlot(o,e,"icon"),i=e.expandIcon||o.expandIcon||A.value,r=function(e,t){if(!t)return x.value&&!f.value.length&&e&&"string"==typeof e?createVNode("div",{class:"".concat(b.value,"-inline-collapsed-noicon")},[e.charAt(0)]):createVNode("span",{class:"".concat(b.value,"-title-content")},[e]);var n=isValidElement(e)&&"span"===e.type;return createVNode(Fragment,null,[cloneElement(t,{class:"".concat(b.value,"-item-icon")},!1),n?e:createVNode("span",{class:"".concat(b.value,"-title-content")},[e])])}(getPropsSlot(o,e,"title"),n);return createVNode("div",{style:G.value,class:"".concat(t,"-title"),tabindex:$.value?null:-1,ref:F,title:"string"==typeof r?r:null,"data-menu-id":d,"aria-expanded":W.value,"aria-haspopup":!0,"aria-controls":X,"aria-disabled":$.value,onClick:K,onFocus:Y},[r,"horizontal"!==E.value&&i?i(_extends$1(_extends$1({},e),{isOpen:W.value})):createVNode("i",{class:"".concat(t,"-arrow")},null)])};return function(){var t,n;if(a)return P?null===(n=o.default)||void 0===n?void 0:n.call(o):null;var i=M.value,s=function(){return null};return s=k.value||"inline"===E.value?function(){return createVNode(PopupTrigger,null,{default:te})}:function(){return createVNode(PopupTrigger,{mode:Q.value,prefixCls:i,visible:!e.internalPopupClose&&W.value,popupClassName:Z.value,popupOffset:e.popupOffset,disabled:$.value,onVisibleChange:q},{default:function(){return[te()]},popup:function(){return createVNode(MenuContextProvider,{mode:ee.value,isRootMenu:!1},{default:function(){return[createVNode(SubMenuList,{id:X,ref:B},{default:o.default})]}})}})},createVNode(MenuContextProvider,{mode:J.value},{default:function(){return[createVNode(Overflow$1.Item,_objectSpread2$1(_objectSpread2$1({component:"li"},r),{},{role:"none",class:classNames(i,"".concat(i,"-").concat(E.value),r.class,(t={},_defineProperty$P(t,"".concat(i,"-open"),W.value),_defineProperty$P(t,"".concat(i,"-active"),z.value),_defineProperty$P(t,"".concat(i,"-selected"),H.value),_defineProperty$P(t,"".concat(i,"-disabled"),$.value),t)),onMouseenter:j,onMouseleave:U,"data-submenu-id":d}),{default:function(){return createVNode(Fragment,null,[s(),!k.value&&createVNode(InlineSubMenuList,{id:X,open:W.value,keyPath:m.value},{default:o.default})])}})]}})}}});function hasClass(e,t){if(e.classList)return e.classList.contains(t);var n=e.className;return" ".concat(n," ").indexOf(" ".concat(t," "))>-1}function addClass(e,t){e.classList?e.classList.add(t):hasClass(e,t)||(e.className="".concat(e.className," ").concat(t))}function removeClass(e,t){if(e.classList)e.classList.remove(t);else if(hasClass(e,t)){var n=e.className;e.className=" ".concat(n," ").replace(" ".concat(t," ")," ")}}var collapseMotion=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ant-motion-collapse",t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{name:e,appear:t,css:!0,onBeforeEnter:function(t){t.style.height="0px",t.style.opacity="0",addClass(t,e)},onEnter:function(e){nextTick((function(){e.style.height="".concat(e.scrollHeight,"px"),e.style.opacity="1"}))},onAfterEnter:function(t){t&&(removeClass(t,e),t.style.height=null,t.style.opacity=null)},onBeforeLeave:function(t){addClass(t,e),t.style.height="".concat(t.offsetHeight,"px"),t.style.opacity=null},onLeave:function(e){setTimeout((function(){e.style.height="0px",e.style.opacity="0"}))},onAfterLeave:function(t){t&&(removeClass(t,e),t.style&&(t.style.height=null,t.style.opacity=null))}}},collapseMotion$1=collapseMotion,menuProps=function(){return{id:String,prefixCls:String,disabled:Boolean,inlineCollapsed:Boolean,disabledOverflow:Boolean,forceSubMenuRender:Boolean,openKeys:Array,selectedKeys:Array,activeKey:String,selectable:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},motion:Object,theme:{type:String,default:"light"},mode:{type:String,default:"vertical"},inlineIndent:{type:Number,default:24},subMenuOpenDelay:{type:Number,default:.1},subMenuCloseDelay:{type:Number,default:.1},builtinPlacements:{type:Object},triggerSubMenuAction:{type:String,default:"hover"},getPopupContainer:Function,expandIcon:Function,onOpenChange:Function,onSelect:Function,onDeselect:Function,onClick:[Function,Array],onFocus:Function,onBlur:Function,onMousedown:Function,"onUpdate:openKeys":Function,"onUpdate:selectedKeys":Function,"onUpdate:activeKey":Function}},EMPTY_LIST$2=[],Menu$2=defineComponent({name:"AMenu",inheritAttrs:!1,props:menuProps(),slots:["expandIcon","overflowedIndicator"],setup:function(e,t){var n=t.slots,i=t.emit,o=t.attrs,r=useConfigInject("menu",e),s=r.prefixCls,a=r.direction,l=r.getPrefixCls,c=ref({}),d=inject(SiderCollapsedKey,ref(void 0)),u=computed((function(){return void 0!==d.value?d.value:e.inlineCollapsed})),h=ref(!1);onMounted((function(){h.value=!0})),watchEffect((function(){devWarning(!(!0===e.inlineCollapsed&&"inline"!==e.mode),"Menu","`inlineCollapsed` should only be used when `mode` is inline."),devWarning(!(void 0!==d.value&&!0===e.inlineCollapsed),"Menu","`inlineCollapsed` not control Menu under Sider. Should set `collapsed` on Sider instead.")}));var g=ref([]),p=ref([]),f=ref({});watch(c,(function(){for(var e={},t=0,n=Object.values(c.value);t<n.length;t++){var i=n[t];e[i.key]=i}f.value=e}),{flush:"post"}),watchEffect((function(){if(void 0!==e.activeKey){var t=[],n=e.activeKey?f.value[e.activeKey]:void 0;t=n&&void 0!==e.activeKey?uniq([].concat(unref(n.parentKeys),e.activeKey)):[],shallowequal(g.value,t)||(g.value=t)}})),watch((function(){return e.selectedKeys}),(function(e){e&&(p.value=e.slice())}),{immediate:!0,deep:!0});var m=ref([]);watch([f,p],(function(){var e=[];p.value.forEach((function(t){var n=f.value[t];n&&(e=e.concat(unref(n.parentKeys)))})),e=uniq(e),shallowequal(m.value,e)||(m.value=e)}),{immediate:!0});var v,_=ref([]);watch((function(){return e.openKeys}),(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_.value;shallowequal(_.value,e)||(_.value=e.slice())}),{immediate:!0,deep:!0});var C=computed((function(){return!!e.disabled})),b=computed((function(){return"rtl"===a.value})),y=ref("vertical"),S=ref(!1);watchEffect((function(){"inline"!==e.mode&&"vertical"!==e.mode||!u.value?(y.value=e.mode,S.value=!1):(y.value="vertical",S.value=u.value)}));var w=computed((function(){return"inline"===y.value})),E=function(e){_.value=e,i("update:openKeys",e),i("openChange",e)},x=ref(_.value),T=ref(!1);watch(_,(function(){w.value&&(x.value=_.value)}),{immediate:!0}),watch(w,(function(){T.value?w.value?_.value=x.value:E(EMPTY_LIST$2):T.value=!0}),{immediate:!0});var I=computed((function(){var t;return _defineProperty$P(t={},"".concat(s.value),!0),_defineProperty$P(t,"".concat(s.value,"-root"),!0),_defineProperty$P(t,"".concat(s.value,"-").concat(y.value),!0),_defineProperty$P(t,"".concat(s.value,"-inline-collapsed"),S.value),_defineProperty$P(t,"".concat(s.value,"-rtl"),b.value),_defineProperty$P(t,"".concat(s.value,"-").concat(e.theme),!0),t})),k=computed((function(){return l()})),L=computed((function(){return{horizontal:{name:"".concat(k.value,"-slide-up")},inline:collapseMotion$1,other:{name:"".concat(k.value,"-zoom-big")}}}));useProvideFirstLevel(!0);var D=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],i=c.value;return t.forEach((function(t){var o=i[t],r=o.key,s=o.childrenEventKeys;n.push.apply(n,[r].concat(_toConsumableArray$2(e(unref(s)))))})),n},N=ref(0),O=computed((function(){return e.expandIcon||n.expandIcon?function(t){var i=e.expandIcon||n.expandIcon;return cloneElement(i="function"==typeof i?i(t):i,{class:"".concat(s.value,"-submenu-expand-icon")},!1)}:null}));return useProvideMenu$1({store:c,prefixCls:s,activeKeys:g,openKeys:_,selectedKeys:p,changeActiveKeys:function(t){clearTimeout(v),v=setTimeout((function(){void 0===e.activeKey&&(g.value=t),i("update:activeKey",t[t.length-1])}))},disabled:C,rtl:b,mode:y,inlineIndent:computed((function(){return e.inlineIndent})),subMenuCloseDelay:computed((function(){return e.subMenuCloseDelay})),subMenuOpenDelay:computed((function(){return e.subMenuOpenDelay})),builtinPlacements:computed((function(){return e.builtinPlacements})),triggerSubMenuAction:computed((function(){return e.triggerSubMenuAction})),getPopupContainer:computed((function(){return e.getPopupContainer})),inlineCollapsed:S,antdMenuTheme:computed((function(){return e.theme})),siderCollapsed:d,defaultMotions:computed((function(){return h.value?L.value:null})),motion:computed((function(){return h.value?e.motion:null})),overflowDisabled:ref(void 0),onOpenChange:function(e,t){var n=f.value[e].childrenEventKeys,i=_.value.filter((function(t){return t!==e}));if(t)i.push(e);else if("inline"!==y.value){var o=D(unref(n));i=uniq(i.filter((function(e){return!o.includes(e)})))}shallowequal(_,i)||E(i)},onItemClick:function(t){i("click",t),function(t){if(e.selectable){var n,o=t.key,r=p.value.includes(o);n=e.multiple?r?p.value.filter((function(e){return e!==o})):[].concat(_toConsumableArray$2(p.value),[o]):[o];var s=_extends$1(_extends$1({},t),{selectedKeys:n});shallowequal(n,p.value)||(void 0===e.selectedKeys&&(p.value=n),i("update:selectedKeys",n),r&&e.multiple?i("deselect",s):i("select",s)),"inline"!==y.value&&!e.multiple&&_.value.length&&E(EMPTY_LIST$2)}}(t)},registerMenuInfo:function(e,t){c.value=_extends$1(_extends$1({},c.value),_defineProperty$P({},e,t))},unRegisterMenuInfo:function(e){delete c.value[e],c.value=_extends$1({},c.value)},selectedSubMenuKeys:m,isRootMenu:ref(!0),expandIcon:O,forceSubMenuRender:computed((function(){return e.forceSubMenuRender}))}),function(){var t,i,r=flattenChildren(null===(t=n.default)||void 0===t?void 0:t.call(n)),a=N.value>=r.length-1||"horizontal"!==y.value||e.disabledOverflow,l="horizontal"!==y.value||e.disabledOverflow?r:r.map((function(e,t){return createVNode(MenuContextProvider,{key:e.key,overflowDisabled:t>N.value},{default:function(){return e}})})),c=(null===(i=n.overflowedIndicator)||void 0===i?void 0:i.call(n))||createVNode(EllipsisOutlined$1,null,null);return createVNode(Overflow$1,_objectSpread2$1(_objectSpread2$1({},o),{},{onMousedown:e.onMousedown,prefixCls:"".concat(s.value,"-overflow"),component:"ul",itemComponent:__unplugin_components_0$5,class:[I.value,o.class],role:"menu",id:e.id,data:l,renderRawItem:function(e){return e},renderRawRest:function(e){var t=e.length,n=t?r.slice(-t):null;return createVNode(Fragment,null,[createVNode(__unplugin_components_0$4,{eventKey:OVERFLOW_KEY,key:OVERFLOW_KEY,title:c,disabled:a,internalPopupClose:0===t},{default:function(){return n}}),createVNode(PathContext,null,{default:function(){return[createVNode(__unplugin_components_0$4,{eventKey:OVERFLOW_KEY,key:OVERFLOW_KEY,title:c,disabled:a,internalPopupClose:0===t},{default:function(){return n}})]}})])},maxCount:"horizontal"!==y.value||e.disabledOverflow?Overflow$1.INVALIDATE:Overflow$1.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(e){N.value=e}}),{default:function(){return[createVNode(Teleport,{to:"body"},{default:function(){return[createVNode("div",{style:{display:"none"},"aria-hidden":!0},[createVNode(PathContext,null,{default:function(){return[l]}})])]}})]}})}}}),menuItemGroupProps=function(){return{title:PropTypes$1.any}},ItemGroup=defineComponent({name:"AMenuItemGroup",inheritAttrs:!1,props:menuItemGroupProps(),slots:["title"],setup:function(e,t){var n=t.slots,i=t.attrs,o=useInjectMenu().prefixCls,r=computed((function(){return"".concat(o.value,"-item-group")})),s=useMeasure();return function(){var t,o;return s?null===(t=n.default)||void 0===t?void 0:t.call(n):createVNode("li",_objectSpread2$1(_objectSpread2$1({},i),{},{onClick:function(e){return e.stopPropagation()},class:r.value}),[createVNode("div",{title:"string"==typeof e.title?e.title:void 0,class:"".concat(r.value,"-title")},[getPropsSlot(n,e,"title")]),createVNode("ul",{class:"".concat(r.value,"-list")},[null===(o=n.default)||void 0===o?void 0:o.call(n)])])}}}),menuDividerProps=function(){return{prefixCls:String,dashed:Boolean}},Divider=defineComponent({name:"AMenuDivider",props:menuDividerProps(),setup:function(e){var t=useConfigInject("menu",e).prefixCls,n=computed((function(){var n;return _defineProperty$P(n={},"".concat(t.value,"-item-divider"),!0),_defineProperty$P(n,"".concat(t.value,"-item-divider-dashed"),!!e.dashed),n}));return function(){return createVNode("li",{class:n.value},null)}}});function arrayMap(e,t){for(var n=-1,i=null==e?0:e.length,o=Array(i);++n<i;)o[n]=t(e[n],n,e);return o}Menu$2.install=function(e){return e.component(Menu$2.name,Menu$2),e.component(__unplugin_components_0$5.name,__unplugin_components_0$5),e.component(__unplugin_components_0$4.name,__unplugin_components_0$4),e.component(Divider.name,Divider),e.component(ItemGroup.name,ItemGroup),e},Menu$2.Item=__unplugin_components_0$5,Menu$2.Divider=Divider,Menu$2.SubMenu=__unplugin_components_0$4,Menu$2.ItemGroup=ItemGroup;var symbolTag$2="[object Symbol]";function isSymbol$1(e){return"symbol"==typeof e||isObjectLike(e)&&baseGetTag(e)==symbolTag$2}var INFINITY$2=1/0,symbolProto$1=Symbol$2?Symbol$2.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray$4(e))return arrayMap(e,baseToString)+"";if(isSymbol$1(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY$2?"-0":t}function baseSlice(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(o);++i<o;)r[i]=e[i+t];return r}function castSlice(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:baseSlice(e,t,n)}var rsAstralRange$1="\\ud800-\\udfff",rsComboMarksRange$1="\\u0300-\\u036f",reComboHalfMarksRange$1="\\ufe20-\\ufe2f",rsComboSymbolsRange$1="\\u20d0-\\u20ff",rsComboRange$1=rsComboMarksRange$1+reComboHalfMarksRange$1+rsComboSymbolsRange$1,rsVarRange$1="\\ufe0e\\ufe0f",rsZWJ$1="\\u200d",reHasUnicode=RegExp("["+rsZWJ$1+rsAstralRange$1+rsComboRange$1+rsVarRange$1+"]");function hasUnicode(e){return reHasUnicode.test(e)}function baseProperty(e){return function(t){return null==t?void 0:t[e]}}function asciiToArray(e){return e.split("")}var rsAstralRange="\\ud800-\\udfff",rsComboMarksRange="\\u0300-\\u036f",reComboHalfMarksRange="\\ufe20-\\ufe2f",rsComboSymbolsRange="\\u20d0-\\u20ff",rsComboRange=rsComboMarksRange+reComboHalfMarksRange+rsComboSymbolsRange,rsVarRange="\\ufe0e\\ufe0f",rsAstral="["+rsAstralRange+"]",rsCombo="["+rsComboRange+"]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsModifier="(?:"+rsCombo+"|"+rsFitz+")",rsNonAstral="[^"+rsAstralRange+"]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsZWJ="\\u200d",reOptMod=rsModifier+"?",rsOptVar="["+rsVarRange+"]?",rsOptJoin="(?:"+rsZWJ+"(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")"+rsOptVar+reOptMod+")*",rsSeq=rsOptVar+reOptMod+rsOptJoin,rsSymbol="(?:"+[rsNonAstral+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,rsAstral].join("|")+")",reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g");function unicodeToArray(e){return e.match(reUnicode)||[]}function stringToArray(e){return hasUnicode(e)?unicodeToArray(e):asciiToArray(e)}var reWhitespace=/\s/;function trimmedEndIndex(e){for(var t=e.length;t--&&reWhitespace.test(e.charAt(t)););return t}var reTrimStart=/^\s+/;function baseTrim(e){return e?e.slice(0,trimmedEndIndex(e)+1).replace(reTrimStart,""):e}var NAN=NaN,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;function toNumber(e){if("number"==typeof e)return e;if(isSymbol$1(e))return NAN;if(isObject$5(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=isObject$5(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=baseTrim(e);var n=reIsBinary.test(e);return n||reIsOctal.test(e)?freeParseInt(e.slice(2),n?2:8):reIsBadHex.test(e)?NAN:+e}var INFINITY$1=1/0,MAX_INTEGER=17976931348623157e292;function toFinite(e){return e?(e=toNumber(e))===INFINITY$1||e===-INFINITY$1?(e<0?-1:1)*MAX_INTEGER:e==e?e:0:0===e?e:0}function toInteger(e){var t=toFinite(e),n=t%1;return t==t?n?t-n:t:0}function toString$1(e){return null==e?"":baseToString(e)}var __rest$p=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},checkboxProps$1={prefixCls:String,name:String,id:String,type:String,defaultChecked:{type:[Boolean,Number],default:void 0},checked:{type:[Boolean,Number],default:void 0},disabled:Boolean,tabindex:{type:[Number,String]},readonly:Boolean,autofocus:Boolean,value:PropTypes$1.any,required:Boolean},VcCheckbox=defineComponent({name:"Checkbox",inheritAttrs:!1,props:initDefaultProps$1(checkboxProps$1,{prefixCls:"rc-checkbox",type:"checkbox",defaultChecked:!1}),emits:["click","change"],setup:function(e,t){var n=t.attrs,i=t.emit,o=t.expose,r=ref(void 0===e.checked?e.defaultChecked:e.checked),s=ref();watch((function(){return e.checked}),(function(){r.value=e.checked})),o({focus:function(){var e;null===(e=s.value)||void 0===e||e.focus()},blur:function(){var e;null===(e=s.value)||void 0===e||e.blur()}});var a=ref(),l=function(t){if(!e.disabled){void 0===e.checked&&(r.value=t.target.checked),t.shiftKey=a.value;var n={target:_extends$1(_extends$1({},e),{checked:t.target.checked}),stopPropagation:function(){t.stopPropagation()},preventDefault:function(){t.preventDefault()},nativeEvent:t};void 0!==e.checked&&(s.value.checked=!!e.checked),i("change",n),a.value=!1}},c=function(e){i("click",e),a.value=e.shiftKey};return function(){var t,i=e.prefixCls,o=e.name,a=e.id,d=e.type,u=e.disabled,h=e.readonly,g=e.tabindex,p=e.autofocus,f=e.value,m=e.required,v=__rest$p(e,["prefixCls","name","id","type","disabled","readonly","tabindex","autofocus","value","required"]),_=n.class,C=n.onFocus,b=n.onBlur,y=n.onKeydown,S=n.onKeypress,w=n.onKeyup,E=_extends$1(_extends$1({},v),n),x=Object.keys(E).reduce((function(e,t){return"aria-"!==t.substr(0,5)&&"data-"!==t.substr(0,5)&&"role"!==t||(e[t]=E[t]),e}),{}),T=classNames(i,_,(_defineProperty$P(t={},"".concat(i,"-checked"),r.value),_defineProperty$P(t,"".concat(i,"-disabled"),u),t)),I=_extends$1(_extends$1({name:o,id:a,type:d,readonly:h,disabled:u,tabindex:g,class:"".concat(i,"-input"),checked:!!r.value,autofocus:p,value:f},x),{onChange:l,onClick:c,onFocus:C,onBlur:b,onKeydown:y,onKeypress:S,onKeyup:w,required:m});return createVNode("span",{class:T},[createVNode("input",_objectSpread2$1({ref:s},I),null),createVNode("span",{class:"".concat(i,"-inner")},null)])}}}),__rest$o=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},radioProps=function(){return{prefixCls:String,checked:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},isGroup:{type:Boolean,default:void 0},value:PropTypes$1.any,name:String,id:String,autofocus:{type:Boolean,default:void 0},onChange:Function,onFocus:Function,onBlur:Function,onClick:Function,"onUpdate:checked":Function,"onUpdate:value":Function}},Radio=defineComponent({name:"ARadio",props:radioProps(),setup:function(e,t){var n=t.emit,i=t.expose,o=t.slots,r=useInjectFormItemContext(),s=ref(),a=inject("radioGroupContext",void 0),l=useConfigInject("radio",e),c=l.prefixCls,d=l.direction;i({focus:function(){s.value.focus()},blur:function(){s.value.blur()}});var u=function(e){var t=e.target.checked;n("update:checked",t),n("update:value",t),n("change",e),r.onFieldChange()},h=function(e){n("change",e),a&&a.onRadioChange&&a.onRadioChange(e)};return function(){var t,n=a;e.prefixCls;var i=e.id,l=void 0===i?r.id.value:i,g=__rest$o(e,["prefixCls","id"]),p=_extends$1({prefixCls:c.value,id:l},omit$2(g,["onUpdate:checked","onUpdate:value"]));n?(p.name=n.props.name,p.onChange=h,p.checked=e.value===n.stateValue.value,p.disabled=e.disabled||n.props.disabled):p.onChange=u;var f=classNames((_defineProperty$P(t={},"".concat(c.value,"-wrapper"),!0),_defineProperty$P(t,"".concat(c.value,"-wrapper-checked"),p.checked),_defineProperty$P(t,"".concat(c.value,"-wrapper-disabled"),p.disabled),_defineProperty$P(t,"".concat(c.value,"-wrapper-rtl"),"rtl"===d.value),t));return createVNode("label",{class:f},[createVNode(VcCheckbox,_objectSpread2$1(_objectSpread2$1({},p),{},{type:"radio",ref:s}),null),o.default&&createVNode("span",null,[o.default()])])}}}),RadioGroupSizeTypes=tuple("large","default","small"),radioGroupProps=function(){return{prefixCls:String,value:PropTypes$1.any,size:PropTypes$1.oneOf(RadioGroupSizeTypes),options:{type:Array},disabled:{type:Boolean,default:void 0},name:String,buttonStyle:{type:String,default:"outline"},id:String,optionType:{type:String,default:"default"},onChange:Function,"onUpdate:value":Function}},Group$1=defineComponent({name:"ARadioGroup",props:radioGroupProps(),setup:function(e,t){var n=t.slots,i=t.emit,o=useInjectFormItemContext(),r=useConfigInject("radio",e),s=r.prefixCls,a=r.direction,l=r.size,c=ref(e.value),d=ref(!1);watch((function(){return e.value}),(function(e){c.value=e,d.value=!1}));return provide("radioGroupContext",{onRadioChange:function(t){var n=c.value,r=t.target.value;"value"in e||(c.value=r),d.value||r===n||(d.value=!0,i("update:value",r),i("change",t),o.onFieldChange()),nextTick((function(){d.value=!1}))},stateValue:c,props:e}),function(){var t,i,r=e.options,d=e.optionType,u=e.buttonStyle,h=e.id,g=void 0===h?o.id.value:h,p="".concat(s.value,"-group"),f=classNames(p,"".concat(p,"-").concat(u),(_defineProperty$P(t={},"".concat(p,"-").concat(l.value),l.value),_defineProperty$P(t,"".concat(p,"-rtl"),"rtl"===a.value),t)),m=null;if(r&&r.length>0){var v="button"===d?"".concat(s.value,"-button"):s.value;m=r.map((function(t){if("string"==typeof t||"number"==typeof t)return createVNode(Radio,{key:t,prefixCls:v,disabled:e.disabled,value:t,checked:c.value===t},{default:function(){return[t]}});var n=t.value,i=t.disabled,o=t.label;return createVNode(Radio,{key:"radio-group-value-options-".concat(n),prefixCls:v,disabled:i||e.disabled,value:n,checked:c.value===n},{default:function(){return[o]}})}))}else m=null===(i=n.default)||void 0===i?void 0:i.call(n);return createVNode("div",{class:f,id:g},[m])}}}),Button$1=defineComponent({name:"ARadioButton",props:radioProps(),setup:function(e,t){var n=t.slots,i=useConfigInject("radio-button",e).prefixCls,o=inject("radioGroupContext",void 0);return function(){var t,r=_extends$1(_extends$1({},e),{prefixCls:i.value});return o&&(r.onChange=o.onRadioChange,r.checked=r.value===o.stateValue.value,r.disabled=r.disabled||o.props.disabled),createVNode(Radio,r,{default:function(){return[null===(t=n.default)||void 0===t?void 0:t.call(n)]}})}}});function useRaf(e){var t=ref(),n=ref(!1);return onBeforeUnmount((function(){n.value=!0,wrapperRaf.cancel(t.value)})),function(){for(var i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];n.value||(wrapperRaf.cancel(t.value),t.value=wrapperRaf((function(){e.apply(void 0,o)})))}}function useRafState(e){var t=ref([]),n=ref("function"==typeof e?e():e),i=useRaf((function(){var e=n.value;t.value.forEach((function(t){e=t(e)})),t.value=[],n.value=e}));return[n,function(e){t.value.push(e),i()}]}Radio.Group=Group$1,Radio.Button=Button$1,Radio.install=function(e){return e.component(Radio.name,Radio),e.component(Radio.Group.name,Radio.Group),e.component(Radio.Button.name,Radio.Button),e};var TabNode=defineComponent({name:"TabNode",props:{id:{type:String},prefixCls:{type:String},tab:{type:Object},active:{type:Boolean},closable:{type:Boolean},editable:{type:Object},onClick:{type:Function},onResize:{type:Function},renderWrapper:{type:Function},removeAriaLabel:{type:String},onFocus:{type:Function}},emits:["click","resize","remove","focus"],setup:function(e,t){var n=t.expose,i=t.attrs,o=ref();function r(t){var n;(null===(n=e.tab)||void 0===n?void 0:n.disabled)||e.onClick(t)}n({domRef:o});var s=computed((function(){var t;return e.editable&&!1!==e.closable&&!(null===(t=e.tab)||void 0===t?void 0:t.disabled)}));return function(){var t,n,a=e.prefixCls,l=e.id,c=e.active,d=e.tab,u=d.key,h=d.tab,g=d.disabled,p=d.closeIcon,f=e.renderWrapper,m=e.removeAriaLabel,v=e.editable,_=e.onFocus,C="".concat(a,"-tab"),b=createVNode("div",{key:u,ref:o,class:classNames(C,(t={},_defineProperty$P(t,"".concat(C,"-with-remove"),s.value),_defineProperty$P(t,"".concat(C,"-active"),c),_defineProperty$P(t,"".concat(C,"-disabled"),g),t)),style:i.style,onClick:r},[createVNode("div",{role:"tab","aria-selected":c,id:l&&"".concat(l,"-tab-").concat(u),class:"".concat(C,"-btn"),"aria-controls":l&&"".concat(l,"-panel-").concat(u),"aria-disabled":g,tabindex:g?null:0,onClick:function(e){e.stopPropagation(),r(e)},onKeydown:function(e){[KeyCode$3.SPACE,KeyCode$3.ENTER].includes(e.which)&&(e.preventDefault(),r(e))},onFocus:_},["function"==typeof h?h():h]),s.value&&createVNode("button",{type:"button","aria-label":m||"remove",tabindex:0,class:"".concat(C,"-remove"),onClick:function(t){t.stopPropagation(),function(t){var n;t.preventDefault(),t.stopPropagation(),e.editable.onEdit("remove",{key:null===(n=e.tab)||void 0===n?void 0:n.key,event:t})}(t)}},[(null==p?void 0:p())||(null===(n=v.removeIcon)||void 0===n?void 0:n.call(v))||"×"])]);return f?f(b):b}}}),DEFAULT_SIZE$1={width:0,height:0,left:0,top:0};function useOffsets(e,t){var n=ref(new Map);return watchEffect((function(){for(var i,o,r=new Map,s=e.value,a=t.value.get(null===(i=s[0])||void 0===i?void 0:i.key)||DEFAULT_SIZE$1,l=a.left+a.width,c=0;c<s.length;c+=1){var d=s[c].key,u=t.value.get(d);u||(u=t.value.get(null===(o=s[c-1])||void 0===o?void 0:o.key)||DEFAULT_SIZE$1);var h=r.get(d)||_extends$1({},u);h.right=l-h.left-h.width,r.set(d,h)}n.value=new Map(r)})),n}var AddButton=defineComponent({name:"AddButton",inheritAttrs:!1,props:{prefixCls:String,editable:{type:Object},locale:{type:Object,default:void 0}},setup:function(e,t){var n=t.expose,i=t.attrs,o=ref();return n({domRef:o}),function(){var t=e.prefixCls,n=e.editable,r=e.locale;return n&&!1!==n.showAdd?createVNode("button",{ref:o,type:"button",class:"".concat(t,"-nav-add"),style:i.style,"aria-label":(null==r?void 0:r.addAriaLabel)||"Add tab",onClick:function(e){n.onEdit("add",{event:e})}},[n.addIcon?n.addIcon():"+"]):null}}}),operationNodeProps={prefixCls:{type:String},id:{type:String},tabs:{type:Object},rtl:{type:Boolean},tabBarGutter:{type:Number},activeKey:{type:[String,Number]},mobile:{type:Boolean},moreIcon:PropTypes$1.any,moreTransitionName:{type:String},editable:{type:Object},locale:{type:Object,default:void 0},removeAriaLabel:String,onTabClick:{type:Function}},OperationNode=defineComponent({name:"OperationNode",inheritAttrs:!1,props:operationNodeProps,emits:["tabClick"],slots:["moreIcon"],setup:function(e,t){var n=t.attrs,i=t.slots,o=_slicedToArray$2(useState(!1),2),r=o[0],s=o[1],a=_slicedToArray$2(useState(null),2),l=a[0],c=a[1],d=function(t){for(var n=e.tabs.filter((function(e){return!e.disabled})),i=n.findIndex((function(e){return e.key===l.value}))||0,o=n.length,r=0;r<o;r+=1){var s=n[i=(i+t+o)%o];if(!s.disabled)return void c(s.key)}},u=function(t){var n=t.which;if(r.value)switch(n){case KeyCode$3.UP:d(-1),t.preventDefault();break;case KeyCode$3.DOWN:d(1),t.preventDefault();break;case KeyCode$3.ESC:s(!1);break;case KeyCode$3.SPACE:case KeyCode$3.ENTER:null!==l.value&&e.onTabClick(l.value,t)}else[KeyCode$3.DOWN,KeyCode$3.SPACE,KeyCode$3.ENTER].includes(n)&&(s(!0),t.preventDefault())},h=computed((function(){return"".concat(e.id,"-more-popup")})),g=computed((function(){return null!==l.value?"".concat(h.value,"-").concat(l.value):null}));return onMounted((function(){watch(l,(function(){var e=document.getElementById(g.value);e&&e.scrollIntoView&&e.scrollIntoView(!1)}),{flush:"post",immediate:!0})})),watch(r,(function(){r.value||c(null)})),function(){var t,o=e.prefixCls,a=e.id,c=e.tabs,d=e.locale,p=e.mobile,f=e.moreIcon,m=void 0===f?(null===(t=i.moreIcon)||void 0===t?void 0:t.call(i))||createVNode(EllipsisOutlined$1,null,null):f,v=e.moreTransitionName,_=e.editable,C=e.tabBarGutter,b=e.rtl,y=e.onTabClick,S="".concat(o,"-dropdown"),w=null==d?void 0:d.dropdownAriaLabel,E=_defineProperty$P({},b?"marginRight":"marginLeft",C);c.length||(E.visibility="hidden",E.order=1);var x=classNames(_defineProperty$P({},"".concat(S,"-rtl"),b)),T=p?null:createVNode(Dropdown$2,{prefixCls:S,trigger:["hover"],visible:r.value,transitionName:v,onVisibleChange:s,overlayClassName:x,mouseEnterDelay:.1,mouseLeaveDelay:.1},{overlay:function(){return createVNode(Menu$2,{onClick:function(e){var t=e.key,n=e.domEvent;y(t,n),s(!1)},id:h.value,tabindex:-1,role:"listbox","aria-activedescendant":g.value,selectedKeys:[l.value],"aria-label":void 0!==w?w:"expanded dropdown"},{default:function(){return[c.map((function(t){var n,i,o=_&&!1!==t.closable&&!t.disabled;return createVNode(__unplugin_components_0$5,{key:t.key,id:"".concat(h.value,"-").concat(t.key),role:"option","aria-controls":a&&"".concat(a,"-panel-").concat(t.key),disabled:t.disabled},{default:function(){return[createVNode("span",null,["function"==typeof t.tab?t.tab():t.tab]),o&&createVNode("button",{type:"button","aria-label":e.removeAriaLabel||"remove",tabindex:0,class:"".concat(S,"-menu-item-remove"),onClick:function(n){var i,o;n.stopPropagation(),i=n,o=t.key,i.preventDefault(),i.stopPropagation(),e.editable.onEdit("remove",{key:o,event:i})}},[(null===(n=t.closeIcon)||void 0===n?void 0:n.call(t))||(null===(i=_.removeIcon)||void 0===i?void 0:i.call(_))||"×"])]}})}))]}})},default:function(){return createVNode("button",{type:"button",class:"".concat(o,"-nav-more"),style:E,tabindex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":h.value,id:"".concat(a,"-more"),"aria-expanded":r.value,onKeydown:u},[m])}});return createVNode("div",{class:classNames("".concat(o,"-nav-operations"),n.class),style:n.style},[T,createVNode(AddButton,{prefixCls:o,locale:d,editable:_},null)])}}}),TabsContextKey=Symbol("tabsContextKey"),useProvideTabs=function(e){provide(TabsContextKey,e)},useInjectTabs=function(){return inject(TabsContextKey,{tabs:ref([]),prefixCls:ref()})};defineComponent({name:"TabsContextProvider",inheritAttrs:!1,props:{tabs:{type:Object,default:void 0},prefixCls:{type:String,default:void 0}},setup:function(e,t){var n=t.slots;return useProvideTabs(toRefs(e)),function(){var e;return null===(e=n.default)||void 0===e?void 0:e.call(n)}}});var MIN_SWIPE_DISTANCE=.1,STOP_SWIPE_DISTANCE=.01,REFRESH_INTERVAL=20,SPEED_OFF_MULTIPLE=Math.pow(.995,REFRESH_INTERVAL);function useTouchMove(e,t){var n=_slicedToArray$2(useState(),2),i=n[0],o=n[1],r=_slicedToArray$2(useState(0),2),s=r[0],a=r[1],l=_slicedToArray$2(useState(0),2),c=l[0],d=l[1],u=_slicedToArray$2(useState(),2),h=u[0],g=u[1],p=ref();var f=ref();var m=ref({onTouchStart:function(e){var t=e.touches[0],n=t.screenX,i=t.screenY;o({x:n,y:i}),clearInterval(p.value)},onTouchMove:function(e){if(i.value){e.preventDefault();var n=e.touches[0],r=n.screenX,l=n.screenY,c=r-i.value.x,u=l-i.value.y;t(c,u),o({x:r,y:l});var h=Date.now();d(h-s.value),a(h),g({x:c,y:u})}},onTouchEnd:function(){if(i.value){var e=h.value;if(o(null),g(null),e){var n=e.x/c.value,r=e.y/c.value,s=Math.abs(n),a=Math.abs(r);if(Math.max(s,a)<MIN_SWIPE_DISTANCE)return;var l=n,d=r;p.value=setInterval((function(){Math.abs(l)<STOP_SWIPE_DISTANCE&&Math.abs(d)<STOP_SWIPE_DISTANCE?clearInterval(p.value):t((l*=SPEED_OFF_MULTIPLE)*REFRESH_INTERVAL,(d*=SPEED_OFF_MULTIPLE)*REFRESH_INTERVAL)}),REFRESH_INTERVAL)}}},onWheel:function(e){var n=e.deltaX,i=e.deltaY,o=0,r=Math.abs(n),s=Math.abs(i);r===s?o="x"===f.value?n:i:r>s?(o=n,f.value="x"):(o=i,f.value="y"),t(-o,-o)&&e.preventDefault()}});function v(e){m.value.onTouchStart(e)}function _(e){m.value.onTouchMove(e)}function C(e){m.value.onTouchEnd(e)}function b(e){m.value.onWheel(e)}onMounted((function(){var t,n;document.addEventListener("touchmove",_,{passive:!1}),document.addEventListener("touchend",C,{passive:!1}),null===(t=e.value)||void 0===t||t.addEventListener("touchstart",v,{passive:!1}),null===(n=e.value)||void 0===n||n.addEventListener("wheel",b,{passive:!1})})),onBeforeUnmount((function(){document.removeEventListener("touchmove",_),document.removeEventListener("touchend",C)}))}function useSyncState(e,t){var n=ref(e);return[n,function(e){var i="function"==typeof e?e(n.value):e;i!==n.value&&t(i,n.value),n.value=i}]}var useRefs=function(){var e=ref(new Map);return onBeforeUpdate((function(){e.value=new Map})),[function(t){return function(n){e.value.set(t,n)}},e]},useRefs$1=useRefs,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray$4(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!isSymbol$1(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}var FUNC_ERROR_TEXT$1="Expected a function";function memoize$1(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT$1);var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],r=n.cache;if(r.has(o))return r.get(o);var s=e.apply(this,i);return n.cache=r.set(o,s)||r,s};return n.cache=new(memoize$1.Cache||MapCache),n}memoize$1.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize$1(e,(function(e){return n.size===MAX_MEMOIZE_SIZE&&n.clear(),e})),n=t.cache;return t}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,n,i,o){t.push(i?o.replace(reEscapeChar,"$1"):n||e)})),t})),stringToPath$1=stringToPath;function castPath(e,t){return isArray$4(e)?e:isKey(e,t)?[e]:stringToPath$1(toString$1(e))}var INFINITY=1/0;function toKey(e){if("string"==typeof e||isSymbol$1(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}function baseGet(e,t){for(var n=0,i=(t=castPath(t,e)).length;null!=e&&n<i;)e=e[toKey(t[n++])];return n&&n==i?e:void 0}var defineProperty=function(){try{var e=getNative(Object,"defineProperty");return e({},"",{}),e}catch(e2){}}(),defineProperty$1=defineProperty;function baseAssignValue(e,t,n){"__proto__"==t&&defineProperty$1?defineProperty$1(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var objectProto$2=Object.prototype,hasOwnProperty$8=objectProto$2.hasOwnProperty;function assignValue(e,t,n){var i=e[t];hasOwnProperty$8.call(e,t)&&eq(i,n)&&(void 0!==n||t in e)||baseAssignValue(e,t,n)}function baseSet(e,t,n,i){if(!isObject$5(e))return e;for(var o=-1,r=(t=castPath(t,e)).length,s=r-1,a=e;null!=a&&++o<r;){var l=toKey(t[o]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(o!=s){var d=a[l];void 0===(c=i?i(d,l,a):void 0)&&(c=isObject$5(d)?d:isIndex(t[o+1])?[]:{})}assignValue(a,l,c),a=a[l]}return e}function basePickBy(e,t,n){for(var i=-1,o=t.length,r={};++i<o;){var s=t[i],a=baseGet(e,s);n(a,s)&&baseSet(r,castPath(s,e),a)}return r}function baseHasIn(e,t){return null!=e&&t in Object(e)}function hasPath(e,t,n){for(var i=-1,o=(t=castPath(t,e)).length,r=!1;++i<o;){var s=toKey(t[i]);if(!(r=null!=e&&n(e,s)))break;e=e[s]}return r||++i!=o?r:!!(o=null==e?0:e.length)&&isLength(o)&&isIndex(s,o)&&(isArray$4(e)||isArguments$1(e))}function hasIn(e,t){return null!=e&&hasPath(e,t,baseHasIn)}function basePick(e,t){return basePickBy(e,t,(function(t,n){return hasIn(e,n)}))}var spreadableSymbol=Symbol$2?Symbol$2.isConcatSpreadable:void 0;function isFlattenable(e){return isArray$4(e)||isArguments$1(e)||!!(spreadableSymbol&&e&&e[spreadableSymbol])}function baseFlatten(e,t,n,i,o){var r=-1,s=e.length;for(n||(n=isFlattenable),o||(o=[]);++r<s;){var a=e[r];t>0&&n(a)?t>1?baseFlatten(a,t-1,n,i,o):arrayPush$1(o,a):i||(o[o.length]=a)}return o}function flatten$1(e){return(null==e?0:e.length)?baseFlatten(e,1):[]}function apply$2(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var nativeMax$2=Math.max;function overRest(e,t,n){return t=nativeMax$2(void 0===t?e.length-1:t,0),function(){for(var i=arguments,o=-1,r=nativeMax$2(i.length-t,0),s=Array(r);++o<r;)s[o]=i[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=i[o];return a[t]=n(s),apply$2(e,this,a)}}function constant(e){return function(){return e}}function identity(e){return e}var baseSetToString=defineProperty$1?function(e,t){return defineProperty$1(e,"toString",{configurable:!0,enumerable:!1,value:constant(t),writable:!0})}:identity,baseSetToString$1=baseSetToString,HOT_COUNT=800,HOT_SPAN=16,nativeNow=Date.now;function shortOut(e){var t=0,n=0;return function(){var i=nativeNow(),o=HOT_SPAN-(i-n);if(n=i,o>0){if(++t>=HOT_COUNT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var setToString=shortOut(baseSetToString$1),setToString$1=setToString;function flatRest(e){return setToString$1(overRest(e,void 0,flatten$1),e+"")}var pick=flatRest((function(e,t){return null==e?{}:basePick(e,t)})),pick$1=pick,DEFAULT_SIZE={width:0,height:0,left:0,top:0,right:0},tabNavListProps=function(){return{id:{type:String},tabPosition:{type:String},activeKey:{type:[String,Number]},rtl:{type:Boolean},animated:{type:Object,default:void 0},editable:{type:Object},moreIcon:PropTypes$1.any,moreTransitionName:{type:String},mobile:{type:Boolean},tabBarGutter:{type:Number},renderTabBar:{type:Function},locale:{type:Object,default:void 0},onTabClick:{type:Function},onTabScroll:{type:Function}}},TabNavList=defineComponent({name:"TabNavList",inheritAttrs:!1,props:tabNavListProps(),slots:["moreIcon","leftExtra","rightExtra","tabBarExtraContent"],emits:["tabClick","tabScroll"],setup:function(e,t){var n=t.attrs,i=t.slots,o=useInjectTabs(),r=o.tabs,s=o.prefixCls,a=ref(),l=ref(),c=ref(),d=ref(),u=_slicedToArray$2(useRefs$1(),2),h=u[0],g=u[1],p=computed((function(){return"top"===e.tabPosition||"bottom"===e.tabPosition})),f=_slicedToArray$2(useSyncState(0,(function(t,n){p.value&&e.onTabScroll&&e.onTabScroll({direction:t>n?"left":"right"})})),2),m=f[0],v=f[1],_=_slicedToArray$2(useSyncState(0,(function(t,n){!p.value&&e.onTabScroll&&e.onTabScroll({direction:t>n?"top":"bottom"})})),2),C=_[0],b=_[1],y=_slicedToArray$2(useState(0),2),S=y[0],w=y[1],E=_slicedToArray$2(useState(0),2),x=E[0],T=E[1],I=_slicedToArray$2(useState(null),2),k=I[0],L=I[1],D=_slicedToArray$2(useState(null),2),N=D[0],O=D[1],A=_slicedToArray$2(useState(0),2),P=A[0],R=A[1],M=_slicedToArray$2(useState(0),2),$=M[0],F=M[1],B=_slicedToArray$2(useRafState(new Map),2),V=B[0],W=B[1],H=useOffsets(r,V),z=computed((function(){return"".concat(s.value,"-nav-operations-hidden")})),K=ref(0),j=ref(0);watchEffect((function(){p.value?e.rtl?(K.value=0,j.value=Math.max(0,S.value-k.value)):(K.value=Math.min(0,k.value-S.value),j.value=0):(K.value=Math.min(0,N.value-x.value),j.value=0)}));var U=function(e){return e<K.value?K.value:e>j.value?j.value:e},G=ref(),q=_slicedToArray$2(useState(),2),Y=q[0],X=q[1],Z=function(){X(Date.now())},Q=function(){clearTimeout(G.value)},J=function(e,t){e((function(e){return U(e+t)}))};useTouchMove(a,(function(e,t){if(p.value){if(k.value>=S.value)return!1;J(v,e)}else{if(N.value>=x.value)return!1;J(b,t)}return Q(),Z(),!0})),watch(Y,(function(){Q(),Y.value&&(G.value=setTimeout((function(){X(0)}),100))}));var ee=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.activeKey,n=H.value.get(t)||{width:0,height:0,left:0,right:0,top:0};if(p.value){var i=m.value;e.rtl?n.right<m.value?i=n.right:n.right+n.width>m.value+k.value&&(i=n.right+n.width-k.value):n.left<-m.value?i=-n.left:n.left+n.width>-m.value+k.value&&(i=-(n.left+n.width-k.value)),b(0),v(U(i))}else{var o=C.value;n.top<-C.value?o=-n.top:n.top+n.height>-C.value+N.value&&(o=-(n.top+n.height-N.value)),v(0),b(U(o))}},te=ref(0),ne=ref(0);watchEffect((function(){var t,n,i,o,s,a,l,c=H.value;["top","bottom"].includes(e.tabPosition)?(n="width",s=k.value,a=S.value,l=P.value,i=e.rtl?"right":"left",o=Math.abs(m.value)):(n="height",s=N.value,a=S.value,l=$.value,i="top",o=-C.value);var d=s;a+l>s&&a<s&&(d=s-l);var u,h=r.value;if(!h.length)return u=[0,0],te.value=u[0],ne.value=u[1],u;for(var g=h.length,p=g,f=0;f<g;f+=1){var v=c.get(h[f].key)||DEFAULT_SIZE;if(v[i]+v[n]>o+d){p=f-1;break}}for(var _=0,b=g-1;b>=0;b-=1){if((c.get(h[b].key)||DEFAULT_SIZE)[i]<o){_=b+1;break}}return t=[_,p],te.value=t[0],ne.value=t[1],t}));var ie=function(){var e,t,n,i,o,s=(null===(e=a.value)||void 0===e?void 0:e.offsetWidth)||0,c=(null===(t=a.value)||void 0===t?void 0:t.offsetHeight)||0,u=(null===(n=d.value)||void 0===n?void 0:n.$el)||{},h=u.offsetWidth||0,p=u.offsetHeight||0;L(s),O(c),R(h),F(p);var f=((null===(i=l.value)||void 0===i?void 0:i.offsetWidth)||0)-h,m=((null===(o=l.value)||void 0===o?void 0:o.offsetHeight)||0)-p;w(f),T(m),W((function(){var e=new Map;return r.value.forEach((function(t){var n,i=t.key,o=g.value.get(i),r=(null===(n=o)||void 0===n?void 0:n.$el)||o;r&&e.set(i,{width:r.offsetWidth,height:r.offsetHeight,left:r.offsetLeft,top:r.offsetTop})})),e}))},oe=computed((function(){return[].concat(_toConsumableArray$2(r.value.slice(0,te.value)),_toConsumableArray$2(r.value.slice(ne.value+1)))})),re=_slicedToArray$2(useState(),2),se=re[0],ae=re[1],le=computed((function(){return H.value.get(e.activeKey)})),ce=ref(),de=function(){wrapperRaf.cancel(ce.value)};watch([le,p,function(){return e.rtl}],(function(){var t={};le.value&&(p.value?(e.rtl?t.right=toPx(le.value.right):t.left=toPx(le.value.left),t.width=toPx(le.value.width)):(t.top=toPx(le.value.top),t.height=toPx(le.value.height))),de(),ce.value=wrapperRaf((function(){ae(t)}))})),watch([function(){return e.activeKey},le,H,p],(function(){ee()}),{flush:"post"}),watch([function(){return e.rtl},function(){return e.tabBarGutter},function(){return e.activeKey},function(){return r.value}],(function(){ie()}),{flush:"post"});var ue=function(e){var t=e.position,n=e.prefixCls,i=e.extra;if(!i)return null;var o=null==i?void 0:i({position:t});return o?createVNode("div",{class:"".concat(n,"-extra-content")},[o]):null};return onBeforeUnmount((function(){Q(),de()})),function(){var t,o,u,g,f,v=e.id,_=e.animated,b=e.activeKey,y=e.rtl,w=e.editable,E=e.locale,T=e.tabPosition,I=e.tabBarGutter,L=e.onTabClick,D=n.class,O=n.style,A=s.value,P=!!oe.value.length,R="".concat(A,"-nav-wrap");p.value?y?(u=m.value>0,o=m.value+k.value<S.value):(o=m.value<0,u=-m.value+k.value<S.value):(g=C.value<0,f=-C.value+N.value<x.value);var M={};"top"===T||"bottom"===T?M[y?"marginRight":"marginLeft"]="number"==typeof I?"".concat(I,"px"):I:M.marginTop="number"==typeof I?"".concat(I,"px"):I;var $=r.value.map((function(e,t){var n=e.key;return createVNode(TabNode,{id:v,prefixCls:A,key:n,tab:e,style:0===t?void 0:M,closable:e.closable,editable:w,active:n===b,removeAriaLabel:null==E?void 0:E.removeAriaLabel,ref:h(n),onClick:function(e){L(n,e)},onFocus:function(){ee(n),Z(),a.value&&(y||(a.value.scrollLeft=0),a.value.scrollTop=0)}},i)}));return createVNode("div",{role:"tablist",class:classNames("".concat(A,"-nav"),D),style:O,onKeydown:function(){Z()}},[createVNode(ue,{position:"left",prefixCls:A,extra:i.leftExtra},null),createVNode(ResizeObserver$1,{onResize:ie},{default:function(){return[createVNode("div",{class:classNames(R,(t={},_defineProperty$P(t,"".concat(R,"-ping-left"),o),_defineProperty$P(t,"".concat(R,"-ping-right"),u),_defineProperty$P(t,"".concat(R,"-ping-top"),g),_defineProperty$P(t,"".concat(R,"-ping-bottom"),f),t)),ref:a},[createVNode(ResizeObserver$1,{onResize:ie},{default:function(){return[createVNode("div",{ref:l,class:"".concat(A,"-nav-list"),style:{transform:"translate(".concat(m.value,"px, ").concat(C.value,"px)"),transition:Y.value?"none":void 0}},[$,createVNode(AddButton,{ref:d,prefixCls:A,locale:E,editable:w,style:_extends$1(_extends$1({},0===$.length?void 0:M),{visibility:P?"hidden":null})},null),createVNode("div",{class:classNames("".concat(A,"-ink-bar"),_defineProperty$P({},"".concat(A,"-ink-bar-animated"),_.inkBar)),style:se.value},null)])]}})])]}}),createVNode(OperationNode,_objectSpread2$1(_objectSpread2$1({},e),{},{removeAriaLabel:null==E?void 0:E.removeAriaLabel,ref:c,prefixCls:A,tabs:oe.value,class:!P&&z.value}),pick$1(i,["moreIcon"])),createVNode(ue,{position:"right",prefixCls:A,extra:i.rightExtra},null),createVNode(ue,{position:"right",prefixCls:A,extra:i.tabBarExtraContent},null)])}}}),TabPanelList=defineComponent({name:"TabPanelList",inheritAttrs:!1,props:{activeKey:{type:[String,Number]},id:{type:String},rtl:{type:Boolean},animated:{type:Object,default:void 0},tabPosition:{type:String},destroyInactiveTabPane:{type:Boolean}},setup:function(e){var t=useInjectTabs(),n=t.tabs,i=t.prefixCls;return function(){var t=e.id,o=e.activeKey,r=e.animated,s=e.tabPosition,a=e.rtl,l=e.destroyInactiveTabPane,c=r.tabPane,d=i.value,u=n.value.findIndex((function(e){return e.key===o}));return createVNode("div",{class:"".concat(d,"-content-holder")},[createVNode("div",{class:["".concat(d,"-content"),"".concat(d,"-content-").concat(s),_defineProperty$P({},"".concat(d,"-content-animated"),c)],style:u&&c?_defineProperty$P({},a?"marginRight":"marginLeft","-".concat(u,"00%")):null},[n.value.map((function(e){return cloneElement(e.node,{key:e.key,prefixCls:d,tabKey:e.key,id:t,animated:c,active:e.key===o,destroyInactiveTabPane:l})}))])])}}}),PlusOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},PlusOutlinedSvg=PlusOutlined$2;function _objectSpread$v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$v(e,t,n[t])}))}return e}function _defineProperty$v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var PlusOutlined=function(e,t){var n=_objectSpread$v({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$v({},n,{icon:PlusOutlinedSvg}),null)};PlusOutlined.displayName="PlusOutlined",PlusOutlined.inheritAttrs=!1;var PlusOutlined$1=PlusOutlined,uuid$2=0,tabsProps=function(){return{prefixCls:{type:String},id:{type:String},activeKey:{type:[String,Number]},defaultActiveKey:{type:[String,Number]},direction:{type:String},animated:{type:[Boolean,Object]},renderTabBar:{type:Function},tabBarGutter:{type:Number},tabBarStyle:{type:Object},tabPosition:{type:String},destroyInactiveTabPane:{type:Boolean},hideAdd:Boolean,type:{type:String},size:{type:String},centered:Boolean,onEdit:{type:Function},onChange:{type:Function},onTabClick:{type:Function},onTabScroll:{type:Function},"onUpdate:activeKey":{type:Function},locale:{type:Object,default:void 0},onPrevClick:Function,onNextClick:Function,tabBarExtraContent:PropTypes$1.any}};function parseTabList(e){return e.map((function(e){if(isValidElement(e)){for(var t=_extends$1({},e.props||{}),n=0,i=Object.entries(t);n<i.length;n++){var o=_slicedToArray$2(i[n],2),r=o[0],s=o[1];delete t[r],t[camelize$1(r)]=s}var a=e.children||{},l=void 0!==e.key?e.key:void 0,c=t.tab,d=void 0===c?a.tab:c,u=t.disabled,h=t.forceRender,g=t.closable,p=t.animated,f=t.active,m=t.destroyInactiveTabPane;return _extends$1(_extends$1({key:l},t),{node:e,closeIcon:a.closeIcon,tab:d,disabled:""===u||u,forceRender:""===h||h,closable:""===g||g,animated:""===p||p,active:""===f||f,destroyInactiveTabPane:""===m||m})}return null})).filter((function(e){return e}))}var InternalTabs=defineComponent({name:"InternalTabs",inheritAttrs:!1,props:_extends$1(_extends$1({},initDefaultProps$1(tabsProps(),{tabPosition:"top",animated:{inkBar:!0,tabPane:!1}})),{tabs:{type:Array}}),slots:["tabBarExtraContent","leftExtra","rightExtra","moreIcon","addIcon","removeIcon","renderTabBar"],setup:function(e,t){var n=t.attrs,i=t.slots;devWarning(!(void 0!==e.onPrevClick||void 0!==e.onNextClick),"Tabs","`onPrevClick / @prevClick` and `onNextClick / @nextClick` has been removed. Please use `onTabScroll / @tabScroll` instead."),devWarning(!(void 0!==e.tabBarExtraContent),"Tabs","`tabBarExtraContent` prop has been removed. Please use `rightExtra` slot instead."),devWarning(!(void 0!==i.tabBarExtraContent),"Tabs","`tabBarExtraContent` slot is deprecated. Please use `rightExtra` slot instead.");var o=useConfigInject("tabs",e),r=o.prefixCls,s=o.direction,a=o.size,l=o.rootPrefixCls,c=computed((function(){return"rtl"===s.value})),d=computed((function(){var t=e.animated,n=e.tabPosition;return!1===t||["left","right"].includes(n)?{inkBar:!1,tabPane:!1}:!0===t?{inkBar:!0,tabPane:!0}:_extends$1({inkBar:!0,tabPane:!1},"object"===_typeof$3(t)?t:{})})),u=_slicedToArray$2(useState(!1),2),h=u[0],g=u[1];onMounted((function(){g(isMobile$2())}));var p=_slicedToArray$2(useMergedState((function(){var t;return null===(t=e.tabs[0])||void 0===t?void 0:t.key}),{value:computed((function(){return e.activeKey})),defaultValue:e.defaultActiveKey}),2),f=p[0],m=p[1],v=_slicedToArray$2(useState((function(){return e.tabs.findIndex((function(e){return e.key===f.value}))})),2),_=v[0],C=v[1];watchEffect((function(){var t,n=e.tabs.findIndex((function(e){return e.key===f.value}));-1===n&&(n=Math.max(0,Math.min(_.value,e.tabs.length-1)),m(null===(t=e.tabs[n])||void 0===t?void 0:t.key)),C(n)}));var b=_slicedToArray$2(useMergedState(null,{value:computed((function(){return e.id}))}),2),y=b[0],S=b[1],w=computed((function(){return h.value&&!["left","right"].includes(e.tabPosition)?"top":e.tabPosition}));onMounted((function(){e.id||(S("rc-tabs-".concat(uuid$2)),uuid$2+=1)}));var E=function(t,n){var i,o;null===(i=e.onTabClick)||void 0===i||i.call(e,t,n);var r=t!==f.value;m(t),r&&(null===(o=e.onChange)||void 0===o||o.call(e,t))};return useProvideTabs({tabs:computed((function(){return e.tabs})),prefixCls:r}),function(){var t,o,s,u=e.id,g=e.type,p=e.tabBarGutter,m=e.tabBarStyle,v=e.locale,_=e.destroyInactiveTabPane,C=e.renderTabBar,b=void 0===C?i.renderTabBar:C,S=e.onTabScroll,x=e.hideAdd,T=e.centered,I={id:y.value,activeKey:f.value,animated:d.value,tabPosition:w.value,rtl:c.value,mobile:h.value};"editable-card"===g&&(o={onEdit:function(t,n){var i,o=n.key,r=n.event;null===(i=e.onEdit)||void 0===i||i.call(e,"add"===t?r:o,t)},removeIcon:function(){return createVNode(CloseOutlined$1,null,null)},addIcon:i.addIcon?i.addIcon:function(){return createVNode(PlusOutlined$1,null,null)},showAdd:!0!==x});var k=_extends$1(_extends$1({},I),{moreTransitionName:"".concat(l.value,"-slide-up"),editable:o,locale:v,tabBarGutter:p,onTabClick:E,onTabScroll:S,style:m});s=b?b(_extends$1(_extends$1({},k),{DefaultTabBar:TabNavList})):createVNode(TabNavList,k,pick$1(i,["moreIcon","leftExtra","rightExtra","tabBarExtraContent"]));var L=r.value;return createVNode("div",_objectSpread2$1(_objectSpread2$1({},n),{},{id:u,class:classNames(L,"".concat(L,"-").concat(w.value),(t={},_defineProperty$P(t,"".concat(L,"-").concat(a.value),a.value),_defineProperty$P(t,"".concat(L,"-card"),["card","editable-card"].includes(g)),_defineProperty$P(t,"".concat(L,"-editable-card"),"editable-card"===g),_defineProperty$P(t,"".concat(L,"-centered"),T),_defineProperty$P(t,"".concat(L,"-mobile"),h.value),_defineProperty$P(t,"".concat(L,"-editable"),"editable-card"===g),_defineProperty$P(t,"".concat(L,"-rtl"),c.value),t),n.class)}),[s,createVNode(TabPanelList,_objectSpread2$1(_objectSpread2$1({destroyInactiveTabPane:_},I),{},{animated:d.value}),null)])}}}),Tabs=defineComponent({name:"ATabs",inheritAttrs:!1,props:initDefaultProps$1(tabsProps(),{tabPosition:"top",animated:{inkBar:!0,tabPane:!1}}),slots:["tabBarExtraContent","leftExtra","rightExtra","moreIcon","addIcon","removeIcon","renderTabBar"],setup:function(e,t){var n=t.attrs,i=t.slots,o=t.emit,r=function(e){o("update:activeKey",e),o("change",e)};return function(){var t,o=parseTabList(flattenChildren(null===(t=i.default)||void 0===t?void 0:t.call(i)));return createVNode(InternalTabs,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},omit$2(e,["onUpdate:activeKey"])),n),{},{onChange:r,tabs:o}),i)}}}),tabPaneProps=function(){return{tab:PropTypes$1.any,disabled:{type:Boolean},forceRender:{type:Boolean},closable:{type:Boolean},animated:{type:Boolean},active:{type:Boolean},destroyInactiveTabPane:{type:Boolean},prefixCls:{type:String},tabKey:{type:[String,Number]},id:{type:String}}},__unplugin_components_4=defineComponent({name:"ATabPane",inheritAttrs:!1,__ANT_TAB_PANE:!0,props:tabPaneProps(),slots:["closeIcon","tab"],setup:function(e,t){var n=t.attrs,i=t.slots,o=ref(e.forceRender);watch([function(){return e.active},function(){return e.destroyInactiveTabPane}],(function(){e.active?o.value=!0:e.destroyInactiveTabPane&&(o.value=!1)}),{immediate:!0});var r=computed((function(){return e.active?{}:e.animated?{visibility:"hidden",height:0,overflowY:"hidden"}:{display:"none"}}));return function(){var t,s=e.prefixCls,a=e.forceRender,l=e.id,c=e.active,d=e.tabKey;return createVNode("div",{id:l&&"".concat(l,"-panel-").concat(d),role:"tabpanel",tabindex:c?0:-1,"aria-labelledby":l&&"".concat(l,"-tab-").concat(d),"aria-hidden":!c,style:[r.value,n.style],class:["".concat(s,"-tabpane"),c&&"".concat(s,"-tabpane-active"),n.class]},[(c||o.value||a)&&(null===(t=i.default)||void 0===t?void 0:t.call(i))])}}});Tabs.TabPane=__unplugin_components_4,Tabs.install=function(e){return e.component(Tabs.name,Tabs),e.component(__unplugin_components_4.name,__unplugin_components_4),e};var canUseDocElement=function(){return canUseDom()&&window.document.documentElement},isStyleNameSupport=function(e){if(canUseDom()&&window.document.documentElement){var t=Array.isArray(e)?e:[e],n=window.document.documentElement;return t.some((function(e){return e in n.style}))}return!1},isStyleValueSupport=function(e,t){if(!isStyleNameSupport(e))return!1;var n=document.createElement("div"),i=n.style[e];return n.style[e]=t,n.style[e]!==i},flexGapSupported;function isStyleSupport(e,t){return Array.isArray(e)||void 0===t?isStyleNameSupport(e):isStyleValueSupport(e,t)}var detectFlexGapSupported=function(){if(!canUseDocElement())return!1;if(void 0!==flexGapSupported)return flexGapSupported;var e=document.createElement("div");return e.style.display="flex",e.style.flexDirection="column",e.style.rowGap="1px",e.appendChild(document.createElement("div")),e.appendChild(document.createElement("div")),document.body.appendChild(e),flexGapSupported=1===e.scrollHeight,document.body.removeChild(e),flexGapSupported},useFlexGapSupport=function(){var e=ref(!1);return onMounted((function(){e.value=detectFlexGapSupported()})),e},RowContextKey=Symbol("rowContextKey"),useProvideRow=function(e){provide(RowContextKey,e)},useInjectRow=function(){return inject(RowContextKey,{gutter:computed((function(){})),wrap:computed((function(){})),supportFlexGap:computed((function(){}))})},useProvideRow$1=useProvideRow;tuple("top","middle","bottom","stretch"),tuple("start","end","center","space-around","space-between");var rowProps=function(){return{align:String,justify:String,prefixCls:String,gutter:{type:[Number,Array,Object],default:0},wrap:{type:Boolean,default:void 0}}},ARow=defineComponent({name:"ARow",props:rowProps(),setup:function(e,t){var n,i=t.slots,o=useConfigInject("row",e),r=o.prefixCls,s=o.direction,a=ref({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0,xxxl:!0}),l=useFlexGapSupport();onMounted((function(){n=ResponsiveObserve.subscribe((function(t){var n=e.gutter||0;(!Array.isArray(n)&&"object"===_typeof$3(n)||Array.isArray(n)&&("object"===_typeof$3(n[0])||"object"===_typeof$3(n[1])))&&(a.value=t)}))})),onBeforeUnmount((function(){ResponsiveObserve.unsubscribe(n)}));var c=computed((function(){var t=[0,0],n=e.gutter,i=void 0===n?0:n;return(Array.isArray(i)?i:[i,0]).forEach((function(e,n){if("object"===_typeof$3(e))for(var i=0;i<responsiveArray.length;i++){var o=responsiveArray[i];if(a.value[o]&&void 0!==e[o]){t[n]=e[o];break}}else t[n]=e||0})),t}));useProvideRow$1({gutter:c,supportFlexGap:l,wrap:computed((function(){return e.wrap}))});var d=computed((function(){var t;return classNames(r.value,(_defineProperty$P(t={},"".concat(r.value,"-no-wrap"),!1===e.wrap),_defineProperty$P(t,"".concat(r.value,"-").concat(e.justify),e.justify),_defineProperty$P(t,"".concat(r.value,"-").concat(e.align),e.align),_defineProperty$P(t,"".concat(r.value,"-rtl"),"rtl"===s.value),t))})),u=computed((function(){var e=c.value,t={},n=e[0]>0?"".concat(e[0]/-2,"px"):void 0,i=e[1]>0?"".concat(e[1]/-2,"px"):void 0;return n&&(t.marginLeft=n,t.marginRight=n),l.value?t.rowGap="".concat(e[1],"px"):i&&(t.marginTop=i,t.marginBottom=i),t}));return function(){var e;return createVNode("div",{class:d.value,style:u.value},[null===(e=i.default)||void 0===e?void 0:e.call(i)])}}}),Row=ARow;function parseFlex(e){return"number"==typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}var colProps=function(){return{span:[String,Number],order:[String,Number],offset:[String,Number],push:[String,Number],pull:[String,Number],xs:{type:[String,Number,Object],default:void 0},sm:{type:[String,Number,Object],default:void 0},md:{type:[String,Number,Object],default:void 0},lg:{type:[String,Number,Object],default:void 0},xl:{type:[String,Number,Object],default:void 0},xxl:{type:[String,Number,Object],default:void 0},xxxl:{type:[String,Number,Object],default:void 0},prefixCls:String,flex:[String,Number]}},Col=defineComponent({name:"ACol",props:colProps(),setup:function(e,t){var n=t.slots,i=useInjectRow(),o=i.gutter,r=i.supportFlexGap,s=i.wrap,a=useConfigInject("col",e),l=a.prefixCls,c=a.direction,d=computed((function(){var t,n=e.span,i=e.order,o=e.offset,r=e.push,s=e.pull,a=l.value,d={};return["xs","sm","md","lg","xl","xxl","xxxl"].forEach((function(t){var n,i={},o=e[t];"number"==typeof o?i.span=o:"object"===_typeof$3(o)&&(i=o||{}),d=_extends$1(_extends$1({},d),(_defineProperty$P(n={},"".concat(a,"-").concat(t,"-").concat(i.span),void 0!==i.span),_defineProperty$P(n,"".concat(a,"-").concat(t,"-order-").concat(i.order),i.order||0===i.order),_defineProperty$P(n,"".concat(a,"-").concat(t,"-offset-").concat(i.offset),i.offset||0===i.offset),_defineProperty$P(n,"".concat(a,"-").concat(t,"-push-").concat(i.push),i.push||0===i.push),_defineProperty$P(n,"".concat(a,"-").concat(t,"-pull-").concat(i.pull),i.pull||0===i.pull),_defineProperty$P(n,"".concat(a,"-rtl"),"rtl"===c.value),n))})),classNames(a,(_defineProperty$P(t={},"".concat(a,"-").concat(n),void 0!==n),_defineProperty$P(t,"".concat(a,"-order-").concat(i),i),_defineProperty$P(t,"".concat(a,"-offset-").concat(o),o),_defineProperty$P(t,"".concat(a,"-push-").concat(r),r),_defineProperty$P(t,"".concat(a,"-pull-").concat(s),s),t),d)})),u=computed((function(){var t=e.flex,n=o.value,i={};if(n&&n[0]>0){var a="".concat(n[0]/2,"px");i.paddingLeft=a,i.paddingRight=a}if(n&&n[1]>0&&!r.value){var l="".concat(n[1]/2,"px");i.paddingTop=l,i.paddingBottom=l}return t&&(i.flex=parseFlex(t),!1!==s.value||i.minWidth||(i.minWidth=0)),i}));return function(){var e;return createVNode("div",{class:d.value,style:u.value},[null===(e=n.default)||void 0===e?void 0:e.call(n)])}}}),now$1=function(){return root$1.Date.now()},now$2=now$1,FUNC_ERROR_TEXT="Expected a function",nativeMax$1=Math.max,nativeMin$1=Math.min;function debounce(e,t,n){var i,o,r,s,a,l,c=0,d=!1,u=!1,h=!0;if("function"!=typeof e)throw new TypeError(FUNC_ERROR_TEXT);function g(t){var n=i,r=o;return i=o=void 0,c=t,s=e.apply(r,n)}function p(e){return c=e,a=setTimeout(m,t),d?g(e):s}function f(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-c>=r}function m(){var e=now$2();if(f(e))return v(e);a=setTimeout(m,function(e){var n=t-(e-l);return u?nativeMin$1(n,r-(e-c)):n}(e))}function v(e){return a=void 0,h&&i?g(e):(i=o=void 0,s)}function _(){var e=now$2(),n=f(e);if(i=arguments,o=this,l=e,n){if(void 0===a)return p(l);if(u)return clearTimeout(a),a=setTimeout(m,t),g(l)}return void 0===a&&(a=setTimeout(m,t)),s}return t=toNumber(t)||0,isObject$5(n)&&(d=!!n.leading,r=(u="maxWait"in n)?nativeMax$1(toNumber(n.maxWait)||0,t):r,h="trailing"in n?!!n.trailing:h),_.cancel=function(){void 0!==a&&clearTimeout(a),c=0,i=l=o=a=void 0},_.flush=function(){return void 0===a?s:v(now$2())},_}var TreeContextKey=Symbol("TreeContextKey"),TreeContext=defineComponent({name:"TreeContext",props:{value:{type:Object}},setup:function(e,t){var n=t.slots;return provide(TreeContextKey,computed((function(){return e.value}))),function(){var e;return null===(e=n.default)||void 0===e?void 0:e.call(n)}}}),useInjectTreeContext=function(){return inject(TreeContextKey,computed((function(){return{}})))},KeysStateKey=Symbol("KeysStateKey"),useProvideKeysState=function(e){provide(KeysStateKey,e)},useInjectKeysState=function(){return inject(KeysStateKey,{expandedKeys:shallowRef([]),selectedKeys:shallowRef([]),loadedKeys:shallowRef([]),loadingKeys:shallowRef([]),checkedKeys:shallowRef([]),halfCheckedKeys:shallowRef([]),expandedKeysSet:computed((function(){return new Set})),selectedKeysSet:computed((function(){return new Set})),loadedKeysSet:computed((function(){return new Set})),loadingKeysSet:computed((function(){return new Set})),checkedKeysSet:computed((function(){return new Set})),halfCheckedKeysSet:computed((function(){return new Set})),flattenNodes:shallowRef([])})},Indent=function(e){for(var t=e.prefixCls,n=e.level,i=e.isStart,o=e.isEnd,r="".concat(t,"-indent-unit"),s=[],a=0;a<n;a+=1){var l;s.push(createVNode("span",{key:a,class:(l={},_defineProperty$P(l,r,!0),_defineProperty$P(l,"".concat(r,"-start"),i[a]),_defineProperty$P(l,"".concat(r,"-end"),o[a]),l)},null))}return createVNode("span",{"aria-hidden":"true",class:"".concat(t,"-indent")},[s])},Indent$1=Indent,treeNodeProps={eventKey:[String,Number],prefixCls:String,title:PropTypes$1.any,data:{type:Object,default:void 0},parent:{type:Object,default:void 0},isStart:{type:Array},isEnd:{type:Array},active:{type:Boolean,default:void 0},onMousemove:{type:Function},isLeaf:{type:Boolean,default:void 0},checkable:{type:Boolean,default:void 0},selectable:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},disableCheckbox:{type:Boolean,default:void 0},icon:PropTypes$1.any,switcherIcon:PropTypes$1.any,domRef:{type:Function}},nodeListProps={prefixCls:{type:String},motion:{type:Object},focusable:{type:Boolean},activeItem:{type:Object},focused:{type:Boolean},tabindex:{type:Number},checkable:{type:Boolean},selectable:{type:Boolean},disabled:{type:Boolean},height:{type:Number},itemHeight:{type:Number},virtual:{type:Boolean},onScroll:{type:Function},onKeydown:{type:Function},onFocus:{type:Function},onBlur:{type:Function},onActiveChange:{type:Function},onContextmenu:{type:Function},onListChangeStart:{type:Function},onListChangeEnd:{type:Function}},treeProps$1=function(){return{prefixCls:String,focusable:{type:Boolean,default:void 0},activeKey:[Number,String],tabindex:Number,children:PropTypes$1.any,treeData:{type:Array},fieldNames:{type:Object},showLine:{type:[Boolean,Object],default:void 0},showIcon:{type:Boolean,default:void 0},icon:PropTypes$1.any,selectable:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},multiple:{type:Boolean,default:void 0},checkable:{type:Boolean,default:void 0},checkStrictly:{type:Boolean,default:void 0},draggable:{type:[Function,Boolean]},defaultExpandParent:{type:Boolean,default:void 0},autoExpandParent:{type:Boolean,default:void 0},defaultExpandAll:{type:Boolean,default:void 0},defaultExpandedKeys:{type:Array},expandedKeys:{type:Array},defaultCheckedKeys:{type:Array},checkedKeys:{type:[Object,Array]},defaultSelectedKeys:{type:Array},selectedKeys:{type:Array},allowDrop:{type:Function},dropIndicatorRender:{type:Function},onFocus:{type:Function},onBlur:{type:Function},onKeydown:{type:Function},onContextmenu:{type:Function},onClick:{type:Function},onDblclick:{type:Function},onScroll:{type:Function},onExpand:{type:Function},onCheck:{type:Function},onSelect:{type:Function},onLoad:{type:Function},loadData:{type:Function},loadedKeys:{type:Array},onMouseenter:{type:Function},onMouseleave:{type:Function},onRightClick:{type:Function},onDragstart:{type:Function},onDragenter:{type:Function},onDragover:{type:Function},onDragleave:{type:Function},onDragend:{type:Function},onDrop:{type:Function},onActiveChange:{type:Function},filterTreeNode:{type:Function},motion:PropTypes$1.any,switcherIcon:PropTypes$1.any,height:Number,itemHeight:Number,virtual:{type:Boolean,default:void 0},direction:{type:String}}},__rest$n=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},ICON_OPEN="open",ICON_CLOSE="close",defaultTitle="---",VcTreeNode=defineComponent({name:"TreeNode",inheritAttrs:!1,props:treeNodeProps,isTreeNode:1,slots:["title","icon","switcherIcon"],setup:function(e,t){var n=t.attrs,i=t.slots,o=t.expose;warning$3(!("slots"in e.data),"treeData slots is deprecated, please use ".concat(Object.keys(e.data.slots||{}).map((function(e){return"`v-slot:"+e+"` "})),"instead"));var r=ref(!1),s=useInjectTreeContext(),a=useInjectKeysState(),l=a.expandedKeysSet,c=a.selectedKeysSet,d=a.loadedKeysSet,u=a.loadingKeysSet,h=a.checkedKeysSet,g=a.halfCheckedKeysSet,p=s.value,f=p.dragOverNodeKey,m=p.dropPosition,v=p.keyEntities,_=computed((function(){return getTreeNodeProps(e.eventKey,{expandedKeysSet:l.value,selectedKeysSet:c.value,loadedKeysSet:d.value,loadingKeysSet:u.value,checkedKeysSet:h.value,halfCheckedKeysSet:g.value,dragOverNodeKey:f,dropPosition:m,keyEntities:v})})),C=eagerComputed((function(){return _.value.expanded})),b=eagerComputed((function(){return _.value.selected})),y=eagerComputed((function(){return _.value.checked})),S=eagerComputed((function(){return _.value.loaded})),w=eagerComputed((function(){return _.value.loading})),E=eagerComputed((function(){return _.value.halfChecked})),x=eagerComputed((function(){return _.value.dragOver})),T=eagerComputed((function(){return _.value.dragOverGapTop})),I=eagerComputed((function(){return _.value.dragOverGapBottom})),k=eagerComputed((function(){return _.value.pos})),L=ref(),D=computed((function(){var t=e.eventKey;return!!((s.value.keyEntities[t]||{}).children||[]).length})),N=computed((function(){var t=e.isLeaf,n=s.value.loadData,i=D.value;return!1!==t&&(t||!n&&!i||n&&S.value&&!i)})),O=computed((function(){return N.value?null:C.value?ICON_OPEN:ICON_CLOSE})),A=computed((function(){var t=e.disabled;return!(!s.value.disabled&&!t)})),P=computed((function(){var t=e.checkable,n=s.value.checkable;return!(!n||!1===t)&&n})),R=computed((function(){var t=e.selectable,n=s.value.selectable;return"boolean"==typeof t?t:n})),M=computed((function(){var t=e.data;return _extends$1(_extends$1({active:e.active,checkable:e.checkable,disableCheckbox:e.disableCheckbox,disabled:e.disabled,selectable:e.selectable},t),{dataRef:t,data:t,isLeaf:N.value,checked:y.value,expanded:C.value,loading:w.value,selected:b.value,halfChecked:E.value})})),$=getCurrentInstance(),F=computed((function(){var t=e.eventKey,n=(s.value.keyEntities[t]||{}).parent;return _extends$1(_extends$1({},convertNodePropsToEventData(_extends$1({},e,_.value))),{parent:n})})),B=reactive({eventData:F,eventKey:computed((function(){return e.eventKey})),selectHandle:L,pos:k,key:$.vnode.key});o(B);var V=function(e){(0,s.value.onNodeDoubleClick)(e,F.value)},W=function(t){if(!A.value){var n=e.disableCheckbox,i=s.value.onNodeCheck;if(P.value&&!n){t.preventDefault();var o=!y.value;i(t,F.value,o)}}},H=function(e){(0,s.value.onNodeClick)(e,F.value),R.value?function(e){if(!A.value){var t=s.value.onNodeSelect;e.preventDefault(),t(e,F.value)}}(e):W(e)},z=function(e){(0,s.value.onNodeMouseEnter)(e,F.value)},K=function(e){(0,s.value.onNodeMouseLeave)(e,F.value)},j=function(e){(0,s.value.onNodeContextMenu)(e,F.value)},U=function(e){var t=s.value.onNodeDragStart;e.stopPropagation(),r.value=!0,t(e,B);try{e.dataTransfer.setData("text/plain","")}catch(n){}},G=function(e){var t=s.value.onNodeDragEnter;e.preventDefault(),e.stopPropagation(),t(e,B)},q=function(e){var t=s.value.onNodeDragOver;e.preventDefault(),e.stopPropagation(),t(e,B)},Y=function(e){var t=s.value.onNodeDragLeave;e.stopPropagation(),t(e,B)},X=function(e){var t=s.value.onNodeDragEnd;e.stopPropagation(),r.value=!1,t(e,B)},Z=function(e){var t=s.value.onNodeDrop;e.preventDefault(),e.stopPropagation(),r.value=!1,t(e,B)},Q=function(e){var t=s.value.onNodeExpand;w.value||t(e,F.value)},J=function(){var e=s.value,t=e.draggable,n=e.prefixCls;return(null==t?void 0:t.icon)?createVNode("span",{class:"".concat(n,"-draggable-icon")},[t.icon]):null},ee=function(){var e=s.value,t=e.loadData,n=e.onNodeLoad;w.value||t&&C.value&&!N.value&&(D.value||S.value||n(F.value))};onMounted((function(){ee()})),onUpdated((function(){ee()}));var te=function(){var t,n,o,r,a,l,c,d=s.value.prefixCls,u=(r=e.switcherIcon,a=void 0===r?i.switcherIcon||(null===(t=s.value.slots)||void 0===t?void 0:t[null===(o=null===(n=e.data)||void 0===n?void 0:n.slots)||void 0===o?void 0:o.switcherIcon]):r,l=s.value.switcherIcon,"function"==typeof(c=a||l)?c(M.value):c);if(N.value)return!1!==u?createVNode("span",{class:classNames("".concat(d,"-switcher"),"".concat(d,"-switcher-noop"))},[u]):null;var h=classNames("".concat(d,"-switcher"),"".concat(d,"-switcher_").concat(C.value?ICON_OPEN:ICON_CLOSE));return!1!==u?createVNode("span",{onClick:Q,class:h},[u]):null},ne=function(){var t,n,i=e.disableCheckbox,o=s.value.prefixCls,r=A.value;return P.value?createVNode("span",{class:classNames("".concat(o,"-checkbox"),y.value&&"".concat(o,"-checkbox-checked"),!y.value&&E.value&&"".concat(o,"-checkbox-indeterminate"),(r||i)&&"".concat(o,"-checkbox-disabled")),onClick:W},[null===(n=(t=s.value).customCheckable)||void 0===n?void 0:n.call(t)]):null},ie=function(){var e=s.value.prefixCls;return createVNode("span",{class:classNames("".concat(e,"-iconEle"),"".concat(e,"-icon__").concat(O.value||"docu"),w.value&&"".concat(e,"-icon_loading"))},null)},oe=function(){var t=e.disabled,n=e.eventKey,i=s.value,o=i.draggable,r=i.dropLevelOffset,a=i.dropPosition,l=i.prefixCls,c=i.indent,d=i.dropIndicatorRender,u=i.dragOverNodeKey,h=i.direction;return!t&&!1!==o&&u===n?d({dropPosition:a,dropLevelOffset:r,indent:c,prefixCls:l,direction:h}):null},re=function(){var t,n,o,a,l,c,d,u,h=e.icon,g=void 0===h?i.icon:h,p=e.data,f=i.title||(null===(t=s.value.slots)||void 0===t?void 0:t[null===(o=null===(n=e.data)||void 0===n?void 0:n.slots)||void 0===o?void 0:o.title])||(null===(a=s.value.slots)||void 0===a?void 0:a.title)||e.title,m=s.value,v=m.prefixCls,_=m.showIcon,C=m.icon,y=m.loadData,S=A.value,E="".concat(v,"-node-content-wrapper");if(_){var x=g||(null===(l=s.value.slots)||void 0===l?void 0:l[null===(c=null==p?void 0:p.slots)||void 0===c?void 0:c.icon])||C;d=x?createVNode("span",{class:classNames("".concat(v,"-iconEle"),"".concat(v,"-icon__customize"))},["function"==typeof x?x(M.value):x]):ie()}else y&&w.value&&(d=ie());u=void 0===(u="function"==typeof f?f(M.value):f)?defaultTitle:u;var T=createVNode("span",{class:"".concat(v,"-title")},[u]);return createVNode("span",{ref:L,title:"string"==typeof f?f:"",class:classNames("".concat(E),"".concat(E,"-").concat(O.value||"normal"),!S&&(b.value||r.value)&&"".concat(v,"-node-selected")),onMouseenter:z,onMouseleave:K,onContextmenu:j,onClick:H,onDblclick:V},[d,T,oe()])};return function(){var t,i=_extends$1(_extends$1({},e),n),o=i.eventKey,r=i.isLeaf,a=i.isStart,l=i.isEnd,c=i.domRef,d=i.active;i.data;var u,h,g=i.onMousemove,p=i.selectable,f=__rest$n(i,["eventKey","isLeaf","isStart","isEnd","domRef","active","data","onMousemove","selectable"]),m=s.value,v=m.prefixCls,_=m.filterTreeNode,S=m.keyEntities,k=m.dropContainerKey,L=m.dropTargetKey,D=m.draggingNodeKey,N=A.value,O=pickAttrs(f,{aria:!0,data:!0}),P=(S[o]||{}).level,R=l[l.length-1],M=(u=e.data,!(!(h=s.value.draggable)||h.nodeDraggable&&!h.nodeDraggable(u))),$=!N&&M,B=D===o,V=void 0!==p?{"aria-selected":!!p}:void 0;return createVNode("div",_objectSpread2$1(_objectSpread2$1({ref:c,class:classNames(n.class,"".concat(v,"-treenode"),(t={},_defineProperty$P(t,"".concat(v,"-treenode-disabled"),N),_defineProperty$P(t,"".concat(v,"-treenode-switcher-").concat(C.value?"open":"close"),!r),_defineProperty$P(t,"".concat(v,"-treenode-checkbox-checked"),y.value),_defineProperty$P(t,"".concat(v,"-treenode-checkbox-indeterminate"),E.value),_defineProperty$P(t,"".concat(v,"-treenode-selected"),b.value),_defineProperty$P(t,"".concat(v,"-treenode-loading"),w.value),_defineProperty$P(t,"".concat(v,"-treenode-active"),d),_defineProperty$P(t,"".concat(v,"-treenode-leaf-last"),R),_defineProperty$P(t,"".concat(v,"-treenode-draggable"),$),_defineProperty$P(t,"dragging",B),_defineProperty$P(t,"drop-target",L===o),_defineProperty$P(t,"drop-container",k===o),_defineProperty$P(t,"drag-over",!N&&x.value),_defineProperty$P(t,"drag-over-gap-top",!N&&T.value),_defineProperty$P(t,"drag-over-gap-bottom",!N&&I.value),_defineProperty$P(t,"filter-node",_&&_(F.value)),t)),style:n.style,draggable:$,"aria-grabbed":B,onDragstart:$?U:void 0,onDragenter:M?G:void 0,onDragover:M?q:void 0,onDragleave:M?Y:void 0,onDrop:M?Z:void 0,onDragend:M?X:void 0,onMousemove:g},V),O),[createVNode(Indent$1,{prefixCls:v,level:P,isStart:a,isEnd:l},null),J(),te(),ne(),re()])}}});function arrDel(e,t){if(!e)return[];var n=e.slice(),i=n.indexOf(t);return i>=0&&n.splice(i,1),n}function arrAdd(e,t){var n=(e||[]).slice();return-1===n.indexOf(t)&&n.push(t),n}function posToArr(e){return e.split("-")}function getPosition(e,t){return"".concat(e,"-").concat(t)}function isTreeNode(e){return e&&e.type&&e.type.isTreeNode}function getDragChildrenKeys(e,t){var n=[];return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach((function(t){var i=t.key,o=t.children;n.push(i),e(o)}))}(t[e].children),n}function isLastChild(e){if(e.parent){var t=posToArr(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function isFirstChild(e){var t=posToArr(e.pos);return 0===Number(t[t.length-1])}function calcDropPosition(e,t,n,i,o,r,s,a,l,c){var d,u=e.clientX,h=e.clientY,g=e.target.getBoundingClientRect(),p=g.top,f=g.height,m=(("rtl"===c?-1:1)*(((null==o?void 0:o.x)||0)-u)-12)/i,v=a[n.eventKey];if(h<p+f/2){var _=s.findIndex((function(e){return e.key===v.key})),C=s[_<=0?0:_-1].key;v=a[C]}var b=v.key,y=v,S=v.key,w=0,E=0;if(!l.has(b))for(var x=0;x<m&&isLastChild(v);x+=1)v=v.parent,E+=1;var T=t.eventData,I=v.node,k=!0;return isFirstChild(v)&&0===v.level&&h<p+f/2&&r({dragNode:T,dropNode:I,dropPosition:-1})&&v.key===n.eventKey?w=-1:(y.children||[]).length&&l.has(S)?r({dragNode:T,dropNode:I,dropPosition:0})?w=0:k=!1:0===E?m>-1.5?r({dragNode:T,dropNode:I,dropPosition:1})?w=1:k=!1:r({dragNode:T,dropNode:I,dropPosition:0})?w=0:r({dragNode:T,dropNode:I,dropPosition:1})?w=1:k=!1:r({dragNode:T,dropNode:I,dropPosition:1})?w=1:k=!1,{dropPosition:w,dropLevelOffset:E,dropTargetKey:v.key,dropTargetPos:v.pos,dragOverNodeKey:S,dropContainerKey:0===w?null:(null===(d=v.parent)||void 0===d?void 0:d.key)||null,dropAllowed:k}}function calcSelectedKeys(e,t){if(e)return t.multiple?e.slice():e.length?[e[0]]:e}function parseCheckedKeys(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==_typeof$3(e))return null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t}function conductExpandParent(e,t){var n=new Set;function i(e){if(!n.has(e)){var o=t[e];if(o){n.add(e);var r=o.parent;o.node.disabled||r&&i(r.key)}}}return(e||[]).forEach((function(e){i(e)})),_toConsumableArray$2(n)}globalThis&&globalThis.__rest;var __rest$m=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function getKey$1(e,t){return null!=e?e:t}function fillFieldNames$1(e){var t=e||{},n=t.title||"title";return{title:n,_title:t._title||[n],key:t.key||"key",children:t.children||"children"}}function convertTreeToData(e){return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=filterEmpty(t);return n.map((function(t){var n,i,o,r;if(!isTreeNode(t))return null;for(var s=t.children||{},a=t.key,l={},c=0,d=Object.entries(t.props);c<d.length;c++){var u=_slicedToArray$2(d[c],2),h=u[0],g=u[1];l[camelize$1(h)]=g}var p=l.isLeaf,f=l.checkable,m=l.selectable,v=l.disabled,_=l.disableCheckbox,C={isLeaf:p||""===p||void 0,checkable:f||""===f||void 0,selectable:m||""===m||void 0,disabled:v||""===v||void 0,disableCheckbox:_||""===_||void 0},b=_extends$1(_extends$1({},l),C),y=l.title,S=void 0===y?null===(n=s.title)||void 0===n?void 0:n.call(s,b):y,w=l.icon,E=void 0===w?null===(i=s.icon)||void 0===i?void 0:i.call(s,b):w,x=l.switcherIcon,T=void 0===x?null===(o=s.switcherIcon)||void 0===o?void 0:o.call(s,b):x,I=__rest$m(l,["title","icon","switcherIcon"]),k=null===(r=s.default)||void 0===r?void 0:r.call(s),L=_extends$1(_extends$1(_extends$1({},I),{title:S,icon:E,switcherIcon:T,key:a,isLeaf:p}),C),D=e(k);return D.length&&(L.children=D),L}))}(e)}function flattenTreeData(e,t,n){var i=fillFieldNames$1(n),o=i._title,r=i.key,s=i.children,a=new Set(!0===t?[]:t),l=[];return function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.map((function(c,d){for(var u,h=getPosition(i?i.pos:"0",d),g=getKey$1(c[r],h),p=0;p<o.length;p+=1){var f=o[p];if(void 0!==c[f]){u=c[f];break}}var m=_extends$1(_extends$1({},omit$2(c,[].concat(_toConsumableArray$2(o),[r,s]))),{title:u,key:g,parent:i,pos:h,children:null,data:c,isStart:[].concat(_toConsumableArray$2(i?i.isStart:[]),[0===d]),isEnd:[].concat(_toConsumableArray$2(i?i.isEnd:[]),[d===n.length-1])});return l.push(m),!0===t||a.has(g)?m.children=e(c[s]||[],m):m.children=[],m}))}(e),l}function traverseDataNodes(e,t,n){var i,o=("object"===_typeof$3(n)?n:{externalGetKey:n})||{},r=o.childrenPropName,s=o.externalGetKey,a=fillFieldNames$1(o.fieldNames),l=a.key,c=a.children,d=r||c;s?"string"==typeof s?i=function(e){return e[s]}:"function"==typeof s&&(i=function(e){return s(e)}):i=function(e,t){return getKey$1(e[l],t)},function n(o,r,s,a){var l=o?o[d]:e,c=o?getPosition(s.pos,r):"0",u=o?[].concat(_toConsumableArray$2(a),[o]):[];if(o){var h=i(o,c),g={node:o,index:r,pos:c,key:h,parentPos:s.node?s.pos:null,level:s.level+1,nodes:u};t(g)}l&&l.forEach((function(e,t){n(e,t,{node:o,pos:c,level:s?s.level+1:-1},u)}))}(null)}function convertDataToEntities(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.initWrapper,i=t.processEntity,o=t.onProcessFinished,r=t.externalGetKey,s=t.childrenPropName,a=t.fieldNames,l=arguments.length>2?arguments[2]:void 0,c=r||l,d={},u={},h={posEntities:d,keyEntities:u};return n&&(h=n(h)||h),traverseDataNodes(e,(function(e){var t=e.node,n=e.index,o=e.pos,r=e.key,s=e.parentPos,a=e.level,l={node:t,nodes:e.nodes,index:n,key:r,pos:o,level:a},c=getKey$1(r,o);d[o]=l,u[c]=l,l.parent=d[s],l.parent&&(l.parent.children=l.parent.children||[],l.parent.children.push(l)),i&&i(l,h)}),{externalGetKey:c,childrenPropName:s,fieldNames:a}),o&&o(h),h}function getTreeNodeProps(e,t){var n=t.expandedKeysSet,i=t.selectedKeysSet,o=t.loadedKeysSet,r=t.loadingKeysSet,s=t.checkedKeysSet,a=t.halfCheckedKeysSet,l=t.dragOverNodeKey,c=t.dropPosition,d=t.keyEntities[e];return{eventKey:e,expanded:n.has(e),selected:i.has(e),loaded:o.has(e),loading:r.has(e),checked:s.has(e),halfChecked:a.has(e),pos:String(d?d.pos:""),parent:d.parent,dragOver:l===e&&0===c,dragOverGapTop:l===e&&-1===c,dragOverGapBottom:l===e&&1===c}}function convertNodePropsToEventData(e){var t=e.data,n=e.expanded,i=e.selected,o=e.checked,r=e.loaded,s=e.loading,a=e.halfChecked,l=e.dragOver,c=e.dragOverGapTop,d=e.dragOverGapBottom,u=e.pos,h=e.active,g=e.eventKey,p=_extends$1(_extends$1({dataRef:t},t),{expanded:n,selected:i,checked:o,loaded:r,loading:s,halfChecked:a,dragOver:l,dragOverGapTop:c,dragOverGapBottom:d,pos:u,active:h,eventKey:g,key:g});return"props"in p||Object.defineProperty(p,"props",{get:function(){return e}}),p}function removeFromCheckedKeys(e,t){var n=new Set;return e.forEach((function(e){t.has(e)||n.add(e)})),n}function isCheckDisabled$1(e){var t=e||{},n=t.disabled,i=t.disableCheckbox,o=t.checkable;return!(!n&&!i)||!1===o}function fillConductCheck(e,t,n,i){for(var o=new Set(e),r=new Set,s=0;s<=n;s+=1){(t.get(s)||new Set).forEach((function(e){var t=e.key,n=e.node,r=e.children,s=void 0===r?[]:r;o.has(t)&&!i(n)&&s.filter((function(e){return!i(e.node)})).forEach((function(e){o.add(e.key)}))}))}for(var a=new Set,l=n;l>=0;l-=1){(t.get(l)||new Set).forEach((function(e){var t=e.parent,n=e.node;if(!i(n)&&e.parent&&!a.has(e.parent.key))if(i(e.parent.node))a.add(t.key);else{var s=!0,l=!1;(t.children||[]).filter((function(e){return!i(e.node)})).forEach((function(e){var t=e.key,n=o.has(t);s&&!n&&(s=!1),l||!n&&!r.has(t)||(l=!0)})),s&&o.add(t.key),l&&r.add(t.key),a.add(t.key)}}))}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(removeFromCheckedKeys(r,o))}}function cleanConductCheck(e,t,n,i,o){for(var r=new Set(e),s=new Set(t),a=0;a<=i;a+=1){(n.get(a)||new Set).forEach((function(e){var t=e.key,n=e.node,i=e.children,a=void 0===i?[]:i;r.has(t)||s.has(t)||o(n)||a.filter((function(e){return!o(e.node)})).forEach((function(e){r.delete(e.key)}))}))}s=new Set;for(var l=new Set,c=i;c>=0;c-=1){(n.get(c)||new Set).forEach((function(e){var t=e.parent,n=e.node;if(!o(n)&&e.parent&&!l.has(e.parent.key))if(o(e.parent.node))l.add(t.key);else{var i=!0,a=!1;(t.children||[]).filter((function(e){return!o(e.node)})).forEach((function(e){var t=e.key,n=r.has(t);i&&!n&&(i=!1),a||!n&&!s.has(t)||(a=!0)})),i||r.delete(t.key),a&&s.add(t.key),l.add(t.key)}}))}return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(removeFromCheckedKeys(s,r))}}function conductCheck(e,t,n,i,o,r){var s;s=r||isCheckDisabled$1;var a=new Set(e.filter((function(e){return!!n[e]})));return!0===t?fillConductCheck(a,o,i,s):cleanConductCheck(a,t.halfCheckedKeys,o,i,s)}function useMaxLevel(e){var t=ref(0),n=shallowRef();return watchEffect((function(){var i=new Map,o=0,r=e.value||{};for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s)){var a=r[s],l=a.level,c=i.get(l);c||(c=new Set,i.set(l,c)),c.add(a),o=Math.max(o,l)}t.value=o,n.value=i})),{maxLevel:t,levelEntities:n}}var LeftOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},LeftOutlinedSvg=LeftOutlined$2;function _objectSpread$u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$u(e,t,n[t])}))}return e}function _defineProperty$u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var LeftOutlined=function(e,t){var n=_objectSpread$u({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$u({},n,{icon:LeftOutlinedSvg}),null)};LeftOutlined.displayName="LeftOutlined",LeftOutlined.inheritAttrs=!1;var LeftOutlined$1=LeftOutlined;function arrayEach(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););return e}function copyObject(e,t,n,i){var o=!n;n||(n={});for(var r=-1,s=t.length;++r<s;){var a=t[r],l=i?i(n[a],e[a],a,n,e):void 0;void 0===l&&(l=e[a]),o?baseAssignValue(n,a,l):assignValue(n,a,l)}return n}function baseAssign(e,t){return e&©Object(t,keys(t),e)}function nativeKeysIn(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}var objectProto$1=Object.prototype,hasOwnProperty$7=objectProto$1.hasOwnProperty;function baseKeysIn(e){if(!isObject$5(e))return nativeKeysIn(e);var t=isPrototype(e),n=[];for(var i in e)("constructor"!=i||!t&&hasOwnProperty$7.call(e,i))&&n.push(i);return n}function keysIn(e){return isArrayLike(e)?arrayLikeKeys(e,!0):baseKeysIn(e)}function baseAssignIn(e,t){return e&©Object(t,keysIn(t),e)}var freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,Buffer$1=moduleExports?root$1.Buffer:void 0,allocUnsafe=Buffer$1?Buffer$1.allocUnsafe:void 0;function cloneBuffer(e,t){if(t)return e.slice();var n=e.length,i=allocUnsafe?allocUnsafe(n):new e.constructor(n);return e.copy(i),i}function copyArray(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}function copySymbols(e,t){return copyObject(e,getSymbols$1(e),t)}var nativeGetSymbols=Object.getOwnPropertySymbols,getSymbolsIn=nativeGetSymbols?function(e){for(var t=[];e;)arrayPush$1(t,getSymbols$1(e)),e=getPrototype$1(e);return t}:stubArray,getSymbolsIn$1=getSymbolsIn;function copySymbolsIn(e,t){return copyObject(e,getSymbolsIn$1(e),t)}function getAllKeysIn(e){return baseGetAllKeys(e,keysIn,getSymbolsIn$1)}var objectProto=Object.prototype,hasOwnProperty$6=objectProto.hasOwnProperty;function initCloneArray(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&hasOwnProperty$6.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function cloneArrayBuffer(e){var t=new e.constructor(e.byteLength);return new Uint8Array$2(t).set(new Uint8Array$2(e)),t}function cloneDataView(e,t){var n=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var reFlags=/\w*$/;function cloneRegExp(e){var t=new e.constructor(e.source,reFlags.exec(e));return t.lastIndex=e.lastIndex,t}var symbolProto=Symbol$2?Symbol$2.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function cloneSymbol(e){return symbolValueOf?Object(symbolValueOf.call(e)):{}}function cloneTypedArray(e,t){var n=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var boolTag$1="[object Boolean]",dateTag$1="[object Date]",mapTag$2="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$2="[object String]",symbolTag$1="[object Symbol]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag$1="[object Float32Array]",float64Tag$1="[object Float64Array]",int8Tag$1="[object Int8Array]",int16Tag$1="[object Int16Array]",int32Tag$1="[object Int32Array]",uint8Tag$1="[object Uint8Array]",uint8ClampedTag$1="[object Uint8ClampedArray]",uint16Tag$1="[object Uint16Array]",uint32Tag$1="[object Uint32Array]";function initCloneByTag(e,t,n){var i=e.constructor;switch(t){case arrayBufferTag$1:return cloneArrayBuffer(e);case boolTag$1:case dateTag$1:return new i(+e);case dataViewTag$1:return cloneDataView(e,n);case float32Tag$1:case float64Tag$1:case int8Tag$1:case int16Tag$1:case int32Tag$1:case uint8Tag$1:case uint8ClampedTag$1:case uint16Tag$1:case uint32Tag$1:return cloneTypedArray(e,n);case mapTag$2:return new i;case numberTag$1:case stringTag$2:return new i(e);case regexpTag$1:return cloneRegExp(e);case setTag$2:return new i;case symbolTag$1:return cloneSymbol(e)}}var objectCreate=Object.create,baseCreate=function(){function e(){}return function(t){if(!isObject$5(t))return{};if(objectCreate)return objectCreate(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),baseCreate$1=baseCreate;function initCloneObject(e){return"function"!=typeof e.constructor||isPrototype(e)?{}:baseCreate$1(getPrototype$1(e))}var mapTag$1="[object Map]";function baseIsMap(e){return isObjectLike(e)&&getTag$1(e)==mapTag$1}var nodeIsMap=nodeUtil$1&&nodeUtil$1.isMap,isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap,isMap$1=isMap,setTag$1="[object Set]";function baseIsSet(e){return isObjectLike(e)&&getTag$1(e)==setTag$1}var nodeIsSet=nodeUtil$1&&nodeUtil$1.isSet,isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet,isSet$1=isSet,CLONE_DEEP_FLAG$2=1,CLONE_FLAT_FLAG$1=2,CLONE_SYMBOLS_FLAG$2=4,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag$1="[object String]",symbolTag="[object Symbol]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",cloneableTags={};function baseClone(e,t,n,i,o,r){var s,a=t&CLONE_DEEP_FLAG$2,l=t&CLONE_FLAT_FLAG$1,c=t&CLONE_SYMBOLS_FLAG$2;if(n&&(s=o?n(e,i,o,r):n(e)),void 0!==s)return s;if(!isObject$5(e))return e;var d=isArray$4(e);if(d){if(s=initCloneArray(e),!a)return copyArray(e,s)}else{var u=getTag$1(e),h=u==funcTag||u==genTag;if(isBuffer$2(e))return cloneBuffer(e,a);if(u==objectTag||u==argsTag||h&&!o){if(s=l||h?{}:initCloneObject(e),!a)return l?copySymbolsIn(e,baseAssignIn(s,e)):copySymbols(e,baseAssign(s,e))}else{if(!cloneableTags[u])return o?e:{};s=initCloneByTag(e,u,a)}}r||(r=new Stack$1);var g=r.get(e);if(g)return g;r.set(e,s),isSet$1(e)?e.forEach((function(i){s.add(baseClone(i,t,n,i,e,r))})):isMap$1(e)&&e.forEach((function(i,o){s.set(o,baseClone(i,t,n,o,e,r))}));var p=d?void 0:(c?l?getAllKeysIn:getAllKeys$1:l?keysIn:keys)(e);return arrayEach(p||e,(function(i,o){p&&(i=e[o=i]),assignValue(s,o,baseClone(i,t,n,o,e,r))})),s}cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag$1]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;var CLONE_DEEP_FLAG$1=1,CLONE_SYMBOLS_FLAG$1=4;function cloneDeep(e){return baseClone(e,CLONE_DEEP_FLAG$1|CLONE_SYMBOLS_FLAG$1)}function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},_extends.apply(this,arguments)}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e2){return!1}}function _construct(e,t,n){return(_construct=_isNativeReflectConstruct()?Reflect.construct.bind():function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&_setPrototypeOf(o,n.prototype),o}).apply(null,arguments)}function _isNativeFunction(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _wrapNativeSuper(e){var t="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function(e){if(null===e||!_isNativeFunction(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(n,e)},_wrapNativeSuper(e)}var formatRegExp=/%[sdj%]/g,warning=function(){};function convertFieldsError(e){if(!e||!e.length)return null;var t={};return e.forEach((function(e){var n=e.field;t[n]=t[n]||[],t[n].push(e)})),t}function format$2(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var o=0,r=n.length;if("function"==typeof e)return e.apply(null,n);if("string"==typeof e){var s=e.replace(formatRegExp,(function(e){if("%%"===e)return"%";if(o>=r)return e;switch(e){case"%s":return String(n[o++]);case"%d":return Number(n[o++]);case"%j":try{return JSON.stringify(n[o++])}catch(t){return"[Circular]"}break;default:return e}}));return s}return e}function isNativeStringType(e){return"string"===e||"url"===e||"hex"===e||"email"===e||"date"===e||"pattern"===e}function isEmptyValue(e,t){return null==e||(!("array"!==t||!Array.isArray(e)||e.length)||!(!isNativeStringType(t)||"string"!=typeof e||e))}function asyncParallelArray(e,t,n){var i=[],o=0,r=e.length;function s(e){i.push.apply(i,e||[]),++o===r&&n(i)}e.forEach((function(e){t(e,s)}))}function asyncSerialArray(e,t,n){var i=0,o=e.length;!function r(s){if(s&&s.length)n(s);else{var a=i;i+=1,a<o?t(e[a],r):n([])}}([])}function flattenObjArr(e){var t=[];return Object.keys(e).forEach((function(n){t.push.apply(t,e[n]||[])})),t}"undefined"!=typeof process&&process.env;var AsyncValidationError=function(e){function t(t,n){var i;return(i=e.call(this,"Async Validation Error")||this).errors=t,i.fields=n,i}return _inheritsLoose(t,e),t}(_wrapNativeSuper(Error));function asyncMap(e,t,n,i,o){if(t.first){var r=new Promise((function(t,r){asyncSerialArray(flattenObjArr(e),n,(function(e){return i(e),e.length?r(new AsyncValidationError(e,convertFieldsError(e))):t(o)}))}));return r.catch((function(e){return e})),r}var s=!0===t.firstFields?Object.keys(e):t.firstFields||[],a=Object.keys(e),l=a.length,c=0,d=[],u=new Promise((function(t,r){var u=function(e){if(d.push.apply(d,e),++c===l)return i(d),d.length?r(new AsyncValidationError(d,convertFieldsError(d))):t(o)};a.length||(i(d),t(o)),a.forEach((function(t){var i=e[t];-1!==s.indexOf(t)?asyncSerialArray(i,n,u):asyncParallelArray(i,n,u)}))}));return u.catch((function(e){return e})),u}function isErrorObj(e){return!(!e||void 0===e.message)}function getValue$1(e,t){for(var n=e,i=0;i<t.length;i++){if(null==n)return n;n=n[t[i]]}return n}function complementError(e,t){return function(n){var i;return i=e.fullFields?getValue$1(t,e.fullFields):t[n.field||e.fullField],isErrorObj(n)?(n.field=n.field||e.fullField,n.fieldValue=i,n):{message:"function"==typeof n?n():n,fieldValue:i,field:n.field||e.fullField}}}function deepMerge(e,t){if(t)for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];"object"==typeof i&&"object"==typeof e[n]?e[n]=_extends({},e[n],i):e[n]=i}return e}var required$1=function(e,t,n,i,o,r){!e.required||n.hasOwnProperty(e.field)&&!isEmptyValue(t,r||e.type)||i.push(format$2(o.messages.required,e.fullField))},whitespace=function(e,t,n,i,o){(/^\s+$/.test(t)||""===t)&&i.push(format$2(o.messages.whitespace,e.fullField))},urlReg,getUrlRegex=function(){if(urlReg)return urlReg;var e="[a-fA-F\\d:]",t=function(t){return t&&t.includeBoundaries?"(?:(?<=\\s|^)(?="+e+")|(?<="+e+")(?=\\s|$))":""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",i="[a-fA-F\\d]{1,4}",o=("\n(?:\n(?:"+i+":){7}(?:"+i+"|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:"+i+":){6}(?:"+n+"|:"+i+"|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:"+i+":){5}(?::"+n+"|(?::"+i+"){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:"+i+":){4}(?:(?::"+i+"){0,1}:"+n+"|(?::"+i+"){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:"+i+":){3}(?:(?::"+i+"){0,2}:"+n+"|(?::"+i+"){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:"+i+":){2}(?:(?::"+i+"){0,3}:"+n+"|(?::"+i+"){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:"+i+":){1}(?:(?::"+i+"){0,4}:"+n+"|(?::"+i+"){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::"+i+"){0,5}:"+n+"|(?::"+i+"){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),r=new RegExp("(?:^"+n+"$)|(?:^"+o+"$)"),s=new RegExp("^"+n+"$"),a=new RegExp("^"+o+"$"),l=function(e){return e&&e.exact?r:new RegExp("(?:"+t(e)+n+t(e)+")|(?:"+t(e)+o+t(e)+")","g")};l.v4=function(e){return e&&e.exact?s:new RegExp(""+t(e)+n+t(e),"g")},l.v6=function(e){return e&&e.exact?a:new RegExp(""+t(e)+o+t(e),"g")};var c=l.v4().source,d=l.v6().source;return urlReg=new RegExp("(?:^"+("(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|"+c+"|"+d+'|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?')+"$)","i")},pattern$2={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},types={integer:function(e){return types.number(e)&&parseInt(e,10)===e},float:function(e){return types.number(e)&&!types.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(e2){return!1}},date:function(e){return"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear&&!isNaN(e.getTime())},number:function(e){return!isNaN(e)&&"number"==typeof e},object:function(e){return"object"==typeof e&&!types.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&e.length<=320&&!!e.match(pattern$2.email)},url:function(e){return"string"==typeof e&&e.length<=2048&&!!e.match(getUrlRegex())},hex:function(e){return"string"==typeof e&&!!e.match(pattern$2.hex)}},type$1=function(e,t,n,i,o){if(e.required&&void 0===t)required$1(e,t,n,i,o);else{var r=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(r)>-1?types[r](t)||i.push(format$2(o.messages.types[r],e.fullField,e.type)):r&&typeof t!==e.type&&i.push(format$2(o.messages.types[r],e.fullField,e.type))}},range$1=function(e,t,n,i,o){var r="number"==typeof e.len,s="number"==typeof e.min,a="number"==typeof e.max,l=t,c=null,d="number"==typeof t,u="string"==typeof t,h=Array.isArray(t);if(d?c="number":u?c="string":h&&(c="array"),!c)return!1;h&&(l=t.length),u&&(l=t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),r?l!==e.len&&i.push(format$2(o.messages[c].len,e.fullField,e.len)):s&&!a&&l<e.min?i.push(format$2(o.messages[c].min,e.fullField,e.min)):a&&!s&&l>e.max?i.push(format$2(o.messages[c].max,e.fullField,e.max)):s&&a&&(l<e.min||l>e.max)&&i.push(format$2(o.messages[c].range,e.fullField,e.min,e.max))},ENUM$1="enum",enumerable$1=function(e,t,n,i,o){e[ENUM$1]=Array.isArray(e[ENUM$1])?e[ENUM$1]:[],-1===e[ENUM$1].indexOf(t)&&i.push(format$2(o.messages[ENUM$1],e.fullField,e[ENUM$1].join(", ")))},pattern$1=function(e,t,n,i,o){if(e.pattern)if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||i.push(format$2(o.messages.pattern.mismatch,e.fullField,t,e.pattern));else if("string"==typeof e.pattern){new RegExp(e.pattern).test(t)||i.push(format$2(o.messages.pattern.mismatch,e.fullField,t,e.pattern))}},rules={required:required$1,whitespace:whitespace,type:type$1,range:range$1,enum:enumerable$1,pattern:pattern$1},string$1=function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(isEmptyValue(t,"string")&&!e.required)return n();rules.required(e,t,i,r,o,"string"),isEmptyValue(t,"string")||(rules.type(e,t,i,r,o),rules.range(e,t,i,r,o),rules.pattern(e,t,i,r,o),!0===e.whitespace&&rules.whitespace(e,t,i,r,o))}n(r)},method=function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(isEmptyValue(t)&&!e.required)return n();rules.required(e,t,i,r,o),void 0!==t&&rules.type(e,t,i,r,o)}n(r)},number$1=function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(""===t&&(t=void 0),isEmptyValue(t)&&!e.required)return n();rules.required(e,t,i,r,o),void 0!==t&&(rules.type(e,t,i,r,o),rules.range(e,t,i,r,o))}n(r)},_boolean=function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(isEmptyValue(t)&&!e.required)return n();rules.required(e,t,i,r,o),void 0!==t&&rules.type(e,t,i,r,o)}n(r)},regexp=function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(isEmptyValue(t)&&!e.required)return n();rules.required(e,t,i,r,o),isEmptyValue(t)||rules.type(e,t,i,r,o)}n(r)},integer=function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(isEmptyValue(t)&&!e.required)return n();rules.required(e,t,i,r,o),void 0!==t&&(rules.type(e,t,i,r,o),rules.range(e,t,i,r,o))}n(r)},floatFn=function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(isEmptyValue(t)&&!e.required)return n();rules.required(e,t,i,r,o),void 0!==t&&(rules.type(e,t,i,r,o),rules.range(e,t,i,r,o))}n(r)},array=function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(null==t&&!e.required)return n();rules.required(e,t,i,r,o,"array"),null!=t&&(rules.type(e,t,i,r,o),rules.range(e,t,i,r,o))}n(r)},object=function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(isEmptyValue(t)&&!e.required)return n();rules.required(e,t,i,r,o),void 0!==t&&rules.type(e,t,i,r,o)}n(r)},ENUM="enum",enumerable=function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(isEmptyValue(t)&&!e.required)return n();rules.required(e,t,i,r,o),void 0!==t&&rules[ENUM](e,t,i,r,o)}n(r)},pattern=function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(isEmptyValue(t,"string")&&!e.required)return n();rules.required(e,t,i,r,o),isEmptyValue(t,"string")||rules.pattern(e,t,i,r,o)}n(r)},date=function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(isEmptyValue(t,"date")&&!e.required)return n();var s;if(rules.required(e,t,i,r,o),!isEmptyValue(t,"date"))s=t instanceof Date?t:new Date(t),rules.type(e,s,i,r,o),s&&rules.range(e,s.getTime(),i,r,o)}n(r)},required=function(e,t,n,i,o){var r=[],s=Array.isArray(t)?"array":typeof t;rules.required(e,t,i,r,o,s),n(r)},type=function(e,t,n,i,o){var r=e.type,s=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(isEmptyValue(t,r)&&!e.required)return n();rules.required(e,t,i,s,o,r),isEmptyValue(t,r)||rules.type(e,t,i,s,o)}n(s)},any=function(e,t,n,i,o){var r=[];if(e.required||!e.required&&i.hasOwnProperty(e.field)){if(isEmptyValue(t)&&!e.required)return n();rules.required(e,t,i,r,o)}n(r)},validators$2={string:string$1,method:method,number:number$1,boolean:_boolean,regexp:regexp,integer:integer,float:floatFn,array:array,object:object,enum:enumerable,pattern:pattern,date:date,url:type,hex:type,email:type,required:required,any:any};function newMessages(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var messages=newMessages(),Schema=function(){function e(e){this.rules=null,this._messages=messages,this.define(e)}var t=e.prototype;return t.define=function(e){var t=this;if(!e)throw new Error("Cannot configure a schema with no rules");if("object"!=typeof e||Array.isArray(e))throw new Error("Rules must be an object");this.rules={},Object.keys(e).forEach((function(n){var i=e[n];t.rules[n]=Array.isArray(i)?i:[i]}))},t.messages=function(e){return e&&(this._messages=deepMerge(newMessages(),e)),this._messages},t.validate=function(t,n,i){var o=this;void 0===n&&(n={}),void 0===i&&(i=function(){});var r=t,s=n,a=i;if("function"==typeof s&&(a=s,s={}),!this.rules||0===Object.keys(this.rules).length)return a&&a(null,r),Promise.resolve(r);if(s.messages){var l=this.messages();l===messages&&(l=newMessages()),deepMerge(l,s.messages),s.messages=l}else s.messages=this.messages();var c={};(s.keys||Object.keys(this.rules)).forEach((function(e){var n=o.rules[e],i=r[e];n.forEach((function(n){var s=n;"function"==typeof s.transform&&(r===t&&(r=_extends({},r)),i=r[e]=s.transform(i)),(s="function"==typeof s?{validator:s}:_extends({},s)).validator=o.getValidationMethod(s),s.validator&&(s.field=e,s.fullField=s.fullField||e,s.type=o.getType(s),c[e]=c[e]||[],c[e].push({rule:s,value:i,source:r,field:e}))}))}));var d={};return asyncMap(c,s,(function(t,n){var i,o=t.rule,a=!("object"!==o.type&&"array"!==o.type||"object"!=typeof o.fields&&"object"!=typeof o.defaultField);function l(e,t){return _extends({},t,{fullField:o.fullField+"."+e,fullFields:o.fullFields?[].concat(o.fullFields,[e]):[e]})}function c(i){void 0===i&&(i=[]);var c=Array.isArray(i)?i:[i];!s.suppressWarning&&c.length&&e.warning("async-validator:",c),c.length&&void 0!==o.message&&(c=[].concat(o.message));var u=c.map(complementError(o,r));if(s.first&&u.length)return d[o.field]=1,n(u);if(a){if(o.required&&!t.value)return void 0!==o.message?u=[].concat(o.message).map(complementError(o,r)):s.error&&(u=[s.error(o,format$2(s.messages.required,o.field))]),n(u);var h={};o.defaultField&&Object.keys(t.value).map((function(e){h[e]=o.defaultField})),h=_extends({},h,t.rule.fields);var g={};Object.keys(h).forEach((function(e){var t=h[e],n=Array.isArray(t)?t:[t];g[e]=n.map(l.bind(null,e))}));var p=new e(g);p.messages(s.messages),t.rule.options&&(t.rule.options.messages=s.messages,t.rule.options.error=s.error),p.validate(t.value,t.rule.options||s,(function(e){var t=[];u&&u.length&&t.push.apply(t,u),e&&e.length&&t.push.apply(t,e),n(t.length?t:null)}))}else n(u)}if(a=a&&(o.required||!o.required&&t.value),o.field=t.field,o.asyncValidator)i=o.asyncValidator(o,t.value,c,t.source,s);else if(o.validator){try{i=o.validator(o,t.value,c,t.source,s)}catch(u){console.error,s.suppressValidatorError||setTimeout((function(){throw u}),0),c(u.message)}!0===i?c():!1===i?c("function"==typeof o.message?o.message(o.fullField||o.field):o.message||(o.fullField||o.field)+" fails"):i instanceof Array?c(i):i instanceof Error&&c(i.message)}i&&i.then&&i.then((function(){return c()}),(function(e){return c(e)}))}),(function(e){!function(e){for(var t,n,i=[],o={},s=0;s<e.length;s++)t=e[s],n=void 0,Array.isArray(t)?i=(n=i).concat.apply(n,t):i.push(t);i.length?(o=convertFieldsError(i),a(i,o)):a(null,r)}(e)}),r)},t.getType=function(e){if(void 0===e.type&&e.pattern instanceof RegExp&&(e.type="pattern"),"function"!=typeof e.validator&&e.type&&!validators$2.hasOwnProperty(e.type))throw new Error(format$2("Unknown rule type %s",e.type));return e.type||"string"},t.getValidationMethod=function(e){if("function"==typeof e.validator)return e.validator;var t=Object.keys(e),n=t.indexOf("message");return-1!==n&&t.splice(n,1),1===t.length&&"required"===t[0]?validators$2.required:validators$2[this.getType(e)]||void 0},e}();function toArray$5(e){return null==e?[]:Array.isArray(e)?e:[e]}function get$2(e,t){for(var n=e,i=0;i<t.length;i+=1){if(null==n)return;n=n[t[i]]}return n}function internalSet(e,t,n,i){if(!t.length)return n;var o,r=_toArray(t),s=r[0],a=r.slice(1);return o=e||"number"!=typeof s?Array.isArray(e)?_toConsumableArray$2(e):_extends$1({},e):[],i&&void 0===n&&1===a.length?delete o[s][a[0]]:o[s]=internalSet(o[s],a,n,i),o}function set(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return t.length&&i&&void 0===n&&!get$2(e,t.slice(0,-1))?e:internalSet(e,t,n,i)}function getNamePath(e){return toArray$5(e)}function getValue(e,t){return get$2(e,t)}function setValue(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=set(e,t,n,i);return o}function containsNamePath(e,t){return e&&e.some((function(e){return matchNamePath(e,t)}))}function isObject$4(e){return"object"===_typeof$3(e)&&null!==e&&Object.getPrototypeOf(e)===Object.prototype}function internalSetValues(e,t){var n=Array.isArray(e)?_toConsumableArray$2(e):_extends$1({},e);return t?(Object.keys(t).forEach((function(e){var i=n[e],o=t[e],r=isObject$4(i)&&isObject$4(o);n[e]=r?internalSetValues(i,o||{}):o})),n):n}function setValues(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return n.reduce((function(e,t){return internalSetValues(e,t)}),e)}function cloneByNamePathList(e,t){var n={};return t.forEach((function(t){var i=getValue(e,t);n=setValue(n,t,i)})),n}function matchNamePath(e,t){return!(!e||!t||e.length!==t.length)&&e.every((function(e,n){return t[n]===e}))}Schema.register=function(e,t){if("function"!=typeof t)throw new Error("Cannot register a validator by type, validator is not a function");validators$2[e]=t},Schema.warning=warning,Schema.messages=messages,Schema.validators=validators$2;var typeTemplate="'${name}' is not a valid ${type}",defaultValidateMessages={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:typeTemplate,method:typeTemplate,array:typeTemplate,object:typeTemplate,number:typeTemplate,date:typeTemplate,boolean:typeTemplate,integer:typeTemplate,float:typeTemplate,regexp:typeTemplate,email:typeTemplate,url:typeTemplate,hex:typeTemplate},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},__awaiter$19=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},AsyncValidator=Schema;function replaceMessage(e,t){return e.replace(/\$\{\w+\}/g,(function(e){var n=e.slice(2,-1);return t[n]}))}function validateRule(e,t,n,i,o){return __awaiter$19(this,void 0,void 0,regenerator.mark((function r(){var s,a,l,c,d,u,h,g;return regenerator.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return delete(s=_extends$1({},n)).ruleIndex,delete s.trigger,a=null,s&&"array"===s.type&&s.defaultField&&(a=s.defaultField,delete s.defaultField),l=new AsyncValidator(_defineProperty$P({},e,[s])),c=setValues({},defaultValidateMessages,i.validateMessages),l.messages(c),d=[],r.prev=9,r.next=12,Promise.resolve(l.validate(_defineProperty$P({},e,t),_extends$1({},i)));case 12:r.next=17;break;case 14:r.prev=14,r.t0=r.catch(9),d=r.t0.errors?r.t0.errors.map((function(e,t){var n=e.message;return isValidElement(n)?cloneVNode(n,{key:"error_".concat(t)}):n})):[c.default()];case 17:if(d.length||!a){r.next=22;break}return r.next=20,Promise.all(t.map((function(t,n){return validateRule("".concat(e,".").concat(n),t,a,i,o)})));case 20:return u=r.sent,r.abrupt("return",u.reduce((function(e,t){return[].concat(_toConsumableArray$2(e),_toConsumableArray$2(t))}),[]));case 22:return h=_extends$1(_extends$1(_extends$1({},n),{name:e,enum:(n.enum||[]).join(", ")}),o),g=d.map((function(e){return"string"==typeof e?replaceMessage(e,h):e})),r.abrupt("return",g);case 25:case"end":return r.stop()}}),r,null,[[9,14]])})))}function validateRules(e,t,n,i,o,r){var s,a=this,l=e.join("."),c=n.map((function(e,t){var n=e.validator,i=_extends$1(_extends$1({},e),{ruleIndex:t});return n&&(i.validator=function(e,t,i){var o=!1,r=n(e,t,(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Promise.resolve().then((function(){o||i.apply(void 0,t)}))}));(o=r&&"function"==typeof r.then&&"function"==typeof r.catch)&&r.then((function(){i()})).catch((function(e){i(e||" ")}))}),i})).sort((function(e,t){var n=e.warningOnly,i=e.ruleIndex,o=t.warningOnly,r=t.ruleIndex;return!!n==!!o?i-r:n?1:-1}));if(!0===o)s=new Promise((function(e,n){return __awaiter$19(a,void 0,void 0,regenerator.mark((function o(){var s,a,d;return regenerator.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:s=0;case 1:if(!(s<c.length)){o.next=12;break}return a=c[s],o.next=5,validateRule(l,t,a,i,r);case 5:if(!(d=o.sent).length){o.next=9;break}return n([{errors:d,rule:a}]),o.abrupt("return");case 9:s+=1,o.next=1;break;case 12:e([]);case 13:case"end":return o.stop()}}),o)})))}));else{var d=c.map((function(e){return validateRule(l,t,e,i,r).then((function(t){return{errors:t,rule:e}}))}));s=(o?finishOnFirstFailed(d):finishOnAllFailed(d)).then((function(e){return Promise.reject(e)}))}return s.catch((function(e){return e})),s}function finishOnAllFailed(e){return __awaiter$19(this,void 0,void 0,regenerator.mark((function t(){return regenerator.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Promise.all(e).then((function(e){var t;return(t=[]).concat.apply(t,_toConsumableArray$2(e))})));case 1:case"end":return t.stop()}}),t)})))}function finishOnFirstFailed(e){return __awaiter$19(this,void 0,void 0,regenerator.mark((function t(){var n;return regenerator.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=0,t.abrupt("return",new Promise((function(t){e.forEach((function(i){i.then((function(i){i.errors.length&&t([i]),(n+=1)===e.length&&t([])}))}))})));case 2:case"end":return t.stop()}}),t)})))}var COMPARE_PARTIAL_FLAG$1=1,COMPARE_UNORDERED_FLAG$1=2;function baseIsMatch(e,t,n,i){var o=n.length,r=o,s=!i;if(null==e)return!r;for(e=Object(e);o--;){var a=n[o];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++o<r;){var l=(a=n[o])[0],c=e[l],d=a[1];if(s&&a[2]){if(void 0===c&&!(l in e))return!1}else{var u=new Stack$1;if(i)var h=i(c,d,l,e,t,u);if(!(void 0===h?baseIsEqual(d,c,COMPARE_PARTIAL_FLAG$1|COMPARE_UNORDERED_FLAG$1,i,u):h))return!1}}return!0}function isStrictComparable(e){return e==e&&!isObject$5(e)}function getMatchData(e){for(var t=keys(e),n=t.length;n--;){var i=t[n],o=e[i];t[n]=[i,o,isStrictComparable(o)]}return t}function matchesStrictComparable(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function baseMatches(e){var t=getMatchData(e);return 1==t.length&&t[0][2]?matchesStrictComparable(t[0][0],t[0][1]):function(n){return n===e||baseIsMatch(n,e,t)}}function get$1(e,t,n){var i=null==e?void 0:baseGet(e,t);return void 0===i?n:i}var COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;function baseMatchesProperty(e,t){return isKey(e)&&isStrictComparable(t)?matchesStrictComparable(toKey(e),t):function(n){var i=get$1(n,e);return void 0===i&&i===t?hasIn(n,e):baseIsEqual(t,i,COMPARE_PARTIAL_FLAG|COMPARE_UNORDERED_FLAG)}}function basePropertyDeep(e){return function(t){return baseGet(t,e)}}function property(e){return isKey(e)?baseProperty(toKey(e)):basePropertyDeep(e)}function baseIteratee(e){return"function"==typeof e?e:null==e?identity:"object"==typeof e?isArray$4(e)?baseMatchesProperty(e[0],e[1]):baseMatches(e):property(e)}function createFind(e){return function(t,n,i){var o=Object(t);if(!isArrayLike(t)){var r=baseIteratee(n);t=keys(t),n=function(e){return r(o[e],e,o)}}var s=e(t,n,i);return s>-1?o[r?t[s]:s]:void 0}}var nativeMax=Math.max;function findIndex(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=null==n?0:toInteger(n);return o<0&&(o=nativeMax(i+o,0)),baseFindIndex(e,baseIteratee(t),o)}var find=createFind(findIndex),find$1=find,FormContextKey=Symbol("formContextKey"),useProvideForm=function(e){provide(FormContextKey,e)},useInjectForm=function(){return inject(FormContextKey,{name:computed((function(){})),labelAlign:computed((function(){return"right"})),vertical:computed((function(){return!1})),addField:function(e,t){},removeField:function(e){},model:computed((function(){})),rules:computed((function(){})),colon:computed((function(){})),labelWrap:computed((function(){})),labelCol:computed((function(){})),requiredMark:computed((function(){return!1})),validateTrigger:computed((function(){})),onValidate:function(){},validateMessages:computed((function(){return defaultValidateMessages}))})},FormItemPrefixContextKey=Symbol("formItemPrefixContextKey"),useProvideFormItemPrefix=function(e){provide(FormItemPrefixContextKey,e)},useInjectFormItemPrefix=function(){return inject(FormItemPrefixContextKey,{prefixCls:computed((function(){return""}))})},FormItemLabel=function(e,t){var n,i,o,r,s,a,l=t.slots,c=t.emit,d=t.attrs,u=_extends$1(_extends$1({},e),d),h=u.prefixCls,g=u.htmlFor,p=u.labelCol,f=u.labelAlign,m=u.colon,v=u.required,_=u.requiredMark,C=_slicedToArray$2(useLocaleReceiver("Form"),1)[0],b=null!==(i=e.label)&&void 0!==i?i:null===(o=l.label)||void 0===o?void 0:o.call(l);if(!b)return null;var y=useInjectForm(),S=y.vertical,w=y.labelAlign,E=y.labelCol,x=y.labelWrap,T=y.colon,I=p||(null==E?void 0:E.value)||{},k=f||(null==w?void 0:w.value),L="".concat(h,"-item-label"),D=classNames(L,"left"===k&&"".concat(L,"-left"),I.class,_defineProperty$P({},"".concat(L,"-wrap"),!!x.value)),N=b,O=!0===m||!1!==(null==T?void 0:T.value)&&!1!==m;O&&!S.value&&"string"==typeof b&&""!==b.trim()&&(N=b.replace(/[:|:]\s*$/,"")),N=createVNode(Fragment,null,[N,null===(r=l.tooltip)||void 0===r?void 0:r.call(l,{class:"".concat(h,"-item-tooltip")})]),"optional"!==_||v||(N=createVNode(Fragment,null,[N,createVNode("span",{class:"".concat(h,"-item-optional")},[(null===(s=C.value)||void 0===s?void 0:s.optional)||(null===(a=defaultLocale.Form)||void 0===a?void 0:a.optional)])]));var A=classNames((_defineProperty$P(n={},"".concat(h,"-item-required"),v),_defineProperty$P(n,"".concat(h,"-item-required-mark-optional"),"optional"===_),_defineProperty$P(n,"".concat(h,"-item-no-colon"),!O),n));return createVNode(Col,_objectSpread2$1(_objectSpread2$1({},I),{},{class:D}),{default:function(){return[createVNode("label",{for:g,class:A,title:"string"==typeof b?b:"",onClick:function(e){return c("click",e)}},[N])]}})};FormItemLabel.displayName="FormItemLabel",FormItemLabel.inheritAttrs=!1;var FormItemLabel$1=FormItemLabel,ErrorList=defineComponent({name:"ErrorList",props:["errors","help","onDomErrorVisibleChange","helpStatus","warnings"],setup:function(e){var t=useConfigInject("",e).prefixCls,n=useInjectFormItemPrefix(),i=n.prefixCls,o=n.status,r=computed((function(){return"".concat(i.value,"-item-explain")})),s=computed((function(){return!(!e.errors||!e.errors.length)})),a=ref(o.value);return watch([s,o],(function(){s.value&&(a.value=o.value)})),function(){var n,i,o=collapseMotion$1("".concat(t.value,"-show-help-item")),s=getTransitionGroupProps("".concat(t.value,"-show-help-item"),o);return s.class=r.value,(null===(n=e.errors)||void 0===n?void 0:n.length)?createVNode(TransitionGroup,_objectSpread2$1(_objectSpread2$1({},s),{},{tag:"div"}),{default:function(){return[null===(i=e.errors)||void 0===i?void 0:i.map((function(e,t){return createVNode("div",{key:t,role:"alert",class:a.value?"".concat(r.value,"-").concat(a.value):""},[e])}))]}}):null}}}),iconMap={success:CheckCircleFilled$1,warning:ExclamationCircleFilled$1,error:CloseCircleFilled$1,validating:LoadingOutlined$1},FormItemInput=defineComponent({slots:["help","extra","errors"],inheritAttrs:!1,props:["prefixCls","errors","hasFeedback","onDomErrorVisibleChange","wrapperCol","help","extra","status"],setup:function(e,t){var n=t.slots,i=useInjectForm(),o=i.wrapperCol,r=_extends$1({},i);return delete r.labelCol,delete r.wrapperCol,useProvideForm(r),useProvideFormItemPrefix({prefixCls:computed((function(){return e.prefixCls})),status:computed((function(){return e.status}))}),function(){var t,i,r,s=e.prefixCls,a=e.wrapperCol,l=e.help,c=void 0===l?null===(t=n.help)||void 0===t?void 0:t.call(n):l,d=e.errors,u=void 0===d?null===(i=n.errors)||void 0===i?void 0:i.call(n):d,h=e.hasFeedback,g=e.status,p=e.extra,f=void 0===p?null===(r=n.extra)||void 0===r?void 0:r.call(n):p,m="".concat(s,"-item"),v=a||(null==o?void 0:o.value)||{},_=classNames("".concat(m,"-control"),v.class),C=g&&iconMap[g];return createVNode(Col,_objectSpread2$1(_objectSpread2$1({},v),{},{class:_}),{default:function(){var e;return createVNode(Fragment,null,[createVNode("div",{class:"".concat(m,"-control-input")},[createVNode("div",{class:"".concat(m,"-control-input-content")},[null===(e=n.default)||void 0===e?void 0:e.call(n)]),h&&C?createVNode("span",{class:"".concat(m,"-children-icon")},[createVNode(C,null,null)]):null]),createVNode(ErrorList,{errors:u,help:c,class:"".concat(m,"-explain-connected")},null),f?createVNode("div",{class:"".concat(m,"-extra")},[f]):null])}})}}}),FormItemInput$1=FormItemInput;function useDebounce(e){var t=shallowRef(e.value.slice()),n=null;return watchEffect((function(){clearTimeout(n),n=setTimeout((function(){t.value=e.value}),e.value.length?0:10)})),t}function getPropByPath$1(e,t,n){var i=e,o=t,r=0;try{for(var s=o.length;r<s-1&&(i||n);++r){var a=o[r];if(!(a in i)){if(n)throw Error("please transfer a valid name path to form item!");break}i=i[a]}if(n&&!i)throw Error("please transfer a valid name path to form item!")}catch(l){}return{o:i,k:o[r],v:i?i[o[r]]:void 0}}tuple("success","warning","error","validating","");var formItemProps=function(){return{htmlFor:String,prefixCls:String,label:PropTypes$1.any,help:PropTypes$1.any,extra:PropTypes$1.any,labelCol:{type:Object},wrapperCol:{type:Object},hasFeedback:{type:Boolean,default:!1},colon:{type:Boolean,default:void 0},labelAlign:PropTypes$1.oneOf(tuple("left","right")),prop:{type:[String,Number,Array]},name:{type:[String,Number,Array]},rules:[Array,Object],autoLink:{type:Boolean,default:!0},required:{type:Boolean,default:void 0},validateFirst:{type:Boolean,default:void 0},validateStatus:PropTypes$1.oneOf(tuple("","success","warning","error","validating")),validateTrigger:{type:[String,Array]},messageVariables:{type:Object},hidden:Boolean,noStyle:Boolean}},indexGuid$1=0,defaultItemNamePrefixCls="form_item",__unplugin_components_5$1=defineComponent({name:"AFormItem",inheritAttrs:!1,__ANT_NEW_FORM_ITEM:!0,props:formItemProps(),slots:["help","label","extra"],setup:function(e,t){var n=t.slots,i=t.attrs,o=t.expose;warning$3(void 0===e.prop);var r="form-item-".concat(++indexGuid$1),s=useConfigInject("form",e).prefixCls,a=useInjectForm(),l=computed((function(){return e.name||e.prop})),c=ref([]),d=ref(!1),u=ref(),h=computed((function(){return getNamePath(l.value)})),g=computed((function(){if(h.value.length){var e=a.name.value,t=h.value.join("_");return e?"".concat(e,"_").concat(t):"".concat(defaultItemNamePrefixCls,"_").concat(t)}})),p=computed((function(){return(e=a.model.value)&&l.value?getPropByPath$1(e,h.value,!0).v:void 0;var e})),f=ref(cloneDeep(p.value)),m=computed((function(){var t=void 0!==e.validateTrigger?e.validateTrigger:a.validateTrigger.value;return toArray$5(t=void 0===t?"change":t)})),v=computed((function(){var t=a.rules.value,n=e.rules,i=void 0!==e.required?{required:!!e.required,trigger:m.value}:[],o=getPropByPath$1(t,h.value);t=t?o.o[o.k]||o.v:[];var r=[].concat(n||t||[]);return find$1(r,(function(e){return e.required}))?r:r.concat(i)})),_=computed((function(){var t=v.value,n=!1;return t&&t.length&&t.every((function(e){return!e.required||(n=!0,!1)})),n||e.required})),C=ref();watchEffect((function(){C.value=e.validateStatus}));var b=computed((function(){var t={};return"string"==typeof e.label?t.label=e.label:e.name&&(t.label=String(name)),e.messageVariables&&(t=_extends$1(_extends$1({},t),e.messageVariables)),t})),y=function(t){if(0!==h.value.length){var n=e.validateFirst,i=void 0!==n&&n,o=(t||{}).triggerName,r=v.value;if(o&&(r=r.filter((function(e){var t=e.trigger;return!t&&!m.value.length||toArray$5(t||m.value).includes(o)}))),!r.length)return Promise.resolve();var s=validateRules(h.value,p.value,r,_extends$1({validateMessages:a.validateMessages.value},t),i,b.value);return C.value="validating",c.value=[],s.catch((function(e){return e})).then((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if("validating"===C.value){var t=e.filter((function(e){return e&&e.errors.length}));C.value=t.length?"error":"success",c.value=t.map((function(e){return e.errors})),a.onValidate(l.value,!c.value.length,c.value.length?toRaw(c.value[0]):null)}})),s}},S=function(){y({triggerName:"blur"})},w=function(){d.value?d.value=!1:y({triggerName:"change"})},E=function(){C.value=e.validateStatus,d.value=!1,c.value=[]},x=function(){C.value=e.validateStatus,d.value=!0,c.value=[];var t=a.model.value||{},n=p.value,i=getPropByPath$1(t,h.value,!0);Array.isArray(n)?i.o[i.k]=[].concat(f.value):i.o[i.k]=f.value,nextTick((function(){d.value=!1}))},T=computed((function(){return void 0===e.htmlFor?g.value:e.htmlFor})),I=function(){var e=T.value;if(e&&u.value){var t=u.value.$el.querySelector('[id="'.concat(e,'"]'));t&&t.focus&&t.focus()}};o({onFieldBlur:S,onFieldChange:w,clearValidate:E,resetField:x}),useProvideFormItemContext({id:g,onFieldBlur:function(){e.autoLink&&S()},onFieldChange:function(){e.autoLink&&w()},clearValidate:E},computed((function(){return!!(e.autoLink&&a.model.value&&l.value)})));var k=!1;watch(l,(function(e){e?k||(k=!0,a.addField(r,{fieldValue:p,fieldId:g,fieldName:l,resetField:x,clearValidate:E,namePath:h,validateRules:y,rules:v})):(k=!1,a.removeField(r))}),{immediate:!0}),onBeforeUnmount((function(){a.removeField(r)}));var L=useDebounce(c),D=computed((function(){return void 0!==e.validateStatus?e.validateStatus:L.value.length?"error":C.value})),N=computed((function(){var t;return _defineProperty$P(t={},"".concat(s.value,"-item"),!0),_defineProperty$P(t,"".concat(s.value,"-item-has-feedback"),D.value&&e.hasFeedback),_defineProperty$P(t,"".concat(s.value,"-item-has-success"),"success"===D.value),_defineProperty$P(t,"".concat(s.value,"-item-has-warning"),"warning"===D.value),_defineProperty$P(t,"".concat(s.value,"-item-has-error"),"error"===D.value),_defineProperty$P(t,"".concat(s.value,"-item-is-validating"),"validating"===D.value),_defineProperty$P(t,"".concat(s.value,"-item-hidden"),e.hidden),t}));return function(){var t,o;if(e.noStyle)return null===(t=n.default)||void 0===t?void 0:t.call(n);var r=null!==(o=e.help)&&void 0!==o?o:n.help?filterEmpty(n.help()):null;return createVNode(Row,_objectSpread2$1(_objectSpread2$1({},i),{},{class:[N.value,null!=r||L.value.length?"".concat(s.value,"-item-with-help"):"",i.class],key:"row"}),{default:function(){var t,i,o,l;return createVNode(Fragment,null,[createVNode(FormItemLabel$1,_objectSpread2$1(_objectSpread2$1({},e),{},{htmlFor:T.value,required:_.value,requiredMark:a.requiredMark.value,prefixCls:s.value,onClick:I,label:null!==(t=e.label)&&void 0!==t?t:null===(i=n.label)||void 0===i?void 0:i.call(n)}),null),createVNode(FormItemInput$1,_objectSpread2$1(_objectSpread2$1({},e),{},{errors:null!=r?toArray$5(r):L.value,prefixCls:s.value,status:D.value,ref:u,help:r,extra:null!==(o=e.extra)&&void 0!==o?o:null===(l=n.extra)||void 0===l?void 0:l.call(n)}),{default:n.default})])}})}}});function allPromiseFinish(e){var t=!1,n=e.length,i=[];return e.length?new Promise((function(o,r){e.forEach((function(e,s){e.catch((function(e){return t=!0,e})).then((function(e){n-=1,i[s]=e,n>0||(t&&r(i),o(i))}))}))})):Promise.resolve([])}function t(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function e(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function n(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var i=getComputedStyle(t,null);return e(i.overflowY,n)||e(i.overflowX,n)||!!(r=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(t){return null}}(o=t))&&(r.clientHeight<o.scrollHeight||r.clientWidth<o.scrollWidth)}var o,r;return!1}function r(e,t,n,i,o,r,s,a){return r<e&&s>t||r>e&&s<t?0:r<=e&&a<=n||s>=t&&a>=n?r-e-i:s>t&&a<n||r<e&&a>n?s-t+o:0}function compute(e,i){var o=window,s=i.scrollMode,a=i.block,l=i.inline,c=i.boundary,d=i.skipOverflowHiddenElements,u="function"==typeof c?c:function(e){return e!==c};if(!t(e))throw new TypeError("Invalid target");for(var h=document.scrollingElement||document.documentElement,g=[],p=e;t(p)&&u(p);){if((p=p.parentElement)===h){g.push(p);break}null!=p&&p===document.body&&n(p)&&!n(document.documentElement)||null!=p&&n(p,d)&&g.push(p)}for(var f=o.visualViewport?o.visualViewport.width:innerWidth,m=o.visualViewport?o.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,_=window.scrollY||pageYOffset,C=e.getBoundingClientRect(),b=C.height,y=C.width,S=C.top,w=C.right,E=C.bottom,x=C.left,T="start"===a||"nearest"===a?S:"end"===a?E:S+b/2,I="center"===l?x+y/2:"end"===l?w:x,k=[],L=0;L<g.length;L++){var D=g[L],N=D.getBoundingClientRect(),O=N.height,A=N.width,P=N.top,R=N.right,M=N.bottom,$=N.left;if("if-needed"===s&&S>=0&&x>=0&&E<=m&&w<=f&&S>=P&&E<=M&&x>=$&&w<=R)return k;var F=getComputedStyle(D),B=parseInt(F.borderLeftWidth,10),V=parseInt(F.borderTopWidth,10),W=parseInt(F.borderRightWidth,10),H=parseInt(F.borderBottomWidth,10),z=0,K=0,j="offsetWidth"in D?D.offsetWidth-D.clientWidth-B-W:0,U="offsetHeight"in D?D.offsetHeight-D.clientHeight-V-H:0;if(h===D)z="start"===a?T:"end"===a?T-m:"nearest"===a?r(_,_+m,m,V,H,_+T,_+T+b,b):T-m/2,K="start"===l?I:"center"===l?I-f/2:"end"===l?I-f:r(v,v+f,f,B,W,v+I,v+I+y,y),z=Math.max(0,z+_),K=Math.max(0,K+v);else{z="start"===a?T-P-V:"end"===a?T-M+H+U:"nearest"===a?r(P,M,O,V,H+U,T,T+b,b):T-(P+O/2)+U/2,K="start"===l?I-$-B:"center"===l?I-($+A/2)+j/2:"end"===l?I-R+W+j:r($,R,A,B,W+j,I,I+y,y);var G=D.scrollLeft,q=D.scrollTop;T+=q-(z=Math.max(0,Math.min(q+z,D.scrollHeight-O+U))),I+=G-(K=Math.max(0,Math.min(G+K,D.scrollWidth-A+j)))}k.push({el:D,top:z,left:K})}return k}function isOptionsObject(e){return e===Object(e)&&0!==Object.keys(e).length}function defaultBehavior(e,t){void 0===t&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach((function(e){var i=e.el,o=e.top,r=e.left;i.scroll&&n?i.scroll({top:o,left:r,behavior:t}):(i.scrollTop=o,i.scrollLeft=r)}))}function getOptions(e){return!1===e?{block:"end",inline:"nearest"}:isOptionsObject(e)?e:{block:"start",inline:"nearest"}}function scrollIntoView(e,t){var n=e.isConnected||e.ownerDocument.documentElement.contains(e);if(isOptionsObject(t)&&"function"==typeof t.behavior)return t.behavior(n?compute(e,t):[]);if(n){var i=getOptions(t);return defaultBehavior(compute(e,i),i.behavior)}}var nativeMin=Math.min;function baseIntersection(e,t,n){for(var i=n?arrayIncludesWith:arrayIncludes,o=e[0].length,r=e.length,s=r,a=Array(r),l=Infinity,c=[];s--;){var d=e[s];s&&t&&(d=arrayMap(d,baseUnary(t))),l=nativeMin(d.length,l),a[s]=!n&&(t||o>=120&&d.length>=120)?new SetCache(s&&d):void 0}d=e[0];var u=-1,h=a[0];e:for(;++u<o&&c.length<l;){var g=d[u],p=t?t(g):g;if(g=n||0!==g?g:0,!(h?cacheHas(h,p):i(c,p,n))){for(s=r;--s;){var f=a[s];if(!(f?cacheHas(f,p):i(e[s],p,n)))continue e}h&&h.push(p),c.push(g)}}return c}function baseRest(e,t){return setToString$1(overRest(e,t,identity),e+"")}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}function castArrayLikeObject(e){return isArrayLikeObject(e)?e:[]}var intersection=baseRest((function(e){var t=arrayMap(e,castArrayLikeObject);return t.length&&t[0]===e[0]?baseIntersection(t):[]})),intersection$1=intersection;function last(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}function parent(e,t){return t.length<2?e:baseGet(e,baseSlice(t,0,-1))}function baseUnset(e,t){return null==(e=parent(e,t=castPath(t,e)))||delete e[toKey(last(t))]}function customOmitClone(e){return isPlainObject$3(e)?void 0:e}var CLONE_DEEP_FLAG=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG=4,omit=flatRest((function(e,t){var n={};if(null==e)return n;var i=!1;t=arrayMap(t,(function(t){return t=castPath(t,e),i||(i=t.length>1),t})),copyObject(e,getAllKeysIn(e),n),i&&(n=baseClone(n,CLONE_DEEP_FLAG|CLONE_FLAT_FLAG|CLONE_SYMBOLS_FLAG,customOmitClone));for(var o=t.length;o--;)baseUnset(n,t[o]);return n})),omit$1=omit;function isRequired(e){var t=!1;return e&&e.length&&e.every((function(e){return!e.required||(t=!0,!1)})),t}function toArray$4(e){return null==e?[]:Array.isArray(e)?e:[e]}function getPropByPath(e,t,n){for(var i=e,o=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),r=0,s=o.length;r<s-1&&(i||n);++r){var a=o[r];if(!(a in i)){if(n)throw new Error("please transfer a valid name path to validate!");break}i=i[a]}return{o:i,k:o[r],v:i?i[o[r]]:null,isValid:i&&o[r]in i}}function useForm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ref({}),n=arguments.length>2?arguments[2]:void 0,i=cloneDeep(unref(e)),o=reactive({}),r=shallowRef([]),s=function(n){_extends$1(unref(e),_extends$1(_extends$1({},cloneDeep(i)),n)),nextTick((function(){Object.keys(o).forEach((function(e){o[e]={autoLink:!1,required:isRequired(unref(t)[e])}}))}))},a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return t.length?e.filter((function(e){var n=toArray$4(e.trigger||"change");return intersection$1(n,t).length})):e},l=null,c=function(n){for(var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,r=[],s={},c=function(l){var c=n[l],u=getPropByPath(unref(e),c,o);if(!u.isValid)return"continue";s[c]=u.v;var h=a(unref(t)[c],toArray$4(i&&i.trigger));h.length&&r.push(d(c,u.v,h,i||{}).then((function(){return{name:c,errors:[],warnings:[]}})).catch((function(e){var t=[],n=[];return e.forEach((function(e){var i=e.rule.warningOnly,o=e.errors;i?n.push.apply(n,_toConsumableArray$2(o)):t.push.apply(t,_toConsumableArray$2(o))})),t.length?Promise.reject({name:c,errors:t,warnings:n}):{name:c,errors:t,warnings:n}})))},u=0;u<n.length;u++)c(u);var h=allPromiseFinish(r);l=h;var g=h.then((function(){return l===h?Promise.resolve(s):Promise.reject([])})).catch((function(e){var t=e.filter((function(e){return e&&e.errors.length}));return Promise.reject({values:s,errorFields:t,outOfDate:l!==h})}));return g.catch((function(e){return e})),g},d=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=validateRules([e],t,i,_extends$1({validateMessages:defaultValidateMessages},r),!!r.validateFirst);return o[e]?(o[e].validateStatus="validating",s.catch((function(e){return e})).then((function(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if("validating"===o[e].validateStatus){var r=i.filter((function(e){return e&&e.errors.length}));o[e].validateStatus=r.length?"error":"success",o[e].help=r.length?r.map((function(e){return e.errors})):null,null===(t=null==n?void 0:n.onValidate)||void 0===t||t.call(n,e,!r.length,r.length?toRaw(o[e].help[0]):null)}})),s):s.catch((function(e){return e}))},u=function(e,t){var n=[],i=!0;e?n=Array.isArray(e)?e:[e]:(i=!1,n=r.value);var o=c(n,t||{},i);return o.catch((function(e){return e})),o},h=function(e){(e?Array.isArray(e)?e:[e]:r.value).forEach((function(e){o[e]&&_extends$1(o[e],{validateStatus:"",help:null})}))},g=function(e){for(var t={autoLink:!1},n=[],i=Array.isArray(e)?e:[e],o=0;o<i.length;o++){var r=i[o];"error"===(null==r?void 0:r.validateStatus)&&(t.validateStatus="error",r.help&&n.push(r.help)),t.required=t.required||(null==r?void 0:r.required)}return t.help=n,t},p=i,f=!0,m=function(e){var t=[];r.value.forEach((function(i){var o=getPropByPath(e,i,!1),r=getPropByPath(p,i,!1);!(f&&(null==n?void 0:n.immediate)&&o.isValid)&&isEqual$1(o.v,r.v)||t.push(i)})),u(t,{trigger:"change"}),f=!1,p=cloneDeep(toRaw(e))},v=null==n?void 0:n.debounce,_=!0;return watch(t,(function(){r.value=t?Object.keys(unref(t)):[],!_&&n&&n.validateOnRuleChange&&u(),_=!1}),{deep:!0,immediate:!0}),watch(r,(function(){var e={};for(var n in r.value.forEach((function(n){e[n]=_extends$1({},o[n],{autoLink:!1,required:isRequired(unref(t)[n])}),delete o[n]})),o)Object.prototype.hasOwnProperty.call(o,n)&&delete o[n];_extends$1(o,e)}),{immediate:!0}),watch(e,v&&v.wait?debounce(m,v.wait,omit$1(v,["wait"])):m,{immediate:n&&!!n.immediate,deep:!0}),{modelRef:e,rulesRef:t,initialModel:i,validateInfos:o,resetFields:s,validate:u,validateField:d,mergeValidateInfo:g,clearValidate:h}}var formProps=function(){return{layout:PropTypes$1.oneOf(tuple("horizontal","inline","vertical")),labelCol:{type:Object},wrapperCol:{type:Object},colon:{type:Boolean,default:void 0},labelAlign:PropTypes$1.oneOf(tuple("left","right")),labelWrap:{type:Boolean,default:void 0},prefixCls:String,requiredMark:{type:[String,Boolean],default:void 0},hideRequiredMark:{type:Boolean,default:void 0},model:PropTypes$1.object,rules:{type:Object},validateMessages:{type:Object,default:void 0},validateOnRuleChange:{type:Boolean,default:void 0},scrollToFirstError:{type:[Boolean,Object]},onSubmit:Function,name:String,validateTrigger:{type:[String,Array]},size:{type:String},onValuesChange:{type:Function},onFieldsChange:{type:Function},onFinish:{type:Function},onFinishFailed:{type:Function},onValidate:{type:Function}}};function isEqualName(e,t){return isEqual$1(toArray$5(e),toArray$5(t))}var Form=defineComponent({name:"AForm",inheritAttrs:!1,props:initDefaultProps$1(formProps(),{layout:"horizontal",hideRequiredMark:!1,colon:!0}),Item:__unplugin_components_5$1,useForm:useForm,setup:function(e,t){var n=t.emit,i=t.slots,o=t.expose,r=t.attrs,s=useInjectSize(e),a=useConfigInject("form",e),l=a.prefixCls,c=a.direction,d=a.form,u=computed((function(){return""===e.requiredMark||e.requiredMark})),h=computed((function(){var t;return void 0!==u.value?u.value:d&&void 0!==(null===(t=d.value)||void 0===t?void 0:t.requiredMark)?d.value.requiredMark:!e.hideRequiredMark})),g=computed((function(){var t,n;return null!==(t=e.colon)&&void 0!==t?t:null===(n=d.value)||void 0===n?void 0:n.colon})),p=useInjectGlobalForm().validateMessages,f=computed((function(){return _extends$1(_extends$1(_extends$1({},defaultValidateMessages),p.value),e.validateMessages)})),m=computed((function(){var t;return classNames(l.value,(_defineProperty$P(t={},"".concat(l.value,"-").concat(e.layout),!0),_defineProperty$P(t,"".concat(l.value,"-hide-required-mark"),!1===h.value),_defineProperty$P(t,"".concat(l.value,"-rtl"),"rtl"===c.value),_defineProperty$P(t,"".concat(l.value,"-").concat(s.value),s.value),t))})),v=ref(),_={},C=function(e){var t=!!e,n=t?toArray$5(e).map(getNamePath):[];return t?Object.values(_).filter((function(e){return n.findIndex((function(t){return isEqualName(t,e.fieldName.value)}))>-1})):Object.values(_)},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=C(e?[e]:void 0);if(n.length){var i=n[0].fieldId.value,o=i?document.getElementById(i):null;o&&scrollIntoView(o,_extends$1({scrollMode:"if-needed",block:"nearest"},t))}},y=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!0===t){var n=[];return Object.values(_).forEach((function(e){var t=e.namePath;n.push(t.value)})),cloneByNamePathList(e.model,n)}return cloneByNamePathList(e.model,t)},S=function(t,n){if(warning$2(!(t instanceof Function),"Form","validateFields/validateField/validate not support callback, please use promise instead"),!e.model)return warning$2(!1,"Form","model is required for validateFields to work."),Promise.reject("Form `model` is required for validateFields to work.");var i=!!t,o=i?toArray$5(t).map(getNamePath):[],r=[];Object.values(_).forEach((function(e){var t;if(i||o.push(e.namePath.value),null===(t=e.rules)||void 0===t?void 0:t.value.length){var s=e.namePath.value;if(!i||containsNamePath(o,s)){var a=e.validateRules(_extends$1({validateMessages:f.value},n));r.push(a.then((function(){return{name:s,errors:[],warnings:[]}})).catch((function(e){var t=[],n=[];return e.forEach((function(e){var i=e.rule.warningOnly,o=e.errors;i?n.push.apply(n,_toConsumableArray$2(o)):t.push.apply(t,_toConsumableArray$2(o))})),t.length?Promise.reject({name:s,errors:t,warnings:n}):{name:s,errors:t,warnings:n}})))}}}));var s=allPromiseFinish(r);v.value=s;var a=s.then((function(){return v.value===s?Promise.resolve(y(o)):Promise.reject([])})).catch((function(e){var t=e.filter((function(e){return e&&e.errors.length}));return Promise.reject({values:y(o),errorFields:t,outOfDate:v.value!==s})}));return a.catch((function(e){return e})),a},w=function(){return S.apply(void 0,arguments)},E=function(t){(t.preventDefault(),t.stopPropagation(),n("submit",t),e.model)&&S().then((function(e){n("finish",e)})).catch((function(t){!function(t){var i=e.scrollToFirstError;if(n("finishFailed",t),i&&t.errorFields.length){var o={};"object"===_typeof$3(i)&&(o=i),b(t.errorFields[0].name,o)}}(t)}))};return o({resetFields:function(t){e.model?C(t).forEach((function(e){e.resetField()})):warning$2(!1,"Form","model is required for resetFields to work.")},clearValidate:function(e){C(e).forEach((function(e){e.clearValidate()}))},validateFields:S,getFieldsValue:y,validate:function(){return w.apply(void 0,arguments)},scrollToField:b}),useProvideForm({model:computed((function(){return e.model})),name:computed((function(){return e.name})),labelAlign:computed((function(){return e.labelAlign})),labelCol:computed((function(){return e.labelCol})),labelWrap:computed((function(){return e.labelWrap})),wrapperCol:computed((function(){return e.wrapperCol})),vertical:computed((function(){return"vertical"===e.layout})),colon:g,requiredMark:h,validateTrigger:computed((function(){return e.validateTrigger})),rules:computed((function(){return e.rules})),addField:function(e,t){_[e]=t},removeField:function(e){delete _[e]},onValidate:function(e,t,i){n("validate",e,t,i)},validateMessages:f}),watch((function(){return e.rules}),(function(){e.validateOnRuleChange&&S()})),function(){var e;return createVNode("form",_objectSpread2$1(_objectSpread2$1({},r),{},{onSubmit:E,class:[m.value,r.class]}),[null===(e=i.default)||void 0===e?void 0:e.call(i)])}}}),Form$1=Form;Form$1.useInjectFormItemContext=useInjectFormItemContext,Form$1.ItemRest=FormItemRest,Form$1.install=function(e){return e.component(Form$1.name,Form$1),e.component(Form$1.Item.name,Form$1.Item),e.component(FormItemRest.name,FormItemRest),e};var abstractCheckboxGroupProps=function(){return{name:String,prefixCls:String,options:{type:Array,default:function(){return[]}},disabled:Boolean,id:String}},checkboxGroupProps=function(){return _extends$1(_extends$1({},abstractCheckboxGroupProps()),{defaultValue:{type:Array},value:{type:Array},onChange:{type:Function},"onUpdate:value":{type:Function}})},abstractCheckboxProps=function(){return{prefixCls:String,defaultChecked:{type:Boolean,default:void 0},checked:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},isGroup:{type:Boolean,default:void 0},value:PropTypes$1.any,name:String,id:String,indeterminate:{type:Boolean,default:void 0},type:{type:String,default:"checkbox"},autofocus:{type:Boolean,default:void 0},onChange:Function,"onUpdate:checked":Function,onClick:Function,skipGroup:{type:Boolean,default:!1}}},checkboxProps=function(){return _extends$1(_extends$1({},abstractCheckboxProps()),{indeterminate:{type:Boolean,default:!1}})},CheckboxGroupContextKey=Symbol("CheckboxGroupContext"),__rest$l=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},Checkbox$1=defineComponent({name:"ACheckbox",inheritAttrs:!1,__ANT_CHECKBOX:!0,props:checkboxProps(),setup:function(e,t){var n=t.emit,i=t.attrs,o=t.slots,r=t.expose,s=useInjectFormItemContext(),a=useConfigInject("checkbox",e),l=a.prefixCls,c=a.direction,d=inject(CheckboxGroupContextKey,void 0),u=Symbol("checkboxUniId");watchEffect((function(){!e.skipGroup&&d&&d.registerValue(u,e.value)})),onBeforeUnmount((function(){d&&d.cancelValue(u)})),onMounted((function(){warning$2(void 0!==e.checked||d||void 0===e.value,"Checkbox","`value` is not validate prop, do you mean `checked`?")}));var h=function(e){var t=e.target.checked;n("update:checked",t),n("change",e)},g=ref();return r({focus:function(){var e;null===(e=g.value)||void 0===e||e.focus()},blur:function(){var e;null===(e=g.value)||void 0===e||e.blur()}}),function(){var t,r,a=flattenChildren(null===(r=o.default)||void 0===r?void 0:r.call(o)),u=e.indeterminate,p=e.skipGroup,f=e.id,m=void 0===f?s.id.value:f,v=__rest$l(e,["indeterminate","skipGroup","id"]),_=i.onMouseenter,C=i.onMouseleave;i.onInput;var b=i.class,y=i.style,S=__rest$l(i,["onMouseenter","onMouseleave","onInput","class","style"]),w=_extends$1(_extends$1(_extends$1({},v),{id:m,prefixCls:l.value}),S);d&&!p?(w.onChange=function(){for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];n.apply(void 0,["change"].concat(i)),d.toggleOption({label:a,value:e.value})},w.name=d.name.value,w.checked=-1!==d.mergedValue.value.indexOf(e.value),w.disabled=e.disabled||d.disabled.value,w.indeterminate=u):w.onChange=h;var E=classNames((_defineProperty$P(t={},"".concat(l.value,"-wrapper"),!0),_defineProperty$P(t,"".concat(l.value,"-rtl"),"rtl"===c.value),_defineProperty$P(t,"".concat(l.value,"-wrapper-checked"),w.checked),_defineProperty$P(t,"".concat(l.value,"-wrapper-disabled"),w.disabled),t),b),x=classNames(_defineProperty$P({},"".concat(l.value,"-indeterminate"),u));return createVNode("label",{class:E,style:y,onMouseenter:_,onMouseleave:C},[createVNode(VcCheckbox,_objectSpread2$1(_objectSpread2$1({},w),{},{class:x,ref:g}),null),a.length?createVNode("span",null,[a]):null])}}});function _createForOfIteratorHelper(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_unsupportedIterableToArray$2(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}var CheckboxGroup=defineComponent({name:"ACheckboxGroup",props:checkboxGroupProps(),setup:function(e,t){var n=t.slots,i=t.emit,o=t.expose,r=useInjectFormItemContext(),s=useConfigInject("checkbox",e),a=s.prefixCls,l=s.direction,c=ref((void 0===e.value?e.defaultValue:e.value)||[]);watch((function(){return e.value}),(function(){c.value=e.value||[]}));var d=computed((function(){return e.options.map((function(e){return"string"==typeof e||"number"==typeof e?{label:e,value:e}:e}))})),u=ref(Symbol()),h=ref(new Map),g=ref(new Map);watch(u,(function(){var e,t=new Map,n=_createForOfIteratorHelper(h.value.values());try{for(n.s();!(e=n.n()).done;){var i=e.value;t.set(i,!0)}}catch(o){n.e(o)}finally{n.f()}g.value=t}));return provide(CheckboxGroupContextKey,{cancelValue:function(e){h.value.delete(e),u.value=Symbol()},registerValue:function(e,t){h.value.set(e,t),u.value=Symbol()},toggleOption:function(t){var n=c.value.indexOf(t.value),o=_toConsumableArray$2(c.value);-1===n?o.push(t.value):o.splice(n,1),void 0===e.value&&(c.value=o);var s=o.filter((function(e){return g.value.has(e)})).sort((function(e,t){return d.value.findIndex((function(t){return t.value===e}))-d.value.findIndex((function(e){return e.value===t}))}));i("update:value",s),i("change",s),r.onFieldChange()},mergedValue:c,name:computed((function(){return e.name})),disabled:computed((function(){return e.disabled}))}),o({mergedValue:c}),function(){var t,i=e.id,o=void 0===i?r.id.value:i,s=null,u="".concat(a.value,"-group");return d.value&&d.value.length>0&&(s=d.value.map((function(t){var i;return createVNode(Checkbox$1,{prefixCls:a.value,key:t.value.toString(),disabled:"disabled"in t?t.disabled:e.disabled,indeterminate:t.indeterminate,value:t.value,checked:-1!==c.value.indexOf(t.value),onChange:t.onChange,class:"".concat(u,"-item")},{default:function(){return[void 0===t.label?null===(i=n.label)||void 0===i?void 0:i.call(n,t):t.label]}})}))),createVNode("div",{class:[u,_defineProperty$P({},"".concat(u,"-rtl"),"rtl"===l.value)],id:o},[s||(null===(t=n.default)||void 0===t?void 0:t.call(n))])}}});Checkbox$1.Group=CheckboxGroup,Checkbox$1.install=function(e){return e.component(Checkbox$1.name,Checkbox$1),e.component(CheckboxGroup.name,CheckboxGroup),e};var checkableTagProps=function(){return{prefixCls:String,checked:{type:Boolean,default:void 0},onChange:{type:Function},onClick:{type:Function},"onUpdate:checked":Function}},CheckableTag=defineComponent({name:"ACheckableTag",props:checkableTagProps(),setup:function(e,t){var n=t.slots,i=t.emit,o=useConfigInject("tag",e).prefixCls,r=function(t){var n=e.checked;i("update:checked",!n),i("change",!n),i("click",t)},s=computed((function(){var t;return classNames(o.value,(_defineProperty$P(t={},"".concat(o.value,"-checkable"),!0),_defineProperty$P(t,"".concat(o.value,"-checkable-checked"),e.checked),t))}));return function(){var e;return createVNode("span",{class:s.value,onClick:r},[null===(e=n.default)||void 0===e?void 0:e.call(n)])}}}),CheckableTag$1=CheckableTag,PresetColorRegex=new RegExp("^(".concat(PresetColorTypes.join("|"),")(-inverse)?$")),PresetStatusColorRegex=new RegExp("^(".concat(PresetStatusColorTypes.join("|"),")$")),tagProps=function(){return{prefixCls:String,color:{type:String},closable:{type:Boolean,default:!1},closeIcon:PropTypes$1.any,visible:{type:Boolean,default:void 0},onClose:{type:Function},"onUpdate:visible":Function,icon:PropTypes$1.any}},Tag=defineComponent({name:"ATag",props:tagProps(),slots:["closeIcon","icon"],setup:function(e,t){var n=t.slots,i=t.emit,o=t.attrs,r=useConfigInject("tag",e),s=r.prefixCls,a=r.direction,l=ref(!0);watchEffect((function(){void 0!==e.visible&&(l.value=e.visible)}));var c=function(t){t.stopPropagation(),i("update:visible",!1),i("close",t),t.defaultPrevented||void 0===e.visible&&(l.value=!1)},d=computed((function(){var t=e.color;return!!t&&(PresetColorRegex.test(t)||PresetStatusColorRegex.test(t))})),u=computed((function(){var t;return classNames(s.value,(_defineProperty$P(t={},"".concat(s.value,"-").concat(e.color),d.value),_defineProperty$P(t,"".concat(s.value,"-has-color"),e.color&&!d.value),_defineProperty$P(t,"".concat(s.value,"-hidden"),!l.value),_defineProperty$P(t,"".concat(s.value,"-rtl"),"rtl"===a.value),t))}));return function(){var t,i,r,a=e.icon,l=void 0===a?null===(t=n.icon)||void 0===t?void 0:t.call(n):a,h=e.color,g=e.closeIcon,p=void 0===g?null===(i=n.closeIcon)||void 0===i?void 0:i.call(n):g,f=e.closable,m=void 0!==f&&f,v={backgroundColor:h&&!d.value?h:void 0},_=l||null,C=null===(r=n.default)||void 0===r?void 0:r.call(n),b=_?createVNode(Fragment,null,[_,createVNode("span",null,[C])]):C,y="onClick"in o,S=createVNode("span",{class:u.value,style:v},[b,m?p?createVNode("div",{class:"".concat(s.value,"-close-icon"),onClick:c},[p]):createVNode(CloseOutlined$1,{class:"".concat(s.value,"-close-icon"),onClick:c},null):null]);return y?createVNode(Wave,null,{default:function(){return[S]}}):S}}});Tag.CheckableTag=CheckableTag$1,Tag.install=function(e){return e.component(Tag.name,Tag),e.component(CheckableTag$1.name,CheckableTag$1),e};var __unplugin_components_1$2=Tag,cached;function getScrollBarSize(e){if("undefined"==typeof document)return 0;if(e||void 0===cached){var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var n=document.createElement("div"),i=n.style;i.position="absolute",i.top="0",i.left="0",i.pointerEvents="none",i.visibility="hidden",i.width="200px",i.height="150px",i.overflow="hidden",n.appendChild(t),document.body.appendChild(n);var o=t.offsetWidth;n.style.overflow="scroll";var r=t.offsetWidth;o===r&&(r=n.clientWidth),document.body.removeChild(n),cached=o-r}return cached}function ensureSize(e){var t=e.match(/^(.*)px$/),n=Number(null==t?void 0:t[1]);return Number.isNaN(n)?getScrollBarSize():n}function getTargetScrollBarSize(e){if(!("undefined"!=typeof document&&e&&e instanceof Element))return{width:0,height:0};var t=getComputedStyle(e,"::-webkit-scrollbar"),n=t.width,i=t.height;return{width:ensureSize(n),height:ensureSize(i)}}function setStyle(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.element,i=void 0===n?document.body:n,o={},r=Object.keys(e);return r.forEach((function(e){o[e]=i.style[e]})),r.forEach((function(t){i.style[t]=e[t]})),o}function isBodyOverflowing(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}Dropdown$1.Button=DropdownButton,Dropdown$1.install=function(e){return e.component(Dropdown$1.name,Dropdown$1),e.component(DropdownButton.name,DropdownButton),e};var cacheStyle$1={},switchScrollingEffect=function(e){if(isBodyOverflowing()||e){var t="ant-scrolling-effect",n=new RegExp("".concat(t),"g"),i=document.body.className;if(e){if(!n.test(i))return;return setStyle(cacheStyle$1),cacheStyle$1={},void(document.body.className=i.replace(n,"").trim())}var o=getScrollBarSize();if(o&&(cacheStyle$1=setStyle({position:"relative",width:"calc(100% - ".concat(o,"px)")}),!n.test(i))){var r="".concat(i," ").concat(t);document.body.className=r.trim()}}},locks=[],scrollingEffectClassName="ant-scrolling-effect",scrollingEffectClassNameReg=new RegExp("".concat(scrollingEffectClassName),"g"),uuid$1=0,cacheStyle=new Map,ScrollLocker=_createClass((function e(t){var n=this;_classCallCheck(this,e),this.getContainer=function(){var e;return null===(e=n.options)||void 0===e?void 0:e.container},this.reLock=function(e){var t=locks.find((function(e){return e.target===n.lockTarget}));t&&n.unLock(),n.options=e,t&&(t.options=e,n.lock())},this.lock=function(){var e;if(!locks.some((function(e){return e.target===n.lockTarget})))if(locks.some((function(e){var t,i=e.options;return(null==i?void 0:i.container)===(null===(t=n.options)||void 0===t?void 0:t.container)})))locks=[].concat(_toConsumableArray$2(locks),[{target:n.lockTarget,options:n.options}]);else{var t=0,i=(null===(e=n.options)||void 0===e?void 0:e.container)||document.body;(i===document.body&&window.innerWidth-document.documentElement.clientWidth>0||i.scrollHeight>i.clientHeight)&&(t=getScrollBarSize());var o=i.className;if(0===locks.filter((function(e){var t,i=e.options;return(null==i?void 0:i.container)===(null===(t=n.options)||void 0===t?void 0:t.container)})).length&&cacheStyle.set(i,setStyle({width:0!==t?"calc(100% - ".concat(t,"px)"):void 0,overflow:"hidden",overflowX:"hidden",overflowY:"hidden"},{element:i})),!scrollingEffectClassNameReg.test(o)){var r="".concat(o," ").concat(scrollingEffectClassName);i.className=r.trim()}locks=[].concat(_toConsumableArray$2(locks),[{target:n.lockTarget,options:n.options}])}},this.unLock=function(){var e,t=locks.find((function(e){return e.target===n.lockTarget}));if(locks=locks.filter((function(e){return e.target!==n.lockTarget})),t&&!locks.some((function(e){var n,i=e.options;return(null==i?void 0:i.container)===(null===(n=t.options)||void 0===n?void 0:n.container)}))){var i=(null===(e=n.options)||void 0===e?void 0:e.container)||document.body,o=i.className;scrollingEffectClassNameReg.test(o)&&(setStyle(cacheStyle.get(i),{element:i}),cacheStyle.delete(i),i.className=i.className.replace(scrollingEffectClassNameReg,"").trim())}},this.lockTarget=uuid$1++,this.options=t})),openCount=0,supportDom=canUseDom(),cacheOverflow={},getParent=function(e){if(!supportDom)return null;if(e){if("string"==typeof e)return document.querySelectorAll(e)[0];if("function"==typeof e)return e();if("object"===_typeof$3(e)&&e instanceof window.HTMLElement)return e}return document.body},Portal=defineComponent({name:"PortalWrapper",inheritAttrs:!1,props:{wrapperClassName:String,forceRender:{type:Boolean,default:void 0},getContainer:PropTypes$1.any,visible:{type:Boolean,default:void 0}},setup:function(e,t){var n=t.slots,i=ref(),o=ref(),r=ref(),s=new ScrollLocker({container:getParent(e.getContainer)}),a=function(){var e,t;null===(t=null===(e=i.value)||void 0===e?void 0:e.parentNode)||void 0===t||t.removeChild(i.value)},l=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t||i.value&&!i.value.parentNode){var n=getParent(e.getContainer);return!!n&&(n.appendChild(i.value),!0)}return!0},c=function(){return supportDom?(i.value||(i.value=document.createElement("div"),l(!0)),d(),i.value):null},d=function(){var t=e.wrapperClassName;i.value&&t&&t!==i.value.className&&(i.value.className=t)};onUpdated((function(){d(),l()}));var u=function(){1!==openCount||Object.keys(cacheOverflow).length?openCount||(setStyle(cacheOverflow),cacheOverflow={},switchScrollingEffect(!0)):(switchScrollingEffect(),cacheOverflow=setStyle({overflow:"hidden",overflowX:"hidden",overflowY:"hidden"}))},h=getCurrentInstance();return onMounted((function(){var t=!1;watch([function(){return e.visible},function(){return e.getContainer}],(function(n,i){var o=_slicedToArray$2(n,2),r=o[0],l=o[1],c=_slicedToArray$2(i,2),d=c[0],u=c[1];(supportDom&&getParent(e.getContainer)===document.body&&(r&&!d?openCount+=1:t&&(openCount-=1)),t)&&(("function"==typeof l&&"function"==typeof u?l.toString()!==u.toString():l!==u)&&a(),r&&r!==d&&supportDom&&getParent(l)!==s.getContainer()&&s.reLock({container:getParent(l)}));t=!0}),{immediate:!0,flush:"post"}),nextTick((function(){l()||(r.value=wrapperRaf((function(){h.update()})))}))})),onBeforeUnmount((function(){var t=e.visible,n=e.getContainer;supportDom&&getParent(n)===document.body&&(openCount=t&&openCount?openCount-1:openCount),a(),wrapperRaf.cancel(r.value)})),function(){var t=e.forceRender,i=e.visible,r=null,a={getOpenCount:function(){return openCount},getContainer:c,switchScrollingEffect:u,scrollLocker:s};return(t||i||o.value)&&(r=createVNode(Portal$1,{getContainer:c,ref:o},{default:function(){var e;return null===(e=n.default)||void 0===e?void 0:e.call(n,a)}})),r}}}),inputProps=function(){return{id:String,prefixCls:String,inputPrefixCls:String,defaultValue:PropTypes$1.oneOfType([PropTypes$1.string,PropTypes$1.number]),value:{type:[String,Number,Symbol],default:void 0},placeholder:{type:[String,Number]},autocomplete:String,type:{type:String,default:"text"},name:String,size:{type:String},disabled:{type:Boolean,default:void 0},readonly:{type:Boolean,default:void 0},addonBefore:PropTypes$1.any,addonAfter:PropTypes$1.any,prefix:PropTypes$1.any,suffix:PropTypes$1.any,autofocus:{type:Boolean,default:void 0},allowClear:{type:Boolean,default:void 0},lazy:{type:Boolean,default:!0},maxlength:Number,loading:{type:Boolean,default:void 0},bordered:{type:Boolean,default:void 0},showCount:{type:[Boolean,Object]},htmlSize:Number,onPressEnter:Function,onKeydown:Function,onKeyup:Function,onFocus:Function,onBlur:Function,onChange:Function,onInput:Function,"onUpdate:value":Function,valueModifiers:Object,hidden:Boolean}},inputProps$1=inputProps,textAreaProps=function(){return _extends$1(_extends$1({},omit$2(inputProps(),["prefix","addonBefore","addonAfter","suffix"])),{rows:Number,autosize:{type:[Boolean,Object],default:void 0},autoSize:{type:[Boolean,Object],default:void 0},onResize:{type:Function},onCompositionstart:Function,onCompositionend:Function,valueModifiers:Object})};function getInputClassName(e,t,n,i,o){var r;return classNames(e,(_defineProperty$P(r={},"".concat(e,"-sm"),"small"===n),_defineProperty$P(r,"".concat(e,"-lg"),"large"===n),_defineProperty$P(r,"".concat(e,"-disabled"),i),_defineProperty$P(r,"".concat(e,"-rtl"),"rtl"===o),_defineProperty$P(r,"".concat(e,"-borderless"),!t),r))}var isValid$1=function(e){return null!=e&&(!Array.isArray(e)||filterEmpty(e).length)};function hasPrefixSuffix(e){return isValid$1(e.prefix)||isValid$1(e.suffix)||isValid$1(e.allowClear)}function hasAddon(e){return isValid$1(e.addonBefore)||isValid$1(e.addonAfter)}var ClearableInputType=["text","input"],ClearableLabeledInput=defineComponent({name:"ClearableLabeledInput",inheritAttrs:!1,props:{prefixCls:String,inputType:PropTypes$1.oneOf(tuple("text","input")),value:PropTypes$1.any,defaultValue:PropTypes$1.any,allowClear:{type:Boolean,default:void 0},element:PropTypes$1.any,handleReset:Function,disabled:{type:Boolean,default:void 0},direction:{type:String},size:{type:String},suffix:PropTypes$1.any,prefix:PropTypes$1.any,addonBefore:PropTypes$1.any,addonAfter:PropTypes$1.any,readonly:{type:Boolean,default:void 0},focused:{type:Boolean,default:void 0},bordered:{type:Boolean,default:!0},triggerFocus:{type:Function},hidden:Boolean},setup:function(e,t){var n=t.slots,i=t.attrs,o=ref(),r=function(t){var n;if(null===(n=o.value)||void 0===n?void 0:n.contains(t.target)){var i=e.triggerFocus;null==i||i()}},s=function(t){var i,o=e.allowClear,r=e.value,s=e.disabled,a=e.readonly,l=e.handleReset,c=e.suffix,d=void 0===c?n.suffix:c;if(!o)return null;var u=!s&&!a&&r,h="".concat(t,"-clear-icon");return createVNode(CloseCircleFilled$1,{onClick:l,onMousedown:function(e){return e.preventDefault()},class:classNames((i={},_defineProperty$P(i,"".concat(h,"-hidden"),!u),_defineProperty$P(i,"".concat(h,"-has-suffix"),!!d),i),h),role:"button"},null)},a=function(t,a){var l,c,d,u=e.focused,h=e.value,g=e.prefix,p=void 0===g?null===(c=n.prefix)||void 0===c?void 0:c.call(n):g,f=e.size,m=e.suffix,v=void 0===m?null===(d=n.suffix)||void 0===d?void 0:d.call(n):m,_=e.disabled,C=e.allowClear,b=e.direction,y=e.readonly,S=e.bordered,w=e.hidden,E=e.addonAfter,x=void 0===E?n.addonAfter:E,T=e.addonBefore,I=void 0===T?n.addonBefore:T,k=function(t){var i,o=e.suffix,r=void 0===o?null===(i=n.suffix)||void 0===i?void 0:i.call(n):o,a=e.allowClear;return r||a?createVNode("span",{class:"".concat(t,"-suffix")},[s(t),r]):null}(t);if(!hasPrefixSuffix({prefix:p,suffix:v,allowClear:C}))return cloneElement(a,{value:h});var L=p?createVNode("span",{class:"".concat(t,"-prefix")},[p]):null,D=classNames("".concat(t,"-affix-wrapper"),(_defineProperty$P(l={},"".concat(t,"-affix-wrapper-focused"),u),_defineProperty$P(l,"".concat(t,"-affix-wrapper-disabled"),_),_defineProperty$P(l,"".concat(t,"-affix-wrapper-sm"),"small"===f),_defineProperty$P(l,"".concat(t,"-affix-wrapper-lg"),"large"===f),_defineProperty$P(l,"".concat(t,"-affix-wrapper-input-with-clear-btn"),v&&C&&h),_defineProperty$P(l,"".concat(t,"-affix-wrapper-rtl"),"rtl"===b),_defineProperty$P(l,"".concat(t,"-affix-wrapper-readonly"),y),_defineProperty$P(l,"".concat(t,"-affix-wrapper-borderless"),!S),_defineProperty$P(l,"".concat(i.class),!hasAddon({addonAfter:x,addonBefore:I})&&i.class),l));return createVNode("span",{ref:o,class:D,style:i.style,onMouseup:r,hidden:w},[L,cloneElement(a,{style:null,value:h,class:getInputClassName(t,S,f,_)}),k])};return function(){var t,o=e.prefixCls,r=e.inputType,l=e.element,c=void 0===l?null===(t=n.element)||void 0===t?void 0:t.call(n):l;return r===ClearableInputType[0]?function(t,o){var r,a=e.value,l=e.allowClear,c=e.direction,d=e.bordered,u=e.hidden,h=e.addonAfter,g=void 0===h?n.addonAfter:h,p=e.addonBefore,f=void 0===p?n.addonBefore:p;if(!l)return cloneElement(o,{value:a});var m=classNames("".concat(t,"-affix-wrapper"),"".concat(t,"-affix-wrapper-textarea-with-clear-btn"),(_defineProperty$P(r={},"".concat(t,"-affix-wrapper-rtl"),"rtl"===c),_defineProperty$P(r,"".concat(t,"-affix-wrapper-borderless"),!d),_defineProperty$P(r,"".concat(i.class),!hasAddon({addonAfter:g,addonBefore:f})&&i.class),r));return createVNode("span",{class:m,style:i.style,hidden:u},[cloneElement(o,{style:null,value:a}),s(t)])}(o,c):function(t,o){var r,s,a,l=e.addonBefore,c=void 0===l?null===(s=n.addonBefore)||void 0===s?void 0:s.call(n):l,d=e.addonAfter,u=void 0===d?null===(a=n.addonAfter)||void 0===a?void 0:a.call(n):d,h=e.size,g=e.direction,p=e.hidden;if(!hasAddon({addonBefore:c,addonAfter:u}))return o;var f="".concat(t,"-group"),m="".concat(f,"-addon"),v=c?createVNode("span",{class:m},[c]):null,_=u?createVNode("span",{class:m},[u]):null,C=classNames("".concat(t,"-wrapper"),f,_defineProperty$P({},"".concat(f,"-rtl"),"rtl"===g)),b=classNames("".concat(t,"-group-wrapper"),(_defineProperty$P(r={},"".concat(t,"-group-wrapper-sm"),"small"===h),_defineProperty$P(r,"".concat(t,"-group-wrapper-lg"),"large"===h),_defineProperty$P(r,"".concat(t,"-group-wrapper-rtl"),"rtl"===g),r),i.class);return createVNode("span",{class:b,style:i.style,hidden:p},[createVNode("span",{class:C},[v,cloneElement(o,{style:null}),_])])}(o,a(o,c))}}});function fixControlledValue(e){return null==e?"":String(e)}function resolveOnChange(e,t,n,i){if(n){var o=t;if("click"===t.type){Object.defineProperty(o,"target",{writable:!0}),Object.defineProperty(o,"currentTarget",{writable:!0});var r=e.cloneNode(!0);return o.target=r,o.currentTarget=r,r.value="",void n(o)}if(void 0!==i)return Object.defineProperty(o,"target",{writable:!0}),Object.defineProperty(o,"currentTarget",{writable:!0}),o.target=e,o.currentTarget=e,e.value=i,void n(o);n(o)}}function triggerFocus(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var i=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(i,i);break;default:e.setSelectionRange(0,i)}}}}var Input=defineComponent({name:"AInput",inheritAttrs:!1,props:inputProps$1(),setup:function(e,t){var n,i=t.slots,o=t.attrs,r=t.expose,s=t.emit,a=ref(),l=ref(),c=useInjectFormItemContext(),d=useConfigInject("input",e),u=d.direction,h=d.prefixCls,g=d.size,p=d.autocomplete,f=ref(void 0===e.value?e.defaultValue:e.value),m=ref(!1);watch((function(){return e.value}),(function(){f.value=e.value})),watch((function(){return e.disabled}),(function(){void 0!==e.value&&(f.value=e.value),e.disabled&&(m.value=!1)}));var v=function(){n=setTimeout((function(){var e;"password"===(null===(e=a.value)||void 0===e?void 0:e.getAttribute("type"))&&a.value.hasAttribute("value")&&a.value.removeAttribute("value")}))},_=function(e){triggerFocus(a.value,e)};r({focus:_,blur:function(){var e;null===(e=a.value)||void 0===e||e.blur()},input:a,stateValue:f,setSelectionRange:function(e,t,n){var i;null===(i=a.value)||void 0===i||i.setSelectionRange(e,t,n)},select:function(){var e;null===(e=a.value)||void 0===e||e.select()}});var C=function(t){var n=e.onFocus;m.value=!0,null==n||n(t),nextTick((function(){v()}))},b=function(t){var n=e.onBlur;m.value=!1,null==n||n(t),c.onFieldBlur(),nextTick((function(){v()}))},y=function(e){s("update:value",e.target.value),s("change",e),s("input",e),c.onFieldChange()},S=getCurrentInstance(),w=function(t,n){f.value!==t&&(void 0===e.value?f.value=t:nextTick((function(){a.value.value!==f.value&&S.update()})),nextTick((function(){n&&n()})))},E=function(e){resolveOnChange(a.value,e,y),w("",(function(){_()}))},x=function(t){var n=t.target,i=n.value,o=n.composing;if(!((t.isComposing||o)&&e.lazy||f.value===i)){var r=t.target.value;resolveOnChange(a.value,t,y),w(r,(function(){v()}))}},T=function(e){13===e.keyCode&&s("pressEnter",e),s("keydown",e)};onMounted((function(){v()})),onBeforeUnmount((function(){clearTimeout(n)}));var I=function(){var t,n=e.addonBefore,r=void 0===n?i.addonBefore:n,s=e.addonAfter,l=void 0===s?i.addonAfter:s,d=e.disabled,f=e.bordered,m=void 0===f||f,v=e.valueModifiers,_=void 0===v?{}:v,y=e.htmlSize,S=omit$2(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","size","bordered","htmlSize","lazy","showCount","valueModifiers"]),w=_extends$1(_extends$1(_extends$1({},S),o),{autocomplete:p.value,onChange:x,onInput:x,onFocus:C,onBlur:b,onKeydown:T,class:classNames(getInputClassName(h.value,m,g.value,d,u.value),_defineProperty$P({},o.class,o.class&&!r&&!l)),ref:a,key:"ant-input",size:y,id:null!==(t=S.id)&&void 0!==t?t:c.id.value});return _.lazy&&delete w.onInput,w.autofocus||delete w.autofocus,withDirectives(createVNode("input",omit$2(w,["size"]),null),[[antInputDirective]])},k=function(){var t,n=f.value,o=e.maxlength,r=e.suffix,s=void 0===r?null===(t=i.suffix)||void 0===t?void 0:t.call(i):r,a=e.showCount,l=Number(o)>0;if(s||a){var c=_toConsumableArray$2(fixControlledValue(n)).length,d=null;return d="object"===_typeof$3(a)?a.formatter({count:c,maxlength:o}):"".concat(c).concat(l?" / ".concat(o):""),createVNode(Fragment,null,[!!a&&createVNode("span",{class:classNames("".concat(h.value,"-show-count-suffix"),_defineProperty$P({},"".concat(h.value,"-show-count-has-suffix"),!!s))},[d]),s])}return null};return function(){var t=_extends$1(_extends$1(_extends$1({},o),e),{prefixCls:h.value,inputType:"input",value:fixControlledValue(f.value),handleReset:E,focused:m.value&&!e.disabled});return createVNode(ClearableLabeledInput,_objectSpread2$1(_objectSpread2$1({},omit$2(t,["element","valueModifiers","suffix","showCount"])),{},{ref:l}),_extends$1(_extends$1({},i),{element:I,suffix:k}))}}}),Group=defineComponent({name:"AInputGroup",props:{prefixCls:String,size:{type:String},compact:{type:Boolean,default:void 0},onMouseenter:{type:Function},onMouseleave:{type:Function},onFocus:{type:Function},onBlur:{type:Function}},setup:function(e,t){var n=t.slots,i=useConfigInject("input-group",e),o=i.prefixCls,r=i.direction,s=computed((function(){var t,n=o.value;return _defineProperty$P(t={},"".concat(n),!0),_defineProperty$P(t,"".concat(n,"-lg"),"large"===e.size),_defineProperty$P(t,"".concat(n,"-sm"),"small"===e.size),_defineProperty$P(t,"".concat(n,"-compact"),e.compact),_defineProperty$P(t,"".concat(n,"-rtl"),"rtl"===r.value),t}));return function(){var t;return createVNode("span",{class:s.value,onMouseenter:e.onMouseenter,onMouseleave:e.onMouseleave,onFocus:e.onFocus,onBlur:e.onBlur},[null===(t=n.default)||void 0===t?void 0:t.call(n)])}}}),applePhone=/iPhone/i,appleIpod=/iPod/i,appleTablet=/iPad/i,androidPhone=/\bAndroid(?:.+)Mobile\b/i,androidTablet=/Android/i,amazonPhone=/\bAndroid(?:.+)SD4930UR\b/i,amazonTablet=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,windowsPhone=/Windows Phone/i,windowsTablet=/\bWindows(?:.+)ARM\b/i,otherBlackberry=/BlackBerry/i,otherBlackberry10=/BB10/i,otherOpera=/Opera Mini/i,otherChrome=/\b(CriOS|Chrome)(?:.+)Mobile/i,otherFirefox=/Mobile(?:.+)Firefox\b/i;function match$1(e,t){return e.test(t)}function isMobile(e){var t=e||("undefined"!=typeof navigator?navigator.userAgent:""),n=t.split("[FBAN");void 0!==n[1]&&(t=_slicedToArray$2(n,1)[0]);void 0!==(n=t.split("Twitter"))[1]&&(t=_slicedToArray$2(n,1)[0]);var i={apple:{phone:match$1(applePhone,t)&&!match$1(windowsPhone,t),ipod:match$1(appleIpod,t),tablet:!match$1(applePhone,t)&&match$1(appleTablet,t)&&!match$1(windowsPhone,t),device:(match$1(applePhone,t)||match$1(appleIpod,t)||match$1(appleTablet,t))&&!match$1(windowsPhone,t)},amazon:{phone:match$1(amazonPhone,t),tablet:!match$1(amazonPhone,t)&&match$1(amazonTablet,t),device:match$1(amazonPhone,t)||match$1(amazonTablet,t)},android:{phone:!match$1(windowsPhone,t)&&match$1(amazonPhone,t)||!match$1(windowsPhone,t)&&match$1(androidPhone,t),tablet:!match$1(windowsPhone,t)&&!match$1(amazonPhone,t)&&!match$1(androidPhone,t)&&(match$1(amazonTablet,t)||match$1(androidTablet,t)),device:!match$1(windowsPhone,t)&&(match$1(amazonPhone,t)||match$1(amazonTablet,t)||match$1(androidPhone,t)||match$1(androidTablet,t))||match$1(/\bokhttp\b/i,t)},windows:{phone:match$1(windowsPhone,t),tablet:match$1(windowsTablet,t),device:match$1(windowsPhone,t)||match$1(windowsTablet,t)},other:{blackberry:match$1(otherBlackberry,t),blackberry10:match$1(otherBlackberry10,t),opera:match$1(otherOpera,t),firefox:match$1(otherFirefox,t),chrome:match$1(otherChrome,t),device:match$1(otherBlackberry,t)||match$1(otherBlackberry10,t)||match$1(otherOpera,t)||match$1(otherFirefox,t)||match$1(otherChrome,t)},any:null,phone:null,tablet:null};return i.any=i.apple.device||i.android.device||i.windows.device||i.other.device,i.phone=i.apple.phone||i.android.phone||i.windows.phone,i.tablet=i.apple.tablet||i.android.tablet||i.windows.tablet,i}var defaultResult=_extends$1(_extends$1({},isMobile()),{isMobile:isMobile}),isMobile$1=defaultResult,__rest$k=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},__unplugin_components_0$3=defineComponent({name:"AInputSearch",inheritAttrs:!1,props:_extends$1(_extends$1({},inputProps$1()),{inputPrefixCls:String,enterButton:PropTypes$1.any,onSearch:{type:Function}}),setup:function(e,t){var n=t.slots,i=t.attrs,o=t.expose,r=t.emit,s=ref();o({focus:function(){var e;null===(e=s.value)||void 0===e||e.focus()},blur:function(){var e;null===(e=s.value)||void 0===e||e.blur()}});var a=function(e){r("update:value",e.target.value),e&&e.target&&"click"===e.type&&r("search",e.target.value,e),r("change",e)},l=function(e){var t;document.activeElement===(null===(t=s.value)||void 0===t?void 0:t.input)&&e.preventDefault()},c=function(e){var t;r("search",null===(t=s.value)||void 0===t?void 0:t.stateValue,e),isMobile$1.tablet||s.value.focus()},d=useConfigInject("input-search",e),u=d.prefixCls,h=d.getPrefixCls,g=d.direction,p=d.size,f=computed((function(){return h("input",e.inputPrefixCls)}));return function(){var t,o,r,d,h,m,v=e.disabled,_=e.loading,C=e.addonAfter,b=void 0===C?null===(o=n.addonAfter)||void 0===o?void 0:o.call(n):C,y=e.suffix,S=void 0===y?null===(r=n.suffix)||void 0===r?void 0:r.call(n):y,w=__rest$k(e,["disabled","loading","addonAfter","suffix"]),E=e.enterButton,x=void 0===E?null!==(h=null===(d=n.enterButton)||void 0===d?void 0:d.call(n))&&void 0!==h&&h:E,T="boolean"==typeof(x=x||""===x)?createVNode(SearchOutlined$1,null,null):null,I="".concat(u.value,"-button"),k=Array.isArray(x)?x[0]:x,L=k.type&&isPlainObject$3(k.type)&&k.type.__ANT_BUTTON;if(L||"button"===k.tagName)m=cloneElement(k,_extends$1({onMousedown:l,onClick:c,key:"enterButton"},L?{class:I,size:p.value}:{}),!1);else{var D=T&&!x;m=createVNode(Button$2,{class:I,type:x?"primary":void 0,size:p.value,disabled:v,key:"enterButton",onMousedown:l,onClick:c,loading:_,icon:D?T:null},{default:function(){return[D?null:T||x]}})}b&&(m=[m,b]);var N=classNames(u.value,(_defineProperty$P(t={},"".concat(u.value,"-rtl"),"rtl"===g.value),_defineProperty$P(t,"".concat(u.value,"-").concat(p.value),!!p.value),_defineProperty$P(t,"".concat(u.value,"-with-button"),!!x),t),i.class);return createVNode(Input,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({ref:s},omit$2(w,["onUpdate:value","onSearch","enterButton"])),i),{},{onPressEnter:c,size:p.value,prefixCls:f.value,addonAfter:m,suffix:S,onChange:a,class:N,disabled:v}),n)}}}),HIDDEN_TEXTAREA_STYLE="\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",SIZING_STYLE=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],computedStyleCache={},hiddenTextarea;function calculateNodeStyling(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&computedStyleCache[n])return computedStyleCache[n];var i=window.getComputedStyle(e),o=i.getPropertyValue("box-sizing")||i.getPropertyValue("-moz-box-sizing")||i.getPropertyValue("-webkit-box-sizing"),r=parseFloat(i.getPropertyValue("padding-bottom"))+parseFloat(i.getPropertyValue("padding-top")),s=parseFloat(i.getPropertyValue("border-bottom-width"))+parseFloat(i.getPropertyValue("border-top-width")),a=SIZING_STYLE.map((function(e){return"".concat(e,":").concat(i.getPropertyValue(e))})).join(";"),l={sizingStyle:a,paddingSize:r,borderSize:s,boxSizing:o};return t&&n&&(computedStyleCache[n]=l),l}function calculateNodeHeight(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;hiddenTextarea||((hiddenTextarea=document.createElement("textarea")).setAttribute("tab-index","-1"),hiddenTextarea.setAttribute("aria-hidden","true"),document.body.appendChild(hiddenTextarea)),e.getAttribute("wrap")?hiddenTextarea.setAttribute("wrap",e.getAttribute("wrap")):hiddenTextarea.removeAttribute("wrap");var o=calculateNodeStyling(e,t),r=o.paddingSize,s=o.borderSize,a=o.boxSizing,l=o.sizingStyle;hiddenTextarea.setAttribute("style","".concat(l,";").concat(HIDDEN_TEXTAREA_STYLE)),hiddenTextarea.value=e.value||e.placeholder||"";var c,d=Number.MIN_SAFE_INTEGER,u=Number.MAX_SAFE_INTEGER,h=hiddenTextarea.scrollHeight;if("border-box"===a?h+=s:"content-box"===a&&(h-=r),null!==n||null!==i){hiddenTextarea.value=" ";var g=hiddenTextarea.scrollHeight-r;null!==n&&(d=g*n,"border-box"===a&&(d=d+r+s),h=Math.max(d,h)),null!==i&&(u=g*i,"border-box"===a&&(u=u+r+s),c=h>u?"":"hidden",h=Math.min(u,h))}return{height:"".concat(h,"px"),minHeight:"".concat(d,"px"),maxHeight:"".concat(u,"px"),overflowY:c,resize:"none"}}var RESIZE_STATUS_NONE=0,RESIZE_STATUS_RESIZING=1,RESIZE_STATUS_RESIZED=2,ResizableTextArea=defineComponent({name:"ResizableTextArea",inheritAttrs:!1,props:textAreaProps(),setup:function(e,t){var n,i,o=t.attrs,r=t.emit,s=t.expose,a=ref(),l=ref({}),c=ref(RESIZE_STATUS_NONE);onBeforeUnmount((function(){wrapperRaf.cancel(n),wrapperRaf.cancel(i)}));var d=function(){var t=e.autoSize||e.autosize;if(t&&a.value){var n=t.minRows,o=t.maxRows;l.value=calculateNodeHeight(a.value,!1,n,o),c.value=RESIZE_STATUS_RESIZING,wrapperRaf.cancel(i),i=wrapperRaf((function(){c.value=RESIZE_STATUS_RESIZED,i=wrapperRaf((function(){c.value=RESIZE_STATUS_NONE,function(){try{if(document.activeElement===a.value){var e=a.value.selectionStart,t=a.value.selectionEnd;a.value.setSelectionRange(e,t)}}catch(e2){}}()}))}))}},u=function(t){c.value===RESIZE_STATUS_NONE&&(r("resize",t),(e.autoSize||e.autosize)&&(wrapperRaf.cancel(n),n=wrapperRaf(d)))};warning$2(void 0===e.autosize,"Input.TextArea","autosize is deprecated, please use autoSize instead.");watch((function(){return e.value}),(function(){nextTick((function(){d()}))})),onMounted((function(){nextTick((function(){d()}))}));var h=getCurrentInstance();return s({resizeTextarea:d,textArea:a,instance:h}),function(){return t=e.prefixCls,n=e.autoSize,i=e.autosize,r=e.disabled,s=omit$2(e,["prefixCls","onPressEnter","autoSize","autosize","defaultValue","allowClear","type","lazy","maxlength","valueModifiers"]),d=classNames(t,o.class,_defineProperty$P({},"".concat(t,"-disabled"),r)),h=[o.style,l.value,c.value===RESIZE_STATUS_RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null],(g=_extends$1(_extends$1(_extends$1({},s),o),{style:h,class:d})).autofocus||delete g.autofocus,0===g.rows&&delete g.rows,createVNode(ResizeObserver$1,{onResize:u,disabled:!(n||i)},{default:function(){return[withDirectives(createVNode("textarea",_objectSpread2$1(_objectSpread2$1({},g),{},{ref:a}),null),[[antInputDirective]])]}});var t,n,i,r,s,d,h,g}}}),ResizableTextArea$1=ResizableTextArea;function fixEmojiLength(e,t){return _toConsumableArray$2(e||"").slice(0,t).join("")}function setTriggerValue(e,t,n,i){var o=n;return e?o=fixEmojiLength(n,i):_toConsumableArray$2(t||"").length<n.length&&_toConsumableArray$2(n||"").length>i&&(o=t),o}var TextArea=defineComponent({name:"ATextarea",inheritAttrs:!1,props:textAreaProps(),setup:function(e,t){var n=t.attrs,i=t.expose,o=t.emit,r=useInjectFormItemContext(),s=ref(void 0===e.value?e.defaultValue:e.value),a=ref(),l=ref(""),c=useConfigInject("input",e),d=c.prefixCls,u=c.size,h=c.direction,g=computed((function(){return""===e.showCount||e.showCount||!1})),p=computed((function(){return Number(e.maxlength)>0})),f=ref(!1),m=ref(),v=ref(0),_=function(e){f.value=!0,m.value=l.value,v.value=e.currentTarget.selectionStart,o("compositionstart",e)},C=function(t){var n;f.value=!1;var i=t.currentTarget.value;p.value&&(i=setTriggerValue(v.value>=e.maxlength+1||v.value===(null===(n=m.value)||void 0===n?void 0:n.length),m.value,i,e.maxlength));i!==l.value&&(S(i),resolveOnChange(t.currentTarget,t,x,i)),o("compositionend",t)},b=getCurrentInstance();watch((function(){return e.value}),(function(){var t;b.vnode.props,s.value=null!==(t=e.value)&&void 0!==t?t:""}));var y=function(e){var t;triggerFocus(null===(t=a.value)||void 0===t?void 0:t.textArea,e)},S=function(t,n){s.value!==t&&(void 0===e.value?s.value=t:nextTick((function(){var e,t,n;a.value.textArea.value!==l.value&&(null===(n=null===(e=a.value)||void 0===e?void 0:(t=e.instance).update)||void 0===n||n.call(t))})),nextTick((function(){n&&n()})))},w=function(e){13===e.keyCode&&o("pressEnter",e),o("keydown",e)},E=function(t){var n=e.onBlur;null==n||n(t),r.onFieldBlur()},x=function(e){o("update:value",e.target.value),o("change",e),o("input",e),r.onFieldChange()},T=function(e){resolveOnChange(a.value.textArea,e,x),S("",(function(){y()}))},I=function(t){var n=t.target.composing,i=t.target.value;if(f.value=!(!t.isComposing&&!n),!(f.value&&e.lazy||s.value===i)){if(p.value){var o=t.target;i=setTriggerValue(o.selectionStart>=e.maxlength+1||o.selectionStart===i.length||!o.selectionStart,l.value,i,e.maxlength)}resolveOnChange(t.currentTarget,t,x,i),S(i)}},k=function(){var t,i,o,s=n.style,l=n.class,c=e.bordered,h=void 0===c||c,p=_extends$1(_extends$1(_extends$1({},omit$2(e,["allowClear"])),n),{style:g.value?{}:s,class:(t={},_defineProperty$P(t,"".concat(d.value,"-borderless"),!h),_defineProperty$P(t,"".concat(l),l&&!g.value),_defineProperty$P(t,"".concat(d.value,"-sm"),"small"===u.value),_defineProperty$P(t,"".concat(d.value,"-lg"),"large"===u.value),t),showCount:null,prefixCls:d.value,onInput:I,onChange:I,onBlur:E,onKeydown:w,onCompositionstart:_,onCompositionend:C});return(null===(i=e.valueModifiers)||void 0===i?void 0:i.lazy)&&delete p.onInput,createVNode(ResizableTextArea$1,_objectSpread2$1(_objectSpread2$1({},p),{},{id:null!==(o=p.id)&&void 0!==o?o:r.id.value,ref:a,maxlength:e.maxlength}),null)};return i({focus:y,blur:function(){var e,t;null===(t=null===(e=a.value)||void 0===e?void 0:e.textArea)||void 0===t||t.blur()},resizableTextArea:a}),watchEffect((function(){var t=fixControlledValue(s.value);f.value||!p.value||null!==e.value&&void 0!==e.value||(t=fixEmojiLength(t,e.maxlength)),l.value=t})),function(){var t=e.maxlength,i=e.bordered,o=void 0===i||i,r=e.hidden,s=n.style,a=n.class,c=_extends$1(_extends$1(_extends$1({},e),n),{prefixCls:d.value,inputType:"text",handleReset:T,direction:h.value,bordered:o,style:g.value?void 0:s}),u=createVNode(ClearableLabeledInput,_objectSpread2$1(_objectSpread2$1({},c),{},{value:l.value}),{element:k});if(g.value){var f=_toConsumableArray$2(l.value).length,m="";m="object"===_typeof$3(g.value)?g.value.formatter({count:f,maxlength:t}):"".concat(f).concat(p.value?" / ".concat(t):""),u=createVNode("div",{hidden:r,class:classNames("".concat(d.value,"-textarea"),_defineProperty$P({},"".concat(d.value,"-textarea-rtl"),"rtl"===h.value),"".concat(d.value,"-textarea-show-count"),a),style:s,"data-count":"object"!==_typeof$3(m)?m:void 0},[u])}return u}}}),EyeOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},EyeOutlinedSvg=EyeOutlined$2;function _objectSpread$t(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$t(e,t,n[t])}))}return e}function _defineProperty$t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var EyeOutlined=function(e,t){var n=_objectSpread$t({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$t({},n,{icon:EyeOutlinedSvg}),null)};EyeOutlined.displayName="EyeOutlined",EyeOutlined.inheritAttrs=!1;var EyeOutlined$1=EyeOutlined,EyeInvisibleOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},EyeInvisibleOutlinedSvg=EyeInvisibleOutlined$2;function _objectSpread$s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$s(e,t,n[t])}))}return e}function _defineProperty$s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var EyeInvisibleOutlined=function(e,t){var n=_objectSpread$s({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$s({},n,{icon:EyeInvisibleOutlinedSvg}),null)};EyeInvisibleOutlined.displayName="EyeInvisibleOutlined",EyeInvisibleOutlined.inheritAttrs=!1;var EyeInvisibleOutlined$1=EyeInvisibleOutlined,__rest$j=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},ActionMap={click:"onClick",hover:"onMouseover"},defaultIconRender=function(e){return createVNode(e?EyeOutlined$1:EyeInvisibleOutlined$1,null,null)},__unplugin_components_0$2=defineComponent({name:"AInputPassword",inheritAttrs:!1,props:_extends$1(_extends$1({},inputProps$1()),{prefixCls:String,inputPrefixCls:String,action:{type:String,default:"click"},visibilityToggle:{type:Boolean,default:!0},iconRender:Function}),setup:function(e,t){var n=t.slots,i=t.attrs,o=t.expose,r=ref(!1),s=function(){e.disabled||(r.value=!r.value)},a=ref();o({focus:function(){var e;null===(e=a.value)||void 0===e||e.focus()},blur:function(){var e;null===(e=a.value)||void 0===e||e.blur()}});var l=useConfigInject("input-password",e),c=l.prefixCls,d=l.getPrefixCls,u=computed((function(){return d("input",e.inputPrefixCls)})),h=function(){var t,o,l,d,h,g,p,f,m=e.size,v=e.visibilityToggle,_=__rest$j(e,["size","visibilityToggle"]),C=v&&(t=c.value,l=e.action,d=e.iconRender,h=void 0===d?n.iconRender||defaultIconRender:d,g=ActionMap[l]||"",p=h(r.value),_defineProperty$P(o={},g,s),_defineProperty$P(o,"class","".concat(t,"-icon")),_defineProperty$P(o,"key","passwordIcon"),_defineProperty$P(o,"onMousedown",(function(e){e.preventDefault()})),_defineProperty$P(o,"onMouseup",(function(e){e.preventDefault()})),f=o,cloneElement(isValidElement(p)?p:createVNode("span",null,[p]),f)),b=classNames(c.value,i.class,_defineProperty$P({},"".concat(c.value,"-").concat(m),!!m)),y=_extends$1(_extends$1(_extends$1({},omit$2(_,["suffix","iconRender","action"])),i),{type:r.value?"text":"password",class:b,prefixCls:u.value,suffix:C});return m&&(y.size=m),createVNode(Input,_objectSpread2$1({ref:a},y),n)};return function(){return h()}}});function getOffset(e){var t=e.getBoundingClientRect(),n=document.documentElement;return{left:t.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:t.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}function dialogPropTypes(){return{keyboard:{type:Boolean,default:void 0},mask:{type:Boolean,default:void 0},afterClose:Function,closable:{type:Boolean,default:void 0},maskClosable:{type:Boolean,default:void 0},visible:{type:Boolean,default:void 0},destroyOnClose:{type:Boolean,default:void 0},mousePosition:PropTypes$1.shape({x:Number,y:Number}).loose,title:PropTypes$1.any,footer:PropTypes$1.any,transitionName:String,maskTransitionName:String,animation:PropTypes$1.any,maskAnimation:PropTypes$1.any,wrapStyle:{type:Object,default:void 0},bodyStyle:{type:Object,default:void 0},maskStyle:{type:Object,default:void 0},prefixCls:String,wrapClassName:String,rootClassName:String,width:[String,Number],height:[String,Number],zIndex:Number,bodyProps:PropTypes$1.any,maskProps:PropTypes$1.any,wrapProps:PropTypes$1.any,getContainer:PropTypes$1.any,dialogStyle:{type:Object,default:void 0},dialogClass:String,closeIcon:PropTypes$1.any,forceRender:{type:Boolean,default:void 0},getOpenCount:Function,focusTriggerAfterClose:{type:Boolean,default:void 0},onClose:Function,modalRender:Function}}function getMotionName(e,t,n){var i=t;return!i&&n&&(i="".concat(e,"-").concat(n)),i}Input.Group=Group,Input.Search=__unplugin_components_0$3,Input.TextArea=TextArea,Input.Password=__unplugin_components_0$2,Input.install=function(e){return e.component(Input.name,Input),e.component(Input.Group.name,Input.Group),e.component(Input.Search.name,Input.Search),e.component(Input.TextArea.name,Input.TextArea),e.component(Input.Password.name,Input.Password),e};var uuid=-1;function getUUID(){return uuid+=1}function getScroll(e,t){var n=e["page".concat(t?"Y":"X","Offset")],i="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var o=e.document;"number"!=typeof(n=o.documentElement[i])&&(n=o.body[i])}return n}function offset$1(e){var t=e.getBoundingClientRect(),n={left:t.left,top:t.top},i=e.ownerDocument,o=i.defaultView||i.parentWindow;return n.left+=getScroll(o),n.top+=getScroll(o,!0),n}var sentinelStyle={width:0,height:0,overflow:"hidden",outline:"none"},Content=defineComponent({name:"Content",inheritAttrs:!1,props:_extends$1(_extends$1({},dialogPropTypes()),{motionName:String,ariaId:String,onVisibleChanged:Function,onMousedown:Function,onMouseup:Function}),setup:function(e,t){var n=t.expose,i=t.slots,o=t.attrs,r=ref(),s=ref(),a=ref();n({focus:function(){var e;null===(e=r.value)||void 0===e||e.focus()},changeActive:function(e){var t=document.activeElement;e&&t===s.value?r.value.focus():e||t!==r.value||s.value.focus()}});var l=ref(),c=computed((function(){var t=e.width,n=e.height,i={};return void 0!==t&&(i.width="number"==typeof t?"".concat(t,"px"):t),void 0!==n&&(i.height="number"==typeof n?"".concat(n,"px"):n),l.value&&(i.transformOrigin=l.value),i})),d=function(){nextTick((function(){if(a.value){var t=offset$1(a.value);l.value=e.mousePosition?"".concat(e.mousePosition.x-t.left,"px ").concat(e.mousePosition.y-t.top,"px"):""}}))},u=function(t){e.onVisibleChanged(t)};return function(){var t,n,l,h,g,p,f,m=e.prefixCls,v=e.footer,_=void 0===v?null===(t=i.footer)||void 0===t?void 0:t.call(i):v,C=e.title,b=void 0===C?null===(n=i.title)||void 0===n?void 0:n.call(i):C,y=e.ariaId,S=e.closable,w=e.closeIcon,E=void 0===w?null===(l=i.closeIcon)||void 0===l?void 0:l.call(i):w,x=e.onClose,T=e.bodyStyle,I=e.bodyProps,k=e.onMousedown,L=e.onMouseup,D=e.visible,N=e.modalRender,O=void 0===N?i.modalRender:N,A=e.destroyOnClose,P=e.motionName;_&&(g=createVNode("div",{class:"".concat(m,"-footer")},[_])),b&&(p=createVNode("div",{class:"".concat(m,"-header")},[createVNode("div",{class:"".concat(m,"-title"),id:y},[b])])),S&&(f=createVNode("button",{type:"button",onClick:x,"aria-label":"Close",class:"".concat(m,"-close")},[E||createVNode("span",{class:"".concat(m,"-close-x")},null)]));var R=createVNode("div",{class:"".concat(m,"-content")},[f,p,createVNode("div",_objectSpread2$1({class:"".concat(m,"-body"),style:T},I),[null===(h=i.default)||void 0===h?void 0:h.call(i)]),g]),M=getTransitionProps(P);return createVNode(Transition,_objectSpread2$1(_objectSpread2$1({},M),{},{onBeforeEnter:d,onAfterEnter:function(){return u(!0)},onAfterLeave:function(){return u(!1)}}),{default:function(){return[D||!A?withDirectives(createVNode("div",_objectSpread2$1(_objectSpread2$1({},o),{},{ref:a,key:"dialog-element",role:"document",style:[c.value,o.style],class:[m,o.class],onMousedown:k,onMouseup:L}),[createVNode("div",{tabindex:0,ref:r,style:sentinelStyle,"aria-hidden":"true"},null),O?O({originVNode:R}):R,createVNode("div",{tabindex:0,ref:s,style:sentinelStyle,"aria-hidden":"true"},null)]),[[vShow,D]]):null]}})}}});function _objectDestructuringEmpty(e){if(null==e)throw new TypeError("Cannot destructure undefined")}var Mask=defineComponent({name:"Mask",props:{prefixCls:String,visible:Boolean,motionName:String,maskProps:Object},setup:function(e,t){return _objectDestructuringEmpty(t),function(){var t=e.prefixCls,n=e.visible,i=e.maskProps,o=e.motionName,r=getTransitionProps(o);return createVNode(Transition,r,{default:function(){return[withDirectives(createVNode("div",_objectSpread2$1({class:"".concat(t,"-mask")},i),null),[[vShow,n]])]}})}}}),Dialog=defineComponent({name:"Dialog",inheritAttrs:!1,props:initDefaultProps$1(_extends$1(_extends$1({},dialogPropTypes()),{getOpenCount:Function,scrollLocker:Object}),{mask:!0,visible:!1,keyboard:!0,closable:!0,maskClosable:!0,destroyOnClose:!1,prefixCls:"rc-dialog",getOpenCount:function(){return null},focusTriggerAfterClose:!0}),setup:function(e,t){var n=t.attrs,i=t.slots,o=ref(),r=ref(),s=ref(),a=ref(e.visible),l=ref("vcDialogTitle".concat(getUUID())),c=function(t){var n,i;if(t)contains(r.value,document.activeElement)||(o.value=document.activeElement,null===(n=s.value)||void 0===n||n.focus());else{var l=a.value;if(a.value=!1,e.mask&&o.value&&e.focusTriggerAfterClose){try{o.value.focus({preventScroll:!0})}catch(e2){}o.value=null}l&&(null===(i=e.afterClose)||void 0===i||i.call(e))}},d=function(t){var n;null===(n=e.onClose)||void 0===n||n.call(e,t)},u=ref(!1),h=ref(),g=function(){clearTimeout(h.value),u.value=!0},p=function(){h.value=setTimeout((function(){u.value=!1}))},f=function(t){if(!e.maskClosable)return null;u.value?u.value=!1:r.value===t.target&&d(t)},m=function(t){if(e.keyboard&&t.keyCode===KeyCode$3.ESC)return t.stopPropagation(),void d(t);e.visible&&t.keyCode===KeyCode$3.TAB&&s.value.changeActive(!t.shiftKey)};return watch((function(){return e.visible}),(function(){e.visible&&(a.value=!0)}),{flush:"post"}),onBeforeUnmount((function(){var t;clearTimeout(h.value),null===(t=e.scrollLocker)||void 0===t||t.unLock()})),watchEffect((function(){var t,n;null===(t=e.scrollLocker)||void 0===t||t.unLock(),a.value&&(null===(n=e.scrollLocker)||void 0===n||n.lock())})),function(){var t=e.prefixCls,o=e.mask,u=e.visible,h=e.maskTransitionName,v=e.maskAnimation,_=e.zIndex,C=e.wrapClassName,b=e.rootClassName,y=e.wrapStyle,S=e.closable,w=e.maskProps,E=e.maskStyle,x=e.transitionName,T=e.animation,I=e.wrapProps,k=e.title,L=void 0===k?i.title:k,D=n.style,N=n.class;return createVNode("div",_objectSpread2$1({class:["".concat(t,"-root"),b]},pickAttrs(e,{data:!0})),[createVNode(Mask,{prefixCls:t,visible:o&&u,motionName:getMotionName(t,h,v),style:_extends$1({zIndex:_},E),maskProps:w},null),createVNode("div",_objectSpread2$1({tabIndex:-1,onKeydown:m,class:classNames("".concat(t,"-wrap"),C),ref:r,onClick:f,role:"dialog","aria-labelledby":L?l.value:null,style:_extends$1(_extends$1({zIndex:_},y),{display:a.value?null:"none"})},I),[createVNode(Content,_objectSpread2$1(_objectSpread2$1({},omit$2(e,["scrollLocker"])),{},{style:D,class:N,onMousedown:g,onMouseup:p,ref:s,closable:S,ariaId:l.value,prefixCls:t,visible:u,onClose:d,onVisibleChanged:c,motionName:getMotionName(t,x,T)}),i)])])}}}),IDialogPropTypes=dialogPropTypes(),DialogWrap=defineComponent({name:"DialogWrap",inheritAttrs:!1,props:initDefaultProps$1(IDialogPropTypes,{visible:!1}),setup:function(e,t){var n=t.attrs,i=t.slots,o=ref(e.visible);return useProvidePortal({},{inTriggerContext:!1}),watch((function(){return e.visible}),(function(){e.visible&&(o.value=!0)}),{flush:"post"}),function(){var t=e.visible,r=e.getContainer,s=e.forceRender,a=e.destroyOnClose,l=void 0!==a&&a,c=e.afterClose,d=_extends$1(_extends$1(_extends$1({},e),n),{ref:"_component",key:"dialog"});return!1===r?createVNode(Dialog,_objectSpread2$1(_objectSpread2$1({},d),{},{getOpenCount:function(){return 2}}),i):s||!l||o.value?createVNode(Portal,{visible:t,forceRender:s,getContainer:r},{default:function(e){return d=_extends$1(_extends$1(_extends$1({},d),e),{afterClose:function(){null==c||c(),o.value=!1}}),createVNode(Dialog,d,i)}}):null}}}),DialogWrap$1=DialogWrap,UpOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},UpOutlinedSvg=UpOutlined$2;function _objectSpread$r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$r(e,t,n[t])}))}return e}function _defineProperty$r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var UpOutlined=function(e,t){var n=_objectSpread$r({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$r({},n,{icon:UpOutlinedSvg}),null)};UpOutlined.displayName="UpOutlined",UpOutlined.inheritAttrs=!1;var UpOutlined$1=UpOutlined;function supportBigInt(){return"function"==typeof BigInt}function trimNumber(e){var t=e.trim(),n=t.startsWith("-");n&&(t=t.slice(1)),(t=t.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,"")).startsWith(".")&&(t="0".concat(t));var i=t||"0",o=i.split("."),r=o[0]||"0",s=o[1]||"0";"0"===r&&"0"===s&&(n=!1);var a=n?"-":"";return{negative:n,negativeStr:a,trimStr:i,integerStr:r,decimalStr:s,fullStr:"".concat(a).concat(i)}}function isE(e){var t=String(e);return!Number.isNaN(Number(t))&&t.includes("e")}function getNumberPrecision(e){var t=String(e);if(isE(e)){var n=Number(t.slice(t.indexOf("e-")+2)),i=t.match(/\.(\d+)/);return(null==i?void 0:i[1])&&(n+=i[1].length),n}return t.includes(".")&&validateNumber(t)?t.length-t.indexOf(".")-1:0}function num2str(e){var t=String(e);if(isE(e)){if(e>Number.MAX_SAFE_INTEGER)return String(supportBigInt()?BigInt(e).toString():Number.MAX_SAFE_INTEGER);if(e<Number.MIN_SAFE_INTEGER)return String(supportBigInt()?BigInt(e).toString():Number.MIN_SAFE_INTEGER);t=e.toFixed(getNumberPrecision(t))}return trimNumber(t).fullStr}function validateNumber(e){return"number"==typeof e?!Number.isNaN(e):!!e&&(/^\s*-?\d+(\.\d+)?\s*$/.test(e)||/^\s*-?\d+\.\s*$/.test(e)||/^\s*-?\.\d+\s*$/.test(e))}var NumberDecimal=function(){function e(t){_classCallCheck(this,e),this.origin="",(t||0===t)&&String(t).trim()?(this.origin=String(t),this.number=Number(t)):this.empty=!0}return _createClass(e,[{key:"negate",value:function(){return new e(-this.toNumber())}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=Number(t);if(Number.isNaN(n))return this;var i=this.number+n;if(i>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(i<Number.MIN_SAFE_INTEGER)return new e(Number.MIN_SAFE_INTEGER);var o=Math.max(getNumberPrecision(this.number),getNumberPrecision(n));return new e(i.toFixed(o))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(e){return this.toNumber()===(null==e?void 0:e.toNumber())}},{key:"lessEquals",value:function(e){return this.add(e.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e?this.isInvalidate()?"":num2str(this.number):this.origin}}]),e}(),BigIntDecimal=function(){function e(t){if(_classCallCheck(this,e),this.origin="",(t||0===t)&&String(t).trim())if(this.origin=String(t),"-"!==t){var n=t;if(isE(n)&&(n=Number(n)),validateNumber(n="string"==typeof n?n:num2str(n))){var i=trimNumber(n);this.negative=i.negative;var o=i.trimStr.split(".");this.integer=BigInt(o[0]);var r=o[1]||"0";this.decimal=BigInt(r),this.decimalLen=r.length}else this.nan=!0}else this.nan=!0;else this.empty=!0}return _createClass(e,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(e){var t="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(e,"0"));return BigInt(t)}},{key:"negate",value:function(){var t=new e(this.toString());return t.negative=!t.negative,t}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=new e(t);if(n.isInvalidate())return this;var i=Math.max(this.getDecimalStr().length,n.getDecimalStr().length),o=trimNumber((this.alignDecimal(i)+n.alignDecimal(i)).toString()),r=o.negativeStr,s=o.trimStr,a="".concat(r).concat(s.padStart(i+1,"0"));return new e("".concat(a.slice(0,-i),".").concat(a.slice(-i)))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(e){return this.toString()===(null==e?void 0:e.toString())}},{key:"lessEquals",value:function(e){return this.add(e.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e?this.isInvalidate()?"":trimNumber("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),e}();function getMiniDecimal(e){return supportBigInt()?new BigIntDecimal(e):new NumberDecimal(e)}function toFixed(e,t,n){if(""===e)return"";var i=trimNumber(e),o=i.negativeStr,r=i.integerStr,s=i.decimalStr,a="".concat(t).concat(s),l="".concat(o).concat(r);if(n>=0){var c=Number(s[n]);return c>=5?toFixed(getMiniDecimal(e).add("".concat(o,"0.").concat("0".repeat(n)).concat(10-c)).toString(),t,n):0===n?l:"".concat(l).concat(t).concat(s.padEnd(n,"0").slice(0,n))}return".0"===a?l:"".concat(l).concat(a)}var STEP_INTERVAL=200,STEP_DELAY=600,StepHandler=defineComponent({name:"StepHandler",inheritAttrs:!1,props:{prefixCls:String,upDisabled:Boolean,downDisabled:Boolean,onStep:{type:Function}},slots:["upNode","downNode"],setup:function(e,t){var n=t.slots,i=t.emit,o=ref(),r=function(e,t){e.preventDefault(),i("step",t),o.value=setTimeout((function e(){i("step",t),o.value=setTimeout(e,STEP_INTERVAL)}),STEP_DELAY)},s=function(){clearTimeout(o.value)};return onBeforeUnmount((function(){s()})),function(){if(isMobile$2())return null;var t=e.prefixCls,i=e.upDisabled,o=e.downDisabled,a="".concat(t,"-handler"),l=classNames(a,"".concat(a,"-up"),_defineProperty$P({},"".concat(a,"-up-disabled"),i)),c=classNames(a,"".concat(a,"-down"),_defineProperty$P({},"".concat(a,"-down-disabled"),o)),d={unselectable:"on",role:"button",onMouseup:s,onMouseleave:s},u=n.upNode,h=n.downNode;return createVNode("div",{class:"".concat(a,"-wrap")},[createVNode("span",_objectSpread2$1(_objectSpread2$1({},d),{},{onMousedown:function(e){r(e,!0)},"aria-label":"Increase Value","aria-disabled":i,class:l}),[(null==u?void 0:u())||createVNode("span",{unselectable:"on",class:"".concat(t,"-handler-up-inner")},null)]),createVNode("span",_objectSpread2$1(_objectSpread2$1({},d),{},{onMousedown:function(e){r(e,!1)},"aria-label":"Decrease Value","aria-disabled":o,class:c}),[(null==h?void 0:h())||createVNode("span",{unselectable:"on",class:"".concat(t,"-handler-down-inner")},null)])])}}});function useCursor(e,t){var n=ref(null);return[function(){try{var t=e.value,i=t.selectionStart,o=t.selectionEnd,r=t.value,s=r.substring(0,i),a=r.substring(o);n.value={start:i,end:o,value:r,beforeTxt:s,afterTxt:a}}catch(e2){}},function(){if(e.value&&n.value&&t.value)try{var i=e.value.value,o=n.value,r=o.beforeTxt,s=o.afterTxt,a=o.start,l=i.length;if(i.endsWith(s))l=i.length-n.value.afterTxt.length;else if(i.startsWith(r))l=r.length;else{var c=r[a-1],d=i.indexOf(c,a-1);-1!==d&&(l=d+1)}e.value.setSelectionRange(l,l)}catch(e2){warning$3(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(e2.message))}}]}var useFrame=function(){var e=ref(0),t=function(){wrapperRaf.cancel(e.value)};return onBeforeUnmount((function(){t()})),function(n){t(),e.value=wrapperRaf((function(){n()}))}},__rest$i=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},getDecimalValue=function(e,t){return e||t.isEmpty()?t.toString():t.toNumber()},getDecimalIfValidate=function(e){var t=getMiniDecimal(e);return t.isInvalidate()?null:t},inputNumberProps$1=function(){return{stringMode:{type:Boolean},defaultValue:{type:[String,Number]},value:{type:[String,Number]},prefixCls:{type:String},min:{type:[String,Number]},max:{type:[String,Number]},step:{type:[String,Number],default:1},tabindex:{type:Number},controls:{type:Boolean,default:!0},readonly:{type:Boolean},disabled:{type:Boolean},autofocus:{type:Boolean},keyboard:{type:Boolean,default:!0},parser:{type:Function},formatter:{type:Function},precision:{type:Number},decimalSeparator:{type:String},onInput:{type:Function},onChange:{type:Function},onPressEnter:{type:Function},onStep:{type:Function},onBlur:{type:Function},onFocus:{type:Function}}},VcInputNumber=defineComponent({name:"InnerInputNumber",inheritAttrs:!1,props:_extends$1(_extends$1({},inputNumberProps$1()),{lazy:Boolean}),slots:["upHandler","downHandler"],setup:function(e,t){var n=t.attrs,i=t.slots,o=t.emit,r=t.expose,s=ref(),a=ref(!1),l=ref(!1),c=ref(!1),d=ref(getMiniDecimal(e.value));var u,h=function(t,n){if(!n)return e.precision>=0?e.precision:Math.max(getNumberPrecision(t),getNumberPrecision(e.step))},g=function(t){var n=String(t);if(e.parser)return e.parser(n);var i=n;return e.decimalSeparator&&(i=i.replace(e.decimalSeparator,".")),i.replace(/[^\w.-]+/g,"")},p=ref(""),f=function(t,n){if(e.formatter)return e.formatter(t,{userTyping:n,input:String(p.value)});var i="number"==typeof t?num2str(t):t;if(!n){var o=h(i,n);if(validateNumber(i)&&(e.decimalSeparator||o>=0))i=toFixed(i,e.decimalSeparator||".",o)}return i},m=(u=e.value,d.value.isInvalidate()&&["string","number"].includes(_typeof$3(u))?Number.isNaN(u)?"":u:f(d.value.toString(),!1));function v(e,t){p.value=f(e.isInvalidate()?e.toString(!1):e.toString(!t),t)}p.value=m;var _=computed((function(){return getDecimalIfValidate(e.max)})),C=computed((function(){return getDecimalIfValidate(e.min)})),b=computed((function(){return!(!_.value||!d.value||d.value.isInvalidate())&&_.value.lessEquals(d.value)})),y=computed((function(){return!(!C.value||!d.value||d.value.isInvalidate())&&d.value.lessEquals(C.value)})),S=_slicedToArray$2(useCursor(s,a),2),w=S[0],E=S[1],x=function(e){return _.value&&!e.lessEquals(_.value)?_.value:C.value&&!C.value.lessEquals(e)?C.value:null},T=function(e){return!x(e)},I=function(t,n){var i,o,r=t,s=T(r)||r.isEmpty();if(r.isEmpty()||n||(r=x(r)||r,s=!0),!e.readonly&&!e.disabled&&s){var a=r.toString(),l=h(a,n);return l>=0&&(r=getMiniDecimal(toFixed(a,".",l))),r.equals(d.value)||(o=r,void 0===e.value&&(d.value=o),null===(i=e.onChange)||void 0===i||i.call(e,r.isEmpty()?null:getDecimalValue(e.stringMode,r)),void 0===e.value&&v(r,n)),r}return d.value},k=useFrame(),L=function t(n){var i;if(w(),p.value=n,!c.value){var o=getMiniDecimal(g(n));o.isNaN()||I(o,!0)}null===(i=e.onInput)||void 0===i||i.call(e,n),k((function(){var i=n;e.parser||(i=n.replace(/。/g,".")),i!==n&&t(i)}))},D=function(){c.value=!0},N=function(){c.value=!1,L(s.value.value)},O=function(e){L(e.target.value)},A=function(t){var n,i;if(!(t&&b.value||!t&&y.value)){l.value=!1;var o=getMiniDecimal(e.step);t||(o=o.negate());var r=(d.value||getMiniDecimal(0)).add(o.toString()),a=I(r,!1);null===(n=e.onStep)||void 0===n||n.call(e,getDecimalValue(e.stringMode,a),{offset:e.step,type:t?"up":"down"}),null===(i=s.value)||void 0===i||i.focus()}},P=function(t){var n=getMiniDecimal(g(p.value)),i=n;i=n.isNaN()?d.value:I(n,t),void 0!==e.value?v(d.value,!1):i.isNaN()||v(i,!1)},R=function(t){var n,i=t.which;l.value=!0,i===KeyCode$3.ENTER&&(c.value||(l.value=!1),P(!1),null===(n=e.onPressEnter)||void 0===n||n.call(e,t)),!1!==e.keyboard&&!c.value&&[KeyCode$3.UP,KeyCode$3.DOWN].includes(i)&&(A(KeyCode$3.UP===i),t.preventDefault())},M=function(){l.value=!1},$=function(e){P(!1),a.value=!1,l.value=!1,o("blur",e)};return watch((function(){return e.precision}),(function(){d.value.isInvalidate()||v(d.value,!1)}),{flush:"post"}),watch((function(){return e.value}),(function(){var t=getMiniDecimal(e.value);d.value=t;var n=getMiniDecimal(g(p.value));t.equals(n)&&l.value&&!e.formatter||v(t,l.value)}),{flush:"post"}),watch(p,(function(){e.formatter&&E()}),{flush:"post"}),watch((function(){return e.disabled}),(function(e){e&&(a.value=!1)})),r({focus:function(){var e;null===(e=s.value)||void 0===e||e.focus()},blur:function(){var e;null===(e=s.value)||void 0===e||e.blur()}}),function(){var t,r=_extends$1(_extends$1({},n),e),l=r.prefixCls,c=void 0===l?"rc-input-number":l,u=r.min,h=r.max,g=r.step,f=void 0===g?1:g;r.defaultValue,r.value;var m=r.disabled,v=r.readonly;r.keyboard;var _=r.controls,C=void 0===_||_,S=r.autofocus;r.stringMode,r.parser,r.formatter,r.precision,r.decimalSeparator,r.onChange,r.onInput,r.onPressEnter,r.onStep;var w=r.lazy,E=r.class,x=r.style,I=__rest$i(r,["prefixCls","min","max","step","defaultValue","value","disabled","readonly","keyboard","controls","autofocus","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","lazy","class","style"]),k=i.upHandler,L=i.downHandler,P="".concat(c,"-input"),F={};return w?F.onChange=O:F.onInput=O,createVNode("div",{class:classNames(c,E,(t={},_defineProperty$P(t,"".concat(c,"-focused"),a.value),_defineProperty$P(t,"".concat(c,"-disabled"),m),_defineProperty$P(t,"".concat(c,"-readonly"),v),_defineProperty$P(t,"".concat(c,"-not-a-number"),d.value.isNaN()),_defineProperty$P(t,"".concat(c,"-out-of-range"),!d.value.isInvalidate()&&!T(d.value)),t)),style:x,onKeydown:R,onKeyup:M},[C&&createVNode(StepHandler,{prefixCls:c,upDisabled:b.value,downDisabled:y.value,onStep:A},{upNode:k,downNode:L}),createVNode("div",{class:"".concat(P,"-wrap")},[createVNode("input",_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({autofocus:S,autocomplete:"off",role:"spinbutton","aria-valuemin":u,"aria-valuemax":h,"aria-valuenow":d.value.isInvalidate()?null:d.value.toString(),step:f},I),{},{ref:s,class:P,value:p.value,disabled:m,readonly:v,onFocus:function(e){a.value=!0,o("focus",e)}},F),{},{onBlur:$,onCompositionstart:D,onCompositionend:N}),null)])])}}});function isValidValue(e){return null!=e}var __rest$h=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},baseProps=inputNumberProps$1(),inputNumberProps=function(){return _extends$1(_extends$1({},baseProps),{size:{type:String},bordered:{type:Boolean,default:!0},placeholder:String,name:String,id:String,type:String,addonBefore:PropTypes$1.any,addonAfter:PropTypes$1.any,prefix:PropTypes$1.any,"onUpdate:value":baseProps.onChange,valueModifiers:Object})},InputNumber=defineComponent({name:"AInputNumber",inheritAttrs:!1,props:inputNumberProps(),slots:["addonBefore","addonAfter","prefix"],setup:function(e,t){var n=t.emit,i=t.expose,o=t.attrs,r=t.slots,s=useInjectFormItemContext(),a=useConfigInject("input-number",e),l=a.prefixCls,c=a.size,d=a.direction,u=ref(void 0===e.value?e.defaultValue:e.value),h=ref(!1);watch((function(){return e.value}),(function(){u.value=e.value}));var g=ref(null);i({focus:function(){var e;null===(e=g.value)||void 0===e||e.focus()},blur:function(){var e;null===(e=g.value)||void 0===e||e.blur()}});var p=function(t){void 0===e.value&&(u.value=t),n("update:value",t),n("change",t),s.onFieldChange()},f=function(e){h.value=!1,n("blur",e),s.onFieldBlur()},m=function(e){h.value=!0,n("focus",e)};return function(){var t,n,i,s,a=_extends$1(_extends$1({},o),e),v=a.class,_=a.bordered,C=a.readonly,b=a.style,y=a.addonBefore,S=void 0===y?null===(n=r.addonBefore)||void 0===n?void 0:n.call(r):y,w=a.addonAfter,E=void 0===w?null===(i=r.addonAfter)||void 0===i?void 0:i.call(r):w,x=a.prefix,T=void 0===x?null===(s=r.prefix)||void 0===s?void 0:s.call(r):x,I=a.valueModifiers,k=void 0===I?{}:I,L=__rest$h(a,["class","bordered","readonly","style","addonBefore","addonAfter","prefix","valueModifiers"]),D=l.value,N=c.value,O=classNames((_defineProperty$P(t={},"".concat(D,"-lg"),"large"===N),_defineProperty$P(t,"".concat(D,"-sm"),"small"===N),_defineProperty$P(t,"".concat(D,"-rtl"),"rtl"===d.value),_defineProperty$P(t,"".concat(D,"-readonly"),C),_defineProperty$P(t,"".concat(D,"-borderless"),!_),t),v),A=createVNode(VcInputNumber,_objectSpread2$1(_objectSpread2$1({},omit$2(L,["size","defaultValue"])),{},{ref:g,lazy:!!k.lazy,value:u.value,class:O,prefixCls:D,readonly:C,onChange:p,onBlur:f,onFocus:m}),{upHandler:function(){return createVNode(UpOutlined$1,{class:"".concat(D,"-handler-up-inner")},null)},downHandler:function(){return createVNode(DownOutlined$1,{class:"".concat(D,"-handler-down-inner")},null)}}),P=isValidValue(S)||isValidValue(E);if(isValidValue(T)){var R,M=classNames("".concat(D,"-affix-wrapper"),(_defineProperty$P(R={},"".concat(D,"-affix-wrapper-focused"),h.value),_defineProperty$P(R,"".concat(D,"-affix-wrapper-disabled"),e.disabled),_defineProperty$P(R,"".concat(D,"-affix-wrapper-rtl"),"rtl"===d.value),_defineProperty$P(R,"".concat(D,"-affix-wrapper-readonly"),C),_defineProperty$P(R,"".concat(D,"-affix-wrapper-borderless"),!_),_defineProperty$P(R,"".concat(v),!P&&v),R));A=createVNode("div",{class:M,style:b,onMouseup:function(){return g.value.focus()}},[createVNode("span",{class:"".concat(D,"-prefix")},[T]),A])}if(P){var $,F="".concat(D,"-group"),B="".concat(F,"-addon"),V=S?createVNode("div",{class:B},[S]):null,W=E?createVNode("div",{class:B},[E]):null,H=classNames("".concat(D,"-wrapper"),F,_defineProperty$P({},"".concat(F,"-rtl"),"rtl"===d.value)),z=classNames("".concat(D,"-group-wrapper"),(_defineProperty$P($={},"".concat(D,"-group-wrapper-sm"),"small"===N),_defineProperty$P($,"".concat(D,"-group-wrapper-lg"),"large"===N),_defineProperty$P($,"".concat(D,"-group-wrapper-rtl"),"rtl"===d.value),$),v);A=createVNode("div",{class:z,style:b},[createVNode("div",{class:H},[V,A,W])])}return cloneElement(A,{style:b})}}}),__unplugin_components_2$1=_extends$1(InputNumber,{install:function(e){return e.component(InputNumber.name,InputNumber),e}}),__rest$g=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},spinProps=function(){return{prefixCls:String,spinning:{type:Boolean,default:void 0},size:String,wrapperClassName:String,tip:PropTypes$1.any,delay:Number,indicator:PropTypes$1.any}},defaultIndicator=null;function shouldDelay(e,t){return!!e&&!!t&&!isNaN(Number(t))}function setDefaultIndicator(e){var t=e.indicator;defaultIndicator="function"==typeof t?t:function(){return createVNode(t,null,null)}}var Spin=defineComponent({name:"ASpin",inheritAttrs:!1,props:initDefaultProps$1(spinProps(),{size:"default",spinning:!0,wrapperClassName:""}),setup:function(){return{originalUpdateSpinning:null,configProvider:inject("configProvider",defaultConfigProvider)}},data:function(){var e=this.spinning,t=shouldDelay(e,this.delay);return{sSpinning:e&&!t}},created:function(){this.originalUpdateSpinning=this.updateSpinning,this.debouncifyUpdateSpinning(this.$props)},mounted:function(){this.updateSpinning()},updated:function(){var e=this;nextTick((function(){e.debouncifyUpdateSpinning(),e.updateSpinning()}))},beforeUnmount:function(){this.cancelExistingSpin()},methods:{debouncifyUpdateSpinning:function(e){var t=(e||this.$props).delay;t&&(this.cancelExistingSpin(),this.updateSpinning=debounce(this.originalUpdateSpinning,t))},updateSpinning:function(){var e=this.spinning;this.sSpinning!==e&&(this.sSpinning=e)},cancelExistingSpin:function(){var e=this.updateSpinning;e&&e.cancel&&e.cancel()},renderIndicator:function(e){var t="".concat(e,"-dot"),n=getComponent(this,"indicator");return null===n?null:(Array.isArray(n)&&(n=1===n.length?n[0]:n),isVNode(n)?cloneVNode(n,{class:t}):defaultIndicator&&isVNode(defaultIndicator())?cloneVNode(defaultIndicator(),{class:t}):createVNode("span",{class:"".concat(t," ").concat(e,"-dot-spin")},[createVNode("i",{class:"".concat(e,"-dot-item")},null),createVNode("i",{class:"".concat(e,"-dot-item")},null),createVNode("i",{class:"".concat(e,"-dot-item")},null),createVNode("i",{class:"".concat(e,"-dot-item")},null)]))}},render:function(){var e,t,n,i=this.$props,o=i.size,r=i.prefixCls,s=i.tip,a=void 0===s?null===(n=(t=this.$slots).tip)||void 0===n?void 0:n.call(t):s,l=i.wrapperClassName,c=this.$attrs,d=c.class,u=c.style,h=__rest$g(c,["class","style"]),g=this.configProvider,p=g.getPrefixCls,f=g.direction,m=p("spin",r),v=this.sSpinning,_=(_defineProperty$P(e={},m,!0),_defineProperty$P(e,"".concat(m,"-sm"),"small"===o),_defineProperty$P(e,"".concat(m,"-lg"),"large"===o),_defineProperty$P(e,"".concat(m,"-spinning"),v),_defineProperty$P(e,"".concat(m,"-show-text"),!!a),_defineProperty$P(e,"".concat(m,"-rtl"),"rtl"===f),_defineProperty$P(e,d,!!d),e),C=createVNode("div",_objectSpread2$1(_objectSpread2$1({},h),{},{style:u,class:_}),[this.renderIndicator(m),a?createVNode("div",{class:"".concat(m,"-text")},[a]):null]),b=getSlot(this);if(b&&b.length){var y,S=(_defineProperty$P(y={},"".concat(m,"-container"),!0),_defineProperty$P(y,"".concat(m,"-blur"),v),y);return createVNode("div",{class:["".concat(m,"-nested-loading"),l]},[v&&createVNode("div",{key:"loading"},[C]),createVNode("div",{class:S,key:"container"},[b])])}return C}});Spin.setDefaultIndicator=setDefaultIndicator,Spin.install=function(e){return e.component(Spin.name,Spin),e};var DoubleLeftOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},DoubleLeftOutlinedSvg=DoubleLeftOutlined$2;function _objectSpread$q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$q(e,t,n[t])}))}return e}function _defineProperty$q(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var DoubleLeftOutlined=function(e,t){var n=_objectSpread$q({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$q({},n,{icon:DoubleLeftOutlinedSvg}),null)};DoubleLeftOutlined.displayName="DoubleLeftOutlined",DoubleLeftOutlined.inheritAttrs=!1;var DoubleLeftOutlined$1=DoubleLeftOutlined,DoubleRightOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},DoubleRightOutlinedSvg=DoubleRightOutlined$2;function _objectSpread$p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$p(e,t,n[t])}))}return e}function _defineProperty$p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var DoubleRightOutlined=function(e,t){var n=_objectSpread$p({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$p({},n,{icon:DoubleRightOutlinedSvg}),null)};DoubleRightOutlined.displayName="DoubleRightOutlined",DoubleRightOutlined.inheritAttrs=!1;var DoubleRightOutlined$1=DoubleRightOutlined,MiniSelect=defineComponent({inheritAttrs:!1,props:selectProps(),Option:__unplugin_components_3.Option,setup:function(e,t){var n=t.attrs,i=t.slots;return function(){var t=_extends$1(_extends$1(_extends$1({},e),{size:"small"}),n);return createVNode(__unplugin_components_3,t,i)}}}),Pager=defineComponent({name:"Pager",inheritAttrs:!1,props:{rootPrefixCls:String,page:Number,active:{type:Boolean,default:void 0},last:{type:Boolean,default:void 0},locale:PropTypes$1.object,showTitle:{type:Boolean,default:void 0},itemRender:{type:Function,default:function(){}},onClick:{type:Function},onKeypress:{type:Function}},eimt:["click","keypress"],setup:function(e,t){var n=t.emit,i=t.attrs,o=function(){n("click",e.page)},r=function(t){n("keypress",t,o,e.page)};return function(){var t,n=e.showTitle,s=e.page,a=e.itemRender,l=i.class,c=i.style,d="".concat(e.rootPrefixCls,"-item"),u=classNames(d,"".concat(d,"-").concat(e.page),(_defineProperty$P(t={},"".concat(d,"-active"),e.active),_defineProperty$P(t,"".concat(d,"-disabled"),!e.page),t),l);return createVNode("li",{onClick:o,onKeypress:r,title:n?String(s):null,tabindex:"0",class:u,style:c},[a({page:s,type:"page",originalElement:createVNode("a",{rel:"nofollow"},[s])})])}}}),KEYCODE={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},Options=defineComponent({props:{disabled:{type:Boolean,default:void 0},changeSize:Function,quickGo:Function,selectComponentClass:PropTypes$1.any,current:Number,pageSizeOptions:PropTypes$1.array.def(["10","20","50","100"]),pageSize:Number,buildOptionText:Function,locale:PropTypes$1.object,rootPrefixCls:String,selectPrefixCls:String,goButton:PropTypes$1.any},setup:function(e){var t=ref(""),n=computed((function(){return!t.value||isNaN(t.value)?void 0:Number(t.value)})),i=function(t){return"".concat(t.value," ").concat(e.locale.items_per_page)},o=function(e){var n=e.target,i=n.value,o=n.composing;e.isComposing||o||t.value===i||(t.value=i)},r=function(i){var o=e.goButton,r=e.quickGo,s=e.rootPrefixCls;o||""===t.value||(i.relatedTarget&&(i.relatedTarget.className.indexOf("".concat(s,"-item-link"))>=0||i.relatedTarget.className.indexOf("".concat(s,"-item"))>=0)||r(n.value),t.value="")},s=function(i){""!==t.value&&(i.keyCode!==KEYCODE.ENTER&&"click"!==i.type||(e.quickGo(n.value),t.value=""))},a=computed((function(){var t=e.pageSize,n=e.pageSizeOptions;return n.some((function(e){return e.toString()===t.toString()}))?n:n.concat([t.toString()]).sort((function(e,t){return(isNaN(Number(e))?0:Number(e))-(isNaN(Number(t))?0:Number(t))}))}));return function(){var n=e.rootPrefixCls,l=e.locale,c=e.changeSize,d=e.quickGo,u=e.goButton,h=e.selectComponentClass,g=e.selectPrefixCls,p=e.pageSize,f=e.disabled,m="".concat(n,"-options"),v=null,_=null,C=null;if(!c&&!d)return null;if(c&&h){var b=e.buildOptionText||i,y=a.value.map((function(e,t){return createVNode(h.Option,{key:t,value:e},{default:function(){return[b({value:e})]}})}));v=createVNode(h,{disabled:f,prefixCls:g,showSearch:!1,class:"".concat(m,"-size-changer"),optionLabelProp:"children",value:(p||a.value[0]).toString(),onChange:function(e){return c(Number(e))},getPopupContainer:function(e){return e.parentNode}},{default:function(){return[y]}})}return d&&(u&&(C="boolean"==typeof u?createVNode("button",{type:"button",onClick:s,onKeyup:s,disabled:f,class:"".concat(m,"-quick-jumper-button")},[l.jump_to_confirm]):createVNode("span",{onClick:s,onKeyup:s},[u])),_=createVNode("div",{class:"".concat(m,"-quick-jumper")},[l.jump_to,withDirectives(createVNode("input",{disabled:f,type:"text",value:t.value,onInput:o,onChange:o,onKeyup:s,onBlur:r},null),[[antInputDirective]]),l.page,C])),createVNode("li",{class:"".concat(m)},[v,_])}}}),LOCALE={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页"},__rest$f=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function isInteger(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function defaultItemRender(e){return e.originalElement}function calculatePage(e,t,n){var i=void 0===e?t.statePageSize:e;return Math.floor((n.total-1)/i)+1}var VcPagination=defineComponent({name:"Pagination",mixins:[BaseMixin],inheritAttrs:!1,props:{disabled:{type:Boolean,default:void 0},prefixCls:PropTypes$1.string.def("rc-pagination"),selectPrefixCls:PropTypes$1.string.def("rc-select"),current:Number,defaultCurrent:PropTypes$1.number.def(1),total:PropTypes$1.number.def(0),pageSize:Number,defaultPageSize:PropTypes$1.number.def(10),hideOnSinglePage:{type:Boolean,default:!1},showSizeChanger:{type:Boolean,default:void 0},showLessItems:{type:Boolean,default:!1},selectComponentClass:PropTypes$1.any,showPrevNextJumpers:{type:Boolean,default:!0},showQuickJumper:PropTypes$1.oneOfType([PropTypes$1.looseBool,PropTypes$1.object]).def(!1),showTitle:{type:Boolean,default:!0},pageSizeOptions:PropTypes$1.arrayOf(PropTypes$1.oneOfType([PropTypes$1.number,PropTypes$1.string])),buildOptionText:Function,showTotal:Function,simple:{type:Boolean,default:void 0},locale:PropTypes$1.object.def(LOCALE),itemRender:PropTypes$1.func.def(defaultItemRender),prevIcon:PropTypes$1.any,nextIcon:PropTypes$1.any,jumpPrevIcon:PropTypes$1.any,jumpNextIcon:PropTypes$1.any,totalBoundaryShowSizeChanger:PropTypes$1.number.def(50)},data:function(){var e=this.$props,t=firstNotUndefined([this.current,this.defaultCurrent]),n=firstNotUndefined([this.pageSize,this.defaultPageSize]);return{stateCurrent:t=Math.min(t,calculatePage(n,void 0,e)),stateCurrentInputValue:t,statePageSize:n}},watch:{current:function(e){this.setState({stateCurrent:e,stateCurrentInputValue:e})},pageSize:function(e){var t={},n=this.stateCurrent,i=calculatePage(e,this.$data,this.$props);n=n>i?i:n,hasProp(this,"current")||(t.stateCurrent=n,t.stateCurrentInputValue=n),t.statePageSize=e,this.setState(t)},stateCurrent:function(e,t){var n=this;this.$nextTick((function(){if(n.$refs.paginationNode){var e=n.$refs.paginationNode.querySelector(".".concat(n.prefixCls,"-item-").concat(t));e&&document.activeElement===e&&e.blur()}}))},total:function(){var e={},t=calculatePage(this.pageSize,this.$data,this.$props);if(hasProp(this,"current")){var n=Math.min(this.current,t);e.stateCurrent=n,e.stateCurrentInputValue=n}else{var i=this.stateCurrent;i=0===i&&t>0?1:Math.min(this.stateCurrent,t),e.stateCurrent=i}this.setState(e)}},methods:{getJumpPrevPage:function(){return Math.max(1,this.stateCurrent-(this.showLessItems?3:5))},getJumpNextPage:function(){return Math.min(calculatePage(void 0,this.$data,this.$props),this.stateCurrent+(this.showLessItems?3:5))},getItemIcon:function(e,t){var n=this.$props.prefixCls;return getComponent(this,e,this.$props)||createVNode("button",{type:"button","aria-label":t,class:"".concat(n,"-item-link")},null)},getValidValue:function(e){var t=e.target.value,n=calculatePage(void 0,this.$data,this.$props),i=this.$data.stateCurrentInputValue;return""===t?t:isNaN(Number(t))?i:t>=n?n:Number(t)},isValid:function(e){return isInteger(e)&&e!==this.stateCurrent},shouldDisplayQuickJumper:function(){var e=this.$props,t=e.showQuickJumper,n=e.pageSize;return!(e.total<=n)&&t},handleKeyDown:function(e){e.keyCode!==KEYCODE.ARROW_UP&&e.keyCode!==KEYCODE.ARROW_DOWN||e.preventDefault()},handleKeyUp:function(e){if(!e.isComposing&&!e.target.composing){var t=this.getValidValue(e);t!==this.stateCurrentInputValue&&this.setState({stateCurrentInputValue:t}),e.keyCode===KEYCODE.ENTER?this.handleChange(t):e.keyCode===KEYCODE.ARROW_UP?this.handleChange(t-1):e.keyCode===KEYCODE.ARROW_DOWN&&this.handleChange(t+1)}},changePageSize:function(e){var t=this.stateCurrent,n=t,i=calculatePage(e,this.$data,this.$props);t=t>i?i:t,0===i&&(t=this.stateCurrent),"number"==typeof e&&(hasProp(this,"pageSize")||this.setState({statePageSize:e}),hasProp(this,"current")||this.setState({stateCurrent:t,stateCurrentInputValue:t})),this.__emit("update:pageSize",e),t!==n&&this.__emit("update:current",t),this.__emit("showSizeChange",t,e),this.__emit("change",t,e)},handleChange:function(e){var t=this.$props.disabled,n=e;if(this.isValid(n)&&!t){var i=calculatePage(void 0,this.$data,this.$props);return n>i?n=i:n<1&&(n=1),hasProp(this,"current")||this.setState({stateCurrent:n,stateCurrentInputValue:n}),this.__emit("update:current",n),this.__emit("change",n,this.statePageSize),n}return this.stateCurrent},prev:function(){this.hasPrev()&&this.handleChange(this.stateCurrent-1)},next:function(){this.hasNext()&&this.handleChange(this.stateCurrent+1)},jumpPrev:function(){this.handleChange(this.getJumpPrevPage())},jumpNext:function(){this.handleChange(this.getJumpNextPage())},hasPrev:function(){return this.stateCurrent>1},hasNext:function(){return this.stateCurrent<calculatePage(void 0,this.$data,this.$props)},getShowSizeChanger:function(){var e=this.$props,t=e.showSizeChanger,n=e.total,i=e.totalBoundaryShowSizeChanger;return void 0!==t?t:n>i},runIfEnter:function(e,t){if("Enter"===e.key||13===e.charCode){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];t.apply(void 0,i)}},runIfEnterPrev:function(e){this.runIfEnter(e,this.prev)},runIfEnterNext:function(e){this.runIfEnter(e,this.next)},runIfEnterJumpPrev:function(e){this.runIfEnter(e,this.jumpPrev)},runIfEnterJumpNext:function(e){this.runIfEnter(e,this.jumpNext)},handleGoTO:function(e){e.keyCode!==KEYCODE.ENTER&&"click"!==e.type||this.handleChange(this.stateCurrentInputValue)},renderPrev:function(e){var t=(0,this.$props.itemRender)({page:e,type:"prev",originalElement:this.getItemIcon("prevIcon","prev page")}),n=!this.hasPrev();return isValidElement(t)?cloneElement(t,n?{disabled:n}:{}):t},renderNext:function(e){var t=(0,this.$props.itemRender)({page:e,type:"next",originalElement:this.getItemIcon("nextIcon","next page")}),n=!this.hasNext();return isValidElement(t)?cloneElement(t,n?{disabled:n}:{}):t}},render:function(){var e,t=this.$props,n=t.prefixCls,i=t.disabled,o=t.hideOnSinglePage,r=t.total,s=t.locale,a=t.showQuickJumper,l=t.showLessItems,c=t.showTitle,d=t.showTotal,u=t.simple,h=t.itemRender,g=t.showPrevNextJumpers,p=t.jumpPrevIcon,f=t.jumpNextIcon,m=t.selectComponentClass,v=t.selectPrefixCls,_=t.pageSizeOptions,C=this.stateCurrent,b=this.statePageSize,y=splitAttrs(this.$attrs).extraAttrs,S=y.class,w=__rest$f(y,["class"]);if(!0===o&&this.total<=b)return null;var E=calculatePage(void 0,this.$data,this.$props),x=[],T=null,I=null,k=null,L=null,D=null,N=a&&a.goButton,O=l?1:2,A=C-1>0?C-1:0,P=C+1<E?C+1:E,R=this.hasPrev(),M=this.hasNext();if(u)return N&&(D="boolean"==typeof N?createVNode("button",{type:"button",onClick:this.handleGoTO,onKeyup:this.handleGoTO},[s.jump_to_confirm]):createVNode("span",{onClick:this.handleGoTO,onKeyup:this.handleGoTO},[N]),D=createVNode("li",{title:c?"".concat(s.jump_to).concat(C,"/").concat(E):null,class:"".concat(n,"-simple-pager")},[D])),createVNode("ul",_objectSpread2$1({class:classNames("".concat(n," ").concat(n,"-simple"),_defineProperty$P({},"".concat(n,"-disabled"),i),S)},w),[createVNode("li",{title:c?s.prev_page:null,onClick:this.prev,tabindex:R?0:null,onKeypress:this.runIfEnterPrev,class:classNames("".concat(n,"-prev"),_defineProperty$P({},"".concat(n,"-disabled"),!R)),"aria-disabled":!R},[this.renderPrev(A)]),createVNode("li",{title:c?"".concat(C,"/").concat(E):null,class:"".concat(n,"-simple-pager")},[withDirectives(createVNode("input",{type:"text",value:this.stateCurrentInputValue,disabled:i,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onInput:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"},null),[[antInputDirective]]),createVNode("span",{class:"".concat(n,"-slash")},[createTextVNode("/")]),E]),createVNode("li",{title:c?s.next_page:null,onClick:this.next,tabindex:M?0:null,onKeypress:this.runIfEnterNext,class:classNames("".concat(n,"-next"),_defineProperty$P({},"".concat(n,"-disabled"),!M)),"aria-disabled":!M},[this.renderNext(P)]),D]);if(E<=3+2*O){var $={locale:s,rootPrefixCls:n,showTitle:c,itemRender:h,onClick:this.handleChange,onKeypress:this.runIfEnter};E||x.push(createVNode(Pager,_objectSpread2$1(_objectSpread2$1({},$),{},{key:"noPager",page:1,class:"".concat(n,"-item-disabled")}),null));for(var F=1;F<=E;F+=1){var B=C===F;x.push(createVNode(Pager,_objectSpread2$1(_objectSpread2$1({},$),{},{key:F,page:F,active:B}),null))}}else{var V=l?s.prev_3:s.prev_5,W=l?s.next_3:s.next_5;g&&(T=createVNode("li",{title:this.showTitle?V:null,key:"prev",onClick:this.jumpPrev,tabindex:"0",onKeypress:this.runIfEnterJumpPrev,class:classNames("".concat(n,"-jump-prev"),_defineProperty$P({},"".concat(n,"-jump-prev-custom-icon"),!!p))},[h({page:this.getJumpPrevPage(),type:"jump-prev",originalElement:this.getItemIcon("jumpPrevIcon","prev page")})]),I=createVNode("li",{title:this.showTitle?W:null,key:"next",tabindex:"0",onClick:this.jumpNext,onKeypress:this.runIfEnterJumpNext,class:classNames("".concat(n,"-jump-next"),_defineProperty$P({},"".concat(n,"-jump-next-custom-icon"),!!f))},[h({page:this.getJumpNextPage(),type:"jump-next",originalElement:this.getItemIcon("jumpNextIcon","next page")})])),L=createVNode(Pager,{locale:s,last:!0,rootPrefixCls:n,onClick:this.handleChange,onKeypress:this.runIfEnter,key:E,page:E,active:!1,showTitle:c,itemRender:h},null),k=createVNode(Pager,{locale:s,rootPrefixCls:n,onClick:this.handleChange,onKeypress:this.runIfEnter,key:1,page:1,active:!1,showTitle:c,itemRender:h},null);var H=Math.max(1,C-O),z=Math.min(C+O,E);C-1<=O&&(z=1+2*O),E-C<=O&&(H=E-2*O);for(var K=H;K<=z;K+=1){var j=C===K;x.push(createVNode(Pager,{locale:s,rootPrefixCls:n,onClick:this.handleChange,onKeypress:this.runIfEnter,key:K,page:K,active:j,showTitle:c,itemRender:h},null))}C-1>=2*O&&3!==C&&(x[0]=createVNode(Pager,{locale:s,rootPrefixCls:n,onClick:this.handleChange,onKeypress:this.runIfEnter,key:H,page:H,class:"".concat(n,"-item-after-jump-prev"),active:!1,showTitle:this.showTitle,itemRender:h},null),x.unshift(T)),E-C>=2*O&&C!==E-2&&(x[x.length-1]=createVNode(Pager,{locale:s,rootPrefixCls:n,onClick:this.handleChange,onKeypress:this.runIfEnter,key:z,page:z,class:"".concat(n,"-item-before-jump-next"),active:!1,showTitle:this.showTitle,itemRender:h},null),x.push(I)),1!==H&&x.unshift(k),z!==E&&x.push(L)}var U=null;d&&(U=createVNode("li",{class:"".concat(n,"-total-text")},[d(r,[0===r?0:(C-1)*b+1,C*b>r?r:C*b])]));var G=!R||!E,q=!M||!E,Y=this.buildOptionText||this.$slots.buildOptionText;return createVNode("ul",_objectSpread2$1(_objectSpread2$1({unselectable:"on",ref:"paginationNode"},w),{},{class:classNames((e={},_defineProperty$P(e,"".concat(n),!0),_defineProperty$P(e,"".concat(n,"-disabled"),i),e),S)}),[U,createVNode("li",{title:c?s.prev_page:null,onClick:this.prev,tabindex:G?null:0,onKeypress:this.runIfEnterPrev,class:classNames("".concat(n,"-prev"),_defineProperty$P({},"".concat(n,"-disabled"),G)),"aria-disabled":G},[this.renderPrev(A)]),x,createVNode("li",{title:c?s.next_page:null,onClick:this.next,tabindex:q?null:0,onKeypress:this.runIfEnterNext,class:classNames("".concat(n,"-next"),_defineProperty$P({},"".concat(n,"-disabled"),q)),"aria-disabled":q},[this.renderNext(P)]),createVNode(Options,{disabled:i,locale:s,rootPrefixCls:n,selectComponentClass:m,selectPrefixCls:v,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:C,pageSize:b,pageSizeOptions:_,buildOptionText:Y||null,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:N},null)])}}),__rest$e=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},paginationProps=function(){return{total:Number,defaultCurrent:Number,disabled:{type:Boolean,default:void 0},current:Number,defaultPageSize:Number,pageSize:Number,hideOnSinglePage:{type:Boolean,default:void 0},showSizeChanger:{type:Boolean,default:void 0},pageSizeOptions:Array,buildOptionText:Function,showQuickJumper:{type:[Boolean,Object],default:void 0},showTotal:Function,size:String,simple:{type:Boolean,default:void 0},locale:Object,prefixCls:String,selectPrefixCls:String,totalBoundaryShowSizeChanger:Number,selectComponentClass:String,itemRender:Function,role:String,responsive:Boolean,showLessItems:{type:Boolean,default:void 0},onChange:Function,onShowSizeChange:Function,"onUpdate:current":Function,"onUpdate:pageSize":Function}},Pagination$1=defineComponent({name:"APagination",inheritAttrs:!1,props:paginationProps(),setup:function(e,t){var n=t.slots,i=t.attrs,o=useConfigInject("pagination",e),r=o.prefixCls,s=o.configProvider,a=o.direction,l=computed((function(){return s.getPrefixCls("select",e.selectPrefixCls)})),c=useBreakpoint(),d=_slicedToArray$2(useLocaleReceiver("Pagination",enUS$1,toRef(e,"locale")),1)[0];return function(){var t,o=e.size,s=e.itemRender,u=void 0===s?n.itemRender:s,h=e.buildOptionText,g=void 0===h?n.buildOptionText:h,p=e.selectComponentClass,f=e.responsive,m=__rest$e(e,["size","itemRender","buildOptionText","selectComponentClass","responsive"]),v="small"===o||!(!(null===(t=c.value)||void 0===t?void 0:t.xs)||o||!f),_=_extends$1(_extends$1(_extends$1(_extends$1(_extends$1({},m),function(e){var t=createVNode("span",{class:"".concat(e,"-item-ellipsis")},[createTextVNode("•••")]),n=createVNode("button",{class:"".concat(e,"-item-link"),type:"button",tabindex:-1},[createVNode(LeftOutlined$1,null,null)]),i=createVNode("button",{class:"".concat(e,"-item-link"),type:"button",tabindex:-1},[createVNode(RightOutlined$1,null,null)]),o=createVNode("a",{rel:"nofollow",class:"".concat(e,"-item-link")},[createVNode("div",{class:"".concat(e,"-item-container")},[createVNode(DoubleLeftOutlined$1,{class:"".concat(e,"-item-link-icon")},null),t])]),r=createVNode("a",{rel:"nofollow",class:"".concat(e,"-item-link")},[createVNode("div",{class:"".concat(e,"-item-container")},[createVNode(DoubleRightOutlined$1,{class:"".concat(e,"-item-link-icon")},null),t])]);if("rtl"===a.value){var s=[i,n];n=s[0],i=s[1];var l=[r,o];o=l[0],r=l[1]}return{prevIcon:n,nextIcon:i,jumpPrevIcon:o,jumpNextIcon:r}}(r.value)),{prefixCls:r.value,selectPrefixCls:l.value,selectComponentClass:p||(v?MiniSelect:__unplugin_components_3),locale:d.value,buildOptionText:g}),i),{class:classNames(_defineProperty$P({mini:v},"".concat(r.value,"-rtl"),"rtl"===a.value),i.class),itemRender:u});return createVNode(VcPagination,_,null)}}}),Pagination=withInstall(Pagination$1),__rest$d=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},mousePosition=null,getClickPosition=function(e){mousePosition={x:e.pageX,y:e.pageY},setTimeout((function(){return mousePosition=null}),100)};canUseDocElement()&&addEventListenerWrap(document.documentElement,"click",getClickPosition,!0);var modalProps=function(){return{prefixCls:String,visible:{type:Boolean,default:void 0},confirmLoading:{type:Boolean,default:void 0},title:PropTypes$1.any,closable:{type:Boolean,default:void 0},closeIcon:PropTypes$1.any,onOk:Function,onCancel:Function,"onUpdate:visible":Function,onChange:Function,afterClose:Function,centered:{type:Boolean,default:void 0},width:[String,Number],footer:PropTypes$1.any,okText:PropTypes$1.any,okType:String,cancelText:PropTypes$1.any,icon:PropTypes$1.any,maskClosable:{type:Boolean,default:void 0},forceRender:{type:Boolean,default:void 0},okButtonProps:Object,cancelButtonProps:Object,destroyOnClose:{type:Boolean,default:void 0},wrapClassName:String,maskTransitionName:String,transitionName:String,getContainer:{type:[String,Function,Boolean,Object],default:void 0},zIndex:Number,bodyStyle:{type:Object,default:void 0},maskStyle:{type:Object,default:void 0},mask:{type:Boolean,default:void 0},keyboard:{type:Boolean,default:void 0},wrapProps:Object,focusTriggerAfterClose:{type:Boolean,default:void 0},modalRender:Function}},destroyFns=[],Modal$2=defineComponent({name:"AModal",inheritAttrs:!1,props:initDefaultProps$1(modalProps(),{width:520,transitionName:"zoom",maskTransitionName:"fade",confirmLoading:!1,visible:!1,okType:"primary"}),setup:function(e,t){var n=t.emit,i=t.slots,o=t.attrs,r=_slicedToArray$2(useLocaleReceiver("Modal"),1)[0],s=useConfigInject("modal",e),a=s.prefixCls,l=s.rootPrefixCls,c=s.direction,d=s.getPopupContainer,u=function(e){n("update:visible",!1),n("cancel",e),n("change",!1)},h=function(e){n("ok",e)},g=function(){var t,n,o=e.okText,s=void 0===o?null===(t=i.okText)||void 0===t?void 0:t.call(i):o,a=e.okType,l=e.cancelText,c=void 0===l?null===(n=i.cancelText)||void 0===n?void 0:n.call(i):l,d=e.confirmLoading;return createVNode(Fragment,null,[createVNode(Button$2,_objectSpread2$1({onClick:u},e.cancelButtonProps),{default:function(){return[c||r.value.cancelText]}}),createVNode(Button$2,_objectSpread2$1(_objectSpread2$1({},convertLegacyProps(a)),{},{loading:d,onClick:h},e.okButtonProps),{default:function(){return[s||r.value.okText]}})])};return function(){var t,n;e.prefixCls;var r=e.visible,s=e.wrapClassName,h=e.centered,p=e.getContainer,f=e.closeIcon,m=void 0===f?null===(n=i.closeIcon)||void 0===n?void 0:n.call(i):f,v=e.focusTriggerAfterClose,_=void 0===v||v,C=__rest$d(e,["prefixCls","visible","wrapClassName","centered","getContainer","closeIcon","focusTriggerAfterClose"]),b=classNames(s,(_defineProperty$P(t={},"".concat(a.value,"-centered"),!!h),_defineProperty$P(t,"".concat(a.value,"-wrap-rtl"),"rtl"===c.value),t));return createVNode(DialogWrap$1,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},C),o),{},{getContainer:p||d.value,prefixCls:a.value,wrapClassName:b,visible:r,mousePosition:mousePosition,onClose:u,focusTriggerAfterClose:_,transitionName:getTransitionName$2(l.value,"zoom",e.transitionName),maskTransitionName:getTransitionName$2(l.value,"fade",e.maskTransitionName)}),_extends$1(_extends$1({},i),{footer:i.footer||g,closeIcon:function(){return createVNode("span",{class:"".concat(a.value,"-close-x")},[m||createVNode(CloseOutlined$1,{class:"".concat(a.value,"-close-icon")},null)])}}))}}}),useDestroyed=function(){var e=ref(!1);return onBeforeUnmount((function(){e.value=!0})),e},useDestroyed$1=useDestroyed,actionButtonProps={type:{type:String},actionFn:Function,close:Function,autofocus:Boolean,prefixCls:String,buttonProps:Object,emitEvent:Boolean,quitOnNullishReturnValue:Boolean};function isThenable$2(e){return!(!e||!e.then)}var ActionButton=defineComponent({name:"ActionButton",props:actionButtonProps,setup:function(e,t){var n,i=t.slots,o=ref(!1),r=ref(),s=ref(!1),a=useDestroyed$1();onMounted((function(){e.autofocus&&(n=setTimeout((function(){var e;return null===(e=r.value.$el)||void 0===e?void 0:e.focus()})))})),onBeforeUnmount((function(){clearTimeout(n)}));var l=function(t){var n=e.actionFn,i=e.close,r=void 0===i?function(){}:i;if(!o.value)if(o.value=!0,n){var l;if(e.emitEvent){if(l=n(t),e.quitOnNullishReturnValue&&!isThenable$2(l))return o.value=!1,void r(t)}else if(n.length)l=n(r),o.value=!1;else if(!(l=n()))return void r();!function(t){var n=e.close;isThenable$2(t)&&(s.value=!0,t.then((function(){a.value||(s.value=!1),n.apply(void 0,arguments),o.value=!1}),(function(e){a.value||(s.value=!1),o.value=!1})))}(l)}else r()};return function(){var t=e.type,n=e.prefixCls,o=e.buttonProps;return createVNode(Button$2,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},convertLegacyProps(t)),{},{onClick:l,loading:s.value,prefixCls:n},o),{},{ref:r}),i)}}});function renderSomeContent(e){return"function"==typeof e?e():e}var ConfirmDialog=defineComponent({name:"ConfirmDialog",inheritAttrs:!1,props:["icon","onCancel","onOk","close","closable","zIndex","afterClose","visible","keyboard","centered","getContainer","maskStyle","okButtonProps","cancelButtonProps","okType","prefixCls","okCancel","width","mask","maskClosable","okText","cancelText","autoFocusButton","transitionName","maskTransitionName","type","title","content","direction","rootPrefixCls","bodyStyle","closeIcon","modalRender","focusTriggerAfterClose","wrapClassName"],setup:function(e,t){var n=t.attrs,i=_slicedToArray$2(useLocaleReceiver("Modal"),1)[0];return function(){var t=e.icon,o=e.onCancel,r=e.onOk,s=e.close,a=e.closable,l=void 0!==a&&a,c=e.zIndex,d=e.afterClose,u=e.visible,h=e.keyboard,g=e.centered,p=e.getContainer,f=e.maskStyle,m=e.okButtonProps,v=e.cancelButtonProps,_=e.okCancel,C=void 0===_||_,b=e.width,y=void 0===b?416:b,S=e.mask,w=void 0===S||S,E=e.maskClosable,x=void 0!==E&&E,T=e.type,I=e.title,k=e.content,L=e.direction,D=e.closeIcon,N=e.modalRender,O=e.focusTriggerAfterClose,A=e.rootPrefixCls,P=e.bodyStyle,R=e.wrapClassName,M=e.okType||"primary",$=e.prefixCls||"ant-modal",F="".concat($,"-confirm"),B=n.style||{},V=renderSomeContent(e.okText)||(C?i.value.okText:i.value.justOkText),W=renderSomeContent(e.cancelText)||i.value.cancelText,H=null!==e.autoFocusButton&&(e.autoFocusButton||"ok"),z=classNames(F,"".concat(F,"-").concat(T),"".concat($,"-").concat(T),_defineProperty$P({},"".concat(F,"-rtl"),"rtl"===L),n.class),K=C&&createVNode(ActionButton,{actionFn:o,close:s,autofocus:"cancel"===H,buttonProps:v,prefixCls:"".concat(A,"-btn")},{default:function(){return[W]}});return createVNode(Modal$2,{prefixCls:$,class:z,wrapClassName:classNames(_defineProperty$P({},"".concat(F,"-centered"),!!g),R),onCancel:function(e){return s({triggerCancel:!0},e)},visible:u,title:"",footer:"",transitionName:getTransitionName$2(A,"zoom",e.transitionName),maskTransitionName:getTransitionName$2(A,"fade",e.maskTransitionName),mask:w,maskClosable:x,maskStyle:f,style:B,bodyStyle:P,width:y,zIndex:c,afterClose:d,keyboard:h,centered:g,getContainer:p,closable:l,closeIcon:D,modalRender:N,focusTriggerAfterClose:O},{default:function(){return[createVNode("div",{class:"".concat(F,"-body-wrapper")},[createVNode("div",{class:"".concat(F,"-body")},[renderSomeContent(t),void 0===I?null:createVNode("span",{class:"".concat(F,"-title")},[renderSomeContent(I)]),createVNode("div",{class:"".concat(F,"-content")},[renderSomeContent(k)])]),createVNode("div",{class:"".concat(F,"-btns")},[K,createVNode(ActionButton,{type:M,actionFn:r,close:s,autofocus:"ok"===H,buttonProps:m,prefixCls:"".concat(A,"-btn")},{default:function(){return[V]}})])])]}})}}}),confirm=function(e){var t=document.createDocumentFragment(),n=_extends$1(_extends$1({},omit$2(e,["parentContext","appContext"])),{close:r,visible:!0}),i=null;function o(){i&&(render(null,t),i.component.update(),i=null);for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];var a=o.some((function(e){return e&&e.triggerCancel}));e.onCancel&&a&&e.onCancel.apply(e,o);for(var l=0;l<destroyFns.length;l++){var c=destroyFns[l];if(c===r){destroyFns.splice(l,1);break}}}function r(){for(var t=this,i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];s(n=_extends$1(_extends$1({},n),{visible:!1,afterClose:function(){"function"==typeof e.afterClose&&e.afterClose(),o.apply(t,r)}}))}function s(e){n="function"==typeof e?e(n):_extends$1(_extends$1({},n),e),i&&(_extends$1(i.component.props,n),i.component.update())}var a,l=function(e){var t=globalConfigForApi,n=t.prefixCls,i=e.prefixCls||"".concat(n,"-modal");return createVNode(ConfigProvider,_objectSpread2$1(_objectSpread2$1({},t),{},{notUpdateGlobalConfig:!0,prefixCls:n}),{default:function(){return[createVNode(ConfirmDialog,_objectSpread2$1(_objectSpread2$1({},e),{},{rootPrefixCls:n,prefixCls:i}),null)]}})};return(a=createVNode(l,_extends$1({},n))).appContext=e.parentContext||e.appContext||a.appContext,render(a,t),i=a,destroyFns.push(r),{destroy:r,update:s}},confirm$1=confirm;function withWarn(e){return _extends$1(_extends$1({icon:function(){return createVNode(ExclamationCircleOutlined$1,null,null)},okCancel:!1},e),{type:"warning"})}function withInfo(e){return _extends$1(_extends$1({icon:function(){return createVNode(InfoCircleOutlined$1,null,null)},okCancel:!1},e),{type:"info"})}function withSuccess(e){return _extends$1(_extends$1({icon:function(){return createVNode(CheckCircleOutlined$1,null,null)},okCancel:!1},e),{type:"success"})}function withError(e){return _extends$1(_extends$1({icon:function(){return createVNode(CloseCircleOutlined$1,null,null)},okCancel:!1},e),{type:"error"})}function withConfirm(e){return _extends$1(_extends$1({icon:function(){return createVNode(ExclamationCircleOutlined$1,null,null)},okCancel:!0},e),{type:"confirm"})}function modalWarn(e){return confirm$1(withWarn(e))}Modal$2.info=function(e){return confirm$1(withInfo(e))},Modal$2.success=function(e){return confirm$1(withSuccess(e))},Modal$2.error=function(e){return confirm$1(withError(e))},Modal$2.warning=modalWarn,Modal$2.warn=modalWarn,Modal$2.confirm=function(e){return confirm$1(withConfirm(e))},Modal$2.destroyAll=function(){for(;destroyFns.length;){var e=destroyFns.pop();e&&e()}},Modal$2.install=function(e){return e.component(Modal$2.name,Modal$2),e};var progressStatuses=tuple("normal","exception","active","success"),ProgressType=tuple("line","circle","dashboard"),ProgressSize=tuple("default","small"),progressProps=function(){return{prefixCls:String,type:PropTypes$1.oneOf(ProgressType),percent:Number,format:{type:Function},status:PropTypes$1.oneOf(progressStatuses),showInfo:{type:Boolean,default:void 0},strokeWidth:Number,strokeLinecap:String,strokeColor:{type:[String,Object],default:void 0},trailColor:String,width:Number,success:{type:Object,default:function(){return{}}},gapDegree:Number,gapPosition:String,size:PropTypes$1.oneOf(ProgressSize),steps:Number,successPercent:Number,title:String}};function validProgress(e){return!e||e<0?0:e>100?100:e}function getSuccessPercent(e){var t=e.success,n=e.successPercent;return t&&"progress"in t&&(devWarning(!1,"Progress","`success.progress` is deprecated. Please use `success.percent` instead."),n=t.progress),t&&"percent"in t&&(n=t.percent),n}var __rest$c=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},lineProps=function(){return _extends$1(_extends$1({},progressProps()),{prefixCls:String,direction:{type:String}})},sortGradient=function(e){var t=[];return Object.keys(e).forEach((function(n){var i=parseFloat(n.replace(/%/g,""));isNaN(i)||t.push({key:i,value:e[n]})})),(t=t.sort((function(e,t){return e.key-t.key}))).map((function(e){var t=e.key,n=e.value;return"".concat(n," ").concat(t,"%")})).join(", ")},handleGradient=function(e,t){var n=e.from,i=void 0===n?presetPrimaryColors.blue:n,o=e.to,r=void 0===o?presetPrimaryColors.blue:o,s=e.direction,a=void 0===s?"rtl"===t?"to left":"to right":s,l=__rest$c(e,["from","to","direction"]);if(0!==Object.keys(l).length){var c=sortGradient(l);return{backgroundImage:"linear-gradient(".concat(a,", ").concat(c,")")}}return{backgroundImage:"linear-gradient(".concat(a,", ").concat(i,", ").concat(r,")")}},Line=defineComponent({name:"Line",props:lineProps(),setup:function(e,t){var n=t.slots,i=computed((function(){var t=e.strokeColor,n=e.direction;return t&&"string"!=typeof t?handleGradient(t,n):{background:t}})),o=computed((function(){return e.trailColor?{backgroundColor:e.trailColor}:void 0})),r=computed((function(){var t=e.percent,n=e.strokeWidth,o=e.strokeLinecap,r=e.size;return _extends$1({width:"".concat(validProgress(t),"%"),height:"".concat(n||("small"===r?6:8),"px"),borderRadius:"square"===o?0:""},i.value)})),s=computed((function(){return getSuccessPercent(e)})),a=computed((function(){var t=e.strokeWidth,n=e.size,i=e.strokeLinecap,o=e.success;return{width:"".concat(validProgress(s.value),"%"),height:"".concat(t||("small"===n?6:8),"px"),borderRadius:"square"===i?0:"",backgroundColor:null==o?void 0:o.strokeColor}}));return function(){var t;return createVNode(Fragment,null,[createVNode("div",{class:"".concat(e.prefixCls,"-outer")},[createVNode("div",{class:"".concat(e.prefixCls,"-inner"),style:o.value},[createVNode("div",{class:"".concat(e.prefixCls,"-bg"),style:r.value},null),void 0!==s.value?createVNode("div",{class:"".concat(e.prefixCls,"-success-bg"),style:a.value},null):null])]),null===(t=n.default)||void 0===t?void 0:t.call(n)])}}}),defaultProps={percent:0,prefixCls:"vc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1},useTransitionDuration=function(e){var t=ref(null);return onUpdated((function(){var n=Date.now(),i=!1;e.value.forEach((function(e){var o,r=(null===(o=e)||void 0===o?void 0:o.$el)||e;if(r){i=!0;var s=r.style;s.transitionDuration=".3s, .3s, .3s, .06s",t.value&&n-t.value<100&&(s.transitionDuration="0s, 0s")}})),i&&(t.value=Date.now())})),e},propTypes={gapDegree:Number,gapPosition:{type:String},percent:{type:[Array,Number]},prefixCls:String,strokeColor:{type:[Object,String,Array]},strokeLinecap:{type:String},strokeWidth:Number,trailColor:String,trailWidth:Number,transition:String},__rest$b=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},gradientSeed=0;function stripPercentToNumber(e){return+e.replace("%","")}function toArray$3(e){return Array.isArray(e)?e:[e]}function getPathStyles(e,t,n,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5?arguments[5]:void 0,s=50-i/2,a=0,l=-s,c=0,d=-2*s;switch(r){case"left":a=-s,l=0,c=2*s,d=0;break;case"right":a=s,l=0,c=-2*s,d=0;break;case"bottom":l=s,d=2*s}var u="M 50,50 m ".concat(a,",").concat(l,"\n a ").concat(s,",").concat(s," 0 1 1 ").concat(c,",").concat(-d,"\n a ").concat(s,",").concat(s," 0 1 1 ").concat(-c,",").concat(d),h=2*Math.PI*s,g={stroke:n,strokeDasharray:"".concat(t/100*(h-o),"px ").concat(h,"px"),strokeDashoffset:"-".concat(o/2+e/100*(h-o),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s"};return{pathString:u,pathStyle:g}}var VCCircle=defineComponent({name:"VCCircle",props:initDefaultProps$1(propTypes,defaultProps),setup:function(e){var t=ref(gradientSeed+=1),n=computed((function(){return toArray$3(e.percent)})),i=computed((function(){return toArray$3(e.strokeColor)})),o=_slicedToArray$2(useRefs$1(),2),r=o[0],s=o[1];useTransitionDuration(s);var a=function(){var o=e.prefixCls,s=e.strokeWidth,a=e.strokeLinecap,l=e.gapDegree,c=e.gapPosition,d=0;return n.value.map((function(e,n){var u=i.value[n]||i.value[i.value.length-1],h="[object Object]"===Object.prototype.toString.call(u)?"url(#".concat(o,"-gradient-").concat(t.value,")"):"",g=getPathStyles(d,e,u,s,l,c),p=g.pathString,f=g.pathStyle;d+=e;var m={key:n,d:p,stroke:h,"stroke-linecap":a,"stroke-width":s,opacity:0===e?0:1,"fill-opacity":"0",class:"".concat(o,"-circle-path"),style:f};return createVNode("path",_objectSpread2$1({ref:r(n)},m),null)}))};return function(){var n=e.prefixCls,o=e.strokeWidth,r=e.trailWidth,s=e.gapDegree,l=e.gapPosition,c=e.trailColor,d=e.strokeLinecap;e.strokeColor;var u=__rest$b(e,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","strokeColor"]),h=getPathStyles(0,100,c,o,s,l),g=h.pathString,p=h.pathStyle;delete u.percent;var f=i.value.find((function(e){return"[object Object]"===Object.prototype.toString.call(e)})),m={d:g,stroke:c,"stroke-linecap":d,"stroke-width":r||o,"fill-opacity":"0",class:"".concat(n,"-circle-trail"),style:p};return createVNode("svg",_objectSpread2$1({class:"".concat(n,"-circle"),viewBox:"0 0 100 100"},u),[f&&createVNode("defs",null,[createVNode("linearGradient",{id:"".concat(n,"-gradient-").concat(t.value),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},[Object.keys(f).sort((function(e,t){return stripPercentToNumber(e)-stripPercentToNumber(t)})).map((function(e,t){return createVNode("stop",{key:t,offset:e,"stop-color":f[e]},null)}))])]),createVNode("path",m,null),a().reverse()])}}});function getPercentage(e){var t=e.percent,n=validProgress(getSuccessPercent({success:e.success,successPercent:e.successPercent}));return[n,validProgress(validProgress(t)-n)]}function getStrokeColor(e){var t=e.success,n=void 0===t?{}:t,i=e.strokeColor;return[n.strokeColor||presetPrimaryColors.green,i||null]}var Circle=defineComponent({name:"Circle",inheritAttrs:!1,props:progressProps(),setup:function(e,t){var n=t.slots,i=computed((function(){return e.gapDegree||0===e.gapDegree?e.gapDegree:"dashboard"===e.type?75:void 0})),o=computed((function(){var t=e.width||120;return{width:"number"==typeof t?"".concat(t,"px"):t,height:"number"==typeof t?"".concat(t,"px"):t,fontSize:"".concat(.15*t+6,"px")}})),r=computed((function(){return e.strokeWidth||6})),s=computed((function(){return e.gapPosition||"dashboard"===e.type&&"bottom"||"top"})),a=computed((function(){return getPercentage(e)})),l=computed((function(){return"[object Object]"===Object.prototype.toString.call(e.strokeColor)})),c=computed((function(){return getStrokeColor({success:e.success,strokeColor:e.strokeColor})})),d=computed((function(){var t;return _defineProperty$P(t={},"".concat(e.prefixCls,"-inner"),!0),_defineProperty$P(t,"".concat(e.prefixCls,"-circle-gradient"),l.value),t}));return function(){var t;return createVNode("div",{class:d.value,style:o.value},[createVNode(VCCircle,{percent:a.value,strokeWidth:r.value,trailWidth:r.value,strokeColor:c.value,strokeLinecap:e.strokeLinecap,trailColor:e.trailColor,prefixCls:e.prefixCls,gapDegree:i.value,gapPosition:s.value},null),null===(t=n.default)||void 0===t?void 0:t.call(n)])}}}),stepsProps=function(){return _extends$1(_extends$1({},progressProps()),{steps:Number,size:{type:String},strokeColor:String,trailColor:String})},Steps=defineComponent({name:"Steps",props:stepsProps(),setup:function(e,t){var n=t.slots,i=computed((function(){return Math.round(e.steps*((e.percent||0)/100))})),o=computed((function(){return"small"===e.size?2:14})),r=computed((function(){for(var t=e.steps,n=e.strokeWidth,r=void 0===n?8:n,s=e.strokeColor,a=e.trailColor,l=e.prefixCls,c=[],d=0;d<t;d+=1){var u,h=(_defineProperty$P(u={},"".concat(l,"-steps-item"),!0),_defineProperty$P(u,"".concat(l,"-steps-item-active"),d<=i.value-1),u);c.push(createVNode("div",{key:d,class:h,style:{backgroundColor:d<=i.value-1?s:a,width:"".concat(o.value,"px"),height:"".concat(r,"px")}},null))}return c}));return function(){var t;return createVNode("div",{class:"".concat(e.prefixCls,"-steps-outer")},[r.value,null===(t=n.default)||void 0===t?void 0:t.call(n)])}}}),Progress$1=defineComponent({name:"AProgress",props:initDefaultProps$1(progressProps(),{type:"line",percent:0,showInfo:!0,trailColor:null,size:"default",strokeLinecap:"round"}),slots:["format"],setup:function(e,t){var n=t.slots,i=useConfigInject("progress",e),o=i.prefixCls,r=i.direction;devWarning(null==e.successPercent,"Progress","`successPercent` is deprecated. Please use `success.percent` instead.");var s=computed((function(){var t,n=e.type,i=e.showInfo,s=e.size,a=o.value;return _defineProperty$P(t={},a,!0),_defineProperty$P(t,"".concat(a,"-").concat("dashboard"===n?"circle":n),!0),_defineProperty$P(t,"".concat(a,"-show-info"),i),_defineProperty$P(t,"".concat(a,"-").concat(s),s),_defineProperty$P(t,"".concat(a,"-rtl"),"rtl"===r.value),t})),a=computed((function(){var t=e.percent,n=void 0===t?0:t,i=getSuccessPercent(e);return parseInt(void 0!==i?i.toString():n.toString(),10)})),l=computed((function(){var t=e.status;return progressStatuses.indexOf(t)<0&&a.value>=100?"success":t||"normal"}));return function(){var t,i=e.type,r=e.steps,a=e.strokeColor,c=e.title,d=function(){var t,i=e.showInfo,r=e.format,s=e.type,a=e.percent,c=e.title,d=getSuccessPercent(e);if(!i)return null;var u=r||(null==n?void 0:n.format)||function(e){return"".concat(e,"%")},h="line"===s;return r||(null==n?void 0:n.format)||"exception"!==l.value&&"success"!==l.value?t=u(validProgress(a),validProgress(d)):"exception"===l.value?t=createVNode(h?CloseCircleFilled$1:CloseOutlined$1,null,null):"success"===l.value&&(t=createVNode(h?CheckCircleFilled$1:CheckOutlined$1,null,null)),createVNode("span",{class:"".concat(o.value,"-text"),title:void 0===c&&"string"==typeof t?t:void 0},[t])}();"line"===i?t=r?createVNode(Steps,_objectSpread2$1(_objectSpread2$1({},e),{},{strokeColor:"string"==typeof a?a:void 0,prefixCls:o.value,steps:r}),{default:function(){return[d]}}):createVNode(Line,_objectSpread2$1(_objectSpread2$1({},e),{},{prefixCls:o.value}),{default:function(){return[d]}}):"circle"!==i&&"dashboard"!==i||(t=createVNode(Circle,_objectSpread2$1(_objectSpread2$1({},e),{},{prefixCls:o.value}),{default:function(){return[d]}}));var u=_extends$1(_extends$1({},s.value),_defineProperty$P({},"".concat(o.value,"-status-").concat(l.value),!0));return createVNode("div",{class:u,title:c},[t])}}}),__unplugin_components_7=withInstall(Progress$1),spaceSize={small:8,middle:16,large:24},spaceProps=function(){return{prefixCls:String,size:{type:[String,Number,Array]},direction:PropTypes$1.oneOf(tuple("horizontal","vertical")).def("horizontal"),align:PropTypes$1.oneOf(tuple("start","end","center","baseline")),wrap:{type:Boolean,default:void 0}}};function getNumberSize(e){return"string"==typeof e?spaceSize[e]:e||0}var Space=defineComponent({name:"ASpace",props:spaceProps(),slots:["split"],setup:function(e,t){var n=t.slots,i=useConfigInject("space",e),o=i.prefixCls,r=i.space,s=i.direction,a=useFlexGapSupport(),l=computed((function(){var t,n,i;return null!==(i=null!==(t=e.size)&&void 0!==t?t:null===(n=r.value)||void 0===n?void 0:n.size)&&void 0!==i?i:"small"})),c=ref(),d=ref();watch(l,(function(){var e=_slicedToArray$2((Array.isArray(l.value)?l.value:[l.value,l.value]).map((function(e){return getNumberSize(e)})),2);c.value=e[0],d.value=e[1]}),{immediate:!0});var u=computed((function(){return void 0===e.align&&"horizontal"===e.direction?"center":e.align})),h=computed((function(){var t;return classNames(o.value,"".concat(o.value,"-").concat(e.direction),(_defineProperty$P(t={},"".concat(o.value,"-rtl"),"rtl"===s.value),_defineProperty$P(t,"".concat(o.value,"-align-").concat(u.value),u.value),t))})),g=computed((function(){return"rtl"===s.value?"marginLeft":"marginRight"})),p=computed((function(){var t={};return a.value&&(t.columnGap="".concat(c.value,"px"),t.rowGap="".concat(d.value,"px")),_extends$1(_extends$1({},t),e.wrap&&{flexWrap:"wrap",marginBottom:"".concat(-d.value,"px")})}));return function(){var t,i,r=e.wrap,s=e.direction,l=void 0===s?"horizontal":s,u=filterEmpty(null===(t=n.default)||void 0===t?void 0:t.call(n)),f=u.length;if(0===f)return null;var m=null===(i=n.split)||void 0===i?void 0:i.call(n),v="".concat(o.value,"-item"),_=c.value,C=f-1;return createVNode("div",{class:h.value,style:p.value},[u.map((function(e,t){var n={};return a.value||("vertical"===l?t<C&&(n={marginBottom:"".concat(_/(m?2:1),"px")}):n=_extends$1(_extends$1({},t<C&&_defineProperty$P({},g.value,"".concat(_/(m?2:1),"px"))),r&&{paddingBottom:"".concat(d.value,"px")})),createVNode(Fragment,null,[createVNode("div",{class:v,style:n},[e]),t<C&&m&&createVNode("span",{class:"".concat(v,"-split"),style:n},[m])])}))])}}}),__unplugin_components_2=withInstall(Space),SwitchSizes=tuple("small","default"),switchProps=function(){return{id:String,prefixCls:String,size:PropTypes$1.oneOf(SwitchSizes),disabled:{type:Boolean,default:void 0},checkedChildren:PropTypes$1.any,unCheckedChildren:PropTypes$1.any,tabindex:PropTypes$1.oneOfType([PropTypes$1.string,PropTypes$1.number]),autofocus:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},checked:PropTypes$1.oneOfType([PropTypes$1.string,PropTypes$1.number,PropTypes$1.looseBool]),checkedValue:PropTypes$1.oneOfType([PropTypes$1.string,PropTypes$1.number,PropTypes$1.looseBool]).def(!0),unCheckedValue:PropTypes$1.oneOfType([PropTypes$1.string,PropTypes$1.number,PropTypes$1.looseBool]).def(!1),onChange:{type:Function},onClick:{type:Function},onKeydown:{type:Function},onMouseup:{type:Function},"onUpdate:checked":{type:Function},onBlur:Function,onFocus:Function}},Switch=defineComponent({name:"ASwitch",__ANT_SWITCH:!0,inheritAttrs:!1,props:switchProps(),slots:["checkedChildren","unCheckedChildren"],setup:function(e,t){var n=t.attrs,i=t.slots,o=t.expose,r=t.emit,s=useInjectFormItemContext();onBeforeMount((function(){warning$2(!("defaultChecked"in n),"Switch","'defaultChecked' is deprecated, please use 'v-model:checked'"),warning$2(!("value"in n),"Switch","`value` is not validate prop, do you mean `checked`?")}));var a=ref(void 0!==e.checked?e.checked:n.defaultChecked),l=computed((function(){return a.value===e.checkedValue}));watch((function(){return e.checked}),(function(){a.value=e.checked}));var c=useConfigInject("switch",e),d=c.prefixCls,u=c.direction,h=c.size,g=ref(),p=function(){var e;null===(e=g.value)||void 0===e||e.focus()};o({focus:p,blur:function(){var e;null===(e=g.value)||void 0===e||e.blur()}}),onMounted((function(){nextTick((function(){e.autofocus&&!e.disabled&&g.value.focus()}))}));var f=function(t,n){e.disabled||(r("update:checked",t),r("change",t,n),s.onFieldChange())},m=function(e){r("blur",e)},v=function(t){p();var n=l.value?e.unCheckedValue:e.checkedValue;f(n,t),r("click",n,t)},_=function(t){t.keyCode===KeyCode$3.LEFT?f(e.unCheckedValue,t):t.keyCode===KeyCode$3.RIGHT&&f(e.checkedValue,t),r("keydown",t)},C=function(e){var t;null===(t=g.value)||void 0===t||t.blur(),r("mouseup",e)},b=computed((function(){var t;return _defineProperty$P(t={},"".concat(d.value,"-small"),"small"===h.value),_defineProperty$P(t,"".concat(d.value,"-loading"),e.loading),_defineProperty$P(t,"".concat(d.value,"-checked"),l.value),_defineProperty$P(t,"".concat(d.value,"-disabled"),e.disabled),_defineProperty$P(t,d.value,!0),_defineProperty$P(t,"".concat(d.value,"-rtl"),"rtl"===u.value),t}));return function(){var t;return createVNode(Wave,{insertExtraNode:!0},{default:function(){return[createVNode("button",_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},omit$2(e,["prefixCls","checkedChildren","unCheckedChildren","checked","autofocus","checkedValue","unCheckedValue","id","onChange","onUpdate:checked"])),n),{},{id:null!==(t=e.id)&&void 0!==t?t:s.id.value,onKeydown:_,onClick:v,onBlur:m,onMouseup:C,type:"button",role:"switch","aria-checked":a.value,disabled:e.disabled||e.loading,class:[n.class,b.value],ref:g}),[createVNode("div",{class:"".concat(d.value,"-handle")},[e.loading?createVNode(LoadingOutlined$1,{class:"".concat(d.value,"-loading-icon")},null):null]),createVNode("span",{class:"".concat(d.value,"-inner")},[l.value?getPropsSlot(i,e,"checkedChildren"):getPropsSlot(i,e,"unCheckedChildren")])])]}})}}}),__unplugin_components_0$1=withInstall(Switch),TableContextKey=Symbol("TableContextProps"),useProvideTable=function(e){provide(TableContextKey,e)},useInjectTable=function(){return inject(TableContextKey,{})},INTERNAL_KEY_PREFIX="RC_TABLE_KEY";function toArray$2(e){return null==e?[]:Array.isArray(e)?e:[e]}function getPathValue(e,t){if(!t&&"number"!=typeof t)return e;for(var n=toArray$2(t),i=e,o=0;o<n.length;o+=1){if(!i)return null;i=i[n[o]]}return i}function getColumnsKey(e){var t=[],n={};return e.forEach((function(e){for(var i=e||{},o=i.key,r=i.dataIndex,s=o||toArray$2(r).join("-")||INTERNAL_KEY_PREFIX;n[s];)s="".concat(s,"_next");n[s]=!0,t.push(s)})),t}function mergeObject(){var e={};function t(e,n){n&&Object.keys(n).forEach((function(i){var o=n[i];o&&"object"===_typeof$3(o)?(e[i]=e[i]||{},t(e[i],o)):e[i]=o}))}for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return i.forEach((function(n){t(e,n)})),e}function validateValue(e){return null!=e}var SlotsContextKey=Symbol("SlotsContextProps"),useProvideSlots=function(e){provide(SlotsContextKey,e)},useInjectSlots=function(){return inject(SlotsContextKey,computed((function(){return{}})))},ContextKey$1=Symbol("ContextProps"),useProvideTableContext=function(e){provide(ContextKey$1,e)},useInjectTableContext=function(){return inject(ContextKey$1,{onResizeColumn:function(){}})};globalThis&&globalThis.__rest;var INTERNAL_COL_DEFINE="RC_TABLE_INTERNAL_COL_DEFINE",HoverContextKey=Symbol("HoverContextProps"),useProvideHover=function(e){provide(HoverContextKey,e)},useInjectHover=function(){return inject(HoverContextKey,{startRow:ref(-1),endRow:ref(-1),onHover:function(){}})},supportSticky=ref(!1),useProvideSticky=function(){onMounted((function(){supportSticky.value=supportSticky.value||isStyleSupport("position","sticky")}))},useInjectSticky=function(){return supportSticky},__rest$a=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function inHoverRange(e,t,n,i){return e<=i&&e+t-1>=n}function isRenderCell(e){return e&&"object"===_typeof$3(e)&&!Array.isArray(e)&&!isVNode(e)}var Cell=defineComponent({name:"Cell",props:["prefixCls","record","index","renderIndex","dataIndex","customRender","component","colSpan","rowSpan","fixLeft","fixRight","firstFixLeft","lastFixLeft","firstFixRight","lastFixRight","appendNode","additionalProps","ellipsis","align","rowType","isSticky","column","cellType","transformCellText"],slots:["appendNode"],setup:function(e,t){var n=t.slots,i=useInjectSlots(),o=useInjectHover(),r=o.onHover,s=o.startRow,a=o.endRow,l=computed((function(){var t,n,i,o;return null!==(i=null!==(t=e.colSpan)&&void 0!==t?t:null===(n=e.additionalProps)||void 0===n?void 0:n.colSpan)&&void 0!==i?i:null===(o=e.additionalProps)||void 0===o?void 0:o.colspan})),c=computed((function(){var t,n,i,o;return null!==(i=null!==(t=e.rowSpan)&&void 0!==t?t:null===(n=e.additionalProps)||void 0===n?void 0:n.rowSpan)&&void 0!==i?i:null===(o=e.additionalProps)||void 0===o?void 0:o.rowspan})),d=eagerComputed((function(){return inHoverRange(e.index,c.value||1,s.value,a.value)})),u=useInjectSticky(),h=function(t){var n,i=e.record,o=e.additionalProps;i&&r(-1,-1),null===(n=null==o?void 0:o.onMouseleave)||void 0===n||n.call(o,t)},g=function e(t){var n=filterEmpty(t)[0];return isVNode(n)?n.type===Text$1?n.children:Array.isArray(n.children)?e(n.children):void 0:n};return function(){var t,o,s,a,p,f,m,v,_,C=e.prefixCls,b=e.record,y=e.index,S=e.renderIndex,w=e.dataIndex,E=e.customRender,x=e.component,T=void 0===x?"td":x,I=e.fixLeft,k=e.fixRight,L=e.firstFixLeft,D=e.lastFixLeft,N=e.firstFixRight,O=e.lastFixRight,A=e.appendNode,P=void 0===A?null===(o=n.appendNode)||void 0===o?void 0:o.call(n):A,R=e.additionalProps,M=void 0===R?{}:R,$=e.ellipsis,F=e.align,B=e.rowType,V=e.isSticky,W=e.column,H=void 0===W?{}:W,z=e.cellType,K="".concat(C,"-cell"),j=null===(s=n.default)||void 0===s?void 0:s.call(n);if(validateValue(j)||"header"===z)_=j;else{var U=getPathValue(b,w);if(_=U,E){var G=E({text:U,value:U,record:b,index:y,renderIndex:S,column:H.__originColumn__});isRenderCell(G)?(_=G.children,v=G.props):_=G}if(!(INTERNAL_COL_DEFINE in H)&&"body"===z&&i.value.bodyCell&&!(null===(a=H.slots)||void 0===a?void 0:a.customRender)){var q=renderSlot(i.value,"bodyCell",{text:U,value:U,record:b,index:y,column:H.__originColumn__},(function(){var e=void 0===_?U:_;return["object"===_typeof$3(e)&&isValidElement(e)||"object"!==_typeof$3(e)?e:null]}));_=flattenChildren(q)}e.transformCellText&&(_=e.transformCellText({text:_,record:b,index:y,column:H.__originColumn__}))}"object"!==_typeof$3(_)||Array.isArray(_)||isVNode(_)||(_=null),$&&(D||N)&&(_=createVNode("span",{class:"".concat(K,"-content")},[_])),Array.isArray(_)&&1===_.length&&(_=_[0]);var Y=v||{},X=Y.colSpan,Z=Y.rowSpan,Q=Y.style,J=Y.class,ee=__rest$a(Y,["colSpan","rowSpan","style","class"]),te=null!==(p=void 0!==X?X:l.value)&&void 0!==p?p:1,ne=null!==(f=void 0!==Z?Z:c.value)&&void 0!==f?f:1;if(0===te||0===ne)return null;var ie={},oe="number"==typeof I&&u.value,re="number"==typeof k&&u.value;oe&&(ie.position="sticky",ie.left="".concat(I,"px")),re&&(ie.position="sticky",ie.right="".concat(k,"px"));var se,ae={};F&&(ae.textAlign=F);var le=!0===$?{showTitle:!0}:$;le&&(le.showTitle||"header"===B)&&("string"==typeof _||"number"==typeof _?se=_.toString():isVNode(_)&&(se=g([_])));var ce=_extends$1(_extends$1(_extends$1({title:se},ee),M),{colSpan:1!==te?te:null,rowSpan:1!==ne?ne:null,class:classNames(K,(t={},_defineProperty$P(t,"".concat(K,"-fix-left"),oe&&u.value),_defineProperty$P(t,"".concat(K,"-fix-left-first"),L&&u.value),_defineProperty$P(t,"".concat(K,"-fix-left-last"),D&&u.value),_defineProperty$P(t,"".concat(K,"-fix-right"),re&&u.value),_defineProperty$P(t,"".concat(K,"-fix-right-first"),N&&u.value),_defineProperty$P(t,"".concat(K,"-fix-right-last"),O&&u.value),_defineProperty$P(t,"".concat(K,"-ellipsis"),$),_defineProperty$P(t,"".concat(K,"-with-append"),P),_defineProperty$P(t,"".concat(K,"-fix-sticky"),(oe||re)&&V&&u.value),_defineProperty$P(t,"".concat(K,"-row-hover"),!v&&d.value),t),M.class,J),onMouseenter:function(t){!function(t,n){var i,o=e.record,s=e.index,a=e.additionalProps;o&&r(s,s+n-1),null===(i=null==a?void 0:a.onMouseenter)||void 0===i||i.call(a,t)}(t,ne)},onMouseleave:h,style:_extends$1(_extends$1(_extends$1(_extends$1({},parseStyleText(M.style)),ae),ie),Q)});return createVNode(T,ce,{default:function(){return[P,_,null===(m=n.dragHandle)||void 0===m?void 0:m.call(n)]}})}}});function getCellFixedInfo(e,t,n,i,o){var r,s,a=n[e]||{},l=n[t]||{};"left"===a.fixed?r=i.left[e]:"right"===l.fixed&&(s=i.right[t]);var c=!1,d=!1,u=!1,h=!1,g=n[t+1],p=n[e-1];if("rtl"===o){if(void 0!==r)h=!(p&&"left"===p.fixed);else if(void 0!==s){u=!(g&&"right"===g.fixed)}}else if(void 0!==r){c=!(g&&"left"===g.fixed)}else if(void 0!==s){d=!(p&&"right"===p.fixed)}return{fixLeft:r,fixRight:s,lastFixLeft:c,firstFixRight:d,lastFixRight:u,firstFixLeft:h,isSticky:i.isSticky}}var events={mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"},touch:{start:"touchstart",move:"touchmove",stop:"touchend"}},defaultMinWidth=50,DragHandleVue=defineComponent({name:"DragHandle",props:{prefixCls:String,width:{type:Number,required:!0},minWidth:{type:Number,default:defaultMinWidth},maxWidth:{type:Number,default:Infinity},column:{type:Object,default:void 0}},setup:function(e){var t=0,n={remove:function(){}},i={remove:function(){}},o=function(){n.remove(),i.remove()};onUnmounted((function(){o()})),watchEffect((function(){devWarning(!isNaN(e.width),"Table","width must be a number when use resizable")}));var r,s=useInjectTableContext().onResizeColumn,a=computed((function(){return"number"!=typeof e.minWidth||isNaN(e.minWidth)?defaultMinWidth:e.minWidth})),l=computed((function(){return"number"!=typeof e.maxWidth||isNaN(e.maxWidth)?Infinity:e.maxWidth})),c=getCurrentInstance(),d=0,u=ref(!1),h=function(n){var i=0;i=n.touches?n.touches.length?n.touches[0].pageX:n.changedTouches[0].pageX:n.pageX;var o=t-i,c=Math.max(d-o,a.value);c=Math.min(c,l.value),wrapperRaf.cancel(r),r=wrapperRaf((function(){s(c,e.column.__originColumn__)}))},g=function(e){h(e)},p=function(e){u.value=!1,h(e),o()},f=function(e,r){u.value=!0,o(),d=c.vnode.el.parentNode.getBoundingClientRect().width,e instanceof MouseEvent&&1!==e.which||(e.stopPropagation&&e.stopPropagation(),t=e.touches?e.touches[0].pageX:e.pageX,n=addEventListenerWrap(document.documentElement,r.move,g),i=addEventListenerWrap(document.documentElement,r.stop,p))},m=function(e){e.stopPropagation(),e.preventDefault(),f(e,events.mouse)},v=function(e){e.stopPropagation(),e.preventDefault()};return function(){var t=e.prefixCls,n=_defineProperty$P({},supportsPassive$1?"onTouchstartPassive":"onTouchstart",(function(e){return function(e){e.stopPropagation(),e.preventDefault(),f(e,events.touch)}(e)}));return createVNode("div",_objectSpread2$1(_objectSpread2$1({class:"".concat(t,"-resize-handle ").concat(u.value?"dragging":""),onMousedown:m},n),{},{onClick:v}),[createVNode("div",{class:"".concat(t,"-resize-handle-line")},null)])}}}),HeaderRow=defineComponent({name:"HeaderRow",props:["cells","stickyOffsets","flattenColumns","rowComponent","cellComponent","index","customHeaderRow"],setup:function(e){var t=useInjectTable();return function(){var n,i=t.prefixCls,o=t.direction,r=e.cells,s=e.stickyOffsets,a=e.flattenColumns,l=e.rowComponent,c=e.cellComponent,d=e.customHeaderRow,u=e.index;d&&(n=d(r.map((function(e){return e.column})),u));var h=getColumnsKey(r.map((function(e){return e.column})));return createVNode(l,n,{default:function(){return[r.map((function(e,t){var n,r=e.column,l=getCellFixedInfo(e.colStart,e.colEnd,a,s,o);r&&r.customHeaderCell&&(n=e.column.customHeaderCell(r));var d=r;return createVNode(Cell,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},e),{},{cellType:"header",ellipsis:r.ellipsis,align:r.align,component:c,prefixCls:i,key:h[t]},l),{},{additionalProps:n,rowType:"header",column:r}),{default:function(){return r.title},dragHandle:function(){return d.resizable?createVNode(DragHandleVue,{prefixCls:i,width:d.width,minWidth:d.minWidth,maxWidth:d.maxWidth,column:d},null):null}})}))]}})}}});function parseHeaderRows(e){var t=[];!function e(n,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t[o]=t[o]||[];var r=i,s=n.filter(Boolean).map((function(n){var i={key:n.key,class:classNames(n.className,n.class),column:n,colStart:r},s=1,a=n.children;return a&&a.length>0&&(s=e(a,r,o+1).reduce((function(e,t){return e+t}),0),i.hasSubColumns=!0),"colSpan"in n&&(s=n.colSpan),"rowSpan"in n&&(i.rowSpan=n.rowSpan),i.colSpan=s,i.colEnd=i.colStart+s-1,t[o].push(i),r+=s,s}));return s}(e,0);for(var n=t.length,i=function(e){t[e].forEach((function(t){"rowSpan"in t||t.hasSubColumns||(t.rowSpan=n-e)}))},o=0;o<n;o+=1)i(o);return t}var Header=defineComponent({name:"Header",inheritAttrs:!1,props:["columns","flattenColumns","stickyOffsets","customHeaderRow"],setup:function(e){var t=useInjectTable(),n=computed((function(){return parseHeaderRows(e.columns)}));return function(){var i=t.prefixCls,o=t.getComponent,r=e.stickyOffsets,s=e.flattenColumns,a=e.customHeaderRow,l=o(["header","wrapper"],"thead"),c=o(["header","row"],"tr"),d=o(["header","cell"],"th");return createVNode(l,{class:"".concat(i,"-thead")},{default:function(){return[n.value.map((function(e,t){return createVNode(HeaderRow,{key:t,flattenColumns:s,cells:e,stickyOffsets:r,rowComponent:c,cellComponent:d,customHeaderRow:a,index:t},null)}))]}})}}}),ExpandedRowContextKey=Symbol("ExpandedRowProps"),useProvideExpandedRow=function(e){provide(ExpandedRowContextKey,e)},useInjectExpandedRow=function(){return inject(ExpandedRowContextKey,{})},ExpandedRow=defineComponent({name:"ExpandedRow",inheritAttrs:!1,props:["prefixCls","component","cellComponent","expanded","colSpan","isEmpty"],setup:function(e,t){var n=t.slots,i=t.attrs,o=useInjectTable(),r=useInjectExpandedRow(),s=r.fixHeader,a=r.fixColumn,l=r.componentWidth,c=r.horizonScroll;return function(){var t=e.prefixCls,r=e.component,d=e.cellComponent,u=e.expanded,h=e.colSpan,g=e.isEmpty;return createVNode(r,{class:i.class,style:{display:u?null:"none"}},{default:function(){return[createVNode(Cell,{component:d,prefixCls:t,colSpan:h},{default:function(){var e,i=null===(e=n.default)||void 0===e?void 0:e.call(n);return(g?c.value:a.value)&&(i=createVNode("div",{style:{width:"".concat(l.value-(s.value?o.scrollbarSize:0),"px"),position:"sticky",left:0,overflow:"hidden"},class:"".concat(t,"-expanded-row-fixed")},[i])),i}})]}})}}}),MeasureCell=defineComponent({name:"MeasureCell",props:["columnKey"],setup:function(e,t){var n=t.emit,i=ref();return onMounted((function(){i.value&&n("columnResize",e.columnKey,i.value.offsetWidth)})),function(){return createVNode(ResizeObserver$1,{onResize:function(t){var i=t.offsetWidth;n("columnResize",e.columnKey,i)}},{default:function(){return[createVNode("td",{ref:i,style:{padding:0,border:0,height:0}},[createVNode("div",{style:{height:0,overflow:"hidden"}},[createTextVNode(" ")])])]}})}}}),BodyContextKey=Symbol("BodyContextProps"),useProvideBody=function(e){provide(BodyContextKey,e)},useInjectBody=function(){return inject(BodyContextKey,{})},BodyRow=defineComponent({name:"BodyRow",inheritAttrs:!1,props:["record","index","renderIndex","recordKey","expandedKeys","rowComponent","cellComponent","customRow","rowExpandable","indent","rowKey","getRowKey","childrenColumnName"],setup:function(e,t){var n=t.attrs,i=useInjectTable(),o=useInjectBody(),r=ref(!1),s=computed((function(){return e.expandedKeys&&e.expandedKeys.has(e.recordKey)}));watchEffect((function(){s.value&&(r.value=!0)}));var a=computed((function(){return"row"===o.expandableType&&(!e.rowExpandable||e.rowExpandable(e.record))})),l=computed((function(){return"nest"===o.expandableType})),c=computed((function(){return e.childrenColumnName&&e.record&&e.record[e.childrenColumnName]})),d=computed((function(){return a.value||l.value})),u=function(e,t){o.onTriggerExpand(e,t)},h=computed((function(){var t;return(null===(t=e.customRow)||void 0===t?void 0:t.call(e,e.record,e.index))||{}})),g=function(t){var n,i,r;o.expandRowByClick&&d.value&&u(e.record,t);for(var s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];null===(r=null===(i=h.value)||void 0===i?void 0:i.onClick)||void 0===r||(n=r).call.apply(n,[i,t].concat(a))},p=computed((function(){var t=e.record,n=e.index,i=e.indent,r=o.rowClassName;return"string"==typeof r?r:"function"==typeof r?r(t,n,i):""})),f=computed((function(){return getColumnsKey(o.flattenColumns)}));return function(){var t,d=n.class,m=n.style,v=e.record,_=e.index,C=e.rowKey,b=e.indent,y=void 0===b?0:b,S=e.rowComponent,w=e.cellComponent,E=i.prefixCls,x=i.fixedInfoList,T=i.transformCellText,I=o.flattenColumns,k=o.expandedRowClassName,L=o.indentSize,D=o.expandIcon,N=o.expandedRowRender,O=o.expandIconColumnIndex,A=createVNode(S,_objectSpread2$1(_objectSpread2$1({},h.value),{},{"data-row-key":C,class:classNames(d,"".concat(E,"-row"),"".concat(E,"-row-level-").concat(y),p.value,h.value.class),style:_extends$1(_extends$1({},m),parseStyleText(h.value.style)),onClick:g}),{default:function(){return[I.map((function(t,n){var i,o=t.customRender,r=t.dataIndex,a=t.className,d=f[n],h=x[n];t.customCell&&(i=t.customCell(v,_,t));var g=n===(O||0)&&l.value?createVNode(Fragment,null,[createVNode("span",{style:{paddingLeft:"".concat(L*y,"px")},class:"".concat(E,"-row-indent indent-level-").concat(y)},null),D({prefixCls:E,expanded:s.value,expandable:c.value,record:v,onExpand:u})]):null;return createVNode(Cell,_objectSpread2$1(_objectSpread2$1({cellType:"body",class:a,ellipsis:t.ellipsis,align:t.align,component:w,prefixCls:E,key:d,record:v,index:_,renderIndex:e.renderIndex,dataIndex:r,customRender:o},h),{},{additionalProps:i,column:t,transformCellText:T,appendNode:g}),null)}))]}});if(a.value&&(r.value||s.value)){var P=N({record:v,index:_,indent:y+1,expanded:s.value}),R=k&&k(v,_,y);t=createVNode(ExpandedRow,{expanded:s.value,class:classNames("".concat(E,"-expanded-row"),"".concat(E,"-expanded-row-level-").concat(y+1),R),prefixCls:E,component:S,cellComponent:w,colSpan:I.length,isEmpty:!1},{default:function(){return[P]}})}return createVNode(Fragment,null,[A,t])}}});function flatRecord(e,t,n,i,o,r){var s=[];s.push({record:e,indent:t,index:r});var a=o(e),l=null==i?void 0:i.has(a);if(e&&Array.isArray(e[n])&&l)for(var c=0;c<e[n].length;c+=1){var d=flatRecord(e[n][c],t+1,n,i,o,c);s.push.apply(s,_toConsumableArray$2(d))}return s}function useFlattenRecords(e,t,n,i){return computed((function(){var o=t.value,r=n.value,s=e.value;if(null==r?void 0:r.size){for(var a=[],l=0;l<(null==s?void 0:s.length);l+=1){var c=s[l];a.push.apply(a,_toConsumableArray$2(flatRecord(c,0,o,r,i.value,l)))}return a}return null==s?void 0:s.map((function(e,t){return{record:e,indent:0,index:t}}))}))}var ResizeContextKey=Symbol("ResizeContextProps"),useProvideResize=function(e){provide(ResizeContextKey,e)},useInjectResize=function(){return inject(ResizeContextKey,{onColumnResize:function(){}})},Body=defineComponent({name:"Body",props:["data","getRowKey","measureColumnWidth","expandedKeys","customRow","rowExpandable","childrenColumnName"],slots:["emptyNode"],setup:function(e,t){var n,i=t.slots,o=useInjectResize(),r=useInjectTable(),s=useInjectBody(),a=useFlattenRecords(toRef(e,"data"),toRef(e,"childrenColumnName"),toRef(e,"expandedKeys"),toRef(e,"getRowKey")),l=ref(-1),c=ref(-1);return useProvideHover({startRow:l,endRow:c,onHover:function(e,t){clearTimeout(n),n=setTimeout((function(){l.value=e,c.value=t}),100)}}),function(){var t,n,l=e.data,c=e.getRowKey,d=e.measureColumnWidth,u=e.expandedKeys,h=e.customRow,g=e.rowExpandable,p=e.childrenColumnName,f=o.onColumnResize,m=r.prefixCls,v=r.getComponent,_=s.flattenColumns,C=v(["body","wrapper"],"tbody"),b=v(["body","row"],"tr"),y=v(["body","cell"],"td");n=l.length?a.value.map((function(e,t){var n=e.record,i=e.indent,o=e.index,r=c(n,t);return createVNode(BodyRow,{key:r,rowKey:r,record:n,recordKey:r,index:t,renderIndex:o,rowComponent:b,cellComponent:y,expandedKeys:u,customRow:h,getRowKey:c,rowExpandable:g,childrenColumnName:p,indent:i},null)})):createVNode(ExpandedRow,{expanded:!0,class:"".concat(m,"-placeholder"),prefixCls:m,component:b,cellComponent:y,colSpan:_.length,isEmpty:!0},{default:function(){return[null===(t=i.emptyNode)||void 0===t?void 0:t.call(i)]}});var S=getColumnsKey(_);return createVNode(C,{class:"".concat(m,"-tbody")},{default:function(){return[d&&createVNode("tr",{"aria-hidden":"true",class:"".concat(m,"-measure-row"),style:{height:0,fontSize:0}},[S.map((function(e){return createVNode(MeasureCell,{key:e,columnKey:e,onColumnResize:f},null)}))]),n]}})}}}),EXPAND_COLUMN={},__rest$9=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function flatColumns(e){return e.reduce((function(e,t){var n=t.fixed,i=!0===n?"left":n,o=t.children;return o&&o.length>0?[].concat(_toConsumableArray$2(e),_toConsumableArray$2(flatColumns(o).map((function(e){return _extends$1({fixed:i},e)})))):[].concat(_toConsumableArray$2(e),[_extends$1(_extends$1({},t),{fixed:i})])}),[])}function revertForRtl(e){return e.map((function(e){var t=e.fixed,n=t;return"left"===t?n="right":"right"===t&&(n="left"),_extends$1({fixed:n},__rest$9(e,["fixed"]))}))}function useColumns$1(e,t){var n=e.prefixCls,i=e.columns,o=e.expandable,r=e.expandedKeys,s=e.getRowKey,a=e.onTriggerExpand,l=e.expandIcon,c=e.rowExpandable,d=e.expandIconColumnIndex,u=e.direction,h=e.expandRowByClick,g=e.expandColumnWidth,p=e.expandFixed,f=computed((function(){if(o.value){var e,t=i.value.slice();if(!t.includes(EXPAND_COLUMN)){var u=d.value||0;u>=0&&t.splice(u,0,EXPAND_COLUMN)}var f=t.indexOf(EXPAND_COLUMN);t=t.filter((function(e,t){return e!==EXPAND_COLUMN||t===f}));var m,v=i.value[f];m="left"!==p.value&&!p.value||d.value?"right"!==p.value&&!p.value||d.value!==i.value.length?v?v.fixed:null:"right":"left";var _=r.value,C=c.value,b=l.value,y=n.value,S=h.value,w=(_defineProperty$P(e={},INTERNAL_COL_DEFINE,{class:"".concat(n.value,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),_defineProperty$P(e,"title",""),_defineProperty$P(e,"fixed",m),_defineProperty$P(e,"class","".concat(n.value,"-row-expand-icon-cell")),_defineProperty$P(e,"width",g.value),_defineProperty$P(e,"customRender",(function(e){var t=e.record,n=e.index,i=s.value(t,n),o=_.has(i),r=!C||C(t),l=b({prefixCls:y,expanded:o,expandable:r,record:t,onExpand:a});return S?createVNode("span",{onClick:function(e){return e.stopPropagation()}},[l]):l})),e);return t.map((function(e){return e===EXPAND_COLUMN?w:e}))}return i.value.filter((function(e){return e!==EXPAND_COLUMN}))})),m=computed((function(){var e=f.value;return t.value&&(e=t.value(e)),e.length||(e=[{customRender:function(){return null}}]),e})),v=computed((function(){return"rtl"===u.value?revertForRtl(flatColumns(m.value)):flatColumns(m.value)}));return[m,v]}function useLayoutState(e){var t,n=shallowRef(e),i=shallowRef([]);return onBeforeUnmount((function(){wrapperRaf.cancel(t)})),[n,function(e){i.value.push(e),wrapperRaf.cancel(t),t=wrapperRaf((function(){var e=i.value;i.value=[],e.forEach((function(e){n.value=e(n.value)}))}))}]}function useTimeoutLock(e){var t=ref(e||null),n=ref();function i(){clearTimeout(n.value)}return onBeforeUnmount((function(){i()})),[function(e){t.value=e,i(),n.value=setTimeout((function(){t.value=null,n.value=void 0}),100)},function(){return t.value}]}function useStickyOffsets(e,t,n){return computed((function(){for(var i=[],o=[],r=0,s=0,a=e.value,l=t.value,c=n.value,d=0;d<l;d+=1)if("rtl"===c){o[d]=s,s+=a[d]||0;var u=l-d-1;i[u]=r,r+=a[u]||0}else{i[d]=r,r+=a[d]||0;var h=l-d-1;o[h]=s,s+=a[h]||0}return{left:i,right:o}}))}var __rest$8=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function ColGroup(e){for(var t=e.colWidths,n=e.columns,i=[],o=!1,r=(e.columCount||n.length)-1;r>=0;r-=1){var s=t[r],a=n&&n[r],l=a&&a[INTERNAL_COL_DEFINE];if(s||l||o){var c=l||{};c.columnType;var d=__rest$8(c,["columnType"]);i.unshift(createVNode("col",_objectSpread2$1({key:r,style:{width:"number"==typeof s?"".concat(s,"px"):s}},d),null)),o=!0}}return createVNode("colgroup",null,[i])}function Panel(e,t){var n,i=t.slots;return createVNode("div",null,[null===(n=i.default)||void 0===n?void 0:n.call(i)])}Panel.displayName="Panel";var indexGuid=0,Summary=defineComponent({name:"Summary",props:["fixed"],setup:function(e,t){var n=t.slots,i=useInjectTable(),o="table-summary-uni-key-".concat(++indexGuid),r=computed((function(){return""===e.fixed||e.fixed}));return watchEffect((function(){i.summaryCollect(o,r.value)})),onBeforeUnmount((function(){i.summaryCollect(o,!1)})),function(){var e;return null===(e=n.default)||void 0===e?void 0:e.call(n)}}}),Summary$1=Summary,SummaryRow=defineComponent({name:"FooterRow",setup:function(e,t){var n=t.slots;return function(){var e;return createVNode("tr",null,[null===(e=n.default)||void 0===e?void 0:e.call(n)])}}}),SummaryContextKey=Symbol("SummaryContextProps"),useProvideSummary=function(e){provide(SummaryContextKey,e)},useInjectSummary=function(){return inject(SummaryContextKey,{})},SummaryCell=defineComponent({name:"SummaryCell",props:["index","colSpan","rowSpan","align"],setup:function(e,t){var n=t.attrs,i=t.slots,o=useInjectTable(),r=useInjectSummary();return function(){var t=e.index,s=e.colSpan,a=void 0===s?1:s,l=e.rowSpan,c=e.align,d=o.prefixCls,u=o.direction,h=r.scrollColumnIndex,g=r.stickyOffsets,p=t+a-1+1===h?a+1:a,f=getCellFixedInfo(t,t+p-1,r.flattenColumns,g,u);return createVNode(Cell,_objectSpread2$1({class:n.class,index:t,component:"td",prefixCls:d,record:null,dataIndex:null,align:c,colSpan:p,rowSpan:l,customRender:function(){var e;return null===(e=i.default)||void 0===e?void 0:e.call(i)}},f),null)}}}),Footer=defineComponent({name:"Footer",inheritAttrs:!1,props:["stickyOffsets","flattenColumns"],setup:function(e,t){var n=t.slots,i=useInjectTable();return useProvideSummary(reactive({stickyOffsets:toRef(e,"stickyOffsets"),flattenColumns:toRef(e,"flattenColumns"),scrollColumnIndex:computed((function(){var t=e.flattenColumns.length-1,n=e.flattenColumns[t];return(null==n?void 0:n.scrollbar)?t:null}))})),function(){var e,t=i.prefixCls;return createVNode("tfoot",{class:"".concat(t,"-summary")},[null===(e=n.default)||void 0===e?void 0:e.call(n)])}}}),FooterComponents=Summary$1;function renderExpandIcon$1(e){var t,n=e.prefixCls,i=e.record,o=e.onExpand,r=e.expanded,s=e.expandable,a="".concat(n,"-row-expand-icon");if(!s)return createVNode("span",{class:[a,"".concat(n,"-row-spaced")]},null);return createVNode("span",{class:(t={},_defineProperty$P(t,a,!0),_defineProperty$P(t,"".concat(n,"-row-expanded"),r),_defineProperty$P(t,"".concat(n,"-row-collapsed"),!r),t),onClick:function(e){o(i,e),e.stopPropagation()}},null)}function findAllChildrenKeys(e,t,n){var i=[];return function e(o){(o||[]).forEach((function(o,r){i.push(t(o,r)),e(o[n])}))}(e),i}var StickyScrollBar=defineComponent({name:"StickyScrollBar",inheritAttrs:!1,props:["offsetScroll","container","scrollBodyRef","scrollBodySizeInfo"],emits:["scroll"],setup:function(e,t){var n=t.emit,i=t.expose,o=useInjectTable(),r=ref(0),s=ref(0),a=ref(0);watchEffect((function(){r.value=e.scrollBodySizeInfo.scrollWidth||0,s.value=e.scrollBodySizeInfo.clientWidth||0,a.value=r.value&&s.value*(s.value/r.value)}),{flush:"post"});var l=ref(),c=_slicedToArray$2(useLayoutState({scrollLeft:0,isHiddenScrollBar:!0}),2),d=c[0],u=c[1],h=ref({delta:0,x:0}),g=ref(!1),p=function(){g.value=!1},f=function(e){h.value={delta:e.pageX-d.value.scrollLeft,x:0},g.value=!0,e.preventDefault()},m=function(e){var t=(e||(null===window||void 0===window?void 0:window.event)).buttons;if(g.value&&0!==t){var i=h.value.x+e.pageX-h.value.x-h.value.delta;i<=0&&(i=0),i+a.value>=s.value&&(i=s.value-a.value),n("scroll",{scrollLeft:i/s.value*(r.value+2)}),h.value.x=e.pageX}else g.value&&(g.value=!1)},v=function(){if(e.scrollBodyRef.value){var t=getOffset(e.scrollBodyRef.value).top,n=t+e.scrollBodyRef.value.offsetHeight,i=e.container===window?document.documentElement.scrollTop+window.innerHeight:getOffset(e.container).top+e.container.clientHeight;n-getScrollBarSize()<=i||t>=i-e.offsetScroll?u((function(e){return _extends$1(_extends$1({},e),{isHiddenScrollBar:!0})})):u((function(e){return _extends$1(_extends$1({},e),{isHiddenScrollBar:!1})}))}};i({setScrollLeft:function(e){u((function(t){return _extends$1(_extends$1({},t),{scrollLeft:e/r.value*s.value||0})}))}});var _=null,C=null,b=null,y=null;onMounted((function(){_=addEventListenerWrap(document.body,"mouseup",p,!1),C=addEventListenerWrap(document.body,"mousemove",m,!1),b=addEventListenerWrap(window,"resize",v,!1)})),onActivated((function(){nextTick((function(){v()}))})),onMounted((function(){setTimeout((function(){watch([a,g],(function(){v()}),{immediate:!0,flush:"post"})}))})),watch((function(){return e.container}),(function(){null==y||y.remove(),y=addEventListenerWrap(e.container,"scroll",v,!1)}),{immediate:!0,flush:"post"}),onBeforeUnmount((function(){null==_||_.remove(),null==C||C.remove(),null==y||y.remove(),null==b||b.remove()})),watch((function(){return _extends$1({},d.value)}),(function(t,n){t.isHiddenScrollBar===(null==n?void 0:n.isHiddenScrollBar)||t.isHiddenScrollBar||u((function(t){var n=e.scrollBodyRef.value;return n?_extends$1(_extends$1({},t),{scrollLeft:n.scrollLeft/n.scrollWidth*n.clientWidth}):t}))}),{immediate:!0});var S=getScrollBarSize();return function(){if(r.value<=s.value||!a.value||d.value.isHiddenScrollBar)return null;var t=o.prefixCls;return createVNode("div",{style:{height:"".concat(S,"px"),width:"".concat(s.value,"px"),bottom:"".concat(e.offsetScroll,"px")},class:"".concat(t,"-sticky-scroll")},[createVNode("div",{onMousedown:f,ref:l,class:classNames("".concat(t,"-sticky-scroll-bar"),_defineProperty$P({},"".concat(t,"-sticky-scroll-bar-active"),g)),style:{width:"".concat(a.value,"px"),transform:"translate3d(".concat(d.value.scrollLeft,"px, 0, 0)")}},null)])}}}),defaultContainer=canUseDom()?window:null;function useSticky(e,t){return computed((function(){var n="object"===_typeof$3(e.value)?e.value:{},i=n.offsetHeader,o=void 0===i?0:i,r=n.offsetSummary,s=void 0===r?0:r,a=n.offsetScroll,l=void 0===a?0:a,c=n.getContainer,d=(void 0===c?function(){return defaultContainer}:c)()||defaultContainer,u=!!e.value;return{isSticky:u,stickyClassName:u?"".concat(t.value,"-sticky-holder"):"",offsetHeader:o,offsetSummary:s,offsetScroll:l,container:d}}))}function useColumnWidth(e,t){return computed((function(){for(var n=[],i=e.value,o=t.value,r=0;r<o;r+=1){var s=i[r];if(void 0===s)return null;n[r]=s}return n}))}var FixedHolder=defineComponent({name:"FixedHolder",inheritAttrs:!1,props:["columns","flattenColumns","stickyOffsets","customHeaderRow","noData","maxContentScroll","colWidths","columCount","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName"],emits:["scroll"],setup:function(e,t){var n=t.attrs,i=t.slots,o=t.emit,r=useInjectTable(),s=computed((function(){return r.isSticky&&!e.fixHeader?0:r.scrollbarSize})),a=ref(),l=function(e){var t=e.currentTarget,n=e.deltaX;n&&(o("scroll",{currentTarget:t,scrollLeft:t.scrollLeft+n}),e.preventDefault())},c=ref();onMounted((function(){nextTick((function(){c.value=addEventListenerWrap(a.value,"wheel",l)}))})),onBeforeUnmount((function(){var e;null===(e=c.value)||void 0===e||e.remove()}));var d=computed((function(){return e.flattenColumns.every((function(e){return e.width&&0!==e.width&&"0px"!==e.width}))})),u=ref([]),h=ref([]);watchEffect((function(){var t=e.flattenColumns[e.flattenColumns.length-1],n={fixed:t?t.fixed:null,scrollbar:!0,customHeaderCell:function(){return{class:"".concat(r.prefixCls,"-cell-scrollbar")}}};u.value=s.value?[].concat(_toConsumableArray$2(e.columns),[n]):e.columns,h.value=s.value?[].concat(_toConsumableArray$2(e.flattenColumns),[n]):e.flattenColumns}));var g=computed((function(){var t=e.stickyOffsets,n=e.direction,i=t.right,o=t.left;return _extends$1(_extends$1({},t),{left:"rtl"===n?[].concat(_toConsumableArray$2(o.map((function(e){return e+s.value}))),[0]):o,right:"rtl"===n?i:[].concat(_toConsumableArray$2(i.map((function(e){return e+s.value}))),[0]),isSticky:r.isSticky})})),p=useColumnWidth(toRef(e,"colWidths"),toRef(e,"columCount"));return function(){var t,o=e.noData,l=e.columCount,c=e.stickyTopOffset,f=e.stickyBottomOffset,m=e.stickyClassName,v=e.maxContentScroll,_=r.isSticky;return createVNode("div",{style:_extends$1({overflow:"hidden"},_?{top:"".concat(c,"px"),bottom:"".concat(f,"px")}:{}),ref:a,class:classNames(n.class,_defineProperty$P({},m,!!m))},[createVNode("table",{style:{tableLayout:"fixed",visibility:o||p.value?null:"hidden"}},[(!o||!v||d.value)&&createVNode(ColGroup,{colWidths:p.value?[].concat(_toConsumableArray$2(p.value),[s.value]):[],columCount:l+1,columns:h.value},null),null===(t=i.default)||void 0===t?void 0:t.call(i,_extends$1(_extends$1({},e),{stickyOffsets:g.value,columns:u.value,flattenColumns:h.value}))])])}}});function fromPairs(e){for(var t=-1,n=null==e?0:e.length,i={};++t<n;){var o=e[t];i[o[0]]=o[1]}return i}function reactivePick(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return reactive(fromPairs(n.map((function(t){return[t,toRef(e,t)]}))))}var EMPTY_DATA=[],EMPTY_SCROLL_TARGET={},INTERNAL_HOOKS="rc-table-internal-hook",Table$3=defineComponent({name:"Table",inheritAttrs:!1,props:["prefixCls","data","columns","rowKey","tableLayout","scroll","rowClassName","title","footer","id","showHeader","components","customRow","customHeaderRow","direction","expandFixed","expandColumnWidth","expandedRowKeys","defaultExpandedRowKeys","expandedRowRender","expandRowByClick","expandIcon","onExpand","onExpandedRowsChange","onUpdate:expandedRowKeys","defaultExpandAllRows","indentSize","expandIconColumnIndex","expandedRowClassName","childrenColumnName","rowExpandable","sticky","transformColumns","internalHooks","internalRefs","canExpandable","onUpdateInternalRefs","transformCellText"],slots:["title","footer","summary","emptyText"],emits:["expand","expandedRowsChange","updateInternalRefs","update:expandedRowKeys"],setup:function(e,t){var n=t.attrs,i=t.slots,o=t.emit,r=computed((function(){return e.data||EMPTY_DATA})),s=computed((function(){return!!r.value.length})),a=computed((function(){return mergeObject(e.components,{})})),l=function(e,t){return getPathValue(a.value,e)||t},c=computed((function(){var t=e.rowKey;return"function"==typeof t?t:function(e){return e&&e[t]}})),d=computed((function(){return e.expandIcon||renderExpandIcon$1})),u=computed((function(){return e.childrenColumnName||"children"})),h=computed((function(){return e.expandedRowRender?"row":!(!e.canExpandable&&!r.value.some((function(e){return e&&"object"===_typeof$3(e)&&e[u.value]})))&&"nest"})),g=shallowRef([]);watchEffect((function(){e.defaultExpandedRowKeys&&(g.value=e.defaultExpandedRowKeys),e.defaultExpandAllRows&&(g.value=findAllChildrenKeys(r.value,c.value,u.value))}))();var p=computed((function(){return new Set(e.expandedRowKeys||g.value||[])})),f=function(e){var t,n=c.value(e,r.value.indexOf(e)),i=p.value.has(n);i?(p.value.delete(n),t=_toConsumableArray$2(p.value)):t=[].concat(_toConsumableArray$2(p.value),[n]),g.value=t,o("expand",!i,e),o("update:expandedRowKeys",t),o("expandedRowsChange",t)},m=ref(0),v=_slicedToArray$2(useColumns$1(_extends$1(_extends$1({},toRefs(e)),{expandable:computed((function(){return!!e.expandedRowRender})),expandedKeys:p,getRowKey:c,onTriggerExpand:f,expandIcon:d}),computed((function(){return e.internalHooks===INTERNAL_HOOKS?e.transformColumns:null}))),2),_=v[0],C=v[1],b=computed((function(){return{columns:_.value,flattenColumns:C.value}})),y=ref(),S=ref(),w=ref(),E=ref({scrollWidth:0,clientWidth:0}),x=ref(),T=_slicedToArray$2(useState(!1),2),I=T[0],k=T[1],L=_slicedToArray$2(useState(!1),2),D=L[0],N=L[1],O=_slicedToArray$2(useLayoutState(new Map),2),A=O[0],P=O[1],R=computed((function(){return getColumnsKey(C.value)})),M=computed((function(){return R.value.map((function(e){return A.value.get(e)}))})),$=computed((function(){return C.value.length})),F=useStickyOffsets(M,$,toRef(e,"direction")),B=computed((function(){return e.scroll&&validateValue(e.scroll.y)})),V=computed((function(){return e.scroll&&validateValue(e.scroll.x)||Boolean(e.expandFixed)})),W=computed((function(){return V.value&&C.value.some((function(e){return e.fixed}))})),H=ref(),z=useSticky(toRef(e,"sticky"),toRef(e,"prefixCls")),K=reactive({}),j=computed((function(){var e=Object.values(K)[0];return(B.value||z.value.isSticky)&&e})),U=ref({}),G=ref({}),q=ref({});watchEffect((function(){B.value&&(G.value={overflowY:"scroll",maxHeight:toPx(e.scroll.y)}),V.value&&(U.value={overflowX:"auto"},B.value||(G.value={overflowY:"hidden"}),q.value={width:!0===e.scroll.x?"auto":toPx(e.scroll.x),minWidth:"100%"})}));var Y=_slicedToArray$2(useTimeoutLock(null),2),X=Y[0],Z=Y[1];function Q(e,t){if(t)if("function"!=typeof t){var n=t.$el||t;n.scrollLeft!==e&&(n.scrollLeft=e)}else t(e)}var J,ee=function(t){var n,i=t.currentTarget,o=t.scrollLeft,r="rtl"===e.direction,s="number"==typeof o?o:i.scrollLeft,a=i||EMPTY_SCROLL_TARGET;if(Z()&&Z()!==a||(X(a),Q(s,S.value),Q(s,w.value),Q(s,x.value),Q(s,null===(n=H.value)||void 0===n?void 0:n.setScrollLeft)),i){var l=i.scrollWidth,c=i.clientWidth;r?(k(-s<l-c),N(-s>0)):(k(s>0),N(s<l-c))}},te=function(){V.value&&w.value?ee({currentTarget:w.value}):(k(!1),N(!1))},ne=function(e){e!==m.value&&(te(),m.value=y.value?y.value.offsetWidth:e)},ie=function(e){var t=e.width;clearTimeout(J),0!==m.value?J=setTimeout((function(){ne(t)}),100):ne(t)};watch([V,function(){return e.data},function(){return e.columns}],(function(){V.value&&te()}));var oe=_slicedToArray$2(useState(0),2),re=oe[0],se=oe[1];useProvideSticky(),onMounted((function(){nextTick((function(){var e,t;te(),se(getTargetScrollBarSize(w.value).width),E.value={scrollWidth:(null===(e=w.value)||void 0===e?void 0:e.scrollWidth)||0,clientWidth:(null===(t=w.value)||void 0===t?void 0:t.clientWidth)||0}}))})),onUpdated((function(){nextTick((function(){var e,t,n=(null===(e=w.value)||void 0===e?void 0:e.scrollWidth)||0,i=(null===(t=w.value)||void 0===t?void 0:t.clientWidth)||0;E.value.scrollWidth===n&&E.value.clientWidth===i||(E.value={scrollWidth:n,clientWidth:i})}))})),watchEffect((function(){e.internalHooks===INTERNAL_HOOKS&&e.internalRefs&&e.onUpdateInternalRefs({body:w.value?w.value.$el||w.value:null})}),{flush:"post"});var ae=computed((function(){return e.tableLayout?e.tableLayout:W.value?"max-content"===e.scroll.x?"auto":"fixed":B.value||z.value.isSticky||C.value.some((function(e){return e.ellipsis}))?"fixed":"auto"})),le=function(){var e;return s.value?null:(null===(e=i.emptyText)||void 0===e?void 0:e.call(i))||"No Data"};useProvideTable(reactive(_extends$1(_extends$1({},toRefs(reactivePick(e,"prefixCls","direction","transformCellText"))),{getComponent:l,scrollbarSize:re,fixedInfoList:computed((function(){return C.value.map((function(t,n){return getCellFixedInfo(n,n,C.value,F.value,e.direction)}))})),isSticky:computed((function(){return z.value.isSticky})),summaryCollect:function(e,t){t?K[e]=t:delete K[e]}}))),useProvideBody(reactive(_extends$1(_extends$1({},toRefs(reactivePick(e,"rowClassName","expandedRowClassName","expandRowByClick","expandedRowRender","expandIconColumnIndex","indentSize"))),{columns:_,flattenColumns:C,tableLayout:ae,expandIcon:d,expandableType:h,onTriggerExpand:f}))),useProvideResize({onColumnResize:function(e,t){isVisible(y.value)&&P((function(n){if(n.get(e)!==t){var i=new Map(n);return i.set(e,t),i}return n}))}}),useProvideExpandedRow({componentWidth:m,fixHeader:B,fixColumn:W,horizonScroll:V});var ce=function(){return createVNode(Body,{data:r.value,measureColumnWidth:B.value||V.value||z.value.isSticky,expandedKeys:p.value,rowExpandable:e.rowExpandable,getRowKey:c.value,customRow:e.customRow,childrenColumnName:u.value},{emptyNode:le})},de=function(){return createVNode(ColGroup,{colWidths:C.value.map((function(e){return e.width})),columns:C.value},null)};return function(){var t,o=e.prefixCls,s=e.scroll,a=e.tableLayout,c=e.direction,d=e.title,u=void 0===d?i.title:d,h=e.footer,g=void 0===h?i.footer:h,p=e.id,f=e.showHeader,m=e.customHeaderRow,v=z.value,T=v.isSticky,k=v.offsetHeader,L=v.offsetSummary,N=v.offsetScroll,O=v.stickyClassName,A=v.container,P=l(["table"],"table"),R=l(["body"]),K=null===(t=i.summary)||void 0===t?void 0:t.call(i,{pageData:r.value}),Y=function(){return null},X={colWidths:M.value,columCount:C.value.length,stickyOffsets:F.value,customHeaderRow:m,fixHeader:B.value,scroll:s};if(B.value||T){var Z=function(){return null};"function"==typeof R?(Z=function(){return R(r.value,{scrollbarSize:re.value,ref:w,onScroll:ee})},X.colWidths=C.value.map((function(e,t){var n=e.width,i=t===_.value.length-1?n-re.value:n;return"number"!=typeof i||Number.isNaN(i)?0:i}))):Z=function(){return createVNode("div",{style:_extends$1(_extends$1({},U.value),G.value),onScroll:ee,ref:w,class:classNames("".concat(o,"-body"))},[createVNode(P,{style:_extends$1(_extends$1({},q.value),{tableLayout:ae.value})},{default:function(){return[de(),ce(),!j.value&&K&&createVNode(Footer,{stickyOffsets:F.value,flattenColumns:C.value},{default:function(){return[K]}})]}})])};var Q=_extends$1(_extends$1(_extends$1({noData:!r.value.length,maxContentScroll:V.value&&"max-content"===s.x},X),b.value),{direction:c,stickyClassName:O,onScroll:ee});Y=function(){return createVNode(Fragment,null,[!1!==f&&createVNode(FixedHolder,_objectSpread2$1(_objectSpread2$1({},Q),{},{stickyTopOffset:k,class:"".concat(o,"-header"),ref:S}),{default:function(e){return createVNode(Fragment,null,[createVNode(Header,e,null),"top"===j.value&&createVNode(Footer,e,{default:function(){return[K]}})])}}),Z(),j.value&&"top"!==j.value&&createVNode(FixedHolder,_objectSpread2$1(_objectSpread2$1({},Q),{},{stickyBottomOffset:L,class:"".concat(o,"-summary"),ref:x}),{default:function(e){return createVNode(Footer,e,{default:function(){return[K]}})}}),T&&w.value&&createVNode(StickyScrollBar,{ref:H,offsetScroll:N,scrollBodyRef:w,onScroll:ee,container:A,scrollBodySizeInfo:E.value},null)])}}else Y=function(){return createVNode("div",{style:_extends$1(_extends$1({},U.value),G.value),class:classNames("".concat(o,"-content")),onScroll:ee,ref:w},[createVNode(P,{style:_extends$1(_extends$1({},q.value),{tableLayout:ae.value})},{default:function(){return[de(),!1!==f&&createVNode(Header,_objectSpread2$1(_objectSpread2$1({},X),b.value),null),ce(),K&&createVNode(Footer,{stickyOffsets:F.value,flattenColumns:C.value},{default:function(){return[K]}})]}})])};var J=pickAttrs(n,{aria:!0,data:!0}),te=function(){var e;return createVNode("div",_objectSpread2$1(_objectSpread2$1({},J),{},{class:classNames(o,(e={},_defineProperty$P(e,"".concat(o,"-rtl"),"rtl"===c),_defineProperty$P(e,"".concat(o,"-ping-left"),I.value),_defineProperty$P(e,"".concat(o,"-ping-right"),D.value),_defineProperty$P(e,"".concat(o,"-layout-fixed"),"fixed"===a),_defineProperty$P(e,"".concat(o,"-fixed-header"),B.value),_defineProperty$P(e,"".concat(o,"-fixed-column"),W.value),_defineProperty$P(e,"".concat(o,"-scroll-horizontal"),V.value),_defineProperty$P(e,"".concat(o,"-has-fix-left"),C.value[0]&&C.value[0].fixed),_defineProperty$P(e,"".concat(o,"-has-fix-right"),C.value[$.value-1]&&"right"===C.value[$.value-1].fixed),_defineProperty$P(e,n.class,n.class),e)),style:n.style,id:p,ref:y}),[u&&createVNode(Panel,{class:"".concat(o,"-title")},{default:function(){return[u(r.value)]}}),createVNode("div",{class:"".concat(o,"-container")},[Y()]),g&&createVNode(Panel,{class:"".concat(o,"-footer")},{default:function(){return[g(r.value)]}})])};return V.value?createVNode(ResizeObserver$1,{onResize:ie},{default:te}):te()}}}),DEFAULT_PAGE_SIZE=10;function getPaginationParam(e,t){var n={current:t.current,pageSize:t.pageSize},i=e&&"object"===_typeof$3(e)?e:{};return Object.keys(i).forEach((function(e){var i=t[e];"function"!=typeof i&&(n[e]=i)})),n}function extendsObject(){for(var e={},t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return n.forEach((function(t){t&&Object.keys(t).forEach((function(n){var i=t[n];void 0!==i&&(e[n]=i)}))})),e}function usePagination(e,t,n){var i=computed((function(){return t.value&&"object"===_typeof$3(t.value)?t.value:{}})),o=computed((function(){return i.value.total||0})),r=_slicedToArray$2(useState((function(){return{current:"defaultCurrent"in i.value?i.value.defaultCurrent:1,pageSize:"defaultPageSize"in i.value?i.value.defaultPageSize:DEFAULT_PAGE_SIZE}})),2),s=r[0],a=r[1],l=computed((function(){var t=extendsObject(s.value,i.value,{total:o.value>0?o.value:e.value}),n=Math.ceil((o.value||e.value)/t.pageSize);return t.current>n&&(t.current=n||1),t})),c=function(e,t){!1!==i.value&&a({current:null!=e?e:1,pageSize:t||l.value.pageSize})},d=function(e,t){var o,r;i.value&&(null===(r=(o=i.value).onChange)||void 0===r||r.call(o,e,t)),c(e,t),n(e,t||l.value.pageSize)};return[computed((function(){return!1===i.value?{}:_extends$1(_extends$1({},l.value),{onChange:d})})),c]}function useLazyKVMap(e,t,n){var i=shallowRef({});return watch([e,t,n],(function(){var o=new Map,r=n.value,s=t.value;!function e(t){t.forEach((function(t,n){var i=r(t,n);o.set(i,t),t&&"object"===_typeof$3(t)&&s in t&&e(t[s]||[])}))}(e.value),i.value={kvMap:o}}),{deep:!0,immediate:!0}),[function(e){return i.value.kvMap.get(e)}]}var SELECTION_COLUMN={},SELECTION_ALL="SELECT_ALL",SELECTION_INVERT="SELECT_INVERT",SELECTION_NONE="SELECT_NONE",EMPTY_LIST$1=[];function flattenData(e,t){var n=[];return(e||[]).forEach((function(e){n.push(e),e&&"object"===_typeof$3(e)&&t in e&&(n=[].concat(_toConsumableArray$2(n),_toConsumableArray$2(flattenData(e[t],t))))})),n}function useSelection(e,t){var n=computed((function(){var t=e.value||{},n=t.checkStrictly,i=void 0===n||n;return _extends$1(_extends$1({},t),{checkStrictly:i})})),i=_slicedToArray$2(useMergedState(n.value.selectedRowKeys||n.value.defaultSelectedRowKeys||EMPTY_LIST$1,{value:computed((function(){return n.value.selectedRowKeys}))}),2),o=i[0],r=i[1],s=shallowRef(new Map),a=function(e){if(n.value.preserveSelectedRowKeys){var i=new Map;e.forEach((function(e){var n=t.getRecordByKey(e);!n&&s.value.has(e)&&(n=s.value.get(e)),i.set(e,n)})),s.value=i}};watchEffect((function(){a(o.value)}));var l=computed((function(){return n.value.checkStrictly?null:convertDataToEntities(t.data.value,{externalGetKey:t.getRowKey.value,childrenPropName:t.childrenColumnName.value}).keyEntities})),c=computed((function(){return flattenData(t.pageData.value,t.childrenColumnName.value)})),d=computed((function(){var e=new Map,i=t.getRowKey.value,o=n.value.getCheckboxProps;return c.value.forEach((function(t,n){var r=i(t,n),s=(o?o(t):null)||{};e.set(r,s)})),e})),u=useMaxLevel(l),h=u.maxLevel,g=u.levelEntities,p=function(e){var n;return!!(null===(n=d.value.get(t.getRowKey.value(e)))||void 0===n?void 0:n.disabled)},f=computed((function(){if(n.value.checkStrictly)return[o.value||[],[]];var e=conductCheck(o.value,!0,l.value,h.value,g.value,p);return[e.checkedKeys||[],e.halfCheckedKeys]})),m=computed((function(){return f.value[0]})),v=computed((function(){return f.value[1]})),_=computed((function(){var e="radio"===n.value.type?m.value.slice(0,1):m.value;return new Set(e)})),C=computed((function(){return"radio"===n.value.type?new Set:new Set(v.value)})),b=_slicedToArray$2(useState(null),2),y=b[0],S=b[1],w=function(e){var i,o;a(e);var l=n.value,c=l.preserveSelectedRowKeys,d=l.onChange,u=t.getRecordByKey;c?(i=e,o=e.map((function(e){return s.value.get(e)}))):(i=[],o=[],e.forEach((function(e){var t=u(e);void 0!==t&&(i.push(e),o.push(t))}))),r(i),null==d||d(i,o)},E=function(e,i,o,r){var s=n.value.onSelect,a=(t||{}).getRecordByKey;if(s){var l=o.map((function(e){return a(e)}));s(a(e),i,l,r)}w(o)},x=computed((function(){var e=n.value,i=e.onSelectInvert,o=e.onSelectNone,r=e.selections,s=e.hideSelectAll,a=t.data,l=t.pageData,c=t.getRowKey,u=t.locale;return!r||s?null:(!0===r?[SELECTION_ALL,SELECTION_INVERT,SELECTION_NONE]:r).map((function(e){return e===SELECTION_ALL?{key:"all",text:u.value.selectionAll,onSelect:function(){w(a.value.map((function(e,t){return c.value(e,t)})).filter((function(e){var t=d.value.get(e);return!(null==t?void 0:t.disabled)||_.value.has(e)})))}}:e===SELECTION_INVERT?{key:"invert",text:u.value.selectInvert,onSelect:function(){var e=new Set(_.value);l.value.forEach((function(t,n){var i=c.value(t,n),o=d.value.get(i);(null==o?void 0:o.disabled)||(e.has(i)?e.delete(i):e.add(i))}));var t=Array.from(e);i&&(devWarning(!1,"Table","`onSelectInvert` will be removed in future. Please use `onChange` instead."),i(t)),w(t)}}:e===SELECTION_NONE?{key:"none",text:u.value.selectNone,onSelect:function(){null==o||o(),w(Array.from(_.value).filter((function(e){var t=d.value.get(e);return null==t?void 0:t.disabled})))}}:e}))})),T=computed((function(){return c.value.length}));return[function(i){var o,r=n.value,s=r.onSelectAll,a=r.onSelectMultiple,u=r.columnWidth,f=r.type,v=r.fixed,b=r.renderCell,I=r.hideSelectAll,k=r.checkStrictly,L=t.prefixCls,D=t.getRecordByKey,N=t.getRowKey,O=t.expandType,A=t.getPopupContainer;if(!e.value)return i.filter((function(e){return e!==SELECTION_COLUMN}));var P,R,M=i.slice(),$=new Set(_.value),F=c.value.map(N.value).filter((function(e){return!d.value.get(e).disabled})),B=F.every((function(e){return $.has(e)})),V=F.some((function(e){return $.has(e)}));if("radio"!==f){var W;if(x.value){var H=createVNode(Menu$2,{getPopupContainer:A.value},{default:function(){return[x.value.map((function(e,t){var n=e.key,i=e.text,o=e.onSelect;return createVNode(Menu$2.Item,{key:n||t,onClick:function(){null==o||o(F)}},{default:function(){return[i]}})}))]}});W=createVNode("div",{class:"".concat(L.value,"-selection-extra")},[createVNode(Dropdown$1,{overlay:H,getPopupContainer:A.value},{default:function(){return[createVNode("span",null,[createVNode(DownOutlined$1,null,null)])]}})])}var z=c.value.map((function(e,t){var n=N.value(e,t),i=d.value.get(n)||{};return _extends$1({checked:$.has(n)},i)})).filter((function(e){return e.disabled})),K=!!z.length&&z.length===T.value,j=K&&z.every((function(e){return e.checked})),U=K&&z.some((function(e){return e.checked}));P=!I&&createVNode("div",{class:"".concat(L.value,"-selection")},[createVNode(Checkbox$1,{checked:K?j:!!T.value&&B,indeterminate:K?!j&&U:!B&&V,onChange:function(){var e=[];B?F.forEach((function(t){$.delete(t),e.push(t)})):F.forEach((function(t){$.has(t)||($.add(t),e.push(t))}));var t=Array.from($);null==s||s(!B,t.map((function(e){return D(e)})),e.map((function(e){return D(e)}))),w(t)},disabled:0===T.value||K,skipGroup:!0},null),W])}R="radio"===f?function(e){var t=e.record,n=e.index,i=N.value(t,n),o=$.has(i);return{node:createVNode(Radio,_objectSpread2$1(_objectSpread2$1({},d.value.get(i)),{},{checked:o,onClick:function(e){return e.stopPropagation()},onChange:function(e){$.has(i)||E(i,!0,[i],e.nativeEvent)}}),null),checked:o}}:function(e){var t,n,i=e.record,o=e.index,r=N.value(i,o),s=$.has(r),c=C.value.has(r),u=d.value.get(r);return"nest"===O.value?(n=c,devWarning("boolean"!=typeof(null==u?void 0:u.indeterminate),"Table","set `indeterminate` using `rowSelection.getCheckboxProps` is not allowed with tree structured dataSource.")):n=null!==(t=null==u?void 0:u.indeterminate)&&void 0!==t?t:c,{node:createVNode(Checkbox$1,_objectSpread2$1(_objectSpread2$1({},u),{},{indeterminate:n,checked:s,skipGroup:!0,onClick:function(e){return e.stopPropagation()},onChange:function(e){var t=e.nativeEvent,n=t.shiftKey,i=-1,o=-1;if(n&&k){var c=new Set([y.value,r]);F.some((function(e,t){if(c.has(e)){if(-1!==i)return o=t,!0;i=t}return!1}))}if(-1!==o&&i!==o&&k){var d=F.slice(i,o+1),u=[];s?d.forEach((function(e){$.has(e)&&(u.push(e),$.delete(e))})):d.forEach((function(e){$.has(e)||(u.push(e),$.add(e))}));var f=Array.from($);null==a||a(!s,f.map((function(e){return D(e)})),u.map((function(e){return D(e)}))),w(f)}else{var v=m.value;if(k){var _=s?arrDel(v,r):arrAdd(v,r);E(r,!s,_,t)}else{var C=conductCheck([].concat(_toConsumableArray$2(v),[r]),!0,l.value,h.value,g.value,p),b=C.checkedKeys,x=C.halfCheckedKeys,T=b;if(s){var I=new Set(b);I.delete(r),T=conductCheck(Array.from(I),{checked:!1,halfCheckedKeys:x},l.value,h.value,g.value,p).checkedKeys}E(r,!s,T,t)}}S(r)}}),null),checked:s}};if(!M.includes(SELECTION_COLUMN))if(0===M.findIndex((function(e){var t;return"EXPAND_COLUMN"===(null===(t=e[INTERNAL_COL_DEFINE])||void 0===t?void 0:t.columnType)}))){var G=_toArray(M),q=G[0],Y=G.slice(1);M=[q,SELECTION_COLUMN].concat(_toConsumableArray$2(Y))}else M=[SELECTION_COLUMN].concat(_toConsumableArray$2(M));var X=M.indexOf(SELECTION_COLUMN),Z=(M=M.filter((function(e,t){return e!==SELECTION_COLUMN||t===X})))[X-1],Q=M[X+1],J=v;void 0===J&&(void 0!==(null==Q?void 0:Q.fixed)?J=Q.fixed:void 0!==(null==Z?void 0:Z.fixed)&&(J=Z.fixed)),J&&Z&&"EXPAND_COLUMN"===(null===(o=Z[INTERNAL_COL_DEFINE])||void 0===o?void 0:o.columnType)&&void 0===Z.fixed&&(Z.fixed=J);var ee=_defineProperty$P({fixed:J,width:u,className:"".concat(L.value,"-selection-column"),title:n.value.columnTitle||P,customRender:function(e){var t=e.record,n=e.index,i=R({record:t,index:n}),o=i.node,r=i.checked;return b?b(r,t,n,o):o}},INTERNAL_COL_DEFINE,{class:"".concat(L.value,"-selection-col")});return M.map((function(e){return e===SELECTION_COLUMN?ee:e}))},_]}var CaretDownOutlined$2={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"},CaretDownOutlinedSvg=CaretDownOutlined$2;function _objectSpread$o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$o(e,t,n[t])}))}return e}function _defineProperty$o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var CaretDownOutlined=function(e,t){var n=_objectSpread$o({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$o({},n,{icon:CaretDownOutlinedSvg}),null)};CaretDownOutlined.displayName="CaretDownOutlined",CaretDownOutlined.inheritAttrs=!1;var CaretDownOutlined$1=CaretDownOutlined,CaretUpOutlined$2={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"},CaretUpOutlinedSvg=CaretUpOutlined$2;function _objectSpread$n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$n(e,t,n[t])}))}return e}function _defineProperty$n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var CaretUpOutlined=function(e,t){var n=_objectSpread$n({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$n({},n,{icon:CaretUpOutlinedSvg}),null)};CaretUpOutlined.displayName="CaretUpOutlined",CaretUpOutlined.inheritAttrs=!1;var CaretUpOutlined$1=CaretUpOutlined,__rest$7=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function getColumnKey(e,t){return"key"in e&&void 0!==e.key&&null!==e.key?e.key:e.dataIndex?Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex:t}function getColumnPos(e,t){return t?"".concat(t,"-").concat(e):"".concat(e)}function renderColumnTitle(e,t){return"function"==typeof e?e(t):e}function convertChildrenToColumns(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=flattenChildren(e),n=[];return t.forEach((function(e){var t,i,o,r;if(e){for(var s=e.key,a=(null===(t=e.props)||void 0===t?void 0:t.style)||{},l=(null===(i=e.props)||void 0===i?void 0:i.class)||"",c=e.props||{},d=0,u=Object.entries(c);d<u.length;d++){var h=_slicedToArray$2(u[d],2),g=h[0],p=h[1];c[camelize$1(g)]=p}var f=e.children||{},m=f.default,v=_extends$1(_extends$1(_extends$1({},__rest$7(f,["default"])),c),{style:a,class:l});if(s&&(v.key=s),null===(o=e.type)||void 0===o?void 0:o.__ANT_TABLE_COLUMN_GROUP)v.children=convertChildrenToColumns("function"==typeof m?m():m);else{var _=null===(r=e.children)||void 0===r?void 0:r.default;v.customRender=v.customRender||_}n.push(v)}})),n}var ASCEND="ascend",DESCEND="descend";function getMultiplePriority(e){return"object"===_typeof$3(e.sorter)&&"number"==typeof e.sorter.multiple&&e.sorter.multiple}function getSortFunction(e){return"function"==typeof e?e:!(!e||"object"!==_typeof$3(e)||!e.compare)&&e.compare}function nextSortDirection(e,t){return t?e[e.indexOf(t)+1]:e[0]}function collectSortStates(e,t,n){var i=[];function o(e,t){i.push({column:e,key:getColumnKey(e,t),multiplePriority:getMultiplePriority(e),sortOrder:e.sortOrder})}return(e||[]).forEach((function(e,r){var s=getColumnPos(r,n);e.children?("sortOrder"in e&&o(e,s),i=[].concat(_toConsumableArray$2(i),_toConsumableArray$2(collectSortStates(e.children,t,s)))):e.sorter&&("sortOrder"in e?o(e,s):t&&e.defaultSortOrder&&i.push({column:e,key:getColumnKey(e,s),multiplePriority:getMultiplePriority(e),sortOrder:e.defaultSortOrder}))})),i}function injectSorter(e,t,n,i,o,r,s,a){return(t||[]).map((function(t,l){var c=getColumnPos(l,a),d=t;if(d.sorter){var u=d.sortDirections||o,h=void 0===d.showSorterTooltip?s:d.showSorterTooltip,g=getColumnKey(d,c),p=n.find((function(e){return e.key===g})),f=p?p.sortOrder:null,m=nextSortDirection(u,f),v=u.includes(ASCEND)&&createVNode(CaretUpOutlined$1,{class:classNames("".concat(e,"-column-sorter-up"),{active:f===ASCEND})},null),_=u.includes(DESCEND)&&createVNode(CaretDownOutlined$1,{class:classNames("".concat(e,"-column-sorter-down"),{active:f===DESCEND})},null),C=r||{},b=C.cancelSort,y=C.triggerAsc,S=C.triggerDesc,w=b;m===DESCEND?w=S:m===ASCEND&&(w=y);var E="object"===_typeof$3(h)?h:{title:w};d=_extends$1(_extends$1({},d),{className:classNames(d.className,_defineProperty$P({},"".concat(e,"-column-sort"),f)),title:function(n){var i=createVNode("div",{class:"".concat(e,"-column-sorters")},[createVNode("span",{class:"".concat(e,"-column-title")},[renderColumnTitle(t.title,n)]),createVNode("span",{class:classNames("".concat(e,"-column-sorter"),_defineProperty$P({},"".concat(e,"-column-sorter-full"),!(!v||!_)))},[createVNode("span",{class:"".concat(e,"-column-sorter-inner")},[v,_])])]);return h?createVNode(__unplugin_components_2$3,E,{default:function(){return[i]}}):i},customHeaderCell:function(n){var o=t.customHeaderCell&&t.customHeaderCell(n)||{},r=o.onClick;return o.onClick=function(e){i({column:t,key:g,sortOrder:m,multiplePriority:getMultiplePriority(t)}),r&&r(e)},o.class=classNames(o.class,"".concat(e,"-column-has-sorters")),o}})}return"children"in d&&(d=_extends$1(_extends$1({},d),{children:injectSorter(e,d.children,n,i,o,r,s,c)})),d}))}function stateToInfo(e){var t=e.column;return{column:t,order:e.sortOrder,field:t.dataIndex,columnKey:t.key}}function generateSorterInfo(e){var t=e.filter((function(e){return e.sortOrder})).map(stateToInfo);return 0===t.length&&e.length?_extends$1(_extends$1({},stateToInfo(e[e.length-1])),{column:void 0}):t.length<=1?t[0]||{}:t}function getSortData$1(e,t,n){var i=t.slice().sort((function(e,t){return t.multiplePriority-e.multiplePriority})),o=e.slice(),r=i.filter((function(e){var t=e.column.sorter,n=e.sortOrder;return getSortFunction(t)&&n}));return r.length?o.sort((function(e,t){for(var n=0;n<r.length;n+=1){var i=r[n],o=i.column.sorter,s=i.sortOrder,a=getSortFunction(o);if(a&&s){var l=a(e,t,s);if(0!==l)return s===ASCEND?l:-l}}return 0})).map((function(e){var i=e[n];return i?_extends$1(_extends$1({},e),_defineProperty$P({},n,getSortData$1(i,t,n))):e})):o}function useFilterSorter(e){var t=e.prefixCls,n=e.mergedColumns,i=e.onSorterChange,o=e.sortDirections,r=e.tableLocale,s=e.showSorterTooltip,a=_slicedToArray$2(useState(collectSortStates(n.value,!0)),2),l=a[0],c=a[1],d=computed((function(){var e=!0,t=collectSortStates(n.value,!1);if(!t.length)return l.value;var i=[];function o(t){e?i.push(t):i.push(_extends$1(_extends$1({},t),{sortOrder:null}))}var r=null;return t.forEach((function(t){null===r?(o(t),t.sortOrder&&(!1===t.multiplePriority?e=!1:r=!0)):(r&&!1!==t.multiplePriority||(e=!1),o(t))})),i})),u=computed((function(){var e=d.value.map((function(e){return{column:e.column,order:e.sortOrder}}));return{sortColumns:e,sortColumn:e[0]&&e[0].column,sortOrder:e[0]&&e[0].order}}));function h(e){var t;t=!1!==e.multiplePriority&&d.value.length&&!1!==d.value[0].multiplePriority?[].concat(_toConsumableArray$2(d.value.filter((function(t){return t.key!==e.key}))),[e]):[e],c(t),i(generateSorterInfo(t),t)}var g=computed((function(){return generateSorterInfo(d.value)}));return[function(e){return injectSorter(t.value,e,d.value,h,o.value,r.value,s.value)},d,u,g]}var FilterFilled$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"},FilterFilledSvg=FilterFilled$2;function _objectSpread$m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$m(e,t,n[t])}))}return e}function _defineProperty$m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var FilterFilled=function(e,t){var n=_objectSpread$m({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$m({},n,{icon:FilterFilledSvg}),null)};FilterFilled.displayName="FilterFilled",FilterFilled.inheritAttrs=!1;var FilterFilled$1=FilterFilled,FilterDropdownMenuWrapper=function(e,t){var n,i=t.slots;return createVNode("div",{onClick:function(e){return e.stopPropagation()}},[null===(n=i.default)||void 0===n?void 0:n.call(i)])},FilterDropdownMenuWrapper$1=FilterDropdownMenuWrapper,FilterSearch=defineComponent({name:"FilterSearch",inheritAttrs:!1,props:{value:String,onChange:Function,filterSearch:Boolean,tablePrefixCls:String,locale:{type:Object,default:void 0}},setup:function(e){return function(){var t=e.value,n=e.onChange,i=e.filterSearch,o=e.tablePrefixCls,r=e.locale;return i?createVNode("div",{class:"".concat(o,"-filter-dropdown-search")},[createVNode(Input,{placeholder:r.filterSearchPlaceholder,onChange:n,value:t,htmlSize:1,class:"".concat(o,"-filter-dropdown-search-input")},{prefix:function(){return createVNode(SearchOutlined$1,null,null)}})]):null}}}),__rest$6=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},MotionTreeNode=defineComponent({name:"MotionTreeNode",inheritAttrs:!1,props:_extends$1(_extends$1({},treeNodeProps),{active:Boolean,motion:Object,motionNodes:{type:Array},onMotionStart:Function,onMotionEnd:Function,motionType:String}),slots:["title","icon","switcherIcon","checkable"],setup:function(e,t){var n=t.attrs,i=t.slots,o=ref(!0),r=useInjectTreeContext(),s=ref(!1),a=computed((function(){return e.motion?e.motion:collapseMotion$1()})),l=function(t,n){var i,o,r,l;"appear"===n?null===(o=null===(i=a.value)||void 0===i?void 0:i.onAfterEnter)||void 0===o||o.call(i,t):"leave"===n&&(null===(l=null===(r=a.value)||void 0===r?void 0:r.onAfterLeave)||void 0===l||l.call(r,t)),s.value||e.onMotionEnd(),s.value=!0};return watch((function(){return e.motionNodes}),(function(){e.motionNodes&&"hide"===e.motionType&&o.value&&nextTick((function(){o.value=!1}))}),{immediate:!0,flush:"post"}),onMounted((function(){e.motionNodes&&e.onMotionStart()})),onBeforeUnmount((function(){e.motionNodes&&l()})),function(){e.motion;var t=e.motionNodes,s=e.motionType,c=e.active,d=e.eventKey,u=__rest$6(e,["motion","motionNodes","motionType","active","eventKey"]);return t?createVNode(Transition,_objectSpread2$1(_objectSpread2$1({},a.value),{},{appear:"show"===s,onAfterAppear:function(e){return l(e,"appear")},onAfterLeave:function(e){return l(e,"leave")}}),{default:function(){return[withDirectives(createVNode("div",{class:"".concat(r.value.prefixCls,"-treenode-motion")},[t.map((function(e){var t=__rest$6(e.data,[]),n=e.title,o=e.key,r=e.isStart,s=e.isEnd;return delete t.children,createVNode(VcTreeNode,_objectSpread2$1(_objectSpread2$1({},t),{},{title:n,active:c,data:e.data,key:o,eventKey:o,isStart:r,isEnd:s}),i)}))]),[[vShow,o.value]])]}}):createVNode(VcTreeNode,_objectSpread2$1(_objectSpread2$1({domRef:ref,class:n.class,style:n.style},u),{},{active:c,eventKey:d}),i)}}});function findExpandedKeys(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.length,i=t.length;if(1!==Math.abs(n-i))return{add:!1,key:null};function o(e,t){var n=new Map;e.forEach((function(e){n.set(e,!0)}));var i=t.filter((function(e){return!n.has(e)}));return 1===i.length?i[0]:null}return n<i?{add:!0,key:o(e,t)}:{add:!1,key:o(t,e)}}function getExpandRange(e,t,n){var i=e.findIndex((function(e){return e.key===n})),o=e[i+1],r=t.findIndex((function(e){return e.key===n}));if(o){var s=t.findIndex((function(e){return e.key===o.key}));return t.slice(r+1,s)}return t.slice(r+1)}var __rest$5=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},HIDDEN_STYLE$1={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},noop$1=function(){},MOTION_KEY="RC_TREE_MOTION_".concat(Math.random()),MotionNode={key:MOTION_KEY},MotionEntity={key:MOTION_KEY,level:0,index:0,pos:"0",node:MotionNode,nodes:[MotionNode]},MotionFlattenData={parent:null,children:[],pos:MotionEntity.pos,data:MotionNode,title:null,key:MOTION_KEY,isStart:[],isEnd:[]};function getMinimumRangeTransitionRange(e,t,n,i){return!1!==t&&n?e.slice(0,Math.ceil(n/i)+1):e}function itemKey(e){return getKey$1(e.key,e.pos)}function getAccessibilityPath(e){for(var t=String(e.key),n=e;n.parent;)n=n.parent,t="".concat(n.key," > ").concat(t);return t}var NodeList=defineComponent({name:"NodeList",inheritAttrs:!1,props:nodeListProps,setup:function(e,t){var n=t.expose,i=t.attrs,o=ref(),r=ref(),s=useInjectKeysState(),a=s.expandedKeys,l=s.flattenNodes;n({scrollTo:function(e){o.value.scrollTo(e)},getIndentWidth:function(){return r.value.offsetWidth}});var c=shallowRef(l.value),d=shallowRef([]),u=ref(null);function h(){c.value=l.value,d.value=[],u.value=null,e.onListChangeEnd()}var g=useInjectTreeContext();watch([function(){return a.value.slice()},l],(function(t,n){var i=_slicedToArray$2(t,2),o=i[0],r=i[1],s=_slicedToArray$2(n,2),a=s[0],l=s[1],h=findExpandedKeys(a,o);if(null!==h.key){var g=e.virtual,p=e.height,f=e.itemHeight;if(h.add){var m=l.findIndex((function(e){return e.key===h.key})),v=getMinimumRangeTransitionRange(getExpandRange(l,r,h.key),g,p,f),_=l.slice();_.splice(m+1,0,MotionFlattenData),c.value=_,d.value=v,u.value="show"}else{var C=r.findIndex((function(e){return e.key===h.key})),b=getMinimumRangeTransitionRange(getExpandRange(r,l,h.key),g,p,f),y=r.slice();y.splice(C+1,0,MotionFlattenData),c.value=y,d.value=b,u.value="hide"}}else l!==r&&(c.value=r)})),watch((function(){return g.value.dragging}),(function(e){e||h()}));var p=computed((function(){return void 0===e.motion?c.value:l.value})),f=function(){e.onActiveChange(null)};return function(){var t=_extends$1(_extends$1({},e),i),n=t.prefixCls;t.selectable,t.checkable;var s=t.disabled,a=t.motion,l=t.height,c=t.itemHeight,g=t.virtual,m=t.focusable,v=t.activeItem,_=t.focused,C=t.tabindex,b=t.onKeydown,y=t.onFocus,S=t.onBlur,w=t.onListChangeStart;t.onListChangeEnd;var E=__rest$5(t,["prefixCls","selectable","checkable","disabled","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabindex","onKeydown","onFocus","onBlur","onListChangeStart","onListChangeEnd"]);return createVNode(Fragment,null,[_&&v&&createVNode("span",{style:HIDDEN_STYLE$1,"aria-live":"assertive"},[getAccessibilityPath(v)]),createVNode("div",null,[createVNode("input",{style:HIDDEN_STYLE$1,disabled:!1===m||s,tabindex:!1!==m?C:null,onKeydown:b,onFocus:y,onBlur:S,value:"",onChange:noop$1,"aria-label":"for screen reader"},null)]),createVNode("div",{class:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden"}},[createVNode("div",{class:"".concat(n,"-indent")},[createVNode("div",{ref:r,class:"".concat(n,"-indent-unit")},null)])]),createVNode(List$2,_objectSpread2$1(_objectSpread2$1({},omit$2(E,["onActiveChange"])),{},{data:p.value,itemKey:itemKey,height:l,fullHeight:!1,virtual:g,itemHeight:c,prefixCls:"".concat(n,"-list"),ref:o,onVisibleChange:function(e,t){var n=new Set(e);t.filter((function(e){return!n.has(e)})).some((function(e){return itemKey(e)===MOTION_KEY}))&&h()}}),{default:function(e){var t=e.pos,n=__rest$5(e.data,[]),i=e.title,o=e.key,r=e.isStart,s=e.isEnd,l=getKey$1(o,t);return delete n.key,delete n.children,createVNode(MotionTreeNode,_objectSpread2$1(_objectSpread2$1({},n),{},{eventKey:l,title:i,active:!!v&&o===v.key,data:e.data,isStart:r,isEnd:s,motion:a,motionNodes:o===MOTION_KEY?d.value:null,motionType:u.value,onMotionStart:w,onMotionEnd:h,onMousemove:f}),null)}})])}}});function DropIndicator(e){var t=e.dropPosition,n=e.dropLevelOffset,i=e.indent,o={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:"".concat(2,"px")};switch(t){case-1:o.top=0,o.left="".concat(-n*i,"px");break;case 1:o.bottom=0,o.left="".concat(-n*i,"px");break;case 0:o.bottom=0,o.left="".concat(i)}return createVNode("div",{style:o},null)}var MAX_RETRY_TIMES=10,Tree$1=defineComponent({name:"Tree",inheritAttrs:!1,slots:["checkable","title","icon","titleRender"],props:initDefaultProps$1(treeProps$1(),{prefixCls:"vc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:DropIndicator,allowDrop:function(){return!0}}),setup:function(e,t){var n=t.attrs,i=t.slots,o=t.expose,r=ref(!1),s={},a=ref(),l=shallowRef([]),c=shallowRef([]),d=shallowRef([]),u=shallowRef([]),h=shallowRef([]),g=shallowRef([]),p={},f=reactive({draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null}),m=shallowRef([]);watch([function(){return e.treeData},function(){return e.children}],(function(){m.value=void 0!==e.treeData?toRaw(e.treeData).slice():convertTreeToData(toRaw(e.children))}),{immediate:!0,deep:!0});var v=shallowRef({}),_=ref(!1),C=ref(null),b=ref(!1),y=computed((function(){return fillFieldNames$1(e.fieldNames)})),S=ref(),w=null,E=null,x=null,T=computed((function(){return{expandedKeysSet:I.value,selectedKeysSet:k.value,loadedKeysSet:L.value,loadingKeysSet:D.value,checkedKeysSet:N.value,halfCheckedKeysSet:O.value,dragOverNodeKey:f.dragOverNodeKey,dropPosition:f.dropPosition,keyEntities:v.value}})),I=computed((function(){return new Set(g.value)})),k=computed((function(){return new Set(l.value)})),L=computed((function(){return new Set(u.value)})),D=computed((function(){return new Set(h.value)})),N=computed((function(){return new Set(c.value)})),O=computed((function(){return new Set(d.value)}));watchEffect((function(){if(m.value){var e=convertDataToEntities(m.value,{fieldNames:y.value});v.value=_extends$1(_defineProperty$P({},MOTION_KEY,MotionEntity),e.keyEntities)}}));var A=!1;watch([function(){return e.expandedKeys},function(){return e.autoExpandParent},v],(function(t,n){var i=_slicedToArray$2(t,2);i[0];var o=i[1],r=_slicedToArray$2(n,2);r[0];var s=r[1],a=g.value;if(void 0!==e.expandedKeys||A&&o!==s)a=e.autoExpandParent||!A&&e.defaultExpandParent?conductExpandParent(e.expandedKeys,v.value):e.expandedKeys;else if(!A&&e.defaultExpandAll){var l=_extends$1({},v.value);delete l[MOTION_KEY],a=Object.keys(l).map((function(e){return l[e].key}))}else!A&&e.defaultExpandedKeys&&(a=e.autoExpandParent||e.defaultExpandParent?conductExpandParent(e.defaultExpandedKeys,v.value):e.defaultExpandedKeys);a&&(g.value=a),A=!0}),{immediate:!0});var P=shallowRef([]);watchEffect((function(){P.value=flattenTreeData(m.value,g.value,y.value)})),watchEffect((function(){e.selectable&&(void 0!==e.selectedKeys?l.value=calcSelectedKeys(e.selectedKeys,e):!A&&e.defaultSelectedKeys&&(l.value=calcSelectedKeys(e.defaultSelectedKeys,e)))}));var R=useMaxLevel(v),M=R.maxLevel,$=R.levelEntities;watchEffect((function(){var t;if(e.checkable&&(void 0!==e.checkedKeys?t=parseCheckedKeys(e.checkedKeys)||{}:!A&&e.defaultCheckedKeys?t=parseCheckedKeys(e.defaultCheckedKeys)||{}:m.value&&(t=parseCheckedKeys(e.checkedKeys)||{checkedKeys:c.value,halfCheckedKeys:d.value}),t)){var n=t,i=n.checkedKeys,o=void 0===i?[]:i,r=n.halfCheckedKeys,s=void 0===r?[]:r;if(!e.checkStrictly){var a=conductCheck(o,!0,v.value,M.value,$.value);o=a.checkedKeys,s=a.halfCheckedKeys}c.value=o,d.value=s}})),watchEffect((function(){e.loadedKeys&&(u.value=e.loadedKeys)}));var F=function(){_extends$1(f,{dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})},B=function(e){S.value.scrollTo(e)};watch((function(){return e.activeKey}),(function(){void 0!==e.activeKey&&(C.value=e.activeKey)}),{immediate:!0}),watch(C,(function(e){nextTick((function(){null!==e&&B({key:e})}))}),{immediate:!0,flush:"post"});var V=function(t){void 0===e.expandedKeys&&(g.value=t)},W=function(){null!==f.draggingNodeKey&&_extends$1(f,{draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),w=null,x=null},H=function(t,n){var i=e.onDragend;f.dragOverNodeKey=null,W(),null==i||i({event:t,node:n.eventData}),E=null},z=function e(t){H(t,null),window.removeEventListener("dragend",e)},K=function(t,n){var i=e.onDragstart,o=n.eventKey,r=n.eventData;E=n,w={x:t.clientX,y:t.clientY};var s=arrDel(g.value,o);f.draggingNodeKey=o,f.dragChildrenKeys=getDragChildrenKeys(o,v.value),a.value=S.value.getIndentWidth(),V(s),window.addEventListener("dragend",z),i&&i({event:t,node:r})},j=function(t,n){var i=e.onDragenter,o=e.onExpand,r=e.allowDrop,l=e.direction,c=n.pos,d=n.eventKey;if(x!==d&&(x=d),E){var u=calcDropPosition(t,E,n,a.value,w,r,P.value,v.value,I.value,l),h=u.dropPosition,p=u.dropLevelOffset,m=u.dropTargetKey,_=u.dropContainerKey,C=u.dropTargetPos,b=u.dropAllowed,y=u.dragOverNodeKey;-1===f.dragChildrenKeys.indexOf(m)&&b?(s||(s={}),Object.keys(s).forEach((function(e){clearTimeout(s[e])})),E.eventKey!==n.eventKey&&(s[c]=window.setTimeout((function(){if(null!==f.draggingNodeKey){var e=g.value.slice(),i=v.value[n.eventKey];i&&(i.children||[]).length&&(e=arrAdd(g.value,n.eventKey)),V(e),o&&o(e,{node:n.eventData,expanded:!0,nativeEvent:t})}}),800)),E.eventKey!==m||0!==p?(_extends$1(f,{dragOverNodeKey:y,dropPosition:h,dropLevelOffset:p,dropTargetKey:m,dropContainerKey:_,dropTargetPos:C,dropAllowed:b}),i&&i({event:t,node:n.eventData,expandedKeys:g.value})):F()):F()}else F()},U=function(t,n){var i=e.onDragover,o=e.allowDrop,r=e.direction;if(E){var s=calcDropPosition(t,E,n,a.value,w,o,P.value,v.value,I.value,r),l=s.dropPosition,c=s.dropLevelOffset,d=s.dropTargetKey,u=s.dropContainerKey,h=s.dropAllowed,g=s.dropTargetPos,p=s.dragOverNodeKey;-1===f.dragChildrenKeys.indexOf(d)&&h&&(E.eventKey===d&&0===c?null===f.dropPosition&&null===f.dropLevelOffset&&null===f.dropTargetKey&&null===f.dropContainerKey&&null===f.dropTargetPos&&!1===f.dropAllowed&&null===f.dragOverNodeKey||F():l===f.dropPosition&&c===f.dropLevelOffset&&d===f.dropTargetKey&&u===f.dropContainerKey&&g===f.dropTargetPos&&h===f.dropAllowed&&p===f.dragOverNodeKey||_extends$1(f,{dropPosition:l,dropLevelOffset:c,dropTargetKey:d,dropContainerKey:u,dropTargetPos:g,dropAllowed:h,dragOverNodeKey:p}),i&&i({event:t,node:n.eventData}))}},G=function(t,n){x!==n.eventKey||t.currentTarget.contains(t.relatedTarget)||(F(),x=null);var i=e.onDragleave;i&&i({event:t,node:n.eventData})},q=function(t,n){var i,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=f.dragChildrenKeys,s=f.dropPosition,a=f.dropTargetKey,l=f.dropTargetPos,c=f.dropAllowed;if(c){var d=e.onDrop;if(f.dragOverNodeKey=null,W(),null!==a){var u=_extends$1(_extends$1({},getTreeNodeProps(a,toRaw(T.value))),{active:(null===(i=ce.value)||void 0===i?void 0:i.key)===a,data:v.value[a].node});r.indexOf(a);var h=posToArr(l),g={event:t,node:convertNodePropsToEventData(u),dragNode:E?E.eventData:null,dragNodesKeys:[E.eventKey].concat(r),dropToGap:0!==s,dropPosition:s+Number(h[h.length-1])};o||null==d||d(g),E=null}}},Y=function(t,n){var i=e.onClick;i&&i(t,n)},X=function(t,n){var i=e.onDblclick;i&&i(t,n)},Z=function(t,n){var i=l.value,o=e.onSelect,r=e.multiple,s=n.selected,a=n[y.value.key],c=!s;i=c?r?arrAdd(i,a):[a]:arrDel(i,a);var d=v.value,u=i.map((function(e){var t=d[e];return t?t.node:null})).filter((function(e){return e}));void 0===e.selectedKeys&&(l.value=i),o&&o(i,{event:"select",selected:c,node:n,selectedNodes:u,nativeEvent:t})},Q=function(t,n,i){var o,r=e.checkStrictly,s=e.onCheck,a=n[y.value.key],l={event:"check",node:n,checked:i,nativeEvent:t},u=v.value;if(r){var h=i?arrAdd(c.value,a):arrDel(c.value,a);o={checked:h,halfChecked:arrDel(d.value,a)},l.checkedNodes=h.map((function(e){return u[e]})).filter((function(e){return e})).map((function(e){return e.node})),void 0===e.checkedKeys&&(c.value=h)}else{var g=conductCheck([].concat(_toConsumableArray$2(c.value),[a]),!0,u,M.value,$.value),p=g.checkedKeys,f=g.halfCheckedKeys;if(!i){var m=new Set(p);m.delete(a);var _=conductCheck(Array.from(m),{checked:!1,halfCheckedKeys:f},u,M.value,$.value);p=_.checkedKeys,f=_.halfCheckedKeys}o=p,l.checkedNodes=[],l.checkedNodesPositions=[],l.halfCheckedKeys=f,p.forEach((function(e){var t=u[e];if(t){var n=t.node,i=t.pos;l.checkedNodes.push(n),l.checkedNodesPositions.push({node:n,pos:i})}})),void 0===e.checkedKeys&&(c.value=p,d.value=f)}s&&s(o,l)},J=function(t){var n=t[y.value.key],i=new Promise((function(i,o){var r=e.loadData,s=e.onLoad;if(!r||L.value.has(n)||D.value.has(n))return null;r(t).then((function(){var o=arrAdd(u.value,n),r=arrDel(h.value,n);s&&s(o,{event:"load",node:t}),void 0===e.loadedKeys&&(u.value=o),h.value=r,i()})).catch((function(t){var r=arrDel(h.value,n);if(h.value=r,p[n]=(p[n]||0)+1,p[n]>=MAX_RETRY_TIMES){var s=arrAdd(u.value,n);void 0===e.loadedKeys&&(u.value=s),i()}o(t)})),h.value=arrAdd(h.value,n)}));return i.catch((function(){})),i},ee=function(t,n){var i=e.onMouseenter;i&&i({event:t,node:n})},te=function(t,n){var i=e.onMouseleave;i&&i({event:t,node:n})},ne=function(t,n){var i=e.onRightClick;i&&(t.preventDefault(),i({event:t,node:n}))},ie=function(t){var n=e.onFocus;_.value=!0,n&&n(t)},oe=function(t){var n=e.onBlur;_.value=!1,le(null),n&&n(t)},re=function(t,n){var i=g.value,o=e.onExpand,r=e.loadData,s=n.expanded,a=n[y.value.key];if(!b.value){i.indexOf(a);var l=!s;if(i=l?arrAdd(i,a):arrDel(i,a),V(i),o&&o(i,{node:n,expanded:l,nativeEvent:t}),l&&r){var c=J(n);c&&c.then((function(){})).catch((function(e){var t=arrDel(g.value,a);V(t),Promise.reject(e)}))}}},se=function(){b.value=!0},ae=function(){setTimeout((function(){b.value=!1}))},le=function(t){var n=e.onActiveChange;C.value!==t&&(void 0!==e.activeKey&&(C.value=t),null!==t&&B({key:t}),n&&n(t))},ce=computed((function(){return null===C.value?null:P.value.find((function(e){return e.key===C.value}))||null})),de=function(e){var t=P.value.findIndex((function(e){return e.key===C.value}));-1===t&&e<0&&(t=P.value.length),t=(t+e+P.value.length)%P.value.length;var n=P.value[t];if(n){var i=n.key;le(i)}else le(null)},ue=computed((function(){return convertNodePropsToEventData(_extends$1(_extends$1({},getTreeNodeProps(C.value,T.value)),{data:ce.value.data,active:!0}))})),he=function(t){var n=e.onKeydown,i=e.checkable,o=e.selectable;switch(t.which){case KeyCode$3.UP:de(-1),t.preventDefault();break;case KeyCode$3.DOWN:de(1),t.preventDefault()}var r=ce.value;if(r&&r.data){var s=!1===r.data.isLeaf||!!(r.data.children||[]).length,a=ue.value;switch(t.which){case KeyCode$3.LEFT:s&&I.value.has(C.value)?re({},a):r.parent&&le(r.parent.key),t.preventDefault();break;case KeyCode$3.RIGHT:s&&!I.value.has(C.value)?re({},a):r.children&&r.children.length&&le(r.children[0].key),t.preventDefault();break;case KeyCode$3.ENTER:case KeyCode$3.SPACE:!i||a.disabled||!1===a.checkable||a.disableCheckbox?i||!o||a.disabled||!1===a.selectable||Z({},a):Q({},a,!N.value.has(C.value))}}n&&n(t)};return o({onNodeExpand:re,scrollTo:B,onKeydown:he,selectedKeys:computed((function(){return l.value})),checkedKeys:computed((function(){return c.value})),halfCheckedKeys:computed((function(){return d.value})),loadedKeys:computed((function(){return u.value})),loadingKeys:computed((function(){return h.value})),expandedKeys:computed((function(){return g.value}))}),onUnmounted((function(){window.removeEventListener("dragend",z),r.value=!0})),useProvideKeysState({expandedKeys:g,selectedKeys:l,loadedKeys:u,loadingKeys:h,checkedKeys:c,halfCheckedKeys:d,expandedKeysSet:I,selectedKeysSet:k,loadedKeysSet:L,loadingKeysSet:D,checkedKeysSet:N,halfCheckedKeysSet:O,flattenNodes:P}),function(){var t,o,r=f.draggingNodeKey,s=f.dropLevelOffset,l=f.dropContainerKey,c=f.dropTargetKey,d=f.dropPosition,u=f.dragOverNodeKey,h=e.prefixCls,g=e.showLine,p=e.focusable,m=e.tabindex,b=void 0===m?0:m,y=e.selectable,w=e.showIcon,E=e.icon,x=void 0===E?i.icon:E,T=e.switcherIcon,I=e.draggable,k=e.checkable,L=e.checkStrictly,D=e.disabled,N=e.motion,O=e.loadData,A=e.filterTreeNode,P=e.height,R=e.itemHeight,M=e.virtual,$=e.dropIndicatorRender,F=e.onContextmenu,B=e.onScroll,V=e.direction,W=n.class,z=n.style,de=pickAttrs(_extends$1(_extends$1({},e),n),{aria:!0,data:!0});return I&&(o="object"===_typeof$3(I)?I:"function"==typeof I?{nodeDraggable:I}:{}),createVNode(TreeContext,{value:{prefixCls:h,selectable:y,showIcon:w,icon:x,switcherIcon:T,draggable:o,draggingNodeKey:r,checkable:k,customCheckable:i.checkable,checkStrictly:L,disabled:D,keyEntities:v.value,dropLevelOffset:s,dropContainerKey:l,dropTargetKey:c,dropPosition:d,dragOverNodeKey:u,dragging:null!==r,indent:a.value,direction:V,dropIndicatorRender:$,loadData:O,filterTreeNode:A,onNodeClick:Y,onNodeDoubleClick:X,onNodeExpand:re,onNodeSelect:Z,onNodeCheck:Q,onNodeLoad:J,onNodeMouseEnter:ee,onNodeMouseLeave:te,onNodeContextMenu:ne,onNodeDragStart:K,onNodeDragEnter:j,onNodeDragOver:U,onNodeDragLeave:G,onNodeDragEnd:H,onNodeDrop:q,slots:i}},{default:function(){return[createVNode("div",{role:"tree",class:classNames(h,W,(t={},_defineProperty$P(t,"".concat(h,"-show-line"),g),_defineProperty$P(t,"".concat(h,"-focused"),_.value),_defineProperty$P(t,"".concat(h,"-active-focused"),null!==C.value),t))},[createVNode(NodeList,_objectSpread2$1({ref:S,prefixCls:h,style:z,disabled:D,selectable:y,checkable:!!k,motion:N,height:P,itemHeight:R,virtual:M,focusable:p,focused:_.value,tabindex:b,activeItem:ce.value,onFocus:ie,onBlur:oe,onKeydown:he,onActiveChange:le,onListChangeStart:se,onListChangeEnd:ae,onContextmenu:F,onScroll:B},de),null)])]}})}}}),FileOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},FileOutlinedSvg=FileOutlined$2;function _objectSpread$l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$l(e,t,n[t])}))}return e}function _defineProperty$l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var FileOutlined=function(e,t){var n=_objectSpread$l({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$l({},n,{icon:FileOutlinedSvg}),null)};FileOutlined.displayName="FileOutlined",FileOutlined.inheritAttrs=!1;var FileOutlined$1=FileOutlined,MinusSquareOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},MinusSquareOutlinedSvg=MinusSquareOutlined$2;function _objectSpread$k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$k(e,t,n[t])}))}return e}function _defineProperty$k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var MinusSquareOutlined=function(e,t){var n=_objectSpread$k({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$k({},n,{icon:MinusSquareOutlinedSvg}),null)};MinusSquareOutlined.displayName="MinusSquareOutlined",MinusSquareOutlined.inheritAttrs=!1;var MinusSquareOutlined$1=MinusSquareOutlined,PlusSquareOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},PlusSquareOutlinedSvg=PlusSquareOutlined$2;function _objectSpread$j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$j(e,t,n[t])}))}return e}function _defineProperty$j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var PlusSquareOutlined=function(e,t){var n=_objectSpread$j({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$j({},n,{icon:PlusSquareOutlinedSvg}),null)};PlusSquareOutlined.displayName="PlusSquareOutlined",PlusSquareOutlined.inheritAttrs=!1;var PlusSquareOutlined$1=PlusSquareOutlined,CaretDownFilled$2={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},CaretDownFilledSvg=CaretDownFilled$2;function _objectSpread$i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$i(e,t,n[t])}))}return e}function _defineProperty$i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var CaretDownFilled=function(e,t){var n=_objectSpread$i({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$i({},n,{icon:CaretDownFilledSvg}),null)};CaretDownFilled.displayName="CaretDownFilled",CaretDownFilled.inheritAttrs=!1;var CaretDownFilled$1=CaretDownFilled;function renderSwitcherIcon(e,t,n,i){var o,r=i.isLeaf,s=i.expanded,a=t;if(i.loading)return createVNode(LoadingOutlined$1,{class:"".concat(e,"-switcher-loading-icon")},null);n&&"object"===_typeof$3(n)&&(o=n.showLeafIcon);var l=null,c="".concat(e,"-switcher-icon");return r?(n&&(l="object"!==_typeof$3(n)||o?createVNode(FileOutlined$1,{class:"".concat(e,"-switcher-line-icon")},null):createVNode("span",{class:"".concat(e,"-switcher-leaf-line")},null)),l):(l=createVNode(CaretDownFilled$1,{class:c},null),n&&(l=createVNode(s?MinusSquareOutlined$1:PlusSquareOutlined$1,{class:"".concat(e,"-switcher-line-icon")},null)),"function"==typeof t?a=t(_extends$1(_extends$1({},i),{defaultIcon:l,switcherCls:c})):isValidElement(a)&&(a=cloneVNode(a,{class:c})),a||l)}var offset=4;function dropIndicatorRender(e){var t,n=e.dropPosition,i=e.dropLevelOffset,o=e.prefixCls,r=e.indent,s=e.direction,a=void 0===s?"ltr":s,l="ltr"===a?"left":"right",c="ltr"===a?"right":"left",d=(_defineProperty$P(t={},l,"".concat(-i*r+offset,"px")),_defineProperty$P(t,c,0),t);switch(n){case-1:d.top="".concat(-3,"px");break;case 1:d.bottom="".concat(-3,"px");break;default:d.bottom="".concat(-3,"px"),d[l]="".concat(r+offset,"px")}return createVNode("div",{style:d,class:"".concat(o,"-drop-indicator")},null)}var treeProps=function(){var e=treeProps$1();return _extends$1(_extends$1({},e),{showLine:{type:[Boolean,Object],default:void 0},multiple:{type:Boolean,default:void 0},autoExpandParent:{type:Boolean,default:void 0},checkStrictly:{type:Boolean,default:void 0},checkable:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},defaultExpandAll:{type:Boolean,default:void 0},defaultExpandParent:{type:Boolean,default:void 0},defaultExpandedKeys:{type:Array},expandedKeys:{type:Array},checkedKeys:{type:[Array,Object]},defaultCheckedKeys:{type:Array},selectedKeys:{type:Array},defaultSelectedKeys:{type:Array},selectable:{type:Boolean,default:void 0},loadedKeys:{type:Array},draggable:{type:Boolean,default:void 0},showIcon:{type:Boolean,default:void 0},icon:{type:Function},switcherIcon:PropTypes$1.any,prefixCls:String,replaceFields:{type:Object},blockNode:{type:Boolean,default:void 0},openAnimation:PropTypes$1.any,onDoubleclick:e.onDblclick,"onUpdate:selectedKeys":Function,"onUpdate:checkedKeys":Function,"onUpdate:expandedKeys":Function})},Tree=defineComponent({name:"ATree",inheritAttrs:!1,props:initDefaultProps$1(treeProps(),{checkable:!1,selectable:!0,showIcon:!1,blockNode:!1}),slots:["icon","title","switcherIcon","titleRender"],setup:function(e,t){var n=t.attrs,i=t.expose,o=t.emit,r=t.slots;warning$3(!(void 0===e.treeData&&r.default));var s=useConfigInject("tree",e),a=s.prefixCls,l=s.direction,c=s.virtual,d=ref();i({treeRef:d,onNodeExpand:function(){var e,t;null===(t=d.value)||void 0===t||(e=t).onNodeExpand.apply(e,arguments)},scrollTo:function(e){var t;null===(t=d.value)||void 0===t||t.scrollTo(e)},selectedKeys:computed((function(){var e;return null===(e=d.value)||void 0===e?void 0:e.selectedKeys})),checkedKeys:computed((function(){var e;return null===(e=d.value)||void 0===e?void 0:e.checkedKeys})),halfCheckedKeys:computed((function(){var e;return null===(e=d.value)||void 0===e?void 0:e.halfCheckedKeys})),loadedKeys:computed((function(){var e;return null===(e=d.value)||void 0===e?void 0:e.loadedKeys})),loadingKeys:computed((function(){var e;return null===(e=d.value)||void 0===e?void 0:e.loadingKeys})),expandedKeys:computed((function(){var e;return null===(e=d.value)||void 0===e?void 0:e.expandedKeys}))}),watchEffect((function(){devWarning(void 0===e.replaceFields,"Tree","`replaceFields` is deprecated, please use fieldNames instead")}));var u=function(e,t){o("update:checkedKeys",e),o("check",e,t)},h=function(e,t){o("update:expandedKeys",e),o("expand",e,t)},g=function(e,t){o("update:selectedKeys",e),o("select",e,t)};return function(){var t,i=e.showIcon,o=e.showLine,s=e.switcherIcon,p=void 0===s?r.switcherIcon:s,f=e.icon,m=void 0===f?r.icon:f,v=e.blockNode,_=e.checkable,C=e.selectable,b=e.fieldNames,y=void 0===b?e.replaceFields:b,S=e.motion,w=void 0===S?e.openAnimation:S,E=e.itemHeight,x=void 0===E?28:E,T=e.onDoubleclick,I=e.onDblclick,k=_extends$1(_extends$1(_extends$1({},n),omit$2(e,["onUpdate:checkedKeys","onUpdate:expandedKeys","onUpdate:selectedKeys","onDoubleclick"])),{showLine:Boolean(o),dropIndicatorRender:dropIndicatorRender,fieldNames:y,icon:m,itemHeight:x}),L=r.default?filterEmpty(r.default()):void 0;return createVNode(Tree$1,_objectSpread2$1(_objectSpread2$1({},k),{},{virtual:c.value,motion:w,ref:d,prefixCls:a.value,class:classNames((t={},_defineProperty$P(t,"".concat(a.value,"-icon-hide"),!i),_defineProperty$P(t,"".concat(a.value,"-block-node"),v),_defineProperty$P(t,"".concat(a.value,"-unselectable"),!C),_defineProperty$P(t,"".concat(a.value,"-rtl"),"rtl"===l.value),t),n.class),direction:l.value,checkable:_,selectable:C,switcherIcon:function(e){return renderSwitcherIcon(a.value,p,o,e)},onCheck:u,onExpand:h,onSelect:g,onDblclick:I||T,children:L}),_extends$1(_extends$1({},r),{checkable:function(){return createVNode("span",{class:"".concat(a.value,"-checkbox-inner")},null)}}))}}}),FolderOpenOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},FolderOpenOutlinedSvg=FolderOpenOutlined$2;function _objectSpread$h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$h(e,t,n[t])}))}return e}function _defineProperty$h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var FolderOpenOutlined=function(e,t){var n=_objectSpread$h({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$h({},n,{icon:FolderOpenOutlinedSvg}),null)};FolderOpenOutlined.displayName="FolderOpenOutlined",FolderOpenOutlined.inheritAttrs=!1;var FolderOpenOutlined$1=FolderOpenOutlined,FolderOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},FolderOutlinedSvg=FolderOutlined$2;function _objectSpread$g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$g(e,t,n[t])}))}return e}function _defineProperty$g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var FolderOutlined=function(e,t){var n=_objectSpread$g({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$g({},n,{icon:FolderOutlinedSvg}),null)};FolderOutlined.displayName="FolderOutlined",FolderOutlined.inheritAttrs=!1;var FolderOutlined$1=FolderOutlined,Record,Record2;function traverseNodesKey(e,t,n){e.forEach((function(e){var i=e[t.key],o=e[t.children];!1!==n(i,e)&&traverseNodesKey(o||[],t,n)}))}function calcRangeKeys(e){var t=e.treeData,n=e.expandedKeys,i=e.startKey,o=e.endKey,r=e.fieldNames,s=void 0===r?{title:"title",key:"key",children:"children"}:r,a=[],l=Record.None;if(i&&i===o)return[i];if(!i||!o)return[];return traverseNodesKey(t,s,(function(e){if(l===Record.End)return!1;if(function(e){return e===i||e===o}(e)){if(a.push(e),l===Record.None)l=Record.Start;else if(l===Record.Start)return l=Record.End,!1}else l===Record.Start&&a.push(e);return-1!==n.indexOf(e)})),a}function convertDirectoryKeysToNodes(e,t,n){var i=_toConsumableArray$2(t),o=[];return traverseNodesKey(e,n,(function(e,t){var n=i.indexOf(e);return-1!==n&&(o.push(t),i.splice(n,1)),!!i.length})),o}Record2=Record||(Record={}),Record2[Record2.None=0]="None",Record2[Record2.Start=1]="Start",Record2[Record2.End=2]="End";var __rest$4=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},directoryTreeProps=function(){return _extends$1(_extends$1({},treeProps()),{expandAction:{type:[Boolean,String]}})};function getIcon(e){var t=e.isLeaf,n=e.expanded;return createVNode(t?FileOutlined$1:n?FolderOpenOutlined$1:FolderOutlined$1,null,null)}var DirectoryTree=defineComponent({name:"ADirectoryTree",inheritAttrs:!1,props:initDefaultProps$1(directoryTreeProps(),{showIcon:!0,expandAction:"click"}),slots:["icon","title","switcherIcon","titleRender"],setup:function(e,t){var n,i=t.attrs,o=t.slots,r=t.emit,s=t.expose,a=ref(e.treeData||convertTreeToData(filterEmpty(null===(n=o.default)||void 0===n?void 0:n.call(o))));watch((function(){return e.treeData}),(function(){a.value=e.treeData})),onUpdated((function(){nextTick((function(){var t;void 0===e.treeData&&o.default&&(a.value=convertTreeToData(filterEmpty(null===(t=o.default)||void 0===t?void 0:t.call(o))))}))}));var l=ref(),c=ref(),d=ref();s({selectedKeys:computed((function(){var e;return null===(e=d.value)||void 0===e?void 0:e.selectedKeys})),checkedKeys:computed((function(){var e;return null===(e=d.value)||void 0===e?void 0:e.checkedKeys})),halfCheckedKeys:computed((function(){var e;return null===(e=d.value)||void 0===e?void 0:e.halfCheckedKeys})),loadedKeys:computed((function(){var e;return null===(e=d.value)||void 0===e?void 0:e.loadedKeys})),loadingKeys:computed((function(){var e;return null===(e=d.value)||void 0===e?void 0:e.loadingKeys})),expandedKeys:computed((function(){var e;return null===(e=d.value)||void 0===e?void 0:e.expandedKeys}))});var u,h=ref(e.selectedKeys||e.defaultSelectedKeys||[]),g=ref((u=convertDataToEntities(a.value).keyEntities,e.defaultExpandAll?Object.keys(u):e.defaultExpandParent?conductExpandParent(e.expandedKeys||e.defaultExpandedKeys||[],u):e.expandedKeys||e.defaultExpandedKeys));watch((function(){return e.selectedKeys}),(function(){void 0!==e.selectedKeys&&(h.value=e.selectedKeys)}),{immediate:!0}),watch((function(){return e.expandedKeys}),(function(){void 0!==e.expandedKeys&&(g.value=e.expandedKeys)}),{immediate:!0});var p=debounce((function(e,t){t.isLeaf||e.shiftKey||e.metaKey||e.ctrlKey||d.value.onNodeExpand(e,t)}),200,{leading:!0}),f=function(t,n){void 0===e.expandedKeys&&(g.value=t),r("update:expandedKeys",t),r("expand",t,n)},m=function(t,n){"click"===e.expandAction&&p(t,n),r("click",t,n)},v=function(t,n){var i=e.expandAction;"dblclick"!==i&&"doubleclick"!==i||p(t,n),r("doubleclick",t,n),r("dblclick",t,n)},_=computed((function(){return fillFieldNames$1(e.fieldNames)})),C=function(t,n){var i,o=e.multiple,s=n.node,d=n.nativeEvent,u=s[_.value.key],p=_extends$1(_extends$1({},n),{selected:!0}),f=(null==d?void 0:d.ctrlKey)||(null==d?void 0:d.metaKey),m=null==d?void 0:d.shiftKey;o&&f?(i=t,l.value=u,c.value=i,p.selectedNodes=convertDirectoryKeysToNodes(a.value,i,_.value)):o&&m?(i=Array.from(new Set([].concat(_toConsumableArray$2(c.value||[]),_toConsumableArray$2(calcRangeKeys({treeData:a.value,expandedKeys:g.value,startKey:u,endKey:l.value,fieldNames:_.value}))))),p.selectedNodes=convertDirectoryKeysToNodes(a.value,i,_.value)):(i=[u],l.value=u,c.value=i,p.selectedNodes=convertDirectoryKeysToNodes(a.value,i,_.value)),r("update:selectedKeys",i),r("select",i,p),void 0===e.selectedKeys&&(h.value=i)},b=function(e,t){r("update:checkedKeys",e),r("check",e,t)},y=useConfigInject("tree",e),S=y.prefixCls,w=y.direction;return function(){var t=classNames("".concat(S.value,"-directory"),_defineProperty$P({},"".concat(S.value,"-directory-rtl"),"rtl"===w.value),i.class),n=e.icon,r=void 0===n?o.icon:n,s=e.blockNode,a=void 0===s||s,l=__rest$4(e,["icon","blockNode"]);return createVNode(Tree,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},i),{},{icon:r||getIcon,ref:d,blockNode:a},l),{},{prefixCls:S.value,class:t,expandedKeys:g.value,selectedKeys:h.value,onSelect:C,onClick:m,onDblclick:v,onExpand:f,onCheck:b}),o)}}}),TreeNode$3=defineComponent(_extends$1(_extends$1({},VcTreeNode),{name:"ATreeNode",props:treeNodeProps})),__unplugin_components_0=_extends$1(Tree,{DirectoryTree:DirectoryTree,TreeNode:TreeNode$3,install:function(e){return e.component(Tree.name,Tree),e.component(TreeNode$3.name,TreeNode$3),e.component(DirectoryTree.name,DirectoryTree),e}}),SubMenu=Menu$2.SubMenu,MenuItem=Menu$2.Item;function hasSubMenu(e){return e.some((function(e){var t=e.children;return t&&t.length>0}))}function searchValueMatched(e,t){return("string"==typeof t||"number"==typeof t)&&(null==t?void 0:t.toString().toLowerCase().includes(e.trim().toLowerCase()))}function renderFilterItems(e){var t=e.filters,n=e.prefixCls,i=e.filteredKeys,o=e.filterMultiple,r=e.searchValue,s=e.filterSearch;return t.map((function(e,t){var a=String(e.value);if(e.children)return createVNode(SubMenu,{key:a||t,title:e.text,popupClassName:"".concat(n,"-dropdown-submenu")},{default:function(){return[renderFilterItems({filters:e.children,prefixCls:n,filteredKeys:i,filterMultiple:o,searchValue:r,filterSearch:s})]}});var l=o?Checkbox$1:Radio,c=createVNode(MenuItem,{key:void 0!==e.value?a:t},{default:function(){return[createVNode(l,{checked:i.includes(a)},null),createVNode("span",null,[e.text])]}});return r.trim()?"function"==typeof s?s(r,e)?c:void 0:searchValueMatched(r,e.text)?c:void 0:c}))}var FilterDropdown=defineComponent({name:"FilterDropdown",props:["tablePrefixCls","prefixCls","dropdownPrefixCls","column","filterState","filterMultiple","filterMode","filterSearch","columnKey","triggerFilter","locale","getPopupContainer"],setup:function(e,t){var n=t.slots,i=useInjectSlots(),o=computed((function(){var t;return null!==(t=e.filterMode)&&void 0!==t?t:"menu"})),r=computed((function(){var t;return null!==(t=e.filterSearch)&&void 0!==t&&t})),s=computed((function(){return e.column.filterDropdownVisible})),a=ref(!1),l=computed((function(){var t;return!(!e.filterState||!(null===(t=e.filterState.filteredKeys)||void 0===t?void 0:t.length)&&!e.filterState.forceFiltered)})),c=computed((function(){var t;return flattenKeys(null===(t=e.column)||void 0===t?void 0:t.filters)})),d=computed((function(){var t=e.column,n=t.filterDropdown,o=t.slots,r=void 0===o?{}:o,s=t.customFilterDropdown;return n||r.filterDropdown&&i.value[r.filterDropdown]||s&&i.value.customFilterDropdown})),u=computed((function(){var t=e.column,n=t.filterIcon,o=t.slots,r=void 0===o?{}:o;return n||r.filterIcon&&i.value[r.filterIcon]||i.value.customFilterIcon})),h=function(t){var n,i;a.value=t,null===(i=(n=e.column).onFilterDropdownVisibleChange)||void 0===i||i.call(n,t)},g=computed((function(){return"boolean"==typeof s.value?s.value:a.value})),p=computed((function(){var t;return null===(t=e.filterState)||void 0===t?void 0:t.filteredKeys})),f=shallowRef([]),m=function(e){var t=e.selectedKeys;f.value=t},v=function(t,n){var i=n.node,o=n.checked;e.filterMultiple?m({selectedKeys:t}):m({selectedKeys:o&&i.key?[i.key]:[]})};watch(p,(function(){a.value&&m({selectedKeys:p.value||[]})}),{immediate:!0});var _=shallowRef([]),C=ref(),b=function(e){C.value=setTimeout((function(){_.value=e}))},y=function(){clearTimeout(C.value)};onBeforeUnmount((function(){clearTimeout(C.value)}));var S=ref(""),w=function(e){var t=e.target.value;S.value=t};watch(a,(function(){a.value||(S.value="")}));var E=function(t){var n=e.column,i=e.columnKey,o=e.filterState,r=t&&t.length?t:null;return null!==r||o&&o.filteredKeys?isEqual$1(r,null==o?void 0:o.filteredKeys)?null:void e.triggerFilter({column:n,key:i,filteredKeys:r}):null},x=function(){h(!1),E(f.value)},T=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{confirm:!1,closeDropdown:!1},t=e.confirm,n=e.closeDropdown;t&&E([]),n&&h(!1),S.value="",f.value=[]},I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{closeDropdown:!0},t=e.closeDropdown;t&&h(!1),E(f.value)},k=function(e){e&&void 0!==p.value&&(f.value=p.value||[]),h(e),e||d.value||x()},L=useConfigInject("",e).direction,D=function(e){if(e.target.checked){var t=c.value;f.value=t}else f.value=[]},N=function e(t){return(t.filters||[]).map((function(t,n){var i=String(t.value),o={title:t.text,key:void 0!==t.value?i:n};return t.children&&(o.children=e({filters:t.children})),o}))},O=computed((function(){return N({filters:e.column.filters})})),A=computed((function(){return classNames(_defineProperty$P({},"".concat(e.dropdownPrefixCls,"-menu-without-submenu"),!hasSubMenu(e.column.filters||[])))})),P=function(){var t=f.value,n=e.column,i=e.locale,s=e.tablePrefixCls,a=e.filterMultiple,l=e.dropdownPrefixCls,d=e.getPopupContainer,u=e.prefixCls;return 0===(n.filters||[]).length?createVNode(__unplugin_components_0$7,{image:__unplugin_components_0$7.PRESENTED_IMAGE_SIMPLE,description:i.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}},null):"tree"===o.value?createVNode(Fragment,null,[createVNode(FilterSearch,{filterSearch:r.value,value:S.value,onChange:w,tablePrefixCls:s,locale:i},null),createVNode("div",{class:"".concat(s,"-filter-dropdown-tree")},[a?createVNode(Checkbox$1,{class:"".concat(s,"-filter-dropdown-checkall"),onChange:D,checked:t.length===c.value.length,indeterminate:t.length>0&&t.length<c.value.length},{default:function(){return[i.filterCheckall]}}):null,createVNode(__unplugin_components_0,{checkable:!0,selectable:!1,blockNode:!0,multiple:a,checkStrictly:!a,class:"".concat(l,"-menu"),onCheck:v,checkedKeys:t,selectedKeys:t,showIcon:!1,treeData:O.value,autoExpandParent:!0,defaultExpandAll:!0,filterTreeNode:S.value.trim()?function(e){return searchValueMatched(S.value,e.title)}:void 0},null)])]):createVNode(Fragment,null,[createVNode(FilterSearch,{filterSearch:r.value,value:S.value,onChange:w,tablePrefixCls:s,locale:i},null),createVNode(Menu$2,{multiple:a,prefixCls:"".concat(l,"-menu"),class:A.value,onClick:y,onSelect:m,onDeselect:m,selectedKeys:t,getPopupContainer:d,openKeys:_.value,onOpenChange:b},{default:function(){return renderFilterItems({filters:n.filters||[],filterSearch:r.value,prefixCls:u,filteredKeys:f.value,filterMultiple:a,searchValue:S.value})}})])};return function(){var t,i,o=e.tablePrefixCls,r=e.prefixCls,s=e.column,a=e.dropdownPrefixCls,c=e.locale,h=e.getPopupContainer;if("function"==typeof d.value)i=d.value({prefixCls:"".concat(a,"-custom"),setSelectedKeys:function(e){return m({selectedKeys:e})},selectedKeys:f.value,confirm:I,clearFilters:T,filters:s.filters,visible:g.value,column:s.__originColumn__});else if(d.value)i=d.value;else{var p=f.value;i=createVNode(Fragment,null,[P(),createVNode("div",{class:"".concat(r,"-dropdown-btns")},[createVNode(Button$2,{type:"link",size:"small",disabled:0===p.length,onClick:function(){return T()}},{default:function(){return[c.filterReset]}}),createVNode(Button$2,{type:"primary",size:"small",onClick:x},{default:function(){return[c.filterConfirm]}})])])}var v,_=createVNode(FilterDropdownMenuWrapper$1,{class:"".concat(r,"-dropdown")},{default:function(){return[i]}});return v="function"==typeof u.value?u.value({filtered:l.value,column:s.__originColumn__}):u.value?u.value:createVNode(FilterFilled$1,null,null),createVNode("div",{class:"".concat(r,"-column")},[createVNode("span",{class:"".concat(o,"-column-title")},[null===(t=n.default)||void 0===t?void 0:t.call(n)]),createVNode(Dropdown$1,{overlay:_,trigger:["click"],visible:g.value,onVisibleChange:k,getPopupContainer:h,placement:"rtl"===L.value?"bottomLeft":"bottomRight"},{default:function(){return[createVNode("span",{role:"button",tabindex:-1,class:classNames("".concat(r,"-trigger"),{active:l.value}),onClick:function(e){e.stopPropagation()}},[v])]}})])}}});function collectFilterStates(e,t,n){var i=[];return(e||[]).forEach((function(e,o){var r,s,a=getColumnPos(o,n),l=e.filterDropdown||(null===(r=null==e?void 0:e.slots)||void 0===r?void 0:r.filterDropdown)||e.customFilterDropdown;if(e.filters||l||"onFilter"in e)if("filteredValue"in e){var c=e.filteredValue;l||(c=null!==(s=null==c?void 0:c.map(String))&&void 0!==s?s:c),i.push({column:e,key:getColumnKey(e,a),filteredKeys:c,forceFiltered:e.filtered})}else i.push({column:e,key:getColumnKey(e,a),filteredKeys:t&&e.defaultFilteredValue?e.defaultFilteredValue:void 0,forceFiltered:e.filtered});"children"in e&&(i=[].concat(_toConsumableArray$2(i),_toConsumableArray$2(collectFilterStates(e.children,t,a))))})),i}function injectFilter(e,t,n,i,o,r,s,a){return n.map((function(n,l){var c,d=getColumnPos(l,a),u=n.filterMultiple,h=void 0===u||u,g=n.filterMode,p=n.filterSearch,f=n,m=n.filterDropdown||(null===(c=null==n?void 0:n.slots)||void 0===c?void 0:c.filterDropdown)||n.customFilterDropdown;if(f.filters||m){var v=getColumnKey(f,d),_=i.find((function(e){var t=e.key;return v===t}));f=_extends$1(_extends$1({},f),{title:function(i){return createVNode(FilterDropdown,{tablePrefixCls:e,prefixCls:"".concat(e,"-filter"),dropdownPrefixCls:t,column:f,columnKey:v,filterState:_,filterMultiple:h,filterMode:g,filterSearch:p,triggerFilter:o,locale:s,getPopupContainer:r},{default:function(){return[renderColumnTitle(n.title,i)]}})}})}return"children"in f&&(f=_extends$1(_extends$1({},f),{children:injectFilter(e,t,f.children,i,o,r,s,d)})),f}))}function flattenKeys(e){var t=[];return(e||[]).forEach((function(e){var n=e.value,i=e.children;t.push(n),i&&(t=[].concat(_toConsumableArray$2(t),_toConsumableArray$2(flattenKeys(i))))})),t}function generateFilterInfo(e){var t={};return e.forEach((function(e){var n,i=e.key,o=e.filteredKeys,r=e.column,s=r.filterDropdown||(null===(n=null==r?void 0:r.slots)||void 0===n?void 0:n.filterDropdown)||r.customFilterDropdown,a=r.filters;if(s)t[i]=o||null;else if(Array.isArray(o)){var l=flattenKeys(a);t[i]=l.filter((function(e){return o.includes(String(e))}))}else t[i]=null})),t}function getFilterData(e,t){return t.reduce((function(e,t){var n=t.column,i=n.onFilter,o=n.filters,r=t.filteredKeys;return i&&r&&r.length?e.filter((function(e){return r.some((function(t){var n=flattenKeys(o),r=n.findIndex((function(e){return String(e)===String(t)})),s=-1!==r?n[r]:t;return i(s,e)}))})):e}),e)}function useFilter(e){var t=e.prefixCls,n=e.dropdownPrefixCls,i=e.mergedColumns,o=e.locale,r=e.onFilterChange,s=e.getPopupContainer,a=_slicedToArray$2(useState(collectFilterStates(i.value,!0)),2),l=a[0],c=a[1],d=computed((function(){var e=collectFilterStates(i.value,!1),t=e.every((function(e){return void 0===e.filteredKeys}));if(t)return l.value;var n=e.every((function(e){return void 0!==e.filteredKeys}));return devWarning(t||n,"Table","`FilteredKeys` should all be controlled or not controlled."),e})),u=computed((function(){return generateFilterInfo(d.value)})),h=function(e){var t=d.value.filter((function(t){return t.key!==e.key}));t.push(e),c(t),r(generateFilterInfo(t),t)};return[function(e){return injectFilter(t.value,n.value,e,d.value,h,s.value,o.value)},d,u]}function fillTitle(e,t){return e.map((function(e){var n=_extends$1({},e);return n.title=renderColumnTitle(n.title,t),"children"in n&&(n.children=fillTitle(n.children,t)),n}))}function useTitleColumns(e){return[function(t){return fillTitle(t,e.value)}]}function renderExpandIcon(e){return function(t){var n,i=t.prefixCls,o=t.onExpand,r=t.record,s=t.expanded,a=t.expandable,l="".concat(i,"-row-expand-icon");return createVNode("button",{type:"button",onClick:function(e){o(r,e),e.stopPropagation()},class:classNames(l,(n={},_defineProperty$P(n,"".concat(l,"-spaced"),!a),_defineProperty$P(n,"".concat(l,"-expanded"),a&&s),_defineProperty$P(n,"".concat(l,"-collapsed"),a&&!s),n)),"aria-label":s?e.collapse:e.expand},null)}}function fillSlots(e,t){var n=t.value;return e.map((function(e){var i;if(e===SELECTION_COLUMN||e===EXPAND_COLUMN)return e;var o=_extends$1({},e),r=o.slots,s=void 0===r?{}:r;return o.__originColumn__=e,devWarning(!("slots"in o),"Table","`column.slots` is deprecated. Please use `v-slot:headerCell` `v-slot:bodyCell` instead."),Object.keys(s).forEach((function(e){var t=s[e];void 0===o[e]&&n[t]&&(o[e]=n[t])})),t.value.headerCell&&!(null===(i=e.slots)||void 0===i?void 0:i.title)&&(o.title=renderSlot(t.value,"headerCell",{title:e.title,column:e},(function(){return[e.title]}))),"children"in o&&(o.children=fillSlots(o.children,t)),o}))}function useColumns(e){return[function(t){return fillSlots(t,e)}]}var EMPTY_LIST=[],tableProps=function(){return{prefixCls:{type:String,default:void 0},columns:{type:Array,default:void 0},rowKey:{type:[String,Function],default:void 0},tableLayout:{type:String,default:void 0},rowClassName:{type:[String,Function],default:void 0},title:{type:Function,default:void 0},footer:{type:Function,default:void 0},id:{type:String,default:void 0},showHeader:{type:Boolean,default:void 0},components:{type:Object,default:void 0},customRow:{type:Function,default:void 0},customHeaderRow:{type:Function,default:void 0},direction:{type:String,default:void 0},expandFixed:{type:[Boolean,String],default:void 0},expandColumnWidth:{type:Number,default:void 0},expandedRowKeys:{type:Array,default:void 0},defaultExpandedRowKeys:{type:Array,default:void 0},expandedRowRender:{type:Function,default:void 0},expandRowByClick:{type:Boolean,default:void 0},expandIcon:{type:Function,default:void 0},onExpand:{type:Function,default:void 0},onExpandedRowsChange:{type:Function,default:void 0},"onUpdate:expandedRowKeys":{type:Function,default:void 0},defaultExpandAllRows:{type:Boolean,default:void 0},indentSize:{type:Number,default:void 0},expandIconColumnIndex:{type:Number,default:void 0},showExpandColumn:{type:Boolean,default:void 0},expandedRowClassName:{type:Function,default:void 0},childrenColumnName:{type:String,default:void 0},rowExpandable:{type:Function,default:void 0},sticky:{type:[Boolean,Object],default:void 0},dropdownPrefixCls:String,dataSource:{type:Array,default:void 0},pagination:{type:[Boolean,Object],default:void 0},loading:{type:[Boolean,Object],default:void 0},size:{type:String,default:void 0},bordered:Boolean,locale:{type:Object,default:void 0},onChange:{type:Function,default:void 0},onResizeColumn:{type:Function,default:void 0},rowSelection:{type:Object,default:void 0},getPopupContainer:{type:Function,default:void 0},scroll:{type:Object,default:void 0},sortDirections:{type:Array,default:void 0},showSorterTooltip:{type:[Boolean,Object],default:!0},contextSlots:{type:Object},transformCellText:{type:Function}}},InteralTable=defineComponent({name:"InteralTable",inheritAttrs:!1,props:initDefaultProps$1(tableProps(),{rowKey:"key"}),slots:["emptyText","expandIcon","title","footer","summary","expandedRowRender","bodyCell","headerCell","customFilterIcon","customFilterDropdown"],setup:function(e,t){var n=t.attrs,i=t.slots,o=t.expose,r=t.emit;devWarning(!("function"==typeof e.rowKey&&e.rowKey.length>1),"Table","`index` parameter of `rowKey` function is deprecated. There is no guarantee that it will work as expected."),useProvideSlots(computed((function(){return e.contextSlots}))),useProvideTableContext({onResizeColumn:function(e,t){r("resizeColumn",e,t)}});var s=useBreakpoint(),a=computed((function(){var t=new Set(Object.keys(s.value).filter((function(e){return s.value[e]})));return e.columns.filter((function(e){return!e.responsive||e.responsive.some((function(e){return t.has(e)}))}))})),l=useConfigInject("table",e),c=l.size,d=l.renderEmpty,u=l.direction,h=l.prefixCls,g=l.configProvider,p=computed((function(){return e.transformCellText||g.transformCellText})),f=_slicedToArray$2(useLocaleReceiver("Table",defaultLocale.Table,toRef(e,"locale")),1)[0],m=computed((function(){return e.dataSource||EMPTY_LIST})),v=computed((function(){return g.getPrefixCls("dropdown",e.dropdownPrefixCls)})),_=computed((function(){return e.childrenColumnName||"children"})),C=computed((function(){return m.value.some((function(e){var t;return null===(t=e)||void 0===t?void 0:t[_.value]}))?"nest":e.expandedRowRender?"row":null})),b=reactive({body:null}),y=function(e){_extends$1(b,e)},S=computed((function(){return"function"==typeof e.rowKey?e.rowKey:function(t){var n;return null===(n=t)||void 0===n?void 0:n[e.rowKey]}})),w=_slicedToArray$2(useLazyKVMap(m,_,S),1)[0],E={},x=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.pagination,r=e.scroll,s=e.onChange,a=_extends$1(_extends$1({},E),t);i&&(E.resetPagination(),a.pagination.current&&(a.pagination.current=1),o&&o.onChange&&o.onChange(1,a.pagination.pageSize)),r&&!1!==r.scrollToFirstRowOnChange&&b.body&&scrollTo(0,{getContainer:function(){return b.body}}),null==s||s(a.pagination,a.filters,a.sorter,{currentDataSource:getFilterData(getSortData$1(m.value,a.sorterStates,_.value),a.filterStates),action:n})},T=_slicedToArray$2(useFilterSorter({prefixCls:h,mergedColumns:a,onSorterChange:function(e,t){x({sorter:e,sorterStates:t},"sort",!1)},sortDirections:computed((function(){return e.sortDirections||["ascend","descend"]})),tableLocale:f,showSorterTooltip:toRef(e,"showSorterTooltip")}),4),I=T[0],k=T[1],L=T[2],D=T[3],N=computed((function(){return getSortData$1(m.value,k.value,_.value)})),O=_slicedToArray$2(useFilter({prefixCls:h,locale:f,dropdownPrefixCls:v,mergedColumns:a,onFilterChange:function(e,t){x({filters:e,filterStates:t},"filter",!0)},getPopupContainer:toRef(e,"getPopupContainer")}),3),A=O[0],P=O[1],R=O[2],M=computed((function(){return getFilterData(N.value,P.value)})),$=_slicedToArray$2(useColumns(toRef(e,"contextSlots")),1)[0],F=_slicedToArray$2(useTitleColumns(computed((function(){return _extends$1({},L.value)}))),1)[0],B=_slicedToArray$2(usePagination(computed((function(){return M.value.length})),toRef(e,"pagination"),(function(e,t){x({pagination:_extends$1(_extends$1({},E.pagination),{current:e,pageSize:t})},"paginate")})),2),V=B[0],W=B[1];watchEffect((function(){E.sorter=D.value,E.sorterStates=k.value,E.filters=R.value,E.filterStates=P.value,E.pagination=!1===e.pagination?{}:getPaginationParam(e.pagination,V.value),E.resetPagination=W}));var H=computed((function(){if(!1===e.pagination||!V.value.pageSize)return M.value;var t=V.value,n=t.current,i=void 0===n?1:n,o=t.total,r=t.pageSize,s=void 0===r?DEFAULT_PAGE_SIZE:r;return devWarning(i>0,"Table","`current` should be positive number."),M.value.length<o?M.value.length>s?M.value.slice((i-1)*s,i*s):M.value:M.value.slice((i-1)*s,i*s)}));watchEffect((function(){nextTick((function(){var e=V.value,t=e.total,n=e.pageSize,i=void 0===n?DEFAULT_PAGE_SIZE:n;M.value.length<t&&M.value.length>i&&devWarning(!1,"Table","`dataSource` length is less than `pagination.total` but large than `pagination.pageSize`. Please make sure your config correct data with async mode.")}))}),{flush:"post"});var z=computed((function(){return!1===e.showExpandColumn?-1:"nest"===C.value&&void 0===e.expandIconColumnIndex?e.rowSelection?1:0:e.expandIconColumnIndex>0&&e.rowSelection?e.expandIconColumnIndex-1:e.expandIconColumnIndex})),K=ref();watch((function(){return e.rowSelection}),(function(){K.value=e.rowSelection?_extends$1({},e.rowSelection):e.rowSelection}),{deep:!0,immediate:!0});var j=_slicedToArray$2(useSelection(K,{prefixCls:h,data:M,pageData:H,getRowKey:S,getRecordByKey:w,expandType:C,childrenColumnName:_,locale:f,getPopupContainer:computed((function(){return e.getPopupContainer}))}),2),U=j[0],G=j[1],q=function(t,n,i){var o,r=e.rowClassName;return o=classNames("function"==typeof r?r(t,n,i):r),classNames(_defineProperty$P({},"".concat(h.value,"-row-selected"),G.value.has(S.value(t,n))),o)};o({selectedKeySet:G});var Y=computed((function(){return"number"==typeof e.indentSize?e.indentSize:15})),X=function(e){return F(U(A(I($(e)))))};return function(){var t,o,r,s,l,g=e.expandIcon,v=void 0===g?i.expandIcon||renderExpandIcon(f.value):g,_=e.pagination,C=e.loading,w=e.bordered;if(!1!==_&&(null===(o=V.value)||void 0===o?void 0:o.total)){var E;E=V.value.size?V.value.size:"small"===c.value||"middle"===c.value?"small":void 0;var x=function(e){return createVNode(Pagination,_objectSpread2$1(_objectSpread2$1({},V.value),{},{class:["".concat(h.value,"-pagination ").concat(h.value,"-pagination-").concat(e),V.value.class],size:E}),null)},T="rtl"===u.value?"left":"right",I=V.value.position;if(null!==I&&Array.isArray(I)){var k=I.find((function(e){return-1!==e.indexOf("top")})),L=I.find((function(e){return-1!==e.indexOf("bottom")})),D=I.every((function(e){return"none"==="".concat(e)}));k||L||D||(s=x(T)),k&&(r=x(k.toLowerCase().replace("top",""))),L&&(s=x(L.toLowerCase().replace("bottom","")))}else s=x(T)}"boolean"==typeof C?l={spinning:C}:"object"===_typeof$3(C)&&(l=_extends$1({spinning:!0},C));var N=classNames("".concat(h.value,"-wrapper"),_defineProperty$P({},"".concat(h.value,"-wrapper-rtl"),"rtl"===u.value),n.class),O=omit$2(e,["columns"]);return createVNode("div",{class:N,style:n.style},[createVNode(Spin,_objectSpread2$1({spinning:!1},l),{default:function(){return[r,createVNode(Table$3,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},n),O),{},{expandedRowKeys:e.expandedRowKeys,defaultExpandedRowKeys:e.defaultExpandedRowKeys,expandIconColumnIndex:z.value,indentSize:Y.value,expandIcon:v,columns:a.value,direction:u.value,prefixCls:h.value,class:classNames((t={},_defineProperty$P(t,"".concat(h.value,"-middle"),"middle"===c.value),_defineProperty$P(t,"".concat(h.value,"-small"),"small"===c.value),_defineProperty$P(t,"".concat(h.value,"-bordered"),w),_defineProperty$P(t,"".concat(h.value,"-empty"),0===m.value.length),t)),data:H.value,rowKey:S.value,rowClassName:q,internalHooks:INTERNAL_HOOKS,internalRefs:b,onUpdateInternalRefs:y,transformColumns:X,transformCellText:p.value}),_extends$1(_extends$1({},i),{emptyText:function(){var t,n;return(null===(t=i.emptyText)||void 0===t?void 0:t.call(i))||(null===(n=e.locale)||void 0===n?void 0:n.emptyText)||d.value("Table")}})),s]}})])}}}),Table$1=defineComponent({name:"ATable",inheritAttrs:!1,setup:function(e,t){var n=t.attrs,i=t.slots,o=t.expose,r=ref();return o({table:r}),function(){var e,t=n.columns||convertChildrenToColumns(null===(e=i.default)||void 0===e?void 0:e.call(i));return createVNode(InteralTable,_objectSpread2$1(_objectSpread2$1({ref:r},n),{},{columns:t||[],expandedRowRender:i.expandedRowRender,contextSlots:_extends$1({},i)}),i)}}}),Table$2=Table$1,Column=defineComponent({name:"ATableColumn",slots:["title","filterIcon"],render:function(){return null}}),ColumnGroup=defineComponent({name:"ATableColumnGroup",slots:["title"],__ANT_TABLE_COLUMN_GROUP:!0,render:function(){return null}}),TableSummaryRow=defineComponent(_extends$1(_extends$1({},SummaryRow),{name:"ATableSummaryRow"})),TableSummaryCell=defineComponent(_extends$1(_extends$1({},SummaryCell),{name:"ATableSummaryCell"})),TableSummary=_extends$1(FooterComponents,{Cell:TableSummaryCell,Row:TableSummaryRow,name:"ATableSummary"}),__unplugin_components_1$1=_extends$1(Table$2,{SELECTION_ALL:SELECTION_ALL,SELECTION_INVERT:SELECTION_INVERT,SELECTION_NONE:SELECTION_NONE,SELECTION_COLUMN:SELECTION_COLUMN,EXPAND_COLUMN:EXPAND_COLUMN,Column:Column,ColumnGroup:ColumnGroup,Summary:TableSummary,install:function(e){return e.component(TableSummary.name,TableSummary),e.component(TableSummaryCell.name,TableSummaryCell),e.component(TableSummaryRow.name,TableSummaryRow),e.component(Table$2.name,Table$2),e.component(Column.name,Column),e.component(ColumnGroup.name,ColumnGroup),e}}),DeleteOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},DeleteOutlinedSvg=DeleteOutlined$2;function _objectSpread$f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$f(e,t,n[t])}))}return e}function _defineProperty$f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var DeleteOutlined=function(e,t){var n=_objectSpread$f({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$f({},n,{icon:DeleteOutlinedSvg}),null)};DeleteOutlined.displayName="DeleteOutlined",DeleteOutlined.inheritAttrs=!1;var DeleteOutlined$1=DeleteOutlined;function toArray$1(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}function fillFieldNames(e){var t=e||{},n=t.label,i=t.value||"value";return{_title:n?[n]:["title","label"],value:i,key:i,children:t.children||"children"}}function isCheckDisabled(e){return e.disabled||e.disableCheckbox||!1===e.checkable}function getAllKeys(e,t){var n=[];return function e(i){i.forEach((function(i){n.push(i[t.value]);var o=i[t.children];o&&e(o)}))}(e),n}function isNil(e){return null==e}var TreeSelectContextPropsKey=Symbol("TreeSelectContextPropsKey");function useProvideSelectContext(e){return provide(TreeSelectContextPropsKey,e)}function useInjectSelectContext(){return inject(TreeSelectContextPropsKey,{})}var HIDDEN_STYLE={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},OptionList=defineComponent({name:"OptionList",inheritAttrs:!1,slots:["notFoundContent","menuItemSelectedIcon"],setup:function(e,t){var n=t.slots,i=t.expose,o=useBaseProps(),r=useInjectLegacySelectContext(),s=useInjectSelectContext(),a=ref(),l=useMemo((function(){return s.treeData}),[function(){return o.open},function(){return s.treeData}],(function(e){return e[0]})),c=computed((function(){var e=r.checkable,t=r.halfCheckedKeys,n=r.checkedKeys;return e?{checked:n,halfChecked:t}:null}));watch((function(){return o.open}),(function(){nextTick((function(){var e;o.open&&!o.multiple&&r.checkedKeys.length&&(null===(e=a.value)||void 0===e||e.scrollTo({key:r.checkedKeys[0]}))}))}),{immediate:!0,flush:"post"});var d=computed((function(){return String(o.searchValue).toLowerCase()})),u=function(e){return!!d.value&&String(e[r.treeNodeFilterProp]).toLowerCase().includes(d.value)},h=shallowRef(r.treeDefaultExpandedKeys),g=shallowRef(null);watch((function(){return o.searchValue}),(function(){o.searchValue&&(g.value=getAllKeys(toRaw(s.treeData),toRaw(s.fieldNames)))}),{immediate:!0});var p=computed((function(){return r.treeExpandedKeys?r.treeExpandedKeys.slice():o.searchValue?g.value:h.value})),f=function(e){var t;h.value=e,g.value=e,null===(t=r.onTreeExpand)||void 0===t||t.call(r,e)},m=function(e){e.preventDefault()},v=function(e,t){var n,i,a=t.node,l=r.checkable,c=r.checkedKeys;l&&isCheckDisabled(a)||(null===(n=s.onSelect)||void 0===n||n.call(s,a.key,{selected:!c.includes(a.key)}),o.multiple||null===(i=o.toggleOpen)||void 0===i||i.call(o,!1))},_=ref(null),C=computed((function(){return r.keyEntities[_.value]})),b=function(e){_.value=e};return i({scrollTo:function(){for(var e,t,n,i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];return null===(n=null===(t=a.value)||void 0===t?void 0:t.scrollTo)||void 0===n?void 0:(e=n).call.apply(e,[t].concat(o))},onKeydown:function(e){var t;switch(e.which){case KeyCode$3.UP:case KeyCode$3.DOWN:case KeyCode$3.LEFT:case KeyCode$3.RIGHT:null===(t=a.value)||void 0===t||t.onKeydown(e);break;case KeyCode$3.ENTER:if(C.value){var n=C.value.node||{},i=n.selectable,s=n.value;!1!==i&&v(0,{node:{key:_.value},selected:!r.checkedKeys.includes(s)})}break;case KeyCode$3.ESC:o.toggleOpen(!1)}},onKeyup:function(){}}),function(){var e,t=o.prefixCls,i=o.multiple,d=o.searchValue,h=o.open,g=o.notFoundContent,y=void 0===g?null===(e=n.notFoundContent)||void 0===e?void 0:e.call(n):g,S=s.listHeight,w=s.listItemHeight,E=s.virtual,x=r.checkable,T=r.treeDefaultExpandAll,I=r.treeIcon,k=r.showTreeIcon,L=r.switcherIcon,D=r.treeLine,N=r.loadData,O=r.treeLoadedKeys,A=r.treeMotion,P=r.onTreeLoad,R=r.checkedKeys;if(0===l.value.length)return createVNode("div",{role:"listbox",class:"".concat(t,"-empty"),onMousedown:m},[y]);var M={fieldNames:s.fieldNames};return O&&(M.loadedKeys=O),p.value&&(M.expandedKeys=p.value),createVNode("div",{onMousedown:m},[C.value&&h&&createVNode("span",{style:HIDDEN_STYLE,"aria-live":"assertive"},[C.value.node.value]),createVNode(Tree$1,_objectSpread2$1(_objectSpread2$1({ref:a,focusable:!1,prefixCls:"".concat(t,"-tree"),treeData:l.value,height:S,itemHeight:w,virtual:E,multiple:i,icon:I,showIcon:k,switcherIcon:L,showLine:D,loadData:d?null:N,motion:A,activeKey:_.value,checkable:x,checkStrictly:!0,checkedKeys:c.value,selectedKeys:x?[]:R,defaultExpandAll:T},M),{},{onActiveChange:b,onSelect:v,onCheck:v,onExpand:f,onLoad:P,filterTreeNode:u}),_extends$1(_extends$1({},n),{checkable:r.customSlots.treeCheckable}))])}}}),SHOW_ALL="SHOW_ALL",SHOW_PARENT="SHOW_PARENT",SHOW_CHILD="SHOW_CHILD";function formatStrategyValues(e,t,n,i){var o=new Set(e);return t===SHOW_CHILD?e.filter((function(e){var t=n[e];return!(t&&t.children&&t.children.some((function(e){var t=e.node;return o.has(t[i.value])}))&&t.children.every((function(e){var t=e.node;return isCheckDisabled(t)||o.has(t[i.value])})))})):t===SHOW_PARENT?e.filter((function(e){var t=n[e],i=t?t.parent:null;return!(i&&!isCheckDisabled(i.node)&&o.has(i.key))})):e}var TreeNode$1=function(){return null};TreeNode$1.inheritAttrs=!1,TreeNode$1.displayName="ATreeSelectNode",TreeNode$1.isTreeSelectNode=!0;var TreeNode$2=TreeNode$1,__rest$3=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function isTreeSelectNode(e){return e&&e.type&&e.type.isTreeSelectNode}function convertChildrenToData(e){return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return filterEmpty(t).map((function(t){var n,i,o;if(!isTreeSelectNode(t))return null;for(var r=t.children||{},s=t.key,a={},l=0,c=Object.entries(t.props);l<c.length;l++){var d=_slicedToArray$2(c[l],2),u=d[0],h=d[1];a[camelize$1(u)]=h}var g=a.isLeaf,p=a.checkable,f=a.selectable,m=a.disabled,v=a.disableCheckbox,_={isLeaf:g||""===g||void 0,checkable:p||""===p||void 0,selectable:f||""===f||void 0,disabled:m||""===m||void 0,disableCheckbox:v||""===v||void 0},C=_extends$1(_extends$1({},a),_),b=a.title,y=void 0===b?null===(n=r.title)||void 0===n?void 0:n.call(r,C):b,S=a.switcherIcon,w=void 0===S?null===(i=r.switcherIcon)||void 0===i?void 0:i.call(r,C):S,E=__rest$3(a,["title","switcherIcon"]),x=null===(o=r.default)||void 0===o?void 0:o.call(r),T=_extends$1(_extends$1(_extends$1({},E),{title:y,switcherIcon:w,key:s,isLeaf:g}),_),I=e(x);return I.length&&(T.children=I),T}))}(e)}function fillLegacyProps(e){if(!e)return e;var t=_extends$1({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return t}}),t}function fillAdditionalInfo(e,t,n,i,o,r){var s=null,a=null;function l(){a||(a=[],function e(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0",l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i.map((function(i,c){var d="".concat(o,"-").concat(c),u=i[r.value],h=n.includes(u),g=e(i[r.children]||[],d,h),p=createVNode(TreeNode$2,i,{default:function(){return[g.map((function(e){return e.node}))]}});if(t===u&&(s=p),h){var f={pos:d,node:p,children:g};return l||a.push(f),f}return null})).filter((function(e){return e}))}(i),a.sort((function(e,t){var i=e.node.props.value,o=t.node.props.value;return n.indexOf(i)-n.indexOf(o)})))}Object.defineProperty(e,"triggerNode",{get:function(){return l(),s}}),Object.defineProperty(e,"allCheckedNodes",{get:function(){return l(),o?a:a.map((function(e){return e.node}))}})}function parseSimpleTreeData(e,t){var n=t.id,i=t.pId,o=t.rootPId,r={},s=[];return e.map((function(e){var t=_extends$1({},e),i=t[n];return r[i]=t,t.key=t.key||i,t})).forEach((function(e){var t=e[i],n=r[t];n&&(n.children=n.children||[],n.children.push(e)),(t===o||!n&&null===o)&&s.push(e)})),s}function useTreeData(e,t,n){var i=shallowRef();return watch([n,e,t],(function(){var o=n.value;e.value?i.value=n.value?parseSimpleTreeData(toRaw(e.value),_extends$1({id:"id",pId:"pId",rootPId:null},!0!==o?o:{})):toRaw(e.value).slice():i.value=convertChildrenToData(toRaw(t.value))}),{immediate:!0,deep:!0}),i}var useCache=function(e){var t=shallowRef({valueLabels:new Map}),n=shallowRef();return watch(e,(function(){n.value=toRaw(e.value)}),{immediate:!0}),[computed((function(){var e=t.value.valueLabels,i=new Map,o=n.value.map((function(t){var n,o=t.value,r=null!==(n=t.label)&&void 0!==n?n:e.get(o);return i.set(o,r),_extends$1(_extends$1({},t),{label:r})}));return t.value.valueLabels=i,o}))]},useDataEntities=function(e,t){var n=shallowRef(new Map),i=shallowRef({});return watchEffect((function(){var o=t.value,r=convertDataToEntities(e.value,{fieldNames:o,initWrapper:function(e){return _extends$1(_extends$1({},e),{valueEntities:new Map})},processEntity:function(e,t){var n=e.node[o.value];t.valueEntities.set(n,e)}});n.value=r.valueEntities,i.value=r.keyEntities})),{valueEntities:n,keyEntities:i}},useCheckedKeys=function(e,t,n,i,o,r){var s=shallowRef([]),a=shallowRef([]);return watchEffect((function(){var l=e.value.map((function(e){return e.value})),c=t.value.map((function(e){return e.value})),d=l.filter((function(e){return!i.value[e]}));if(n.value){var u=conductCheck(l,!0,i.value,o.value,r.value);l=u.checkedKeys,c=u.halfCheckedKeys}s.value=Array.from(new Set([].concat(_toConsumableArray$2(d),_toConsumableArray$2(l)))),a.value=c})),[s,a]},useFilterTreeData=function(e,t,n){var i=n.treeNodeFilterProp,o=n.filterTreeNode,r=n.fieldNames;return computed((function(){var n,s=r.value.children,a=t.value,l=null==i?void 0:i.value;if(!a||!1===o.value)return e.value;if("function"==typeof o.value)n=o.value;else{var c=a.toUpperCase();n=function(e,t){var n=t[l];return String(n).toUpperCase().includes(c)}}return function e(t){for(var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=[],r=0,l=t.length;r<l;r++){var c=t[r],d=c[s],u=i||n(a,fillLegacyProps(c)),h=e(d||[],u);(u||h.length)&&o.push(_extends$1(_extends$1({},c),_defineProperty$P({},s,h)))}return o}(e.value)}))};function treeSelectProps$1(){return _extends$1(_extends$1({},omit$2(baseSelectPropsWithoutPrivate(),["mode"])),{prefixCls:String,id:String,value:{type:[String,Number,Object,Array]},defaultValue:{type:[String,Number,Object,Array]},onChange:{type:Function},searchValue:String,inputValue:String,onSearch:{type:Function},autoClearSearchValue:{type:Boolean,default:void 0},filterTreeNode:{type:[Boolean,Function],default:void 0},treeNodeFilterProp:String,onSelect:Function,onDeselect:Function,showCheckedStrategy:{type:String},treeNodeLabelProp:String,fieldNames:{type:Object},multiple:{type:Boolean,default:void 0},treeCheckable:{type:Boolean,default:void 0},treeCheckStrictly:{type:Boolean,default:void 0},labelInValue:{type:Boolean,default:void 0},treeData:{type:Array},treeDataSimpleMode:{type:[Boolean,Object],default:void 0},loadData:{type:Function},treeLoadedKeys:{type:Array},onTreeLoad:{type:Function},treeDefaultExpandAll:{type:Boolean,default:void 0},treeExpandedKeys:{type:Array},treeDefaultExpandedKeys:{type:Array},onTreeExpand:{type:Function},virtual:{type:Boolean,default:void 0},listHeight:Number,listItemHeight:Number,onDropdownVisibleChange:{type:Function},treeLine:{type:[Boolean,Object],default:void 0},treeIcon:PropTypes$1.any,showTreeIcon:{type:Boolean,default:void 0},switcherIcon:PropTypes$1.any,treeMotion:PropTypes$1.any,children:Array,showArrow:{type:Boolean,default:void 0},showSearch:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},placeholder:PropTypes$1.any,maxTagPlaceholder:{type:Function},dropdownPopupAlign:PropTypes$1.any,customSlots:Object})}function isRawValue(e){return!e||"object"!==_typeof$3(e)}var TreeSelect$1=defineComponent({name:"TreeSelect",inheritAttrs:!1,props:initDefaultProps$1(treeSelectProps$1(),{treeNodeFilterProp:"value",autoClearSearchValue:!0,showCheckedStrategy:SHOW_CHILD,listHeight:200,listItemHeight:20,prefixCls:"vc-tree-select"}),setup:function(e,t){var n=t.attrs,i=t.expose,o=t.slots,r=useId(toRef(e,"id")),s=computed((function(){return e.treeCheckable&&!e.treeCheckStrictly})),a=computed((function(){return e.treeCheckable||e.treeCheckStrictly})),l=computed((function(){return e.treeCheckStrictly||e.labelInValue})),c=computed((function(){return a.value||e.multiple})),d=computed((function(){return fillFieldNames(e.fieldNames)})),u=_slicedToArray$2(useMergedState("",{value:computed((function(){return void 0!==e.searchValue?e.searchValue:e.inputValue})),postState:function(e){return e||""}}),2),h=u[0],g=u[1],p=function(t){var n;g(t),null===(n=e.onSearch)||void 0===n||n.call(e,t)},f=useTreeData(toRef(e,"treeData"),toRef(e,"children"),toRef(e,"treeDataSimpleMode")),m=useDataEntities(f,d),v=m.keyEntities,_=m.valueEntities,C=useFilterTreeData(f,h,{fieldNames:d,treeNodeFilterProp:toRef(e,"treeNodeFilterProp"),filterTreeNode:toRef(e,"filterTreeNode")}),b=function(e){return toArray$1(e).map((function(e){return isRawValue(e)?{value:e}:e}))},y=function(t){return b(t).map((function(t){var n,i=t.label,o=t.value,r=t.halfChecked,s=_.value.get(o);return s&&(i=null!=i?i:function(t){if(t){if(e.treeNodeLabelProp)return t[e.treeNodeLabelProp];for(var n=d.value._title,i=0;i<n.length;i+=1){var o=t[n[i]];if(void 0!==o)return o}}}(s.node),n=s.node.disabled),{label:i,value:o,halfChecked:r,disabled:n}}))},S=_slicedToArray$2(useMergedState(e.defaultValue,{value:toRef(e,"value")}),2),w=S[0],E=S[1],x=computed((function(){return b(w.value)})),T=shallowRef([]),I=shallowRef([]);watchEffect((function(){var e=[],t=[];x.value.forEach((function(n){n.halfChecked?t.push(n):e.push(n)})),T.value=e,I.value=t}));var k=computed((function(){return T.value.map((function(e){return e.value}))})),L=useMaxLevel(v),D=L.maxLevel,N=L.levelEntities,O=_slicedToArray$2(useCheckedKeys(T,I,s,v,D,N),2),A=O[0],P=O[1],R=computed((function(){var t=formatStrategyValues(A.value,e.showCheckedStrategy,v.value,d.value).map((function(e){var t,n,i;return null!==(i=null===(n=null===(t=v.value[e])||void 0===t?void 0:t.node)||void 0===n?void 0:n[d.value.value])&&void 0!==i?i:e})).map((function(e){var t=T.value.find((function(t){return t.value===e}));return{value:e,label:null==t?void 0:t.label}})),n=y(t),i=n[0];return!c.value&&i&&isNil(i.value)&&isNil(i.label)?[]:n.map((function(e){var t;return _extends$1(_extends$1({},e),{label:null!==(t=e.label)&&void 0!==t?t:e.value})}))})),M=_slicedToArray$2(useCache(R),1)[0],$=function(t,n,i){var o=y(t);if(E(o),e.autoClearSearchValue&&g(""),e.onChange){var r=t;if(s.value){var u=formatStrategyValues(t,e.showCheckedStrategy,v.value,d.value);r=u.map((function(e){var t=_.value.get(e);return t?t.node[d.value.value]:e}))}var h=n||{triggerValue:void 0,selected:void 0},p=h.triggerValue,m=h.selected,C=r;if(e.treeCheckStrictly){var b=I.value.filter((function(e){return!r.includes(e.value)}));C=[].concat(_toConsumableArray$2(C),_toConsumableArray$2(b))}var S=y(C),w={preValue:T.value,triggerValue:p},x=!0;(e.treeCheckStrictly||"selection"===i&&!m)&&(x=!1),fillAdditionalInfo(w,p,t,f.value,x,d.value),a.value?w.checked=m:w.selected=m;var k=l.value?S:S.map((function(e){return e.value}));e.onChange(c.value?k:k[0],l.value?null:S.map((function(e){return e.label})),w)}},F=function(t,n){var i,o,r,a=n.selected,l=n.source,u=toRaw(v.value),h=toRaw(_.value),g=u[t],p=null==g?void 0:g.node,f=null!==(i=null==p?void 0:p[d.value.value])&&void 0!==i?i:t;if(c.value){var m=a?[].concat(_toConsumableArray$2(k.value),[f]):A.value.filter((function(e){return e!==f}));if(s.value){var C,b=function(e){var t=[],n=[];return e.forEach((function(e){_.value.has(e)?n.push(e):t.push(e)})),{missingRawValues:t,existRawValues:n}}(m),y=b.missingRawValues,S=b.existRawValues.map((function(e){return h.get(e).key}));if(a)C=conductCheck(S,!0,u,D.value,N.value).checkedKeys;else C=conductCheck(S,{checked:!1,halfCheckedKeys:P.value},u,D.value,N.value).checkedKeys;m=[].concat(_toConsumableArray$2(y),_toConsumableArray$2(C.map((function(e){return u[e].node[d.value.value]}))))}$(m,{selected:a,triggerValue:f},l||"option")}else $([f],{selected:!0,triggerValue:f},"option");a||!c.value?null===(o=e.onSelect)||void 0===o||o.call(e,f,fillLegacyProps(p)):null===(r=e.onDeselect)||void 0===r||r.call(e,f,fillLegacyProps(p))},B=function(t){if(e.onDropdownVisibleChange){var n={};Object.defineProperty(n,"documentClickClose",{get:function(){return!1}}),e.onDropdownVisibleChange(t,n)}},V=function(e,t){var n=e.map((function(e){return e.value}));"clear"!==t.type?t.values.length&&F(t.values[0].value,{selected:!1,source:"selection"}):$(n,{},"selection")},W=toRefs(e),H=W.treeNodeFilterProp,z=W.loadData,K=W.treeLoadedKeys,j=W.onTreeLoad,U=W.treeDefaultExpandAll,G=W.treeExpandedKeys,q=W.treeDefaultExpandedKeys,Y=W.onTreeExpand,X=W.virtual,Z=W.listHeight,Q=W.listItemHeight,J=W.treeLine,ee=W.treeIcon,te=W.showTreeIcon,ne=W.switcherIcon,ie=W.treeMotion,oe=W.customSlots;useProvideLegacySelectContext(toReactive({checkable:a,loadData:z,treeLoadedKeys:K,onTreeLoad:j,checkedKeys:A,halfCheckedKeys:P,treeDefaultExpandAll:U,treeExpandedKeys:G,treeDefaultExpandedKeys:q,onTreeExpand:Y,treeIcon:ee,treeMotion:ie,showTreeIcon:te,switcherIcon:ne,treeLine:J,treeNodeFilterProp:H,keyEntities:v,customSlots:oe})),useProvideSelectContext(toReactive({virtual:X,listHeight:Z,listItemHeight:Q,treeData:C,fieldNames:d,onSelect:F}));var re=ref();return i({focus:function(){var e;null===(e=re.value)||void 0===e||e.focus()},blur:function(){var e;null===(e=re.value)||void 0===e||e.blur()},scrollTo:function(e){var t;null===(t=re.value)||void 0===t||t.scrollTo(e)}}),function(){var t,i=omit$2(e,["id","prefixCls","value","defaultValue","onChange","onSelect","onDeselect","searchValue","inputValue","onSearch","autoClearSearchValue","filterTreeNode","treeNodeFilterProp","showCheckedStrategy","treeNodeLabelProp","multiple","treeCheckable","treeCheckStrictly","labelInValue","fieldNames","treeDataSimpleMode","treeData","children","loadData","treeLoadedKeys","onTreeLoad","treeDefaultExpandAll","treeExpandedKeys","treeDefaultExpandedKeys","onTreeExpand","virtual","listHeight","listItemHeight","onDropdownVisibleChange","treeLine","treeIcon","showTreeIcon","switcherIcon","treeMotion"]);return createVNode(BaseSelect,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({ref:re},n),i),{},{id:r,prefixCls:e.prefixCls,mode:c.value?"multiple":void 0,displayValues:M.value,onDisplayValuesChange:V,searchValue:h.value,onSearch:p,OptionList:OptionList,emptyOptions:!f.value.length,onDropdownVisibleChange:B,tagRender:e.tagRender||o.tagRender,dropdownMatchSelectWidth:null===(t=e.dropdownMatchSelectWidth)||void 0===t||t}),o)}}}),getTransitionName=function(e,t,n){return void 0!==n?n:"".concat(e,"-").concat(t)};function treeSelectProps(){return _extends$1(_extends$1({},omit$2(treeSelectProps$1(),["showTreeIcon","treeMotion","inputIcon","getInputElement","treeLine","customSlots"])),{suffixIcon:PropTypes$1.any,size:{type:String},bordered:{type:Boolean,default:void 0},treeLine:{type:[Boolean,Object],default:void 0},replaceFields:{type:Object},"onUpdate:value":{type:Function},"onUpdate:treeExpandedKeys":{type:Function},"onUpdate:searchValue":{type:Function}})}var TreeSelect=defineComponent({name:"ATreeSelect",inheritAttrs:!1,props:initDefaultProps$1(treeSelectProps(),{choiceTransitionName:"",listHeight:256,treeIcon:!1,listItemHeight:26,bordered:!0}),slots:["title","titleRender","placeholder","maxTagPlaceholder","treeIcon","switcherIcon","notFoundContent"],setup:function(e,t){var n=t.attrs,i=t.slots,o=t.expose,r=t.emit;warning$3(!(void 0===e.treeData&&i.default)),watchEffect((function(){devWarning(!1!==e.multiple||!e.treeCheckable,"TreeSelect","`multiple` will always be `true` when `treeCheckable` is true"),devWarning(void 0===e.replaceFields,"TreeSelect","`replaceFields` is deprecated, please use fieldNames instead")}));var s=useInjectFormItemContext(),a=useConfigInject("select",e),l=a.prefixCls,c=a.renderEmpty,d=a.direction,u=a.virtual,h=a.dropdownMatchSelectWidth,g=a.size,p=a.getPopupContainer,f=a.getPrefixCls,m=computed((function(){return f()})),v=computed((function(){return getTransitionName(m.value,"slide-up",e.transitionName)})),_=computed((function(){return getTransitionName(m.value,"",e.choiceTransitionName)})),C=computed((function(){return f("select-tree",e.prefixCls)})),b=computed((function(){return f("tree-select",e.prefixCls)})),y=computed((function(){return classNames(e.dropdownClassName,"".concat(b.value,"-dropdown"),_defineProperty$P({},"".concat(b.value,"-dropdown-rtl"),"rtl"===d.value))})),S=computed((function(){return!(!e.treeCheckable&&!e.multiple)})),w=ref();o({focus:function(){var e,t;null===(t=(e=w.value).focus)||void 0===t||t.call(e)},blur:function(){var e,t;null===(t=(e=w.value).blur)||void 0===t||t.call(e)}});var E=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r("update:value",t[0]),r.apply(void 0,["change"].concat(t)),s.onFieldChange()},x=function(e){r("update:treeExpandedKeys",e),r("treeExpand",e)},T=function(e){r("update:searchValue",e),r("search",e)},I=function(e){r("blur",e),s.onFieldBlur()};return function(){var t,o,r,a,f=e.notFoundContent,m=void 0===f?null===(o=i.notFoundContent)||void 0===o?void 0:o.call(i):f,k=e.prefixCls,L=e.bordered,D=e.listHeight,N=e.listItemHeight,O=e.multiple,A=e.treeIcon,P=e.treeLine,R=e.switcherIcon,M=void 0===R?null===(r=i.switcherIcon)||void 0===r?void 0:r.call(i):R,$=e.fieldNames,F=void 0===$?e.replaceFields:$,B=e.id,V=void 0===B?s.id.value:B,W=getIcons(_extends$1(_extends$1({},e),{multiple:S.value,prefixCls:l.value}),i),H=W.suffixIcon,z=W.removeIcon,K=W.clearIcon;a=void 0!==m?m:c.value("Select");var j=omit$2(e,["suffixIcon","itemIcon","removeIcon","clearIcon","switcherIcon","bordered","onUpdate:value","onUpdate:treeExpandedKeys","onUpdate:searchValue"]),U=classNames(!k&&b.value,(_defineProperty$P(t={},"".concat(l.value,"-lg"),"large"===g.value),_defineProperty$P(t,"".concat(l.value,"-sm"),"small"===g.value),_defineProperty$P(t,"".concat(l.value,"-rtl"),"rtl"===d.value),_defineProperty$P(t,"".concat(l.value,"-borderless"),!L),t),n.class),G={};return void 0===e.treeData&&i.default&&(G.children=flattenChildren(i.default())),createVNode(TreeSelect$1,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},n),j),{},{virtual:u.value,dropdownMatchSelectWidth:h.value,id:V,fieldNames:F,ref:w,prefixCls:l.value,class:U,listHeight:D,listItemHeight:N,treeLine:!!P,inputIcon:H,multiple:O,removeIcon:z,clearIcon:K,switcherIcon:function(e){return renderSwitcherIcon(C.value,M,P,e)},showTreeIcon:A,notFoundContent:a,getPopupContainer:p.value,treeMotion:null,dropdownClassName:y.value,choiceTransitionName:_.value,onChange:E,onBlur:I,onSearch:T,onTreeExpand:x},G),{},{transitionName:v.value,customSlots:_extends$1(_extends$1({},i),{treeCheckable:function(){return createVNode("span",{class:"".concat(l.value,"-tree-checkbox-inner")},null)}}),maxTagPlaceholder:e.maxTagPlaceholder||i.maxTagPlaceholder}),_extends$1(_extends$1({},i),{treeCheckable:function(){return createVNode("span",{class:"".concat(l.value,"-tree-checkbox-inner")},null)}}))}}}),TreeSelectNode=TreeNode$2,__unplugin_components_1=_extends$1(TreeSelect,{TreeNode:TreeNode$2,SHOW_ALL:SHOW_ALL,SHOW_PARENT:SHOW_PARENT,SHOW_CHILD:SHOW_CHILD,install:function(e){return e.component(TreeSelect.name,TreeSelect),e.component(TreeSelectNode.displayName,TreeSelectNode),e}}),CopyOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},CopyOutlinedSvg=CopyOutlined$2;function _objectSpread$e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$e(e,t,n[t])}))}return e}function _defineProperty$e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var CopyOutlined=function(e,t){var n=_objectSpread$e({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$e({},n,{icon:CopyOutlinedSvg}),null)};CopyOutlined.displayName="CopyOutlined",CopyOutlined.inheritAttrs=!1;var CopyOutlined$1=CopyOutlined;function getError(e,t){var n="cannot ".concat(e.method," ").concat(e.action," ").concat(t.status,"'"),i=new Error(n);return i.status=t.status,i.method=e.method,i.url=e.action,i}function getBody(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e2){return t}}function upload(e){var t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});var n=new FormData;e.data&&Object.keys(e.data).forEach((function(t){var i=e.data[t];Array.isArray(i)?i.forEach((function(e){n.append("".concat(t,"[]"),e)})):n.append(t,i)})),e.file instanceof Blob?n.append(e.filename,e.file,e.file.name):n.append(e.filename,e.file),t.onerror=function(t){e.onError(t)},t.onload=function(){return t.status<200||t.status>=300?e.onError(getError(e,t),getBody(t)):e.onSuccess(getBody(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var i=e.headers||{};return null!==i["X-Requested-With"]&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(i).forEach((function(e){null!==i[e]&&t.setRequestHeader(e,i[e])})),t.send(n),{abort:function(){t.abort()}}}var now=+new Date,index$u=0;function uid(){return"vc-upload-".concat(now,"-").concat(++index$u)}var attrAccept=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),i=e.name||"",o=e.type||"",r=o.replace(/\/.*$/,"");return n.some((function(e){var t=e.trim();if(/^\*(\/\*)?$/.test(e))return!0;if("."===t.charAt(0)){var n=i.toLowerCase(),s=t.toLowerCase(),a=[s];return".jpg"!==s&&".jpeg"!==s||(a=[".jpg",".jpeg"]),a.some((function(e){return n.endsWith(e)}))}return/\/\*$/.test(t)?r===t.replace(/\/.*$/,""):o===t||!!/^\w+$/.test(t)}))}return!0};function loopFiles(e,t){var n=e.createReader(),i=[];!function e(){n.readEntries((function(n){var o=Array.prototype.slice.apply(n);i=i.concat(o),!o.length?t(i):e()}))}()}var traverseFileTree=function(e,t,n){var i=function e(i,o){i.path=o||"",i.isFile?i.file((function(e){n(e)&&(i.fullPath&&!e.webkitRelativePath&&(Object.defineProperties(e,{webkitRelativePath:{writable:!0}}),e.webkitRelativePath=i.fullPath.replace(/^\//,""),Object.defineProperties(e,{webkitRelativePath:{writable:!1}})),t([e]))})):i.isDirectory&&loopFiles(i,(function(t){t.forEach((function(t){e(t,"".concat(o).concat(i.name,"/"))}))}))};e.forEach((function(e){i(e.webkitGetAsEntry())}))},traverseFileTree$1=traverseFileTree,uploadProps$1=function(){return{capture:[Boolean,String],multipart:{type:Boolean,default:void 0},name:String,disabled:{type:Boolean,default:void 0},componentTag:String,action:[String,Function],method:String,directory:{type:Boolean,default:void 0},data:[Object,Function],headers:Object,accept:String,multiple:{type:Boolean,default:void 0},onBatchStart:Function,onReject:Function,onStart:Function,onError:Function,onSuccess:Function,onProgress:Function,beforeUpload:Function,customRequest:Function,withCredentials:{type:Boolean,default:void 0},openFileDialogOnClick:{type:Boolean,default:void 0},prefixCls:String,id:String,onMouseenter:Function,onMouseleave:Function,onClick:Function}};function arrayAggregator(e,t,n,i){for(var o=-1,r=null==e?0:e.length;++o<r;){var s=e[o];t(i,s,n(s),e)}return i}function createBaseFor(e){return function(t,n,i){for(var o=-1,r=Object(t),s=i(t),a=s.length;a--;){var l=s[e?a:++o];if(!1===n(r[l],l,r))break}return t}}var baseFor=createBaseFor(),baseFor$1=baseFor;function baseForOwn(e,t){return e&&baseFor$1(e,t,keys)}function createBaseEach(e,t){return function(n,i){if(null==n)return n;if(!isArrayLike(n))return e(n,i);for(var o=n.length,r=t?o:-1,s=Object(n);(t?r--:++r<o)&&!1!==i(s[r],r,s););return n}}var baseEach=createBaseEach(baseForOwn),baseEach$1=baseEach;function baseAggregator(e,t,n,i){return baseEach$1(e,(function(e,o,r){t(i,e,n(e),r)})),i}function createAggregator(e,t){return function(n,i){var o=isArray$4(n)?arrayAggregator:baseAggregator,r=t?t():{};return o(n,e,baseIteratee(i),r)}}var partition=createAggregator((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),partition$1=partition,__awaiter$18=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},__rest$2=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},AjaxUpload=defineComponent({name:"AjaxUploader",inheritAttrs:!1,props:uploadProps$1(),setup:function(e,t){var n=this,i=t.slots,o=t.attrs,r=t.expose,s=ref(uid()),a={},l=ref(),c=!1,d=function(e){if(e){var t=e.uid?e.uid:e;a[t]&&a[t].abort&&a[t].abort(),delete a[t]}else Object.keys(a).forEach((function(e){a[e]&&a[e].abort&&a[e].abort(),delete a[e]}))};onMounted((function(){c=!0})),onBeforeUnmount((function(){c=!1,d()}));var u=function(t){var i=_toConsumableArray$2(t),o=i.map((function(t){return t.uid=uid(),function(t,i){return __awaiter$18(n,void 0,void 0,regenerator.mark((function n(){var o,r,s,a,l,c,d,u,h;return regenerator.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(o=e.beforeUpload,r=t,!o){n.next=14;break}return n.prev=3,n.next=6,o(t,i);case 6:r=n.sent,n.next=12;break;case 9:n.prev=9,n.t0=n.catch(3),r=!1;case 12:if(!1!==r){n.next=14;break}return n.abrupt("return",{origin:t,parsedFile:null,action:null,data:null});case 14:if("function"!=typeof(s=e.action)){n.next=21;break}return n.next=18,s(t);case 18:a=n.sent,n.next=22;break;case 21:a=s;case 22:if("function"!=typeof(l=e.data)){n.next=29;break}return n.next=26,l(t);case 26:c=n.sent,n.next=30;break;case 29:c=l;case 30:return d="object"!==_typeof$3(r)&&"string"!=typeof r||!r?t:r,u=d instanceof File?d:new File([d],t.name,{type:t.type}),(h=u).uid=t.uid,n.abrupt("return",{origin:t,data:c,parsedFile:h,action:a});case 35:case"end":return n.stop()}}),n,null,[[3,9]])})))}(t,i)}));Promise.all(o).then((function(t){var n=e.onBatchStart;null==n||n(t.map((function(e){return{file:e.origin,parsedFile:e.parsedFile}}))),t.filter((function(e){return null!==e.parsedFile})).forEach((function(t){!function(t){var n=t.data,i=t.origin,o=t.action,r=t.parsedFile;if(c){var s=e.onStart,l=e.customRequest,d=e.name,u=e.headers,h=e.withCredentials,g=e.method,p=i.uid,f=l||upload,m={action:o,filename:d,data:n,file:r,headers:u,withCredentials:h,method:g||"post",onProgress:function(t){var n=e.onProgress;null==n||n(t,r)},onSuccess:function(t,n){var i=e.onSuccess;null==i||i(t,r,n),delete a[p]},onError:function(t,n){var i=e.onError;null==i||i(t,n,r),delete a[p]}};s(i),a[p]=f(m)}}(t)}))}))},h=function(t){var n=e.accept,i=e.directory,o=_toConsumableArray$2(t.target.files).filter((function(e){return!i||attrAccept(e,n)}));u(o),s.value=uid()},g=function(t){var n=l.value;if(n){var i=e.onClick;n.click(),i&&i(t)}},p=function(e){"Enter"===e.key&&g(e)},f=function(t){var n=e.multiple;if(t.preventDefault(),"dragover"!==t.type)if(e.directory)traverseFileTree$1(Array.prototype.slice.call(t.dataTransfer.items),u,(function(t){return attrAccept(t,e.accept)}));else{var i=partition$1(Array.prototype.slice.call(t.dataTransfer.files),(function(t){return attrAccept(t,e.accept)})),o=i[0],r=i[1];!1===n&&(o=o.slice(0,1)),u(o),r.length&&e.onReject&&e.onReject(r)}};return r({abort:d}),function(){var t,n,r=e.componentTag,a=e.prefixCls,c=e.disabled,d=e.id,u=e.multiple,m=e.accept,v=e.capture,_=e.directory,C=e.openFileDialogOnClick,b=e.onMouseenter,y=e.onMouseleave,S=__rest$2(e,["componentTag","prefixCls","disabled","id","multiple","accept","capture","directory","openFileDialogOnClick","onMouseenter","onMouseleave"]),w=(_defineProperty$P(t={},a,!0),_defineProperty$P(t,"".concat(a,"-disabled"),c),_defineProperty$P(t,o.class,!!o.class),t),E=_?{directory:"directory",webkitdirectory:"webkitdirectory"}:{};return createVNode(r,_objectSpread2$1(_objectSpread2$1({},c?{}:{onClick:C?g:function(){},onKeydown:C?p:function(){},onMouseenter:b,onMouseleave:y,onDrop:f,onDragover:f,tabindex:"0"}),{},{class:w,role:"button",style:o.style}),{default:function(){return[createVNode("input",_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},pickAttrs(S,{aria:!0,data:!0})),{},{id:d,type:"file",ref:l,onClick:function(e){return e.stopPropagation()},key:s.value,style:{display:"none"},accept:m},E),{},{multiple:u,onChange:h},null!=v?{capture:v}:{}),null),null===(n=i.default)||void 0===n?void 0:n.call(i)]}})}}});function empty$1(){}var Upload$1=defineComponent({name:"Upload",inheritAttrs:!1,props:initDefaultProps$1(uploadProps$1(),{componentTag:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:empty$1,onError:empty$1,onSuccess:empty$1,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0}),setup:function(e,t){var n=t.slots,i=t.attrs,o=t.expose,r=ref();return o({abort:function(e){var t;null===(t=r.value)||void 0===t||t.abort(e)}}),function(){return createVNode(AjaxUpload,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},e),i),{},{ref:r}),n)}}}),PaperClipOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},PaperClipOutlinedSvg=PaperClipOutlined$2;function _objectSpread$d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$d(e,t,n[t])}))}return e}function _defineProperty$d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var PaperClipOutlined=function(e,t){var n=_objectSpread$d({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$d({},n,{icon:PaperClipOutlinedSvg}),null)};PaperClipOutlined.displayName="PaperClipOutlined",PaperClipOutlined.inheritAttrs=!1;var PaperClipOutlined$1=PaperClipOutlined,PictureTwoTone$2={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:e}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:t}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:t}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:t}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:e}}]}},name:"picture",theme:"twotone"},PictureTwoToneSvg=PictureTwoTone$2;function _objectSpread$c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$c(e,t,n[t])}))}return e}function _defineProperty$c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var PictureTwoTone=function(e,t){var n=_objectSpread$c({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$c({},n,{icon:PictureTwoToneSvg}),null)};PictureTwoTone.displayName="PictureTwoTone",PictureTwoTone.inheritAttrs=!1;var PictureTwoTone$1=PictureTwoTone,FileTwoTone$2={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:t}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:e}}]}},name:"file",theme:"twotone"},FileTwoToneSvg=FileTwoTone$2;function _objectSpread$b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$b(e,t,n[t])}))}return e}function _defineProperty$b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var FileTwoTone=function(e,t){var n=_objectSpread$b({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$b({},n,{icon:FileTwoToneSvg}),null)};FileTwoTone.displayName="FileTwoTone",FileTwoTone.inheritAttrs=!1;var FileTwoTone$1=FileTwoTone;function uploadProps(){return{capture:[Boolean,String],type:String,name:String,defaultFileList:Array,fileList:Array,action:[String,Function],directory:{type:Boolean,default:void 0},data:[Object,Function],method:String,headers:Object,showUploadList:{type:[Boolean,Object],default:void 0},multiple:{type:Boolean,default:void 0},accept:String,beforeUpload:Function,onChange:Function,"onUpdate:fileList":Function,onDrop:Function,listType:String,onPreview:Function,onDownload:Function,onReject:Function,onRemove:Function,remove:Function,supportServerRender:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},prefixCls:String,customRequest:Function,withCredentials:{type:Boolean,default:void 0},openFileDialogOnClick:{type:Boolean,default:void 0},locale:{type:Object,default:void 0},id:String,previewFile:Function,transformFile:Function,iconRender:Function,isImageUrl:Function,progress:Object,itemRender:Function,maxCount:Number,height:[Number,String],removeIcon:Function,downloadIcon:Function,previewIcon:Function}}function uploadListProps(){return{listType:String,onPreview:Function,onDownload:Function,onRemove:Function,items:Array,progress:Object,prefixCls:String,showRemoveIcon:{type:Boolean,default:void 0},showDownloadIcon:{type:Boolean,default:void 0},showPreviewIcon:{type:Boolean,default:void 0},removeIcon:Function,downloadIcon:Function,previewIcon:Function,locale:{type:Object,default:void 0},previewFile:Function,iconRender:Function,isImageUrl:Function,appendAction:Function,appendActionVisible:{type:Boolean,default:void 0},itemRender:Function}}function file2Obj(e){return _extends$1(_extends$1({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function updateFileList(e,t){var n=_toConsumableArray$2(t),i=n.findIndex((function(t){return t.uid===e.uid}));return-1===i?n.push(e):n[i]=e,n}function getFileItem(e,t){var n=void 0!==e.uid?"uid":"name";return t.filter((function(t){return t[n]===e[n]}))[0]}function removeFileItem(e,t){var n=void 0!==e.uid?"uid":"name",i=t.filter((function(t){return t[n]!==e[n]}));return i.length===t.length?null:i}var extname$2=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split("/"),n=t[t.length-1],i=n.split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(i)||[""])[0]},isImageFileType=function(e){return 0===e.indexOf("image/")},isImageUrl=function(e){if(e.type&&!e.thumbUrl)return isImageFileType(e.type);var t=e.thumbUrl||e.url||"",n=extname$2(t);return!(!/^data:image\//.test(t)&&!/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i.test(n))||!/^data:/.test(t)&&!n},MEASURE_SIZE=200;function previewImage(e){return new Promise((function(t){if(e.type&&isImageFileType(e.type)){var n=document.createElement("canvas");n.width=MEASURE_SIZE,n.height=MEASURE_SIZE,n.style.cssText="position: fixed; left: 0; top: 0; width: ".concat(MEASURE_SIZE,"px; height: ").concat(MEASURE_SIZE,"px; z-index: 9999; display: none;"),document.body.appendChild(n);var i=n.getContext("2d"),o=new Image;o.onload=function(){var e=o.width,r=o.height,s=MEASURE_SIZE,a=MEASURE_SIZE,l=0,c=0;e>r?c=-((a=r*(MEASURE_SIZE/e))-s)/2:l=-((s=e*(MEASURE_SIZE/r))-a)/2,i.drawImage(o,l,c,s,a);var d=n.toDataURL();document.body.removeChild(n),t(d)},o.src=window.URL.createObjectURL(e)}else t("")}))}var DownloadOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},DownloadOutlinedSvg=DownloadOutlined$2;function _objectSpread$a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$a(e,t,n[t])}))}return e}function _defineProperty$a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var DownloadOutlined=function(e,t){var n=_objectSpread$a({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$a({},n,{icon:DownloadOutlinedSvg}),null)};DownloadOutlined.displayName="DownloadOutlined",DownloadOutlined.inheritAttrs=!1;var DownloadOutlined$1=DownloadOutlined,listItemProps=function(){return{prefixCls:String,locale:{type:Object,default:void 0},file:Object,items:Array,listType:String,isImgUrl:Function,showRemoveIcon:{type:Boolean,default:void 0},showDownloadIcon:{type:Boolean,default:void 0},showPreviewIcon:{type:Boolean,default:void 0},removeIcon:Function,downloadIcon:Function,previewIcon:Function,iconRender:Function,actionIconRender:Function,itemRender:Function,onPreview:Function,onClose:Function,onDownload:Function,progress:Object}},ListItem=defineComponent({name:"ListItem",inheritAttrs:!1,props:listItemProps(),setup:function(e,t){var n=t.slots,i=t.attrs,o=ref(!1),r=ref();onMounted((function(){r.value=setTimeout((function(){o.value=!0}),300)})),onBeforeUnmount((function(){clearTimeout(r.value)}));var s=useConfigInject("upload",e).rootPrefixCls,a=computed((function(){return getTransitionProps("".concat(s.value,"-fade"))}));return function(){var t,r,s,l,c=e.prefixCls,d=e.locale,u=e.listType,h=e.file,g=e.items,p=e.progress,f=e.iconRender,m=void 0===f?n.iconRender:f,v=e.actionIconRender,_=void 0===v?n.actionIconRender:v,C=e.itemRender,b=void 0===C?n.itemRender:C,y=e.isImgUrl,S=e.showPreviewIcon,w=e.showRemoveIcon,E=e.showDownloadIcon,x=e.previewIcon,T=void 0===x?n.previewIcon:x,I=e.removeIcon,k=void 0===I?n.removeIcon:I,L=e.downloadIcon,D=void 0===L?n.downloadIcon:L,N=e.onPreview,O=e.onDownload,A=e.onClose,P=i.class,R=i.style,M="".concat(c,"-span"),$=m({file:h}),F=createVNode("div",{class:"".concat(c,"-text-icon")},[$]);if("picture"===u||"picture-card"===u)if("uploading"===h.status||!h.thumbUrl&&!h.url){var B,V=(_defineProperty$P(B={},"".concat(c,"-list-item-thumbnail"),!0),_defineProperty$P(B,"".concat(c,"-list-item-file"),"uploading"!==h.status),B);F=createVNode("div",{class:V},[$])}else{var W,H=(null==y?void 0:y(h))?createVNode("img",{src:h.thumbUrl||h.url,alt:h.name,class:"".concat(c,"-list-item-image")},null):$,z=(_defineProperty$P(W={},"".concat(c,"-list-item-thumbnail"),!0),_defineProperty$P(W,"".concat(c,"-list-item-file"),y&&!y(h)),W);F=createVNode("a",{class:z,onClick:function(e){return N(h,e)},href:h.url||h.thumbUrl,target:"_blank",rel:"noopener noreferrer"},[H])}var K,j=(_defineProperty$P(t={},"".concat(c,"-list-item"),!0),_defineProperty$P(t,"".concat(c,"-list-item-").concat(h.status),!0),_defineProperty$P(t,"".concat(c,"-list-item-list-type-").concat(u),!0),t),U="string"==typeof h.linkProps?JSON.parse(h.linkProps):h.linkProps,G=w?_({customIcon:k?k({file:h}):createVNode(DeleteOutlined$1,null,null),callback:function(){return A(h)},prefixCls:c,title:d.removeFile}):null,q=E&&"done"===h.status?_({customIcon:D?D({file:h}):createVNode(DownloadOutlined$1,null,null),callback:function(){return O(h)},prefixCls:c,title:d.downloadFile}):null,Y="picture-card"!==u&&createVNode("span",{key:"download-delete",class:["".concat(c,"-list-item-card-actions"),{picture:"picture"===u}]},[q,G]),X="".concat(c,"-list-item-name"),Z=h.url?[createVNode("a",_objectSpread2$1(_objectSpread2$1({key:"view",target:"_blank",rel:"noopener noreferrer",class:X,title:h.name},U),{},{href:h.url,onClick:function(e){return N(h,e)}}),[h.name]),Y]:[createVNode("span",{key:"view",class:X,onClick:function(e){return N(h,e)},title:h.name},[h.name]),Y],Q=S?createVNode("a",{href:h.url||h.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:h.url||h.thumbUrl?void 0:{pointerEvents:"none",opacity:.5},onClick:function(e){return N(h,e)},title:d.previewFile},[T?T({file:h}):createVNode(EyeOutlined$1,null,null)]):null,J="picture-card"===u&&"uploading"!==h.status&&createVNode("span",{class:"".concat(c,"-list-item-actions")},[Q,"done"===h.status&&q,G]);K=h.response&&"string"==typeof h.response?h.response:(null===(s=h.error)||void 0===s?void 0:s.statusText)||(null===(l=h.error)||void 0===l?void 0:l.message)||d.uploadError;var ee=createVNode("span",{class:M},[F,Z]),te=createVNode("div",{class:j},[createVNode("div",{class:"".concat(c,"-list-item-info")},[ee]),J,o.value&&createVNode(Transition,a.value,{default:function(){return[withDirectives(createVNode("div",{class:"".concat(c,"-list-item-progress")},["percent"in h?createVNode(__unplugin_components_7,_objectSpread2$1(_objectSpread2$1({},p),{},{type:"line",percent:h.percent}),null):null]),[[vShow,"uploading"===h.status]])]}})]),ne=(_defineProperty$P(r={},"".concat(c,"-list-").concat(u,"-container"),!0),_defineProperty$P(r,"".concat(P),!!P),r),ie="error"===h.status?createVNode(__unplugin_components_2$3,{title:K,getPopupContainer:function(e){return e.parentNode}},{default:function(){return[te]}}):te;return createVNode("div",{class:ne,style:R,ref:ref},[b?b({originNode:ie,file:h,fileList:g,actions:{download:O.bind(null,h),preview:N.bind(null,h),remove:A.bind(null,h)}}):ie])}}}),HackSlot=function(e,t){var n,i=t.slots;return filterEmpty(null===(n=i.default)||void 0===n?void 0:n.call(i))[0]},UploadList=defineComponent({name:"AUploadList",props:initDefaultProps$1(uploadListProps(),{listType:"text",progress:{strokeWidth:2,showInfo:!1},showRemoveIcon:!0,showDownloadIcon:!1,showPreviewIcon:!0,previewFile:previewImage,isImageUrl:isImageUrl,items:[],appendActionVisible:!0}),setup:function(e,t){var n=t.slots,i=t.expose,o=ref(!1),r=getCurrentInstance();onMounted((function(){o.value})),watchEffect((function(){"picture"!==e.listType&&"picture-card"!==e.listType||(e.items||[]).forEach((function(t){"undefined"!=typeof document&&"undefined"!=typeof window&&window.FileReader&&window.File&&(t.originFileObj instanceof File||t.originFileObj instanceof Blob)&&void 0===t.thumbUrl&&(t.thumbUrl="",e.previewFile&&e.previewFile(t.originFileObj).then((function(e){t.thumbUrl=e||"",r.update()})))}))}));var s=function(t,n){if(e.onPreview)return null==n||n.preventDefault(),e.onPreview(t)},a=function(t){"function"==typeof e.onDownload?e.onDownload(t):t.url&&window.open(t.url)},l=function(t){var n;null===(n=e.onRemove)||void 0===n||n.call(e,t)},c=function(t){var i=t.file,o=e.iconRender||n.iconRender;if(o)return o({file:i,listType:e.listType});var r="uploading"===i.status,s=e.isImageUrl&&e.isImageUrl(i)?createVNode(PictureTwoTone$1,null,null):createVNode(FileTwoTone$1,null,null),a=createVNode(r?LoadingOutlined$1:PaperClipOutlined$1,null,null);return"picture"===e.listType?a=r?createVNode(LoadingOutlined$1,null,null):s:"picture-card"===e.listType&&(a=r?e.locale.uploading:s),a},d=function(e){var t=e.customIcon,n=e.callback,i=e.prefixCls,o={type:"text",size:"small",title:e.title,onClick:function(){n()},class:"".concat(i,"-list-item-card-actions-btn")};return isValidElement(t)?createVNode(Button$2,o,{icon:function(){return t}}):createVNode(Button$2,o,{default:function(){return[createVNode("span",null,[t])]}})};i({handlePreview:s,handleDownload:a});var u=useConfigInject("upload",e),h=u.prefixCls,g=u.direction,p=computed((function(){var t;return _defineProperty$P(t={},"".concat(h.value,"-list"),!0),_defineProperty$P(t,"".concat(h.value,"-list-").concat(e.listType),!0),_defineProperty$P(t,"".concat(h.value,"-list-rtl"),"rtl"===g.value),t})),f=computed((function(){return _extends$1(_extends$1(_extends$1({},collapseMotion$1("".concat(h.value,"-").concat("picture-card"===e.listType?"animate-inline":"animate"))),getTransitionGroupProps("".concat(h.value,"-").concat("picture-card"===e.listType?"animate-inline":"animate"))),{class:p.value,appear:o.value})}));return function(){var t=e.listType,i=e.locale,o=e.isImageUrl,r=e.items,u=void 0===r?[]:r,g=e.showPreviewIcon,p=e.showRemoveIcon,m=e.showDownloadIcon,v=e.removeIcon,_=e.previewIcon,C=e.downloadIcon,b=e.progress,y=e.appendAction,S=e.itemRender,w=e.appendActionVisible,E=null==y?void 0:y();return createVNode(TransitionGroup,_objectSpread2$1(_objectSpread2$1({},f.value),{},{tag:"div"}),{default:function(){return[u.map((function(e){var r=e.uid;return createVNode(ListItem,{key:r,locale:i,prefixCls:h.value,file:e,items:u,progress:b,listType:t,isImgUrl:o,showPreviewIcon:g,showRemoveIcon:p,showDownloadIcon:m,onPreview:s,onDownload:a,onClose:l,removeIcon:v,previewIcon:_,downloadIcon:C,itemRender:S},_extends$1(_extends$1({},n),{iconRender:c,actionIconRender:d}))})),y?withDirectives(createVNode(HackSlot,{key:"__ant_upload_appendAction"},{default:function(){return E}}),[[vShow,!!w]]):null]}})}}}),__awaiter$17=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},__rest$1=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},LIST_IGNORE="__LIST_IGNORE_".concat(Date.now(),"__"),Upload=defineComponent({name:"AUpload",inheritAttrs:!1,props:initDefaultProps$1(uploadProps(),{type:"select",multiple:!1,action:"",data:{},accept:"",showUploadList:!0,listType:"text",disabled:!1,supportServerRender:!0}),setup:function(e,t){var n=this,i=t.slots,o=t.attrs,r=t.expose,s=useInjectFormItemContext(),a=_slicedToArray$2(useMergedState(e.defaultFileList||[],{value:toRef(e,"fileList"),postState:function(e){var t=Date.now();return(null!=e?e:[]).map((function(e,n){return e.uid||Object.isFrozen(e)||(e.uid="__AUTO__".concat(t,"_").concat(n,"__")),e}))}}),2),l=a[0],c=a[1],d=ref("drop"),u=ref();onMounted((function(){devWarning(void 0!==e.fileList||void 0===o.value,"Upload","`value` is not a valid prop, do you mean `fileList`?"),devWarning(void 0===e.transformFile,"Upload","`transformFile` is deprecated. Please use `beforeUpload` directly."),devWarning(void 0===e.remove,"Upload","`remove` props is deprecated. Please use `remove` event.")}));var h=function(t,n,i){var o,r,a=_toConsumableArray$2(n);1===e.maxCount?a=a.slice(-1):e.maxCount&&(a=a.slice(0,e.maxCount)),c(a);var l={file:t,fileList:a};i&&(l.event=i),null===(o=e["onUpdate:fileList"])||void 0===o||o.call(e,l.fileList),null===(r=e.onChange)||void 0===r||r.call(e,l),s.onFieldChange()},g=function(t,i){return __awaiter$17(n,void 0,void 0,regenerator.mark((function n(){var o,r,s,a;return regenerator.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(o=e.beforeUpload,r=e.transformFile,s=t,!o){n.next=13;break}return n.next=5,o(t,i);case 5:if(!1!==(a=n.sent)){n.next=8;break}return n.abrupt("return",!1);case 8:if(delete t[LIST_IGNORE],a!==LIST_IGNORE){n.next=12;break}return Object.defineProperty(t,LIST_IGNORE,{value:!0,configurable:!0}),n.abrupt("return",!1);case 12:"object"===_typeof$3(a)&&a&&(s=a);case 13:if(!r){n.next=17;break}return n.next=16,r(s);case 16:s=n.sent;case 17:return n.abrupt("return",s);case 18:case"end":return n.stop()}}),n)})))},p=function(e){var t=e.filter((function(e){return!e.file[LIST_IGNORE]}));if(t.length){var n=t.map((function(e){return file2Obj(e.file)})),i=_toConsumableArray$2(l.value);n.forEach((function(e){i=updateFileList(e,i)})),n.forEach((function(e,n){var o=e;if(t[n].parsedFile)e.status="uploading";else{var r,s=e.originFileObj;try{r=new File([s],s.name,{type:s.type})}catch(e2){(r=new Blob([s],{type:s.type})).name=s.name,r.lastModifiedDate=new Date,r.lastModified=(new Date).getTime()}r.uid=e.uid,o=r}h(o,i)}))}},f=function(e,t,n){try{"string"==typeof e&&(e=JSON.parse(e))}catch(e2){}if(getFileItem(t,l.value)){var i=file2Obj(t);i.status="done",i.percent=100,i.response=e,i.xhr=n;var o=updateFileList(i,l.value);h(i,o)}},m=function(e,t){if(getFileItem(t,l.value)){var n=file2Obj(t);n.status="uploading",n.percent=e.percent;var i=updateFileList(n,l.value);h(n,i,e)}},v=function(e,t,n){if(getFileItem(n,l.value)){var i=file2Obj(n);i.error=e,i.response=t,i.status="error";var o=updateFileList(i,l.value);h(i,o)}},_=function(t){var n,i=e.onRemove||e.remove;Promise.resolve("function"==typeof i?i(t):i).then((function(e){var i,o;if(!1!==e){var r=removeFileItem(t,l.value);r&&(n=_extends$1(_extends$1({},t),{status:"removed"}),null===(i=l.value)||void 0===i||i.forEach((function(e){var t=void 0!==n.uid?"uid":"name";e[t]!==n[t]||Object.isFrozen(e)||(e.status="removed")})),null===(o=u.value)||void 0===o||o.abort(n),h(n,r))}}))},C=function(t){var n;d.value=t.type,"drop"===t.type&&(null===(n=e.onDrop)||void 0===n||n.call(e,t))};r({onBatchStart:p,onSuccess:f,onProgress:m,onError:v,fileList:l,upload:u});var b=useConfigInject("upload",e),y=b.prefixCls,S=b.direction,w=_slicedToArray$2(useLocaleReceiver("Upload",defaultLocale.Upload,computed((function(){return e.locale}))),1)[0],E=function(t,n){var o=e.removeIcon,r=e.previewIcon,s=e.downloadIcon,a=e.previewFile,c=e.onPreview,d=e.onDownload,u=e.disabled,h=e.isImageUrl,g=e.progress,p=e.itemRender,f=e.iconRender,m=e.showUploadList,v="boolean"==typeof m?{}:m,C=v.showDownloadIcon,b=v.showPreviewIcon,y=v.showRemoveIcon;return m?createVNode(UploadList,{listType:e.listType,items:l.value,previewFile:a,onPreview:c,onDownload:d,onRemove:_,showRemoveIcon:!u&&y,showPreviewIcon:b,showDownloadIcon:C,removeIcon:o,previewIcon:r,downloadIcon:s,iconRender:f,locale:w.value,isImageUrl:h,progress:g,itemRender:p,appendActionVisible:n,appendAction:t},_extends$1({},i)):null==t?void 0:t()};return function(){var t,n,r,a,c=e.listType,h=e.disabled,_=e.type;o.class,o.style;var b=__rest$1(o,["class","style"]),w=_extends$1(_extends$1(_extends$1({onBatchStart:p,onError:v,onProgress:m,onSuccess:f},b),e),{id:null!==(n=e.id)&&void 0!==n?n:s.id.value,prefixCls:y.value,beforeUpload:g,onChange:void 0});if(delete w.remove,i.default&&!h||delete w.id,"drag"===_){var x,T=classNames(y.value,(_defineProperty$P(x={},"".concat(y.value,"-drag"),!0),_defineProperty$P(x,"".concat(y.value,"-drag-uploading"),l.value.some((function(e){return"uploading"===e.status}))),_defineProperty$P(x,"".concat(y.value,"-drag-hover"),"dragover"===d.value),_defineProperty$P(x,"".concat(y.value,"-disabled"),h),_defineProperty$P(x,"".concat(y.value,"-rtl"),"rtl"===S.value),x),o.class);return createVNode("span",null,[createVNode("div",{class:T,onDrop:C,onDragover:C,onDragleave:C,style:o.style},[createVNode(Upload$1,_objectSpread2$1(_objectSpread2$1({},w),{},{ref:u,class:"".concat(y.value,"-btn")}),_objectSpread2$1({default:function(){return[createVNode("div",{class:"".concat(y,"-drag-container")},[null===(r=i.default)||void 0===r?void 0:r.call(i)])]}},i))]),E()])}var I=classNames(y.value,(_defineProperty$P(t={},"".concat(y.value,"-select"),!0),_defineProperty$P(t,"".concat(y.value,"-select-").concat(c),!0),_defineProperty$P(t,"".concat(y.value,"-disabled"),h),_defineProperty$P(t,"".concat(y.value,"-rtl"),"rtl"===S.value),t)),k=flattenChildren(null===(a=i.default)||void 0===a?void 0:a.call(i)),L=function(e){return createVNode("div",{class:I,style:e},[createVNode(Upload$1,_objectSpread2$1(_objectSpread2$1({},w),{},{ref:u}),i)])};return"picture-card"===c?createVNode("span",{class:classNames("".concat(y.value,"-picture-card-wrapper"),o.class)},[E(L,!(!k||!k.length))]):createVNode("span",{class:o.class},[L(k&&k.length?void 0:{display:"none"}),E()])}}}),__rest=globalThis&&globalThis.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n},Dragger=defineComponent({name:"AUploadDragger",inheritAttrs:!1,props:uploadProps(),setup:function(e,t){var n=t.slots,i=t.attrs;return function(){var t=e.height,o=__rest(e,["height"]),r=i.style,s=__rest(i,["style"]),a=_extends$1(_extends$1(_extends$1({},o),s),{type:"drag",style:_extends$1(_extends$1({},r),{height:"number"==typeof t?"".concat(t,"px"):t})});return createVNode(Upload,a,n)}}}),__unplugin_components_5=_extends$1(Upload,{Dragger:Dragger,LIST_IGNORE:LIST_IGNORE,install:function(e){return e.component(Upload.name,Upload),e.component(Dragger.name,Dragger),e}}),_default="",index$t="",index$s="",isVue2=!1;
- /*!
- * pinia v2.0.16
- * (c) 2022 Eduardo San Martin Morote
- * @license MIT
- */
- let activePinia;const setActivePinia=e=>activePinia=e,piniaSymbol=Symbol();function isPlainObject$2(e){return e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)&&"function"!=typeof e.toJSON}var MutationType,MutationType2;function createPinia(){const e=effectScope(!0),t=e.run((()=>ref({})));let n=[],i=[];const o=markRaw({install(e){setActivePinia(o),o._a=e,e.provide(piniaSymbol,o),e.config.globalProperties.$pinia=o,i.forEach((e=>n.push(e))),i=[]},use(e){return this._a||isVue2?n.push(e):i.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return o}MutationType2=MutationType||(MutationType={}),MutationType2.direct="direct",MutationType2.patchObject="patch object",MutationType2.patchFunction="patch function";const noop=()=>{};function addSubscription(e,t,n,i=noop){e.push(t);const o=()=>{const n=e.indexOf(t);n>-1&&(e.splice(n,1),i())};return!n&&getCurrentInstance()&&onUnmounted(o),o}function triggerSubscriptions(e,...t){e.slice().forEach((e=>{e(...t)}))}function mergeReactiveObjects(e,t){for(const n in t){if(!t.hasOwnProperty(n))continue;const i=t[n],o=e[n];isPlainObject$2(o)&&isPlainObject$2(i)&&e.hasOwnProperty(n)&&!isRef(i)&&!isReactive(i)?e[n]=mergeReactiveObjects(o,i):e[n]=i}return e}const skipHydrateSymbol=Symbol();function shouldHydrate(e){return!isPlainObject$2(e)||!e.hasOwnProperty(skipHydrateSymbol)}const{assign:assign$1}=Object;function isComputed(e){return!(!isRef(e)||!e.effect)}function createOptionsStore(e,t,n,i){const{state:o,actions:r,getters:s}=t,a=n.state.value[e];let l;return l=createSetupStore(e,(function(){a||(n.state.value[e]=o?o():{});const t=toRefs(n.state.value[e]);return assign$1(t,r,Object.keys(s||{}).reduce(((t,i)=>(t[i]=markRaw(computed((()=>{setActivePinia(n);const t=n._s.get(e);return s[i].call(t,t)}))),t)),{}))}),t,n,i,!0),l.$reset=function(){const e=o?o():{};this.$patch((t=>{assign$1(t,e)}))},l}function createSetupStore(e,t,n={},i,o,r){let s;const a=assign$1({actions:{}},n),l={deep:!0};let c,d,u,h=markRaw([]),g=markRaw([]);const p=i.state.value[e];let f;function m(t){let n;c=d=!1,"function"==typeof t?(t(i.state.value[e]),n={type:MutationType.patchFunction,storeId:e,events:u}):(mergeReactiveObjects(i.state.value[e],t),n={type:MutationType.patchObject,payload:t,storeId:e,events:u});const o=f=Symbol();nextTick().then((()=>{f===o&&(c=!0)})),d=!0,triggerSubscriptions(h,n,i.state.value[e])}r||p||(i.state.value[e]={}),ref({});const v=noop;function _(t,n){return function(){setActivePinia(i);const o=Array.from(arguments),r=[],s=[];function a(e){r.push(e)}function l(e){s.push(e)}let c;triggerSubscriptions(g,{args:o,name:t,store:b,after:a,onError:l});try{c=n.apply(this&&this.$id===e?this:b,o)}catch(d){throw triggerSubscriptions(s,d),d}return c instanceof Promise?c.then((e=>(triggerSubscriptions(r,e),e))).catch((e=>(triggerSubscriptions(s,e),Promise.reject(e)))):(triggerSubscriptions(r,c),c)}}const C={_p:i,$id:e,$onAction:addSubscription.bind(null,g),$patch:m,$reset:v,$subscribe(t,n={}){const o=addSubscription(h,t,n.detached,(()=>r())),r=s.run((()=>watch((()=>i.state.value[e]),(i=>{("sync"===n.flush?d:c)&&t({storeId:e,type:MutationType.direct,events:u},i)}),assign$1({},l,n))));return o},$dispose:function(){s.stop(),h=[],g=[],i._s.delete(e)}},b=reactive(assign$1({},C));i._s.set(e,b);const y=i._e.run((()=>(s=effectScope(),s.run((()=>t())))));for(const S in y){const t=y[S];if(isRef(t)&&!isComputed(t)||isReactive(t))r||(p&&shouldHydrate(t)&&(isRef(t)?t.value=p[S]:mergeReactiveObjects(t,p[S])),i.state.value[e][S]=t);else if("function"==typeof t){const e=_(S,t);y[S]=e,a.actions[S]=t}}return assign$1(b,y),assign$1(toRaw(b),y),Object.defineProperty(b,"$state",{get:()=>i.state.value[e],set:e=>{m((t=>{assign$1(t,e)}))}}),i._p.forEach((e=>{assign$1(b,s.run((()=>e({store:b,app:i._a,pinia:i,options:a}))))})),p&&r&&n.hydrate&&n.hydrate(b.$state,p),c=!0,d=!0,b}function defineStore(e,t,n){let i,o;const r="function"==typeof t;function s(e,n){const s=getCurrentInstance();(e=e||s&&inject(piniaSymbol))&&setActivePinia(e),(e=activePinia)._s.has(i)||(r?createSetupStore(i,t,o,e):createOptionsStore(i,o,e));return e._s.get(i)}return"string"==typeof e?(i=e,o=r?n:t):(o=e,i=e.id),s.$id=i,s}const GLOBALPARAMS="GLOBAL_PARAMS";var axios$2={exports:{}},bind$2=function(e,t){return function(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];return e.apply(t,n)}},bind$1=bind$2,toString=Object.prototype.toString,kindOf=(cache2=Object.create(null),function(e){var t=toString.call(e);return cache2[t]||(cache2[t]=t.slice(8,-1).toLowerCase())}),cache2;function kindOfTest(e){return e=e.toLowerCase(),function(t){return kindOf(t)===e}}function isArray$2(e){return Array.isArray(e)}function isUndefined$1(e){return void 0===e}function isBuffer(e){return null!==e&&!isUndefined$1(e)&&null!==e.constructor&&!isUndefined$1(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&isArrayBuffer(e.buffer)}function isString$4(e){return"string"==typeof e}function isNumber$3(e){return"number"==typeof e}function isObject$3(e){return null!==e&&"object"==typeof e}function isPlainObject$1(e){if("object"!==kindOf(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList");function isFunction$2(e){return"[object Function]"===toString.call(e)}function isStream(e){return isObject$3(e)&&isFunction$2(e.pipe)}function isFormData(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||toString.call(e)===t||isFunction$2(e.toString)&&e.toString()===t)}var isURLSearchParams=kindOfTest("URLSearchParams");function trim$1(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function isStandardBrowserEnv(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function forEach$1(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),isArray$2(e))for(var n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}function merge(){var e={};function t(t,n){isPlainObject$1(e[n])&&isPlainObject$1(t)?e[n]=merge(e[n],t):isPlainObject$1(t)?e[n]=merge({},t):isArray$2(t)?e[n]=t.slice():e[n]=t}for(var n=0,i=arguments.length;n<i;n++)forEach$1(arguments[n],t);return e}function extend(e,t,n){return forEach$1(t,(function(t,i){e[i]=n&&"function"==typeof t?bind$1(t,n):t})),e}function stripBOM(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}function inherits(e,t,n,i){e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,n&&Object.assign(e.prototype,n)}function toFlatObject(e,t,n){var i,o,r,s={};t=t||{};do{for(o=(i=Object.getOwnPropertyNames(e)).length;o-- >0;)s[r=i[o]]||(t[r]=e[r],s[r]=!0);e=Object.getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t}function endsWith(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var i=e.indexOf(t,n);return-1!==i&&i===n}function toArray(e){if(!e)return null;var t=e.length;if(isUndefined$1(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n}var isTypedArray=(TypedArray="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return TypedArray&&e instanceof TypedArray}),TypedArray,utils$h={isArray:isArray$2,isArrayBuffer:isArrayBuffer,isBuffer:isBuffer,isFormData:isFormData,isArrayBufferView:isArrayBufferView,isString:isString$4,isNumber:isNumber$3,isObject:isObject$3,isPlainObject:isPlainObject$1,isUndefined:isUndefined$1,isDate:isDate$1,isFile:isFile,isBlob:isBlob,isFunction:isFunction$2,isStream:isStream,isURLSearchParams:isURLSearchParams,isStandardBrowserEnv:isStandardBrowserEnv,forEach:forEach$1,merge:merge,extend:extend,trim:trim$1,stripBOM:stripBOM,inherits:inherits,toFlatObject:toFlatObject,kindOf:kindOf,kindOfTest:kindOfTest,endsWith:endsWith,toArray:toArray,isTypedArray:isTypedArray,isFileList:isFileList},utils$g=utils$h;function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var buildURL$2=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(utils$g.isURLSearchParams(t))i=t.toString();else{var o=[];utils$g.forEach(t,(function(e,t){null!=e&&(utils$g.isArray(e)?t+="[]":e=[e],utils$g.forEach(e,(function(e){utils$g.isDate(e)?e=e.toISOString():utils$g.isObject(e)&&(e=JSON.stringify(e)),o.push(encode(t)+"="+encode(e))})))})),i=o.join("&")}if(i){var r=e.indexOf("#");-1!==r&&(e=e.slice(0,r)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e},utils$f=utils$h;function InterceptorManager$1(){this.handlers=[]}InterceptorManager$1.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},InterceptorManager$1.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},InterceptorManager$1.prototype.forEach=function(e){utils$f.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var InterceptorManager_1=InterceptorManager$1,utils$e=utils$h,normalizeHeaderName$1=function(e,t){utils$e.forEach(e,(function(n,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[i])}))},utils$d=utils$h;function AxiosError$5(e,t,n,i,o){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),o&&(this.response=o)}utils$d.inherits(AxiosError$5,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var prototype=AxiosError$5.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){descriptors[e]={value:e}})),Object.defineProperties(AxiosError$5,descriptors),Object.defineProperty(prototype,"isAxiosError",{value:!0}),AxiosError$5.from=function(e,t,n,i,o,r){var s=Object.create(prototype);return utils$d.toFlatObject(e,s,(function(e){return e!==Error.prototype})),AxiosError$5.call(s,e.message,t,n,i,o),s.name=e.name,r&&Object.assign(s,r),s};var AxiosError_1=AxiosError$5,transitional={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},utils$c=utils$h;function toFormData$1(e,t){t=t||new FormData;var n=[];function i(e){return null===e?"":utils$c.isDate(e)?e.toISOString():utils$c.isArrayBuffer(e)||utils$c.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}return function e(o,r){if(utils$c.isPlainObject(o)||utils$c.isArray(o)){if(-1!==n.indexOf(o))throw Error("Circular reference detected in "+r);n.push(o),utils$c.forEach(o,(function(n,o){if(!utils$c.isUndefined(n)){var s,a=r?r+"."+o:o;if(n&&!r&&"object"==typeof n)if(utils$c.endsWith(o,"{}"))n=JSON.stringify(n);else if(utils$c.endsWith(o,"[]")&&(s=utils$c.toArray(n)))return void s.forEach((function(e){!utils$c.isUndefined(e)&&t.append(a,i(e))}));e(n,a)}})),n.pop()}else t.append(r,i(o))}(e),t}var toFormData_1=toFormData$1,AxiosError$4=AxiosError_1,settle$1=function(e,t,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(new AxiosError$4("Request failed with status code "+n.status,[AxiosError$4.ERR_BAD_REQUEST,AxiosError$4.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)},utils$b=utils$h,cookies$1=utils$b.isStandardBrowserEnv()?{write:function(e,t,n,i,o,r){var s=[];s.push(e+"="+encodeURIComponent(t)),utils$b.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),utils$b.isString(i)&&s.push("path="+i),utils$b.isString(o)&&s.push("domain="+o),!0===r&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},isAbsoluteURL$1=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},combineURLs$1=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},isAbsoluteURL=isAbsoluteURL$1,combineURLs=combineURLs$1,buildFullPath$2=function(e,t){return e&&!isAbsoluteURL(t)?combineURLs(e,t):t},utils$a=utils$h,ignoreDuplicateOf=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],parseHeaders$1=function(e){var t,n,i,o={};return e?(utils$a.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=utils$a.trim(e.substr(0,i)).toLowerCase(),n=utils$a.trim(e.substr(i+1)),t){if(o[t]&&ignoreDuplicateOf.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o},utils$9=utils$h,isURLSameOrigin$1=utils$9.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var i=e;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=utils$9.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},AxiosError$3=AxiosError_1,utils$8=utils$h;function CanceledError$3(e){AxiosError$3.call(this,null==e?"canceled":e,AxiosError$3.ERR_CANCELED),this.name="CanceledError"}utils$8.inherits(CanceledError$3,AxiosError$3,{__CANCEL__:!0});var CanceledError_1=CanceledError$3,parseProtocol$1=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""},utils$7=utils$h,settle=settle$1,cookies=cookies$1,buildURL$1=buildURL$2,buildFullPath$1=buildFullPath$2,parseHeaders=parseHeaders$1,isURLSameOrigin=isURLSameOrigin$1,transitionalDefaults$1=transitional,AxiosError$2=AxiosError_1,CanceledError$2=CanceledError_1,parseProtocol=parseProtocol$1,xhr=function(e){return new Promise((function(t,n){var i,o=e.data,r=e.headers,s=e.responseType;function a(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}utils$7.isFormData(o)&&utils$7.isStandardBrowserEnv()&&delete r["Content-Type"];var l=new XMLHttpRequest;if(e.auth){var c=e.auth.username||"",d=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";r.Authorization="Basic "+btoa(c+":"+d)}var u=buildFullPath$1(e.baseURL,e.url);function h(){if(l){var i="getAllResponseHeaders"in l?parseHeaders(l.getAllResponseHeaders()):null,o={data:s&&"text"!==s&&"json"!==s?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:i,config:e,request:l};settle((function(e){t(e),a()}),(function(e){n(e),a()}),o),l=null}}if(l.open(e.method.toUpperCase(),buildURL$1(u,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=h:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(h)},l.onabort=function(){l&&(n(new AxiosError$2("Request aborted",AxiosError$2.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new AxiosError$2("Network Error",AxiosError$2.ERR_NETWORK,e,l,l)),l=null},l.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",i=e.transitional||transitionalDefaults$1;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new AxiosError$2(t,i.clarifyTimeoutError?AxiosError$2.ETIMEDOUT:AxiosError$2.ECONNABORTED,e,l)),l=null},utils$7.isStandardBrowserEnv()){var g=(e.withCredentials||isURLSameOrigin(u))&&e.xsrfCookieName?cookies.read(e.xsrfCookieName):void 0;g&&(r[e.xsrfHeaderName]=g)}"setRequestHeader"in l&&utils$7.forEach(r,(function(e,t){void 0===o&&"content-type"===t.toLowerCase()?delete r[t]:l.setRequestHeader(t,e)})),utils$7.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),s&&"json"!==s&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(i=function(e){l&&(n(!e||e&&e.type?new CanceledError$2:e),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i))),o||(o=null);var p=parseProtocol(u);p&&-1===["http","https","file"].indexOf(p)?n(new AxiosError$2("Unsupported protocol "+p+":",AxiosError$2.ERR_BAD_REQUEST,e)):l.send(o)}))},_null=null,utils$6=utils$h,normalizeHeaderName=normalizeHeaderName$1,AxiosError$1=AxiosError_1,transitionalDefaults=transitional,toFormData=toFormData_1,DEFAULT_CONTENT_TYPE={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(e,t){!utils$6.isUndefined(e)&&utils$6.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function getDefaultAdapter(){var e;return("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(e=xhr),e}function stringifySafely(e,t,n){if(utils$6.isString(e))try{return(t||JSON.parse)(e),utils$6.trim(e)}catch(e2){if("SyntaxError"!==e2.name)throw e2}return(n||JSON.stringify)(e)}var defaults$3={transitional:transitionalDefaults,adapter:getDefaultAdapter(),transformRequest:[function(e,t){if(normalizeHeaderName(t,"Accept"),normalizeHeaderName(t,"Content-Type"),utils$6.isFormData(e)||utils$6.isArrayBuffer(e)||utils$6.isBuffer(e)||utils$6.isStream(e)||utils$6.isFile(e)||utils$6.isBlob(e))return e;if(utils$6.isArrayBufferView(e))return e.buffer;if(utils$6.isURLSearchParams(e))return setContentTypeIfUnset(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var n,i=utils$6.isObject(e),o=t&&t["Content-Type"];if((n=utils$6.isFileList(e))||i&&"multipart/form-data"===o){var r=this.env&&this.env.FormData;return toFormData(n?{"files[]":e}:e,r&&new r)}return i||"application/json"===o?(setContentTypeIfUnset(t,"application/json"),stringifySafely(e)):e}],transformResponse:[function(e){var t=this.transitional||defaults$3.transitional,n=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,o=!n&&"json"===this.responseType;if(o||i&&utils$6.isString(e)&&e.length)try{return JSON.parse(e)}catch(e2){if(o){if("SyntaxError"===e2.name)throw AxiosError$1.from(e2,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response);throw e2}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_null},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};utils$6.forEach(["delete","get","head"],(function(e){defaults$3.headers[e]={}})),utils$6.forEach(["post","put","patch"],(function(e){defaults$3.headers[e]=utils$6.merge(DEFAULT_CONTENT_TYPE)}));var defaults_1=defaults$3,utils$5=utils$h,defaults$2=defaults_1,transformData$1=function(e,t,n){var i=this||defaults$2;return utils$5.forEach(n,(function(n){e=n.call(i,e,t)})),e},isCancel$1=function(e){return!(!e||!e.__CANCEL__)},utils$4=utils$h,transformData=transformData$1,isCancel=isCancel$1,defaults$1=defaults_1,CanceledError$1=CanceledError_1;function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CanceledError$1}var dispatchRequest$1=function(e){return throwIfCancellationRequested(e),e.headers=e.headers||{},e.data=transformData.call(e,e.data,e.headers,e.transformRequest),e.headers=utils$4.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),utils$4.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||defaults$1.adapter)(e).then((function(t){return throwIfCancellationRequested(e),t.data=transformData.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return isCancel(t)||(throwIfCancellationRequested(e),t&&t.response&&(t.response.data=transformData.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},utils$3=utils$h,mergeConfig$2=function(e,t){t=t||{};var n={};function i(e,t){return utils$3.isPlainObject(e)&&utils$3.isPlainObject(t)?utils$3.merge(e,t):utils$3.isPlainObject(t)?utils$3.merge({},t):utils$3.isArray(t)?t.slice():t}function o(n){return utils$3.isUndefined(t[n])?utils$3.isUndefined(e[n])?void 0:i(void 0,e[n]):i(e[n],t[n])}function r(e){if(!utils$3.isUndefined(t[e]))return i(void 0,t[e])}function s(n){return utils$3.isUndefined(t[n])?utils$3.isUndefined(e[n])?void 0:i(void 0,e[n]):i(void 0,t[n])}function a(n){return n in t?i(e[n],t[n]):n in e?i(void 0,e[n]):void 0}var l={url:r,method:r,data:r,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a};return utils$3.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=l[e]||o,i=t(e);utils$3.isUndefined(i)&&t!==a||(n[e]=i)})),n},data={version:"0.27.2"},VERSION$2=data.version,AxiosError=AxiosError_1,validators$1={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){validators$1[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var deprecatedWarnings={};function assertOptions(e,t,n){if("object"!=typeof e)throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);for(var i=Object.keys(e),o=i.length;o-- >0;){var r=i[o],s=t[r];if(s){var a=e[r],l=void 0===a||s(a,r,e);if(!0!==l)throw new AxiosError("option "+r+" must be "+l,AxiosError.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new AxiosError("Unknown option "+r,AxiosError.ERR_BAD_OPTION)}}validators$1.transitional=function(e,t,n){return function(i,o,r){if(!1===e)throw new AxiosError(function(e,t){return"[Axios v"+VERSION$2+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}(o," has been removed"+(t?" in "+t:"")),AxiosError.ERR_DEPRECATED);return t&&!deprecatedWarnings[o]&&(deprecatedWarnings[o]=!0),!e||e(i,o,r)}};var validator$1={assertOptions:assertOptions,validators:validators$1},utils$2=utils$h,buildURL=buildURL$2,InterceptorManager=InterceptorManager_1,dispatchRequest=dispatchRequest$1,mergeConfig$1=mergeConfig$2,buildFullPath=buildFullPath$2,validator=validator$1,validators=validator.validators;function Axios$1(e){this.defaults=e,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}Axios$1.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=mergeConfig$1(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&validator.assertOptions(n,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1);var i=[],o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));var r,s=[];if(this.interceptors.response.forEach((function(e){s.push(e.fulfilled,e.rejected)})),!o){var a=[dispatchRequest,void 0];for(Array.prototype.unshift.apply(a,i),a=a.concat(s),r=Promise.resolve(t);a.length;)r=r.then(a.shift(),a.shift());return r}for(var l=t;i.length;){var c=i.shift(),d=i.shift();try{l=c(l)}catch(u){d(u);break}}try{r=dispatchRequest(l)}catch(u){return Promise.reject(u)}for(;s.length;)r=r.then(s.shift(),s.shift());return r},Axios$1.prototype.getUri=function(e){e=mergeConfig$1(this.defaults,e);var t=buildFullPath(e.baseURL,e.url);return buildURL(t,e.params,e.paramsSerializer)},utils$2.forEach(["delete","get","head","options"],(function(e){Axios$1.prototype[e]=function(t,n){return this.request(mergeConfig$1(n||{},{method:e,url:t,data:(n||{}).data}))}})),utils$2.forEach(["post","put","patch"],(function(e){function t(t){return function(n,i,o){return this.request(mergeConfig$1(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Axios$1.prototype[e]=t(),Axios$1.prototype[e+"Form"]=t(!0)}));var Axios_1=Axios$1,CanceledError=CanceledError_1;function CancelToken(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,i=n._listeners.length;for(t=0;t<i;t++)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,i=new Promise((function(e){n.subscribe(e),t=e})).then(e);return i.cancel=function(){n.unsubscribe(t)},i},e((function(e){n.reason||(n.reason=new CanceledError(e),t(n.reason))}))}CancelToken.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},CancelToken.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},CancelToken.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},CancelToken.source=function(){var e;return{token:new CancelToken((function(t){e=t})),cancel:e}};var CancelToken_1=CancelToken,spread=function(e){return function(t){return e.apply(null,t)}},utils$1=utils$h,isAxiosError=function(e){return utils$1.isObject(e)&&!0===e.isAxiosError},utils=utils$h,bind=bind$2,Axios=Axios_1,mergeConfig=mergeConfig$2,defaults=defaults_1;function createInstance(e){var t=new Axios(e),n=bind(Axios.prototype.request,t);return utils.extend(n,Axios.prototype,t),utils.extend(n,t),n.create=function(t){return createInstance(mergeConfig(e,t))},n}var axios$1=createInstance(defaults);axios$1.Axios=Axios,axios$1.CanceledError=CanceledError_1,axios$1.CancelToken=CancelToken_1,axios$1.isCancel=isCancel$1,axios$1.VERSION=data.version,axios$1.toFormData=toFormData_1,axios$1.AxiosError=AxiosError_1,axios$1.Cancel=axios$1.CanceledError,axios$1.all=function(e){return Promise.all(e)},axios$1.spread=spread,axios$1.isAxiosError=isAxiosError,axios$2.exports=axios$1,axios$2.exports.default=axios$1;var axios=axios$2.exports,URL$1=(e=>(e.config="/apidoc/config",e))(URL$1||{});class globalApi$1{}globalApi$1.getConfig=e=>__async(void 0,null,(function*(){return get({url:"/apidoc/config",params:e})}));const getApidocUrls=()=>{const e=[];for(const t in URL)e.push(URL[t]);for(const t in URL$1)e.push(URL$1[t]);return e},createStorage=({prefixKey:e="",storage:t=localStorage})=>new class{constructor(){this.prefixKey=e,this.storage=t}getKey(e){return`${this.prefixKey}${e}`.toUpperCase()}set(e,t,n=null){const i=JSON.stringify({value:t,time:Date.now(),expire:n?(new Date).getTime()+1e3*n:null});this.storage.setItem(this.getKey(e),i)}get(e,t=null){const n=this.storage.getItem(this.getKey(e));if(!n)return t;try{const t=JSON.parse(n),{value:i,expire:o}=t;if(!o||o>=(new Date).getTime())return i;this.remove(e)}catch(e2){return t}}remove(e){this.storage.removeItem(this.getKey(e))}},feConfig=apidocFeConfig,createOptions$1=e=>{let t="";return feConfig&&feConfig.CACHE&&feConfig.CACHE.PREFIX&&(t=feConfig.CACHE.PREFIX),{storage:e,prefixKey:t}},WebStorage=createStorage(createOptions$1(localStorage)),APP_THEME="APP_THEME",APP_LANG="APP_LANG",APP_AUTH="APP_AUTH";let apidocUrls=[];const config$1=apidocFeConfig;let baseURL="";if(config$1.HTTP.HOSTS&&config$1.HTTP.HOSTS.length){const e=WebStorage.get("HOST");if(e){const t=config$1.HTTP.HOSTS.find((t=>t.host===e));baseURL=t&&t.host?t.host:config$1.HTTP.HOSTS[0].host}else baseURL=config$1.HTTP.HOSTS[0].host}axios.defaults.timeout=config$1.HTTP.TIMEOUT,axios.defaults.withCredentials=config$1.HTTP.WITHCREDENTIALS;const axiosInstance=axios.create({baseURL:baseURL});axiosInstance.interceptors.request.use((e=>{if(apidocUrls.length||(apidocUrls=getApidocUrls()),e&&apidocUrls.includes(e.url)){const t="get"==e.method?"params":"data";let n="";e[t]&&e[t].appKey&&(n=e[t].appKey);const i=WebStorage.get(APP_AUTH);let o="";i&&i[n]?o=i[n]:i&&i.global&&(o=i.global),o&&(e[t]?e[t].token=o:e[t]={token:o})}return e}),(e=>Promise.reject(e))),axiosInstance.interceptors.response.use((e=>e),(e=>Promise.reject(e)));const request=e=>{const t=e;return new Promise(((e,n)=>{axiosInstance.request(t).then((i=>{if(t.url&&apidocUrls.includes(t.url)){const{data:t}=i;if(0!=t.code){const e=i;return e.response={data:t},void n(e)}e(t)}else e(i)})).catch((e=>{n(e)}))}))};function get(e){return request(__spreadProps(__spreadValues({},e),{method:"GET"}))}function post(e){return request(__spreadProps(__spreadValues({},e),{method:"POST"}))}var URL=(e=>(e.apiMenus="/apidoc/apiMenus",e.apiDetail="/apidoc/apiDetail",e.docMenus="/apidoc/docMenus",e.docDetail="/apidoc/docDetail",e.generator="/apidoc/generator",e.verifyAuth="/apidoc/verifyAuth",e.cancelAllCache="/apidoc/cancelAllCache",e.createAllCache="/apidoc/createAllCache",e.renderCodeTemplate="/apidoc/renderCodeTemplate",e))(URL||{});class globalApi{}function handleApiData(e){const t=e.data,n={apiMenus:[],dashboard:{apiCount:0,apiMethodTotal:{},controllerGroupTotal:{},apiGroupTotal:{},apiTagTotal:{},apiAuthorTotal:{}}};return n.apiMenus=function e(t){return t.map((t=>{const i=t.method;let o=[],r="folder";if(t.controller?r="controller":i&&i.indexOf(",")>-1&&"string"==typeof i?(r="multiple",o=i.split(",")):i&&"object"==typeof i&&i.length?(r="multiple",o=i):i&&(r="api",o=[i]),"controller"===r&&t.group){const e=t.group,i=t.children&&t.children.length?t.children.length:0;n.dashboard.apiGroupTotal[e]?n.dashboard.apiGroupTotal[e]=n.dashboard.apiGroupTotal[e]+i:n.dashboard.apiGroupTotal[e]=i,n.dashboard.controllerGroupTotal[e]?n.dashboard.controllerGroupTotal[e]=n.dashboard.controllerGroupTotal[e]+1:n.dashboard.controllerGroupTotal[e]=1}else if(t.url){if(n.dashboard.apiCount++,o&&o.length)for(let e=0;e<o.length;e++){const t=o[e];n.dashboard.apiMethodTotal[t]?n.dashboard.apiMethodTotal[t]=n.dashboard.apiMethodTotal[t]+1:n.dashboard.apiMethodTotal[t]=1}if(t.tag&&t.tag.length)for(let e=0;e<t.tag.length;e++){const i=t.tag[e];n.dashboard.apiTagTotal[i]?n.dashboard.apiTagTotal[i]=n.dashboard.apiTagTotal[i]+1:n.dashboard.apiTagTotal[i]=1}t.author&&(n.dashboard.apiAuthorTotal[t.author]?n.dashboard.apiAuthorTotal[t.author]=n.dashboard.apiAuthorTotal[t.author]+1:n.dashboard.apiAuthorTotal[t.author]=1)}const s={name:t.name,title:t.title,menuKey:t.menuKey,type:r,method:t.method,url:t.url,tag:t.tag,controller:t.controller};return t.children&&t.children.length&&(s.children=e(t.children)),s}))}(t),n}function handleDocMenusData(e){const t={menus:[],count:0};return t.menus=function e(n){return n.map((n=>(n.path&&t.count++,n.children&&n.children.length&&(n.children=e(n.children)),n)))}(e),t}globalApi.getApiMenus=e=>__async(void 0,null,(function*(){return post({url:"/apidoc/apiMenus",data:e})})),globalApi.getApiDetail=e=>__async(void 0,null,(function*(){return post({url:"/apidoc/apiDetail",data:e})})),globalApi.getDocMenus=e=>__async(void 0,null,(function*(){return post({url:"/apidoc/docMenus",data:e})})),globalApi.getDocDetail=e=>__async(void 0,null,(function*(){return post({url:"/apidoc/docDetail",data:e})})),globalApi.generator=e=>__async(void 0,null,(function*(){return post({url:"/apidoc/generator",data:e})})),globalApi.verifyAuth=e=>__async(void 0,null,(function*(){return post({url:"/apidoc/verifyAuth",data:e})})),globalApi.cancelAllCache=()=>__async(void 0,null,(function*(){return post({url:"/apidoc/cancelAllCache"})})),globalApi.createAllCache=()=>__async(void 0,null,(function*(){return post({url:"/apidoc/createAllCache"})})),globalApi.renderCodeTemplate=e=>__async(void 0,null,(function*(){return post({url:"/apidoc/renderCodeTemplate",data:e})}));var index$r="",index$q="",vueI18n_cjs={};
- /*!
- * @intlify/shared v9.1.10
- * (c) 2022 kazuya kawaguchi
- * Released under the MIT License.
- */
- const inBrowser="undefined"!=typeof window;let mark,measure;const RE_ARGS=/\{([0-9a-zA-Z]+)\}/g;function format$1(e,...t){return 1===t.length&&isObject$2(t[0])&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(RE_ARGS,((e,n)=>t.hasOwnProperty(n)?t[n]:""))}const hasSymbol="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,makeSymbol=e=>hasSymbol?Symbol(e):e,generateFormatCacheKey=(e,t,n)=>friendlyJSONstringify({l:e,k:t,s:n}),friendlyJSONstringify=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),isNumber$2=e=>"number"==typeof e&&isFinite(e),isDate=e=>"[object Date]"===toTypeString(e),isRegExp=e=>"[object RegExp]"===toTypeString(e),isEmptyObject=e=>isPlainObject(e)&&0===Object.keys(e).length;function warn(e,t){}const assign=Object.assign;let _globalThis;const getGlobalThis=()=>_globalThis||(_globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function escapeHtml(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const hasOwnProperty$5=Object.prototype.hasOwnProperty;function hasOwn$1(e,t){return hasOwnProperty$5.call(e,t)}const isArray$1=Array.isArray,isFunction$1=e=>"function"==typeof e,isString$3=e=>"string"==typeof e,isBoolean$1=e=>"boolean"==typeof e,isSymbol=e=>"symbol"==typeof e,isObject$2=e=>null!==e&&"object"==typeof e,isPromise=e=>isObject$2(e)&&isFunction$1(e.then)&&isFunction$1(e.catch),objectToString=Object.prototype.toString,toTypeString=e=>objectToString.call(e),isPlainObject=e=>"[object Object]"===toTypeString(e),toDisplayString=e=>null==e?"":isArray$1(e)||isPlainObject(e)&&e.toString===objectToString?JSON.stringify(e,null,2):String(e),RANGE=2;function generateCodeFrame(e,t=0,n=e.length){const i=e.split(/\r?\n/);let o=0;const r=[];for(let s=0;s<i.length;s++)if(o+=i[s].length+1,o>=t){for(let e=s-RANGE;e<=s+RANGE||n>o;e++){if(e<0||e>=i.length)continue;const a=e+1;r.push(`${a}${" ".repeat(3-String(a).length)}| ${i[e]}`);const l=i[e].length;if(e===s){const e=t-(o-l)+1,i=Math.max(1,n>o?l-e:n-t);r.push(" | "+" ".repeat(e)+"^".repeat(i))}else if(e>s){if(n>o){const e=Math.max(Math.min(n-o,l),1);r.push(" | "+"^".repeat(e))}o+=l+1}}break}return r.join("\n")}function createEmitter(){const e=new Map;return{events:e,on(t,n){const i=e.get(t);i&&i.push(n)||e.set(t,[n])},off(t,n){const i=e.get(t);i&&i.splice(i.indexOf(n)>>>0,1)},emit(t,n){(e.get(t)||[]).slice().map((e=>e(n))),(e.get("*")||[]).slice().map((e=>e(t,n)))}}}var shared_esmBundler=Object.freeze(Object.defineProperty({__proto__:null,assign:assign,createEmitter:createEmitter,escapeHtml:escapeHtml,format:format$1,friendlyJSONstringify:friendlyJSONstringify,generateCodeFrame:generateCodeFrame,generateFormatCacheKey:generateFormatCacheKey,getGlobalThis:getGlobalThis,hasOwn:hasOwn$1,inBrowser:inBrowser,isArray:isArray$1,isBoolean:isBoolean$1,isDate:isDate,isEmptyObject:isEmptyObject,isFunction:isFunction$1,isNumber:isNumber$2,isObject:isObject$2,isPlainObject:isPlainObject,isPromise:isPromise,isRegExp:isRegExp,isString:isString$3,isSymbol:isSymbol,makeSymbol:makeSymbol,mark:mark,measure:measure,objectToString:objectToString,toDisplayString:toDisplayString,toTypeString:toTypeString,warn:warn},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(shared_esmBundler);
- /*!
- * @intlify/message-resolver v9.1.10
- * (c) 2022 kazuya kawaguchi
- * Released under the MIT License.
- */
- const hasOwnProperty$4=Object.prototype.hasOwnProperty;function hasOwn(e,t){return hasOwnProperty$4.call(e,t)}const isObject$1=e=>null!==e&&"object"==typeof e,pathStateMachine=[];pathStateMachine[0]={w:[0],i:[3,0],"[":[4],o:[7]},pathStateMachine[1]={w:[1],".":[2],"[":[4],o:[7]},pathStateMachine[2]={w:[2],i:[3,0],0:[3,0]},pathStateMachine[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},pathStateMachine[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},pathStateMachine[5]={"'":[4,0],o:8,l:[5,0]},pathStateMachine[6]={'"':[4,0],o:8,l:[6,0]};const literalValueRE=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function isLiteral(e){return literalValueRE.test(e)}function stripQuotes(e){const t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}function getPathCharType(e){if(null==e)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function formatSubPath(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(isLiteral(t)?stripQuotes(t):"*"+t)}function parse$2(e){const t=[];let n,i,o,r,s,a,l,c=-1,d=0,u=0;const h=[];function g(){const t=e[c+1];if(5===d&&"'"===t||6===d&&'"'===t)return c++,o="\\"+t,h[0](),!0}for(h[0]=()=>{void 0===i?i=o:i+=o},h[1]=()=>{void 0!==i&&(t.push(i),i=void 0)},h[2]=()=>{h[0](),u++},h[3]=()=>{if(u>0)u--,d=4,h[0]();else{if(u=0,void 0===i)return!1;if(i=formatSubPath(i),!1===i)return!1;h[1]()}};null!==d;)if(c++,n=e[c],"\\"!==n||!g()){if(r=getPathCharType(n),l=pathStateMachine[d],s=l[r]||l.l||8,8===s)return;if(d=s[0],void 0!==s[1]&&(a=h[s[1]],a&&(o=n,!1===a())))return;if(7===d)return t}}const cache=new Map;function resolveValue(e,t){if(!isObject$1(e))return null;let n=cache.get(t);if(n||(n=parse$2(t),n&&cache.set(t,n)),!n)return null;const i=n.length;let o=e,r=0;for(;r<i;){const e=o[n[r]];if(void 0===e)return null;o=e,r++}return o}function handleFlatJson(e){if(!isObject$1(e))return e;for(const t in e)if(hasOwn(e,t))if(t.includes(".")){const n=t.split("."),i=n.length-1;let o=e;for(let e=0;e<i;e++)n[e]in o||(o[n[e]]={}),o=o[n[e]];o[n[i]]=e[t],delete e[t],isObject$1(o[n[i]])&&handleFlatJson(o[n[i]])}else isObject$1(e[t])&&handleFlatJson(e[t]);return e}
- /*!
- * @intlify/runtime v9.1.10
- * (c) 2022 kazuya kawaguchi
- * Released under the MIT License.
- */const DEFAULT_MODIFIER=e=>e,DEFAULT_MESSAGE=e=>"",DEFAULT_MESSAGE_DATA_TYPE="text",DEFAULT_NORMALIZE=e=>0===e.length?"":e.join(""),DEFAULT_INTERPOLATE=toDisplayString;function pluralDefault(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function getPluralIndex(e){const t=isNumber$2(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(isNumber$2(e.named.count)||isNumber$2(e.named.n))?isNumber$2(e.named.count)?e.named.count:isNumber$2(e.named.n)?e.named.n:t:t}function normalizeNamed(e,t){t.count||(t.count=e),t.n||(t.n=e)}function createMessageContext(e={}){const t=e.locale,n=getPluralIndex(e),i=isObject$2(e.pluralRules)&&isString$3(t)&&isFunction$1(e.pluralRules[t])?e.pluralRules[t]:pluralDefault,o=isObject$2(e.pluralRules)&&isString$3(t)&&isFunction$1(e.pluralRules[t])?pluralDefault:void 0,r=e.list||[],s=e.named||{};isNumber$2(e.pluralIndex)&&normalizeNamed(n,s);function a(t){const n=isFunction$1(e.messages)?e.messages(t):!!isObject$2(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):DEFAULT_MESSAGE)}const l=isPlainObject(e.processor)&&isFunction$1(e.processor.normalize)?e.processor.normalize:DEFAULT_NORMALIZE,c=isPlainObject(e.processor)&&isFunction$1(e.processor.interpolate)?e.processor.interpolate:DEFAULT_INTERPOLATE,d={list:e=>r[e],named:e=>s[e],plural:e=>e[i(n,e.length,o)],linked:(t,n)=>{const i=a(t)(d);return isString$3(n)?(o=n,e.modifiers?e.modifiers[o]:DEFAULT_MODIFIER)(i):i;var o},message:a,type:isPlainObject(e.processor)&&isString$3(e.processor.type)?e.processor.type:DEFAULT_MESSAGE_DATA_TYPE,interpolate:c,normalize:l};return d}
- /*!
- * @intlify/message-compiler v9.1.10
- * (c) 2022 kazuya kawaguchi
- * Released under the MIT License.
- */function createCompileError(e,t,n={}){const{domain:i,messages:o,args:r}=n,s=new SyntaxError(String(e));return s.code=e,t&&(s.location=t),s.domain=i,s}function defaultOnError(e){throw e}function createPosition(e,t,n){return{line:e,column:t,offset:n}}function createLocation(e,t,n){const i={start:e,end:t};return null!=n&&(i.source=n),i}const CHAR_SP=" ",CHAR_CR="\r",CHAR_LF="\n",CHAR_LS=String.fromCharCode(8232),CHAR_PS=String.fromCharCode(8233);function createScanner(e){const t=e;let n=0,i=1,o=1,r=0;const s=e=>t[e]===CHAR_CR&&t[e+1]===CHAR_LF,a=e=>t[e]===CHAR_PS,l=e=>t[e]===CHAR_LS,c=e=>s(e)||(e=>t[e]===CHAR_LF)(e)||a(e)||l(e),d=e=>s(e)||a(e)||l(e)?CHAR_LF:t[e];function u(){return r=0,c(n)&&(i++,o=0),s(n)&&n++,n++,o++,t[n]}return{index:()=>n,line:()=>i,column:()=>o,peekOffset:()=>r,charAt:d,currentChar:()=>d(n),currentPeek:()=>d(n+r),next:u,peek:function(){return s(n+r)&&r++,r++,t[n+r]},reset:function(){n=0,i=1,o=1,r=0},resetPeek:function(e=0){r=e},skipToPeek:function(){const e=n+r;for(;e!==n;)u();r=0}}}const EOF=void 0,LITERAL_DELIMITER="'",ERROR_DOMAIN$1="tokenizer";function createTokenizer(e,t={}){const n=!1!==t.location,i=createScanner(e),o=()=>i.index(),r=()=>createPosition(i.line(),i.column(),i.index()),s=r(),a=o(),l={currentType:14,offset:a,startLoc:s,endLoc:s,lastType:14,lastOffset:a,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},c=()=>l,{onError:d}=t;function u(e,t,n,...i){const o=c();if(t.column+=n,t.offset+=n,d){const n=createCompileError(e,createLocation(o.startLoc,t),{domain:ERROR_DOMAIN$1,args:i});d(n)}}function h(e,t,i){e.endLoc=r(),e.currentType=t;const o={type:t};return n&&(o.loc=createLocation(e.startLoc,e.endLoc)),null!=i&&(o.value=i),o}const g=e=>h(e,14);function p(e,t){return e.currentChar()===t?(e.next(),t):(u(0,r(),0,t),"")}function f(e){let t="";for(;e.currentPeek()===CHAR_SP||e.currentPeek()===CHAR_LF;)t+=e.currentPeek(),e.peek();return t}function m(e){const t=f(e);return e.skipToPeek(),t}function v(e){if(e===EOF)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||95===t}function _(e,t){const{currentType:n}=t;if(2!==n)return!1;f(e);const i=function(e){if(e===EOF)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),i}function C(e){f(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function b(e,t=!0){const n=(t=!1,i="",o=!1)=>{const r=e.currentPeek();return"{"===r?"%"!==i&&t:"@"!==r&&r?"%"===r?(e.peek(),n(t,"%",!0)):"|"===r?!("%"!==i&&!o)||!(i===CHAR_SP||i===CHAR_LF):r===CHAR_SP?(e.peek(),n(!0,CHAR_SP,o)):r!==CHAR_LF||(e.peek(),n(!0,CHAR_LF,o)):"%"===i||t},i=n();return t&&e.resetPeek(),i}function y(e,t){const n=e.currentChar();return n===EOF?EOF:t(n)?(e.next(),n):null}function S(e){return y(e,(e=>{const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t}))}function w(e){return y(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}))}function E(e){return y(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}))}function x(e){let t="",n="";for(;t=w(e);)n+=t;return n}function T(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return I(e,t,4);case"U":return I(e,t,6);default:return u(3,r(),0,t),""}}function I(e,t,n){p(e,t);let i="";for(let o=0;o<n;o++){const n=E(e);if(!n){u(4,r(),0,`\\${t}${i}${e.currentChar()}`);break}i+=n}return`\\${t}${i}`}function k(e){m(e);const t=p(e,"|");return m(e),t}function L(e,t){let n=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&u(8,r(),0),e.next(),n=h(t,2,"{"),m(e),t.braceNest++,n;case"}":return t.braceNest>0&&2===t.currentType&&u(7,r(),0),e.next(),n=h(t,3,"}"),t.braceNest--,t.braceNest>0&&m(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),n;case"@":return t.braceNest>0&&u(6,r(),0),n=D(e,t)||g(t),t.braceNest=0,n;default:let i=!0,o=!0,s=!0;if(C(e))return t.braceNest>0&&u(6,r(),0),n=h(t,1,k(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(5===t.currentType||6===t.currentType||7===t.currentType))return u(6,r(),0),t.braceNest=0,N(e,t);if(i=function(e,t){const{currentType:n}=t;if(2!==n)return!1;f(e);const i=v(e.currentPeek());return e.resetPeek(),i}(e,t))return n=h(t,5,function(e){m(e);let t="",n="";for(;t=S(e);)n+=t;return e.currentChar()===EOF&&u(6,r(),0),n}(e)),m(e),n;if(o=_(e,t))return n=h(t,6,function(e){m(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${x(e)}`):t+=x(e),e.currentChar()===EOF&&u(6,r(),0),t}(e)),m(e),n;if(s=function(e,t){const{currentType:n}=t;if(2!==n)return!1;f(e);const i=e.currentPeek()===LITERAL_DELIMITER;return e.resetPeek(),i}(e,t))return n=h(t,7,function(e){m(e),p(e,"'");let t="",n="";const i=e=>e!==LITERAL_DELIMITER&&e!==CHAR_LF;for(;t=y(e,i);)n+="\\"===t?T(e):t;const o=e.currentChar();return o===CHAR_LF||o===EOF?(u(2,r(),0),o===CHAR_LF&&(e.next(),p(e,"'")),n):(p(e,"'"),n)}(e)),m(e),n;if(!i&&!o&&!s)return n=h(t,13,function(e){m(e);let t="",n="";const i=e=>"{"!==e&&"}"!==e&&e!==CHAR_SP&&e!==CHAR_LF;for(;t=y(e,i);)n+=t;return n}(e)),u(1,r(),0,n.value),m(e),n}return n}function D(e,t){const{currentType:n}=t;let i=null;const o=e.currentChar();switch(8!==n&&9!==n&&12!==n&&10!==n||o!==CHAR_LF&&o!==CHAR_SP||u(9,r(),0),o){case"@":return e.next(),i=h(t,8,"@"),t.inLinked=!0,i;case".":return m(e),e.next(),h(t,9,".");case":":return m(e),e.next(),h(t,10,":");default:return C(e)?(i=h(t,1,k(e)),t.braceNest=0,t.inLinked=!1,i):function(e,t){const{currentType:n}=t;if(8!==n)return!1;f(e);const i="."===e.currentPeek();return e.resetPeek(),i}(e,t)||function(e,t){const{currentType:n}=t;if(8!==n&&12!==n)return!1;f(e);const i=":"===e.currentPeek();return e.resetPeek(),i}(e,t)?(m(e),D(e,t)):function(e,t){const{currentType:n}=t;if(9!==n)return!1;f(e);const i=v(e.currentPeek());return e.resetPeek(),i}(e,t)?(m(e),h(t,12,function(e){let t="",n="";for(;t=S(e);)n+=t;return n}(e))):function(e,t){const{currentType:n}=t;if(10!==n)return!1;const i=()=>{const t=e.currentPeek();return"{"===t?v(e.peek()):!("@"===t||"%"===t||"|"===t||":"===t||"."===t||t===CHAR_SP||!t)&&(t===CHAR_LF?(e.peek(),i()):v(t))},o=i();return e.resetPeek(),o}(e,t)?(m(e),"{"===o?L(e,t)||i:h(t,11,function(e){const t=(n=!1,i)=>{const o=e.currentChar();return"{"!==o&&"%"!==o&&"@"!==o&&"|"!==o&&o?o===CHAR_SP?i:o===CHAR_LF?(i+=o,e.next(),t(n,i)):(i+=o,e.next(),t(!0,i)):i};return t(!1,"")}(e))):(8===n&&u(9,r(),0),t.braceNest=0,t.inLinked=!1,N(e,t))}}function N(e,t){let n={type:14};if(t.braceNest>0)return L(e,t)||g(t);if(t.inLinked)return D(e,t)||g(t);const i=e.currentChar();switch(i){case"{":return L(e,t)||g(t);case"}":return u(5,r(),0),e.next(),h(t,3,"}");case"@":return D(e,t)||g(t);default:if(C(e))return n=h(t,1,k(e)),t.braceNest=0,t.inLinked=!1,n;if(b(e))return h(t,0,function(e){let t="";for(;;){const n=e.currentChar();if("{"===n||"}"===n||"@"===n||"|"===n||!n)break;if("%"===n){if(!b(e))break;t+=n,e.next()}else if(n===CHAR_SP||n===CHAR_LF)if(b(e))t+=n,e.next();else{if(C(e))break;t+=n,e.next()}else t+=n,e.next()}return t}(e));if("%"===i)return e.next(),h(t,4,"%")}return n}return{nextToken:function(){const{currentType:e,offset:t,startLoc:n,endLoc:s}=l;return l.lastType=e,l.lastOffset=t,l.lastStartLoc=n,l.lastEndLoc=s,l.offset=o(),l.startLoc=r(),i.currentChar()===EOF?h(l,14):N(i,l)},currentOffset:o,currentPosition:r,context:c}}const ERROR_DOMAIN="parser",KNOWN_ESCAPES=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function fromEscapeSequence(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(t||n,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function createParser(e={}){const t=!1!==e.location,{onError:n}=e;function i(e,t,i,o,...r){const s=e.currentPosition();if(s.offset+=o,s.column+=o,n){const e=createCompileError(t,createLocation(i,s),{domain:ERROR_DOMAIN,args:r});n(e)}}function o(e,n,i){const o={type:e,start:n,end:n};return t&&(o.loc={start:i,end:i}),o}function r(e,n,i,o){e.end=n,o&&(e.type=o),t&&e.loc&&(e.loc.end=i)}function s(e,t){const n=e.context(),i=o(3,n.offset,n.startLoc);return i.value=t,r(i,e.currentOffset(),e.currentPosition()),i}function a(e,t){const n=e.context(),{lastOffset:i,lastStartLoc:s}=n,a=o(5,i,s);return a.index=parseInt(t,10),e.nextToken(),r(a,e.currentOffset(),e.currentPosition()),a}function l(e,t){const n=e.context(),{lastOffset:i,lastStartLoc:s}=n,a=o(4,i,s);return a.key=t,e.nextToken(),r(a,e.currentOffset(),e.currentPosition()),a}function c(e,t){const n=e.context(),{lastOffset:i,lastStartLoc:s}=n,a=o(9,i,s);return a.value=t.replace(KNOWN_ESCAPES,fromEscapeSequence),e.nextToken(),r(a,e.currentOffset(),e.currentPosition()),a}function d(e){const t=e.context(),n=o(6,t.offset,t.startLoc);let s=e.nextToken();if(9===s.type){const t=function(e){const t=e.nextToken(),n=e.context(),{lastOffset:s,lastStartLoc:a}=n,l=o(8,s,a);return 12!==t.type?(i(e,11,n.lastStartLoc,0),l.value="",r(l,s,a),{nextConsumeToken:t,node:l}):(null==t.value&&i(e,13,n.lastStartLoc,0,getTokenCaption(t)),l.value=t.value||"",r(l,e.currentOffset(),e.currentPosition()),{node:l})}(e);n.modifier=t.node,s=t.nextConsumeToken||e.nextToken()}switch(10!==s.type&&i(e,13,t.lastStartLoc,0,getTokenCaption(s)),s=e.nextToken(),2===s.type&&(s=e.nextToken()),s.type){case 11:null==s.value&&i(e,13,t.lastStartLoc,0,getTokenCaption(s)),n.key=function(e,t){const n=e.context(),i=o(7,n.offset,n.startLoc);return i.value=t,r(i,e.currentOffset(),e.currentPosition()),i}(e,s.value||"");break;case 5:null==s.value&&i(e,13,t.lastStartLoc,0,getTokenCaption(s)),n.key=l(e,s.value||"");break;case 6:null==s.value&&i(e,13,t.lastStartLoc,0,getTokenCaption(s)),n.key=a(e,s.value||"");break;case 7:null==s.value&&i(e,13,t.lastStartLoc,0,getTokenCaption(s)),n.key=c(e,s.value||"");break;default:i(e,12,t.lastStartLoc,0);const d=e.context(),u=o(7,d.offset,d.startLoc);return u.value="",r(u,d.offset,d.startLoc),n.key=u,r(n,d.offset,d.startLoc),{nextConsumeToken:s,node:n}}return r(n,e.currentOffset(),e.currentPosition()),{node:n}}function u(e){const t=e.context(),n=o(2,1===t.currentType?e.currentOffset():t.offset,1===t.currentType?t.endLoc:t.startLoc);n.items=[];let u=null;do{const o=u||e.nextToken();switch(u=null,o.type){case 0:null==o.value&&i(e,13,t.lastStartLoc,0,getTokenCaption(o)),n.items.push(s(e,o.value||""));break;case 6:null==o.value&&i(e,13,t.lastStartLoc,0,getTokenCaption(o)),n.items.push(a(e,o.value||""));break;case 5:null==o.value&&i(e,13,t.lastStartLoc,0,getTokenCaption(o)),n.items.push(l(e,o.value||""));break;case 7:null==o.value&&i(e,13,t.lastStartLoc,0,getTokenCaption(o)),n.items.push(c(e,o.value||""));break;case 8:const r=d(e);n.items.push(r.node),u=r.nextConsumeToken||null}}while(14!==t.currentType&&1!==t.currentType);return r(n,1===t.currentType?t.lastOffset:e.currentOffset(),1===t.currentType?t.lastEndLoc:e.currentPosition()),n}function h(e){const t=e.context(),{offset:n,startLoc:s}=t,a=u(e);return 14===t.currentType?a:function(e,t,n,s){const a=e.context();let l=0===s.items.length;const c=o(1,t,n);c.cases=[],c.cases.push(s);do{const t=u(e);l||(l=0===t.items.length),c.cases.push(t)}while(14!==a.currentType);return l&&i(e,10,n,0),r(c,e.currentOffset(),e.currentPosition()),c}(e,n,s,a)}return{parse:function(n){const s=createTokenizer(n,assign({},e)),a=s.context(),l=o(0,a.offset,a.startLoc);return t&&l.loc&&(l.loc.source=n),l.body=h(s),14!==a.currentType&&i(s,13,a.lastStartLoc,0,n[a.offset]||""),r(l,s.currentOffset(),s.currentPosition()),l}}}function getTokenCaption(e){if(14===e.type)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function createTransformer(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:e=>(n.helpers.add(e),e)}}function traverseNodes(e,t){for(let n=0;n<e.length;n++)traverseNode(e[n],t)}function traverseNode(e,t){switch(e.type){case 1:traverseNodes(e.cases,t),t.helper("plural");break;case 2:traverseNodes(e.items,t);break;case 6:traverseNode(e.key,t),t.helper("linked");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named")}}function transform(e,t={}){const n=createTransformer(e);n.helper("normalize"),e.body&&traverseNode(e.body,n);const i=n.context();e.helpers=Array.from(i.helpers)}function createCodeGenerator(e,t){const{sourceMap:n,filename:i,breakLineCode:o,needIndent:r}=t,s={source:e.loc.source,filename:i,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:r,indentLevel:0};function a(e,t){s.code+=e}function l(e,t=!0){const n=t?o:"";a(r?n+" ".repeat(e):n)}return{context:()=>s,push:a,indent:function(e=!0){const t=++s.indentLevel;e&&l(t)},deindent:function(e=!0){const t=--s.indentLevel;e&&l(t)},newline:function(){l(s.indentLevel)},helper:e=>`_${e}`,needIndent:()=>s.needIndent}}function generateLinkedNode(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),generateNode(e,t.key),t.modifier&&(e.push(", "),generateNode(e,t.modifier)),e.push(")")}function generateMessageNode(e,t){const{helper:n,needIndent:i}=e;e.push(`${n("normalize")}([`),e.indent(i());const o=t.items.length;for(let r=0;r<o&&(generateNode(e,t.items[r]),r!==o-1);r++)e.push(", ");e.deindent(i()),e.push("])")}function generatePluralNode(e,t){const{helper:n,needIndent:i}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(i());const o=t.cases.length;for(let n=0;n<o&&(generateNode(e,t.cases[n]),n!==o-1);n++)e.push(", ");e.deindent(i()),e.push("])")}}function generateResource(e,t){t.body?generateNode(e,t.body):e.push("null")}function generateNode(e,t){const{helper:n}=e;switch(t.type){case 0:generateResource(e,t);break;case 1:generatePluralNode(e,t);break;case 2:generateMessageNode(e,t);break;case 6:generateLinkedNode(e,t);break;case 8:case 7:case 9:case 3:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t)}}const generate=(e,t={})=>{const n=isString$3(t.mode)?t.mode:"normal",i=isString$3(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,r=null!=t.breakLineCode?t.breakLineCode:"arrow"===n?";":"\n",s=t.needIndent?t.needIndent:"arrow"!==n,a=e.helpers||[],l=createCodeGenerator(e,{mode:n,filename:i,sourceMap:o,breakLineCode:r,needIndent:s});l.push("normal"===n?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(s),a.length>0&&(l.push(`const { ${a.map((e=>`${e}: _${e}`)).join(", ")} } = ctx`),l.newline()),l.push("return "),generateNode(l,e),l.deindent(s),l.push("}");const{code:c,map:d}=l.context();return{ast:e,code:c,map:d?d.toJSON():void 0}};function baseCompile(e,t={}){const n=assign({},t),i=createParser(n).parse(e);return transform(i,n),generate(i,n)}
- /*!
- * @intlify/devtools-if v9.1.10
- * (c) 2022 kazuya kawaguchi
- * Released under the MIT License.
- */const IntlifyDevToolsHooks={I18nInit:"i18n:init",FunctionTranslate:"function:translate"};
- /*!
- * @intlify/core-base v9.1.10
- * (c) 2022 kazuya kawaguchi
- * Released under the MIT License.
- */let devtools=null;function setDevToolsHook(e){devtools=e}function getDevToolsHook(){return devtools}function initI18nDevTools(e,t,n){devtools&&devtools.emit(IntlifyDevToolsHooks.I18nInit,{timestamp:Date.now(),i18n:e,version:t,meta:n})}const translateDevTools=createDevToolsHook(IntlifyDevToolsHooks.FunctionTranslate);function createDevToolsHook(e){return t=>devtools&&devtools.emit(e,t)}const warnMessages$1={0:"Not found '{key}' key in '{locale}' locale messages.",1:"Fall back to translate '{key}' key with '{target}' locale.",2:"Cannot format a number value due to not supported Intl.NumberFormat.",3:"Fall back to number format '{key}' key with '{target}' locale.",4:"Cannot format a date value due to not supported Intl.DateTimeFormat.",5:"Fall back to datetime format '{key}' key with '{target}' locale."};function getWarnMessage$1(e,...t){return format$1(warnMessages$1[e],...t)}const VERSION$1="9.1.10",NOT_REOSLVED=-1,MISSING_RESOLVE_VALUE="";function getDefaultLinkedModifiers(){return{upper:e=>isString$3(e)?e.toUpperCase():e,lower:e=>isString$3(e)?e.toLowerCase():e,capitalize:e=>isString$3(e)?`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`:e}}let _compiler;function registerMessageCompiler(e){_compiler=e}let _additionalMeta=null;const setAdditionalMeta=e=>{_additionalMeta=e},getAdditionalMeta=()=>_additionalMeta;let _cid=0;function createCoreContext(e={}){const t=isString$3(e.version)?e.version:VERSION$1,n=isString$3(e.locale)?e.locale:"en-US",i=isArray$1(e.fallbackLocale)||isPlainObject(e.fallbackLocale)||isString$3(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:n,o=isPlainObject(e.messages)?e.messages:{[n]:{}},r=isPlainObject(e.datetimeFormats)?e.datetimeFormats:{[n]:{}},s=isPlainObject(e.numberFormats)?e.numberFormats:{[n]:{}},a=assign({},e.modifiers||{},getDefaultLinkedModifiers()),l=e.pluralRules||{},c=isFunction$1(e.missing)?e.missing:null,d=!isBoolean$1(e.missingWarn)&&!isRegExp(e.missingWarn)||e.missingWarn,u=!isBoolean$1(e.fallbackWarn)&&!isRegExp(e.fallbackWarn)||e.fallbackWarn,h=!!e.fallbackFormat,g=!!e.unresolving,p=isFunction$1(e.postTranslation)?e.postTranslation:null,f=isPlainObject(e.processor)?e.processor:null,m=!isBoolean$1(e.warnHtmlMessage)||e.warnHtmlMessage,v=!!e.escapeParameter,_=isFunction$1(e.messageCompiler)?e.messageCompiler:_compiler,C=isFunction$1(e.onWarn)?e.onWarn:warn,b=e,y=isObject$2(b.__datetimeFormatters)?b.__datetimeFormatters:new Map,S=isObject$2(b.__numberFormatters)?b.__numberFormatters:new Map,w=isObject$2(b.__meta)?b.__meta:{};_cid++;const E={version:t,cid:_cid,locale:n,fallbackLocale:i,messages:o,datetimeFormats:r,numberFormats:s,modifiers:a,pluralRules:l,missing:c,missingWarn:d,fallbackWarn:u,fallbackFormat:h,unresolving:g,postTranslation:p,processor:f,warnHtmlMessage:m,escapeParameter:v,messageCompiler:_,onWarn:C,__datetimeFormatters:y,__numberFormatters:S,__meta:w};return __INTLIFY_PROD_DEVTOOLS__&&initI18nDevTools(E,t,w),E}function isTranslateFallbackWarn(e,t){return e instanceof RegExp?e.test(t):e}function isTranslateMissingWarn(e,t){return e instanceof RegExp?e.test(t):e}function handleMissing(e,t,n,i,o){const{missing:r,onWarn:s}=e;if(null!==r){const i=r(e,n,t,o);return isString$3(i)?i:t}return t}function getLocaleChain(e,t,n){const i=e;i.__localeChainCache||(i.__localeChainCache=new Map);let o=i.__localeChainCache.get(n);if(!o){o=[];let e=[n];for(;isArray$1(e);)e=appendBlockToChain(o,e,t);const r=isArray$1(t)?t:isPlainObject(t)?t.default?t.default:null:t;e=isString$3(r)?[r]:r,isArray$1(e)&&appendBlockToChain(o,e,!1),i.__localeChainCache.set(n,o)}return o}function appendBlockToChain(e,t,n){let i=!0;for(let o=0;o<t.length&&isBoolean$1(i);o++){const r=t[o];isString$3(r)&&(i=appendLocaleToChain(e,t[o],n))}return i}function appendLocaleToChain(e,t,n){let i;const o=t.split("-");do{i=appendItemToChain(e,o.join("-"),n),o.splice(-1,1)}while(o.length&&!0===i);return i}function appendItemToChain(e,t,n){let i=!1;if(!e.includes(t)&&(i=!0,t)){i="!"!==t[t.length-1];const o=t.replace(/!/g,"");e.push(o),(isArray$1(n)||isPlainObject(n))&&n[o]&&(i=n[o])}return i}function updateFallbackLocale(e,t,n){e.__localeChainCache=new Map,getLocaleChain(e,n,t)}const defaultOnCacheKey=e=>e;let compileCache=Object.create(null);function clearCompileCache(){compileCache=Object.create(null)}function compileToFunction(e,t={}){{const n=(t.onCacheKey||defaultOnCacheKey)(e),i=compileCache[n];if(i)return i;let o=!1;const r=t.onError||defaultOnError;t.onError=e=>{o=!0,r(e)};const{code:s}=baseCompile(e,t),a=new Function(`return ${s}`)();return o?a:compileCache[n]=a}}function createCoreError(e){return createCompileError(e,null,void 0)}const NOOP_MESSAGE_FUNCTION=()=>"",isMessageFunction=e=>isFunction$1(e);function translate(e,...t){const{fallbackFormat:n,postTranslation:i,unresolving:o,fallbackLocale:r,messages:s}=e,[a,l]=parseTranslateArgs(...t),c=isBoolean$1(l.missingWarn)?l.missingWarn:e.missingWarn,d=isBoolean$1(l.fallbackWarn)?l.fallbackWarn:e.fallbackWarn,u=isBoolean$1(l.escapeParameter)?l.escapeParameter:e.escapeParameter,h=!!l.resolvedMessage,g=isString$3(l.default)||isBoolean$1(l.default)?isBoolean$1(l.default)?a:l.default:n?a:"",p=n||""!==g,f=isString$3(l.locale)?l.locale:e.locale;u&&escapeParams(l);let[m,v,_]=h?[a,f,s[f]||{}]:resolveMessageFormat(e,a,f,r,d,c),C=a;if(h||isString$3(m)||isMessageFunction(m)||p&&(m=g,C=m),!(h||(isString$3(m)||isMessageFunction(m))&&isString$3(v)))return o?NOT_REOSLVED:a;let b=!1;const y=isMessageFunction(m)?m:compileMessageFormat(e,a,v,m,C,(()=>{b=!0}));if(b)return m;const S=evaluateMessage(e,y,createMessageContext(getMessageContextOptions(e,v,_,l))),w=i?i(S):S;if(__INTLIFY_PROD_DEVTOOLS__){const t={timestamp:Date.now(),key:isString$3(a)?a:isMessageFunction(m)?m.key:"",locale:v||(isMessageFunction(m)?m.locale:""),format:isString$3(m)?m:isMessageFunction(m)?m.source:"",message:w};t.meta=assign({},e.__meta,getAdditionalMeta()||{}),translateDevTools(t)}return w}function escapeParams(e){isArray$1(e.list)?e.list=e.list.map((e=>isString$3(e)?escapeHtml(e):e)):isObject$2(e.named)&&Object.keys(e.named).forEach((t=>{isString$3(e.named[t])&&(e.named[t]=escapeHtml(e.named[t]))}))}function resolveMessageFormat(e,t,n,i,o,r){const{messages:s,onWarn:a}=e,l=getLocaleChain(e,i,n);let c,d={},u=null;for(let h=0;h<l.length&&(c=l[h],d=s[c]||{},null===(u=resolveValue(d,t))&&(u=d[t]),!isString$3(u)&&!isFunction$1(u));h++){const n=handleMissing(e,t,c,r,"translate");n!==t&&(u=n)}return[u,c,d]}function compileMessageFormat(e,t,n,i,o,r){const{messageCompiler:s,warnHtmlMessage:a}=e;if(isMessageFunction(i)){const e=i;return e.locale=e.locale||n,e.key=e.key||t,e}const l=s(i,getCompileOptions(e,n,o,i,a,r));return l.locale=n,l.key=t,l.source=i,l}function evaluateMessage(e,t,n){return t(n)}function parseTranslateArgs(...e){const[t,n,i]=e,o={};if(!isString$3(t)&&!isNumber$2(t)&&!isMessageFunction(t))throw createCoreError(14);const r=isNumber$2(t)?String(t):(isMessageFunction(t),t);return isNumber$2(n)?o.plural=n:isString$3(n)?o.default=n:isPlainObject(n)&&!isEmptyObject(n)?o.named=n:isArray$1(n)&&(o.list=n),isNumber$2(i)?o.plural=i:isString$3(i)?o.default=i:isPlainObject(i)&&assign(o,i),[r,o]}function getCompileOptions(e,t,n,i,o,r){return{warnHtmlMessage:o,onError:e=>{throw r&&r(e),e},onCacheKey:e=>generateFormatCacheKey(t,n,e)}}function getMessageContextOptions(e,t,n,i){const{modifiers:o,pluralRules:r}=e,s={locale:t,modifiers:o,pluralRules:r,messages:i=>{const o=resolveValue(n,i);if(isString$3(o)){let n=!1;const r=compileMessageFormat(e,i,t,o,i,(()=>{n=!0}));return n?NOOP_MESSAGE_FUNCTION:r}return isMessageFunction(o)?o:NOOP_MESSAGE_FUNCTION}};return e.processor&&(s.processor=e.processor),i.list&&(s.list=i.list),i.named&&(s.named=i.named),isNumber$2(i.plural)&&(s.pluralIndex=i.plural),s}function datetime(e,...t){const{datetimeFormats:n,unresolving:i,fallbackLocale:o,onWarn:r}=e,{__datetimeFormatters:s}=e,[a,l,c,d]=parseDateTimeArgs(...t),u=isBoolean$1(c.missingWarn)?c.missingWarn:e.missingWarn;isBoolean$1(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn;const h=!!c.part,g=isString$3(c.locale)?c.locale:e.locale,p=getLocaleChain(e,o,g);if(!isString$3(a)||""===a)return new Intl.DateTimeFormat(g).format(l);let f,m={},v=null;for(let b=0;b<p.length&&(f=p[b],m=n[f]||{},v=m[a],!isPlainObject(v));b++)handleMissing(e,a,f,u,"datetime format");if(!isPlainObject(v)||!isString$3(f))return i?NOT_REOSLVED:a;let _=`${f}__${a}`;isEmptyObject(d)||(_=`${_}__${JSON.stringify(d)}`);let C=s.get(_);return C||(C=new Intl.DateTimeFormat(f,assign({},v,d)),s.set(_,C)),h?C.formatToParts(l):C.format(l)}function parseDateTimeArgs(...e){const[t,n,i,o]=e;let r,s={},a={};if(isString$3(t)){if(!/\d{4}-\d{2}-\d{2}(T.*)?/.test(t))throw createCoreError(16);r=new Date(t);try{r.toISOString()}catch(e2){throw createCoreError(16)}}else if(isDate(t)){if(isNaN(t.getTime()))throw createCoreError(15);r=t}else{if(!isNumber$2(t))throw createCoreError(14);r=t}return isString$3(n)?s.key=n:isPlainObject(n)&&(s=n),isString$3(i)?s.locale=i:isPlainObject(i)&&(a=i),isPlainObject(o)&&(a=o),[s.key||"",r,s,a]}function clearDateTimeFormat(e,t,n){const i=e;for(const o in n){const e=`${t}__${o}`;i.__datetimeFormatters.has(e)&&i.__datetimeFormatters.delete(e)}}function number(e,...t){const{numberFormats:n,unresolving:i,fallbackLocale:o,onWarn:r}=e,{__numberFormatters:s}=e,[a,l,c,d]=parseNumberArgs(...t),u=isBoolean$1(c.missingWarn)?c.missingWarn:e.missingWarn;isBoolean$1(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn;const h=!!c.part,g=isString$3(c.locale)?c.locale:e.locale,p=getLocaleChain(e,o,g);if(!isString$3(a)||""===a)return new Intl.NumberFormat(g).format(l);let f,m={},v=null;for(let b=0;b<p.length&&(f=p[b],m=n[f]||{},v=m[a],!isPlainObject(v));b++)handleMissing(e,a,f,u,"number format");if(!isPlainObject(v)||!isString$3(f))return i?NOT_REOSLVED:a;let _=`${f}__${a}`;isEmptyObject(d)||(_=`${_}__${JSON.stringify(d)}`);let C=s.get(_);return C||(C=new Intl.NumberFormat(f,assign({},v,d)),s.set(_,C)),h?C.formatToParts(l):C.format(l)}function parseNumberArgs(...e){const[t,n,i,o]=e;let r={},s={};if(!isNumber$2(t))throw createCoreError(14);const a=t;return isString$3(n)?r.key=n:isPlainObject(n)&&(r=n),isString$3(i)?r.locale=i:isPlainObject(i)&&(s=i),isPlainObject(o)&&(s=o),[r.key||"",a,r,s]}function clearNumberFormat(e,t,n){const i=e;for(const o in n){const e=`${t}__${o}`;i.__numberFormatters.has(e)&&i.__numberFormatters.delete(e)}}"boolean"!=typeof __INTLIFY_PROD_DEVTOOLS__&&(getGlobalThis().__INTLIFY_PROD_DEVTOOLS__=!1);var coreBase_esmBundler=Object.freeze(Object.defineProperty({__proto__:null,MISSING_RESOLVE_VALUE:MISSING_RESOLVE_VALUE,NOT_REOSLVED:NOT_REOSLVED,VERSION:VERSION$1,clearCompileCache:clearCompileCache,clearDateTimeFormat:clearDateTimeFormat,clearNumberFormat:clearNumberFormat,compileToFunction:compileToFunction,createCoreContext:createCoreContext,createCoreError:createCoreError,datetime:datetime,getAdditionalMeta:getAdditionalMeta,getDevToolsHook:getDevToolsHook,getLocaleChain:getLocaleChain,getWarnMessage:getWarnMessage$1,handleMissing:handleMissing,initI18nDevTools:initI18nDevTools,isMessageFunction:isMessageFunction,isTranslateFallbackWarn:isTranslateFallbackWarn,isTranslateMissingWarn:isTranslateMissingWarn,number:number,parseDateTimeArgs:parseDateTimeArgs,parseNumberArgs:parseNumberArgs,parseTranslateArgs:parseTranslateArgs,registerMessageCompiler:registerMessageCompiler,setAdditionalMeta:setAdditionalMeta,setDevToolsHook:setDevToolsHook,translate:translate,translateDevTools:translateDevTools,updateFallbackLocale:updateFallbackLocale,createCompileError:createCompileError,handleFlatJson:handleFlatJson,parse:parse$2,resolveValue:resolveValue,DEFAULT_MESSAGE_DATA_TYPE:DEFAULT_MESSAGE_DATA_TYPE,createMessageContext:createMessageContext},Symbol.toStringTag,{value:"Module"})),require$$1=getAugmentedNamespace(coreBase_esmBundler),require$$2=getAugmentedNamespace(vue_runtime_esmBundler);
- /*!
- * vue-i18n v9.1.10
- * (c) 2022 kazuya kawaguchi
- * Released under the MIT License.
- */
- Object.defineProperty(vueI18n_cjs,"__esModule",{value:!0});var shared=require$$0,coreBase=require$$1,vue=require$$2;const VERSION="9.1.10",warnMessages={6:"Fall back to {type} '{key}' with root locale.",7:"Not supported 'preserve'.",8:"Not supported 'formatter'.",9:"Not supported 'preserveDirectiveContent'.",10:"Not supported 'getChoiceIndex'.",11:"Component name legacy compatible: '{name}' -> 'i18n'",12:"Not found parent scope. use the global scope."};function getWarnMessage(e,...t){return shared.format(warnMessages[e],...t)}function createI18nError(e,...t){return coreBase.createCompileError(e,null,{messages:errorMessages,args:t})}const errorMessages={14:"Unexpected return type in composer",15:"Invalid argument",16:"Must be called at the top of a `setup` function",17:"Need to install with `app.use` function",22:"Unexpected error",18:"Not available in legacy mode",19:"Required in value: {0}",20:"Invalid value",21:"Cannot setup vue-devtools plugin"},DEVTOOLS_META="__INTLIFY_META__",TransrateVNodeSymbol=shared.makeSymbol("__transrateVNode"),DatetimePartsSymbol=shared.makeSymbol("__datetimeParts"),NumberPartsSymbol=shared.makeSymbol("__numberParts"),EnableEmitter=shared.makeSymbol("__enableEmitter"),DisableEmitter=shared.makeSymbol("__disableEmitter"),SetPluralRulesSymbol=shared.makeSymbol("__setPluralRules");shared.makeSymbol("__intlifyMeta");const InejctWithOption=shared.makeSymbol("__injectWithOption");let composerID=0;function defineCoreMissingHandler(e){return(t,n,i,o)=>e(n,i,vue.getCurrentInstance()||void 0,o)}function getLocaleMessages(e,t){const{messages:n,__i18n:i}=t,o=shared.isPlainObject(n)?n:shared.isArray(i)?{}:{[e]:{}};if(shared.isArray(i)&&i.forEach((({locale:e,resource:t})=>{e?(o[e]=o[e]||{},deepCopy(t,o[e])):deepCopy(t,o)})),t.flatJson)for(const r in o)shared.hasOwn(o,r)&&coreBase.handleFlatJson(o[r]);return o}const isNotObjectOrIsArray=e=>!shared.isObject(e)||shared.isArray(e);function deepCopy(e,t){if(isNotObjectOrIsArray(e)||isNotObjectOrIsArray(t))throw createI18nError(20);for(const n in e)shared.hasOwn(e,n)&&(isNotObjectOrIsArray(e[n])||isNotObjectOrIsArray(t[n])?t[n]=e[n]:deepCopy(e[n],t[n]))}const getMetaInfo=()=>{const e=vue.getCurrentInstance();return e&&e.type[DEVTOOLS_META]?{[DEVTOOLS_META]:e.type[DEVTOOLS_META]}:null};function createComposer(e={}){const{__root:t}=e,n=void 0===t;let i=!shared.isBoolean(e.inheritLocale)||e.inheritLocale;const o=vue.ref(t&&i?t.locale.value:shared.isString(e.locale)?e.locale:"en-US"),r=vue.ref(t&&i?t.fallbackLocale.value:shared.isString(e.fallbackLocale)||shared.isArray(e.fallbackLocale)||shared.isPlainObject(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:o.value),s=vue.ref(getLocaleMessages(o.value,e)),a=vue.ref(shared.isPlainObject(e.datetimeFormats)?e.datetimeFormats:{[o.value]:{}}),l=vue.ref(shared.isPlainObject(e.numberFormats)?e.numberFormats:{[o.value]:{}});let c=t?t.missingWarn:!shared.isBoolean(e.missingWarn)&&!shared.isRegExp(e.missingWarn)||e.missingWarn,d=t?t.fallbackWarn:!shared.isBoolean(e.fallbackWarn)&&!shared.isRegExp(e.fallbackWarn)||e.fallbackWarn,u=t?t.fallbackRoot:!shared.isBoolean(e.fallbackRoot)||e.fallbackRoot,h=!!e.fallbackFormat,g=shared.isFunction(e.missing)?e.missing:null,p=shared.isFunction(e.missing)?defineCoreMissingHandler(e.missing):null,f=shared.isFunction(e.postTranslation)?e.postTranslation:null,m=!shared.isBoolean(e.warnHtmlMessage)||e.warnHtmlMessage,v=!!e.escapeParameter;const _=t?t.modifiers:shared.isPlainObject(e.modifiers)?e.modifiers:{};let C,b=e.pluralRules||t&&t.pluralRules;C=coreBase.createCoreContext({version:VERSION,locale:o.value,fallbackLocale:r.value,messages:s.value,datetimeFormats:a.value,numberFormats:l.value,modifiers:_,pluralRules:b,missing:null===p?void 0:p,missingWarn:c,fallbackWarn:d,fallbackFormat:h,unresolving:!0,postTranslation:null===f?void 0:f,warnHtmlMessage:m,escapeParameter:v,__datetimeFormatters:shared.isPlainObject(C)?C.__datetimeFormatters:void 0,__numberFormatters:shared.isPlainObject(C)?C.__numberFormatters:void 0,__v_emitter:shared.isPlainObject(C)?C.__v_emitter:void 0,__meta:{framework:"vue"}}),coreBase.updateFallbackLocale(C,o.value,r.value);const y=vue.computed({get:()=>o.value,set:e=>{o.value=e,C.locale=o.value}}),S=vue.computed({get:()=>r.value,set:e=>{r.value=e,C.fallbackLocale=r.value,coreBase.updateFallbackLocale(C,o.value,e)}}),w=vue.computed((()=>s.value)),E=vue.computed((()=>a.value)),x=vue.computed((()=>l.value));function T(e,n,i,h,g,p){let f;o.value,r.value,s.value,a.value,l.value;try{coreBase.setAdditionalMeta(getMetaInfo()),f=e(C)}finally{coreBase.setAdditionalMeta(null)}if(shared.isNumber(f)&&f===coreBase.NOT_REOSLVED){const[e,o]=n();if(t&&shared.isString(e)&&(m=o,"translate"!==i||0==!!m.resolvedMessage)){u&&(coreBase.isTranslateFallbackWarn(d,e)||coreBase.isTranslateMissingWarn(c,e))&&shared.warn(getWarnMessage(6,{key:e,type:i}));{const{__v_emitter:t}=C;t&&u&&t.emit("fallback",{type:i,key:e,to:"global",groupId:`${i}:${e}`})}}return t&&u?h(t):g(e)}if(p(f))return f;throw createI18nError(14);var m}function I(...e){return T((t=>coreBase.translate(t,...e)),(()=>coreBase.parseTranslateArgs(...e)),"translate",(t=>t.t(...e)),(e=>e),(e=>shared.isString(e)))}const k={normalize:function(e){return e.map((e=>shared.isString(e)?vue.createVNode(vue.Text,null,e,0):e))},interpolate:e=>e,type:"vnode"};function L(e){return s.value[e]||{}}composerID++,t&&(vue.watch(t.locale,(e=>{i&&(o.value=e,C.locale=e,coreBase.updateFallbackLocale(C,o.value,r.value))})),vue.watch(t.fallbackLocale,(e=>{i&&(r.value=e,C.fallbackLocale=e,coreBase.updateFallbackLocale(C,o.value,r.value))})));const D={id:composerID,locale:y,fallbackLocale:S,get inheritLocale(){return i},set inheritLocale(e){i=e,e&&t&&(o.value=t.locale.value,r.value=t.fallbackLocale.value,coreBase.updateFallbackLocale(C,o.value,r.value))},get availableLocales(){return Object.keys(s.value).sort()},messages:w,datetimeFormats:E,numberFormats:x,get modifiers(){return _},get pluralRules(){return b||{}},get isGlobal(){return n},get missingWarn(){return c},set missingWarn(e){c=e,C.missingWarn=c},get fallbackWarn(){return d},set fallbackWarn(e){d=e,C.fallbackWarn=d},get fallbackRoot(){return u},set fallbackRoot(e){u=e},get fallbackFormat(){return h},set fallbackFormat(e){h=e,C.fallbackFormat=h},get warnHtmlMessage(){return m},set warnHtmlMessage(e){m=e,C.warnHtmlMessage=e},get escapeParameter(){return v},set escapeParameter(e){v=e,C.escapeParameter=e},t:I,rt:function(...e){const[t,n,i]=e;if(i&&!shared.isObject(i))throw createI18nError(15);return I(t,n,shared.assign({resolvedMessage:!0},i||{}))},d:function(...e){return T((t=>coreBase.datetime(t,...e)),(()=>coreBase.parseDateTimeArgs(...e)),"datetime format",(t=>t.d(...e)),(()=>coreBase.MISSING_RESOLVE_VALUE),(e=>shared.isString(e)))},n:function(...e){return T((t=>coreBase.number(t,...e)),(()=>coreBase.parseNumberArgs(...e)),"number format",(t=>t.n(...e)),(()=>coreBase.MISSING_RESOLVE_VALUE),(e=>shared.isString(e)))},te:function(e,t){const n=L(shared.isString(t)?t:o.value);return null!==coreBase.resolveValue(n,e)},tm:function(e){const n=function(e){let t=null;const n=coreBase.getLocaleChain(C,r.value,o.value);for(let i=0;i<n.length;i++){const o=s.value[n[i]]||{},r=coreBase.resolveValue(o,e);if(null!=r){t=r;break}}return t}(e);return null!=n?n:t&&t.tm(e)||{}},getLocaleMessage:L,setLocaleMessage:function(e,t){s.value[e]=t,C.messages=s.value},mergeLocaleMessage:function(e,t){s.value[e]=s.value[e]||{},deepCopy(t,s.value[e]),C.messages=s.value},getDateTimeFormat:function(e){return a.value[e]||{}},setDateTimeFormat:function(e,t){a.value[e]=t,C.datetimeFormats=a.value,coreBase.clearDateTimeFormat(C,e,t)},mergeDateTimeFormat:function(e,t){a.value[e]=shared.assign(a.value[e]||{},t),C.datetimeFormats=a.value,coreBase.clearDateTimeFormat(C,e,t)},getNumberFormat:function(e){return l.value[e]||{}},setNumberFormat:function(e,t){l.value[e]=t,C.numberFormats=l.value,coreBase.clearNumberFormat(C,e,t)},mergeNumberFormat:function(e,t){l.value[e]=shared.assign(l.value[e]||{},t),C.numberFormats=l.value,coreBase.clearNumberFormat(C,e,t)},getPostTranslationHandler:function(){return shared.isFunction(f)?f:null},setPostTranslationHandler:function(e){f=e,C.postTranslation=e},getMissingHandler:function(){return g},setMissingHandler:function(e){null!==e&&(p=defineCoreMissingHandler(e)),g=e,C.missing=p},[TransrateVNodeSymbol]:function(...e){return T((t=>{let n;const i=t;try{i.processor=k,n=coreBase.translate(i,...e)}finally{i.processor=null}return n}),(()=>coreBase.parseTranslateArgs(...e)),"translate",(t=>t[TransrateVNodeSymbol](...e)),(e=>[vue.createVNode(vue.Text,null,e,0)]),(e=>shared.isArray(e)))},[NumberPartsSymbol]:function(...e){return T((t=>coreBase.number(t,...e)),(()=>coreBase.parseNumberArgs(...e)),"number format",(t=>t[NumberPartsSymbol](...e)),(()=>[]),(e=>shared.isString(e)||shared.isArray(e)))},[DatetimePartsSymbol]:function(...e){return T((t=>coreBase.datetime(t,...e)),(()=>coreBase.parseDateTimeArgs(...e)),"datetime format",(t=>t[DatetimePartsSymbol](...e)),(()=>[]),(e=>shared.isString(e)||shared.isArray(e)))},[SetPluralRulesSymbol]:function(e){b=e,C.pluralRules=b},[InejctWithOption]:e.__injectWithOption};return D[EnableEmitter]=e=>{C.__v_emitter=e},D[DisableEmitter]=()=>{C.__v_emitter=void 0},D}function convertComposerOptions(e){const t=shared.isString(e.locale)?e.locale:"en-US",n=shared.isString(e.fallbackLocale)||shared.isArray(e.fallbackLocale)||shared.isPlainObject(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:t,i=shared.isFunction(e.missing)?e.missing:void 0,o=!shared.isBoolean(e.silentTranslationWarn)&&!shared.isRegExp(e.silentTranslationWarn)||!e.silentTranslationWarn,r=!shared.isBoolean(e.silentFallbackWarn)&&!shared.isRegExp(e.silentFallbackWarn)||!e.silentFallbackWarn,s=!shared.isBoolean(e.fallbackRoot)||e.fallbackRoot,a=!!e.formatFallbackMessages,l=shared.isPlainObject(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,d=shared.isFunction(e.postTranslation)?e.postTranslation:void 0,u=!shared.isString(e.warnHtmlInMessage)||"off"!==e.warnHtmlInMessage,h=!!e.escapeParameterHtml,g=!shared.isBoolean(e.sync)||e.sync;e.formatter&&shared.warn(getWarnMessage(8)),e.preserveDirectiveContent&&shared.warn(getWarnMessage(9));let p=e.messages;if(shared.isPlainObject(e.sharedMessages)){const t=e.sharedMessages;p=Object.keys(t).reduce(((e,n)=>{const i=e[n]||(e[n]={});return shared.assign(i,t[n]),e}),p||{})}const{__i18n:f,__root:m,__injectWithOption:v}=e,_=e.datetimeFormats,C=e.numberFormats;return{locale:t,fallbackLocale:n,messages:p,flatJson:e.flatJson,datetimeFormats:_,numberFormats:C,missing:i,missingWarn:o,fallbackWarn:r,fallbackRoot:s,fallbackFormat:a,modifiers:l,pluralRules:c,postTranslation:d,warnHtmlMessage:u,escapeParameter:h,inheritLocale:g,__i18n:f,__root:m,__injectWithOption:v}}function createVueI18n(e={}){const t=createComposer(convertComposerOptions(e)),n={id:t.id,get locale(){return t.locale.value},set locale(e){t.locale.value=e},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(e){t.fallbackLocale.value=e},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get formatter(){return shared.warn(getWarnMessage(8)),{interpolate:()=>[]}},set formatter(e){shared.warn(getWarnMessage(8))},get missing(){return t.getMissingHandler()},set missing(e){t.setMissingHandler(e)},get silentTranslationWarn(){return shared.isBoolean(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(e){t.missingWarn=shared.isBoolean(e)?!e:e},get silentFallbackWarn(){return shared.isBoolean(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(e){t.fallbackWarn=shared.isBoolean(e)?!e:e},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(e){t.fallbackFormat=e},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(e){t.setPostTranslationHandler(e)},get sync(){return t.inheritLocale},set sync(e){t.inheritLocale=e},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(e){t.warnHtmlMessage="off"!==e},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(e){t.escapeParameter=e},get preserveDirectiveContent(){return shared.warn(getWarnMessage(9)),!0},set preserveDirectiveContent(e){shared.warn(getWarnMessage(9))},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...e){const[n,i,o]=e,r={};let s=null,a=null;if(!shared.isString(n))throw createI18nError(15);const l=n;return shared.isString(i)?r.locale=i:shared.isArray(i)?s=i:shared.isPlainObject(i)&&(a=i),shared.isArray(o)?s=o:shared.isPlainObject(o)&&(a=o),t.t(l,s||a||{},r)},rt:(...e)=>t.rt(...e),tc(...e){const[n,i,o]=e,r={plural:1};let s=null,a=null;if(!shared.isString(n))throw createI18nError(15);const l=n;return shared.isString(i)?r.locale=i:shared.isNumber(i)?r.plural=i:shared.isArray(i)?s=i:shared.isPlainObject(i)&&(a=i),shared.isString(o)?r.locale=o:shared.isArray(o)?s=o:shared.isPlainObject(o)&&(a=o),t.t(l,s||a||{},r)},te:(e,n)=>t.te(e,n),tm:e=>t.tm(e),getLocaleMessage:e=>t.getLocaleMessage(e),setLocaleMessage(e,n){t.setLocaleMessage(e,n)},mergeLocaleMessage(e,n){t.mergeLocaleMessage(e,n)},d:(...e)=>t.d(...e),getDateTimeFormat:e=>t.getDateTimeFormat(e),setDateTimeFormat(e,n){t.setDateTimeFormat(e,n)},mergeDateTimeFormat(e,n){t.mergeDateTimeFormat(e,n)},n:(...e)=>t.n(...e),getNumberFormat:e=>t.getNumberFormat(e),setNumberFormat(e,n){t.setNumberFormat(e,n)},mergeNumberFormat(e,n){t.mergeNumberFormat(e,n)},getChoiceIndex:(e,t)=>(shared.warn(getWarnMessage(10)),-1),__onComponentInstanceCreated(t){const{componentInstanceCreatedListener:i}=e;i&&i(t,n)},__enableEmitter:e=>{const n=t;n[EnableEmitter]&&n[EnableEmitter](e)},__disableEmitter:()=>{const e=t;e[DisableEmitter]&&e[DisableEmitter]()}};return n}const baseFormatProps={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>"parent"===e||"global"===e,default:"parent"},i18n:{type:Object}},Translation={name:"i18n-t",props:shared.assign({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>shared.isNumber(e)||!isNaN(e)}},baseFormatProps),setup(e,t){const{slots:n,attrs:i}=t,o=e.i18n||useI18n$1({useScope:e.scope,__useComponent:!0}),r=Object.keys(n).filter((e=>"_"!==e));return()=>{const n={};e.locale&&(n.locale=e.locale),void 0!==e.plural&&(n.plural=shared.isString(e.plural)?+e.plural:e.plural);const s=getInterpolateArg(t,r),a=o[TransrateVNodeSymbol](e.keypath,s,n),l=shared.assign({},i);return shared.isString(e.tag)||shared.isObject(e.tag)?vue.h(e.tag,l,a):vue.h(vue.Fragment,l,a)}}};function getInterpolateArg({slots:e},t){return 1===t.length&&"default"===t[0]?e.default?e.default():[]:t.reduce(((t,n)=>{const i=e[n];return i&&(t[n]=i()),t}),{})}function renderFormatter(e,t,n,i){const{slots:o,attrs:r}=t;return()=>{const t={part:!0};let s={};e.locale&&(t.locale=e.locale),shared.isString(e.format)?t.key=e.format:shared.isObject(e.format)&&(shared.isString(e.format.key)&&(t.key=e.format.key),s=Object.keys(e.format).reduce(((t,i)=>n.includes(i)?shared.assign({},t,{[i]:e.format[i]}):t),{}));const a=i(e.value,t,s);let l=[t.key];shared.isArray(a)?l=a.map(((e,t)=>{const n=o[e.type];return n?n({[e.type]:e.value,index:t,parts:a}):[e.value]})):shared.isString(a)&&(l=[a]);const c=shared.assign({},r);return shared.isString(e.tag)||shared.isObject(e.tag)?vue.h(e.tag,c,l):vue.h(vue.Fragment,c,l)}}const NUMBER_FORMAT_KEYS=["localeMatcher","style","unit","unitDisplay","currency","currencyDisplay","useGrouping","numberingSystem","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","notation","formatMatcher"],NumberFormat={name:"i18n-n",props:shared.assign({value:{type:Number,required:!0},format:{type:[String,Object]}},baseFormatProps),setup(e,t){const n=e.i18n||useI18n$1({useScope:"parent",__useComponent:!0});return renderFormatter(e,t,NUMBER_FORMAT_KEYS,((...e)=>n[NumberPartsSymbol](...e)))}},DATETIME_FORMAT_KEYS=["dateStyle","timeStyle","fractionalSecondDigits","calendar","dayPeriod","numberingSystem","localeMatcher","timeZone","hour12","hourCycle","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"],DatetimeFormat={name:"i18n-d",props:shared.assign({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},baseFormatProps),setup(e,t){const n=e.i18n||useI18n$1({useScope:"parent",__useComponent:!0});return renderFormatter(e,t,DATETIME_FORMAT_KEYS,((...e)=>n[DatetimePartsSymbol](...e)))}};function getComposer$1(e,t){const n=e;if("composition"===e.mode)return n.__getInstance(t)||e.global;{const i=n.__getInstance(t);return null!=i?i.__composer:e.global.__composer}}function vTDirective(e){const t=(t,{instance:n,value:i,modifiers:o})=>{if(!n||!n.$)throw createI18nError(22);const r=getComposer$1(e,n.$);o.preserve&&shared.warn(getWarnMessage(7));const s=parseValue(i);t.textContent=r.t(...makeParams(s))};return{beforeMount:t,beforeUpdate:t}}function parseValue(e){if(shared.isString(e))return{path:e};if(shared.isPlainObject(e)){if(!("path"in e))throw createI18nError(19,"path");return e}throw createI18nError(20)}function makeParams(e){const{path:t,locale:n,args:i,choice:o,plural:r}=e,s={},a=i||{};return shared.isString(n)&&(s.locale=n),shared.isNumber(o)&&(s.plural=o),shared.isNumber(r)&&(s.plural=r),[t,a,s]}function apply$1(e,t,...n){const i=shared.isPlainObject(n[0])?n[0]:{},o=!!i.useI18nComponentName,r=!shared.isBoolean(i.globalInstall)||i.globalInstall;r&&o&&shared.warn(getWarnMessage(11,{name:Translation.name})),r&&(e.component(o?"i18n":Translation.name,Translation),e.component(NumberFormat.name,NumberFormat),e.component(DatetimeFormat.name,DatetimeFormat)),e.directive("t",vTDirective(t))}function defineMixin(e,t,n){return{beforeCreate(){const i=vue.getCurrentInstance();if(!i)throw createI18nError(22);const o=this.$options;if(o.i18n){const n=o.i18n;o.__i18n&&(n.__i18n=o.__i18n),n.__root=t,this===this.$root?this.$i18n=mergeToRoot(e,n):(n.__injectWithOption=!0,this.$i18n=createVueI18n(n))}else o.__i18n?this===this.$root?this.$i18n=mergeToRoot(e,o):this.$i18n=createVueI18n({__i18n:o.__i18n,__injectWithOption:!0,__root:t}):this.$i18n=e;e.__onComponentInstanceCreated(this.$i18n),n.__setInstance(i,this.$i18n),this.$t=(...e)=>this.$i18n.t(...e),this.$rt=(...e)=>this.$i18n.rt(...e),this.$tc=(...e)=>this.$i18n.tc(...e),this.$te=(e,t)=>this.$i18n.te(e,t),this.$d=(...e)=>this.$i18n.d(...e),this.$n=(...e)=>this.$i18n.n(...e),this.$tm=e=>this.$i18n.tm(e)},mounted(){},beforeUnmount(){const e=vue.getCurrentInstance();if(!e)throw createI18nError(22);delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,n.__deleteInstance(e),delete this.$i18n}}}function mergeToRoot(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[SetPluralRulesSymbol](t.pluralizationRules||e.pluralizationRules);const n=getLocaleMessages(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach((t=>e.mergeLocaleMessage(t,n[t]))),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach((n=>e.mergeDateTimeFormat(n,t.datetimeFormats[n]))),t.numberFormats&&Object.keys(t.numberFormats).forEach((n=>e.mergeNumberFormat(n,t.numberFormats[n]))),e}function createI18n(e={}){const t=!shared.isBoolean(e.legacy)||e.legacy,n=!!e.globalInjection,i=new Map,o=t?createVueI18n(e):createComposer(e),r=shared.makeSymbol("vue-i18n"),s={get mode(){return t?"legacy":"composition"},install(e,...i){return __async(this,null,(function*(){e.__VUE_I18N_SYMBOL__=r,e.provide(e.__VUE_I18N_SYMBOL__,s),!t&&n&&injectGlobalFields(e,s.global),apply$1(e,s,...i),t&&e.mixin(defineMixin(o,o.__composer,s))}))},get global(){return o},__instances:i,__getInstance:e=>i.get(e)||null,__setInstance(e,t){i.set(e,t)},__deleteInstance(e){i.delete(e)}};return s}function useI18n$1(e={}){const t=vue.getCurrentInstance();if(null==t)throw createI18nError(16);if(!t.appContext.app.__VUE_I18N_SYMBOL__)throw createI18nError(17);const n=vue.inject(t.appContext.app.__VUE_I18N_SYMBOL__);if(!n)throw createI18nError(22);const i="composition"===n.mode?n.global:n.global.__composer,o=shared.isEmptyObject(e)?"__i18n"in t.type?"local":"global":e.useScope?e.useScope:"local";if("global"===o){let n=shared.isObject(e.messages)?e.messages:{};"__i18nGlobal"in t.type&&(n=getLocaleMessages(i.locale.value,{messages:n,__i18n:t.type.__i18nGlobal}));const o=Object.keys(n);if(o.length&&o.forEach((e=>{i.mergeLocaleMessage(e,n[e])})),shared.isObject(e.datetimeFormats)){const t=Object.keys(e.datetimeFormats);t.length&&t.forEach((t=>{i.mergeDateTimeFormat(t,e.datetimeFormats[t])}))}if(shared.isObject(e.numberFormats)){const t=Object.keys(e.numberFormats);t.length&&t.forEach((t=>{i.mergeNumberFormat(t,e.numberFormats[t])}))}return i}if("parent"===o){let o=getComposer(n,t,e.__useComponent);return null==o&&(shared.warn(getWarnMessage(12)),o=i),o}if("legacy"===n.mode)throw createI18nError(18);const r=n;let s=r.__getInstance(t);if(null==s){const n=t.type,o=shared.assign({},e);n.__i18n&&(o.__i18n=n.__i18n),i&&(o.__root=i),s=createComposer(o),setupLifeCycle(r,t),r.__setInstance(t,s)}return s}function getComposer(e,t,n=!1){let i=null;const o=t.root;let r=t.parent;for(;null!=r;){const t=e;if("composition"===e.mode)i=t.__getInstance(r);else{const e=t.__getInstance(r);null!=e&&(i=e.__composer),n&&i&&!i[InejctWithOption]&&(i=null)}if(null!=i)break;if(o===r)break;r=r.parent}return i}function setupLifeCycle(e,t,n){vue.onMounted((()=>{}),t),vue.onUnmounted((()=>{e.__deleteInstance(t)}),t)}const globalExportProps=["locale","fallbackLocale","availableLocales"],globalExportMethods=["t","rt","d","n","tm"];function injectGlobalFields(e,t){const n=Object.create(null);globalExportProps.forEach((e=>{const i=Object.getOwnPropertyDescriptor(t,e);if(!i)throw createI18nError(22);const o=vue.isRef(i.value)?{get:()=>i.value.value,set(e){i.value.value=e}}:{get:()=>i.get&&i.get()};Object.defineProperty(n,e,o)})),e.config.globalProperties.$i18n=n,globalExportMethods.forEach((n=>{const i=Object.getOwnPropertyDescriptor(t,n);if(!i||!i.value)throw createI18nError(22);Object.defineProperty(e.config.globalProperties,`$${n}`,i)}))}coreBase.registerMessageCompiler(coreBase.compileToFunction);{const e=shared.getGlobalThis();e.__INTLIFY__=!0,coreBase.setDevToolsHook(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}vueI18n_cjs.DatetimeFormat=DatetimeFormat,vueI18n_cjs.NumberFormat=NumberFormat,vueI18n_cjs.Translation=Translation,vueI18n_cjs.VERSION=VERSION;var createI18n_1=vueI18n_cjs.createI18n=createI18n;let i18n;function createI18nOptions(){return __async(this,null,(function*(){const e=apidocFeConfig,t=WebStorage.get(APP_LANG),n=t||"zh-cn";let i={};if(e.LANG&&e.LANG.length){const t=e.LANG.find((e=>e.lang===n));t&&t.messages?i=t.messages:e.LANG[0]&&e.LANG[0].messages&&(i=e.LANG[0].messages)}return{legacy:!1,locale:n,messages:{[n]:i},sync:!0,silentTranslationWarn:!0,missingWarn:!1,silentFallbackWarn:!0}}))}function setupI18n(e){return __async(this,null,(function*(){const t=yield createI18nOptions();i18n=createI18n_1(t),e.use(i18n)}))}function getKey(e,t){return e?t.startsWith(e)?t:`${e}.${t}`:t}function useI18n(e){if(!i18n)return{t:t=>getKey(e,t)};const t=i18n.global,{t:n}=t,i=__objRest(t,["t"]);return __spreadProps(__spreadValues({},i),{t:(t,...i)=>t?n(getKey(e,t),...i):""})}vueI18n_cjs.useI18n=useI18n$1,vueI18n_cjs.vTDirective=vTDirective;var md5$1={exports:{}};
- /**
- * [js-md5]{@link https://github.com/emn178/js-md5}
- *
- * @namespace md5
- * @version 0.7.3
- * @author Chen, Yi-Cyuan [emn178@gmail.com]
- * @copyright Chen, Yi-Cyuan 2014-2017
- * @license MIT
- */(function(module){(function(){var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=commonjsGlobal:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&module.exports,ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t){return new Md5(!0).update(t)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t<OUTPUT_TYPES.length;++t){var n=OUTPUT_TYPES[t];e[n]=createOutputMethod(n)}return e},nodeWrap=function(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function(e){if("string"==typeof e)return crypto.createHash("md5").update(e,"utf8").digest("hex");if(null==e)throw ERROR;return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===Buffer?crypto.createHash("md5").update(new Buffer(e)).digest("hex"):method(e)};return nodeMethod};function Md5(e){if(e)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Md5.prototype.update=function(e){if(!this.finalized){var t,n=typeof e;if("string"!==n){if("object"!==n)throw ERROR;if(null===e)throw ERROR;if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw ERROR;t=!0}for(var i,o,r=0,s=e.length,a=this.blocks,l=this.buffer8;r<s;){if(this.hashed&&(this.hashed=!1,a[0]=a[16],a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),t)if(ARRAY_BUFFER)for(o=this.start;r<s&&o<64;++r)l[o++]=e[r];else for(o=this.start;r<s&&o<64;++r)a[o>>2]|=e[r]<<SHIFT[3&o++];else if(ARRAY_BUFFER)for(o=this.start;r<s&&o<64;++r)(i=e.charCodeAt(r))<128?l[o++]=i:i<2048?(l[o++]=192|i>>6,l[o++]=128|63&i):i<55296||i>=57344?(l[o++]=224|i>>12,l[o++]=128|i>>6&63,l[o++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++r)),l[o++]=240|i>>18,l[o++]=128|i>>12&63,l[o++]=128|i>>6&63,l[o++]=128|63&i);else for(o=this.start;r<s&&o<64;++r)(i=e.charCodeAt(r))<128?a[o>>2]|=i<<SHIFT[3&o++]:i<2048?(a[o>>2]|=(192|i>>6)<<SHIFT[3&o++],a[o>>2]|=(128|63&i)<<SHIFT[3&o++]):i<55296||i>=57344?(a[o>>2]|=(224|i>>12)<<SHIFT[3&o++],a[o>>2]|=(128|i>>6&63)<<SHIFT[3&o++],a[o>>2]|=(128|63&i)<<SHIFT[3&o++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++r)),a[o>>2]|=(240|i>>18)<<SHIFT[3&o++],a[o>>2]|=(128|i>>12&63)<<SHIFT[3&o++],a[o>>2]|=(128|i>>6&63)<<SHIFT[3&o++],a[o>>2]|=(128|63&i)<<SHIFT[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,n,i,o,r,s=this.blocks;this.first?t=((t=((e=((e=s[0]-680876937)<<7|e>>>25)-271733879<<0)^(n=((n=(-271733879^(i=((i=(-1732584194^2004318071&e)+s[1]-117830708)<<12|i>>>20)+e<<0)&(-271733879^e))+s[2]-1126478375)<<17|n>>>15)+i<<0)&(i^e))+s[3]-1316259209)<<22|t>>>10)+n<<0:(e=this.h0,t=this.h1,n=this.h2,t=((t+=((e=((e+=((i=this.h3)^t&(n^i))+s[0]-680876936)<<7|e>>>25)+t<<0)^(n=((n+=(t^(i=((i+=(n^e&(t^n))+s[1]-389564586)<<12|i>>>20)+e<<0)&(e^t))+s[2]+606105819)<<17|n>>>15)+i<<0)&(i^e))+s[3]-1044525330)<<22|t>>>10)+n<<0),t=((t+=((e=((e+=(i^t&(n^i))+s[4]-176418897)<<7|e>>>25)+t<<0)^(n=((n+=(t^(i=((i+=(n^e&(t^n))+s[5]+1200080426)<<12|i>>>20)+e<<0)&(e^t))+s[6]-1473231341)<<17|n>>>15)+i<<0)&(i^e))+s[7]-45705983)<<22|t>>>10)+n<<0,t=((t+=((e=((e+=(i^t&(n^i))+s[8]+1770035416)<<7|e>>>25)+t<<0)^(n=((n+=(t^(i=((i+=(n^e&(t^n))+s[9]-1958414417)<<12|i>>>20)+e<<0)&(e^t))+s[10]-42063)<<17|n>>>15)+i<<0)&(i^e))+s[11]-1990404162)<<22|t>>>10)+n<<0,t=((t+=((e=((e+=(i^t&(n^i))+s[12]+1804603682)<<7|e>>>25)+t<<0)^(n=((n+=(t^(i=((i+=(n^e&(t^n))+s[13]-40341101)<<12|i>>>20)+e<<0)&(e^t))+s[14]-1502002290)<<17|n>>>15)+i<<0)&(i^e))+s[15]+1236535329)<<22|t>>>10)+n<<0,t=((t+=((i=((i+=(t^n&((e=((e+=(n^i&(t^n))+s[1]-165796510)<<5|e>>>27)+t<<0)^t))+s[6]-1069501632)<<9|i>>>23)+e<<0)^e&((n=((n+=(e^t&(i^e))+s[11]+643717713)<<14|n>>>18)+i<<0)^i))+s[0]-373897302)<<20|t>>>12)+n<<0,t=((t+=((i=((i+=(t^n&((e=((e+=(n^i&(t^n))+s[5]-701558691)<<5|e>>>27)+t<<0)^t))+s[10]+38016083)<<9|i>>>23)+e<<0)^e&((n=((n+=(e^t&(i^e))+s[15]-660478335)<<14|n>>>18)+i<<0)^i))+s[4]-405537848)<<20|t>>>12)+n<<0,t=((t+=((i=((i+=(t^n&((e=((e+=(n^i&(t^n))+s[9]+568446438)<<5|e>>>27)+t<<0)^t))+s[14]-1019803690)<<9|i>>>23)+e<<0)^e&((n=((n+=(e^t&(i^e))+s[3]-187363961)<<14|n>>>18)+i<<0)^i))+s[8]+1163531501)<<20|t>>>12)+n<<0,t=((t+=((i=((i+=(t^n&((e=((e+=(n^i&(t^n))+s[13]-1444681467)<<5|e>>>27)+t<<0)^t))+s[2]-51403784)<<9|i>>>23)+e<<0)^e&((n=((n+=(e^t&(i^e))+s[7]+1735328473)<<14|n>>>18)+i<<0)^i))+s[12]-1926607734)<<20|t>>>12)+n<<0,t=((t+=((r=(i=((i+=((o=t^n)^(e=((e+=(o^i)+s[5]-378558)<<4|e>>>28)+t<<0))+s[8]-2022574463)<<11|i>>>21)+e<<0)^e)^(n=((n+=(r^t)+s[11]+1839030562)<<16|n>>>16)+i<<0))+s[14]-35309556)<<23|t>>>9)+n<<0,t=((t+=((r=(i=((i+=((o=t^n)^(e=((e+=(o^i)+s[1]-1530992060)<<4|e>>>28)+t<<0))+s[4]+1272893353)<<11|i>>>21)+e<<0)^e)^(n=((n+=(r^t)+s[7]-155497632)<<16|n>>>16)+i<<0))+s[10]-1094730640)<<23|t>>>9)+n<<0,t=((t+=((r=(i=((i+=((o=t^n)^(e=((e+=(o^i)+s[13]+681279174)<<4|e>>>28)+t<<0))+s[0]-358537222)<<11|i>>>21)+e<<0)^e)^(n=((n+=(r^t)+s[3]-722521979)<<16|n>>>16)+i<<0))+s[6]+76029189)<<23|t>>>9)+n<<0,t=((t+=((r=(i=((i+=((o=t^n)^(e=((e+=(o^i)+s[9]-640364487)<<4|e>>>28)+t<<0))+s[12]-421815835)<<11|i>>>21)+e<<0)^e)^(n=((n+=(r^t)+s[15]+530742520)<<16|n>>>16)+i<<0))+s[2]-995338651)<<23|t>>>9)+n<<0,t=((t+=((i=((i+=(t^((e=((e+=(n^(t|~i))+s[0]-198630844)<<6|e>>>26)+t<<0)|~n))+s[7]+1126891415)<<10|i>>>22)+e<<0)^((n=((n+=(e^(i|~t))+s[14]-1416354905)<<15|n>>>17)+i<<0)|~e))+s[5]-57434055)<<21|t>>>11)+n<<0,t=((t+=((i=((i+=(t^((e=((e+=(n^(t|~i))+s[12]+1700485571)<<6|e>>>26)+t<<0)|~n))+s[3]-1894986606)<<10|i>>>22)+e<<0)^((n=((n+=(e^(i|~t))+s[10]-1051523)<<15|n>>>17)+i<<0)|~e))+s[1]-2054922799)<<21|t>>>11)+n<<0,t=((t+=((i=((i+=(t^((e=((e+=(n^(t|~i))+s[8]+1873313359)<<6|e>>>26)+t<<0)|~n))+s[15]-30611744)<<10|i>>>22)+e<<0)^((n=((n+=(e^(i|~t))+s[6]-1560198380)<<15|n>>>17)+i<<0)|~e))+s[13]+1309151649)<<21|t>>>11)+n<<0,t=((t+=((i=((i+=(t^((e=((e+=(n^(t|~i))+s[4]-145523070)<<6|e>>>26)+t<<0)|~n))+s[11]-1120210379)<<10|i>>>22)+e<<0)^((n=((n+=(e^(i|~t))+s[2]+718787259)<<15|n>>>17)+i<<0)|~e))+s[9]-343485551)<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=i+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+i<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&i,i>>8&255,i>>16&255,i>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,n,i="",o=this.array(),r=0;r<15;)e=o[r++],t=o[r++],n=o[r++],i+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|n>>>6)]+BASE64_ENCODE_CHAR[63&n];return e=o[r],i+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:root.md5=exports})()})(md5$1);var md5=md5$1.exports;const _sfc_main$w=defineComponent({__name:"VerifyAuthModal",props:{onSuccess:{type:Function,default:()=>{}},onCancel:{type:Function,default:()=>{}}},setup(e){const t=e,n=useAppStore(),{t:i}=useI18n(),o=reactive({visible:!1,password:""});onMounted((()=>{o.visible=!0}));const r=()=>{if(!o.password)return void message.error(i("auth.input.placeholder"));const e=md5(o.password);globalApi.verifyAuth({appKey:n.appKey,password:e}).then((e=>{if(0!==e.code||!e.data||!e.data.token)return e.message&&message.error(e.message),!1;const i=e.data.token;n.setAppAuth(n.appKey,i),t.onSuccess&&t.onSuccess(),o.visible=!1})).catch((e=>{let t=e.message;e.response&&e.response.data&&e.response.data.message&&(t=e.response.data.message),message.error(t)}))},s=()=>{t.onCancel&&t.onCancel(),o.visible=!1};return(e,t)=>{const n=__unplugin_components_0$2,a=Button$2,l=Modal$2;return openBlock(),createBlock(l,{visible:o.visible,width:500,maskClosable:!1,title:unref(i)("auth.title"),destroyOnClose:"",onCancel:s},{footer:withCtx((()=>[createVNode(a,{type:"primary",onClick:r},{default:withCtx((()=>[createTextVNode(toDisplayString$1(unref(i)("common.ok")),1)])),_:1})])),default:withCtx((()=>[createBaseVNode("div",null,[createVNode(n,{ref:"inputRef",placeholder:unref(i)("auth.input.placeholder"),size:"large",allowClear:!0,value:o.password,"onUpdate:value":t[0]||(t[0]=e=>o.password=e),onKeydown:withKeys(r,["enter"])},null,8,["placeholder","value","onKeydown"])])])),_:1},8,["visible","title"])}}});function modal$4(e){const t=createApp(_sfc_main$w,__spreadProps(__spreadValues({},e),{onSuccess:t=>{e.onSuccess&&e.onSuccess(t)},onCancel:()=>{e.onCancel&&e.onCancel(),n()}})).use(pinia),n=()=>{t.unmount(),document.body.removeChild(i)},i=document.createElement("div");return document.body.appendChild(i),t.mount(i),t}let isShowVerifyAuth=!1,resolveList=[];const config=apidocFeConfig,authConfig={ERROR_STATUS:config.AUTH&&config.AUTH.ERROR_STATUS||401,ERROR_CODE_FIELD:config.AUTH&&config.AUTH.ERROR_CODE_FIELD||"code"};function handleApidocHttpError(e){return new Promise(((t,n)=>{if(e.response||200==e.status&&e.data){let i=200,o=0;if(e.response?(i=e.response.status,o=e.response.data&&e.response.data[authConfig.ERROR_CODE_FIELD]||0):(i=e.status,o=e.data.code),i===authConfig.ERROR_STATUS||[4001,4002].includes(o))isShowVerifyAuth?resolveList.push({resolve:t,reject:n}):(isShowVerifyAuth=!0,modal$4({onSuccess:e=>{if(isShowVerifyAuth=!1,resolveList.length)for(let t=0;t<resolveList.length;t++){resolveList[t].resolve(e)}resolveList=[],t(e)},onCancel:()=>{isShowVerifyAuth=!1,n()}}));else if(0!=o){useAppOutsideStore().setGlobalError(e)}else t(!1)}}))}const createRandKey=()=>(new Date).getTime()+Math.ceil(1e3*Math.random())+"",handleTableDataRowKey=e=>e.map((e=>(e.key=`${e.name}_${getRandomNumber(999)}`,e.children&&e.children.length&&(e.children=handleTableDataRowKey(e.children)),e))),createIdcardEndNumber=e=>{const t=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let n=0;for(let i=0;i<17;i++)n+=parseInt(e[i],10)*t[i];return[1,0,"X",9,8,7,6,5,4,3,2][n%11]},getRandomNumber=(e,t)=>Math.floor(Math.random()*e+(t||0)),createIdcard=()=>{const e=[11,12,13,14,15,21,22,23,31,32,33,34,35,36,37,41,42,43,44,45,46,50,51,52,53,54,61,62,63,64,65,71,81,82];let t=e[getRandomNumber(e.length)]+"";for(let n=2;n<18;n++)if(n<6)t+=getRandomNumber(10);else if(6==n)t+=getRandomNumber(2,1);else if(7==n)t+="1"==t[6]?9:0;else if(8==n)t+="1"==t[6]?getRandomNumber(7,3):getRandomNumber(2);else if(9==n)t+=getRandomNumber(10);else if(10==n)t+=getRandomNumber(2);else if(11==n)t+="0"==t[10]?getRandomNumber(9,1):getRandomNumber(3);else if(12==n){const e=new Date(Number(t.substr(6,4)),Number(t.substr(10,2)),0).getDate(),i=getRandomNumber(e,1);t+=i<10?"0"+i:i,n++}else n>13&&n<17?t+=getRandomNumber(10):17==n&&(t+=createIdcardEndNumber(t));return t},reloadHomePage=()=>{const e=window.location.href;let t="/apidoc";e.indexOf("#")>-1&&(t=e.split("#")[0]),window.location.href=t},parseRouteKey=e=>{let t=encodeURIComponent(`${e.query.key}`);return e.meta.keepKey?t=e.meta.keepKey+"":"function"==typeof e.meta.keepKey&&(t=e.meta.keepKey(e)),t},copyTextToClipboard=e=>{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="12pt";const n=document.getSelection();let i;n&&n.rangeCount>0&&(i=n.getRangeAt(0)),document.body.append(t),t.select(),t.selectionStart=0,t.selectionEnd=e.length;let o=!1;try{document.execCommand("copy"),o=!0}catch(e2){throw new Error}return t.remove(),i&&n&&(n.removeAllRanges(),n.addRange(i)),o},textToHtml=e=>e?e.replace(/ /g," ").replace(/\r\n/g,"<br>"):"",getObjectValueByKey=(e,t)=>{let n=t;if(e&&e.indexOf(".")>-1){const t=e.split(".");for(let e=0;e<t.length;e++){const i=t[e];i&&"object"==typeof n&&(n=n[i])}}else e&&(n=n[e]);return n},camelToUnderline=e=>e.replace(/[A-Z]/g,(function(e){return" "+e.toLowerCase()})).trim().replaceAll(" ","_"),RegExpEscape=e=>e.replace(/[-\\/\\^$*+?.()|[\]{}]/g,"\\$&"),checkStringRules=(e,t)=>{let n="";if(t&&t.length)for(let i=0;i<t.length;i++){const o=t[i];if(o.required&&!e&&"0"!=e){n=o.message;break}if(o.pattern){if(!new RegExp(o.pattern).test(e)){n=o.message;break}}}return n},replaceAppConfigKeys=(e,t)=>{if(!e||!e.path)return"";let n=t;const i=e.nodes;if(i&&i.length)for(let o=0;o<3;o++){const e=i[o];if(e)for(const t in e){const i=`\${app[${o}].${t}}`;if(n.indexOf(i)>-1){const o=RegExpEscape(i),r=new RegExp(o,"g");n=n.replace(r,e[t])}}else{const e=i[0];for(const t in e){const e=`\\\${app[${o}].${t}}`;if(n.indexOf(e)>-1){const t=RegExpEscape(e),i=new RegExp(t,"g");n=n.replace(i,"")}}}}return n},useApidocStore=defineStore("apidoc",{state:()=>({apiMenus:[],dashboard:{apiCount:0,apiMethodTotal:{},controllerGroupTotal:{},apiGroupTotal:{},apiTagTotal:{},apiAuthorTotal:{},docsCount:0,appCount:0},docsMenus:[],globalParams:{header:[],query:[],body:[]},currentEditorHoverTipsParams:{}}),getters:{},actions:{updateSettings(e){this.$patch(e)},setDashboard(e){this.dashboard=__spreadValues(__spreadValues({},this.dashboard),e)},fetchApiMenus(e){return new Promise(((t,n)=>{globalApi.getApiMenus(e).then((e=>{const{apiMenus:n,dashboard:i}=handleApiData(e.data);this.apiMenus=n,this.dashboard=__spreadValues(__spreadValues({},this.dashboard),i),t(e)})).catch((t=>{const i=useAppOutsideStore();handleApidocHttpError(t).then((n=>{!1===n?i.setGlobalError(t):this.fetchApiMenus(e)})),n(t)}))}))},fetchDocsMenus(e){return new Promise(((t,n)=>{globalApi.getDocMenus(e).then((e=>{const{menus:n,count:i}=handleDocMenusData(e.data);this.docsMenus=n,this.dashboard=__spreadProps(__spreadValues({},this.dashboard),{docsCount:i}),t(e)})).catch((t=>{const i=useAppOutsideStore();handleApidocHttpError(t).then((n=>{!1===n?i.setGlobalError(t):this.fetchDocsMenus(e)})),n(t)}))}))},setGlobalParams(e){this.globalParams=e,WebStorage.set(GLOBALPARAMS,e)},initGlobalParams(e){const t=WebStorage.get(GLOBALPARAMS),n=useAppOutsideStore(),i=i=>{const o={};if(t&&t[i])for(let e=0;e<t[i].length;e++){const n=t[i][e];o[`${n.appKey?n.appKey:""}_${n.name}`]=n}const r=[];if(e.params&&e.params[i]){const t=e.params[i];for(let e=0;e<t.length;e++){const n=t[e];n.id=createRandKey(),n.appKey="all",n.addSource="config",n.require=!0;const i=`${n.appKey}_${n.name}`;o[i]?(n.value=o[i].value,delete o[i]):n.value=n.default,r.push(n)}}if(n.appObject)for(const e in n.appObject){const t=n.appObject[e];if(t.params&&t.params[i]){const n=t.params[i];for(let t=0;t<n.length;t++){const i=n[t];i.id=createRandKey(),i.addSource="config",i.appKey=e,i.require=!0;const s=`${e}_${i.name}`;o[s]?(i.value=o[s].value,delete o[s]):i.value=i.default,r.push(i)}}}if(Object.keys(o).length)for(const e in o){const t=o[e];"config"!=t.addSource&&r.push(t)}return r},o={header:i("header"),query:i("query"),body:i("body")};this.setGlobalParams(o)},setCurrentEditorHoverTipsParams(e){this.currentEditorHoverTipsParams=e}}});function useApidocOutsideStore(){return useApidocStore(pinia)}const pinia=createPinia();var ThemeEnum=(e=>(e.DARK="dark",e.LIGHT="light",e))(ThemeEnum||{}),MonacoEditorThemeEnum=(e=>(e.DARK="vs-dark",e.LIGHT="vs",e))(MonacoEditorThemeEnum||{}),DeviceEnum=(e=>(e.DESKTOP="desktop",e.MOBILE="mobile",e))(DeviceEnum||{});function loadVoLteResourceList(e){return new Promise((t=>{e.reduce(((e,t)=>e.then((()=>loadScript(t)))),Promise.resolve()).then((()=>{t({})})).catch((e=>Promise.reject(e)))}))}function loadScript(e){return new Promise(((t,n)=>{const i=document.createElement("script");i.onload=()=>t({}),i.onerror=()=>n(new Error(`Load script from ${e} failed`)),i.src=e;const o=document.head||document.getElementsByTagName("head")[0];(document.body||o).appendChild(i)}))}function loadStyle(e){const t=document.createElement("link");t.type="text/css",t.rel="stylesheet",t.href=e;const n=document.head||document.getElementsByTagName("head")[0];(document.body||n).appendChild(t)}const browerPreprocessorOptions={outputDir:"",defaultScopeName:"",includeStyleWithColors:[{color:"#ffffff"},{color:["transparent","none"]}],extract:!1,themeLinkTagId:"theme-link-tag",themeLinkTagInjectTo:"head",removeCssScopeName:!1,customThemeCssFileName:null,arbitraryMode:!1,defaultPrimaryColor:"",customThemeOutputPath:"E:/Apidoc/apidoc-ui/node_modules/.pnpm/@zougt+vite-plugin-theme-preprocessor@1.4.5/node_modules/@zougt/vite-plugin-theme-preprocessor/setCustomTheme.js",styleTagId:"custom-theme-tagid",InjectDefaultStyleTagToHtml:!0,hueDiffControls:{low:0,high:0},multipleScopeVars:[{scopeName:"theme-light",path:"E:\\Apidoc\\apidoc-ui\\src\\styles\\theme-light.less"},{scopeName:"theme-dark",path:"E:\\Apidoc\\apidoc-ui\\src\\styles\\theme-dark.less"}]};function getRegstr(e){return`(^${e}\\s+|\\s+${e}\\s+|\\s+${e}$|^${e}$)`}function addClassNameToHtmlTag({scopeName:e,multipleScopeVars:t}){const n=Array.isArray(t)&&t.length?t:browerPreprocessorOptions.multipleScopeVars;let i=document.documentElement.className;new RegExp(getRegstr(e)).test(i)||(n.forEach((t=>{i=i.replace(new RegExp(getRegstr(t.scopeName),"g"),` ${e} `)})),document.documentElement.className=i.replace(/(^\s+|\s+$)/g,""))}function toggleTheme(e){addClassNameToHtmlTag(__spreadValues({scopeName:"theme-default",customLinkHref:e=>e},e))}const handleApps=e=>{const t={appObject:{},count:0};return function e(n,i="",o=[]){if(n&&n.length)for(let r=0;r<n.length;r++){const s=n[r],a=i?i+","+s.key:s.key;let l=[];l=o&&o.length?[...o,s]:[s],s.items&&s.items.length?e(s.items,a,l):s.path&&(s.nodes=l,t.count++,t.appObject[a]=s)}}(e,""),t},useAppStore=defineStore("app",{state:()=>({title:"Apidoc",theme:ThemeEnum.LIGHT,device:"desktop",isOpenSide:!1,sideWidth:350,feConfig:{TITLE:"Apidoc",LANG:[],HTTP:{}},multiTabs:[],appKey:"",serverConfig:{apps:[],cache:{}},appObject:{},lang:"",keepAliveKeys:[],appAuth:{},globalError:{config:{},isAxiosError:!1,toJSON:()=>({}),name:"",message:""},keepPages:[],apidocHost:"http://localhost:6999"}),getters:{},actions:{updateSettings(e){this.$patch(e)},fetchFeConfig(){this.feConfig=apidocFeConfig,this.feConfig.LOAD_SCRIPTS&&this.feConfig.LOAD_SCRIPTS.length&&loadVoLteResourceList(this.feConfig.LOAD_SCRIPTS),loadStyle("./style.css")},initTheme(){const e=WebStorage.get(APP_THEME);e&&this.toggleTheme(e===ThemeEnum.DARK)},toggleTheme(e){this.theme=e?ThemeEnum.DARK:ThemeEnum.LIGHT,WebStorage.set(APP_THEME,this.theme),toggleTheme({scopeName:`theme-${this.theme}`})},setLang(e){e?(this.lang=e,WebStorage.set(APP_LANG,e)):this.lang=WebStorage.get(APP_LANG)},setDevice(e){this.device=e},toggleOpenSide(e){this.isOpenSide=e},setSideWidth(e){this.sideWidth=e},setMultiTabs(e){this.multiTabs=e,this.keepAliveKeys=e.map((e=>parseRouteKey(e)))},fetchSeverConfig(e){return new Promise(((t,n)=>{globalApi$1.getConfig(e).then((n=>{const{appObject:i,count:o}=handleApps(n.data.apps);this.appObject=i;if(useApidocOutsideStore().setDashboard({appCount:o}),document.title=n.data.title,this.serverConfig=n.data,e.appKey){if(i[e.appKey])return this.appKey=e.appKey,void t({appKey:this.appKey,config:this.serverConfig})}n.data.apps.length&&(this.appKey=Object.keys(i)[0]),t({appKey:this.appKey,config:this.serverConfig})})).catch((e=>{n(e)}))}))},setAppKey(e){this.appKey=e},initAppAuth(){const e=WebStorage.get(APP_AUTH);e&&(this.appAuth=e)},setAppAuth(e,t){const n=e||"global";this.appAuth[n]=t,WebStorage.set(APP_AUTH,this.appAuth)},setGlobalError(e){this.globalError=e},setKeepPages(e){this.keepPages=e},addKeepPages(e){this.keepPages.push(e)}}});function useAppOutsideStore(){return useAppStore(pinia)}var index$p="",DarkSwitch_vue_vue_type_style_index_0_scoped_true_lang="";const _sfc_main$v=defineComponent({__name:"DarkSwitch",setup(e){const t=useAppStore(),n=e=>{t.toggleTheme(e)};return(e,i)=>{const o=__unplugin_components_0$1;return openBlock(),createBlock(o,{class:normalizeClass(["dark-switch",unref(t).theme]),checked:"dark"===unref(t).theme,"checked-children":"🌙","un-checked-children":"🌞",onChange:n},null,8,["class","checked"])}}});var DarkSwitch=_export_sfc(_sfc_main$v,[["__scopeId","data-v-28e6539e"]]),_imports_0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAdCAYAAAG8mV4RAAAACXBIWXMAAAsSAAALEgHS3X78AAAG+0lEQVR4nK1XC3CU1RX+7r//ZrPhqQkxdEorxIozLTDYArEOFFqg6pgqGBEjxbRpiDS14vQ1vGpHA6mUqai0Dlh1FCY1ygQyYEeEMYBoTafFElOxKCAPSdgiCU3I7mZ3/9Pv/PtINq8q7Zm5ex//Ped853XvXVtEoPRki3Ps/jwr39ZJ2dsiTxdYZvIWiLtw5jxQdcKRMTkG9ueexJu5I0398rHmmxgL2EkZSXJZlr0jcuQ0sPs7xtgza0V+MBfzgl3Y7u5ovmCwaCh2LJoGEy28WdJkrHrfkawMYFgWQEwmJfPWP0lNlg8LhvlNwzNfNwXF+0Sq90P+fBeMu6G51SzgBrz0LRTovHqmMc7y4mXO32nI8N9gdKYXBwPLML0nXKuqekNkwvSVaRg2fOxs9vvwSHmOdTrNLqWfNznHh2VibMxB2e8CzsSKXOvd1IaSgzLV7zNjYzEcbTqFa0+cM40Vd6Pbio4gGsiJp6aY8Tq/ZZfIxOeNNN5LK26owZohmUBUNwQcOREwyBkBxATNrgRyr3BEpcmkpblWI3LjmGimOG/hpN0e5G5yNyw0jT3NdJpatfuCSjjDDV9EL5KPOiazW9knnkl65EMn5PXAl+EFvDTF9mDe0lHWjt777N4LFX+VHT4vbrOMgc8r8EWBD5oN6JrtT3UCE68Wz9ZvGKdfAQtfF1GNXWTSXFg/MZ4R3wuIb9RwCREFmk6a2LzX8MD2uXgiTcDsOhEfZ6oxGAYybGQ/dFSeizlSMsRn4LGQaIJTAfM4WboFTKmGWFQWofZwVGBbeKtktlzsCJl7/3XRhCNRnGUkGrNHYO22OeYv8tj3X5bHEDQPPuu3x21CGZ2lTgI30mGGIcGN0Ezww8IV6T6Klc7PY1fkTkrni4apUi1V21XA0bJ4Dg1EnmdqWyLTZnVHYaAwrj/tfJ7ROGBZ2MPMLR9IYJ8wKj38gTODjPtVNpEt2djilP4oz+p3b5/FnxyWq8i0XyOiAhw2jj08fFpZ6FcMKqC8QTws3xahGxxyq5DOsMHfPgQudJiRrwxH86uFGD2ggGgMoaBq9OrMEIGMa72Ee7TMs+jgsxeQV7wPt1bPxK4+Au7cKw8zeWxlVrcS+u9/O8k6wWHl3fVS0hWR/C4mVNNJ7HSl9xYQiWG19gnH4ekCU5H85s9AYdiH90IRQThiMP81/LR2LtanBDCNtzL74CTEUXt43SnxB0M41x7CMK1GPfe6IvE6udCBYm7rFhCKmHsyWXlOJI6AZpSxeDrbPO7RQibjriuzpnrbJXNDyoTrt2K21w0Zy9cWd+POW8yWzZ/glyyefFZ1K3PiOK2uGzEEa2saS/PJ185aWM1aeNQOdWGTk0hGxzFQJEpLss2X3EFa0LinLnQ0Mfy1LC9eZ9N541SA6zwiCYpZ1TtZepIEQjF2nsS0UhG4XnezjufMuyVYM7iA4HJ26xLTIjscSaSrNy5xMOYEgud6CMi2WcI1HMwigp8dvx8v/DcB3ob687yV6jm8nu3LA5bzQLTmmDPD48HLzJtc9u4xx0jpGXqe40X3jbJ2fxZ5/ZZ4f7TiiHOdx+BNKr5SXcaUQhKA9lzP4fqrrPoQ1+b+MNd64/8C4IF3JIsC6TIzNXmoa6+Vo77jAQArlpwbnh7I5NqBqk5pGe6Xr1ZcZZ29bAB8M/2K7n1IheuZr9GKMdfV5bYCcdAeDJuOc20YrdmoLdjlVqaO87j34z15qN3xbdzxmQDw9FGrD7GN9yQUs15SlnMtysqd/OhXTFOS57sHZA3zYIXeLxbB6cWsgI63YP6MbfjkQBGyPxWA23fL1bzl3qMb/SosEV94Uh5gMGKYsHmaeb8n35YZZiVBBKh3g3rIaEA4MATRdglXTt+GtjeKMHJQAHPqZAKtPBz1wCSt7ZNwFiqen96t/Bf/kHy6/XaW4yy+s77GcwvJpvmi971FEBcvYcRNO/E2b5SCfgEQ4TjG+RD1GX2seUxahicTrrZwqlRvbEE7r6yh6uIhGfFnTCjhcl5p7ry7SaI3eu3X9+uBqX90v++LxIytSvWhIUSvR7mJpUIQ47dyHnvXjBwaVx6Pd6KZuLW6rpQMX2YG/s0HZ11HUMp3nbkvE5v5XFmyKZgGgEwbKXxMMs5RN+FMQrG41kccrN57m+FfB22DP156klQuHsPuEFtn6sirXKy/C82qF2rs8X/ANZwsTSL2pJWcesAF8s+Dd6Lq0ypNAxAIzWGX08+nF+XHC47ZTKAHky9HTbgI4gBSr0mPPi5w0+UoV7KeeOnZ2MLCRRzO6udzlV5ni3soc3sl94Rj3nBtSlMJPrpcAEr0wtoBANxoU9FuWnhHor5dANE4kF10fdGRUoT/F+VK9ut79vIGPMzhpF6fXvkPvTXxt0NWzOUAAAAASUVORK5CYII=",Logo_vue_vue_type_style_index_0_scoped_true_lang="";const _withScopeId$3=e=>(pushScopeId("data-v-4b61ec3d"),e=e(),popScopeId(),e),_hoisted_1$l={class:"header-logo"},_hoisted_2$f=_withScopeId$3((()=>createBaseVNode("img",{class:"header-logo_img",src:_imports_0},null,-1))),_hoisted_3$c={key:0,class:"header-logo_title"},_sfc_main$u=defineComponent({__name:"Logo",setup(e){const t=useAppStore(),n=computed((()=>t.serverConfig.title?t.serverConfig.title:t.feConfig.TITLE));return(e,i)=>(openBlock(),createElementBlock("a",_hoisted_1$l,[_hoisted_2$f,unref(t).device!=unref(DeviceEnum).MOBILE?(openBlock(),createElementBlock("span",_hoisted_3$c,toDisplayString$1(unref(n)),1)):createCommentVNode("",!0)]))}});var Logo=_export_sfc(_sfc_main$u,[["__scopeId","data-v-4b61ec3d"]]),AppstoreOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"},AppstoreOutlinedSvg=AppstoreOutlined$2;function _objectSpread$9(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$9(e,t,n[t])}))}return e}function _defineProperty$9(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var AppstoreOutlined=function(e,t){var n=_objectSpread$9({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$9({},n,{icon:AppstoreOutlinedSvg}),null)};AppstoreOutlined.displayName="AppstoreOutlined",AppstoreOutlined.inheritAttrs=!1;var AppstoreOutlined$1=AppstoreOutlined,CopyrightCircleOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm5.6-532.7c53 0 89 33.8 93 83.4.3 4.2 3.8 7.4 8 7.4h56.7c2.6 0 4.7-2.1 4.7-4.7 0-86.7-68.4-147.4-162.7-147.4C407.4 290 344 364.2 344 486.8v52.3C344 660.8 407.4 734 517.3 734c94 0 162.7-58.8 162.7-141.4 0-2.6-2.1-4.7-4.7-4.7h-56.8c-4.2 0-7.6 3.2-8 7.3-4.2 46.1-40.1 77.8-93 77.8-65.3 0-102.1-47.9-102.1-133.6v-52.6c.1-87 37-135.5 102.2-135.5z"}}]},name:"copyright-circle",theme:"outlined"},CopyrightCircleOutlinedSvg=CopyrightCircleOutlined$2;function _objectSpread$8(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$8(e,t,n[t])}))}return e}function _defineProperty$8(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var CopyrightCircleOutlined=function(e,t){var n=_objectSpread$8({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$8({},n,{icon:CopyrightCircleOutlinedSvg}),null)};CopyrightCircleOutlined.displayName="CopyrightCircleOutlined",CopyrightCircleOutlined.inheritAttrs=!1;var CopyrightCircleOutlined$1=CopyrightCircleOutlined,FileMarkdownOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM429 481.2c-1.9-4.4-6.2-7.2-11-7.2h-35c-6.6 0-12 5.4-12 12v272c0 6.6 5.4 12 12 12h27.1c6.6 0 12-5.4 12-12V582.1l66.8 150.2a12 12 0 0011 7.1H524c4.7 0 9-2.8 11-7.1l66.8-150.6V758c0 6.6 5.4 12 12 12H641c6.6 0 12-5.4 12-12V486c0-6.6-5.4-12-12-12h-34.7c-4.8 0-9.1 2.8-11 7.2l-83.1 191-83.2-191z"}}]},name:"file-markdown",theme:"outlined"},FileMarkdownOutlinedSvg=FileMarkdownOutlined$2;function _objectSpread$7(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$7(e,t,n[t])}))}return e}function _defineProperty$7(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var FileMarkdownOutlined=function(e,t){var n=_objectSpread$7({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$7({},n,{icon:FileMarkdownOutlinedSvg}),null)};FileMarkdownOutlined.displayName="FileMarkdownOutlined",FileMarkdownOutlined.inheritAttrs=!1;var FileMarkdownOutlined$1=FileMarkdownOutlined,FullscreenOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M290 236.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0013.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 000 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 00-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"}}]},name:"fullscreen",theme:"outlined"},FullscreenOutlinedSvg=FullscreenOutlined$2;function _objectSpread$6(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$6(e,t,n[t])}))}return e}function _defineProperty$6(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var FullscreenOutlined=function(e,t){var n=_objectSpread$6({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$6({},n,{icon:FullscreenOutlinedSvg}),null)};FullscreenOutlined.displayName="FullscreenOutlined",FullscreenOutlined.inheritAttrs=!1;var FullscreenOutlined$1=FullscreenOutlined,GlobalOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"},GlobalOutlinedSvg=GlobalOutlined$2;function _objectSpread$5(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$5(e,t,n[t])}))}return e}function _defineProperty$5(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var GlobalOutlined=function(e,t){var n=_objectSpread$5({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$5({},n,{icon:GlobalOutlinedSvg}),null)};GlobalOutlined.displayName="GlobalOutlined",GlobalOutlined.inheritAttrs=!1;var GlobalOutlined$1=GlobalOutlined,LockOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 10-56 0z"}}]},name:"lock",theme:"outlined"},LockOutlinedSvg=LockOutlined$2;function _objectSpread$4(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$4(e,t,n[t])}))}return e}function _defineProperty$4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var LockOutlined=function(e,t){var n=_objectSpread$4({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$4({},n,{icon:LockOutlinedSvg}),null)};LockOutlined.displayName="LockOutlined",LockOutlined.inheritAttrs=!1;var LockOutlined$1=LockOutlined,MenuOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 160H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0 624H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0-312H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"}}]},name:"menu",theme:"outlined"},MenuOutlinedSvg=MenuOutlined$2;function _objectSpread$3(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$3(e,t,n[t])}))}return e}function _defineProperty$3(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var MenuOutlined=function(e,t){var n=_objectSpread$3({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$3({},n,{icon:MenuOutlinedSvg}),null)};MenuOutlined.displayName="MenuOutlined",MenuOutlined.inheritAttrs=!1;var MenuOutlined$1=MenuOutlined,RedoOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"}}]},name:"redo",theme:"outlined"},RedoOutlinedSvg=RedoOutlined$2;function _objectSpread$2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$2(e,t,n[t])}))}return e}function _defineProperty$2(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var RedoOutlined=function(e,t){var n=_objectSpread$2({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$2({},n,{icon:RedoOutlinedSvg}),null)};RedoOutlined.displayName="RedoOutlined",RedoOutlined.inheritAttrs=!1;var RedoOutlined$1=RedoOutlined,TagsOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M483.2 790.3L861.4 412c1.7-1.7 2.5-4 2.3-6.3l-25.5-301.4c-.7-7.8-6.8-13.9-14.6-14.6L522.2 64.3c-2.3-.2-4.7.6-6.3 2.3L137.7 444.8a8.03 8.03 0 000 11.3l334.2 334.2c3.1 3.2 8.2 3.2 11.3 0zm62.6-651.7l224.6 19 19 224.6L477.5 694 233.9 450.5l311.9-311.9zm60.16 186.23a48 48 0 1067.88-67.89 48 48 0 10-67.88 67.89zM889.7 539.8l-39.6-39.5a8.03 8.03 0 00-11.3 0l-362 361.3-237.6-237a8.03 8.03 0 00-11.3 0l-39.6 39.5a8.03 8.03 0 000 11.3l243.2 242.8 39.6 39.5c3.1 3.1 8.2 3.1 11.3 0l407.3-406.6c3.1-3.1 3.1-8.2 0-11.3z"}}]},name:"tags",theme:"outlined"},TagsOutlinedSvg=TagsOutlined$2;function _objectSpread$1(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty$1(e,t,n[t])}))}return e}function _defineProperty$1(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var TagsOutlined=function(e,t){var n=_objectSpread$1({},e,t.attrs);return createVNode(AntdIcon,_objectSpread$1({},n,{icon:TagsOutlinedSvg}),null)};TagsOutlined.displayName="TagsOutlined",TagsOutlined.inheritAttrs=!1;var TagsOutlined$1=TagsOutlined,WarningOutlined$2={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"},WarningOutlinedSvg=WarningOutlined$2;function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){_defineProperty(e,t,n[t])}))}return e}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var WarningOutlined=function(e,t){var n=_objectSpread({},e,t.attrs);return createVNode(AntdIcon,_objectSpread({},n,{icon:WarningOutlinedSvg}),null)};WarningOutlined.displayName="WarningOutlined",WarningOutlined.inheritAttrs=!1;var WarningOutlined$1=WarningOutlined,index$o="",index$n="",index$m="",index$l="",index$k="",index$j="",index$i="",index$h="",index$g="",index$f="",index$e="",index$d="",index$c="",index$b="",index$a="",index$9="",AppSelect_vue_vue_type_style_index_0_scoped_true_lang="";const _hoisted_1$k={class:"app-select"},_hoisted_2$e={key:0,class:"app-select-option_icon"},_hoisted_3$b={key:0,class:"app-select-option_icon"},_sfc_main$t=defineComponent({__name:"AppSelect",props:{showLock:{type:Boolean,default:!1},value:{default:""},options:null,disabled:{type:Boolean,default:!1},showAllOption:{type:Boolean,default:!1}},emits:["change"],setup(e,{emit:t}){const n=e,{t:i}=useI18n(),o=useAppStore(),r=ref([]),s=e=>{t("change",e)};return watchEffect((()=>{(e=>{let t=[];n.showAllOption&&t.push({key:"all",title:i("common.allAppOption"),path:""}),t=e&&e.length?t.concat(e):t.concat(o.serverConfig.apps),r.value=t})(n.options)})),(t,n)=>{const i=SelectOption,o=SelectOptGroup,a=__unplugin_components_3;return openBlock(),createElementBlock("div",_hoisted_1$k,[createVNode(a,{value:e.value,class:"app-select_select","option-label-prop":"label",disabled:e.disabled,onChange:s},{default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(r.value,((t,n)=>(openBlock(),createElementBlock(Fragment,null,[t.items&&t.items.length?(openBlock(),createBlock(o,{label:t.title,key:n},{default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(t.items,(n=>(openBlock(),createBlock(i,{key:`${t.key},${n.key}`,value:`${t.key},${n.key}`,label:`${t.title}-${n.title}`},{default:withCtx((()=>[createTextVNode(toDisplayString$1(n.title)+" ",1),n.hasPassword&&e.showLock?(openBlock(),createElementBlock("span",_hoisted_2$e,[createVNode(unref(LockOutlined$1))])):createCommentVNode("",!0)])),_:2},1032,["value","label"])))),128))])),_:2},1032,["label"])):(openBlock(),createBlock(i,{value:`${t.key}`,label:`${t.title}`,key:`${n}`},{default:withCtx((()=>[createTextVNode(toDisplayString$1(t.title)+" ",1),t.hasPassword&&e.showLock?(openBlock(),createElementBlock("span",_hoisted_3$b,[createVNode(unref(LockOutlined$1))])):createCommentVNode("",!0)])),_:2},1032,["value","label"]))],64)))),256))])),_:1},8,["value","disabled"])])}}});var AppSelect=_export_sfc(_sfc_main$t,[["__scopeId","data-v-155a4fdb"]]),EditTable_vue_vue_type_style_index_0_scoped_true_lang="";const _withScopeId$2=e=>(pushScopeId("data-v-8e9b7dd2"),e=e(),popScopeId(),e),_hoisted_1$j={class:"edit-item-wraper"},_hoisted_2$d=_withScopeId$2((()=>createBaseVNode("span",{else:""},null,-1))),_hoisted_3$a={key:7,class:"tl"},_hoisted_4$7={key:9,style:{"text-align":"initial"}},__default__={name:"EditTable"},_sfc_main$s=defineComponent(__spreadProps(__spreadValues({},__default__),{props:{columns:null,data:null,isAdd:{type:Boolean,default:!1},scroll:null},emits:["deleteRow","addRow"],setup(e,{emit:t}){const n=e,{t:i}=useI18n();function o(e,t,n){let i="";switch(t.itemRender&&t.itemRender.name?t.itemRender.name:""){case"input":case"auto":i=e.target.value;break;case"checkbox":i=e.target.checked;break;default:i=e}n[t.dataIndex]=i}const r=()=>{t("addRow")};return(e,s)=>{const a=__unplugin_components_2$1,l=__unplugin_components_1$3,c=__unplugin_components_3,d=Checkbox$1,u=Button$2,h=__unplugin_components_5,g=Input,p=__unplugin_components_1$1;return openBlock(),createElementBlock("div",null,[createVNode(p,{bordered:"",pagination:!1,size:"small","data-source":n.data,columns:n.columns,scroll:n.scroll},{bodyCell:withCtx((({column:e,text:n,record:r})=>[createBaseVNode("div",_hoisted_1$j,[e.itemRender&&"number"===e.itemRender.name?(openBlock(),createBlock(a,mergeProps({key:0,class:"edit-item",value:n},e.itemRender.props,{onChange:t=>o(t,e,r)}),null,16,["value","onChange"])):e.itemRender&&"auto-complete"===e.itemRender.name?(openBlock(),createBlock(l,mergeProps({key:1,class:"edit-item",value:n},e.itemRender.props,{onChange:t=>o(t,e,r),onSelect:e=>{}}),null,16,["value","onChange","onSelect"])):e.itemRender&&"select"===e.itemRender.name?(openBlock(),createBlock(c,mergeProps({key:2,class:"edit-item",value:n,showSearch:"",allowClear:""},e.itemRender.props,{onChange:t=>o(t,e,r)}),null,16,["value","onChange"])):e.itemRender&&"checkbox"===e.itemRender.name?(openBlock(),createBlock(d,mergeProps({key:3,class:"edit-item",checked:n},e.itemRender.props,{onChange:t=>o(t,e,r)}),null,16,["checked","onChange"])):e.itemRender&&"app-select"===e.itemRender.name?(openBlock(),createBlock(unref(AppSelect),mergeProps({key:4,class:"edit-item",value:n},e.itemRender.props,{onChange:t=>o(t,e,r)}),null,16,["value","onChange"])):e.itemRender&&"delete-button"===e.itemRender.name?(openBlock(),createElementBlock(Fragment,{key:5},[!0!==r.require?(openBlock(),createBlock(u,{key:0,type:"link",danger:"",onClick:e=>(e=>{t("deleteRow",e)})(r)},{default:withCtx((()=>[createVNode(unref(DeleteOutlined$1))])),_:2},1032,["onClick"])):createCommentVNode("",!0),_hoisted_2$d],64)):e.itemRender&&"check-status"===e.itemRender.name?(openBlock(),createElementBlock(Fragment,{key:6},[n&&1==n?(openBlock(),createBlock(unref(CheckOutlined$1),{key:0})):createCommentVNode("",!0)],64)):!e.itemRender||"auto"!==e.itemRender.name||"file"!==r.type&&"files"!==r.type?!e.itemRender||"input"!==e.itemRender.name&&"auto"!==e.itemRender.name?(openBlock(),createElementBlock("div",_hoisted_4$7,toDisplayString$1(n),1)):(openBlock(),createBlock(g,mergeProps({key:8,class:"edit-item",value:n},e.itemRender.props,{onChange:t=>o(t,e,r)}),null,16,["value","onChange"])):(openBlock(),createElementBlock("div",_hoisted_3$a,[createVNode(h,{multiple:"files"===r.type,"file-list":n,onRemove:t=>{!function(e,t,n){let i=t[n.dataIndex];const o=i.indexOf(e),r=i.slice();r.splice(o,1),t[n.dataIndex]=r}(t,r,e)},"before-upload":t=>(function(e,t,n){"files"===t.type&&t[n.dataIndex]&&t[n.dataIndex].length?t[n.dataIndex].push(e):t[n.dataIndex]=[e]}(t,r,e),!1),name:r.name},{default:withCtx((()=>[createVNode(u,null,{default:withCtx((()=>[createTextVNode(toDisplayString$1("files"===r.type?unref(i)("apiPage.debug.selectFiles"):unref(i)("apiPage.debug.selectFile")),1)])),_:2},1024)])),_:2},1032,["multiple","file-list","onRemove","before-upload","name"])]))])])),_:1},8,["data-source","columns","scroll"]),n.isAdd?(openBlock(),createBlock(u,{key:0,class:"mt-sm",onClick:r},{default:withCtx((()=>[createTextVNode("+ "+toDisplayString$1(unref(i)("globalParam.add")),1)])),_:1})):createCommentVNode("",!0)])}}}));var EditTable=_export_sfc(_sfc_main$s,[["__scopeId","data-v-8e9b7dd2"]]),stringTag="[object String]";function isString$2(e){return"string"==typeof e||!isArray$4(e)&&isObjectLike(e)&&baseGetTag(e)==stringTag}function charsEndIndex(e,t){for(var n=e.length;n--&&baseIndexOf(t,e[n],0)>-1;);return n}function charsStartIndex(e,t){for(var n=-1,i=e.length;++n<i&&baseIndexOf(t,e[n],0)>-1;);return n}function trim(e,t,n){if((e=toString$1(e))&&(n||void 0===t))return baseTrim(e);if(!e||!(t=baseToString(t)))return e;var i=stringToArray(e),o=stringToArray(t);return castSlice(i,charsStartIndex(i,o),charsEndIndex(i,o)+1).join("")}const _sfc_main$r=defineComponent({__name:"GlobalParamsModal",props:{onSuccess:{type:Function,default:()=>{}},onCancel:{type:Function,default:()=>{}}},setup(e){const t=e,{t:n}=useI18n(),i=useApidocStore(),o=reactive({visible:!1,currentTabKey:"header",paramTypes:["header","query","body"],globalParams:cloneDeep(i.globalParams),columns:[{title:n("common.appOrVersion"),dataIndex:"appKey",width:158,itemRender:{name:"app-select",props:{showAllOption:!0}}},{title:n("common.field"),dataIndex:"name",width:150,itemRender:{name:"input"}},{title:n("common.value"),dataIndex:"value",itemRender:{name:"input"}},{title:n("common.desc"),dataIndex:"desc",width:260,itemRender:{name:"input"}},{title:n("common.action"),dataIndex:"id",width:70,align:"center",itemRender:{name:"delete-button"}}]});onMounted((()=>{o.visible=!0}));const r=()=>{i.setGlobalParams(o.globalParams),t.onSuccess&&t.onSuccess(),o.visible=!1},s=()=>{t.onCancel&&t.onCancel(),o.visible=!1},a=()=>{};return(e,t)=>{const i=__unplugin_components_0$6,l=__unplugin_components_4,c=Tabs,d=Button$2,u=Modal$2;return openBlock(),createBlock(u,{visible:o.visible,width:900,bodyStyle:{padding:"0 10px 10px"},maskClosable:!1,title:unref(n)("globalParam.title"),destroyOnClose:"",onCancel:s},{footer:withCtx((()=>[createVNode(d,{type:"primary",onClick:r},{default:withCtx((()=>[createTextVNode(toDisplayString$1(unref(n)("common.ok")),1)])),_:1})])),default:withCtx((()=>[createVNode(c,{visible:o.currentTabKey,"onUpdate:visible":t[0]||(t[0]=e=>o.currentTabKey=e),onChange:a},{default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.paramTypes,(e=>(openBlock(),createBlock(l,{key:e,tab:unref(n)(`globalParam.${e}`)},{default:withCtx((()=>[createVNode(i,{type:"info","show-icon":"",style:{"margin-bottom":"10px"},message:unref(n)(`globalParam.${e}.message`)},null,8,["message"]),createVNode(unref(EditTable),{columns:o.columns,data:o.globalParams[e],"is-add":!0,onAddRow:t=>(e=>{o.globalParams[e].push({id:createRandKey(),appKey:"all",name:"",value:"",desc:""})})(e),onDeleteRow:t=>((e,t)=>{o.globalParams[t]=o.globalParams[t].filter((t=>t.id!=e.id))})(t,e),scroll:{x:"700px",y:"200px"}},null,8,["columns","data","onAddRow","onDeleteRow"])])),_:2},1032,["tab"])))),128))])),_:1},8,["visible"])])),_:1},8,["visible","title"])}}});function modal$3(e){const t=createApp(_sfc_main$r,__spreadProps(__spreadValues({},e),{onSuccess:t=>{e.onSuccess&&e.onSuccess(t)},onCancel:()=>{e.onSuccess&&e.onCancel(),n()}})).use(pinia),n=()=>{t.unmount(),document.body.removeChild(i)},i=document.createElement("div");return document.body.appendChild(i),t.mount(i),t}var LangSelect_vue_vue_type_style_index_0_scoped_true_lang="";const _hoisted_1$i={key:0,class:"lang-select"},_sfc_main$q=defineComponent({__name:"LangSelect",setup(e){const{t:t}=useI18n(),n=useAppStore();let i=WebStorage.get(APP_LANG);!i&&n.feConfig&&n.feConfig.LANG&&n.feConfig.LANG.length&&(i=n.feConfig.LANG[0].lang);const o=reactive({langOptions:n.feConfig.LANG,locale:i}),r=e=>{if(i===e)return!1;const n=o.langOptions.find((t=>t.lang===e)),r=n&&n.title?n.title:"";Modal$2.confirm({title:t("lang.change.confirm.title",{langTitle:r}),content:t("lang.change.confirm.content"),okText:t("common.ok"),cancelText:t("common.cancel"),onOk(){WebStorage.set(APP_LANG,e),reloadHomePage()},onCancel(){}})};return(e,t)=>{const i=SelectOption,s=__unplugin_components_3;return o.langOptions&&o.langOptions.length>1?(openBlock(),createElementBlock("div",_hoisted_1$i,[createVNode(s,{value:o.locale,class:normalizeClass(["lang-select_select",unref(n).device]),"option-label-prop":"label",onSelect:r,getPopupContainer:e=>e.parentNode},{default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.langOptions,(e=>(openBlock(),createBlock(i,{key:e.lang,value:`${e.lang}`,label:`${e.title}`},{default:withCtx((()=>[createTextVNode(toDisplayString$1(e.title),1)])),_:2},1032,["value","label"])))),128))])),_:1},8,["value","class","getPopupContainer"])])):createCommentVNode("",!0)}}});var LangSelect=_export_sfc(_sfc_main$q,[["__scopeId","data-v-3dc59854"]]),index$8="",index$7="",index$6="",index$5="",FormInputType=(e=>(e.INPUT="input",e.SELECT="select",e.APPSELECT="app-select",e.GROUPSELECT="group-select",e.NUMBER="number",e.CHECKBOX="checkbox",e))(FormInputType||{}),DataForm_vue_vue_type_style_index_0_scoped_true_lang="";const _sfc_main$p=defineComponent({__name:"DataForm",props:{layout:{default:"grid"},items:null,colspan:{default:1},data:null,rules:null},setup(e,{expose:t}){const n=e,i=ref(),o=computed((()=>{if("grid"===n.layout){let e="";for(let t=0;t<n.colspan;t++)e+=" 1fr";return{"grid-template-columns":e}}})),r=reactive({formRules:{},formData:{}});watchEffect((()=>{(e=>{let t={};for(const n in e)t[n]=e[n];r.formData=t})(n.data)}));const s=(e,t)=>{r.formData[t.field]=e,t.onChange&&t.onChange(e)},a=e=>{let t=e.style?e.style:{};return"grid"===n.layout&&(e.colspan&&(t.gridColumn="span "+e.colspan),e.rowspan&&e.rowspan>1&&(t.gridRow="span "+e.rowspan)),t};const l=function(e){const t={};if(e&&e.length)for(let n=0;n<e.length;n++){const i=e[n];i.rules&&i.rules.length&&(t[i.field]=i.rules)}return t}(n.items);r.formRules=__spreadValues(__spreadValues({},n.rules),l);return t({onSubmit:()=>new Promise(((e,t)=>{i.value.validate().then((()=>{e(r.formData)})).catch((e=>{t(e)}))})),getData:()=>r.formData}),(t,l)=>{const c=__unplugin_components_3,d=__unplugin_components_1,u=__unplugin_components_2$1,h=Checkbox$1,g=Input,p=__unplugin_components_5$1,f=Form$1;return openBlock(),createBlock(f,{ref_key:"formRef",ref:i,class:normalizeClass(["data-form",n.layout]),style:normalizeStyle(unref(o)),rules:r.formRules,model:r.formData},{default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.items,(e=>(openBlock(),createBlock(p,{key:e.field,style:normalizeStyle(a(e)),class:normalizeClass(["data-form-item",e.class])},{label:withCtx((()=>[createBaseVNode("div",{class:normalizeClass(["data-form-item_title",{colon:!1!==e.colon}])},toDisplayString$1(e.title),3)])),default:withCtx((()=>[createBaseVNode("div",{class:normalizeClass(["data-form-item-wrapper",e.align])},[createBaseVNode("div",{class:"data-form-item-content",style:normalizeStyle({width:e.titleWidth})},[e.type==unref(FormInputType).SELECT?(openBlock(),createBlock(c,mergeProps({key:0},e.props,{value:r.formData[e.field],"onUpdate:value":t=>r.formData[e.field]=t,onChange:t=>s(t,e)}),null,16,["value","onUpdate:value","onChange"])):e.type==unref(FormInputType).GROUPSELECT?(openBlock(),createBlock(d,mergeProps({key:1},e.props,{value:r.formData[e.field],"onUpdate:value":t=>r.formData[e.field]=t,onChange:t=>s(t,e)}),null,16,["value","onUpdate:value","onChange"])):e.type==unref(FormInputType).APPSELECT?(openBlock(),createBlock(unref(AppSelect),mergeProps({key:2},e.props,{showLock:!1,style:{width:"100%"},value:r.formData[e.field],"onUpdate:value":t=>r.formData[e.field]=t,onChange:t=>((e,t)=>{r.formData[t.field]=e,t.onChange&&t.onChange(e)})(t,e)}),null,16,["value","onUpdate:value","onChange"])):e.type==unref(FormInputType).NUMBER?(openBlock(),createBlock(u,mergeProps({key:3},e.props,{style:{width:"100%"},value:r.formData[e.field],"onUpdate:value":t=>r.formData[e.field]=t,onChange:t=>s(t,e)}),null,16,["value","onUpdate:value","onChange"])):e.type==unref(FormInputType).CHECKBOX?(openBlock(),createBlock(h,mergeProps({key:4},e.props,{style:{width:"100%"},checked:r.formData[e.field],"onUpdate:checked":t=>r.formData[e.field]=t,onChange:t=>((e,t)=>{r.formData[t.field]=e.target.checked,t.onChange&&t.onChange(e.target.checked)})(t,e)}),null,16,["checked","onUpdate:checked","onChange"])):(openBlock(),createBlock(g,mergeProps({key:5},e.props,{value:r.formData[e.field],"onUpdate:value":t=>r.formData[e.field]=t,onChange:t=>((e,t)=>{r.formData[t.field]=e.target.value,t.onChange&&t.onChange(e.target.value)})(t,e)}),null,16,["value","onUpdate:value","onChange"]))],4)],2)])),_:2},1032,["style","class"])))),128))])),_:1},8,["class","style","rules","model"])}}});var DataForm=_export_sfc(_sfc_main$p,[["__scopeId","data-v-fa318eb6"]]),DataTableEdit_vue_vue_type_style_index_0_scoped_true_lang="";const _hoisted_1$h={class:"data-table-editor"},_hoisted_2$c={class:"table-title"},_hoisted_3$9=createTextVNode(" , "),_hoisted_4$6=createTextVNode(" , "),_hoisted_5$2={key:0,class:"table-desc"},_sfc_main$o=defineComponent({__name:"DataTableEdit",props:{option:null,data:null,fieldTypes:null},setup(e,{expose:t}){const n=e,{t:i}=useI18n(),o=reactive({modelName:"",tableName:"",tableComment:"",currentAlert:{type:"warning",message:""},columns:[],currentData:[]});function r(e){const{value:t}=e.target;t&&(o.tableName=camelToUnderline(t))}function s(e){o.currentData=o.currentData.filter((t=>t.id!==e.id))}function a(){let e={};n.option&&n.option.default_values&&(e=n.option.default_values),o.currentData.push(__spreadValues({id:createRandKey(),field:"",type:"",desc:""},e))}return n.data&&n.data.length&&(o.currentData=cloneDeep(n.data).map((e=>__spreadProps(__spreadValues({},e),{id:createRandKey()})))),function(){let e=[{title:i("generator.table.field"),dataIndex:"field",width:150,align:"center",itemRender:{name:"input"}},{title:i("generator.table.desc"),dataIndex:"desc",width:150,align:"center",itemRender:{name:"input"}},{title:i("generator.table.type"),dataIndex:"type",width:120,align:"center",itemRender:{name:"select",props:{options:n.fieldTypes.map((e=>({label:e,value:e})))}}},{title:i("generator.table.length"),dataIndex:"length",width:100,align:"center",itemRender:{name:"input"}},{title:i("generator.table.default"),dataIndex:"default",width:150,align:"center",itemRender:{name:"input"}},{title:i("generator.table.notNull"),dataIndex:"not_null",width:65,align:"center",itemRender:{name:"checkbox"}},{title:i("generator.table.mainKey"),dataIndex:"main_key",width:60,align:"center",itemRender:{name:"checkbox"}},{title:i("generator.table.autoAdd"),dataIndex:"incremental",width:50,align:"center",itemRender:{name:"checkbox"}}];if(n.option&&n.option.columns)for(let t=0;t<n.option.columns.length;t++){const i=cloneDeep(n.option.columns[t]);e.push({width:i.width?i.width:80,align:i.align?i.align:"center",dataIndex:i.field,title:i.title,itemRender:{name:i.type,props:i.props}})}e=e.concat([{title:i("common.action"),dataIndex:"id",width:70,align:"center",itemRender:{name:"delete-button"}}]),o.columns=e}(),t({getData:function(){var e,t,r;const s=trim(o.tableName),a=trim(o.modelName);let l=[{required:!0,message:i("generator.model.name.placeholder")}];(null==(e=n.option)?void 0:e.model_rules)&&(l=[...l,...n.option.model_rules]);const c=checkStringRules(a,l);if(c)return void(o.currentAlert={type:"error",message:c});let d=[{required:!0,message:i("generator.table.name.placeholder")}];(null==(t=n.option)?void 0:t.table_rules)&&(d=[...d,...n.option.table_rules]);const u=checkStringRules(s,d);if(u)return void(o.currentAlert={type:"error",message:u});let h=[];const g={};let p=!1;for(let n=0;n<o.columns.length;n++){const e=o.columns[n];g[e.dataIndex]=e,"select"===(null==(r=e.itemRender)?void 0:r.name)&&e.itemRender.props&&e.itemRender.props.options&&"type"!=e.dataIndex&&(p=!0)}const f=cloneDeep(o.currentData).map(((e,t)=>{var n,i;if(p)for(const o in e){const t=e[o],r=g[o];if("select"===(null==(n=r.itemRender)?void 0:n.name)&&r.itemRender.props&&r.itemRender.props.options&&"type"!=r.dataIndex){let n="";n="select"===(null==(i=r.itemRender)?void 0:i.name)&&r.itemRender.props&&"multiple"==r.itemRender.props.mode&&isArray$4(t)?r.itemRender.props.options.filter((e=>t.includes(e.value))):r.itemRender.props.options.find((e=>e.value==t)),e[o]=n}}return e.field&&e.type||h.push(t+1),e}));if(!h.length)return o.currentAlert={type:"warning",message:n.option?n.option.desc:""},{table_name:s,model_name:a,table_comment:o.tableComment,namespace:n.option&&n.option.namespace?n.option.namespace:"",model_path:n.option&&n.option.path?n.option.path:"",template:n.option&&n.option.template?n.option.template:"",datas:f};o.currentAlert={type:"error",message:i("generator.table.row.error",{rows:h.join(",")})}}}),(e,t)=>{const l=Input,c=__unplugin_components_0$6;return openBlock(),createElementBlock("div",_hoisted_1$h,[createBaseVNode("div",_hoisted_2$c,[createBaseVNode("b",null,toDisplayString$1(n.option.title),1),createBaseVNode("span",null,toDisplayString$1(unref(i)("generator.model.name"))+":",1),createBaseVNode("span",null,toDisplayString$1(n.option.path)+"\\",1),createVNode(l,{value:o.modelName,"onUpdate:value":t[0]||(t[0]=e=>o.modelName=e),style:{width:"160px"},onChange:r},null,8,["value"]),_hoisted_3$9,createBaseVNode("span",null,toDisplayString$1(unref(i)("generator.table.name"))+":",1),createVNode(l,{value:o.tableName,"onUpdate:value":t[1]||(t[1]=e=>o.tableName=e),style:{width:"160px"}},null,8,["value"]),_hoisted_4$6,createBaseVNode("span",null,toDisplayString$1(unref(i)("generator.table.comment"))+":",1),createVNode(l,{value:o.tableComment,"onUpdate:value":t[2]||(t[2]=e=>o.tableComment=e),style:{width:"160px"}},null,8,["value"])]),o.currentAlert&&o.currentAlert.message?(openBlock(),createElementBlock("div",_hoisted_5$2,[createVNode(c,{banner:"",type:o.currentAlert.type,message:o.currentAlert.message},null,8,["type","message"])])):createCommentVNode("",!0),createVNode(unref(EditTable),{columns:o.columns,data:o.currentData,"is-add":!0,scroll:{x:"100%",y:"300px"},onAddRow:a,onDeleteRow:s},null,8,["columns","data"])])}}});var DataTableEdit=_export_sfc(_sfc_main$o,[["__scopeId","data-v-078e2764"]]),FilesEditor_vue_vue_type_style_index_0_scoped_true_lang="";const _withScopeId$1=e=>(pushScopeId("data-v-3e8bf20c"),e=e(),popScopeId(),e),_hoisted_1$g={class:"file-list"},_hoisted_2$b={key:0,class:"error-text"},_hoisted_3$8=_withScopeId$1((()=>createBaseVNode("label",null,"Path:",-1))),_sfc_main$n=defineComponent({__name:"FilesEditor",props:{appKey:null,files:null},setup(e,{expose:t}){const n=e,{t:i}=useI18n(),o=useAppStore(),r=reactive({fileDatas:[],ruleError:{}});return watchEffect((()=>{let e=[];if(n.files&&n.files.length)for(let t=0;t<n.files.length;t++){const i=n.files[t];e.push({name:i.name,value:"",path:replaceAppConfigKeys(o.appObject[n.appKey],i.path)})}r.fileDatas=e})),t({getData:function(){const e=r.fileDatas;let t={};for(let i=0;i<n.files.length;i++){const o=n.files[i];if(o.rules&&o.rules.length){const n=e[i].value,r=checkStringRules(n,o.rules);r&&(t[o.name]=r)}}return r.ruleError=t,"{}"==JSON.stringify(t)&&r.fileDatas}}),(e,t)=>{const o=Input;return openBlock(),createElementBlock("div",_hoisted_1$g,[(openBlock(!0),createElementBlock(Fragment,null,renderList(r.fileDatas,((e,t)=>(openBlock(),createElementBlock(Fragment,{key:t},[e.path.indexOf(".php")<0?(openBlock(),createElementBlock("div",{key:t,class:"file-item"},[createBaseVNode("label",null,toDisplayString$1(e.name),1),createVNode(o,{value:e.value,"onUpdate:value":t=>e.value=t,class:"input-link",placeholder:`${unref(i)("common.please.input")} ${e.name}${unref(i)("common.file.name")}`,onBlur:e=>function(e,t){const{value:i}=e.target;0===t&&(r.fileDatas=r.fileDatas.map((e=>(e.value=i,e))));const o=n.files[t],s=checkStringRules(i,o.rules);s?r.ruleError[o.name]=s:delete r.ruleError[o.name]}(e,t)},null,8,["value","onUpdate:value","placeholder","onBlur"]),r.ruleError[e.name]?(openBlock(),createElementBlock("div",_hoisted_2$b,toDisplayString$1(r.ruleError[e.name]),1)):createCommentVNode("",!0),createBaseVNode("div",null,[_hoisted_3$8,createBaseVNode("span",null,toDisplayString$1(e.path),1)])])):createCommentVNode("",!0)],64)))),128))])}}});var FilesEditor=_export_sfc(_sfc_main$n,[["__scopeId","data-v-3e8bf20c"]]);const _hoisted_1$f={class:"generator-wraper"},_hoisted_2$a={class:"mb-sm"},_sfc_main$m=defineComponent({__name:"GeneratorModal",props:{onSuccess:{type:Function,default:()=>{}},onCancel:{type:Function,default:()=>{}},generatorIndex:{type:Number,default:0}},setup(e){const t=e,{t:n}=useI18n(),i=useAppStore(),o=ref(),r=ref();let s={};const a=e=>{if(e){const t=e.$attrs.index;s[t]=e}},l=reactive({visible:!1,modalTitle:n("generator.title"),currentGenerator:{title:"",name:"",files:[]},formItems:[],formData:{},currentAppKey:"",tableItems:[],loading:!1});function c(){return __async(this,null,(function*(){try{const e=yield o.value.onSubmit(),i=r.value.getData();if(!i)return void(l.loading=!1);let a=[];if(Object.keys(s).length){let e=!1;for(const t in s){const n=s[t];if(n&&n.getData){const t=n.getData();if(!t){e=!0;break}a.push(t)}}if(e)return void(l.loading=!1)}const c={index:t.generatorIndex,form:e,files:i,tables:a};globalApi.generator(c).then((()=>{message.success(n("generator.submitSuccess")),l.loading=!1,d(),t.onSuccess&&t.onSuccess()})).catch((e=>{if(l.loading=!1,e.response){const t=e.response&&e.response.data&&e.response.data.message?e.response.data.message:e.message;notification.error({message:e.response.status,description:t})}else notification.error({message:e.response.status,description:e.message})}))}catch(e){l.loading=!1}}))}onMounted((()=>{l.visible=!0,function(e){s={};const t=i.serverConfig.generator&&i.serverConfig.generator[e];if(t){if(l.modalTitle=`${n("generator.title")} - ${t.title}`,l.currentGenerator=t,t.form&&t.form.items){const e=[{title:n("generator.apps.title"),field:"appKey",type:FormInputType.APPSELECT},{title:n("generator.group.title"),field:"group",type:FormInputType.GROUPSELECT},...t.form.items];let o={};l.formItems=e.map((e=>("app-select"===e.type&&(e.onChange=e=>{h(e)}),e.default&&(o[e.field]=e.default),e))),l.formData=__spreadValues({appKey:i.appKey,group:""},o)}t.table&&t.table.items?l.tableItems=t.table.items:l.tableItems=[],h(i.appKey)}}(t.generatorIndex)}));const d=()=>{l.visible=!1,t.onCancel&&t.onCancel()},u=e=>e&&e.length?e.map((e=>(e.value=e.name,e.children&&e.children.length&&(e.children=u(e.children)),e))):[];function h(e){l.currentAppKey=e,s={};const t=i.appObject[e];if(t){const e=null==t?void 0:t.groups,n=l.formItems.findIndex((e=>"group-select"===e.type));if(n>-1){if(o.value){const e=o.value.getData();l.formData=__spreadProps(__spreadValues({},e),{[l.formItems[n].field]:""})}let t=[];e&&e.length&&(t=u(e)),l.formItems[n].props=__spreadProps(__spreadValues({},l.formItems[n].props),{treeData:t})}}}return(e,t)=>{const i=Button$2,s=Modal$2;return openBlock(),createBlock(s,{visible:l.visible,width:"90%",bodyStyle:{padding:"0 10px 10px"},maskClosable:!1,title:l.modalTitle,centered:"",destroyOnClose:"",class:"generator-modal",onCancel:d},{footer:withCtx((()=>[createVNode(i,{danger:"",ghost:"",onClick:d},{default:withCtx((()=>[createTextVNode(toDisplayString$1(unref(n)("common.cancel")),1)])),_:1}),createVNode(i,{loading:l.loading,type:"primary",onClick:c},{default:withCtx((()=>[createTextVNode(toDisplayString$1(unref(n)("common.ok")),1)])),_:1},8,["loading"])])),default:withCtx((()=>[createBaseVNode("div",_hoisted_1$f,[createBaseVNode("div",_hoisted_2$a,[createVNode(unref(DataForm),{ref_key:"formRef",ref:o,colspan:l.currentGenerator.form&&l.currentGenerator.form.colspan?l.currentGenerator.form.colspan:3,items:l.formItems,data:l.formData},null,8,["colspan","items","data"])]),createVNode(FilesEditor,{ref_key:"filesRef",ref:r,files:l.currentGenerator.files,appKey:l.currentAppKey},null,8,["files","appKey"]),(openBlock(!0),createElementBlock(Fragment,null,renderList(l.tableItems,((e,t)=>{var n;return openBlock(),createBlock(DataTableEdit,{key:t,ref_for:!0,ref:a,data:e.default_fields,option:e,index:t,fieldTypes:null==(n=l.currentGenerator.table)?void 0:n.field_types},null,8,["data","option","index","fieldTypes"])})),128))])])),_:1},8,["visible","title"])}}});function modal$2(e){const t=createApp(_sfc_main$m,__spreadProps(__spreadValues({},e),{onSuccess:t=>{e.onSuccess&&e.onSuccess(t),n()},onCancel:()=>{e.onCancel&&e.onCancel(),n()}})).use(pinia),n=()=>{t.unmount(),document.body.removeChild(i)},i=document.createElement("div");return document.body.appendChild(i),t.mount(i),t}var Error_vue_vue_type_style_index_0_scoped_true_lang="";const _hoisted_1$e={class:"error-box"},_hoisted_2$9={class:"error-status"},_hoisted_3$7=["src"],_hoisted_4$5={key:1,class:"error-message"},_sfc_main$l=defineComponent({__name:"Error",props:{error:null},setup(e){const t=e,n=computed((()=>{const e=t.error;if(e.response&&e.response.data){if(e.response.data.message)return e.response.data.message;if(e.response.data.msg)return e.response.data.msg}return e.message})),i=computed((()=>{const e=t.error;return e.response&&e.response.status?e.response.status:500})),o=computed((()=>{const e=t.error;if(e.config&&e.response&&500==e.response.status){let t="";if("post"==e.config.method&&e.config.data){const n=JSON.parse(e.config.data);for(const e in n){let i=encodeURIComponent(n[e]);if(i){t+=`${t?"&":"?"}${e}=${i}`}}}return e.config.baseURL+e.config.url+t}return""}));return(t,r)=>(openBlock(),createElementBlock("div",_hoisted_1$e,[createBaseVNode("div",_hoisted_2$9,[createBaseVNode("div",null,[createVNode(unref(WarningOutlined$1))]),createBaseVNode("div",null,toDisplayString$1(unref(i)),1)]),createBaseVNode("div",null,[createBaseVNode("p",null,"Url: "+toDisplayString$1(e.error.config&&e.error.config.baseURL)+toDisplayString$1(e.error.config&&e.error.config.url),1)]),unref(o)?(openBlock(),createElementBlock("iframe",{key:0,src:unref(o),class:"error-iframe"},null,8,_hoisted_3$7)):(openBlock(),createElementBlock("div",_hoisted_4$5,toDisplayString$1(unref(n)),1))]))}});var Error$1=_export_sfc(_sfc_main$l,[["__scopeId","data-v-f5da7740"]]),ConfirmModal_vue_vue_type_style_index_0_scoped_true_lang="";const _hoisted_1$d={key:1,class:"title"},_sfc_main$k=defineComponent({__name:"ConfirmModal",props:{title:{type:String,default:""},onOk:{type:Function,default:()=>{}},onCancel:{type:Function,default:()=>{}}},setup(e){const t=e,{t:n}=useI18n(),i=reactive({visible:!1,loading:!1,error:{config:{},isAxiosError:!1,toJSON:()=>({}),name:"",message:""}});onMounted((()=>{i.visible=!0}));const o=()=>__async(this,null,(function*(){if(i.loading=!0,t.onOk)try{const e=yield t.onOk();return i.loading=!1,i.visible=!1,e}catch(e){return i.loading=!1,i.error=e,Promise.reject(e)}})),r=()=>{t.onCancel&&t.onCancel(),i.visible=!1};return(t,s)=>{const a=Button$2,l=Modal$2;return openBlock(),createBlock(l,{visible:i.visible,width:415,maskClosable:!1,destroyOnClose:"",closable:!1,onCancel:r,class:"confirm-modal"},{footer:withCtx((()=>[createVNode(a,{onClick:r},{default:withCtx((()=>[createTextVNode(toDisplayString$1(unref(n)("common.cancel")),1)])),_:1}),i.error.response&&200!=i.error.response.status||!i.error.response&&i.error.message?createCommentVNode("",!0):(openBlock(),createBlock(a,{key:0,type:"primary",loading:i.loading,onClick:o},{default:withCtx((()=>[createTextVNode(toDisplayString$1(unref(n)("common.ok")),1)])),_:1},8,["loading"]))])),default:withCtx((()=>[!i.loading&&(i.error.response&&200!=i.error.response.status||!i.error.response&&i.error.message)?(openBlock(),createBlock(unref(Error$1),{key:0,error:i.error,style:{padding:"10px"}},null,8,["error"])):(openBlock(),createElementBlock("div",_hoisted_1$d,[createBaseVNode("span",null,[createVNode(unref(ExclamationCircleOutlined$1),{class:"icon"})]),createTextVNode(" "+toDisplayString$1(e.title),1)]))])),_:1},8,["visible"])}}});var Modal$1=_export_sfc(_sfc_main$k,[["__scopeId","data-v-f23038e6"]]);function modal$1(e){const t=createApp(Modal$1,__spreadProps(__spreadValues({},e),{onSuccess:t=>{e.onSuccess&&e.onSuccess(t)},onCancel:()=>{e.onCancel&&e.onCancel(),n()}})).use(pinia),n=()=>{t.unmount(),document.body.removeChild(i)},i=document.createElement("div");return document.body.appendChild(i),t.mount(i),t}var index$4="",Search_vue_vue_type_style_index_0_scoped_true_lang="";const _hoisted_1$c={class:"search-wraper"},_sfc_main$j=defineComponent({__name:"Search",emits:["search","appChange"],setup(e,{emit:t}){const n=useAppStore(),{t:i}=useI18n(),o=ref(""),r=e=>{t("search",e)},s=e=>{t("appChange",e)};return watchEffect((()=>{o.value=n.appKey})),(e,t)=>{const n=__unplugin_components_0$3,a=__unplugin_components_2;return openBlock(),createElementBlock("div",_hoisted_1$c,[createVNode(a,null,{default:withCtx((()=>[createVNode(unref(AppSelect),{value:o.value,showLock:"",onChange:s},null,8,["value"]),createVNode(n,{placeholder:unref(i)("side.search.placeholder"),onSearch:r,allowClear:!0},null,8,["placeholder"])])),_:1})])}}});var Search=_export_sfc(_sfc_main$j,[["__scopeId","data-v-5125c0d2"]]),ApiTreeSelect_vue_vue_type_style_index_0_scoped_true_lang="";const _withScopeId=e=>(pushScopeId("data-v-6fa3aecf"),e=e(),popScopeId(),e),_hoisted_1$b={class:"api-tree-select"},_hoisted_2$8={class:"api-tree-select-search mb-sm"},_hoisted_3$6=_withScopeId((()=>createBaseVNode("div",null,null,-1))),_hoisted_4$4={class:"tree-wraper"},_sfc_main$i=defineComponent({__name:"ApiTreeSelect",props:{checkable:{type:Boolean,default:!1},treeHeight:null,selectedKeys:null,selectMode:null},emits:["select","check"],setup(e,{emit:t}){const n=e,i=useAppStore(),o=reactive({appKey:i.appKey,apiResData:[],apiTreeData:[],keyword:"",currentSelectedKeys:[]}),r={title:"title",key:"menuKey"},s=e=>{o.keyword=e,o.apiTreeData=u(cloneDeep(o.apiResData))},a=e=>__async(this,null,(function*(){o.appKey=e,l()})),l=()=>{globalApi.getApiMenus({appKey:o.appKey}).then((e=>{o.apiResData=e.data.data,"controller"==n.selectMode?o.apiTreeData=u(e.data.data):o.apiTreeData=e.data.data}))};l();const c=(e,n)=>{t("select",e,n,o.appKey)},d=(e,n)=>{t("check",e,n,o.appKey)};function u(e){return e.map((e=>"controller"==n.selectMode&&e.url?"":(!(o.keyword&&e.title.indexOf(o.keyword)<0)||e.children&&e.children.length)&&(!e.children||!e.children.length||(e.children=u(e.children),!o.keyword||e.children&&e.children.length))?e:"")).filter((e=>""!=e))}return watch((()=>n.selectMode),(()=>{l()})),(e,t)=>{const l=__unplugin_components_0;return openBlock(),createElementBlock("div",_hoisted_1$b,[createBaseVNode("div",_hoisted_2$8,[createVNode(Search,{onSearch:s,onAppChange:a})]),_hoisted_3$6,createBaseVNode("div",_hoisted_4$4,[createVNode(l,{"default-expand-all":"",checkable:n.checkable,"tree-data":o.apiTreeData,"field-names":r,height:n.treeHeight,selectedKeys:n.selectedKeys,onSelect:c,onCheck:d},{title:withCtx((({title:e,controller:t,method:o,path:r})=>{var s;return[t?(openBlock(),createBlock(unref(CopyrightCircleOutlined$1),{key:0})):o?(openBlock(),createElementBlock("span",{key:1,class:normalizeClass(["api-method-icon",`method-color_${o}`]),style:normalizeStyle({color:unref(i).feConfig.METHOD_COLOR&&unref(i).feConfig.METHOD_COLOR[o]?unref(i).feConfig.METHOD_COLOR[o]:""})},toDisplayString$1("string"==typeof o?o:`${o.length} met.`),7)):(openBlock(),createBlock(unref(FolderOutlined$1),{key:2})),createBaseVNode("span",{class:normalizeClass(["tree-title",{active:null==(s=n.selectedKeys)?void 0:s.includes(r)}])},toDisplayString$1(e),3)]})),_:1},8,["checkable","tree-data","height","selectedKeys"])])])}}});var ApiTreeSelect=_export_sfc(_sfc_main$i,[["__scopeId","data-v-6fa3aecf"]]);function _format$1(e,t){let n;return n=0===t.length?e:e.replace(/\{(\d+)\}/g,(function(e,n){const i=n[0];return void 0!==t[i]?t[i]:e})),n}function localize(e,t,...n){return _format$1(t,n)}class ErrorHandler{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout((()=>{if(e.stack)throw new Error(e.message+"\n\n"+e.stack);throw e}),0)}}emit(e){this.listeners.forEach((t=>{t(e)}))}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const errorHandler=new ErrorHandler;function onUnexpectedError(e){isCancellationError(e)||errorHandler.onUnexpectedError(e)}function onUnexpectedExternalError(e){isCancellationError(e)||errorHandler.onUnexpectedExternalError(e)}function transformErrorForSerialization(e){if(e instanceof Error){let{name:t,message:n}=e;return{$isError:!0,name:t,message:n,stack:e.stacktrace||e.stack}}return e}const canceledName="Canceled";function isCancellationError(e){return e instanceof CancellationError||e instanceof Error&&e.name===canceledName&&e.message===canceledName}class CancellationError extends Error{constructor(){super(canceledName),this.name=this.message}}function canceled(){const e=new Error(canceledName);return e.name=e.message,e}function illegalArgument(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}function illegalState(e){return e?new Error(`Illegal state: ${e}`):new Error("Illegal state")}class NotSupportedError extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}function once$1(e){const t=this;let n,i=!1;return function(){return i||(i=!0,n=e.apply(t,arguments)),n}}var Iterable,_a$e;function trackDisposable(e){return e}function setParentOfDisposable(e,t){}function markAsSingleton(e){return e}!function(e){e.is=function(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]};const t=Object.freeze([]);e.empty=function(){return t},e.single=function*(e){yield e},e.from=function(e){return e||t},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){for(const n of e)if(t(n))return!0;return!1},e.find=function(e,t){for(const n of e)if(t(n))return n},e.filter=function*(e,t){for(const n of e)t(n)&&(yield n)},e.map=function*(e,t){let n=0;for(const i of e)yield t(i,n++)},e.concat=function*(...e){for(const t of e)for(const e of t)yield e},e.concatNested=function*(e){for(const t of e)for(const e of t)yield e},e.reduce=function(e,t,n){let i=n;for(const o of e)i=t(i,o);return i},e.slice=function*(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]},e.consume=function(t,n=Number.POSITIVE_INFINITY){const i=[];if(0===n)return[i,t];const o=t[Symbol.iterator]();for(let r=0;r<n;r++){const t=o.next();if(t.done)return[i,e.empty()];i.push(t.value)}return[i,{[Symbol.iterator]:()=>o}]},e.equals=function(e,t,n=((e,t)=>e===t)){const i=e[Symbol.iterator](),o=t[Symbol.iterator]();for(;;){const e=i.next(),t=o.next();if(e.done!==t.done)return!1;if(e.done)return!0;if(!n(e.value,t.value))return!1}}}(Iterable||(Iterable={}));class MultiDisposeError extends Error{constructor(e){super(`Encountered errors while disposing of store. Errors: [${e.join(", ")}]`),this.errors=e}}function isDisposable(e){return"function"==typeof e.dispose&&0===e.dispose.length}function dispose(e){if(Iterable.is(e)){let t=[];for(const n of e)if(n)try{n.dispose()}catch(e2){t.push(e2)}if(1===t.length)throw t[0];if(t.length>1)throw new MultiDisposeError(t);return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function combinedDisposable(...e){return toDisposable((()=>dispose(e)))}function toDisposable(e){return trackDisposable({dispose:once$1((()=>{e()}))})}class DisposableStore{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){try{dispose(this._toDispose.values())}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?DisposableStore.DISABLE_DISPOSED_WARNING:this._toDispose.add(e),e}}DisposableStore.DISABLE_DISPOSED_WARNING=!1;class Disposable{constructor(){this._store=new DisposableStore,setParentOfDisposable(this._store)}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}Disposable.None=Object.freeze({dispose(){}});class MutableDisposable{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||(null===(t=this._value)||void 0===t||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,null===(e=this._value)||void 0===e||e.dispose(),this._value=void 0}clearAndLeak(){const e=this._value;return this._value=void 0,e}}class SafeDisposable{constructor(){this.dispose=()=>{},this.unset=()=>{},this.isset=()=>!1}set(e){let t=e;return this.unset=()=>t=void 0,this.isset=()=>void 0!==t,this.dispose=()=>{t&&(t(),t=void 0)},this}}class ImmortalReference{constructor(e){this.object=e}dispose(){}}class Node$2{constructor(e){this.element=e,this.next=Node$2.Undefined,this.prev=Node$2.Undefined}}Node$2.Undefined=new Node$2(void 0);class LinkedList{constructor(){this._first=Node$2.Undefined,this._last=Node$2.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Node$2.Undefined}clear(){let e=this._first;for(;e!==Node$2.Undefined;){const t=e.next;e.prev=Node$2.Undefined,e.next=Node$2.Undefined,e=t}this._first=Node$2.Undefined,this._last=Node$2.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const n=new Node$2(e);if(this._first===Node$2.Undefined)this._first=n,this._last=n;else if(t){const e=this._last;this._last=n,n.prev=e,e.next=n}else{const e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(n))}}shift(){if(this._first!==Node$2.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Node$2.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Node$2.Undefined&&e.next!==Node$2.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Node$2.Undefined&&e.next===Node$2.Undefined?(this._first=Node$2.Undefined,this._last=Node$2.Undefined):e.next===Node$2.Undefined?(this._last=this._last.prev,this._last.next=Node$2.Undefined):e.prev===Node$2.Undefined&&(this._first=this._first.next,this._first.prev=Node$2.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Node$2.Undefined;)yield e.element,e=e.next}}const LANGUAGE_DEFAULT="en";let _isWindows=!1,_isMacintosh=!1,_isLinux=!1,_isNative=!1,_isWeb=!1,_isIOS=!1,_locale,_language=LANGUAGE_DEFAULT,_translationsConfigFile,_userAgent;const globals="object"==typeof self?self:"object"==typeof global?global:{};let nodeProcess;void 0!==globals.vscode&&void 0!==globals.vscode.process?nodeProcess=globals.vscode.process:"undefined"!=typeof process&&(nodeProcess=process);const isElectronProcess="string"==typeof(null===(_a$e=null==nodeProcess?void 0:nodeProcess.versions)||void 0===_a$e?void 0:_a$e.electron),isElectronRenderer=isElectronProcess&&"renderer"===(null==nodeProcess?void 0:nodeProcess.type);if("object"!=typeof navigator||isElectronRenderer){if("object"==typeof nodeProcess){_isWindows="win32"===nodeProcess.platform,_isMacintosh="darwin"===nodeProcess.platform,_isLinux="linux"===nodeProcess.platform,_isLinux&&nodeProcess.env.SNAP&&nodeProcess.env.SNAP_REVISION,nodeProcess.env.CI||nodeProcess.env.BUILD_ARTIFACTSTAGINGDIRECTORY,_locale=LANGUAGE_DEFAULT,_language=LANGUAGE_DEFAULT;const e=nodeProcess.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e),n=t.availableLanguages["*"];_locale=t.locale,_language=n||LANGUAGE_DEFAULT,_translationsConfigFile=t._translationsConfigFile}catch(e2){}_isNative=!0}}else _userAgent=navigator.userAgent,_isWindows=_userAgent.indexOf("Windows")>=0,_isMacintosh=_userAgent.indexOf("Macintosh")>=0,_isIOS=(_userAgent.indexOf("Macintosh")>=0||_userAgent.indexOf("iPad")>=0||_userAgent.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,_isLinux=_userAgent.indexOf("Linux")>=0,_isWeb=!0,_locale=navigator.language,_language=_locale;const isWindows=_isWindows,isMacintosh=_isMacintosh,isLinux=_isLinux,isNative=_isNative,isWeb=_isWeb,isWebWorker=_isWeb&&"function"==typeof globals.importScripts,isIOS=_isIOS,userAgent$1=_userAgent,language=_language,setTimeout0=(()=>{if("function"==typeof globals.postMessage&&!globals.importScripts){let e=[];globals.addEventListener("message",(t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,i=e.length;n<i;n++){const i=e[n];if(i.id===t.data.vscodeScheduleAsyncWork)return e.splice(n,1),void i.callback()}}));let t=0;return n=>{const i=++t;e.push({id:i,callback:n}),globals.postMessage({vscodeScheduleAsyncWork:i},"*")}}return e=>setTimeout(e)})(),OS=_isMacintosh||_isIOS?2:_isWindows?1:3;let _isLittleEndian=!0,_isLittleEndianComputed=!1;function isLittleEndian(){if(!_isLittleEndianComputed){_isLittleEndianComputed=!0;const e=new Uint8Array(2);e[0]=1,e[1]=2;const t=new Uint16Array(e.buffer);_isLittleEndian=513===t[0]}return _isLittleEndian}const isChrome$1=!!(userAgent$1&&userAgent$1.indexOf("Chrome")>=0),isFirefox$1=!!(userAgent$1&&userAgent$1.indexOf("Firefox")>=0),isSafari$1=!!(!isChrome$1&&userAgent$1&&userAgent$1.indexOf("Safari")>=0),isEdge=!!(userAgent$1&&userAgent$1.indexOf("Edg/")>=0);userAgent$1&&userAgent$1.indexOf("Android");const hasPerformanceNow=globals.performance&&"function"==typeof globals.performance.now;class StopWatch{constructor(e){this._highResolution=hasPerformanceNow&&e,this._startTime=this._now(),this._stopTime=-1}static create(e=!0){return new StopWatch(e)}stop(){this._stopTime=this._now()}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?globals.performance.now():Date.now()}}var Event$1;!function(e){function t(e){return(t,n=null,i)=>{let o,r=!1;return o=e((e=>{if(!r)return o?o.dispose():r=!0,t.call(n,e)}),null,i),r&&o.dispose(),o}}function n(e,t,n){return s(((n,i=null,o)=>e((e=>n.call(i,t(e))),null,o)),n)}function i(e,t,n){return s(((n,i=null,o)=>e((e=>{t(e),n.call(i,e)}),null,o)),n)}function o(e,t,n){return s(((n,i=null,o)=>e((e=>t(e)&&n.call(i,e)),null,o)),n)}function r(e,t,i,o){let r=i;return n(e,(e=>(r=t(r,e),r)),o)}function s(e,t){let n;const i=new Emitter$1({onFirstListenerAdd(){n=e(i.fire,i)},onLastListenerRemove(){n.dispose()}});return t&&t.add(i),i.event}function a(e,t,n=100,i=!1,o,r){let s,a,l,c=0;const d=new Emitter$1({leakWarningThreshold:o,onFirstListenerAdd(){s=e((e=>{c++,a=t(a,e),i&&!l&&(d.fire(a),a=void 0),clearTimeout(l),l=setTimeout((()=>{const e=a;a=void 0,l=void 0,(!i||c>1)&&d.fire(e),c=0}),n)}))},onLastListenerRemove(){s.dispose()}});return r&&r.add(d),d.event}function l(e,t=((e,t)=>e===t),n){let i,r=!0;return o(e,(e=>{const n=r||!t(e,i);return r=!1,i=e,n}),n)}e.None=()=>Disposable.None,e.once=t,e.map=n,e.forEach=i,e.filter=o,e.signal=function(e){return e},e.any=function(...e){return(t,n=null,i)=>combinedDisposable(...e.map((e=>e((e=>t.call(n,e)),null,i))))},e.reduce=r,e.debounce=a,e.latch=l,e.split=function(t,n,i){return[e.filter(t,n,i),e.filter(t,(e=>!n(e)),i)]},e.buffer=function(e,t=!1,n=[]){let i=n.slice(),o=e((e=>{i?i.push(e):s.fire(e)}));const r=()=>{i&&i.forEach((e=>s.fire(e))),i=null},s=new Emitter$1({onFirstListenerAdd(){o||(o=e((e=>s.fire(e))))},onFirstListenerDidAdd(){i&&(t?setTimeout(r):r())},onLastListenerRemove(){o&&o.dispose(),o=null}});return s.event};class c{constructor(e){this.event=e}map(e){return new c(n(this.event,e))}forEach(e){return new c(i(this.event,e))}filter(e){return new c(o(this.event,e))}reduce(e,t){return new c(r(this.event,e,t))}latch(){return new c(l(this.event))}debounce(e,t=100,n=!1,i){return new c(a(this.event,e,t,n,i))}on(e,t,n){return this.event(e,t,n)}once(e,n,i){return t(this.event)(e,n,i)}}e.chain=function(e){return new c(e)},e.fromNodeEventEmitter=function(e,t,n=(e=>e)){const i=(...e)=>o.fire(n(...e)),o=new Emitter$1({onFirstListenerAdd:()=>e.on(t,i),onLastListenerRemove:()=>e.removeListener(t,i)});return o.event},e.fromDOMEventEmitter=function(e,t,n=(e=>e)){const i=(...e)=>o.fire(n(...e)),o=new Emitter$1({onFirstListenerAdd:()=>e.addEventListener(t,i),onLastListenerRemove:()=>e.removeEventListener(t,i)});return o.event},e.toPromise=function(e){return new Promise((n=>t(e)(n)))},e.runAndSubscribe=function(e,t){return t(void 0),e((e=>t(e)))},e.runAndSubscribeWithStore=function(e,t){let n=null;function i(e){null==n||n.dispose(),n=new DisposableStore,t(e,n)}i(void 0);const o=e((e=>i(e)));return toDisposable((()=>{o.dispose(),null==n||n.dispose()}))}}(Event$1||(Event$1={}));class EventProfiling{constructor(e){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${e}_${EventProfiling._idPool++}`}start(e){this._stopWatch=new StopWatch(!0),this._listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this._elapsedOverall+=e,this._invocationCount+=1,this._stopWatch=void 0}}}EventProfiling._idPool=0;class Stacktrace{constructor(e){this.value=e}static create(){var e;return new Stacktrace(null!==(e=(new Error).stack)&&void 0!==e?e:"")}print(){}}class Listener{constructor(e,t,n){this.callback=e,this.callbackThis=t,this.stack=n,this.subscription=new SafeDisposable}invoke(e){this.callback.call(this.callbackThis,e)}}class Emitter$1{constructor(e){var t;this._disposed=!1,this._options=e,this._leakageMon=void 0,this._perfMon=(null===(t=this._options)||void 0===t?void 0:t._profName)?new EventProfiling(this._options._profName):void 0}dispose(){var e,t,n,i;this._disposed||(this._disposed=!0,this._listeners&&this._listeners.clear(),null===(e=this._deliveryQueue)||void 0===e||e.clear(),null===(n=null===(t=this._options)||void 0===t?void 0:t.onLastListenerRemove)||void 0===n||n.call(t),null===(i=this._leakageMon)||void 0===i||i.dispose())}get event(){return this._event||(this._event=(e,t,n)=>{var i,o,r;this._listeners||(this._listeners=new LinkedList);const s=this._listeners.isEmpty();let a,l;s&&(null===(i=this._options)||void 0===i?void 0:i.onFirstListenerAdd)&&this._options.onFirstListenerAdd(this),this._leakageMon&&this._listeners.size>=30&&(l=Stacktrace.create(),a=this._leakageMon.check(l,this._listeners.size+1));const c=new Listener(e,t,l),d=this._listeners.push(c);s&&(null===(o=this._options)||void 0===o?void 0:o.onFirstListenerDidAdd)&&this._options.onFirstListenerDidAdd(this),(null===(r=this._options)||void 0===r?void 0:r.onListenerDidAdd)&&this._options.onListenerDidAdd(this,e,t);const u=c.subscription.set((()=>{if(a&&a(),!this._disposed&&(d(),this._options&&this._options.onLastListenerRemove)){this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)}}));return n instanceof DisposableStore?n.add(u):Array.isArray(n)&&n.push(u),u}),this._event}fire(e){var t,n;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new LinkedList);for(let t of this._listeners)this._deliveryQueue.push([t,e]);for(null===(t=this._perfMon)||void 0===t||t.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[e,t]=this._deliveryQueue.shift();try{e.invoke(t)}catch(e2){onUnexpectedError(e2)}}null===(n=this._perfMon)||void 0===n||n.stop()}}}class PauseableEmitter extends Emitter$1{constructor(e){super(e),this._isPaused=0,this._eventQueue=new LinkedList,this._mergeFn=null==e?void 0:e.merge}pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}else for(;!this._isPaused&&0!==this._eventQueue.size;)super.fire(this._eventQueue.shift())}fire(e){this._listeners&&(0!==this._isPaused?this._eventQueue.push(e):super.fire(e))}}class DebounceEmitter extends PauseableEmitter{constructor(e){var t;super(e),this._delay=null!==(t=e.delay)&&void 0!==t?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout((()=>{this._handle=void 0,this.resume()}),this._delay)),super.fire(e)}}class EventBufferer{constructor(){this.buffers=[]}wrapEvent(e){return(t,n,i)=>e((e=>{const i=this.buffers[this.buffers.length-1];i?i.push((()=>t.call(n,e))):t.call(n,e)}),void 0,i)}bufferEvents(e){const t=[];this.buffers.push(t);const n=e();return this.buffers.pop(),t.forEach((e=>e())),n}}class Relay{constructor(){this.listening=!1,this.inputEvent=Event$1.None,this.inputEventListener=Disposable.None,this.emitter=new Emitter$1({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}class WindowManager{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}WindowManager.INSTANCE=new WindowManager;class DevicePixelRatioMonitor extends Disposable{constructor(){super(),this._onDidChange=this._register(new Emitter$1),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){this._mediaQueryList&&this._mediaQueryList.removeEventListener("change",this._listener),this._mediaQueryList=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class PixelRatioImpl extends Disposable{constructor(){super(),this._onDidChange=this._register(new Emitter$1),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new DevicePixelRatioMonitor);this._register(e.onDidChange((()=>{this._value=this._getPixelRatio(),this._onDidChange.fire(this._value)})))}get value(){return this._value}_getPixelRatio(){const e=document.createElement("canvas").getContext("2d");return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}}class PixelRatioFacade{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new PixelRatioImpl),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}}const PixelRatio=new PixelRatioFacade;function getZoomFactor(){return WindowManager.INSTANCE.getZoomFactor()}const userAgent=navigator.userAgent,isFirefox=userAgent.indexOf("Firefox")>=0,isWebKit=userAgent.indexOf("AppleWebKit")>=0,isChrome=userAgent.indexOf("Chrome")>=0,isSafari=!isChrome&&userAgent.indexOf("Safari")>=0,isWebkitWebView=!isChrome&&!isSafari&&isWebKit,isElectron=userAgent.indexOf("Electron/")>=0,isAndroid=userAgent.indexOf("Android")>=0,isStandalone=window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches;var browser=Object.freeze(Object.defineProperty({__proto__:null,PixelRatio:PixelRatio,getZoomFactor:getZoomFactor,isFirefox:isFirefox,isWebKit:isWebKit,isChrome:isChrome,isSafari:isSafari,isWebkitWebView:isWebkitWebView,isElectron:isElectron,isAndroid:isAndroid,isStandalone:isStandalone},Symbol.toStringTag,{value:"Module"}));function isArray(e){return Array.isArray(e)}function isString$1(e){return"string"==typeof e}function isObject(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof RegExp||e instanceof Date)}function isNumber$1(e){return"number"==typeof e&&!isNaN(e)}function isIterable(e){return!!e&&"function"==typeof e[Symbol.iterator]}function isBoolean(e){return!0===e||!1===e}function isUndefined(e){return void 0===e}function isDefined(e){return!isUndefinedOrNull(e)}function isUndefinedOrNull(e){return isUndefined(e)||null===e}function assertType(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function assertIsDefined(e){if(isUndefinedOrNull(e))throw new Error("Assertion Failed: argument is undefined or null");return e}function isFunction(e){return"function"==typeof e}function validateConstraints(e,t){const n=Math.min(e.length,t.length);for(let i=0;i<n;i++)validateConstraint(e[i],t[i])}function validateConstraint(e,t){if(isString$1(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(isFunction(t)){try{if(e instanceof t)return}catch(n){}if(!isUndefinedOrNull(e)&&e.constructor===t)return;if(1===t.length&&!0===t.call(void 0,e))return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function getAllPropertyNames(e){let t=[],n=Object.getPrototypeOf(e);for(;Object.prototype!==n;)t=t.concat(Object.getOwnPropertyNames(n)),n=Object.getPrototypeOf(n);return t}function getAllMethodNames(e){const t=[];for(const n of getAllPropertyNames(e))"function"==typeof e[n]&&t.push(n);return t}function createProxyObject$1(e,t){const n=e=>function(){const n=Array.prototype.slice.call(arguments,0);return t(e,n)};let i={};for(const o of e)i[o]=n(o);return i}function withNullAsUndefined(e){return null===e?void 0:e}function assertNever(e,t="Unreachable"){throw new Error(t)}const BrowserFeatures={clipboard:{writeText:isNative||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:isNative||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:isNative||isStandalone?0:navigator.keyboard||isSafari?1:2,touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};class KeyCodeStrMap{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const uiMap=new KeyCodeStrMap,userSettingsUSMap=new KeyCodeStrMap,userSettingsGeneralMap=new KeyCodeStrMap,EVENT_KEY_CODE_MAP=new Array(230),scanCodeStrToInt=Object.create(null),scanCodeLowerCaseStrToInt=Object.create(null),IMMUTABLE_CODE_TO_KEY_CODE=[];for(let C=0;C<=193;C++)IMMUTABLE_CODE_TO_KEY_CODE[C]=-1;var KeyCodeUtils,KeyCodeUtils2;function KeyChord(e,t){return(e|(65535&t)<<16>>>0)>>>0}function createKeybinding(e,t){if(0===e)return null;const n=(65535&e)>>>0,i=(4294901760&e)>>>16;return new ChordKeybinding(0!==i?[createSimpleKeybinding(n,t),createSimpleKeybinding(i,t)]:[createSimpleKeybinding(n,t)])}function createSimpleKeybinding(e,t){const n=!!(2048&e),i=!!(256&e);return new SimpleKeybinding(2===t?i:n,!!(1024&e),!!(512&e),2===t?n:i,255&e)}!function(){const e="",t=[[0,1,0,"None",0,"unknown",0,"VK_UNKNOWN",e,e],[0,1,1,"Hyper",0,e,0,e,e,e],[0,1,2,"Super",0,e,0,e,e,e],[0,1,3,"Fn",0,e,0,e,e,e],[0,1,4,"FnLock",0,e,0,e,e,e],[0,1,5,"Suspend",0,e,0,e,e,e],[0,1,6,"Resume",0,e,0,e,e,e],[0,1,7,"Turbo",0,e,0,e,e,e],[0,1,8,"Sleep",0,e,0,"VK_SLEEP",e,e],[0,1,9,"WakeUp",0,e,0,e,e,e],[31,0,10,"KeyA",31,"A",65,"VK_A",e,e],[32,0,11,"KeyB",32,"B",66,"VK_B",e,e],[33,0,12,"KeyC",33,"C",67,"VK_C",e,e],[34,0,13,"KeyD",34,"D",68,"VK_D",e,e],[35,0,14,"KeyE",35,"E",69,"VK_E",e,e],[36,0,15,"KeyF",36,"F",70,"VK_F",e,e],[37,0,16,"KeyG",37,"G",71,"VK_G",e,e],[38,0,17,"KeyH",38,"H",72,"VK_H",e,e],[39,0,18,"KeyI",39,"I",73,"VK_I",e,e],[40,0,19,"KeyJ",40,"J",74,"VK_J",e,e],[41,0,20,"KeyK",41,"K",75,"VK_K",e,e],[42,0,21,"KeyL",42,"L",76,"VK_L",e,e],[43,0,22,"KeyM",43,"M",77,"VK_M",e,e],[44,0,23,"KeyN",44,"N",78,"VK_N",e,e],[45,0,24,"KeyO",45,"O",79,"VK_O",e,e],[46,0,25,"KeyP",46,"P",80,"VK_P",e,e],[47,0,26,"KeyQ",47,"Q",81,"VK_Q",e,e],[48,0,27,"KeyR",48,"R",82,"VK_R",e,e],[49,0,28,"KeyS",49,"S",83,"VK_S",e,e],[50,0,29,"KeyT",50,"T",84,"VK_T",e,e],[51,0,30,"KeyU",51,"U",85,"VK_U",e,e],[52,0,31,"KeyV",52,"V",86,"VK_V",e,e],[53,0,32,"KeyW",53,"W",87,"VK_W",e,e],[54,0,33,"KeyX",54,"X",88,"VK_X",e,e],[55,0,34,"KeyY",55,"Y",89,"VK_Y",e,e],[56,0,35,"KeyZ",56,"Z",90,"VK_Z",e,e],[22,0,36,"Digit1",22,"1",49,"VK_1",e,e],[23,0,37,"Digit2",23,"2",50,"VK_2",e,e],[24,0,38,"Digit3",24,"3",51,"VK_3",e,e],[25,0,39,"Digit4",25,"4",52,"VK_4",e,e],[26,0,40,"Digit5",26,"5",53,"VK_5",e,e],[27,0,41,"Digit6",27,"6",54,"VK_6",e,e],[28,0,42,"Digit7",28,"7",55,"VK_7",e,e],[29,0,43,"Digit8",29,"8",56,"VK_8",e,e],[30,0,44,"Digit9",30,"9",57,"VK_9",e,e],[21,0,45,"Digit0",21,"0",48,"VK_0",e,e],[3,1,46,"Enter",3,"Enter",13,"VK_RETURN",e,e],[9,1,47,"Escape",9,"Escape",27,"VK_ESCAPE",e,e],[1,1,48,"Backspace",1,"Backspace",8,"VK_BACK",e,e],[2,1,49,"Tab",2,"Tab",9,"VK_TAB",e,e],[10,1,50,"Space",10,"Space",32,"VK_SPACE",e,e],[83,0,51,"Minus",83,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[81,0,52,"Equal",81,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[87,0,53,"BracketLeft",87,"[",219,"VK_OEM_4","[","OEM_4"],[89,0,54,"BracketRight",89,"]",221,"VK_OEM_6","]","OEM_6"],[88,0,55,"Backslash",88,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,0,56,"IntlHash",0,e,0,e,e,e],[80,0,57,"Semicolon",80,";",186,"VK_OEM_1",";","OEM_1"],[90,0,58,"Quote",90,"'",222,"VK_OEM_7","'","OEM_7"],[86,0,59,"Backquote",86,"`",192,"VK_OEM_3","`","OEM_3"],[82,0,60,"Comma",82,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[84,0,61,"Period",84,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[85,0,62,"Slash",85,"/",191,"VK_OEM_2","/","OEM_2"],[8,1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",e,e],[59,1,64,"F1",59,"F1",112,"VK_F1",e,e],[60,1,65,"F2",60,"F2",113,"VK_F2",e,e],[61,1,66,"F3",61,"F3",114,"VK_F3",e,e],[62,1,67,"F4",62,"F4",115,"VK_F4",e,e],[63,1,68,"F5",63,"F5",116,"VK_F5",e,e],[64,1,69,"F6",64,"F6",117,"VK_F6",e,e],[65,1,70,"F7",65,"F7",118,"VK_F7",e,e],[66,1,71,"F8",66,"F8",119,"VK_F8",e,e],[67,1,72,"F9",67,"F9",120,"VK_F9",e,e],[68,1,73,"F10",68,"F10",121,"VK_F10",e,e],[69,1,74,"F11",69,"F11",122,"VK_F11",e,e],[70,1,75,"F12",70,"F12",123,"VK_F12",e,e],[0,1,76,"PrintScreen",0,e,0,e,e,e],[79,1,77,"ScrollLock",79,"ScrollLock",145,"VK_SCROLL",e,e],[7,1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",e,e],[19,1,79,"Insert",19,"Insert",45,"VK_INSERT",e,e],[14,1,80,"Home",14,"Home",36,"VK_HOME",e,e],[11,1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",e,e],[20,1,82,"Delete",20,"Delete",46,"VK_DELETE",e,e],[13,1,83,"End",13,"End",35,"VK_END",e,e],[12,1,84,"PageDown",12,"PageDown",34,"VK_NEXT",e,e],[17,1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",e],[15,1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",e],[18,1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",e],[16,1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",e],[78,1,89,"NumLock",78,"NumLock",144,"VK_NUMLOCK",e,e],[108,1,90,"NumpadDivide",108,"NumPad_Divide",111,"VK_DIVIDE",e,e],[103,1,91,"NumpadMultiply",103,"NumPad_Multiply",106,"VK_MULTIPLY",e,e],[106,1,92,"NumpadSubtract",106,"NumPad_Subtract",109,"VK_SUBTRACT",e,e],[104,1,93,"NumpadAdd",104,"NumPad_Add",107,"VK_ADD",e,e],[3,1,94,"NumpadEnter",3,e,0,e,e,e],[94,1,95,"Numpad1",94,"NumPad1",97,"VK_NUMPAD1",e,e],[95,1,96,"Numpad2",95,"NumPad2",98,"VK_NUMPAD2",e,e],[96,1,97,"Numpad3",96,"NumPad3",99,"VK_NUMPAD3",e,e],[97,1,98,"Numpad4",97,"NumPad4",100,"VK_NUMPAD4",e,e],[98,1,99,"Numpad5",98,"NumPad5",101,"VK_NUMPAD5",e,e],[99,1,100,"Numpad6",99,"NumPad6",102,"VK_NUMPAD6",e,e],[100,1,101,"Numpad7",100,"NumPad7",103,"VK_NUMPAD7",e,e],[101,1,102,"Numpad8",101,"NumPad8",104,"VK_NUMPAD8",e,e],[102,1,103,"Numpad9",102,"NumPad9",105,"VK_NUMPAD9",e,e],[93,1,104,"Numpad0",93,"NumPad0",96,"VK_NUMPAD0",e,e],[107,1,105,"NumpadDecimal",107,"NumPad_Decimal",110,"VK_DECIMAL",e,e],[92,0,106,"IntlBackslash",92,"OEM_102",226,"VK_OEM_102",e,e],[58,1,107,"ContextMenu",58,"ContextMenu",93,e,e,e],[0,1,108,"Power",0,e,0,e,e,e],[0,1,109,"NumpadEqual",0,e,0,e,e,e],[71,1,110,"F13",71,"F13",124,"VK_F13",e,e],[72,1,111,"F14",72,"F14",125,"VK_F14",e,e],[73,1,112,"F15",73,"F15",126,"VK_F15",e,e],[74,1,113,"F16",74,"F16",127,"VK_F16",e,e],[75,1,114,"F17",75,"F17",128,"VK_F17",e,e],[76,1,115,"F18",76,"F18",129,"VK_F18",e,e],[77,1,116,"F19",77,"F19",130,"VK_F19",e,e],[0,1,117,"F20",0,e,0,"VK_F20",e,e],[0,1,118,"F21",0,e,0,"VK_F21",e,e],[0,1,119,"F22",0,e,0,"VK_F22",e,e],[0,1,120,"F23",0,e,0,"VK_F23",e,e],[0,1,121,"F24",0,e,0,"VK_F24",e,e],[0,1,122,"Open",0,e,0,e,e,e],[0,1,123,"Help",0,e,0,e,e,e],[0,1,124,"Select",0,e,0,e,e,e],[0,1,125,"Again",0,e,0,e,e,e],[0,1,126,"Undo",0,e,0,e,e,e],[0,1,127,"Cut",0,e,0,e,e,e],[0,1,128,"Copy",0,e,0,e,e,e],[0,1,129,"Paste",0,e,0,e,e,e],[0,1,130,"Find",0,e,0,e,e,e],[0,1,131,"AudioVolumeMute",112,"AudioVolumeMute",173,"VK_VOLUME_MUTE",e,e],[0,1,132,"AudioVolumeUp",113,"AudioVolumeUp",175,"VK_VOLUME_UP",e,e],[0,1,133,"AudioVolumeDown",114,"AudioVolumeDown",174,"VK_VOLUME_DOWN",e,e],[105,1,134,"NumpadComma",105,"NumPad_Separator",108,"VK_SEPARATOR",e,e],[110,0,135,"IntlRo",110,"ABNT_C1",193,"VK_ABNT_C1",e,e],[0,1,136,"KanaMode",0,e,0,e,e,e],[0,0,137,"IntlYen",0,e,0,e,e,e],[0,1,138,"Convert",0,e,0,e,e,e],[0,1,139,"NonConvert",0,e,0,e,e,e],[0,1,140,"Lang1",0,e,0,e,e,e],[0,1,141,"Lang2",0,e,0,e,e,e],[0,1,142,"Lang3",0,e,0,e,e,e],[0,1,143,"Lang4",0,e,0,e,e,e],[0,1,144,"Lang5",0,e,0,e,e,e],[0,1,145,"Abort",0,e,0,e,e,e],[0,1,146,"Props",0,e,0,e,e,e],[0,1,147,"NumpadParenLeft",0,e,0,e,e,e],[0,1,148,"NumpadParenRight",0,e,0,e,e,e],[0,1,149,"NumpadBackspace",0,e,0,e,e,e],[0,1,150,"NumpadMemoryStore",0,e,0,e,e,e],[0,1,151,"NumpadMemoryRecall",0,e,0,e,e,e],[0,1,152,"NumpadMemoryClear",0,e,0,e,e,e],[0,1,153,"NumpadMemoryAdd",0,e,0,e,e,e],[0,1,154,"NumpadMemorySubtract",0,e,0,e,e,e],[0,1,155,"NumpadClear",126,"Clear",12,"VK_CLEAR",e,e],[0,1,156,"NumpadClearEntry",0,e,0,e,e,e],[5,1,0,e,5,"Ctrl",17,"VK_CONTROL",e,e],[4,1,0,e,4,"Shift",16,"VK_SHIFT",e,e],[6,1,0,e,6,"Alt",18,"VK_MENU",e,e],[57,1,0,e,57,"Meta",0,"VK_COMMAND",e,e],[5,1,157,"ControlLeft",5,e,0,"VK_LCONTROL",e,e],[4,1,158,"ShiftLeft",4,e,0,"VK_LSHIFT",e,e],[6,1,159,"AltLeft",6,e,0,"VK_LMENU",e,e],[57,1,160,"MetaLeft",57,e,0,"VK_LWIN",e,e],[5,1,161,"ControlRight",5,e,0,"VK_RCONTROL",e,e],[4,1,162,"ShiftRight",4,e,0,"VK_RSHIFT",e,e],[6,1,163,"AltRight",6,e,0,"VK_RMENU",e,e],[57,1,164,"MetaRight",57,e,0,"VK_RWIN",e,e],[0,1,165,"BrightnessUp",0,e,0,e,e,e],[0,1,166,"BrightnessDown",0,e,0,e,e,e],[0,1,167,"MediaPlay",0,e,0,e,e,e],[0,1,168,"MediaRecord",0,e,0,e,e,e],[0,1,169,"MediaFastForward",0,e,0,e,e,e],[0,1,170,"MediaRewind",0,e,0,e,e,e],[114,1,171,"MediaTrackNext",119,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",e,e],[115,1,172,"MediaTrackPrevious",120,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",e,e],[116,1,173,"MediaStop",121,"MediaStop",178,"VK_MEDIA_STOP",e,e],[0,1,174,"Eject",0,e,0,e,e,e],[117,1,175,"MediaPlayPause",122,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",e,e],[0,1,176,"MediaSelect",123,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",e,e],[0,1,177,"LaunchMail",124,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",e,e],[0,1,178,"LaunchApp2",125,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",e,e],[0,1,179,"LaunchApp1",0,e,0,"VK_MEDIA_LAUNCH_APP1",e,e],[0,1,180,"SelectTask",0,e,0,e,e,e],[0,1,181,"LaunchScreenSaver",0,e,0,e,e,e],[0,1,182,"BrowserSearch",115,"BrowserSearch",170,"VK_BROWSER_SEARCH",e,e],[0,1,183,"BrowserHome",116,"BrowserHome",172,"VK_BROWSER_HOME",e,e],[112,1,184,"BrowserBack",117,"BrowserBack",166,"VK_BROWSER_BACK",e,e],[113,1,185,"BrowserForward",118,"BrowserForward",167,"VK_BROWSER_FORWARD",e,e],[0,1,186,"BrowserStop",0,e,0,"VK_BROWSER_STOP",e,e],[0,1,187,"BrowserRefresh",0,e,0,"VK_BROWSER_REFRESH",e,e],[0,1,188,"BrowserFavorites",0,e,0,"VK_BROWSER_FAVORITES",e,e],[0,1,189,"ZoomToggle",0,e,0,e,e,e],[0,1,190,"MailReply",0,e,0,e,e,e],[0,1,191,"MailForward",0,e,0,e,e,e],[0,1,192,"MailSend",0,e,0,e,e,e],[109,1,0,e,109,"KeyInComposition",229,e,e,e],[111,1,0,e,111,"ABNT_C2",194,"VK_ABNT_C2",e,e],[91,1,0,e,91,"OEM_8",223,"VK_OEM_8",e,e],[0,1,0,e,0,e,0,"VK_KANA",e,e],[0,1,0,e,0,e,0,"VK_HANGUL",e,e],[0,1,0,e,0,e,0,"VK_JUNJA",e,e],[0,1,0,e,0,e,0,"VK_FINAL",e,e],[0,1,0,e,0,e,0,"VK_HANJA",e,e],[0,1,0,e,0,e,0,"VK_KANJI",e,e],[0,1,0,e,0,e,0,"VK_CONVERT",e,e],[0,1,0,e,0,e,0,"VK_NONCONVERT",e,e],[0,1,0,e,0,e,0,"VK_ACCEPT",e,e],[0,1,0,e,0,e,0,"VK_MODECHANGE",e,e],[0,1,0,e,0,e,0,"VK_SELECT",e,e],[0,1,0,e,0,e,0,"VK_PRINT",e,e],[0,1,0,e,0,e,0,"VK_EXECUTE",e,e],[0,1,0,e,0,e,0,"VK_SNAPSHOT",e,e],[0,1,0,e,0,e,0,"VK_HELP",e,e],[0,1,0,e,0,e,0,"VK_APPS",e,e],[0,1,0,e,0,e,0,"VK_PROCESSKEY",e,e],[0,1,0,e,0,e,0,"VK_PACKET",e,e],[0,1,0,e,0,e,0,"VK_DBE_SBCSCHAR",e,e],[0,1,0,e,0,e,0,"VK_DBE_DBCSCHAR",e,e],[0,1,0,e,0,e,0,"VK_ATTN",e,e],[0,1,0,e,0,e,0,"VK_CRSEL",e,e],[0,1,0,e,0,e,0,"VK_EXSEL",e,e],[0,1,0,e,0,e,0,"VK_EREOF",e,e],[0,1,0,e,0,e,0,"VK_PLAY",e,e],[0,1,0,e,0,e,0,"VK_ZOOM",e,e],[0,1,0,e,0,e,0,"VK_NONAME",e,e],[0,1,0,e,0,e,0,"VK_PA1",e,e],[0,1,0,e,0,e,0,"VK_OEM_CLEAR",e,e]];let n=[],i=[];for(const o of t){const[e,t,r,s,a,l,c,d,u,h]=o;if(i[r]||(i[r]=!0,scanCodeStrToInt[s]=r,scanCodeLowerCaseStrToInt[s.toLowerCase()]=r,t&&(IMMUTABLE_CODE_TO_KEY_CODE[r]=a)),!n[a]){if(n[a]=!0,!l)throw new Error(`String representation missing for key code ${a} around scan code ${s}`);uiMap.define(a,l),userSettingsUSMap.define(a,u||l),userSettingsGeneralMap.define(a,h||u||l)}c&&(EVENT_KEY_CODE_MAP[c]=a)}}(),KeyCodeUtils2=KeyCodeUtils||(KeyCodeUtils={}),KeyCodeUtils2.toString=function(e){return uiMap.keyCodeToStr(e)},KeyCodeUtils2.fromString=function(e){return uiMap.strToKeyCode(e)},KeyCodeUtils2.toUserSettingsUS=function(e){return userSettingsUSMap.keyCodeToStr(e)},KeyCodeUtils2.toUserSettingsGeneral=function(e){return userSettingsGeneralMap.keyCodeToStr(e)},KeyCodeUtils2.fromUserSettings=function(e){return userSettingsUSMap.strToKeyCode(e)||userSettingsGeneralMap.strToKeyCode(e)},KeyCodeUtils2.toElectronAccelerator=function(e){if(e>=93&&e<=108)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return uiMap.keyCodeToStr(e)};class SimpleKeybinding{constructor(e,t,n,i,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=i,this.keyCode=o}equals(e){return this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode}toChord(){return new ChordKeybinding([this])}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}}class ChordKeybinding{constructor(e){if(0===e.length)throw illegalArgument("parts");this.parts=e}}class ResolvedKeybindingPart{constructor(e,t,n,i,o,r){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=i,this.keyLabel=o,this.keyAriaLabel=r}}class ResolvedKeybinding{}function extractKeyCode(e){if(e.charCode){let t=String.fromCharCode(e.charCode).toUpperCase();return KeyCodeUtils.fromString(t)}const t=e.keyCode;if(3===t)return 7;if(isFirefox){if(59===t)return 80;if(107===t)return 81;if(109===t)return 83;if(isMacintosh&&224===t)return 57}else if(isWebKit){if(91===t)return 57;if(isMacintosh&&93===t)return 57;if(!isMacintosh&&92===t)return 57}return EVENT_KEY_CODE_MAP[t]||0}const ctrlKeyMod$1=isMacintosh?256:2048,altKeyMod=512,shiftKeyMod=1024,metaKeyMod=isMacintosh?2048:256;class StandardKeyboardEvent{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.keyCode=extractKeyCode(t),this.code=t.code,this.ctrlKey=this.ctrlKey||5===this.keyCode,this.altKey=this.altKey||6===this.keyCode,this.shiftKey=this.shiftKey||4===this.keyCode,this.metaKey=this.metaKey||57===this.keyCode,this._asKeybinding=this._computeKeybinding(),this._asRuntimeKeybinding=this._computeRuntimeKeybinding()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeybinding(){return this._asRuntimeKeybinding}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=ctrlKeyMod$1),this.altKey&&(t|=altKeyMod),this.shiftKey&&(t|=shiftKeyMod),this.metaKey&&(t|=metaKeyMod),t|=e,t}_computeRuntimeKeybinding(){let e=0;return 5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode),new SimpleKeybinding(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let hasDifferentOriginAncestorFlag=!1,sameOriginWindowChainCache=null;function getParentWindowIfSameOrigin(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if("null"!==t.origin&&"null"!==n.origin&&t.origin!==n.origin)return hasDifferentOriginAncestorFlag=!0,null}catch(e2){return hasDifferentOriginAncestorFlag=!0,null}return e.parent}class IframeUtils{static getSameOriginWindowChain(){if(!sameOriginWindowChainCache){sameOriginWindowChainCache=[];let e,t=window;do{e=getParentWindowIfSameOrigin(t),e?sameOriginWindowChainCache.push({window:t,iframeElement:t.frameElement||null}):sameOriginWindowChainCache.push({window:t,iframeElement:null}),t=e}while(t)}return sameOriginWindowChainCache.slice(0)}static hasDifferentOriginAncestor(){return sameOriginWindowChainCache||this.getSameOriginWindowChain(),hasDifferentOriginAncestorFlag}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,i=0,o=this.getSameOriginWindowChain();for(const r of o){if(n+=r.window.scrollY,i+=r.window.scrollX,r.window===t)break;if(!r.iframeElement)break;let e=r.iframeElement.getBoundingClientRect();n+=e.top,i+=e.left}return{top:n,left:i}}}class StandardMouseEvent{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=0===e.button,this.middleButton=1===e.button,this.rightButton=2===e.button,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,"dblclick"===e.type&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,"number"==typeof e.pageX?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,this.posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop);let t=IframeUtils.getPositionOfChildWindowRelativeToAncestorWindow(self,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class StandardWheelEvent{constructor(e,t=0,n=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t,e){let t=e,n=e;if(void 0!==t.wheelDeltaY)this.deltaY=t.wheelDeltaY/120;else if(void 0!==n.VERTICAL_AXIS&&n.axis===n.VERTICAL_AXIS)this.deltaY=-n.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaY=isFirefox&&!isMacintosh?-e.deltaY/3:-e.deltaY:this.deltaY=-e.deltaY/40}if(void 0!==t.wheelDeltaX)this.deltaX=isSafari&&isWindows?-t.wheelDeltaX/120:t.wheelDeltaX/120;else if(void 0!==n.HORIZONTAL_AXIS&&n.axis===n.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaX=isFirefox&&!isMacintosh?-e.deltaX/3:-e.deltaX:this.deltaX=-e.deltaX/40}0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation()}}const shortcutEvent=Object.freeze((function(e,t){const n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}));var CancellationToken,CancellationToken2;CancellationToken2=CancellationToken||(CancellationToken={}),CancellationToken2.isCancellationToken=function(e){return e===CancellationToken2.None||e===CancellationToken2.Cancelled||e instanceof MutableToken||!(!e||"object"!=typeof e)&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},CancellationToken2.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Event$1.None}),CancellationToken2.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:shortcutEvent});class MutableToken{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?shortcutEvent:(this._emitter||(this._emitter=new Emitter$1),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class CancellationTokenSource$1{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new MutableToken),this._token}cancel(){this._token?this._token instanceof MutableToken&&this._token.cancel():this._token=CancellationToken.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof MutableToken&&this._token.dispose():this._token=CancellationToken.None}}var __awaiter$16=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},__asyncValues$2=globalThis&&globalThis.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise((function(i,o){(function(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)})(i,o,(t=e[n](t)).done,t.value)}))}}};function isThenable$1(e){return!!e&&"function"==typeof e.then}function createCancelablePromise(e){const t=new CancellationTokenSource$1,n=e(t.token),i=new Promise(((e,i)=>{const o=t.token.onCancellationRequested((()=>{o.dispose(),t.dispose(),i(new CancellationError)}));Promise.resolve(n).then((n=>{o.dispose(),t.dispose(),e(n)}),(e=>{o.dispose(),t.dispose(),i(e)}))}));return new class{cancel(){t.cancel()}then(e,t){return i.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return i.finally(e)}}}function raceCancellation(e,t,n){return new Promise(((i,o)=>{const r=t.onCancellationRequested((()=>{r.dispose(),i(n)}));e.then(i,o).finally((()=>r.dispose()))}))}class Throttler{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const e=()=>{this.queuedPromise=null;const e=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,e};this.queuedPromise=new Promise((t=>{this.activePromise.then(e,e).then(t)}))}return new Promise(((e,t)=>{this.queuedPromise.then(e,t)}))}return this.activePromise=e(),new Promise(((e,t)=>{this.activePromise.then((t=>{this.activePromise=null,e(t)}),(e=>{this.activePromise=null,t(e)}))}))}}const timeoutDeferred=(e,t)=>{let n=!0;const i=setTimeout((()=>{n=!1,t()}),e);return{isTriggered:()=>n,dispose:()=>{clearTimeout(i),n=!1}}},microtaskDeferred=e=>{let t=!0;return queueMicrotask((()=>{t&&(t=!1,e())})),{isTriggered:()=>t,dispose:()=>{t=!1}}},MicrotaskDelay=Symbol("MicrotaskDelay");class Delayer{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(((e,t)=>{this.doResolve=e,this.doReject=t})).then((()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const e=this.task;return this.task=null,e()}})));const n=()=>{var e;this.deferred=null,null===(e=this.doResolve)||void 0===e||e.call(this,null)};return this.deferred=t===MicrotaskDelay?microtaskDeferred(n):timeoutDeferred(t,n),this.completionPromise}isTriggered(){var e;return!!(null===(e=this.deferred)||void 0===e?void 0:e.isTriggered())}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject&&this.doReject(new CancellationError),this.completionPromise=null)}cancelTimeout(){var e;null===(e=this.deferred)||void 0===e||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class ThrottledDelayer{constructor(e){this.delayer=new Delayer(e),this.throttler=new Throttler}trigger(e,t){return this.delayer.trigger((()=>this.throttler.queue(e)),t)}dispose(){this.delayer.dispose()}}function timeout(e,t){return t?new Promise(((n,i)=>{const o=setTimeout((()=>{r.dispose(),n()}),e),r=t.onCancellationRequested((()=>{clearTimeout(o),r.dispose(),i(new CancellationError)}))})):createCancelablePromise((t=>timeout(e,t)))}function disposableTimeout(e,t=0){const n=setTimeout(e,t);return toDisposable((()=>clearTimeout(n)))}function first(e,t=(e=>!!e),n=null){let i=0;const o=e.length,r=()=>{if(i>=o)return Promise.resolve(n);const s=e[i++];return Promise.resolve(s()).then((e=>t(e)?Promise.resolve(e):r()))};return r()}class TimeoutTimer{constructor(e,t){this._token=-1,"function"==typeof e&&"number"==typeof t&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout((()=>{this._token=-1,e()}),t)}setIfNotSet(e,t){-1===this._token&&(this._token=setTimeout((()=>{this._token=-1,e()}),t))}}class IntervalTimer{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval((()=>{e()}),t)}}class RunOnceScheduler{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return-1!==this.timeoutToken}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner&&this.runner()}}let runWhenIdle;runWhenIdle="function"!=typeof requestIdleCallback||"function"!=typeof cancelIdleCallback?e=>{setTimeout0((()=>{if(t)return;const n=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining:()=>Math.max(0,n-Date.now())}))}));let t=!1;return{dispose(){t||(t=!0)}}}:(e,t)=>{const n=requestIdleCallback(e,"number"==typeof t?{timeout:t}:void 0);let i=!1;return{dispose(){i||(i=!0,cancelIdleCallback(n))}}};class IdleValue{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=runWhenIdle((()=>this._executor()))}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class DeferredPromise{constructor(){this.rejected=!1,this.resolved=!1,this.p=new Promise(((e,t)=>{this.completeCallback=e,this.errorCallback=t}))}get isRejected(){return this.rejected}get isSettled(){return this.rejected||this.resolved}complete(e){return new Promise((t=>{this.completeCallback(e),this.resolved=!0,t()}))}cancel(){new Promise((e=>{this.errorCallback(new CancellationError),this.rejected=!0,e()}))}}var Promises,Promises2;Promises2=Promises||(Promises={}),Promises2.settled=function(e){return __awaiter$16(this,void 0,void 0,(function*(){let t;const n=yield Promise.all(e.map((e=>e.then((e=>e),(e=>{t||(t=e)})))));if(void 0!==t)throw t;return n}))},Promises2.withAsyncBody=function(e){return new Promise(((t,n)=>__awaiter$16(this,void 0,void 0,(function*(){try{yield e(t,n)}catch(i){n(i)}}))))};class AsyncIterableObject{constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new Emitter$1,queueMicrotask((()=>__awaiter$16(this,void 0,void 0,(function*(){const t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{yield Promise.resolve(e(t)),this.resolve()}catch(n){this.reject(n)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))))}static fromArray(e){return new AsyncIterableObject((t=>{t.emitMany(e)}))}static fromPromise(e){return new AsyncIterableObject((t=>__awaiter$16(this,void 0,void 0,(function*(){t.emitMany(yield e)}))))}static fromPromises(e){return new AsyncIterableObject((t=>__awaiter$16(this,void 0,void 0,(function*(){yield Promise.all(e.map((e=>__awaiter$16(this,void 0,void 0,(function*(){return t.emitOne(yield e)})))))}))))}static merge(e){return new AsyncIterableObject((t=>__awaiter$16(this,void 0,void 0,(function*(){yield Promise.all(e.map((e=>{var n,i;return __awaiter$16(this,void 0,void 0,(function*(){var o,r;try{for(n=__asyncValues$2(e);!(i=yield n.next()).done;){const e=i.value;t.emitOne(e)}}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&(yield r.call(n))}finally{if(o)throw o.error}}}))})))}))))}[Symbol.asyncIterator](){let e=0;return{next:()=>__awaiter$16(this,void 0,void 0,(function*(){for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};yield Event$1.toPromise(this._onStateChanged.event)}}))}}static map(e,t){return new AsyncIterableObject((n=>__awaiter$16(this,void 0,void 0,(function*(){var i,o;try{for(var r,s=__asyncValues$2(e);!(r=yield s.next()).done;){const e=r.value;n.emitOne(t(e))}}catch(a){i={error:a}}finally{try{r&&!r.done&&(o=s.return)&&(yield o.call(s))}finally{if(i)throw i.error}}}))))}map(e){return AsyncIterableObject.map(this,e)}static filter(e,t){return new AsyncIterableObject((n=>__awaiter$16(this,void 0,void 0,(function*(){var i,o;try{for(var r,s=__asyncValues$2(e);!(r=yield s.next()).done;){const e=r.value;t(e)&&n.emitOne(e)}}catch(a){i={error:a}}finally{try{r&&!r.done&&(o=s.return)&&(yield o.call(s))}finally{if(i)throw i.error}}}))))}filter(e){return AsyncIterableObject.filter(this,e)}static coalesce(e){return AsyncIterableObject.filter(e,(e=>!!e))}coalesce(){return AsyncIterableObject.coalesce(this)}static toPromise(e){var t,n,i,o;return __awaiter$16(this,void 0,void 0,(function*(){const r=[];try{for(t=__asyncValues$2(e);!(n=yield t.next()).done;){const e=n.value;r.push(e)}}catch(s){i={error:s}}finally{try{n&&!n.done&&(o=t.return)&&(yield o.call(t))}finally{if(i)throw i.error}}return r}))}toPromise(){return AsyncIterableObject.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}}AsyncIterableObject.EMPTY=AsyncIterableObject.fromArray([]);class CancelableAsyncIterableObject extends AsyncIterableObject{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function createCancelableAsyncIterable(e){const t=new CancellationTokenSource$1,n=e(t.token);return new CancelableAsyncIterableObject(t,(e=>__awaiter$16(this,void 0,void 0,(function*(){var i,o;const r=t.token.onCancellationRequested((()=>{r.dispose(),t.dispose(),e.reject(new CancellationError)}));try{try{for(var s,a=__asyncValues$2(n);!(s=yield a.next()).done;){const n=s.value;if(t.token.isCancellationRequested)return;e.emitOne(n)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(o=a.return)&&(yield o.call(a))}finally{if(i)throw i.error}}r.dispose(),t.dispose()}catch(c){r.dispose(),t.dispose(),e.reject(c)}}))))}let safeProcess;if(void 0!==globals.vscode&&void 0!==globals.vscode.process){const e=globals.vscode.process;safeProcess={get platform(){return e.platform},get arch(){return e.arch},get env(){return e.env},cwd:()=>e.cwd()}}else safeProcess="undefined"!=typeof process?{get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd:()=>process.env.VSCODE_CWD||process.cwd()}:{get platform(){return isWindows?"win32":isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd:()=>"/"};const cwd=safeProcess.cwd,env=safeProcess.env,platform=safeProcess.platform,CHAR_UPPERCASE_A=65,CHAR_LOWERCASE_A=97,CHAR_UPPERCASE_Z=90,CHAR_LOWERCASE_Z=122,CHAR_DOT=46,CHAR_FORWARD_SLASH=47,CHAR_BACKWARD_SLASH=92,CHAR_COLON=58,CHAR_QUESTION_MARK=63;class ErrorInvalidArgType extends Error{constructor(e,t,n){let i;"string"==typeof t&&0===t.indexOf("not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be";const o=-1!==e.indexOf(".")?"property":"argument";let r=`The "${e}" ${o} ${i} of type ${t}`;r+=". Received type "+typeof n,super(r),this.code="ERR_INVALID_ARG_TYPE"}}function validateString(e,t){if("string"!=typeof e)throw new ErrorInvalidArgType(t,"string",e)}function isPathSeparator$1(e){return e===CHAR_FORWARD_SLASH||e===CHAR_BACKWARD_SLASH}function isPosixPathSeparator(e){return e===CHAR_FORWARD_SLASH}function isWindowsDeviceRoot(e){return e>=CHAR_UPPERCASE_A&&e<=CHAR_UPPERCASE_Z||e>=CHAR_LOWERCASE_A&&e<=CHAR_LOWERCASE_Z}function normalizeString(e,t,n,i){let o="",r=0,s=-1,a=0,l=0;for(let c=0;c<=e.length;++c){if(c<e.length)l=e.charCodeAt(c);else{if(i(l))break;l=CHAR_FORWARD_SLASH}if(i(l)){if(s===c-1||1===a);else if(2===a){if(o.length<2||2!==r||o.charCodeAt(o.length-1)!==CHAR_DOT||o.charCodeAt(o.length-2)!==CHAR_DOT){if(o.length>2){const e=o.lastIndexOf(n);-1===e?(o="",r=0):(o=o.slice(0,e),r=o.length-1-o.lastIndexOf(n)),s=c,a=0;continue}if(0!==o.length){o="",r=0,s=c,a=0;continue}}t&&(o+=o.length>0?`${n}..`:"..",r=2)}else o.length>0?o+=`${n}${e.slice(s+1,c)}`:o=e.slice(s+1,c),r=c-s-1;s=c,a=0}else l===CHAR_DOT&&-1!==a?++a:a=-1}return o}function _format(e,t){if(null===t||"object"!=typeof t)throw new ErrorInvalidArgType("pathObject","Object",t);const n=t.dir||t.root,i=t.base||`${t.name||""}${t.ext||""}`;return n?n===t.root?`${n}${i}`:`${n}${e}${i}`:i}const win32={resolve(...e){let t="",n="",i=!1;for(let o=e.length-1;o>=-1;o--){let r;if(o>=0){if(r=e[o],validateString(r,"path"),0===r.length)continue}else 0===t.length?r=cwd():(r=env[`=${t}`]||cwd(),(void 0===r||r.slice(0,2).toLowerCase()!==t.toLowerCase()&&r.charCodeAt(2)===CHAR_BACKWARD_SLASH)&&(r=`${t}\\`));const s=r.length;let a=0,l="",c=!1;const d=r.charCodeAt(0);if(1===s)isPathSeparator$1(d)&&(a=1,c=!0);else if(isPathSeparator$1(d))if(c=!0,isPathSeparator$1(r.charCodeAt(1))){let e=2,t=e;for(;e<s&&!isPathSeparator$1(r.charCodeAt(e));)e++;if(e<s&&e!==t){const n=r.slice(t,e);for(t=e;e<s&&isPathSeparator$1(r.charCodeAt(e));)e++;if(e<s&&e!==t){for(t=e;e<s&&!isPathSeparator$1(r.charCodeAt(e));)e++;e!==s&&e===t||(l=`\\\\${n}\\${r.slice(t,e)}`,a=e)}}}else a=1;else isWindowsDeviceRoot(d)&&r.charCodeAt(1)===CHAR_COLON&&(l=r.slice(0,2),a=2,s>2&&isPathSeparator$1(r.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(t.length>0){if(l.toLowerCase()!==t.toLowerCase())continue}else t=l;if(i){if(t.length>0)break}else if(n=`${r.slice(a)}\\${n}`,i=c,c&&t.length>0)break}return n=normalizeString(n,!i,"\\",isPathSeparator$1),i?`${t}\\${n}`:`${t}${n}`||"."},normalize(e){validateString(e,"path");const t=e.length;if(0===t)return".";let n,i=0,o=!1;const r=e.charCodeAt(0);if(1===t)return isPosixPathSeparator(r)?"\\":e;if(isPathSeparator$1(r))if(o=!0,isPathSeparator$1(e.charCodeAt(1))){let o=2,r=o;for(;o<t&&!isPathSeparator$1(e.charCodeAt(o));)o++;if(o<t&&o!==r){const s=e.slice(r,o);for(r=o;o<t&&isPathSeparator$1(e.charCodeAt(o));)o++;if(o<t&&o!==r){for(r=o;o<t&&!isPathSeparator$1(e.charCodeAt(o));)o++;if(o===t)return`\\\\${s}\\${e.slice(r)}\\`;o!==r&&(n=`\\\\${s}\\${e.slice(r,o)}`,i=o)}}}else i=1;else isWindowsDeviceRoot(r)&&e.charCodeAt(1)===CHAR_COLON&&(n=e.slice(0,2),i=2,t>2&&isPathSeparator$1(e.charCodeAt(2))&&(o=!0,i=3));let s=i<t?normalizeString(e.slice(i),!o,"\\",isPathSeparator$1):"";return 0!==s.length||o||(s="."),s.length>0&&isPathSeparator$1(e.charCodeAt(t-1))&&(s+="\\"),void 0===n?o?`\\${s}`:s:o?`${n}\\${s}`:`${n}${s}`},isAbsolute(e){validateString(e,"path");const t=e.length;if(0===t)return!1;const n=e.charCodeAt(0);return isPathSeparator$1(n)||t>2&&isWindowsDeviceRoot(n)&&e.charCodeAt(1)===CHAR_COLON&&isPathSeparator$1(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let t,n;for(let r=0;r<e.length;++r){const i=e[r];validateString(i,"path"),i.length>0&&(void 0===t?t=n=i:t+=`\\${i}`)}if(void 0===t)return".";let i=!0,o=0;if("string"==typeof n&&isPathSeparator$1(n.charCodeAt(0))){++o;const e=n.length;e>1&&isPathSeparator$1(n.charCodeAt(1))&&(++o,e>2&&(isPathSeparator$1(n.charCodeAt(2))?++o:i=!1))}if(i){for(;o<t.length&&isPathSeparator$1(t.charCodeAt(o));)o++;o>=2&&(t=`\\${t.slice(o)}`)}return win32.normalize(t)},relative(e,t){if(validateString(e,"from"),validateString(t,"to"),e===t)return"";const n=win32.resolve(e),i=win32.resolve(t);if(n===i)return"";if((e=n.toLowerCase())===(t=i.toLowerCase()))return"";let o=0;for(;o<e.length&&e.charCodeAt(o)===CHAR_BACKWARD_SLASH;)o++;let r=e.length;for(;r-1>o&&e.charCodeAt(r-1)===CHAR_BACKWARD_SLASH;)r--;const s=r-o;let a=0;for(;a<t.length&&t.charCodeAt(a)===CHAR_BACKWARD_SLASH;)a++;let l=t.length;for(;l-1>a&&t.charCodeAt(l-1)===CHAR_BACKWARD_SLASH;)l--;const c=l-a,d=s<c?s:c;let u=-1,h=0;for(;h<d;h++){const n=e.charCodeAt(o+h);if(n!==t.charCodeAt(a+h))break;n===CHAR_BACKWARD_SLASH&&(u=h)}if(h!==d){if(-1===u)return i}else{if(c>d){if(t.charCodeAt(a+h)===CHAR_BACKWARD_SLASH)return i.slice(a+h+1);if(2===h)return i.slice(a+h)}s>d&&(e.charCodeAt(o+h)===CHAR_BACKWARD_SLASH?u=h:2===h&&(u=3)),-1===u&&(u=0)}let g="";for(h=o+u+1;h<=r;++h)h!==r&&e.charCodeAt(h)!==CHAR_BACKWARD_SLASH||(g+=0===g.length?"..":"\\..");return a+=u,g.length>0?`${g}${i.slice(a,l)}`:(i.charCodeAt(a)===CHAR_BACKWARD_SLASH&&++a,i.slice(a,l))},toNamespacedPath(e){if("string"!=typeof e)return e;if(0===e.length)return"";const t=win32.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===CHAR_BACKWARD_SLASH){if(t.charCodeAt(1)===CHAR_BACKWARD_SLASH){const e=t.charCodeAt(2);if(e!==CHAR_QUESTION_MARK&&e!==CHAR_DOT)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(isWindowsDeviceRoot(t.charCodeAt(0))&&t.charCodeAt(1)===CHAR_COLON&&t.charCodeAt(2)===CHAR_BACKWARD_SLASH)return`\\\\?\\${t}`;return e},dirname(e){validateString(e,"path");const t=e.length;if(0===t)return".";let n=-1,i=0;const o=e.charCodeAt(0);if(1===t)return isPathSeparator$1(o)?e:".";if(isPathSeparator$1(o)){if(n=i=1,isPathSeparator$1(e.charCodeAt(1))){let o=2,r=o;for(;o<t&&!isPathSeparator$1(e.charCodeAt(o));)o++;if(o<t&&o!==r){for(r=o;o<t&&isPathSeparator$1(e.charCodeAt(o));)o++;if(o<t&&o!==r){for(r=o;o<t&&!isPathSeparator$1(e.charCodeAt(o));)o++;if(o===t)return e;o!==r&&(n=i=o+1)}}}}else isWindowsDeviceRoot(o)&&e.charCodeAt(1)===CHAR_COLON&&(n=t>2&&isPathSeparator$1(e.charCodeAt(2))?3:2,i=n);let r=-1,s=!0;for(let a=t-1;a>=i;--a)if(isPathSeparator$1(e.charCodeAt(a))){if(!s){r=a;break}}else s=!1;if(-1===r){if(-1===n)return".";r=n}return e.slice(0,r)},basename(e,t){void 0!==t&&validateString(t,"ext"),validateString(e,"path");let n,i=0,o=-1,r=!0;if(e.length>=2&&isWindowsDeviceRoot(e.charCodeAt(0))&&e.charCodeAt(1)===CHAR_COLON&&(i=2),void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let s=t.length-1,a=-1;for(n=e.length-1;n>=i;--n){const l=e.charCodeAt(n);if(isPathSeparator$1(l)){if(!r){i=n+1;break}}else-1===a&&(r=!1,a=n+1),s>=0&&(l===t.charCodeAt(s)?-1==--s&&(o=n):(s=-1,o=a))}return i===o?o=a:-1===o&&(o=e.length),e.slice(i,o)}for(n=e.length-1;n>=i;--n)if(isPathSeparator$1(e.charCodeAt(n))){if(!r){i=n+1;break}}else-1===o&&(r=!1,o=n+1);return-1===o?"":e.slice(i,o)},extname(e){validateString(e,"path");let t=0,n=-1,i=0,o=-1,r=!0,s=0;e.length>=2&&e.charCodeAt(1)===CHAR_COLON&&isWindowsDeviceRoot(e.charCodeAt(0))&&(t=i=2);for(let a=e.length-1;a>=t;--a){const t=e.charCodeAt(a);if(isPathSeparator$1(t)){if(!r){i=a+1;break}}else-1===o&&(r=!1,o=a+1),t===CHAR_DOT?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1)}return-1===n||-1===o||0===s||1===s&&n===o-1&&n===i+1?"":e.slice(n,o)},format:_format.bind(null,"\\"),parse(e){validateString(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const n=e.length;let i=0,o=e.charCodeAt(0);if(1===n)return isPathSeparator$1(o)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(isPathSeparator$1(o)){if(i=1,isPathSeparator$1(e.charCodeAt(1))){let t=2,o=t;for(;t<n&&!isPathSeparator$1(e.charCodeAt(t));)t++;if(t<n&&t!==o){for(o=t;t<n&&isPathSeparator$1(e.charCodeAt(t));)t++;if(t<n&&t!==o){for(o=t;t<n&&!isPathSeparator$1(e.charCodeAt(t));)t++;t===n?i=t:t!==o&&(i=t+1)}}}}else if(isWindowsDeviceRoot(o)&&e.charCodeAt(1)===CHAR_COLON){if(n<=2)return t.root=t.dir=e,t;if(i=2,isPathSeparator$1(e.charCodeAt(2))){if(3===n)return t.root=t.dir=e,t;i=3}}i>0&&(t.root=e.slice(0,i));let r=-1,s=i,a=-1,l=!0,c=e.length-1,d=0;for(;c>=i;--c)if(o=e.charCodeAt(c),isPathSeparator$1(o)){if(!l){s=c+1;break}}else-1===a&&(l=!1,a=c+1),o===CHAR_DOT?-1===r?r=c:1!==d&&(d=1):-1!==r&&(d=-1);return-1!==a&&(-1===r||0===d||1===d&&r===a-1&&r===s+1?t.base=t.name=e.slice(s,a):(t.name=e.slice(s,r),t.base=e.slice(s,a),t.ext=e.slice(r,a))),t.dir=s>0&&s!==i?e.slice(0,s-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},posix={resolve(...e){let t="",n=!1;for(let i=e.length-1;i>=-1&&!n;i--){const o=i>=0?e[i]:cwd();validateString(o,"path"),0!==o.length&&(t=`${o}/${t}`,n=o.charCodeAt(0)===CHAR_FORWARD_SLASH)}return t=normalizeString(t,!n,"/",isPosixPathSeparator),n?`/${t}`:t.length>0?t:"."},normalize(e){if(validateString(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===CHAR_FORWARD_SLASH,n=e.charCodeAt(e.length-1)===CHAR_FORWARD_SLASH;return 0===(e=normalizeString(e,!t,"/",isPosixPathSeparator)).length?t?"/":n?"./":".":(n&&(e+="/"),t?`/${e}`:e)},isAbsolute:e=>(validateString(e,"path"),e.length>0&&e.charCodeAt(0)===CHAR_FORWARD_SLASH),join(...e){if(0===e.length)return".";let t;for(let n=0;n<e.length;++n){const i=e[n];validateString(i,"path"),i.length>0&&(void 0===t?t=i:t+=`/${i}`)}return void 0===t?".":posix.normalize(t)},relative(e,t){if(validateString(e,"from"),validateString(t,"to"),e===t)return"";if((e=posix.resolve(e))===(t=posix.resolve(t)))return"";const n=e.length,i=n-1,o=t.length-1,r=i<o?i:o;let s=-1,a=0;for(;a<r;a++){const n=e.charCodeAt(1+a);if(n!==t.charCodeAt(1+a))break;n===CHAR_FORWARD_SLASH&&(s=a)}if(a===r)if(o>r){if(t.charCodeAt(1+a)===CHAR_FORWARD_SLASH)return t.slice(1+a+1);if(0===a)return t.slice(1+a)}else i>r&&(e.charCodeAt(1+a)===CHAR_FORWARD_SLASH?s=a:0===a&&(s=0));let l="";for(a=1+s+1;a<=n;++a)a!==n&&e.charCodeAt(a)!==CHAR_FORWARD_SLASH||(l+=0===l.length?"..":"/..");return`${l}${t.slice(1+s)}`},toNamespacedPath:e=>e,dirname(e){if(validateString(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===CHAR_FORWARD_SLASH;let n=-1,i=!0;for(let o=e.length-1;o>=1;--o)if(e.charCodeAt(o)===CHAR_FORWARD_SLASH){if(!i){n=o;break}}else i=!1;return-1===n?t?"/":".":t&&1===n?"//":e.slice(0,n)},basename(e,t){void 0!==t&&validateString(t,"ext"),validateString(e,"path");let n,i=0,o=-1,r=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let s=t.length-1,a=-1;for(n=e.length-1;n>=0;--n){const l=e.charCodeAt(n);if(l===CHAR_FORWARD_SLASH){if(!r){i=n+1;break}}else-1===a&&(r=!1,a=n+1),s>=0&&(l===t.charCodeAt(s)?-1==--s&&(o=n):(s=-1,o=a))}return i===o?o=a:-1===o&&(o=e.length),e.slice(i,o)}for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===CHAR_FORWARD_SLASH){if(!r){i=n+1;break}}else-1===o&&(r=!1,o=n+1);return-1===o?"":e.slice(i,o)},extname(e){validateString(e,"path");let t=-1,n=0,i=-1,o=!0,r=0;for(let s=e.length-1;s>=0;--s){const a=e.charCodeAt(s);if(a!==CHAR_FORWARD_SLASH)-1===i&&(o=!1,i=s+1),a===CHAR_DOT?-1===t?t=s:1!==r&&(r=1):-1!==t&&(r=-1);else if(!o){n=s+1;break}}return-1===t||-1===i||0===r||1===r&&t===i-1&&t===n+1?"":e.slice(t,i)},format:_format.bind(null,"/"),parse(e){validateString(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const n=e.charCodeAt(0)===CHAR_FORWARD_SLASH;let i;n?(t.root="/",i=1):i=0;let o=-1,r=0,s=-1,a=!0,l=e.length-1,c=0;for(;l>=i;--l){const t=e.charCodeAt(l);if(t!==CHAR_FORWARD_SLASH)-1===s&&(a=!1,s=l+1),t===CHAR_DOT?-1===o?o=l:1!==c&&(c=1):-1!==o&&(c=-1);else if(!a){r=l+1;break}}if(-1!==s){const i=0===r&&n?1:r;-1===o||0===c||1===c&&o===s-1&&o===r+1?t.base=t.name=e.slice(i,s):(t.name=e.slice(i,o),t.base=e.slice(i,s),t.ext=e.slice(o,s))}return r>0?t.dir=e.slice(0,r-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};posix.win32=win32.win32=win32,posix.posix=win32.posix=posix;const normalize="win32"===platform?win32.normalize:posix.normalize,resolve="win32"===platform?win32.resolve:posix.resolve,relative="win32"===platform?win32.relative:posix.relative,dirname$1="win32"===platform?win32.dirname:posix.dirname,basename$1="win32"===platform?win32.basename:posix.basename,extname$1="win32"===platform?win32.extname:posix.extname,sep="win32"===platform?win32.sep:posix.sep,_schemePattern=/^\w[\w\d+.-]*$/,_singleSlashStart=/^\//,_doubleSlashStart=/^\/\//;function _validateUri(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!_schemePattern.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!_singleSlashStart.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(_doubleSlashStart.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}function _schemeFix(e,t){return e||t?e:"file"}function _referenceResolution(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==_slash&&(t=_slash+t):t=_slash}return t}const _empty="",_slash="/",_regexp=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class URI{constructor(e,t,n,i,o,r=!1){"object"==typeof e?(this.scheme=e.scheme||_empty,this.authority=e.authority||_empty,this.path=e.path||_empty,this.query=e.query||_empty,this.fragment=e.fragment||_empty):(this.scheme=_schemeFix(e,r),this.authority=t||_empty,this.path=_referenceResolution(this.scheme,n||_empty),this.query=i||_empty,this.fragment=o||_empty,_validateUri(this,r))}static isUri(e){return e instanceof URI||!!e&&("string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString)}get fsPath(){return uriToFsPath(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:i,query:o,fragment:r}=e;return void 0===t?t=this.scheme:null===t&&(t=_empty),void 0===n?n=this.authority:null===n&&(n=_empty),void 0===i?i=this.path:null===i&&(i=_empty),void 0===o?o=this.query:null===o&&(o=_empty),void 0===r?r=this.fragment:null===r&&(r=_empty),t===this.scheme&&n===this.authority&&i===this.path&&o===this.query&&r===this.fragment?this:new Uri$1(t,n,i,o,r)}static parse(e,t=!1){const n=_regexp.exec(e);return n?new Uri$1(n[2]||_empty,percentDecode(n[4]||_empty),percentDecode(n[5]||_empty),percentDecode(n[7]||_empty),percentDecode(n[9]||_empty),t):new Uri$1(_empty,_empty,_empty,_empty,_empty)}static file(e){let t=_empty;if(isWindows&&(e=e.replace(/\\/g,_slash)),e[0]===_slash&&e[1]===_slash){const n=e.indexOf(_slash,2);-1===n?(t=e.substring(2),e=_slash):(t=e.substring(2,n),e=e.substring(n)||_slash)}return new Uri$1("file",t,e,_empty,_empty)}static from(e){const t=new Uri$1(e.scheme,e.authority,e.path,e.query,e.fragment);return _validateUri(t,!0),t}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let n;return n=isWindows&&"file"===e.scheme?URI.file(win32.join(uriToFsPath(e,!0),...t)).path:posix.join(e.path,...t),e.with({path:n})}toString(e=!1){return _asFormatted(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof URI)return e;{const t=new Uri$1(e);return t._formatted=e.external,t._fsPath=e._sep===_pathSepMarker?e.fsPath:null,t}}return e}}const _pathSepMarker=isWindows?1:void 0;class Uri$1 extends URI{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=uriToFsPath(this,!1)),this._fsPath}toString(e=!1){return e?_asFormatted(this,!0):(this._formatted||(this._formatted=_asFormatted(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=_pathSepMarker),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const encodeTable={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function encodeURIComponentFast(e,t){let n,i=-1;for(let o=0;o<e.length;o++){const r=e.charCodeAt(o);if(r>=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||45===r||46===r||95===r||126===r||t&&47===r)-1!==i&&(n+=encodeURIComponent(e.substring(i,o)),i=-1),void 0!==n&&(n+=e.charAt(o));else{void 0===n&&(n=e.substr(0,o));const t=encodeTable[r];void 0!==t?(-1!==i&&(n+=encodeURIComponent(e.substring(i,o)),i=-1),n+=t):-1===i&&(i=o)}}return-1!==i&&(n+=encodeURIComponent(e.substring(i))),void 0!==n?n:e}function encodeURIComponentMinimal(e){let t;for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);35===i||63===i?(void 0===t&&(t=e.substr(0,n)),t+=encodeTable[i]):void 0!==t&&(t+=e[n])}return void 0!==t?t:e}function uriToFsPath(e,t){let n;return n=e.authority&&e.path.length>1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,isWindows&&(n=n.replace(/\//g,"\\")),n}function _asFormatted(e,t){const n=t?encodeURIComponentMinimal:encodeURIComponentFast;let i="",{scheme:o,authority:r,path:s,query:a,fragment:l}=e;if(o&&(i+=o,i+=":"),(r||"file"===o)&&(i+=_slash,i+=_slash),r){let e=r.indexOf("@");if(-1!==e){const t=r.substr(0,e);r=r.substr(e+1),e=t.indexOf(":"),-1===e?i+=n(t,!1):(i+=n(t.substr(0,e),!1),i+=":",i+=n(t.substr(e+1),!1)),i+="@"}r=r.toLowerCase(),e=r.indexOf(":"),-1===e?i+=n(r,!1):(i+=n(r.substr(0,e),!1),i+=r.substr(e))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2)){const e=s.charCodeAt(1);e>=65&&e<=90&&(s=`/${String.fromCharCode(e+32)}:${s.substr(3)}`)}else if(s.length>=2&&58===s.charCodeAt(1)){const e=s.charCodeAt(0);e>=65&&e<=90&&(s=`${String.fromCharCode(e+32)}:${s.substr(2)}`)}i+=n(s,!0)}return a&&(i+="?",i+=n(a,!1)),l&&(i+="#",i+=t?l:encodeURIComponentFast(l,!1)),i}function decodeURIComponentGraceful(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+decodeURIComponentGraceful(e.substr(3)):e}}const _rEncodedAsHex=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function percentDecode(e){return e.match(_rEncodedAsHex)?e.replace(_rEncodedAsHex,(e=>decodeURIComponentGraceful(e))):e}var Schemas,Schemas2;Schemas2=Schemas||(Schemas={}),Schemas2.inMemory="inmemory",Schemas2.vscode="vscode",Schemas2.internal="private",Schemas2.walkThrough="walkThrough",Schemas2.walkThroughSnippet="walkThroughSnippet",Schemas2.http="http",Schemas2.https="https",Schemas2.file="file",Schemas2.mailto="mailto",Schemas2.untitled="untitled",Schemas2.data="data",Schemas2.command="command",Schemas2.vscodeRemote="vscode-remote",Schemas2.vscodeRemoteResource="vscode-remote-resource",Schemas2.userData="vscode-userdata",Schemas2.vscodeCustomEditor="vscode-custom-editor",Schemas2.vscodeNotebook="vscode-notebook",Schemas2.vscodeNotebookCell="vscode-notebook-cell",Schemas2.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",Schemas2.vscodeNotebookCellOutput="vscode-notebook-cell-output",Schemas2.vscodeInteractive="vscode-interactive",Schemas2.vscodeInteractiveInput="vscode-interactive-input",Schemas2.vscodeSettings="vscode-settings",Schemas2.vscodeWorkspaceTrust="vscode-workspace-trust",Schemas2.vscodeTerminal="vscode-terminal",Schemas2.webviewPanel="webview-panel",Schemas2.vscodeWebview="vscode-webview",Schemas2.extension="extension",Schemas2.vscodeFileResource="vscode-file",Schemas2.tmp="tmp",Schemas2.vsls="vsls";const connectionTokenQueryName="tkn";class RemoteAuthoritiesImpl{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)return this._delegate(e);const t=e.authority;let n=this._hosts[t];n&&-1!==n.indexOf(":")&&(n=`[${n}]`);const i=this._ports[t],o=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return"string"==typeof o&&(r+=`&${connectionTokenQueryName}=${encodeURIComponent(o)}`),URI.from({scheme:isWeb?this._preferredWebSchema:Schemas.vscodeRemoteResource,authority:`${n}:${i}`,path:"/vscode-remote-resource",query:r})}}const RemoteAuthorities=new RemoteAuthoritiesImpl;class FileAccessImpl{asBrowserUri(e,t){const n=this.toUri(e,t);return n.scheme===Schemas.vscodeRemote?RemoteAuthorities.rewrite(n):n.scheme===Schemas.file&&(isNative||isWebWorker&&globals.origin===`${Schemas.vscodeFileResource}://${FileAccessImpl.FALLBACK_AUTHORITY}`)?n.with({scheme:Schemas.vscodeFileResource,authority:n.authority||FileAccessImpl.FALLBACK_AUTHORITY,query:null,fragment:null}):n}toUri(e,t){return URI.isUri(e)?e:URI.parse(t.toUrl(e))}}FileAccessImpl.FALLBACK_AUTHORITY="vscode-app";const FileAccess=new FileAccessImpl;function clearNode(e){for(;e.firstChild;)e.firstChild.remove()}function isInDOM(e){var t;return null!==(t=null==e?void 0:e.isConnected)&&void 0!==t&&t}class DomListener{constructor(e,t,n,i){this._node=e,this._type=t,this._handler=n,this._options=i||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function addDisposableListener(e,t,n,i){return new DomListener(e,t,n,i)}function _wrapAsStandardMouseEvent(e){return function(t){return e(new StandardMouseEvent(t))}}function _wrapAsStandardKeyboardEvent(e){return function(t){return e(new StandardKeyboardEvent(t))}}let addStandardDisposableListener=function(e,t,n,i){let o=n;return"click"===t||"mousedown"===t?o=_wrapAsStandardMouseEvent(n):"keydown"!==t&&"keypress"!==t&&"keyup"!==t||(o=_wrapAsStandardKeyboardEvent(n)),addDisposableListener(e,t,o,i)},addStandardDisposableGenericMouseDownListener=function(e,t,n){return addDisposableGenericMouseDownListener(e,_wrapAsStandardMouseEvent(t),n)};function addDisposableGenericMouseDownListener(e,t,n){return addDisposableListener(e,isIOS&&BrowserFeatures.pointerEvents?EventType$1.POINTER_DOWN:EventType$1.MOUSE_DOWN,t,n)}function addDisposableGenericMouseUpListener(e,t,n){return addDisposableListener(e,isIOS&&BrowserFeatures.pointerEvents?EventType$1.POINTER_UP:EventType$1.MOUSE_UP,t,n)}function addDisposableNonBubblingMouseOutListener(e,t){return addDisposableListener(e,"mouseout",(n=>{let i=n.relatedTarget;for(;i&&i!==e;)i=i.parentNode;i!==e&&t(n)}))}function addDisposableNonBubblingPointerOutListener(e,t){return addDisposableListener(e,"pointerout",(n=>{let i=n.relatedTarget;for(;i&&i!==e;)i=i.parentNode;i!==e&&t(n)}))}function createEventEmitter(e,t,n){let i=null;const o=e=>r.fire(e),r=new Emitter$1({onFirstListenerAdd:()=>{i||(i=new DomListener(e,t,o,n))},onLastListenerRemove:()=>{i&&(i.dispose(),i=null)}});return r}let _animationFrame=null,runAtThisOrScheduleAtNextAnimationFrame,scheduleAtNextAnimationFrame;function doRequestAnimationFrame(e){if(!_animationFrame){const e=e=>setTimeout((()=>e((new Date).getTime())),0);_animationFrame=self.requestAnimationFrame||self.msRequestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame||self.oRequestAnimationFrame||e}return _animationFrame.call(self,e)}class AnimationFrameQueueItem{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e2){onUnexpectedError(e2)}}static sort(e,t){return t.priority-e.priority}}!function(){let e=[],t=null,n=!1,i=!1,o=()=>{for(n=!1,t=e,e=[],i=!0;t.length>0;){t.sort(AnimationFrameQueueItem.sort),t.shift().execute()}i=!1};scheduleAtNextAnimationFrame=(t,i=0)=>{let r=new AnimationFrameQueueItem(t,i);return e.push(r),n||(n=!0,doRequestAnimationFrame(o)),r},runAtThisOrScheduleAtNextAnimationFrame=(e,n)=>{if(i){let i=new AnimationFrameQueueItem(e,n);return t.push(i),i}return scheduleAtNextAnimationFrame(e,n)}}();const MINIMUM_TIME_MS=8,DEFAULT_EVENT_MERGER=function(e,t){return t};class TimeoutThrottledDomListener extends Disposable{constructor(e,t,n,i=DEFAULT_EVENT_MERGER,o=MINIMUM_TIME_MS){super();let r=null,s=0,a=this._register(new TimeoutTimer),l=()=>{s=(new Date).getTime(),n(r),r=null};this._register(addDisposableListener(e,t,(e=>{r=i(r,e);let t=(new Date).getTime()-s;t>=o?(a.cancel(),l()):a.setIfNotSet(l,o-t)})))}}function addDisposableThrottledListener(e,t,n,i,o){return new TimeoutThrottledDomListener(e,t,n,i,o)}function getComputedStyle$1(e){return document.defaultView.getComputedStyle(e,null)}function getClientArea(e){if(e!==document.body)return new Dimension(e.clientWidth,e.clientHeight);if(isIOS&&window.visualViewport)return new Dimension(window.visualViewport.width,window.visualViewport.height);if(window.innerWidth&&window.innerHeight)return new Dimension(window.innerWidth,window.innerHeight);if(document.body&&document.body.clientWidth&&document.body.clientHeight)return new Dimension(document.body.clientWidth,document.body.clientHeight);if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientHeight)return new Dimension(document.documentElement.clientWidth,document.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class SizeUtils{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,n){let i=getComputedStyle$1(e),o="0";return i&&(o=i.getPropertyValue?i.getPropertyValue(t):i.getAttribute(n)),SizeUtils.convertToPixels(e,o)}static getBorderLeftWidth(e){return SizeUtils.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return SizeUtils.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return SizeUtils.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return SizeUtils.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return SizeUtils.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return SizeUtils.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return SizeUtils.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return SizeUtils.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return SizeUtils.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return SizeUtils.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return SizeUtils.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return SizeUtils.getDimension(e,"margin-bottom","marginBottom")}}class Dimension{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Dimension(e,t):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(e){return e instanceof Dimension?e:new Dimension(e.width,e.height)}static equals(e,t){return e===t||!(!e||!t)&&(e.width===t.width&&e.height===t.height)}}function getTopLeftOffset(e){let t=e.offsetParent,n=e.offsetTop,i=e.offsetLeft;for(;null!==(e=e.parentNode)&&e!==document.body&&e!==document.documentElement;){n-=e.scrollTop;const o=isShadowRoot(e)?null:getComputedStyle$1(e);o&&(i-="rtl"!==o.direction?e.scrollLeft:-e.scrollLeft),e===t&&(i+=SizeUtils.getBorderLeftWidth(e),n+=SizeUtils.getBorderTopWidth(e),n+=e.offsetTop,i+=e.offsetLeft,t=e.offsetParent)}return{left:i,top:n}}function size(e,t,n){"number"==typeof t&&(e.style.width=`${t}px`),"number"==typeof n&&(e.style.height=`${n}px`)}function getDomNodePagePosition(e){let t=e.getBoundingClientRect();return{left:t.left+StandardWindow.scrollX,top:t.top+StandardWindow.scrollY,width:t.width,height:t.height}}Dimension.None=new Dimension(0,0);const StandardWindow=new class{get scrollX(){return"number"==typeof window.scrollX?window.scrollX:document.body.scrollLeft+document.documentElement.scrollLeft}get scrollY(){return"number"==typeof window.scrollY?window.scrollY:document.body.scrollTop+document.documentElement.scrollTop}};function getTotalWidth(e){let t=SizeUtils.getMarginLeft(e)+SizeUtils.getMarginRight(e);return e.offsetWidth+t}function getContentWidth(e){let t=SizeUtils.getBorderLeftWidth(e)+SizeUtils.getBorderRightWidth(e),n=SizeUtils.getPaddingLeft(e)+SizeUtils.getPaddingRight(e);return e.offsetWidth-t-n}function getContentHeight(e){let t=SizeUtils.getBorderTopWidth(e)+SizeUtils.getBorderBottomWidth(e),n=SizeUtils.getPaddingTop(e)+SizeUtils.getPaddingBottom(e);return e.offsetHeight-t-n}function getTotalHeight(e){let t=SizeUtils.getMarginTop(e)+SizeUtils.getMarginBottom(e);return e.offsetHeight+t}function isAncestor$1(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function findParentWithClass(e,t,n){for(;e&&e.nodeType===e.ELEMENT_NODE;){if(e.classList.contains(t))return e;if(n)if("string"==typeof n){if(e.classList.contains(n))return null}else if(e===n)return null;e=e.parentNode}return null}function hasParentWithClass(e,t,n){return!!findParentWithClass(e,t,n)}function isShadowRoot(e){return e&&!!e.host&&!!e.mode}function isInShadowDOM(e){return!!getShadowRoot(e)}function getShadowRoot(e){for(;e.parentNode;){if(e===document.body)return null;e=e.parentNode}return isShadowRoot(e)?e:null}function getActiveElement(){let e=document.activeElement;for(;null==e?void 0:e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function createStyleSheet(e=document.getElementsByTagName("head")[0]){let t=document.createElement("style");return t.type="text/css",t.media="screen",e.appendChild(t),t}let _sharedStyleSheet=null;function getSharedStyleSheet(){return _sharedStyleSheet||(_sharedStyleSheet=createStyleSheet()),_sharedStyleSheet}function getDynamicStyleSheetRules(e){var t,n;return(null===(t=null==e?void 0:e.sheet)||void 0===t?void 0:t.rules)?e.sheet.rules:(null===(n=null==e?void 0:e.sheet)||void 0===n?void 0:n.cssRules)?e.sheet.cssRules:[]}function createCSSRule(e,t,n=getSharedStyleSheet()){n&&t&&n.sheet.insertRule(e+"{"+t+"}",0)}function removeCSSRulesContainingSelector(e,t=getSharedStyleSheet()){if(!t)return;let n=getDynamicStyleSheetRules(t),i=[];for(let o=0;o<n.length;o++){-1!==n[o].selectorText.indexOf(e)&&i.push(o)}for(let o=i.length-1;o>=0;o--)t.sheet.deleteRule(i[o])}function isHTMLElement(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName}const EventType$1={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:isWebKit?"webkitAnimationStart":"animationstart",ANIMATION_END:isWebKit?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:isWebKit?"webkitAnimationIteration":"animationiteration"},EventHelper={stop:function(e,t){e.preventDefault?e.preventDefault():e.returnValue=!1,t&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)}};function saveParentsScrollTop(e){let t=[];for(let n=0;e&&e.nodeType===e.ELEMENT_NODE;n++)t[n]=e.scrollTop,e=e.parentNode;return t}function restoreParentsScrollTop(e,t){for(let n=0;e&&e.nodeType===e.ELEMENT_NODE;n++)e.scrollTop!==t[n]&&(e.scrollTop=t[n]),e=e.parentNode}class FocusTracker extends Disposable{constructor(e){super(),this._onDidFocus=this._register(new Emitter$1),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new Emitter$1),this.onDidBlur=this._onDidBlur.event;let t=FocusTracker.hasFocusWithin(e),n=!1;const i=()=>{n=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(n=!0,window.setTimeout((()=>{n&&(n=!1,t=!1,this._onDidBlur.fire())}),0))};this._refreshStateHandler=()=>{FocusTracker.hasFocusWithin(e)!==t&&(t?o():i())},this._register(addDisposableListener(e,EventType$1.FOCUS,i,!0)),this._register(addDisposableListener(e,EventType$1.BLUR,o,!0)),this._register(addDisposableListener(e,EventType$1.FOCUS_IN,(()=>this._refreshStateHandler()))),this._register(addDisposableListener(e,EventType$1.FOCUS_OUT,(()=>this._refreshStateHandler())))}static hasFocusWithin(e){const t=getShadowRoot(e);return isAncestor$1(t?t.activeElement:document.activeElement,e)}}function trackFocus(e){return new FocusTracker(e)}function append$1(e,...t){if(e.append(...t),1===t.length&&"string"!=typeof t[0])return t[0]}function prepend$1(e,t){return e.insertBefore(t,e.firstChild),t}function reset(e,...t){e.innerText="",append$1(e,...t)}const SELECTOR_REGEX=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var Namespace,Namespace2;function _$(e,t,n,...i){let o=SELECTOR_REGEX.exec(t);if(!o)throw new Error("Bad use of emmet");n=Object.assign({},n||{});let r,s=o[1]||"div";return r=e!==Namespace.HTML?document.createElementNS(e,s):document.createElement(s),o[3]&&(r.id=o[3]),o[4]&&(r.className=o[4].replace(/\./g," ").trim()),Object.keys(n).forEach((e=>{const t=n[e];void 0!==t&&(/^on\w+$/.test(e)?r[e]=t:"selected"===e?t&&r.setAttribute(e,"true"):r.setAttribute(e,t))})),r.append(...i),r}function $$c(e,t,...n){return _$(Namespace.HTML,e,t,...n)}function show(...e){for(let t of e)t.style.display="",t.removeAttribute("aria-hidden")}function hide(...e){for(let t of e)t.style.display="none",t.setAttribute("aria-hidden","true")}function getElementsByTagName(e){return Array.prototype.slice.call(document.getElementsByTagName(e),0)}function computeScreenAwareSize(e){const t=window.devicePixelRatio*e;return Math.max(1,Math.floor(t))/window.devicePixelRatio}function windowOpenNoOpener(e){window.open(e,"_blank","noopener")}function animate(e){const t=()=>{e(),n=scheduleAtNextAnimationFrame(t)};let n=scheduleAtNextAnimationFrame(t);return toDisposable((()=>n.dispose()))}function asCSSUrl(e){return e?`url('${FileAccess.asBrowserUri(e).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function asCSSPropertyValue(e){return`'${e.replace(/'/g,"%27")}'`}Namespace2=Namespace||(Namespace={}),Namespace2.HTML="http://www.w3.org/1999/xhtml",Namespace2.SVG="http://www.w3.org/2000/svg",$$c.SVG=function(e,t,...n){return _$(Namespace.SVG,e,t,...n)},RemoteAuthorities.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");class ModifierKeyEmitter extends Emitter$1{constructor(){super(),this._subscriptions=new DisposableStore,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(addDisposableListener(window,"keydown",(e=>{if(e.defaultPrevented)return;const t=new StandardKeyboardEvent(e);if(6!==t.keyCode||!e.repeat){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else{if(6===t.keyCode)return;this._keyStatus.lastKeyPressed=void 0}this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}}),!0)),this._subscriptions.add(addDisposableListener(window,"keyup",(e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))}),!0)),this._subscriptions.add(addDisposableListener(document.body,"mousedown",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),this._subscriptions.add(addDisposableListener(document.body,"mouseup",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),this._subscriptions.add(addDisposableListener(document.body,"mousemove",(e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)}),!0)),this._subscriptions.add(addDisposableListener(window,"blur",(()=>{this.resetKeyStatus()})))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return ModifierKeyEmitter.instance||(ModifierKeyEmitter.instance=new ModifierKeyEmitter),ModifierKeyEmitter.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}function addMatchMediaChangeListener(e,t){window.matchMedia(e).addEventListener("change",t)}var aria="";const MAX_MESSAGE_LENGTH=2e4;let ariaContainer,alertContainer,alertContainer2,statusContainer,statusContainer2;function setARIAContainer(e){ariaContainer=document.createElement("div"),ariaContainer.className="monaco-aria-container";const t=()=>{const e=document.createElement("div");return e.className="monaco-alert",e.setAttribute("role","alert"),e.setAttribute("aria-atomic","true"),ariaContainer.appendChild(e),e};alertContainer=t(),alertContainer2=t();const n=()=>{const e=document.createElement("div");return e.className="monaco-status",e.setAttribute("role","complementary"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),ariaContainer.appendChild(e),e};statusContainer=n(),statusContainer2=n(),e.appendChild(ariaContainer)}function alert(e){ariaContainer&&(alertContainer.textContent!==e?(clearNode(alertContainer2),insertMessage(alertContainer,e)):(clearNode(alertContainer),insertMessage(alertContainer2,e)))}function status(e){ariaContainer&&(isMacintosh?alert(e):statusContainer.textContent!==e?(clearNode(statusContainer2),insertMessage(statusContainer,e)):(clearNode(statusContainer),insertMessage(statusContainer2,e)))}function insertMessage(e,t){clearNode(e),t.length>MAX_MESSAGE_LENGTH&&(t=t.substr(0,MAX_MESSAGE_LENGTH)),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}var _util,_util2;_util2=_util||(_util={}),_util2.serviceIds=new Map,_util2.DI_TARGET="$di$target",_util2.DI_DEPENDENCIES="$di$dependencies",_util2.getServiceDependencies=function(e){return e[_util2.DI_DEPENDENCIES]||[]};const IInstantiationService=createDecorator("instantiationService");function storeServiceDependency(e,t,n){t[_util.DI_TARGET]===t?t[_util.DI_DEPENDENCIES].push({id:e,index:n}):(t[_util.DI_DEPENDENCIES]=[{id:e,index:n}],t[_util.DI_TARGET]=t)}function createDecorator(e){if(_util.serviceIds.has(e))return _util.serviceIds.get(e);const t=function(e,n,i){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");storeServiceDependency(t,e,i)};return t.toString=()=>e,_util.serviceIds.set(e,t),t}const ICodeEditorService=createDecorator("codeEditorService");class Position$1{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new Position$1(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return Position$1.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return Position$1.isBefore(this,e)}static isBefore(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<t.column}isBeforeOrEqual(e){return Position$1.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<=t.column}static compare(e,t){const n=0|e.lineNumber,i=0|t.lineNumber;if(n===i){return(0|e.column)-(0|t.column)}return n-i}clone(){return new Position$1(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new Position$1(e.lineNumber,e.column)}static isIPosition(e){return e&&"number"==typeof e.lineNumber&&"number"==typeof e.column}}const IModelService=createDecorator("modelService"),ITextModelService=createDecorator("textModelService");var __awaiter$15=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},CSSIcon;class Action extends Disposable{constructor(e,t="",n="",i=!0,o){super(),this._onDidChange=this._register(new Emitter$1),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=n,this._enabled=i,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}run(e,t){return __awaiter$15(this,void 0,void 0,(function*(){this._actionCallback&&(yield this._actionCallback(e))}))}}class ActionRunner extends Disposable{constructor(){super(...arguments),this._onBeforeRun=this._register(new Emitter$1),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new Emitter$1),this.onDidRun=this._onDidRun.event}run(e,t){return __awaiter$15(this,void 0,void 0,(function*(){if(!e.enabled)return;let n;this._onBeforeRun.fire({action:e});try{yield this.runAction(e,t)}catch(e2){n=e2}this._onDidRun.fire({action:e,error:n})}))}runAction(e,t){return __awaiter$15(this,void 0,void 0,(function*(){yield e.run(t)}))}}class Separator extends Action{constructor(e){super(Separator.ID,e,e?"separator text":"separator"),this.checked=!1,this.enabled=!1}}Separator.ID="vs.actions.separator";class SubmenuAction{constructor(e,t,n,i){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=i,this._actions=n}get actions(){return this._actions}dispose(){}run(){return __awaiter$15(this,void 0,void 0,(function*(){}))}}class EmptySubmenuAction extends Action{constructor(){super(EmptySubmenuAction.ID,localize("submenu.empty","(empty)"),void 0,!1)}}function getCodiconAriaLabel(e){return e?e.replace(/\$\((.*?)\)/g,((e,t)=>` ${t} `)).trim():""}EmptySubmenuAction.ID="vs.actions.empty";class Codicon{constructor(e,t,n){this.id=e,this.definition=t,this.description=n,Codicon._allCodicons.push(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}static getAll(){return Codicon._allCodicons}}Codicon._allCodicons=[],Codicon.add=new Codicon("add",{fontCharacter:"\\ea60"}),Codicon.plus=new Codicon("plus",Codicon.add.definition),Codicon.gistNew=new Codicon("gist-new",Codicon.add.definition),Codicon.repoCreate=new Codicon("repo-create",Codicon.add.definition),Codicon.lightbulb=new Codicon("lightbulb",{fontCharacter:"\\ea61"}),Codicon.lightBulb=new Codicon("light-bulb",{fontCharacter:"\\ea61"}),Codicon.repo=new Codicon("repo",{fontCharacter:"\\ea62"}),Codicon.repoDelete=new Codicon("repo-delete",{fontCharacter:"\\ea62"}),Codicon.gistFork=new Codicon("gist-fork",{fontCharacter:"\\ea63"}),Codicon.repoForked=new Codicon("repo-forked",{fontCharacter:"\\ea63"}),Codicon.gitPullRequest=new Codicon("git-pull-request",{fontCharacter:"\\ea64"}),Codicon.gitPullRequestAbandoned=new Codicon("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),Codicon.recordKeys=new Codicon("record-keys",{fontCharacter:"\\ea65"}),Codicon.keyboard=new Codicon("keyboard",{fontCharacter:"\\ea65"}),Codicon.tag=new Codicon("tag",{fontCharacter:"\\ea66"}),Codicon.tagAdd=new Codicon("tag-add",{fontCharacter:"\\ea66"}),Codicon.tagRemove=new Codicon("tag-remove",{fontCharacter:"\\ea66"}),Codicon.person=new Codicon("person",{fontCharacter:"\\ea67"}),Codicon.personFollow=new Codicon("person-follow",{fontCharacter:"\\ea67"}),Codicon.personOutline=new Codicon("person-outline",{fontCharacter:"\\ea67"}),Codicon.personFilled=new Codicon("person-filled",{fontCharacter:"\\ea67"}),Codicon.gitBranch=new Codicon("git-branch",{fontCharacter:"\\ea68"}),Codicon.gitBranchCreate=new Codicon("git-branch-create",{fontCharacter:"\\ea68"}),Codicon.gitBranchDelete=new Codicon("git-branch-delete",{fontCharacter:"\\ea68"}),Codicon.sourceControl=new Codicon("source-control",{fontCharacter:"\\ea68"}),Codicon.mirror=new Codicon("mirror",{fontCharacter:"\\ea69"}),Codicon.mirrorPublic=new Codicon("mirror-public",{fontCharacter:"\\ea69"}),Codicon.star=new Codicon("star",{fontCharacter:"\\ea6a"}),Codicon.starAdd=new Codicon("star-add",{fontCharacter:"\\ea6a"}),Codicon.starDelete=new Codicon("star-delete",{fontCharacter:"\\ea6a"}),Codicon.starEmpty=new Codicon("star-empty",{fontCharacter:"\\ea6a"}),Codicon.comment=new Codicon("comment",{fontCharacter:"\\ea6b"}),Codicon.commentAdd=new Codicon("comment-add",{fontCharacter:"\\ea6b"}),Codicon.alert=new Codicon("alert",{fontCharacter:"\\ea6c"}),Codicon.warning=new Codicon("warning",{fontCharacter:"\\ea6c"}),Codicon.search=new Codicon("search",{fontCharacter:"\\ea6d"}),Codicon.searchSave=new Codicon("search-save",{fontCharacter:"\\ea6d"}),Codicon.logOut=new Codicon("log-out",{fontCharacter:"\\ea6e"}),Codicon.signOut=new Codicon("sign-out",{fontCharacter:"\\ea6e"}),Codicon.logIn=new Codicon("log-in",{fontCharacter:"\\ea6f"}),Codicon.signIn=new Codicon("sign-in",{fontCharacter:"\\ea6f"}),Codicon.eye=new Codicon("eye",{fontCharacter:"\\ea70"}),Codicon.eyeUnwatch=new Codicon("eye-unwatch",{fontCharacter:"\\ea70"}),Codicon.eyeWatch=new Codicon("eye-watch",{fontCharacter:"\\ea70"}),Codicon.circleFilled=new Codicon("circle-filled",{fontCharacter:"\\ea71"}),Codicon.primitiveDot=new Codicon("primitive-dot",{fontCharacter:"\\ea71"}),Codicon.closeDirty=new Codicon("close-dirty",{fontCharacter:"\\ea71"}),Codicon.debugBreakpoint=new Codicon("debug-breakpoint",{fontCharacter:"\\ea71"}),Codicon.debugBreakpointDisabled=new Codicon("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),Codicon.debugHint=new Codicon("debug-hint",{fontCharacter:"\\ea71"}),Codicon.primitiveSquare=new Codicon("primitive-square",{fontCharacter:"\\ea72"}),Codicon.edit=new Codicon("edit",{fontCharacter:"\\ea73"}),Codicon.pencil=new Codicon("pencil",{fontCharacter:"\\ea73"}),Codicon.info=new Codicon("info",{fontCharacter:"\\ea74"}),Codicon.issueOpened=new Codicon("issue-opened",{fontCharacter:"\\ea74"}),Codicon.gistPrivate=new Codicon("gist-private",{fontCharacter:"\\ea75"}),Codicon.gitForkPrivate=new Codicon("git-fork-private",{fontCharacter:"\\ea75"}),Codicon.lock=new Codicon("lock",{fontCharacter:"\\ea75"}),Codicon.mirrorPrivate=new Codicon("mirror-private",{fontCharacter:"\\ea75"}),Codicon.close=new Codicon("close",{fontCharacter:"\\ea76"}),Codicon.removeClose=new Codicon("remove-close",{fontCharacter:"\\ea76"}),Codicon.x=new Codicon("x",{fontCharacter:"\\ea76"}),Codicon.repoSync=new Codicon("repo-sync",{fontCharacter:"\\ea77"}),Codicon.sync=new Codicon("sync",{fontCharacter:"\\ea77"}),Codicon.clone=new Codicon("clone",{fontCharacter:"\\ea78"}),Codicon.desktopDownload=new Codicon("desktop-download",{fontCharacter:"\\ea78"}),Codicon.beaker=new Codicon("beaker",{fontCharacter:"\\ea79"}),Codicon.microscope=new Codicon("microscope",{fontCharacter:"\\ea79"}),Codicon.vm=new Codicon("vm",{fontCharacter:"\\ea7a"}),Codicon.deviceDesktop=new Codicon("device-desktop",{fontCharacter:"\\ea7a"}),Codicon.file=new Codicon("file",{fontCharacter:"\\ea7b"}),Codicon.fileText=new Codicon("file-text",{fontCharacter:"\\ea7b"}),Codicon.more=new Codicon("more",{fontCharacter:"\\ea7c"}),Codicon.ellipsis=new Codicon("ellipsis",{fontCharacter:"\\ea7c"}),Codicon.kebabHorizontal=new Codicon("kebab-horizontal",{fontCharacter:"\\ea7c"}),Codicon.mailReply=new Codicon("mail-reply",{fontCharacter:"\\ea7d"}),Codicon.reply=new Codicon("reply",{fontCharacter:"\\ea7d"}),Codicon.organization=new Codicon("organization",{fontCharacter:"\\ea7e"}),Codicon.organizationFilled=new Codicon("organization-filled",{fontCharacter:"\\ea7e"}),Codicon.organizationOutline=new Codicon("organization-outline",{fontCharacter:"\\ea7e"}),Codicon.newFile=new Codicon("new-file",{fontCharacter:"\\ea7f"}),Codicon.fileAdd=new Codicon("file-add",{fontCharacter:"\\ea7f"}),Codicon.newFolder=new Codicon("new-folder",{fontCharacter:"\\ea80"}),Codicon.fileDirectoryCreate=new Codicon("file-directory-create",{fontCharacter:"\\ea80"}),Codicon.trash=new Codicon("trash",{fontCharacter:"\\ea81"}),Codicon.trashcan=new Codicon("trashcan",{fontCharacter:"\\ea81"}),Codicon.history=new Codicon("history",{fontCharacter:"\\ea82"}),Codicon.clock=new Codicon("clock",{fontCharacter:"\\ea82"}),Codicon.folder=new Codicon("folder",{fontCharacter:"\\ea83"}),Codicon.fileDirectory=new Codicon("file-directory",{fontCharacter:"\\ea83"}),Codicon.symbolFolder=new Codicon("symbol-folder",{fontCharacter:"\\ea83"}),Codicon.logoGithub=new Codicon("logo-github",{fontCharacter:"\\ea84"}),Codicon.markGithub=new Codicon("mark-github",{fontCharacter:"\\ea84"}),Codicon.github=new Codicon("github",{fontCharacter:"\\ea84"}),Codicon.terminal=new Codicon("terminal",{fontCharacter:"\\ea85"}),Codicon.console=new Codicon("console",{fontCharacter:"\\ea85"}),Codicon.repl=new Codicon("repl",{fontCharacter:"\\ea85"}),Codicon.zap=new Codicon("zap",{fontCharacter:"\\ea86"}),Codicon.symbolEvent=new Codicon("symbol-event",{fontCharacter:"\\ea86"}),Codicon.error=new Codicon("error",{fontCharacter:"\\ea87"}),Codicon.stop=new Codicon("stop",{fontCharacter:"\\ea87"}),Codicon.variable=new Codicon("variable",{fontCharacter:"\\ea88"}),Codicon.symbolVariable=new Codicon("symbol-variable",{fontCharacter:"\\ea88"}),Codicon.array=new Codicon("array",{fontCharacter:"\\ea8a"}),Codicon.symbolArray=new Codicon("symbol-array",{fontCharacter:"\\ea8a"}),Codicon.symbolModule=new Codicon("symbol-module",{fontCharacter:"\\ea8b"}),Codicon.symbolPackage=new Codicon("symbol-package",{fontCharacter:"\\ea8b"}),Codicon.symbolNamespace=new Codicon("symbol-namespace",{fontCharacter:"\\ea8b"}),Codicon.symbolObject=new Codicon("symbol-object",{fontCharacter:"\\ea8b"}),Codicon.symbolMethod=new Codicon("symbol-method",{fontCharacter:"\\ea8c"}),Codicon.symbolFunction=new Codicon("symbol-function",{fontCharacter:"\\ea8c"}),Codicon.symbolConstructor=new Codicon("symbol-constructor",{fontCharacter:"\\ea8c"}),Codicon.symbolBoolean=new Codicon("symbol-boolean",{fontCharacter:"\\ea8f"}),Codicon.symbolNull=new Codicon("symbol-null",{fontCharacter:"\\ea8f"}),Codicon.symbolNumeric=new Codicon("symbol-numeric",{fontCharacter:"\\ea90"}),Codicon.symbolNumber=new Codicon("symbol-number",{fontCharacter:"\\ea90"}),Codicon.symbolStructure=new Codicon("symbol-structure",{fontCharacter:"\\ea91"}),Codicon.symbolStruct=new Codicon("symbol-struct",{fontCharacter:"\\ea91"}),Codicon.symbolParameter=new Codicon("symbol-parameter",{fontCharacter:"\\ea92"}),Codicon.symbolTypeParameter=new Codicon("symbol-type-parameter",{fontCharacter:"\\ea92"}),Codicon.symbolKey=new Codicon("symbol-key",{fontCharacter:"\\ea93"}),Codicon.symbolText=new Codicon("symbol-text",{fontCharacter:"\\ea93"}),Codicon.symbolReference=new Codicon("symbol-reference",{fontCharacter:"\\ea94"}),Codicon.goToFile=new Codicon("go-to-file",{fontCharacter:"\\ea94"}),Codicon.symbolEnum=new Codicon("symbol-enum",{fontCharacter:"\\ea95"}),Codicon.symbolValue=new Codicon("symbol-value",{fontCharacter:"\\ea95"}),Codicon.symbolRuler=new Codicon("symbol-ruler",{fontCharacter:"\\ea96"}),Codicon.symbolUnit=new Codicon("symbol-unit",{fontCharacter:"\\ea96"}),Codicon.activateBreakpoints=new Codicon("activate-breakpoints",{fontCharacter:"\\ea97"}),Codicon.archive=new Codicon("archive",{fontCharacter:"\\ea98"}),Codicon.arrowBoth=new Codicon("arrow-both",{fontCharacter:"\\ea99"}),Codicon.arrowDown=new Codicon("arrow-down",{fontCharacter:"\\ea9a"}),Codicon.arrowLeft=new Codicon("arrow-left",{fontCharacter:"\\ea9b"}),Codicon.arrowRight=new Codicon("arrow-right",{fontCharacter:"\\ea9c"}),Codicon.arrowSmallDown=new Codicon("arrow-small-down",{fontCharacter:"\\ea9d"}),Codicon.arrowSmallLeft=new Codicon("arrow-small-left",{fontCharacter:"\\ea9e"}),Codicon.arrowSmallRight=new Codicon("arrow-small-right",{fontCharacter:"\\ea9f"}),Codicon.arrowSmallUp=new Codicon("arrow-small-up",{fontCharacter:"\\eaa0"}),Codicon.arrowUp=new Codicon("arrow-up",{fontCharacter:"\\eaa1"}),Codicon.bell=new Codicon("bell",{fontCharacter:"\\eaa2"}),Codicon.bold=new Codicon("bold",{fontCharacter:"\\eaa3"}),Codicon.book=new Codicon("book",{fontCharacter:"\\eaa4"}),Codicon.bookmark=new Codicon("bookmark",{fontCharacter:"\\eaa5"}),Codicon.debugBreakpointConditionalUnverified=new Codicon("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),Codicon.debugBreakpointConditional=new Codicon("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),Codicon.debugBreakpointConditionalDisabled=new Codicon("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),Codicon.debugBreakpointDataUnverified=new Codicon("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),Codicon.debugBreakpointData=new Codicon("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),Codicon.debugBreakpointDataDisabled=new Codicon("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),Codicon.debugBreakpointLogUnverified=new Codicon("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),Codicon.debugBreakpointLog=new Codicon("debug-breakpoint-log",{fontCharacter:"\\eaab"}),Codicon.debugBreakpointLogDisabled=new Codicon("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),Codicon.briefcase=new Codicon("briefcase",{fontCharacter:"\\eaac"}),Codicon.broadcast=new Codicon("broadcast",{fontCharacter:"\\eaad"}),Codicon.browser=new Codicon("browser",{fontCharacter:"\\eaae"}),Codicon.bug=new Codicon("bug",{fontCharacter:"\\eaaf"}),Codicon.calendar=new Codicon("calendar",{fontCharacter:"\\eab0"}),Codicon.caseSensitive=new Codicon("case-sensitive",{fontCharacter:"\\eab1"}),Codicon.check=new Codicon("check",{fontCharacter:"\\eab2"}),Codicon.checklist=new Codicon("checklist",{fontCharacter:"\\eab3"}),Codicon.chevronDown=new Codicon("chevron-down",{fontCharacter:"\\eab4"}),Codicon.dropDownButton=new Codicon("drop-down-button",Codicon.chevronDown.definition),Codicon.chevronLeft=new Codicon("chevron-left",{fontCharacter:"\\eab5"}),Codicon.chevronRight=new Codicon("chevron-right",{fontCharacter:"\\eab6"}),Codicon.chevronUp=new Codicon("chevron-up",{fontCharacter:"\\eab7"}),Codicon.chromeClose=new Codicon("chrome-close",{fontCharacter:"\\eab8"}),Codicon.chromeMaximize=new Codicon("chrome-maximize",{fontCharacter:"\\eab9"}),Codicon.chromeMinimize=new Codicon("chrome-minimize",{fontCharacter:"\\eaba"}),Codicon.chromeRestore=new Codicon("chrome-restore",{fontCharacter:"\\eabb"}),Codicon.circleOutline=new Codicon("circle-outline",{fontCharacter:"\\eabc"}),Codicon.debugBreakpointUnverified=new Codicon("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),Codicon.circleSlash=new Codicon("circle-slash",{fontCharacter:"\\eabd"}),Codicon.circuitBoard=new Codicon("circuit-board",{fontCharacter:"\\eabe"}),Codicon.clearAll=new Codicon("clear-all",{fontCharacter:"\\eabf"}),Codicon.clippy=new Codicon("clippy",{fontCharacter:"\\eac0"}),Codicon.closeAll=new Codicon("close-all",{fontCharacter:"\\eac1"}),Codicon.cloudDownload=new Codicon("cloud-download",{fontCharacter:"\\eac2"}),Codicon.cloudUpload=new Codicon("cloud-upload",{fontCharacter:"\\eac3"}),Codicon.code=new Codicon("code",{fontCharacter:"\\eac4"}),Codicon.collapseAll=new Codicon("collapse-all",{fontCharacter:"\\eac5"}),Codicon.colorMode=new Codicon("color-mode",{fontCharacter:"\\eac6"}),Codicon.commentDiscussion=new Codicon("comment-discussion",{fontCharacter:"\\eac7"}),Codicon.compareChanges=new Codicon("compare-changes",{fontCharacter:"\\eafd"}),Codicon.creditCard=new Codicon("credit-card",{fontCharacter:"\\eac9"}),Codicon.dash=new Codicon("dash",{fontCharacter:"\\eacc"}),Codicon.dashboard=new Codicon("dashboard",{fontCharacter:"\\eacd"}),Codicon.database=new Codicon("database",{fontCharacter:"\\eace"}),Codicon.debugContinue=new Codicon("debug-continue",{fontCharacter:"\\eacf"}),Codicon.debugDisconnect=new Codicon("debug-disconnect",{fontCharacter:"\\ead0"}),Codicon.debugPause=new Codicon("debug-pause",{fontCharacter:"\\ead1"}),Codicon.debugRestart=new Codicon("debug-restart",{fontCharacter:"\\ead2"}),Codicon.debugStart=new Codicon("debug-start",{fontCharacter:"\\ead3"}),Codicon.debugStepInto=new Codicon("debug-step-into",{fontCharacter:"\\ead4"}),Codicon.debugStepOut=new Codicon("debug-step-out",{fontCharacter:"\\ead5"}),Codicon.debugStepOver=new Codicon("debug-step-over",{fontCharacter:"\\ead6"}),Codicon.debugStop=new Codicon("debug-stop",{fontCharacter:"\\ead7"}),Codicon.debug=new Codicon("debug",{fontCharacter:"\\ead8"}),Codicon.deviceCameraVideo=new Codicon("device-camera-video",{fontCharacter:"\\ead9"}),Codicon.deviceCamera=new Codicon("device-camera",{fontCharacter:"\\eada"}),Codicon.deviceMobile=new Codicon("device-mobile",{fontCharacter:"\\eadb"}),Codicon.diffAdded=new Codicon("diff-added",{fontCharacter:"\\eadc"}),Codicon.diffIgnored=new Codicon("diff-ignored",{fontCharacter:"\\eadd"}),Codicon.diffModified=new Codicon("diff-modified",{fontCharacter:"\\eade"}),Codicon.diffRemoved=new Codicon("diff-removed",{fontCharacter:"\\eadf"}),Codicon.diffRenamed=new Codicon("diff-renamed",{fontCharacter:"\\eae0"}),Codicon.diff=new Codicon("diff",{fontCharacter:"\\eae1"}),Codicon.discard=new Codicon("discard",{fontCharacter:"\\eae2"}),Codicon.editorLayout=new Codicon("editor-layout",{fontCharacter:"\\eae3"}),Codicon.emptyWindow=new Codicon("empty-window",{fontCharacter:"\\eae4"}),Codicon.exclude=new Codicon("exclude",{fontCharacter:"\\eae5"}),Codicon.extensions=new Codicon("extensions",{fontCharacter:"\\eae6"}),Codicon.eyeClosed=new Codicon("eye-closed",{fontCharacter:"\\eae7"}),Codicon.fileBinary=new Codicon("file-binary",{fontCharacter:"\\eae8"}),Codicon.fileCode=new Codicon("file-code",{fontCharacter:"\\eae9"}),Codicon.fileMedia=new Codicon("file-media",{fontCharacter:"\\eaea"}),Codicon.filePdf=new Codicon("file-pdf",{fontCharacter:"\\eaeb"}),Codicon.fileSubmodule=new Codicon("file-submodule",{fontCharacter:"\\eaec"}),Codicon.fileSymlinkDirectory=new Codicon("file-symlink-directory",{fontCharacter:"\\eaed"}),Codicon.fileSymlinkFile=new Codicon("file-symlink-file",{fontCharacter:"\\eaee"}),Codicon.fileZip=new Codicon("file-zip",{fontCharacter:"\\eaef"}),Codicon.files=new Codicon("files",{fontCharacter:"\\eaf0"}),Codicon.filter=new Codicon("filter",{fontCharacter:"\\eaf1"}),Codicon.flame=new Codicon("flame",{fontCharacter:"\\eaf2"}),Codicon.foldDown=new Codicon("fold-down",{fontCharacter:"\\eaf3"}),Codicon.foldUp=new Codicon("fold-up",{fontCharacter:"\\eaf4"}),Codicon.fold=new Codicon("fold",{fontCharacter:"\\eaf5"}),Codicon.folderActive=new Codicon("folder-active",{fontCharacter:"\\eaf6"}),Codicon.folderOpened=new Codicon("folder-opened",{fontCharacter:"\\eaf7"}),Codicon.gear=new Codicon("gear",{fontCharacter:"\\eaf8"}),Codicon.gift=new Codicon("gift",{fontCharacter:"\\eaf9"}),Codicon.gistSecret=new Codicon("gist-secret",{fontCharacter:"\\eafa"}),Codicon.gist=new Codicon("gist",{fontCharacter:"\\eafb"}),Codicon.gitCommit=new Codicon("git-commit",{fontCharacter:"\\eafc"}),Codicon.gitCompare=new Codicon("git-compare",{fontCharacter:"\\eafd"}),Codicon.gitMerge=new Codicon("git-merge",{fontCharacter:"\\eafe"}),Codicon.githubAction=new Codicon("github-action",{fontCharacter:"\\eaff"}),Codicon.githubAlt=new Codicon("github-alt",{fontCharacter:"\\eb00"}),Codicon.globe=new Codicon("globe",{fontCharacter:"\\eb01"}),Codicon.grabber=new Codicon("grabber",{fontCharacter:"\\eb02"}),Codicon.graph=new Codicon("graph",{fontCharacter:"\\eb03"}),Codicon.gripper=new Codicon("gripper",{fontCharacter:"\\eb04"}),Codicon.heart=new Codicon("heart",{fontCharacter:"\\eb05"}),Codicon.home=new Codicon("home",{fontCharacter:"\\eb06"}),Codicon.horizontalRule=new Codicon("horizontal-rule",{fontCharacter:"\\eb07"}),Codicon.hubot=new Codicon("hubot",{fontCharacter:"\\eb08"}),Codicon.inbox=new Codicon("inbox",{fontCharacter:"\\eb09"}),Codicon.issueClosed=new Codicon("issue-closed",{fontCharacter:"\\eba4"}),Codicon.issueReopened=new Codicon("issue-reopened",{fontCharacter:"\\eb0b"}),Codicon.issues=new Codicon("issues",{fontCharacter:"\\eb0c"}),Codicon.italic=new Codicon("italic",{fontCharacter:"\\eb0d"}),Codicon.jersey=new Codicon("jersey",{fontCharacter:"\\eb0e"}),Codicon.json=new Codicon("json",{fontCharacter:"\\eb0f"}),Codicon.kebabVertical=new Codicon("kebab-vertical",{fontCharacter:"\\eb10"}),Codicon.key=new Codicon("key",{fontCharacter:"\\eb11"}),Codicon.law=new Codicon("law",{fontCharacter:"\\eb12"}),Codicon.lightbulbAutofix=new Codicon("lightbulb-autofix",{fontCharacter:"\\eb13"}),Codicon.linkExternal=new Codicon("link-external",{fontCharacter:"\\eb14"}),Codicon.link=new Codicon("link",{fontCharacter:"\\eb15"}),Codicon.listOrdered=new Codicon("list-ordered",{fontCharacter:"\\eb16"}),Codicon.listUnordered=new Codicon("list-unordered",{fontCharacter:"\\eb17"}),Codicon.liveShare=new Codicon("live-share",{fontCharacter:"\\eb18"}),Codicon.loading=new Codicon("loading",{fontCharacter:"\\eb19"}),Codicon.location=new Codicon("location",{fontCharacter:"\\eb1a"}),Codicon.mailRead=new Codicon("mail-read",{fontCharacter:"\\eb1b"}),Codicon.mail=new Codicon("mail",{fontCharacter:"\\eb1c"}),Codicon.markdown=new Codicon("markdown",{fontCharacter:"\\eb1d"}),Codicon.megaphone=new Codicon("megaphone",{fontCharacter:"\\eb1e"}),Codicon.mention=new Codicon("mention",{fontCharacter:"\\eb1f"}),Codicon.milestone=new Codicon("milestone",{fontCharacter:"\\eb20"}),Codicon.mortarBoard=new Codicon("mortar-board",{fontCharacter:"\\eb21"}),Codicon.move=new Codicon("move",{fontCharacter:"\\eb22"}),Codicon.multipleWindows=new Codicon("multiple-windows",{fontCharacter:"\\eb23"}),Codicon.mute=new Codicon("mute",{fontCharacter:"\\eb24"}),Codicon.noNewline=new Codicon("no-newline",{fontCharacter:"\\eb25"}),Codicon.note=new Codicon("note",{fontCharacter:"\\eb26"}),Codicon.octoface=new Codicon("octoface",{fontCharacter:"\\eb27"}),Codicon.openPreview=new Codicon("open-preview",{fontCharacter:"\\eb28"}),Codicon.package_=new Codicon("package",{fontCharacter:"\\eb29"}),Codicon.paintcan=new Codicon("paintcan",{fontCharacter:"\\eb2a"}),Codicon.pin=new Codicon("pin",{fontCharacter:"\\eb2b"}),Codicon.play=new Codicon("play",{fontCharacter:"\\eb2c"}),Codicon.run=new Codicon("run",{fontCharacter:"\\eb2c"}),Codicon.plug=new Codicon("plug",{fontCharacter:"\\eb2d"}),Codicon.preserveCase=new Codicon("preserve-case",{fontCharacter:"\\eb2e"}),Codicon.preview=new Codicon("preview",{fontCharacter:"\\eb2f"}),Codicon.project=new Codicon("project",{fontCharacter:"\\eb30"}),Codicon.pulse=new Codicon("pulse",{fontCharacter:"\\eb31"}),Codicon.question=new Codicon("question",{fontCharacter:"\\eb32"}),Codicon.quote=new Codicon("quote",{fontCharacter:"\\eb33"}),Codicon.radioTower=new Codicon("radio-tower",{fontCharacter:"\\eb34"}),Codicon.reactions=new Codicon("reactions",{fontCharacter:"\\eb35"}),Codicon.references=new Codicon("references",{fontCharacter:"\\eb36"}),Codicon.refresh=new Codicon("refresh",{fontCharacter:"\\eb37"}),Codicon.regex=new Codicon("regex",{fontCharacter:"\\eb38"}),Codicon.remoteExplorer=new Codicon("remote-explorer",{fontCharacter:"\\eb39"}),Codicon.remote=new Codicon("remote",{fontCharacter:"\\eb3a"}),Codicon.remove=new Codicon("remove",{fontCharacter:"\\eb3b"}),Codicon.replaceAll=new Codicon("replace-all",{fontCharacter:"\\eb3c"}),Codicon.replace=new Codicon("replace",{fontCharacter:"\\eb3d"}),Codicon.repoClone=new Codicon("repo-clone",{fontCharacter:"\\eb3e"}),Codicon.repoForcePush=new Codicon("repo-force-push",{fontCharacter:"\\eb3f"}),Codicon.repoPull=new Codicon("repo-pull",{fontCharacter:"\\eb40"}),Codicon.repoPush=new Codicon("repo-push",{fontCharacter:"\\eb41"}),Codicon.report=new Codicon("report",{fontCharacter:"\\eb42"}),Codicon.requestChanges=new Codicon("request-changes",{fontCharacter:"\\eb43"}),Codicon.rocket=new Codicon("rocket",{fontCharacter:"\\eb44"}),Codicon.rootFolderOpened=new Codicon("root-folder-opened",{fontCharacter:"\\eb45"}),Codicon.rootFolder=new Codicon("root-folder",{fontCharacter:"\\eb46"}),Codicon.rss=new Codicon("rss",{fontCharacter:"\\eb47"}),Codicon.ruby=new Codicon("ruby",{fontCharacter:"\\eb48"}),Codicon.saveAll=new Codicon("save-all",{fontCharacter:"\\eb49"}),Codicon.saveAs=new Codicon("save-as",{fontCharacter:"\\eb4a"}),Codicon.save=new Codicon("save",{fontCharacter:"\\eb4b"}),Codicon.screenFull=new Codicon("screen-full",{fontCharacter:"\\eb4c"}),Codicon.screenNormal=new Codicon("screen-normal",{fontCharacter:"\\eb4d"}),Codicon.searchStop=new Codicon("search-stop",{fontCharacter:"\\eb4e"}),Codicon.server=new Codicon("server",{fontCharacter:"\\eb50"}),Codicon.settingsGear=new Codicon("settings-gear",{fontCharacter:"\\eb51"}),Codicon.settings=new Codicon("settings",{fontCharacter:"\\eb52"}),Codicon.shield=new Codicon("shield",{fontCharacter:"\\eb53"}),Codicon.smiley=new Codicon("smiley",{fontCharacter:"\\eb54"}),Codicon.sortPrecedence=new Codicon("sort-precedence",{fontCharacter:"\\eb55"}),Codicon.splitHorizontal=new Codicon("split-horizontal",{fontCharacter:"\\eb56"}),Codicon.splitVertical=new Codicon("split-vertical",{fontCharacter:"\\eb57"}),Codicon.squirrel=new Codicon("squirrel",{fontCharacter:"\\eb58"}),Codicon.starFull=new Codicon("star-full",{fontCharacter:"\\eb59"}),Codicon.starHalf=new Codicon("star-half",{fontCharacter:"\\eb5a"}),Codicon.symbolClass=new Codicon("symbol-class",{fontCharacter:"\\eb5b"}),Codicon.symbolColor=new Codicon("symbol-color",{fontCharacter:"\\eb5c"}),Codicon.symbolCustomColor=new Codicon("symbol-customcolor",{fontCharacter:"\\eb5c"}),Codicon.symbolConstant=new Codicon("symbol-constant",{fontCharacter:"\\eb5d"}),Codicon.symbolEnumMember=new Codicon("symbol-enum-member",{fontCharacter:"\\eb5e"}),Codicon.symbolField=new Codicon("symbol-field",{fontCharacter:"\\eb5f"}),Codicon.symbolFile=new Codicon("symbol-file",{fontCharacter:"\\eb60"}),Codicon.symbolInterface=new Codicon("symbol-interface",{fontCharacter:"\\eb61"}),Codicon.symbolKeyword=new Codicon("symbol-keyword",{fontCharacter:"\\eb62"}),Codicon.symbolMisc=new Codicon("symbol-misc",{fontCharacter:"\\eb63"}),Codicon.symbolOperator=new Codicon("symbol-operator",{fontCharacter:"\\eb64"}),Codicon.symbolProperty=new Codicon("symbol-property",{fontCharacter:"\\eb65"}),Codicon.wrench=new Codicon("wrench",{fontCharacter:"\\eb65"}),Codicon.wrenchSubaction=new Codicon("wrench-subaction",{fontCharacter:"\\eb65"}),Codicon.symbolSnippet=new Codicon("symbol-snippet",{fontCharacter:"\\eb66"}),Codicon.tasklist=new Codicon("tasklist",{fontCharacter:"\\eb67"}),Codicon.telescope=new Codicon("telescope",{fontCharacter:"\\eb68"}),Codicon.textSize=new Codicon("text-size",{fontCharacter:"\\eb69"}),Codicon.threeBars=new Codicon("three-bars",{fontCharacter:"\\eb6a"}),Codicon.thumbsdown=new Codicon("thumbsdown",{fontCharacter:"\\eb6b"}),Codicon.thumbsup=new Codicon("thumbsup",{fontCharacter:"\\eb6c"}),Codicon.tools=new Codicon("tools",{fontCharacter:"\\eb6d"}),Codicon.triangleDown=new Codicon("triangle-down",{fontCharacter:"\\eb6e"}),Codicon.triangleLeft=new Codicon("triangle-left",{fontCharacter:"\\eb6f"}),Codicon.triangleRight=new Codicon("triangle-right",{fontCharacter:"\\eb70"}),Codicon.triangleUp=new Codicon("triangle-up",{fontCharacter:"\\eb71"}),Codicon.twitter=new Codicon("twitter",{fontCharacter:"\\eb72"}),Codicon.unfold=new Codicon("unfold",{fontCharacter:"\\eb73"}),Codicon.unlock=new Codicon("unlock",{fontCharacter:"\\eb74"}),Codicon.unmute=new Codicon("unmute",{fontCharacter:"\\eb75"}),Codicon.unverified=new Codicon("unverified",{fontCharacter:"\\eb76"}),Codicon.verified=new Codicon("verified",{fontCharacter:"\\eb77"}),Codicon.versions=new Codicon("versions",{fontCharacter:"\\eb78"}),Codicon.vmActive=new Codicon("vm-active",{fontCharacter:"\\eb79"}),Codicon.vmOutline=new Codicon("vm-outline",{fontCharacter:"\\eb7a"}),Codicon.vmRunning=new Codicon("vm-running",{fontCharacter:"\\eb7b"}),Codicon.watch=new Codicon("watch",{fontCharacter:"\\eb7c"}),Codicon.whitespace=new Codicon("whitespace",{fontCharacter:"\\eb7d"}),Codicon.wholeWord=new Codicon("whole-word",{fontCharacter:"\\eb7e"}),Codicon.window=new Codicon("window",{fontCharacter:"\\eb7f"}),Codicon.wordWrap=new Codicon("word-wrap",{fontCharacter:"\\eb80"}),Codicon.zoomIn=new Codicon("zoom-in",{fontCharacter:"\\eb81"}),Codicon.zoomOut=new Codicon("zoom-out",{fontCharacter:"\\eb82"}),Codicon.listFilter=new Codicon("list-filter",{fontCharacter:"\\eb83"}),Codicon.listFlat=new Codicon("list-flat",{fontCharacter:"\\eb84"}),Codicon.listSelection=new Codicon("list-selection",{fontCharacter:"\\eb85"}),Codicon.selection=new Codicon("selection",{fontCharacter:"\\eb85"}),Codicon.listTree=new Codicon("list-tree",{fontCharacter:"\\eb86"}),Codicon.debugBreakpointFunctionUnverified=new Codicon("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),Codicon.debugBreakpointFunction=new Codicon("debug-breakpoint-function",{fontCharacter:"\\eb88"}),Codicon.debugBreakpointFunctionDisabled=new Codicon("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),Codicon.debugStackframeActive=new Codicon("debug-stackframe-active",{fontCharacter:"\\eb89"}),Codicon.debugStackframeDot=new Codicon("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),Codicon.debugStackframe=new Codicon("debug-stackframe",{fontCharacter:"\\eb8b"}),Codicon.debugStackframeFocused=new Codicon("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),Codicon.debugBreakpointUnsupported=new Codicon("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),Codicon.symbolString=new Codicon("symbol-string",{fontCharacter:"\\eb8d"}),Codicon.debugReverseContinue=new Codicon("debug-reverse-continue",{fontCharacter:"\\eb8e"}),Codicon.debugStepBack=new Codicon("debug-step-back",{fontCharacter:"\\eb8f"}),Codicon.debugRestartFrame=new Codicon("debug-restart-frame",{fontCharacter:"\\eb90"}),Codicon.callIncoming=new Codicon("call-incoming",{fontCharacter:"\\eb92"}),Codicon.callOutgoing=new Codicon("call-outgoing",{fontCharacter:"\\eb93"}),Codicon.menu=new Codicon("menu",{fontCharacter:"\\eb94"}),Codicon.expandAll=new Codicon("expand-all",{fontCharacter:"\\eb95"}),Codicon.feedback=new Codicon("feedback",{fontCharacter:"\\eb96"}),Codicon.groupByRefType=new Codicon("group-by-ref-type",{fontCharacter:"\\eb97"}),Codicon.ungroupByRefType=new Codicon("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),Codicon.account=new Codicon("account",{fontCharacter:"\\eb99"}),Codicon.bellDot=new Codicon("bell-dot",{fontCharacter:"\\eb9a"}),Codicon.debugConsole=new Codicon("debug-console",{fontCharacter:"\\eb9b"}),Codicon.library=new Codicon("library",{fontCharacter:"\\eb9c"}),Codicon.output=new Codicon("output",{fontCharacter:"\\eb9d"}),Codicon.runAll=new Codicon("run-all",{fontCharacter:"\\eb9e"}),Codicon.syncIgnored=new Codicon("sync-ignored",{fontCharacter:"\\eb9f"}),Codicon.pinned=new Codicon("pinned",{fontCharacter:"\\eba0"}),Codicon.githubInverted=new Codicon("github-inverted",{fontCharacter:"\\eba1"}),Codicon.debugAlt=new Codicon("debug-alt",{fontCharacter:"\\eb91"}),Codicon.serverProcess=new Codicon("server-process",{fontCharacter:"\\eba2"}),Codicon.serverEnvironment=new Codicon("server-environment",{fontCharacter:"\\eba3"}),Codicon.pass=new Codicon("pass",{fontCharacter:"\\eba4"}),Codicon.stopCircle=new Codicon("stop-circle",{fontCharacter:"\\eba5"}),Codicon.playCircle=new Codicon("play-circle",{fontCharacter:"\\eba6"}),Codicon.record=new Codicon("record",{fontCharacter:"\\eba7"}),Codicon.debugAltSmall=new Codicon("debug-alt-small",{fontCharacter:"\\eba8"}),Codicon.vmConnect=new Codicon("vm-connect",{fontCharacter:"\\eba9"}),Codicon.cloud=new Codicon("cloud",{fontCharacter:"\\ebaa"}),Codicon.merge=new Codicon("merge",{fontCharacter:"\\ebab"}),Codicon.exportIcon=new Codicon("export",{fontCharacter:"\\ebac"}),Codicon.graphLeft=new Codicon("graph-left",{fontCharacter:"\\ebad"}),Codicon.magnet=new Codicon("magnet",{fontCharacter:"\\ebae"}),Codicon.notebook=new Codicon("notebook",{fontCharacter:"\\ebaf"}),Codicon.redo=new Codicon("redo",{fontCharacter:"\\ebb0"}),Codicon.checkAll=new Codicon("check-all",{fontCharacter:"\\ebb1"}),Codicon.pinnedDirty=new Codicon("pinned-dirty",{fontCharacter:"\\ebb2"}),Codicon.passFilled=new Codicon("pass-filled",{fontCharacter:"\\ebb3"}),Codicon.circleLargeFilled=new Codicon("circle-large-filled",{fontCharacter:"\\ebb4"}),Codicon.circleLargeOutline=new Codicon("circle-large-outline",{fontCharacter:"\\ebb5"}),Codicon.combine=new Codicon("combine",{fontCharacter:"\\ebb6"}),Codicon.gather=new Codicon("gather",{fontCharacter:"\\ebb6"}),Codicon.table=new Codicon("table",{fontCharacter:"\\ebb7"}),Codicon.variableGroup=new Codicon("variable-group",{fontCharacter:"\\ebb8"}),Codicon.typeHierarchy=new Codicon("type-hierarchy",{fontCharacter:"\\ebb9"}),Codicon.typeHierarchySub=new Codicon("type-hierarchy-sub",{fontCharacter:"\\ebba"}),Codicon.typeHierarchySuper=new Codicon("type-hierarchy-super",{fontCharacter:"\\ebbb"}),Codicon.gitPullRequestCreate=new Codicon("git-pull-request-create",{fontCharacter:"\\ebbc"}),Codicon.runAbove=new Codicon("run-above",{fontCharacter:"\\ebbd"}),Codicon.runBelow=new Codicon("run-below",{fontCharacter:"\\ebbe"}),Codicon.notebookTemplate=new Codicon("notebook-template",{fontCharacter:"\\ebbf"}),Codicon.debugRerun=new Codicon("debug-rerun",{fontCharacter:"\\ebc0"}),Codicon.workspaceTrusted=new Codicon("workspace-trusted",{fontCharacter:"\\ebc1"}),Codicon.workspaceUntrusted=new Codicon("workspace-untrusted",{fontCharacter:"\\ebc2"}),Codicon.workspaceUnspecified=new Codicon("workspace-unspecified",{fontCharacter:"\\ebc3"}),Codicon.terminalCmd=new Codicon("terminal-cmd",{fontCharacter:"\\ebc4"}),Codicon.terminalDebian=new Codicon("terminal-debian",{fontCharacter:"\\ebc5"}),Codicon.terminalLinux=new Codicon("terminal-linux",{fontCharacter:"\\ebc6"}),Codicon.terminalPowershell=new Codicon("terminal-powershell",{fontCharacter:"\\ebc7"}),Codicon.terminalTmux=new Codicon("terminal-tmux",{fontCharacter:"\\ebc8"}),Codicon.terminalUbuntu=new Codicon("terminal-ubuntu",{fontCharacter:"\\ebc9"}),Codicon.terminalBash=new Codicon("terminal-bash",{fontCharacter:"\\ebca"}),Codicon.arrowSwap=new Codicon("arrow-swap",{fontCharacter:"\\ebcb"}),Codicon.copy=new Codicon("copy",{fontCharacter:"\\ebcc"}),Codicon.personAdd=new Codicon("person-add",{fontCharacter:"\\ebcd"}),Codicon.filterFilled=new Codicon("filter-filled",{fontCharacter:"\\ebce"}),Codicon.wand=new Codicon("wand",{fontCharacter:"\\ebcf"}),Codicon.debugLineByLine=new Codicon("debug-line-by-line",{fontCharacter:"\\ebd0"}),Codicon.inspect=new Codicon("inspect",{fontCharacter:"\\ebd1"}),Codicon.layers=new Codicon("layers",{fontCharacter:"\\ebd2"}),Codicon.layersDot=new Codicon("layers-dot",{fontCharacter:"\\ebd3"}),Codicon.layersActive=new Codicon("layers-active",{fontCharacter:"\\ebd4"}),Codicon.compass=new Codicon("compass",{fontCharacter:"\\ebd5"}),Codicon.compassDot=new Codicon("compass-dot",{fontCharacter:"\\ebd6"}),Codicon.compassActive=new Codicon("compass-active",{fontCharacter:"\\ebd7"}),Codicon.azure=new Codicon("azure",{fontCharacter:"\\ebd8"}),Codicon.issueDraft=new Codicon("issue-draft",{fontCharacter:"\\ebd9"}),Codicon.gitPullRequestClosed=new Codicon("git-pull-request-closed",{fontCharacter:"\\ebda"}),Codicon.gitPullRequestDraft=new Codicon("git-pull-request-draft",{fontCharacter:"\\ebdb"}),Codicon.debugAll=new Codicon("debug-all",{fontCharacter:"\\ebdc"}),Codicon.debugCoverage=new Codicon("debug-coverage",{fontCharacter:"\\ebdd"}),Codicon.runErrors=new Codicon("run-errors",{fontCharacter:"\\ebde"}),Codicon.folderLibrary=new Codicon("folder-library",{fontCharacter:"\\ebdf"}),Codicon.debugContinueSmall=new Codicon("debug-continue-small",{fontCharacter:"\\ebe0"}),Codicon.beakerStop=new Codicon("beaker-stop",{fontCharacter:"\\ebe1"}),Codicon.graphLine=new Codicon("graph-line",{fontCharacter:"\\ebe2"}),Codicon.graphScatter=new Codicon("graph-scatter",{fontCharacter:"\\ebe3"}),Codicon.pieChart=new Codicon("pie-chart",{fontCharacter:"\\ebe4"}),Codicon.bracket=new Codicon("bracket",Codicon.json.definition),Codicon.bracketDot=new Codicon("bracket-dot",{fontCharacter:"\\ebe5"}),Codicon.bracketError=new Codicon("bracket-error",{fontCharacter:"\\ebe6"}),Codicon.lockSmall=new Codicon("lock-small",{fontCharacter:"\\ebe7"}),Codicon.azureDevops=new Codicon("azure-devops",{fontCharacter:"\\ebe8"}),Codicon.verifiedFilled=new Codicon("verified-filled",{fontCharacter:"\\ebe9"}),Codicon.newLine=new Codicon("newline",{fontCharacter:"\\ebea"}),Codicon.layout=new Codicon("layout",{fontCharacter:"\\ebeb"}),Codicon.layoutActivitybarLeft=new Codicon("layout-activitybar-left",{fontCharacter:"\\ebec"}),Codicon.layoutActivitybarRight=new Codicon("layout-activitybar-right",{fontCharacter:"\\ebed"}),Codicon.layoutPanelLeft=new Codicon("layout-panel-left",{fontCharacter:"\\ebee"}),Codicon.layoutPanelCenter=new Codicon("layout-panel-center",{fontCharacter:"\\ebef"}),Codicon.layoutPanelJustify=new Codicon("layout-panel-justify",{fontCharacter:"\\ebf0"}),Codicon.layoutPanelRight=new Codicon("layout-panel-right",{fontCharacter:"\\ebf1"}),Codicon.layoutPanel=new Codicon("layout-panel",{fontCharacter:"\\ebf2"}),Codicon.layoutSidebarLeft=new Codicon("layout-sidebar-left",{fontCharacter:"\\ebf3"}),Codicon.layoutSidebarRight=new Codicon("layout-sidebar-right",{fontCharacter:"\\ebf4"}),Codicon.layoutStatusbar=new Codicon("layout-statusbar",{fontCharacter:"\\ebf5"}),Codicon.layoutMenubar=new Codicon("layout-menubar",{fontCharacter:"\\ebf6"}),Codicon.layoutCentered=new Codicon("layout-centered",{fontCharacter:"\\ebf7"}),Codicon.target=new Codicon("target",{fontCharacter:"\\ebf8"}),Codicon.indent=new Codicon("indent",{fontCharacter:"\\ebf9"}),Codicon.recordSmall=new Codicon("record-small",{fontCharacter:"\\ebfa"}),Codicon.errorSmall=new Codicon("error-small",{fontCharacter:"\\ebfb"}),Codicon.arrowCircleDown=new Codicon("arrow-circle-down",{fontCharacter:"\\ebfc"}),Codicon.arrowCircleLeft=new Codicon("arrow-circle-left",{fontCharacter:"\\ebfd"}),Codicon.arrowCircleRight=new Codicon("arrow-circle-right",{fontCharacter:"\\ebfe"}),Codicon.arrowCircleUp=new Codicon("arrow-circle-up",{fontCharacter:"\\ebff"}),Codicon.dialogError=new Codicon("dialog-error",Codicon.error.definition),Codicon.dialogWarning=new Codicon("dialog-warning",Codicon.warning.definition),Codicon.dialogInfo=new Codicon("dialog-info",Codicon.info.definition),Codicon.dialogClose=new Codicon("dialog-close",Codicon.close.definition),Codicon.treeItemExpanded=new Codicon("tree-item-expanded",Codicon.chevronDown.definition),Codicon.treeFilterOnTypeOn=new Codicon("tree-filter-on-type-on",Codicon.listFilter.definition),Codicon.treeFilterOnTypeOff=new Codicon("tree-filter-on-type-off",Codicon.listSelection.definition),Codicon.treeFilterClear=new Codicon("tree-filter-clear",Codicon.close.definition),Codicon.treeItemLoading=new Codicon("tree-item-loading",Codicon.loading.definition),Codicon.menuSelection=new Codicon("menu-selection",Codicon.check.definition),Codicon.menuSubmenu=new Codicon("menu-submenu",Codicon.chevronRight.definition),Codicon.menuBarMore=new Codicon("menubar-more",Codicon.more.definition),Codicon.scrollbarButtonLeft=new Codicon("scrollbar-button-left",Codicon.triangleLeft.definition),Codicon.scrollbarButtonRight=new Codicon("scrollbar-button-right",Codicon.triangleRight.definition),Codicon.scrollbarButtonUp=new Codicon("scrollbar-button-up",Codicon.triangleUp.definition),Codicon.scrollbarButtonDown=new Codicon("scrollbar-button-down",Codicon.triangleDown.definition),Codicon.toolBarMore=new Codicon("toolbar-more",Codicon.more.definition),Codicon.quickInputBack=new Codicon("quick-input-back",Codicon.arrowLeft.definition),function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9-]+",e.iconModifierExpression="~[A-Za-z]+",e.iconNameCharacter="[A-Za-z0-9~-]";const t=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function n(e){if(e instanceof Codicon)return["codicon","codicon-"+e.id];const i=t.exec(e.id);if(!i)return n(Codicon.error);let[,o,r]=i;const s=["codicon","codicon-"+o];return r&&s.push("codicon-modifier-"+r.substr(1)),s}e.asClassNameArray=n,e.asClassName=function(e){return n(e).join(" ")},e.asCSSSelector=function(e){return"."+n(e).join(".")}}(CSSIcon||(CSSIcon={}));const ICommandService=createDecorator("commandService"),CommandsRegistry=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Emitter$1,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.description){const t=[];for(let i of e.description.args)t.push(i.constraint);const n=e.handler;e.handler=function(e,...i){return validateConstraints(i,t),n(e,...i)}}const{id:n}=e;let i=this._commands.get(n);i||(i=new LinkedList,this._commands.set(n,i));let o=i.unshift(e),r=toDisposable((()=>{o();const e=this._commands.get(n);(null==e?void 0:e.isEmpty())&&this._commands.delete(n)}));return this._onDidRegisterCommand.fire(n),r}registerCommandAlias(e,t){return CommandsRegistry.registerCommand(e,((e,...n)=>e.get(ICommandService).executeCommand(t,...n)))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return Iterable.first(t)}getCommands(){const e=new Map;for(const t of this._commands.keys()){const n=this.getCommand(t);n&&e.set(t,n)}return e}};CommandsRegistry.registerCommand("noop",(()=>{}));class LRUCachedComputed{constructor(e){this.computeFn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.computeFn(e)),this.lastCache}}class Lazy{constructor(e){this.executor=e,this._didRun=!1}getValue(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var _a$d;function isFalsyOrWhitespace(e){return!e||"string"!=typeof e||0===e.trim().length}const _formatRegexp=/{(\d+)}/g;function format(e,...t){return 0===t.length?e:e.replace(_formatRegexp,(function(e,n){const i=parseInt(n,10);return isNaN(i)||i<0||i>=t.length?e:t[i]}))}function escape(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}}))}function escapeRegExpCharacters(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function ltrim(e,t){if(!e||!t)return e;const n=t.length;if(0===n||0===e.length)return e;let i=0;for(;e.indexOf(t,i)===i;)i+=n;return e.substring(i)}function rtrim(e,t){if(!e||!t)return e;const n=t.length,i=e.length;if(0===n||0===i)return e;let o=i,r=-1;for(;r=e.lastIndexOf(t,o-1),-1!==r&&r+n===o;){if(0===r)return"";o=r}return e.substring(0,o)}function convertSimple2RegExpPattern(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function createRegExp(e,t,n={}){if(!e)throw new Error("Cannot create regex from empty string");t||(e=escapeRegExpCharacters(e)),n.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let i="";return n.global&&(i+="g"),n.matchCase||(i+="i"),n.multiline&&(i+="m"),n.unicode&&(i+="u"),new RegExp(e,i)}function regExpLeadsToEndlessLoop(e){if("^"===e.source||"^$"===e.source||"$"===e.source||"^\\s*$"===e.source)return!1;return!(!e.exec("")||0!==e.lastIndex)}function regExpFlags(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")}function splitLines(e){return e.split(/\r\n|\r|\n/)}function firstNonWhitespaceIndex(e){for(let t=0,n=e.length;t<n;t++){const n=e.charCodeAt(t);if(32!==n&&9!==n)return t}return-1}function getLeadingWhitespace(e,t=0,n=e.length){for(let i=t;i<n;i++){const n=e.charCodeAt(i);if(32!==n&&9!==n)return e.substring(t,i)}return e.substring(t,n)}function lastNonWhitespaceIndex(e,t=e.length-1){for(let n=t;n>=0;n--){const t=e.charCodeAt(n);if(32!==t&&9!==t)return n}return-1}function compare(e,t){return e<t?-1:e>t?1:0}function compareSubstring(e,t,n=0,i=e.length,o=0,r=t.length){for(;n<i&&o<r;n++,o++){let i=e.charCodeAt(n),r=t.charCodeAt(o);if(i<r)return-1;if(i>r)return 1}const s=i-n,a=r-o;return s<a?-1:s>a?1:0}function compareIgnoreCase(e,t){return compareSubstringIgnoreCase(e,t,0,e.length,0,t.length)}function compareSubstringIgnoreCase(e,t,n=0,i=e.length,o=0,r=t.length){for(;n<i&&o<r;n++,o++){let s=e.charCodeAt(n),a=t.charCodeAt(o);if(s===a)continue;if(s>=128||a>=128)return compareSubstring(e.toLowerCase(),t.toLowerCase(),n,i,o,r);isLowerAsciiLetter(s)&&(s-=32),isLowerAsciiLetter(a)&&(a-=32);const l=s-a;if(0!==l)return l}const s=i-n,a=r-o;return s<a?-1:s>a?1:0}function isLowerAsciiLetter(e){return e>=97&&e<=122}function isUpperAsciiLetter(e){return e>=65&&e<=90}function equalsIgnoreCase(e,t){return e.length===t.length&&0===compareSubstringIgnoreCase(e,t)}function startsWithIgnoreCase(e,t){const n=t.length;return!(t.length>e.length)&&0===compareSubstringIgnoreCase(e,t,0,n)}function commonPrefixLength(e,t){let n,i=Math.min(e.length,t.length);for(n=0;n<i;n++)if(e.charCodeAt(n)!==t.charCodeAt(n))return n;return i}function commonSuffixLength(e,t){let n,i=Math.min(e.length,t.length);const o=e.length-1,r=t.length-1;for(n=0;n<i;n++)if(e.charCodeAt(o-n)!==t.charCodeAt(r-n))return n;return i}function isHighSurrogate(e){return 55296<=e&&e<=56319}function isLowSurrogate(e){return 56320<=e&&e<=57343}function computeCodePoint(e,t){return t-56320+(e-55296<<10)+65536}function getNextCodePoint(e,t,n){const i=e.charCodeAt(n);if(isHighSurrogate(i)&&n+1<t){const t=e.charCodeAt(n+1);if(isLowSurrogate(t))return computeCodePoint(i,t)}return i}function getPrevCodePoint(e,t){const n=e.charCodeAt(t-1);if(isLowSurrogate(n)&&t>1){const i=e.charCodeAt(t-2);if(isHighSurrogate(i))return computeCodePoint(i,n)}return n}class CodePointIterator{constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}get offset(){return this._offset}setOffset(e){this._offset=e}prevCodePoint(){const e=getPrevCodePoint(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=getNextCodePoint(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class GraphemeIterator{constructor(e,t=0){this._iterator=new CodePointIterator(e,t)}get offset(){return this._iterator.offset}nextGraphemeLength(){const e=GraphemeBreakTree.getInstance(),t=this._iterator,n=t.offset;let i=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const n=t.offset,o=e.getGraphemeBreakType(t.nextCodePoint());if(breakBetweenGraphemeBreakType(i,o)){t.setOffset(n);break}i=o}return t.offset-n}prevGraphemeLength(){const e=GraphemeBreakTree.getInstance(),t=this._iterator,n=t.offset;let i=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const n=t.offset,o=e.getGraphemeBreakType(t.prevCodePoint());if(breakBetweenGraphemeBreakType(o,i)){t.setOffset(n);break}i=o}return n-t.offset}eol(){return this._iterator.eol()}}function nextCharLength(e,t){return new GraphemeIterator(e,t).nextGraphemeLength()}function prevCharLength(e,t){return new GraphemeIterator(e,t).prevGraphemeLength()}function getCharContainingOffset(e,t){t>0&&isLowSurrogate(e.charCodeAt(t))&&t--;const n=t+nextCharLength(e,t);return[n-prevCharLength(e,n),n]}const CONTAINS_RTL=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function containsRTL(e){return CONTAINS_RTL.test(e)}const IS_BASIC_ASCII=/^[\t\n\r\x20-\x7E]*$/;function isBasicASCII(e){return IS_BASIC_ASCII.test(e)}const UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function containsUnusualLineTerminators(e){return UNUSUAL_LINE_TERMINATORS.test(e)}function isFullWidthCharacter(e){return e>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function isEmojiImprecise(e){return e>=127462&&e<=127487||8986===e||8987===e||9200===e||9203===e||e>=9728&&e<=10175||11088===e||11093===e||e>=127744&&e<=128591||e>=128640&&e<=128764||e>=128992&&e<=129008||e>=129280&&e<=129535||e>=129648&&e<=129782}const UTF8_BOM_CHARACTER=String.fromCharCode(65279);function startsWithUTF8BOM(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function containsUppercaseCharacter(e,t=!1){return!!e&&(t&&(e=e.replace(/\\./g,"")),e.toLowerCase()!==e)}function singleLetterHash(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)}function breakBetweenGraphemeBreakType(e,t){return 0===e?5!==t&&7!==t:(2!==e||3!==t)&&(4===e||2===e||3===e||(4===t||2===t||3===t||(8!==e||8!==t&&9!==t&&11!==t&&12!==t)&&((11!==e&&9!==e||9!==t&&10!==t)&&((12!==e&&10!==e||10!==t)&&(5!==t&&13!==t&&(7!==t&&(1!==e&&((13!==e||14!==t)&&(6!==e||6!==t)))))))))}class GraphemeBreakTree{constructor(){this._data=getGraphemeBreakRawData()}static getInstance(){return GraphemeBreakTree._INSTANCE||(GraphemeBreakTree._INSTANCE=new GraphemeBreakTree),GraphemeBreakTree._INSTANCE}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;const t=this._data,n=t.length/3;let i=1;for(;i<=n;)if(e<t[3*i])i*=2;else{if(!(e>t[3*i+1]))return t[3*i+2];i=2*i+1}return 0}}function getGraphemeBreakRawData(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function getLeftDeleteOffset(e,t){if(0===e)return 0;const n=getOffsetBeforeLastEmojiComponent(e,t);if(void 0!==n)return n;const i=new CodePointIterator(t,e);return i.prevCodePoint(),i.offset}function getOffsetBeforeLastEmojiComponent(e,t){const n=new CodePointIterator(t,e);let i=n.prevCodePoint();for(;isEmojiModifier(i)||65039===i||8419===i;){if(0===n.offset)return;i=n.prevCodePoint()}if(!isEmojiImprecise(i))return;let o=n.offset;if(o>0){8205===n.prevCodePoint()&&(o=n.offset)}return o}function isEmojiModifier(e){return 127995<=e&&e<=127999}GraphemeBreakTree._INSTANCE=null;const noBreakWhitespace=" ";class AmbiguousCharacters{constructor(e){this.confusableDictionary=e}static getInstance(e){return AmbiguousCharacters.cache.get(Array.from(e))}static getLocales(){return AmbiguousCharacters._locales.getValue()}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}_a$d=AmbiguousCharacters,AmbiguousCharacters.ambiguousCharacterData=new Lazy((()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'))),AmbiguousCharacters.cache=new LRUCachedComputed((e=>{function t(e){const t=new Map;for(let n=0;n<e.length;n+=2)t.set(e[n],e[n+1]);return t}function n(e,t){if(!e)return t;const n=new Map;for(const[i,o]of e)t.has(i)&&n.set(i,o);return n}const i=_a$d.ambiguousCharacterData.getValue();let o,r=e.filter((e=>!e.startsWith("_")&&e in i));0===r.length&&(r=["_default"]);for(const a of r){o=n(o,t(i[a]))}const s=function(e,t){const n=new Map(e);for(const[i,o]of t)n.set(i,o);return n}(t(i._common),o);return new AmbiguousCharacters(s)})),AmbiguousCharacters._locales=new Lazy((()=>Object.keys(AmbiguousCharacters.ambiguousCharacterData.getValue()).filter((e=>!e.startsWith("_")))));class InvisibleCharacters{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(InvisibleCharacters.getRawData())),this._data}static isInvisibleCharacter(e){return InvisibleCharacters.getData().has(e)}static get codePoints(){return InvisibleCharacters.getData()}}InvisibleCharacters._data=void 0;const CONSTANT_VALUES=new Map;CONSTANT_VALUES.set("false",!1),CONSTANT_VALUES.set("true",!0),CONSTANT_VALUES.set("isMac",isMacintosh),CONSTANT_VALUES.set("isLinux",isLinux),CONSTANT_VALUES.set("isWindows",isWindows),CONSTANT_VALUES.set("isWeb",isWeb),CONSTANT_VALUES.set("isMacNative",isMacintosh&&!isWeb),CONSTANT_VALUES.set("isEdge",isEdge),CONSTANT_VALUES.set("isFirefox",isFirefox$1),CONSTANT_VALUES.set("isChrome",isChrome$1),CONSTANT_VALUES.set("isSafari",isSafari$1);const hasOwnProperty$3=Object.prototype.hasOwnProperty;class ContextKeyExpr{static has(e){return ContextKeyDefinedExpr.create(e)}static equals(e,t){return ContextKeyEqualsExpr.create(e,t)}static regex(e,t){return ContextKeyRegexExpr.create(e,t)}static not(e){return ContextKeyNotExpr.create(e)}static and(...e){return ContextKeyAndExpr.create(e,null)}static or(...e){return ContextKeyOrExpr.create(e,null,!0)}static deserialize(e,t=!1){if(e)return this._deserializeOrExpression(e,t)}static _deserializeOrExpression(e,t){let n=e.split("||");return ContextKeyOrExpr.create(n.map((e=>this._deserializeAndExpression(e,t))),null,!0)}static _deserializeAndExpression(e,t){let n=e.split("&&");return ContextKeyAndExpr.create(n.map((e=>this._deserializeOne(e,t))),null)}static _deserializeOne(e,t){if((e=e.trim()).indexOf("!=")>=0){let n=e.split("!=");return ContextKeyNotEqualsExpr.create(n[0].trim(),this._deserializeValue(n[1],t))}if(e.indexOf("==")>=0){let n=e.split("==");return ContextKeyEqualsExpr.create(n[0].trim(),this._deserializeValue(n[1],t))}if(e.indexOf("=~")>=0){let n=e.split("=~");return ContextKeyRegexExpr.create(n[0].trim(),this._deserializeRegexValue(n[1],t))}if(e.indexOf(" in ")>=0){let t=e.split(" in ");return ContextKeyInExpr.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(e)){const t=e.split(">=");return ContextKeyGreaterEqualsExpr.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(e)){const t=e.split(">");return ContextKeyGreaterExpr.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(e)){const t=e.split("<=");return ContextKeySmallerEqualsExpr.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(e)){const t=e.split("<");return ContextKeySmallerExpr.create(t[0].trim(),t[1].trim())}return/^\!\s*/.test(e)?ContextKeyNotExpr.create(e.substr(1).trim()):ContextKeyDefinedExpr.create(e)}static _deserializeValue(e,t){if("true"===(e=e.trim()))return!0;if("false"===e)return!1;let n=/^'([^']*)'$/.exec(e);return n?n[1].trim():e}static _deserializeRegexValue(e,t){if(isFalsyOrWhitespace(e)){if(t)throw new Error("missing regexp-value for =~-expression");return null}let n=e.indexOf("/"),i=e.lastIndexOf("/");if(n===i||n<0){if(t)throw new Error(`bad regexp-value '${e}', missing /-enclosure`);return null}let o=e.slice(n+1,i),r="i"===e[i+1]?"i":"";try{return new RegExp(o,r)}catch(e2){if(t)throw new Error(`bad regexp-value '${e}', parse error: ${e2}`);return null}}}function expressionsAreEqualWithConstantSubstitution(e,t){const n=e?e.substituteConstants():void 0,i=t?t.substituteConstants():void 0;return!n&&!i||!(!n||!i)&&n.equals(i)}function cmp(e,t){return e.cmp(t)}class ContextKeyFalseExpr{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return ContextKeyTrueExpr.INSTANCE}}ContextKeyFalseExpr.INSTANCE=new ContextKeyFalseExpr;class ContextKeyTrueExpr{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return ContextKeyFalseExpr.INSTANCE}}ContextKeyTrueExpr.INSTANCE=new ContextKeyTrueExpr;class ContextKeyDefinedExpr{constructor(e,t){this.key=e,this.negated=t,this.type=2}static create(e,t=null){const n=CONSTANT_VALUES.get(e);return"boolean"==typeof n?n?ContextKeyTrueExpr.INSTANCE:ContextKeyFalseExpr.INSTANCE:new ContextKeyDefinedExpr(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:cmp1(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=CONSTANT_VALUES.get(this.key);return"boolean"==typeof e?e?ContextKeyTrueExpr.INSTANCE:ContextKeyFalseExpr.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeyNotExpr.create(this.key,this)),this.negated}}class ContextKeyEqualsExpr{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=4}static create(e,t,n=null){if("boolean"==typeof t)return t?ContextKeyDefinedExpr.create(e,n):ContextKeyNotExpr.create(e,n);const i=CONSTANT_VALUES.get(e);if("boolean"==typeof i){return t===(i?"true":"false")?ContextKeyTrueExpr.INSTANCE:ContextKeyFalseExpr.INSTANCE}return new ContextKeyEqualsExpr(e,t,n)}cmp(e){return e.type!==this.type?this.type-e.type:cmp2(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){const e=CONSTANT_VALUES.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?ContextKeyTrueExpr.INSTANCE:ContextKeyFalseExpr.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeyNotEqualsExpr.create(this.key,this.value,this)),this.negated}}class ContextKeyInExpr{constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}static create(e,t){return new ContextKeyInExpr(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:cmp2(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type&&(this.key===e.key&&this.valueKey===e.valueKey)}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),n=e.getValue(this.key);return Array.isArray(t)?t.indexOf(n)>=0:"string"==typeof n&&"object"==typeof t&&null!==t&&hasOwnProperty$3.call(t,n)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=ContextKeyNotInExpr.create(this)),this.negated}}class ContextKeyNotInExpr{constructor(e){this._actual=e,this.type=11}static create(e){return new ContextKeyNotInExpr(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class ContextKeyNotEqualsExpr{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=5}static create(e,t,n=null){if("boolean"==typeof t)return t?ContextKeyNotExpr.create(e,n):ContextKeyDefinedExpr.create(e,n);const i=CONSTANT_VALUES.get(e);if("boolean"==typeof i){return t===(i?"true":"false")?ContextKeyFalseExpr.INSTANCE:ContextKeyTrueExpr.INSTANCE}return new ContextKeyNotEqualsExpr(e,t,n)}cmp(e){return e.type!==this.type?this.type-e.type:cmp2(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){const e=CONSTANT_VALUES.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?ContextKeyFalseExpr.INSTANCE:ContextKeyTrueExpr.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeyEqualsExpr.create(this.key,this.value,this)),this.negated}}class ContextKeyNotExpr{constructor(e,t){this.key=e,this.negated=t,this.type=3}static create(e,t=null){const n=CONSTANT_VALUES.get(e);return"boolean"==typeof n?n?ContextKeyFalseExpr.INSTANCE:ContextKeyTrueExpr.INSTANCE:new ContextKeyNotExpr(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:cmp1(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=CONSTANT_VALUES.get(this.key);return"boolean"==typeof e?e?ContextKeyFalseExpr.INSTANCE:ContextKeyTrueExpr.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeyDefinedExpr.create(this.key,this)),this.negated}}function withFloatOrStr(e,t){if("string"==typeof e){const t=parseFloat(e);isNaN(t)||(e=t)}return"string"==typeof e||"number"==typeof e?t(e):ContextKeyFalseExpr.INSTANCE}class ContextKeyGreaterExpr{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=12}static create(e,t,n=null){return withFloatOrStr(t,(t=>new ContextKeyGreaterExpr(e,t,n)))}cmp(e){return e.type!==this.type?this.type-e.type:cmp2(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeySmallerEqualsExpr.create(this.key,this.value,this)),this.negated}}class ContextKeyGreaterEqualsExpr{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=13}static create(e,t,n=null){return withFloatOrStr(t,(t=>new ContextKeyGreaterEqualsExpr(e,t,n)))}cmp(e){return e.type!==this.type?this.type-e.type:cmp2(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeySmallerExpr.create(this.key,this.value,this)),this.negated}}class ContextKeySmallerExpr{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=14}static create(e,t,n=null){return withFloatOrStr(t,(t=>new ContextKeySmallerExpr(e,t,n)))}cmp(e){return e.type!==this.type?this.type-e.type:cmp2(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeyGreaterEqualsExpr.create(this.key,this.value,this)),this.negated}}class ContextKeySmallerEqualsExpr{constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=15}static create(e,t,n=null){return withFloatOrStr(t,(t=>new ContextKeySmallerEqualsExpr(e,t,n)))}cmp(e){return e.type!==this.type?this.type-e.type:cmp2(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeyGreaterExpr.create(this.key,this.value,this)),this.negated}}class ContextKeyRegexExpr{constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}static create(e,t){return new ContextKeyRegexExpr(e,t)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return t<n?-1:t>n?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return this.key===e.key&&t===n}return!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeyNotRegexExpr.create(this)),this.negated}}class ContextKeyNotRegexExpr{constructor(e){this._actual=e,this.type=8}static create(e){return new ContextKeyNotRegexExpr(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function eliminateConstantsInArray(e){let t=null;for(let n=0,i=e.length;n<i;n++){const i=e[n].substituteConstants();if(e[n]!==i&&null===t){t=[];for(let i=0;i<n;i++)t[i]=e[i]}null!==t&&(t[n]=i)}return null===t?e:t}class ContextKeyAndExpr{constructor(e,t){this.expr=e,this.negated=t,this.type=6}static create(e,t){return ContextKeyAndExpr._normalizeArr(e,t)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,n=this.expr.length;t<n;t++){const n=cmp(this.expr[t],e.expr[t]);if(0!==n)return n}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=eliminateConstantsInArray(this.expr);return e===this.expr?this:ContextKeyAndExpr.create(e,this.negated)}evaluate(e){for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(e,t){const n=[];let i=!1;for(const o of e)if(o)if(1!==o.type){if(0===o.type)return ContextKeyFalseExpr.INSTANCE;6!==o.type?n.push(o):n.push(...o.expr)}else i=!0;if(0===n.length&&i)return ContextKeyTrueExpr.INSTANCE;if(0!==n.length){if(1===n.length)return n[0];n.sort(cmp);for(let e=1;e<n.length;e++)n[e-1].equals(n[e])&&(n.splice(e,1),e--);if(1===n.length)return n[0];for(;n.length>1;){const e=n[n.length-1];if(9!==e.type)break;n.pop();const t=n.pop(),i=0===n.length,o=ContextKeyOrExpr.create(e.expr.map((e=>ContextKeyAndExpr.create([e,t],null))),null,i);o&&(n.push(o),n.sort(cmp))}return 1===n.length?n[0]:new ContextKeyAndExpr(n,t)}}serialize(){return this.expr.map((e=>e.serialize())).join(" && ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(let t of this.expr)e.push(t.negate());this.negated=ContextKeyOrExpr.create(e,this,!0)}return this.negated}}class ContextKeyOrExpr{constructor(e,t){this.expr=e,this.negated=t,this.type=9}static create(e,t,n){return ContextKeyOrExpr._normalizeArr(e,t,n)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,n=this.expr.length;t<n;t++){const n=cmp(this.expr[t],e.expr[t]);if(0!==n)return n}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=eliminateConstantsInArray(this.expr);return e===this.expr?this:ContextKeyOrExpr.create(e,this.negated,!1)}evaluate(e){for(let t=0,n=this.expr.length;t<n;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(e,t,n){let i=[],o=!1;if(e){for(let t=0,n=e.length;t<n;t++){const n=e[t];if(n)if(0!==n.type){if(1===n.type)return ContextKeyTrueExpr.INSTANCE;9!==n.type?i.push(n):i=i.concat(n.expr)}else o=!0}if(0===i.length&&o)return ContextKeyFalseExpr.INSTANCE;i.sort(cmp)}if(0!==i.length){if(1===i.length)return i[0];for(let e=1;e<i.length;e++)i[e-1].equals(i[e])&&(i.splice(e,1),e--);if(1===i.length)return i[0];if(n){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)implies(i[e],i[t])&&(i.splice(t,1),t--);if(1===i.length)return i[0]}return new ContextKeyOrExpr(i,t)}}serialize(){return this.expr.map((e=>e.serialize())).join(" || ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),n=e.shift(),i=[];for(const e of getTerminals(t))for(const t of getTerminals(n))i.push(ContextKeyAndExpr.create([e,t],null));const o=0===e.length;e.unshift(ContextKeyOrExpr.create(i,null,o))}this.negated=e[0]}return this.negated}}class RawContextKey extends ContextKeyDefinedExpr{constructor(e,t,n){super(e,null),this._defaultValue=t,"object"==typeof n?RawContextKey._info.push(Object.assign(Object.assign({},n),{key:e})):!0!==n&&RawContextKey._info.push({key:e,description:n,type:null!=t?typeof t:void 0})}static all(){return RawContextKey._info.values()}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return ContextKeyEqualsExpr.create(this.key,e)}}RawContextKey._info=[];const IContextKeyService=createDecorator("contextKeyService"),SET_CONTEXT_COMMAND_ID="setContext";function cmp1(e,t){return e<t?-1:e>t?1:0}function cmp2(e,t,n,i){return e<n?-1:e>n?1:t<i?-1:t>i?1:0}function implies(e,t){if(6===t.type&&9!==e.type&&6!==e.type)for(const i of t.expr)if(e.equals(i))return!0;const n=getTerminals(e.negate()).concat(getTerminals(t));n.sort(cmp);for(let i=0;i<n.length;i++){const e=n[i].negate();for(let t=i+1;t<n.length;t++){const i=n[t];if(e.equals(i))return!0}}return!1}function getTerminals(e){return 9===e.type?e.expr:[e]}function ok(e,t){if(!e)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}class RegistryImpl{constructor(){this.data=new Map}add(e,t){ok(isString$1(e)),ok(isObject(t)),ok(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}as(e){return this.data.get(e)||null}}const Registry=new RegistryImpl;var ColorScheme,ColorScheme2;ColorScheme2=ColorScheme||(ColorScheme={}),ColorScheme2.DARK="dark",ColorScheme2.LIGHT="light",ColorScheme2.HIGH_CONTRAST="hc";const IThemeService=createDecorator("themeService");var ThemeColor,ThemeIcon;function themeColorFromId(e){return{id:e}}function getThemeTypeSelector(e){switch(e){case ColorScheme.DARK:return"vs-dark";case ColorScheme.HIGH_CONTRAST:return"hc-black";default:return"vs"}}(ThemeColor||(ThemeColor={})).isThemeColor=function(e){return e&&"object"==typeof e&&"string"==typeof e.id},function(e){e.isThemeIcon=function(e){return e&&"object"==typeof e&&"string"==typeof e.id&&(void 0===e.color||ThemeColor.isThemeColor(e.color))};const t=new RegExp(`^\\$\\((${CSSIcon.iconNameExpression}(?:${CSSIcon.iconModifierExpression})?)\\)$`);e.fromString=function(e){const n=t.exec(e);if(!n)return;let[,i]=n;return{id:i}},e.fromId=function(e){return{id:e}},e.modify=function(e,t){let n=e.id;const i=n.lastIndexOf("~");return-1!==i&&(n=n.substring(0,i)),t&&(n=`${n}~${t}`),{id:n}},e.getModifier=function(e){const t=e.id.lastIndexOf("~");if(-1!==t)return e.id.substring(t+1)},e.isEqual=function(e,t){var n,i;return e.id===t.id&&(null===(n=e.color)||void 0===n?void 0:n.id)===(null===(i=t.color)||void 0===i?void 0:i.id)},e.asThemeIcon=function(e,t){return{id:e.id,color:t?themeColorFromId(t):void 0}},e.asClassNameArray=CSSIcon.asClassNameArray,e.asClassName=CSSIcon.asClassName,e.asCSSSelector=CSSIcon.asCSSSelector}(ThemeIcon||(ThemeIcon={}));const Extensions$8={ThemingContribution:"base.contributions.theming"};class ThemingRegistry{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Emitter$1}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),toDisposable((()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)}))}getThemingParticipants(){return this.themingParticipants}}let themingRegistry$1=new ThemingRegistry;function registerThemingParticipant(e){return themingRegistry$1.onColorThemeChange(e)}Registry.add(Extensions$8.ThemingContribution,themingRegistry$1);class Themable extends Disposable{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange((e=>this.onThemeChange(e))))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}var __decorate$1B=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1v=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};function isIMenuItem(e){return void 0!==e.command}class MenuId{constructor(e){this.id=MenuId._idPool++,this._debugName=e}}MenuId._idPool=0,MenuId.CommandPalette=new MenuId("CommandPalette"),MenuId.DebugBreakpointsContext=new MenuId("DebugBreakpointsContext"),MenuId.DebugCallStackContext=new MenuId("DebugCallStackContext"),MenuId.DebugConsoleContext=new MenuId("DebugConsoleContext"),MenuId.DebugVariablesContext=new MenuId("DebugVariablesContext"),MenuId.DebugWatchContext=new MenuId("DebugWatchContext"),MenuId.DebugToolBar=new MenuId("DebugToolBar"),MenuId.EditorContext=new MenuId("EditorContext"),MenuId.SimpleEditorContext=new MenuId("SimpleEditorContext"),MenuId.EditorContextCopy=new MenuId("EditorContextCopy"),MenuId.EditorContextPeek=new MenuId("EditorContextPeek"),MenuId.EditorTitle=new MenuId("EditorTitle"),MenuId.EditorTitleRun=new MenuId("EditorTitleRun"),MenuId.EditorTitleContext=new MenuId("EditorTitleContext"),MenuId.EmptyEditorGroup=new MenuId("EmptyEditorGroup"),MenuId.EmptyEditorGroupContext=new MenuId("EmptyEditorGroupContext"),MenuId.ExplorerContext=new MenuId("ExplorerContext"),MenuId.ExtensionContext=new MenuId("ExtensionContext"),MenuId.GlobalActivity=new MenuId("GlobalActivity"),MenuId.LayoutControlMenuSubmenu=new MenuId("LayoutControlMenuSubmenu"),MenuId.LayoutControlMenu=new MenuId("LayoutControlMenu"),MenuId.MenubarMainMenu=new MenuId("MenubarMainMenu"),MenuId.MenubarAppearanceMenu=new MenuId("MenubarAppearanceMenu"),MenuId.MenubarDebugMenu=new MenuId("MenubarDebugMenu"),MenuId.MenubarEditMenu=new MenuId("MenubarEditMenu"),MenuId.MenubarCopy=new MenuId("MenubarCopy"),MenuId.MenubarFileMenu=new MenuId("MenubarFileMenu"),MenuId.MenubarGoMenu=new MenuId("MenubarGoMenu"),MenuId.MenubarHelpMenu=new MenuId("MenubarHelpMenu"),MenuId.MenubarLayoutMenu=new MenuId("MenubarLayoutMenu"),MenuId.MenubarNewBreakpointMenu=new MenuId("MenubarNewBreakpointMenu"),MenuId.MenubarPanelAlignmentMenu=new MenuId("MenubarPanelAlignmentMenu"),MenuId.MenubarPanelPositionMenu=new MenuId("MenubarPanelPositionMenu"),MenuId.MenubarPreferencesMenu=new MenuId("MenubarPreferencesMenu"),MenuId.MenubarRecentMenu=new MenuId("MenubarRecentMenu"),MenuId.MenubarSelectionMenu=new MenuId("MenubarSelectionMenu"),MenuId.MenubarSwitchEditorMenu=new MenuId("MenubarSwitchEditorMenu"),MenuId.MenubarSwitchGroupMenu=new MenuId("MenubarSwitchGroupMenu"),MenuId.MenubarTerminalMenu=new MenuId("MenubarTerminalMenu"),MenuId.MenubarViewMenu=new MenuId("MenubarViewMenu"),MenuId.MenubarHomeMenu=new MenuId("MenubarHomeMenu"),MenuId.OpenEditorsContext=new MenuId("OpenEditorsContext"),MenuId.ProblemsPanelContext=new MenuId("ProblemsPanelContext"),MenuId.SCMChangeContext=new MenuId("SCMChangeContext"),MenuId.SCMResourceContext=new MenuId("SCMResourceContext"),MenuId.SCMResourceFolderContext=new MenuId("SCMResourceFolderContext"),MenuId.SCMResourceGroupContext=new MenuId("SCMResourceGroupContext"),MenuId.SCMSourceControl=new MenuId("SCMSourceControl"),MenuId.SCMTitle=new MenuId("SCMTitle"),MenuId.SearchContext=new MenuId("SearchContext"),MenuId.StatusBarWindowIndicatorMenu=new MenuId("StatusBarWindowIndicatorMenu"),MenuId.StatusBarRemoteIndicatorMenu=new MenuId("StatusBarRemoteIndicatorMenu"),MenuId.TestItem=new MenuId("TestItem"),MenuId.TestItemGutter=new MenuId("TestItemGutter"),MenuId.TestPeekElement=new MenuId("TestPeekElement"),MenuId.TestPeekTitle=new MenuId("TestPeekTitle"),MenuId.TouchBarContext=new MenuId("TouchBarContext"),MenuId.TitleBarContext=new MenuId("TitleBarContext"),MenuId.TunnelContext=new MenuId("TunnelContext"),MenuId.TunnelPrivacy=new MenuId("TunnelPrivacy"),MenuId.TunnelProtocol=new MenuId("TunnelProtocol"),MenuId.TunnelPortInline=new MenuId("TunnelInline"),MenuId.TunnelTitle=new MenuId("TunnelTitle"),MenuId.TunnelLocalAddressInline=new MenuId("TunnelLocalAddressInline"),MenuId.TunnelOriginInline=new MenuId("TunnelOriginInline"),MenuId.ViewItemContext=new MenuId("ViewItemContext"),MenuId.ViewContainerTitle=new MenuId("ViewContainerTitle"),MenuId.ViewContainerTitleContext=new MenuId("ViewContainerTitleContext"),MenuId.ViewTitle=new MenuId("ViewTitle"),MenuId.ViewTitleContext=new MenuId("ViewTitleContext"),MenuId.CommentThreadTitle=new MenuId("CommentThreadTitle"),MenuId.CommentThreadActions=new MenuId("CommentThreadActions"),MenuId.CommentTitle=new MenuId("CommentTitle"),MenuId.CommentActions=new MenuId("CommentActions"),MenuId.InteractiveToolbar=new MenuId("InteractiveToolbar"),MenuId.InteractiveCellTitle=new MenuId("InteractiveCellTitle"),MenuId.InteractiveCellExecute=new MenuId("InteractiveCellExecute"),MenuId.InteractiveInputExecute=new MenuId("InteractiveInputExecute"),MenuId.NotebookToolbar=new MenuId("NotebookToolbar"),MenuId.NotebookCellTitle=new MenuId("NotebookCellTitle"),MenuId.NotebookCellInsert=new MenuId("NotebookCellInsert"),MenuId.NotebookCellBetween=new MenuId("NotebookCellBetween"),MenuId.NotebookCellListTop=new MenuId("NotebookCellTop"),MenuId.NotebookCellExecute=new MenuId("NotebookCellExecute"),MenuId.NotebookCellExecutePrimary=new MenuId("NotebookCellExecutePrimary"),MenuId.NotebookDiffCellInputTitle=new MenuId("NotebookDiffCellInputTitle"),MenuId.NotebookDiffCellMetadataTitle=new MenuId("NotebookDiffCellMetadataTitle"),MenuId.NotebookDiffCellOutputsTitle=new MenuId("NotebookDiffCellOutputsTitle"),MenuId.NotebookOutputToolbar=new MenuId("NotebookOutputToolbar"),MenuId.NotebookEditorLayoutConfigure=new MenuId("NotebookEditorLayoutConfigure"),MenuId.BulkEditTitle=new MenuId("BulkEditTitle"),MenuId.BulkEditContext=new MenuId("BulkEditContext"),MenuId.TimelineItemContext=new MenuId("TimelineItemContext"),MenuId.TimelineTitle=new MenuId("TimelineTitle"),MenuId.TimelineTitleContext=new MenuId("TimelineTitleContext"),MenuId.AccountsContext=new MenuId("AccountsContext"),MenuId.PanelTitle=new MenuId("PanelTitle"),MenuId.AuxiliaryBarTitle=new MenuId("AuxiliaryBarTitle"),MenuId.TerminalInstanceContext=new MenuId("TerminalInstanceContext"),MenuId.TerminalEditorInstanceContext=new MenuId("TerminalEditorInstanceContext"),MenuId.TerminalNewDropdownContext=new MenuId("TerminalNewDropdownContext"),MenuId.TerminalTabContext=new MenuId("TerminalTabContext"),MenuId.TerminalTabEmptyAreaContext=new MenuId("TerminalTabEmptyAreaContext"),MenuId.TerminalInlineTabContext=new MenuId("TerminalInlineTabContext"),MenuId.WebviewContext=new MenuId("WebviewContext"),MenuId.InlineCompletionsActions=new MenuId("InlineCompletionsActions"),MenuId.NewFile=new MenuId("NewFile");const IMenuService=createDecorator("menuService"),MenuRegistry=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Emitter$1,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:e=>e===MenuId.CommandPalette}}addCommand(e){return this.addCommands(Iterable.single(e))}addCommands(e){for(const t of e)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),toDisposable((()=>{let t=!1;for(const n of e)t=this._commands.delete(n.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)}))}getCommand(e){return this._commands.get(e)}getCommands(){const e=new Map;return this._commands.forEach(((t,n)=>e.set(n,t))),e}appendMenuItem(e,t){return this.appendMenuItems(Iterable.single({id:e,item:t}))}appendMenuItems(e){const t=new Set,n=new LinkedList;for(const{id:i,item:o}of e){let e=this._menuItems.get(i);e||(e=new LinkedList,this._menuItems.set(i,e)),n.push(e.push(o)),t.add(i)}return this._onDidChangeMenu.fire(t),toDisposable((()=>{if(n.size>0){for(let e of n)e();this._onDidChangeMenu.fire(t),n.clear()}}))}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===MenuId.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const n of e)isIMenuItem(n)&&(t.add(n.command.id),n.alt&&t.add(n.alt.id));this._commands.forEach(((n,i)=>{t.has(i)||e.push({command:n})}))}};class SubmenuItemAction extends SubmenuAction{constructor(e,t,n,i){super(`submenuitem.${e.submenu.id}`,"string"==typeof e.title?e.title:e.title.value,[],"submenu"),this.item=e,this._menuService=t,this._contextKeyService=n,this._options=i}get actions(){const e=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),n=t.getActions(this._options);t.dispose();for(const[,i]of n)i.length>0&&(e.push(...i),e.push(new Separator));return e.length&&e.pop(),e}}let MenuItemAction=class e{constructor(t,n,i,o,r){var s,a;if(this._commandService=r,this.id=t.id,this.label=(null==i?void 0:i.renderShortTitle)&&t.shortTitle?"string"==typeof t.shortTitle?t.shortTitle:t.shortTitle.value:"string"==typeof t.title?t.title:t.title.value,this.tooltip=null!==(a="string"==typeof t.tooltip?t.tooltip:null===(s=t.tooltip)||void 0===s?void 0:s.value)&&void 0!==a?a:"",this.enabled=!t.precondition||o.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const e=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=o.contextMatchesRules(e.condition),this.checked&&e.tooltip&&(this.tooltip="string"==typeof e.tooltip?e.tooltip:e.tooltip.value),e.title&&(this.label="string"==typeof e.title?e.title:e.title.value)}this.item=t,this.alt=n?new e(n,void 0,i,o,r):void 0,this._options=i,ThemeIcon.isThemeIcon(t.icon)&&(this.class=CSSIcon.asClassName(t.icon))}dispose(){}run(...e){var t,n;let i=[];return(null===(t=this._options)||void 0===t?void 0:t.arg)&&(i=[...i,this._options.arg]),(null===(n=this._options)||void 0===n?void 0:n.shouldForwardArgs)&&(i=[...i,...e]),this._commandService.executeCommand(this.id,...i)}};MenuItemAction=__decorate$1B([__param$1v(3,IContextKeyService),__param$1v(4,ICommandService)],MenuItemAction);class KeybindingsRegistryImpl{constructor(){this._coreKeybindings=[],this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(1===OS){if(e&&e.win)return e.win}else if(2===OS){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=KeybindingsRegistryImpl.bindToCurrentPlatform(e);if(t&&t.primary){const n=createKeybinding(t.primary,OS);n&&this._registerDefaultKeybinding(n,e.id,e.args,e.weight,0,e.when)}if(t&&Array.isArray(t.secondary))for(let n=0,i=t.secondary.length;n<i;n++){const i=createKeybinding(t.secondary[n],OS);i&&this._registerDefaultKeybinding(i,e.id,e.args,e.weight,-n-1,e.when)}}registerCommandAndKeybindingRule(e){this.registerKeybindingRule(e),CommandsRegistry.registerCommand(e)}static _mightProduceChar(e){return e>=21&&e<=30||(e>=31&&e<=56||(80===e||81===e||82===e||83===e||84===e||85===e||86===e||110===e||111===e||87===e||88===e||89===e||90===e||91===e||92===e))}_assertNoCtrlAlt(e,t){e.ctrlKey&&e.altKey&&!e.metaKey&&KeybindingsRegistryImpl._mightProduceChar(e.keyCode)}_registerDefaultKeybinding(e,t,n,i,o,r){1===OS&&this._assertNoCtrlAlt(e.parts[0],t),this._coreKeybindings.push({keybinding:e.parts,command:t,commandArgs:n,when:r,weight1:i,weight2:o,extensionId:null,isBuiltinExtension:!1}),this._cachedMergedKeybindings=null}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=[].concat(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(sorter)),this._cachedMergedKeybindings.slice(0)}}const KeybindingsRegistry=new KeybindingsRegistryImpl,Extensions$7={EditorModes:"platform.keybindingsRegistry"};function sorter(e,t){return e.weight1!==t.weight1?e.weight1-t.weight1:e.command<t.command?-1:e.command>t.command?1:e.weight2-t.weight2}Registry.add(Extensions$7.EditorModes,KeybindingsRegistry);const ITelemetryService=createDecorator("telemetryService"),ILogService=createDecorator("logService");var LogLevel,LogLevel2;LogLevel2=LogLevel||(LogLevel={}),LogLevel2[LogLevel2.Trace=0]="Trace",LogLevel2[LogLevel2.Debug=1]="Debug",LogLevel2[LogLevel2.Info=2]="Info",LogLevel2[LogLevel2.Warning=3]="Warning",LogLevel2[LogLevel2.Error=4]="Error",LogLevel2[LogLevel2.Critical=5]="Critical",LogLevel2[LogLevel2.Off=6]="Off";const DEFAULT_LOG_LEVEL=LogLevel.Info;class AbstractLogger extends Disposable{constructor(){super(...arguments),this.level=DEFAULT_LOG_LEVEL,this._onDidChangeLogLevel=this._register(new Emitter$1)}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}}class ConsoleLogger extends AbstractLogger{constructor(e=DEFAULT_LOG_LEVEL){super(),this.setLevel(e)}trace(e,...t){this.getLevel(),LogLevel.Trace}debug(e,...t){this.getLevel(),LogLevel.Debug}info(e,...t){this.getLevel(),LogLevel.Info}error(e,...t){this.getLevel(),LogLevel.Error}dispose(){}}class LogService extends Disposable{constructor(e){super(),this.logger=e,this._register(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}error(e,...t){this.logger.error(e,...t)}}class Command$1{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let e=t.kbExpr;this.precondition&&(e=e?ContextKeyExpr.and(e,this.precondition):this.precondition);const n={id:this.id,weight:t.weight,args:t.args,when:e,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};KeybindingsRegistry.registerKeybindingRule(n)}}CommandsRegistry.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){MenuRegistry.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class MultiCommand extends Command$1{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,n){return this._implementations.push({priority:e,name:t,implementation:n}),this._implementations.sort(((e,t)=>t.priority-e.priority)),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e].implementation===n)return void this._implementations.splice(e,1)}}}runCommand(e,t){const n=e.get(ILogService);n.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);for(const i of this._implementations){const o=i.implementation(e,t);if(o){if(n.trace(`Command '${this.id}' was handled by '${i.name}'.`),"boolean"==typeof o)return;return o}}n.trace(`The Command '${this.id}' was not handled by any implementation.`)}}class ProxyCommand extends Command$1{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class EditorCommand extends Command$1{static bindToContribution(e){return class extends EditorCommand{constructor(e){super(e),this._callback=e.handler}runEditorCommand(t,n,i){const o=e(n);o&&this._callback(o,i)}}}runCommand(e,t){const n=e.get(ICodeEditorService),i=n.getFocusedCodeEditor()||n.getActiveCodeEditor();if(i)return i.invokeWithinContext((e=>{if(e.get(IContextKeyService).contextMatchesRules(withNullAsUndefined(this.precondition)))return this.runEditorCommand(e,i,t)}))}}class EditorAction extends EditorCommand{constructor(e){super(EditorAction.convertOptions(e)),this.label=e.label,this.alias=e.alias}static convertOptions(e){let t;function n(t){return t.menuId||(t.menuId=MenuId.EditorContext),t.title||(t.title=e.label),t.when=ContextKeyExpr.and(e.precondition,t.when),t}return t=Array.isArray(e.menuOpts)?e.menuOpts:e.menuOpts?[e.menuOpts]:[],Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(n)):e.contextMenuOpts&&t.push(n(e.contextMenuOpts)),e.menuOpts=t,e}runEditorCommand(e,t,n){return this.reportTelemetry(e,t),this.run(e,t,n||{})}reportTelemetry(e,t){e.get(ITelemetryService).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class MultiEditorAction extends EditorAction{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort(((e,t)=>t[0]-e[0])),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e][1]===t)return void this._implementations.splice(e,1)}}}run(e,t,n){for(const i of this._implementations){const o=i[1](e,t,n);if(o){if("boolean"==typeof o)return;return o}}}}function registerModelAndPositionCommand(e,t){CommandsRegistry.registerCommand(e,(function(e,...n){const i=e.get(IInstantiationService),[o,r]=n;assertType(URI.isUri(o)),assertType(Position$1.isIPosition(r));const s=e.get(IModelService).getModel(o);if(s){const e=Position$1.lift(r);return i.invokeFunction(t,s,e,...n.slice(2))}return e.get(ITextModelService).createModelReference(o).then((e=>new Promise(((o,s)=>{try{o(i.invokeFunction(t,e.object.textEditorModel,Position$1.lift(r),n.slice(2)))}catch(a){s(a)}})).finally((()=>{e.dispose()}))))}))}function registerEditorCommand(e){return EditorContributionRegistry.INSTANCE.registerEditorCommand(e),e}function registerEditorAction(e){const t=new e;return EditorContributionRegistry.INSTANCE.registerEditorAction(t),t}function registerMultiEditorAction(e){return EditorContributionRegistry.INSTANCE.registerEditorAction(e),e}function registerInstantiatedEditorAction(e){EditorContributionRegistry.INSTANCE.registerEditorAction(e)}function registerEditorContribution(e,t){EditorContributionRegistry.INSTANCE.registerEditorContribution(e,t)}var EditorExtensionsRegistry,EditorExtensionsRegistry2;EditorExtensionsRegistry2=EditorExtensionsRegistry||(EditorExtensionsRegistry={}),EditorExtensionsRegistry2.getEditorCommand=function(e){return EditorContributionRegistry.INSTANCE.getEditorCommand(e)},EditorExtensionsRegistry2.getEditorActions=function(){return EditorContributionRegistry.INSTANCE.getEditorActions()},EditorExtensionsRegistry2.getEditorContributions=function(){return EditorContributionRegistry.INSTANCE.getEditorContributions()},EditorExtensionsRegistry2.getSomeEditorContributions=function(e){return EditorContributionRegistry.INSTANCE.getEditorContributions().filter((t=>e.indexOf(t.id)>=0))},EditorExtensionsRegistry2.getDiffEditorContributions=function(){return EditorContributionRegistry.INSTANCE.getDiffEditorContributions()};const Extensions$6={EditorCommonContributions:"editor.contributions"};class EditorContributionRegistry{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t){this.editorContributions.push({id:e,ctor:t})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions.slice(0)}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}function registerCommand$3(e){return e.register(),e}EditorContributionRegistry.INSTANCE=new EditorContributionRegistry,Registry.add(Extensions$6.EditorCommonContributions,EditorContributionRegistry.INSTANCE);const UndoCommand=registerCommand$3(new MultiCommand({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:MenuId.MenubarEditMenu,group:"1_do",title:localize({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:MenuId.CommandPalette,group:"",title:localize("undo","Undo"),order:1}]}));registerCommand$3(new ProxyCommand(UndoCommand,{id:"default:undo",precondition:void 0}));const RedoCommand=registerCommand$3(new MultiCommand({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:MenuId.MenubarEditMenu,group:"1_do",title:localize({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:MenuId.CommandPalette,group:"",title:localize("redo","Redo"),order:1}]}));registerCommand$3(new ProxyCommand(RedoCommand,{id:"default:redo",precondition:void 0}));const SelectAllCommand=registerCommand$3(new MultiCommand({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:MenuId.MenubarSelectionMenu,group:"1_basic",title:localize({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:MenuId.CommandPalette,group:"",title:localize("selectAll","Select All"),order:1}]}));class Range$2{constructor(e,t,n,i){e>n||e===n&&t>i?(this.startLineNumber=n,this.startColumn=i,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=i)}isEmpty(){return Range$2.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Range$2.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber)&&(!(t.lineNumber===e.startLineNumber&&t.column<e.startColumn)&&!(t.lineNumber===e.endLineNumber&&t.column>e.endColumn))}static strictContainsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber)&&(!(t.lineNumber===e.startLineNumber&&t.column<=e.startColumn)&&!(t.lineNumber===e.endLineNumber&&t.column>=e.endColumn))}containsRange(e){return Range$2.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber)&&(!(t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn)&&!(t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)))}strictContainsRange(e){return Range$2.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber)&&(!(t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn)&&!(t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)))}plusRange(e){return Range$2.plusRange(this,e)}static plusRange(e,t){let n,i,o,r;return t.startLineNumber<e.startLineNumber?(n=t.startLineNumber,i=t.startColumn):t.startLineNumber===e.startLineNumber?(n=t.startLineNumber,i=Math.min(t.startColumn,e.startColumn)):(n=e.startLineNumber,i=e.startColumn),t.endLineNumber>e.endLineNumber?(o=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,r=e.endColumn),new Range$2(n,i,o,r)}intersectRanges(e){return Range$2.intersectRanges(this,e)}static intersectRanges(e,t){let n=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,r=e.endColumn,s=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,c=t.endColumn;return n<s?(n=s,i=a):n===s&&(i=Math.max(i,a)),o>l?(o=l,r=c):o===l&&(r=Math.min(r,c)),n>o||n===o&&i>r?null:new Range$2(n,i,o,r)}equalsRange(e){return Range$2.equalsRange(this,e)}static equalsRange(e,t){return!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return Range$2.getEndPosition(this)}static getEndPosition(e){return new Position$1(e.endLineNumber,e.endColumn)}getStartPosition(){return Range$2.getStartPosition(this)}static getStartPosition(e){return new Position$1(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new Range$2(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new Range$2(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return Range$2.collapseToStart(this)}static collapseToStart(e){return new Range$2(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}static fromPositions(e,t=e){return new Range$2(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new Range$2(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}static areIntersectingOrTouching(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn)&&!(t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn)}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn)&&!(t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn)}static compareRangesUsingStarts(e,t){if(e&&t){const n=0|e.startLineNumber,i=0|t.startLineNumber;if(n===i){const n=0|e.startColumn,i=0|t.startColumn;if(n===i){const n=0|e.endLineNumber,i=0|t.endLineNumber;if(n===i){return(0|e.endColumn)-(0|t.endColumn)}return n-i}return n-i}return n-i}return(e?1:0)-(t?1:0)}static compareRangesUsingEnds(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}toJSON(){return this}}class Selection$1 extends Range$2{constructor(e,t,n,i){super(e,t,n,i),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=i}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Selection$1.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return 0===this.getDirection()?new Selection$1(this.startLineNumber,this.startColumn,e,t):new Selection$1(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new Position$1(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new Position$1(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return 0===this.getDirection()?new Selection$1(e,t,this.endLineNumber,this.endColumn):new Selection$1(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Selection$1(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return 0===t?new Selection$1(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Selection$1(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Selection$1(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(!this.selectionsEqual(e[n],t[n]))return!1;return!0}static isISelection(e){return e&&"number"==typeof e.selectionStartLineNumber&&"number"==typeof e.selectionStartColumn&&"number"==typeof e.positionLineNumber&&"number"==typeof e.positionColumn}static createWithDirection(e,t,n,i,o){return 0===o?new Selection$1(e,t,n,i):new Selection$1(n,i,e,t)}}function createScopedLineTokens(e,t){const n=e.getCount(),i=e.findTokenIndexAtOffset(t),o=e.getLanguageId(i);let r=i;for(;r+1<n&&e.getLanguageId(r+1)===o;)r++;let s=i;for(;s>0&&e.getLanguageId(s-1)===o;)s--;return new ScopedLineTokens(e,o,s,r+1,e.getStartOffset(s),e.getEndOffset(r))}class ScopedLineTokens{constructor(e,t,n,i,o,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=n,this._lastTokenIndex=i,this.firstCharOffset=o,this._lastCharOffset=r}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function ignoreBracketsInToken(e){return 0!=(3&e)}class CursorColumns{static _nextVisibleColumn(e,t,n){return 9===e?CursorColumns.nextRenderTabStop(t,n):isFullWidthCharacter(e)||isEmojiImprecise(e)?t+2:t+1}static visibleColumnFromColumn(e,t,n){const i=Math.min(t-1,e.length),o=e.substring(0,i),r=new GraphemeIterator(o);let s=0;for(;!r.eol();){const e=getNextCodePoint(o,i,r.offset);r.nextGraphemeLength(),s=this._nextVisibleColumn(e,s,n)}return s}static columnFromVisibleColumn(e,t,n){if(t<=0)return 1;const i=e.length,o=new GraphemeIterator(e);let r=0,s=1;for(;!o.eol();){const a=getNextCodePoint(e,i,o.offset);o.nextGraphemeLength();const l=this._nextVisibleColumn(a,r,n),c=o.offset+1;if(l>=t){return l-t<t-r?c:s}r=l,s=c}return i+1}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return e+t-e%t}static prevRenderTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}static prevIndentTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}}function _normalizeIndentationFromWhitespace(e,t,n){let i=0;for(let r=0;r<e.length;r++)"\t"===e.charAt(r)?i+=t:i++;let o="";if(!n){const e=Math.floor(i/t);i%=t;for(let t=0;t<e;t++)o+="\t"}for(let r=0;r<i;r++)o+=" ";return o}function normalizeIndentation(e,t,n){let i=firstNonWhitespaceIndex(e);return-1===i&&(i=e.length),_normalizeIndentationFromWhitespace(e.substring(0,i),t,n)+e.substring(i)}const autoCloseAlways=()=>!0,autoCloseNever=()=>!1,autoCloseBeforeWhitespace=e=>" "===e||"\t"===e;class CursorConfiguration{constructor(e,t,n,i){this.languageConfigurationService=i,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=n.options,r=o.get(131);this.readOnly=o.get(81),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(104),this.lineHeight=o.get(59),this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=o.get(116),this.wordSeparators=o.get(117),this.emptySelectionClipboard=o.get(32),this.copyWithSyntaxHighlighting=o.get(21),this.multiCursorMergeOverlapping=o.get(69),this.multiCursorPaste=o.get(71),this.autoClosingBrackets=o.get(5),this.autoClosingQuotes=o.get(8),this.autoClosingDelete=o.get(6),this.autoClosingOvertype=o.get(7),this.autoSurround=o.get(11),this.autoIndent=o.get(9),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const s=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(s)for(const a of s)this.surroundingPairs[a.open]=a.close}static shouldRecreate(e){return e.hasChanged(131)||e.hasChanged(117)||e.hasChanged(32)||e.hasChanged(69)||e.hasChanged(71)||e.hasChanged(5)||e.hasChanged(8)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(116)||e.hasChanged(59)||e.hasChanged(81)}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=null===(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)||void 0===e?void 0:e.getElectricCharacters();if(t)for(const e of t)this._electricChars[e]=!0}return this._electricChars}onElectricCharacter(e,t,n){const i=createScopedLineTokens(t,n-1),o=this.languageConfigurationService.getLanguageConfiguration(i.languageId).electricCharacter;return o?o.onElectricCharacter(e,i,n-i.firstCharOffset):null}normalizeIndentation(e){return normalizeIndentation(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t){switch(t){case"beforeWhitespace":return autoCloseBeforeWhitespace;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e);case"always":return autoCloseAlways;case"never":return autoCloseNever}}_getLanguageDefinedShouldAutoClose(e){const t=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet();return e=>-1!==t.indexOf(e)}visibleColumnFromColumn(e,t){return CursorColumns.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,n){const i=CursorColumns.columnFromVisibleColumn(e.getLineContent(t),n,this.tabSize),o=e.getLineMinColumn(t);if(i<o)return o;const r=e.getLineMaxColumn(t);return i>r?r:i}}class CursorState$1{constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}static fromModelState(e){return new PartialModelCursorState(e)}static fromViewState(e){return new PartialViewCursorState(e)}static fromModelSelection(e){const t=Selection$1.liftSelection(e),n=new SingleCursorState(Range$2.fromPositions(t.getSelectionStart()),0,t.getPosition(),0);return CursorState$1.fromModelState(n)}static fromModelSelections(e){const t=[];for(let n=0,i=e.length;n<i;n++)t[n]=this.fromModelSelection(e[n]);return t}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}}class PartialModelCursorState{constructor(e){this.modelState=e,this.viewState=null}}class PartialViewCursorState{constructor(e){this.modelState=null,this.viewState=e}}class SingleCursorState{constructor(e,t,n,i){this._singleCursorStateBrand=void 0,this.selectionStart=e,this.selectionStartLeftoverVisibleColumns=t,this.position=n,this.leftoverVisibleColumns=i,this.selection=SingleCursorState._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,n,i){return e?new SingleCursorState(this.selectionStart,this.selectionStartLeftoverVisibleColumns,new Position$1(t,n),i):new SingleCursorState(new Range$2(t,n,t,n),i,new Position$1(t,n),i)}static _computeSelection(e,t){return e.isEmpty()||!t.isBeforeOrEqual(e.getStartPosition())?Selection$1.fromPositions(e.getStartPosition(),t):Selection$1.fromPositions(e.getEndPosition(),t)}}class EditOperationResult{constructor(e,t,n){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=n.shouldPushStackElementBefore,this.shouldPushStackElementAfter=n.shouldPushStackElementAfter}}function isQuote(e){return"'"===e||'"'===e||"`"===e}class ColumnSelection{static columnSelect(e,t,n,i,o,r){const s=Math.abs(o-n)+1,a=n>o,l=i>r,c=i<r,d=[];for(let u=0;u<s;u++){const o=n+(a?-u:u),s=e.columnFromVisibleColumn(t,o,i),h=e.columnFromVisibleColumn(t,o,r),g=e.visibleColumnFromColumn(t,new Position$1(o,s)),p=e.visibleColumnFromColumn(t,new Position$1(o,h));if(c){if(g>r)continue;if(p<i)continue}if(l){if(p>i)continue;if(g<r)continue}d.push(new SingleCursorState(new Range$2(o,s,o,s),0,new Position$1(o,h),0))}if(0===d.length)for(let u=0;u<s;u++){const e=n+(a?-u:u),i=t.getLineMaxColumn(e);d.push(new SingleCursorState(new Range$2(e,i,e,i),0,new Position$1(e,i),0))}return{viewStates:d,reversed:a,fromLineNumber:n,fromVisualColumn:i,toLineNumber:o,toVisualColumn:r}}static columnSelectLeft(e,t,n){let i=n.toViewVisualColumn;return i>0&&i--,ColumnSelection.columnSelect(e,t,n.fromViewLineNumber,n.fromViewVisualColumn,n.toViewLineNumber,i)}static columnSelectRight(e,t,n){let i=0;const o=Math.min(n.fromViewLineNumber,n.toViewLineNumber),r=Math.max(n.fromViewLineNumber,n.toViewLineNumber);for(let a=o;a<=r;a++){const n=t.getLineMaxColumn(a),o=e.visibleColumnFromColumn(t,new Position$1(a,n));i=Math.max(i,o)}let s=n.toViewVisualColumn;return s<i&&s++,this.columnSelect(e,t,n.fromViewLineNumber,n.fromViewVisualColumn,n.toViewLineNumber,s)}static columnSelectUp(e,t,n,i){const o=i?e.pageSize:1,r=Math.max(1,n.toViewLineNumber-o);return this.columnSelect(e,t,n.fromViewLineNumber,n.fromViewVisualColumn,r,n.toViewVisualColumn)}static columnSelectDown(e,t,n,i){const o=i?e.pageSize:1,r=Math.min(t.getLineCount(),n.toViewLineNumber+o);return this.columnSelect(e,t,n.fromViewLineNumber,n.fromViewVisualColumn,r,n.toViewVisualColumn)}}class ReplaceCommand{constructor(e,t,n=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=n}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return Selection$1.fromPositions(n.getEndPosition())}}class ReplaceCommandThatSelectsText{constructor(e,t){this._range=e,this._text=t}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return Selection$1.fromRange(n,0)}}class ReplaceCommandWithoutChangingPosition{constructor(e,t,n=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=n}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return Selection$1.fromPositions(n.getStartPosition())}}class ReplaceCommandWithOffsetCursorState{constructor(e,t,n,i,o=!1){this._range=e,this._text=t,this._columnDeltaOffset=i,this._lineNumberDeltaOffset=n,this.insertsAutoWhitespace=o}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return Selection$1.fromPositions(n.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}}class ReplaceCommandThatPreservesSelection{constructor(e,t,n,i=!1){this._range=e,this._text=t,this._initialSelection=n,this._forceMoveMarkers=i,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}class AtomicTabMoveOperations{static whitespaceVisibleColumn(e,t,n){const i=e.length;let o=0,r=-1,s=-1;for(let a=0;a<i;a++){if(a===t)return[r,s,o];o%n==0&&(r=a,s=o);switch(e.charCodeAt(a)){case 32:o+=1;break;case 9:o=CursorColumns.nextRenderTabStop(o,n);break;default:return[-1,-1,-1]}}return t===i?[r,s,o]:[-1,-1,-1]}static atomicPosition(e,t,n,i){const o=e.length,[r,s,a]=AtomicTabMoveOperations.whitespaceVisibleColumn(e,t,n);if(-1===a)return-1;let l;switch(i){case 0:l=!0;break;case 1:l=!1;break;case 2:if(a%n==0)return t;l=a%n<=n/2}if(l){if(-1===r)return-1;let t=s;for(let i=r;i<o;++i){if(t===s+n)return r;switch(e.charCodeAt(i)){case 32:t+=1;break;case 9:t=CursorColumns.nextRenderTabStop(t,n);break;default:return-1}}return t===s+n?r:-1}const c=CursorColumns.nextRenderTabStop(a,n);let d=a;for(let u=t;u<o;u++){if(d===c)return u;switch(e.charCodeAt(u)){case 32:d+=1;break;case 9:d=CursorColumns.nextRenderTabStop(d,n);break;default:return-1}}return d===c?o:-1}}class CursorPosition{constructor(e,t,n){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=n}}class MoveOperations{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-prevCharLength(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const n=t.lineNumber-1;return new Position$1(n,e.getLineMaxColumn(n))}return t}static leftPositionAtomicSoftTabs(e,t,n){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const i=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),r=AtomicTabMoveOperations.atomicPosition(o,t.column-1,n,0);if(-1!==r&&r+1>=i)return new Position$1(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,n){const i=e.stickyTabStops?MoveOperations.leftPositionAtomicSoftTabs(t,n,e.tabSize):MoveOperations.leftPosition(t,n);return new CursorPosition(i.lineNumber,i.column,0)}static moveLeft(e,t,n,i,o){let r,s;if(n.hasSelection()&&!i)r=n.selection.startLineNumber,s=n.selection.startColumn;else{const i=n.position.delta(void 0,-(o-1)),a=t.normalizePosition(MoveOperations.clipPositionColumn(i,t),0),l=MoveOperations.left(e,t,a);r=l.lineNumber,s=l.column}return n.move(i,r,s,0)}static clipPositionColumn(e,t){return new Position$1(e.lineNumber,MoveOperations.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,n){return e<t?t:e>n?n:e}static rightPosition(e,t,n){return n<e.getLineMaxColumn(t)?n+=nextCharLength(e.getLineContent(t),n-1):t<e.getLineCount()&&(t+=1,n=e.getLineMinColumn(t)),new Position$1(t,n)}static rightPositionAtomicSoftTabs(e,t,n,i,o){if(n<e.getLineIndentColumn(t)){const o=e.getLineContent(t),r=AtomicTabMoveOperations.atomicPosition(o,n-1,i,1);if(-1!==r)return new Position$1(t,r+1)}return this.rightPosition(e,t,n)}static right(e,t,n){const i=e.stickyTabStops?MoveOperations.rightPositionAtomicSoftTabs(t,n.lineNumber,n.column,e.tabSize,e.indentSize):MoveOperations.rightPosition(t,n.lineNumber,n.column);return new CursorPosition(i.lineNumber,i.column,0)}static moveRight(e,t,n,i,o){let r,s;if(n.hasSelection()&&!i)r=n.selection.endLineNumber,s=n.selection.endColumn;else{const i=n.position.delta(void 0,o-1),a=t.normalizePosition(MoveOperations.clipPositionColumn(i,t),1),l=MoveOperations.right(e,t,a);r=l.lineNumber,s=l.column}return n.move(i,r,s,0)}static vertical(e,t,n,i,o,r,s,a){const l=CursorColumns.visibleColumnFromColumn(t.getLineContent(n),i,e.tabSize)+o,c=t.getLineCount(),d=1===n&&1===i,u=n===c&&i===t.getLineMaxColumn(n),h=r<n?d:u;if((n=r)<1?(n=1,i=s?t.getLineMinColumn(n):Math.min(t.getLineMaxColumn(n),i)):n>c?(n=c,i=s?t.getLineMaxColumn(n):Math.min(t.getLineMaxColumn(n),i)):i=e.columnFromVisibleColumn(t,n,l),o=h?0:l-CursorColumns.visibleColumnFromColumn(t.getLineContent(n),i,e.tabSize),void 0!==a){const e=new Position$1(n,i),r=t.normalizePosition(e,a);o+=i-r.column,n=r.lineNumber,i=r.column}return new CursorPosition(n,i,o)}static down(e,t,n,i,o,r,s){return this.vertical(e,t,n,i,o,n+r,s,1)}static moveDown(e,t,n,i,o){let r,s;n.hasSelection()&&!i?(r=n.selection.endLineNumber,s=n.selection.endColumn):(r=n.position.lineNumber,s=n.position.column);const a=MoveOperations.down(e,t,r,s,n.leftoverVisibleColumns,o,!0);return n.move(i,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateDown(e,t,n){const i=n.selection,o=MoveOperations.down(e,t,i.selectionStartLineNumber,i.selectionStartColumn,n.selectionStartLeftoverVisibleColumns,1,!1),r=MoveOperations.down(e,t,i.positionLineNumber,i.positionColumn,n.leftoverVisibleColumns,1,!1);return new SingleCursorState(new Range$2(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new Position$1(r.lineNumber,r.column),r.leftoverVisibleColumns)}static up(e,t,n,i,o,r,s){return this.vertical(e,t,n,i,o,n-r,s,0)}static moveUp(e,t,n,i,o){let r,s;n.hasSelection()&&!i?(r=n.selection.startLineNumber,s=n.selection.startColumn):(r=n.position.lineNumber,s=n.position.column);const a=MoveOperations.up(e,t,r,s,n.leftoverVisibleColumns,o,!0);return n.move(i,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateUp(e,t,n){const i=n.selection,o=MoveOperations.up(e,t,i.selectionStartLineNumber,i.selectionStartColumn,n.selectionStartLeftoverVisibleColumns,1,!1),r=MoveOperations.up(e,t,i.positionLineNumber,i.positionColumn,n.leftoverVisibleColumns,1,!1);return new SingleCursorState(new Range$2(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new Position$1(r.lineNumber,r.column),r.leftoverVisibleColumns)}static _isBlankLine(e,t){return 0===e.getLineFirstNonWhitespaceColumn(t)}static moveToPrevBlankLine(e,t,n,i){let o=n.position.lineNumber;for(;o>1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return n.move(i,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,n,i){const o=t.getLineCount();let r=n.position.lineNumber;for(;r<o&&this._isBlankLine(t,r);)r++;for(;r<o&&!this._isBlankLine(t,r);)r++;return n.move(i,r,t.getLineMinColumn(r),0)}static moveToBeginningOfLine(e,t,n,i){const o=n.position.lineNumber,r=t.getLineMinColumn(o),s=t.getLineFirstNonWhitespaceColumn(o)||r;let a;return a=n.position.column===s?r:s,n.move(i,o,a,0)}static moveToEndOfLine(e,t,n,i,o){const r=n.position.lineNumber,s=t.getLineMaxColumn(r);return n.move(i,r,s,o?1073741824-s:0)}static moveToBeginningOfBuffer(e,t,n,i){return n.move(i,1,1,0)}static moveToEndOfBuffer(e,t,n,i){const o=t.getLineCount(),r=t.getLineMaxColumn(o);return n.move(i,o,r,0)}}class DeleteOperations{static deleteRight(e,t,n,i){const o=[];let r=3!==e;for(let s=0,a=i.length;s<a;s++){const e=i[s];let a=e;if(a.isEmpty()){const i=e.getPosition(),o=MoveOperations.right(t,n,i);a=new Range$2(o.lineNumber,o.column,i.lineNumber,i.column)}a.isEmpty()?o[s]=null:(a.startLineNumber!==a.endLineNumber&&(r=!0),o[s]=new ReplaceCommand(a,""))}return[r,o]}static isAutoClosingPairDelete(e,t,n,i,o,r,s){if("never"===t&&"never"===n)return!1;if("never"===e)return!1;for(let a=0,l=r.length;a<l;a++){const l=r[a],c=l.getPosition();if(!l.isEmpty())return!1;const d=o.getLineContent(c.lineNumber);if(c.column<2||c.column>=d.length+1)return!1;const u=d.charAt(c.column-2),h=i.get(u);if(!h)return!1;if(isQuote(u)){if("never"===n)return!1}else if("never"===t)return!1;const g=d.charAt(c.column-1);let p=!1;for(const e of h)e.open===u&&e.close===g&&(p=!0);if(!p)return!1;if("auto"===e){let e=!1;for(let t=0,n=s.length;t<n;t++){const n=s[t];if(c.lineNumber===n.startLineNumber&&c.column===n.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingPairDelete(e,t,n){const i=[];for(let o=0,r=n.length;o<r;o++){const e=n[o].getPosition(),t=new Range$2(e.lineNumber,e.column-1,e.lineNumber,e.column+1);i[o]=new ReplaceCommand(t,"")}return[!0,i]}static deleteLeft(e,t,n,i,o){if(this.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,n,i,o))return this._runAutoClosingPairDelete(t,n,i);const r=[];let s=2!==e;for(let a=0,l=i.length;a<l;a++){const e=DeleteOperations.getDeleteRange(i[a],n,t);e.isEmpty()?r[a]=null:(e.startLineNumber!==e.endLineNumber&&(s=!0),r[a]=new ReplaceCommand(e,""))}return[s,r]}static getDeleteRange(e,t,n){if(!e.isEmpty())return e;const i=e.getPosition();if(n.useTabStops&&i.column>1){const e=t.getLineContent(i.lineNumber),o=firstNonWhitespaceIndex(e),r=-1===o?e.length+1:o+1;if(i.column<=r){const e=n.visibleColumnFromColumn(t,i),o=CursorColumns.prevIndentTabStop(e,n.indentSize),r=n.columnFromVisibleColumn(t,i.lineNumber,o);return new Range$2(i.lineNumber,r,i.lineNumber,i.column)}}return Range$2.fromPositions(DeleteOperations.getPositionAfterDeleteLeft(i,t),i)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const n=getLeftDeleteOffset(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,n+1)}if(e.lineNumber>1){const n=e.lineNumber-1;return new Position$1(n,t.getLineMaxColumn(n))}return e}static cut(e,t,n){const i=[];let o=null;n.sort(((e,t)=>Position$1.compare(e.getStartPosition(),t.getEndPosition())));for(let r=0,s=n.length;r<s;r++){const s=n[r];if(s.isEmpty())if(e.emptySelectionClipboard){const e=s.getPosition();let n,a,l,c;e.lineNumber<t.getLineCount()?(n=e.lineNumber,a=1,l=e.lineNumber+1,c=1):e.lineNumber>1&&(null==o?void 0:o.endLineNumber)!==e.lineNumber?(n=e.lineNumber-1,a=t.getLineMaxColumn(e.lineNumber-1),l=e.lineNumber,c=t.getLineMaxColumn(e.lineNumber)):(n=e.lineNumber,a=1,l=e.lineNumber,c=t.getLineMaxColumn(e.lineNumber));const d=new Range$2(n,a,l,c);o=d,d.isEmpty()?i[r]=null:i[r]=new ReplaceCommand(d,"")}else i[r]=null;else i[r]=new ReplaceCommand(s,"")}return new EditOperationResult(0,i,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}function toUint8(e){return e<0?0:e>255?255:0|e}function toUint32(e){return e<0?0:e>4294967295?4294967295:0|e}class CharacterClassifier{constructor(e){const t=toUint8(e);this._defaultValue=t,this._asciiMap=CharacterClassifier._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);for(let n=0;n<256;n++)t[n]=e;return t}set(e,t){const n=toUint8(t);e>=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}}class CharacterSet{constructor(){this._actual=new CharacterClassifier(0)}add(e){this._actual.set(e,1)}has(e){return 1===this._actual.get(e)}}class WordCharacterClassifier extends CharacterClassifier{constructor(e){super(0);for(let t=0,n=e.length;t<n;t++)this.set(e.charCodeAt(t),2);this.set(32,1),this.set(9,1)}}function once(e){const t={};return n=>(t.hasOwnProperty(n)||(t[n]=e(n)),t[n])}const getMapForWordSeparators=once((e=>new WordCharacterClassifier(e)));class WordOperations{static _createWord(e,t,n,i,o){return{start:i,end:o,wordType:t,nextCharClass:n}}static _findPreviousWordOnLine(e,t,n){const i=t.getLineContent(n.lineNumber);return this._doFindPreviousWordOnLine(i,e,n)}static _doFindPreviousWordOnLine(e,t,n){let i=0;for(let o=n.column-2;o>=0;o--){const n=e.charCodeAt(o),r=t.get(n);if(0===r){if(2===i)return this._createWord(e,i,r,o+1,this._findEndOfWord(e,t,i,o+1));i=1}else if(2===r){if(1===i)return this._createWord(e,i,r,o+1,this._findEndOfWord(e,t,i,o+1));i=2}else if(1===r&&0!==i)return this._createWord(e,i,r,o+1,this._findEndOfWord(e,t,i,o+1))}return 0!==i?this._createWord(e,i,1,0,this._findEndOfWord(e,t,i,0)):null}static _findEndOfWord(e,t,n,i){const o=e.length;for(let r=i;r<o;r++){const i=e.charCodeAt(r),o=t.get(i);if(1===o)return r;if(1===n&&2===o)return r;if(2===n&&0===o)return r}return o}static _findNextWordOnLine(e,t,n){const i=t.getLineContent(n.lineNumber);return this._doFindNextWordOnLine(i,e,n)}static _doFindNextWordOnLine(e,t,n){let i=0;const o=e.length;for(let r=n.column-1;r<o;r++){const n=e.charCodeAt(r),o=t.get(n);if(0===o){if(2===i)return this._createWord(e,i,o,this._findStartOfWord(e,t,i,r-1),r);i=1}else if(2===o){if(1===i)return this._createWord(e,i,o,this._findStartOfWord(e,t,i,r-1),r);i=2}else if(1===o&&0!==i)return this._createWord(e,i,o,this._findStartOfWord(e,t,i,r-1),r)}return 0!==i?this._createWord(e,i,1,this._findStartOfWord(e,t,i,o-1),o):null}static _findStartOfWord(e,t,n,i){for(let o=i;o>=0;o--){const i=e.charCodeAt(o),r=t.get(i);if(1===r)return o+1;if(1===n&&2===r)return o+1;if(2===n&&0===r)return o+1}return 0}static moveWordLeft(e,t,n,i){let o=n.lineNumber,r=n.column;1===r&&o>1&&(o-=1,r=t.getLineMaxColumn(o));let s=WordOperations._findPreviousWordOnLine(e,t,new Position$1(o,r));if(0===i)return new Position$1(o,s?s.start+1:1);if(1===i)return s&&2===s.wordType&&s.end-s.start==1&&0===s.nextCharClass&&(s=WordOperations._findPreviousWordOnLine(e,t,new Position$1(o,s.start+1))),new Position$1(o,s?s.start+1:1);if(3===i){for(;s&&2===s.wordType;)s=WordOperations._findPreviousWordOnLine(e,t,new Position$1(o,s.start+1));return new Position$1(o,s?s.start+1:1)}return s&&r<=s.end+1&&(s=WordOperations._findPreviousWordOnLine(e,t,new Position$1(o,s.start+1))),new Position$1(o,s?s.end+1:1)}static _moveWordPartLeft(e,t){const n=t.lineNumber,i=e.getLineMaxColumn(n);if(1===t.column)return n>1?new Position$1(n-1,e.getLineMaxColumn(n-1)):t;const o=e.getLineContent(n);for(let r=t.column-1;r>1;r--){const e=o.charCodeAt(r-2),t=o.charCodeAt(r-1);if(95===e&&95!==t)return new Position$1(n,r);if(isLowerAsciiLetter(e)&&isUpperAsciiLetter(t))return new Position$1(n,r);if(isUpperAsciiLetter(e)&&isUpperAsciiLetter(t)&&r+1<i){if(isLowerAsciiLetter(o.charCodeAt(r)))return new Position$1(n,r)}}return new Position$1(n,1)}static moveWordRight(e,t,n,i){let o=n.lineNumber,r=n.column,s=!1;r===t.getLineMaxColumn(o)&&o<t.getLineCount()&&(s=!0,o+=1,r=1);let a=WordOperations._findNextWordOnLine(e,t,new Position$1(o,r));if(2===i)a&&2===a.wordType&&a.end-a.start==1&&0===a.nextCharClass&&(a=WordOperations._findNextWordOnLine(e,t,new Position$1(o,a.end+1))),r=a?a.end+1:t.getLineMaxColumn(o);else if(3===i){for(s&&(r=0);a&&(2===a.wordType||a.start+1<=r);)a=WordOperations._findNextWordOnLine(e,t,new Position$1(o,a.end+1));r=a?a.start+1:t.getLineMaxColumn(o)}else a&&!s&&r>=a.start+1&&(a=WordOperations._findNextWordOnLine(e,t,new Position$1(o,a.end+1))),r=a?a.start+1:t.getLineMaxColumn(o);return new Position$1(o,r)}static _moveWordPartRight(e,t){const n=t.lineNumber,i=e.getLineMaxColumn(n);if(t.column===i)return n<e.getLineCount()?new Position$1(n+1,1):t;const o=e.getLineContent(n);for(let r=t.column+1;r<i;r++){const e=o.charCodeAt(r-2),t=o.charCodeAt(r-1);if(95!==e&&95===t)return new Position$1(n,r);if(isLowerAsciiLetter(e)&&isUpperAsciiLetter(t))return new Position$1(n,r);if(isUpperAsciiLetter(e)&&isUpperAsciiLetter(t)&&r+1<i){if(isLowerAsciiLetter(o.charCodeAt(r)))return new Position$1(n,r)}}return new Position$1(n,i)}static _deleteWordLeftWhitespace(e,t){const n=e.getLineContent(t.lineNumber),i=t.column-2,o=lastNonWhitespaceIndex(n,i);return o+1<i?new Range$2(t.lineNumber,o+2,t.lineNumber,t.column):null}static deleteWordLeft(e,t){const n=e.wordSeparators,i=e.model,o=e.selection,r=e.whitespaceHeuristics;if(!o.isEmpty())return o;if(DeleteOperations.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){const t=e.selection.getPosition();return new Range$2(t.lineNumber,t.column-1,t.lineNumber,t.column+1)}const s=new Position$1(o.positionLineNumber,o.positionColumn);let a=s.lineNumber,l=s.column;if(1===a&&1===l)return null;if(r){const e=this._deleteWordLeftWhitespace(i,s);if(e)return e}let c=WordOperations._findPreviousWordOnLine(n,i,s);return 0===t?c?l=c.start+1:l>1?l=1:(a--,l=i.getLineMaxColumn(a)):(c&&l<=c.end+1&&(c=WordOperations._findPreviousWordOnLine(n,i,new Position$1(a,c.start+1))),c?l=c.end+1:l>1?l=1:(a--,l=i.getLineMaxColumn(a))),new Range$2(a,l,s.lineNumber,s.column)}static deleteInsideWord(e,t,n){if(!n.isEmpty())return n;const i=new Position$1(n.positionLineNumber,n.positionColumn),o=this._deleteInsideWordWhitespace(t,i);return o||this._deleteInsideWordDetermineDeleteRange(e,t,i)}static _charAtIsWhitespace(e,t){const n=e.charCodeAt(t);return 32===n||9===n}static _deleteInsideWordWhitespace(e,t){const n=e.getLineContent(t.lineNumber),i=n.length;if(0===i)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(n,o))return null;let r=Math.min(t.column-1,i-1);if(!this._charAtIsWhitespace(n,r))return null;for(;o>0&&this._charAtIsWhitespace(n,o-1);)o--;for(;r+1<i&&this._charAtIsWhitespace(n,r+1);)r++;return new Range$2(t.lineNumber,o+1,t.lineNumber,r+2)}static _deleteInsideWordDetermineDeleteRange(e,t,n){const i=t.getLineContent(n.lineNumber),o=i.length;if(0===o)return n.lineNumber>1?new Range$2(n.lineNumber-1,t.getLineMaxColumn(n.lineNumber-1),n.lineNumber,1):n.lineNumber<t.getLineCount()?new Range$2(n.lineNumber,1,n.lineNumber+1,1):new Range$2(n.lineNumber,1,n.lineNumber,1);const r=e=>e.start+1<=n.column&&n.column<=e.end+1,s=(e,t)=>(e=Math.min(e,n.column),t=Math.max(t,n.column),new Range$2(n.lineNumber,e,n.lineNumber,t)),a=e=>{let t=e.start+1,n=e.end+1,r=!1;for(;n-1<o&&this._charAtIsWhitespace(i,n-1);)r=!0,n++;if(!r)for(;t>1&&this._charAtIsWhitespace(i,t-2);)t--;return s(t,n)},l=WordOperations._findPreviousWordOnLine(e,t,n);if(l&&r(l))return a(l);const c=WordOperations._findNextWordOnLine(e,t,n);return c&&r(c)?a(c):l&&c?s(l.end+1,c.start+1):l?s(l.start+1,l.end+1):c?s(c.start+1,c.end+1):s(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const n=t.getPosition(),i=WordOperations._moveWordPartLeft(e,n);return new Range$2(n.lineNumber,n.column,i.lineNumber,i.column)}static _findFirstNonWhitespaceChar(e,t){const n=e.length;for(let i=t;i<n;i++){const t=e.charAt(i);if(" "!==t&&"\t"!==t)return i}return n}static _deleteWordRightWhitespace(e,t){const n=e.getLineContent(t.lineNumber),i=t.column-1,o=this._findFirstNonWhitespaceChar(n,i);return i+1<o?new Range$2(t.lineNumber,t.column,t.lineNumber,o+1):null}static deleteWordRight(e,t){const n=e.wordSeparators,i=e.model,o=e.selection,r=e.whitespaceHeuristics;if(!o.isEmpty())return o;const s=new Position$1(o.positionLineNumber,o.positionColumn);let a=s.lineNumber,l=s.column;const c=i.getLineCount(),d=i.getLineMaxColumn(a);if(a===c&&l===d)return null;if(r){const e=this._deleteWordRightWhitespace(i,s);if(e)return e}let u=WordOperations._findNextWordOnLine(n,i,s);return 2===t?u?l=u.end+1:l<d||a===c?l=d:(a++,u=WordOperations._findNextWordOnLine(n,i,new Position$1(a,1)),l=u?u.start+1:i.getLineMaxColumn(a)):(u&&l>=u.start+1&&(u=WordOperations._findNextWordOnLine(n,i,new Position$1(a,u.end+1))),u?l=u.start+1:l<d||a===c?l=d:(a++,u=WordOperations._findNextWordOnLine(n,i,new Position$1(a,1)),l=u?u.start+1:i.getLineMaxColumn(a))),new Range$2(a,l,s.lineNumber,s.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;const n=t.getPosition(),i=WordOperations._moveWordPartRight(e,n);return new Range$2(n.lineNumber,n.column,i.lineNumber,i.column)}static _createWordAtPosition(e,t,n){const i=new Range$2(t,n.start+1,t,n.end+1);return{word:e.getValueInRange(i),startColumn:i.startColumn,endColumn:i.endColumn}}static getWordAtPosition(e,t,n){const i=getMapForWordSeparators(t),o=WordOperations._findPreviousWordOnLine(i,e,n);if(o&&1===o.wordType&&o.start<=n.column-1&&n.column-1<=o.end)return WordOperations._createWordAtPosition(e,n.lineNumber,o);const r=WordOperations._findNextWordOnLine(i,e,n);return r&&1===r.wordType&&r.start<=n.column-1&&n.column-1<=r.end?WordOperations._createWordAtPosition(e,n.lineNumber,r):null}static word(e,t,n,i,o){const r=getMapForWordSeparators(e.wordSeparators),s=WordOperations._findPreviousWordOnLine(r,t,o),a=WordOperations._findNextWordOnLine(r,t,o);if(!i){let e,n;return s&&1===s.wordType&&s.start<=o.column-1&&o.column-1<=s.end?(e=s.start+1,n=s.end+1):a&&1===a.wordType&&a.start<=o.column-1&&o.column-1<=a.end?(e=a.start+1,n=a.end+1):(e=s?s.end+1:1,n=a?a.start+1:t.getLineMaxColumn(o.lineNumber)),new SingleCursorState(new Range$2(o.lineNumber,e,o.lineNumber,n),0,new Position$1(o.lineNumber,n),0)}let l,c;s&&1===s.wordType&&s.start<o.column-1&&o.column-1<s.end?(l=s.start+1,c=s.end+1):a&&1===a.wordType&&a.start<o.column-1&&o.column-1<a.end?(l=a.start+1,c=a.end+1):(l=o.column,c=o.column);const d=o.lineNumber;let u;if(n.selectionStart.containsPosition(o))u=n.selectionStart.endColumn;else if(o.isBeforeOrEqual(n.selectionStart.getStartPosition())){u=l;const e=new Position$1(d,u);n.selectionStart.containsPosition(e)&&(u=n.selectionStart.endColumn)}else{u=c;const e=new Position$1(d,u);n.selectionStart.containsPosition(e)&&(u=n.selectionStart.startColumn)}return n.move(!0,d,u,0)}}class WordPartOperations extends WordOperations{static deleteWordPartLeft(e){const t=enforceDefined([WordOperations.deleteWordLeft(e,0),WordOperations.deleteWordLeft(e,2),WordOperations._deleteWordPartLeft(e.model,e.selection)]);return t.sort(Range$2.compareRangesUsingEnds),t[2]}static deleteWordPartRight(e){const t=enforceDefined([WordOperations.deleteWordRight(e,0),WordOperations.deleteWordRight(e,2),WordOperations._deleteWordPartRight(e.model,e.selection)]);return t.sort(Range$2.compareRangesUsingStarts),t[0]}static moveWordPartLeft(e,t,n){const i=enforceDefined([WordOperations.moveWordLeft(e,t,n,0),WordOperations.moveWordLeft(e,t,n,2),WordOperations._moveWordPartLeft(t,n)]);return i.sort(Position$1.compare),i[2]}static moveWordPartRight(e,t,n){const i=enforceDefined([WordOperations.moveWordRight(e,t,n,0),WordOperations.moveWordRight(e,t,n,2),WordOperations._moveWordPartRight(t,n)]);return i.sort(Position$1.compare),i[0]}}function enforceDefined(e){return e.filter((e=>Boolean(e)))}class CursorMoveCommands{static addCursorDown(e,t,n){const i=[];let o=0;for(let r=0,s=t.length;r<s;r++){const s=t[r];i[o++]=new CursorState$1(s.modelState,s.viewState),i[o++]=n?CursorState$1.fromModelState(MoveOperations.translateDown(e.cursorConfig,e.model,s.modelState)):CursorState$1.fromViewState(MoveOperations.translateDown(e.cursorConfig,e,s.viewState))}return i}static addCursorUp(e,t,n){const i=[];let o=0;for(let r=0,s=t.length;r<s;r++){const s=t[r];i[o++]=new CursorState$1(s.modelState,s.viewState),i[o++]=n?CursorState$1.fromModelState(MoveOperations.translateUp(e.cursorConfig,e.model,s.modelState)):CursorState$1.fromViewState(MoveOperations.translateUp(e.cursorConfig,e,s.viewState))}return i}static moveToBeginningOfLine(e,t,n){let i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o];i[o]=this._moveToLineStart(e,r,n)}return i}static _moveToLineStart(e,t,n){const i=t.viewState.position.column,o=i===t.modelState.position.column,r=t.viewState.position.lineNumber,s=e.getLineFirstNonWhitespaceColumn(r);return o||i===s?this._moveToLineStartByModel(e,t,n):this._moveToLineStartByView(e,t,n)}static _moveToLineStartByView(e,t,n){return CursorState$1.fromViewState(MoveOperations.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,n))}static _moveToLineStartByModel(e,t,n){return CursorState$1.fromModelState(MoveOperations.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,n))}static moveToEndOfLine(e,t,n,i){const o=[];for(let r=0,s=t.length;r<s;r++){const s=t[r];o[r]=this._moveToLineEnd(e,s,n,i)}return o}static _moveToLineEnd(e,t,n,i){const o=t.viewState.position,r=e.getLineMaxColumn(o.lineNumber),s=o.column===r,a=t.modelState.position,l=e.model.getLineMaxColumn(a.lineNumber),c=r-o.column==l-a.column;return s||c?this._moveToLineEndByModel(e,t,n,i):this._moveToLineEndByView(e,t,n,i)}static _moveToLineEndByView(e,t,n,i){return CursorState$1.fromViewState(MoveOperations.moveToEndOfLine(e.cursorConfig,e,t.viewState,n,i))}static _moveToLineEndByModel(e,t,n,i){return CursorState$1.fromModelState(MoveOperations.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,n,i))}static expandLineSelection(e,t){const n=[];for(let i=0,o=t.length;i<o;i++){const o=t[i],r=o.modelState.selection.startLineNumber,s=e.model.getLineCount();let a,l=o.modelState.selection.endLineNumber;l===s?a=e.model.getLineMaxColumn(s):(l++,a=1),n[i]=CursorState$1.fromModelState(new SingleCursorState(new Range$2(r,1,r,1),0,new Position$1(l,a),0))}return n}static moveToBeginningOfBuffer(e,t,n){const i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o];i[o]=CursorState$1.fromModelState(MoveOperations.moveToBeginningOfBuffer(e.cursorConfig,e.model,r.modelState,n))}return i}static moveToEndOfBuffer(e,t,n){const i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o];i[o]=CursorState$1.fromModelState(MoveOperations.moveToEndOfBuffer(e.cursorConfig,e.model,r.modelState,n))}return i}static selectAll(e,t){const n=e.model.getLineCount(),i=e.model.getLineMaxColumn(n);return CursorState$1.fromModelState(new SingleCursorState(new Range$2(1,1,1,1),0,new Position$1(n,i),0))}static line(e,t,n,i,o){const r=e.model.validatePosition(i),s=o?e.coordinatesConverter.validateViewPosition(new Position$1(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);if(!n||!t.modelState.hasSelection()){const t=e.model.getLineCount();let n=r.lineNumber+1,i=1;return n>t&&(n=t,i=e.model.getLineMaxColumn(n)),CursorState$1.fromModelState(new SingleCursorState(new Range$2(r.lineNumber,1,n,i),0,new Position$1(n,i),0))}const a=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumber<a)return CursorState$1.fromViewState(t.viewState.move(t.modelState.hasSelection(),s.lineNumber,1,0));if(r.lineNumber>a){const n=e.getLineCount();let i=s.lineNumber+1,o=1;return i>n&&(i=n,o=e.getLineMaxColumn(i)),CursorState$1.fromViewState(t.viewState.move(t.modelState.hasSelection(),i,o,0))}{const e=t.modelState.selectionStart.getEndPosition();return CursorState$1.fromModelState(t.modelState.move(t.modelState.hasSelection(),e.lineNumber,e.column,0))}}static word(e,t,n,i){const o=e.model.validatePosition(i);return CursorState$1.fromModelState(WordOperations.word(e.cursorConfig,e.model,t.modelState,n,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new CursorState$1(t.modelState,t.viewState);const n=t.viewState.position.lineNumber,i=t.viewState.position.column;return CursorState$1.fromViewState(new SingleCursorState(new Range$2(n,i,n,i),0,new Position$1(n,i),0))}static moveTo(e,t,n,i,o){const r=e.model.validatePosition(i),s=o?e.coordinatesConverter.validateViewPosition(new Position$1(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return CursorState$1.fromViewState(t.viewState.move(n,s.lineNumber,s.column,0))}static simpleMove(e,t,n,i,o,r){switch(n){case 0:return 4===r?this._moveHalfLineLeft(e,t,i):this._moveLeft(e,t,i,o);case 1:return 4===r?this._moveHalfLineRight(e,t,i):this._moveRight(e,t,i,o);case 2:return 2===r?this._moveUpByViewLines(e,t,i,o):this._moveUpByModelLines(e,t,i,o);case 3:return 2===r?this._moveDownByViewLines(e,t,i,o):this._moveDownByModelLines(e,t,i,o);case 4:return 2===r?t.map((t=>CursorState$1.fromViewState(MoveOperations.moveToPrevBlankLine(e.cursorConfig,e,t.viewState,i)))):t.map((t=>CursorState$1.fromModelState(MoveOperations.moveToPrevBlankLine(e.cursorConfig,e.model,t.modelState,i))));case 5:return 2===r?t.map((t=>CursorState$1.fromViewState(MoveOperations.moveToNextBlankLine(e.cursorConfig,e,t.viewState,i)))):t.map((t=>CursorState$1.fromModelState(MoveOperations.moveToNextBlankLine(e.cursorConfig,e.model,t.modelState,i))));case 6:return this._moveToViewMinColumn(e,t,i);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,i);case 8:return this._moveToViewCenterColumn(e,t,i);case 9:return this._moveToViewMaxColumn(e,t,i);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,i);default:return null}}static viewportMove(e,t,n,i,o){const r=e.getCompletelyVisibleViewRange(),s=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(n){case 11:{const n=this._firstLineNumberInRange(e.model,s,o),r=e.model.getLineFirstNonWhitespaceColumn(n);return[this._moveToModelPosition(e,t[0],i,n,r)]}case 13:{const n=this._lastLineNumberInRange(e.model,s,o),r=e.model.getLineFirstNonWhitespaceColumn(n);return[this._moveToModelPosition(e,t[0],i,n,r)]}case 12:{const n=Math.round((s.startLineNumber+s.endLineNumber)/2),o=e.model.getLineFirstNonWhitespaceColumn(n);return[this._moveToModelPosition(e,t[0],i,n,o)]}case 14:{const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=this.findPositionInViewportIfOutside(e,s,r,i)}return n}default:return null}}static findPositionInViewportIfOutside(e,t,n,i){const o=t.viewState.position.lineNumber;if(n.startLineNumber<=o&&o<=n.endLineNumber-1)return new CursorState$1(t.modelState,t.viewState);{let r;r=o>n.endLineNumber-1?n.endLineNumber-1:o<n.startLineNumber?n.startLineNumber:o;const s=MoveOperations.vertical(e.cursorConfig,e,o,t.viewState.position.column,t.viewState.leftoverVisibleColumns,r,!1);return CursorState$1.fromViewState(t.viewState.move(i,s.lineNumber,s.column,s.leftoverVisibleColumns))}}static _firstLineNumberInRange(e,t,n){let i=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(i)&&i++,Math.min(t.endLineNumber,i+n-1)}static _lastLineNumberInRange(e,t,n){let i=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(i)&&i++,Math.max(i,t.endLineNumber-n+1)}static _moveLeft(e,t,n,i){return t.map((t=>CursorState$1.fromViewState(MoveOperations.moveLeft(e.cursorConfig,e,t.viewState,n,i))))}static _moveHalfLineLeft(e,t,n){const i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o],s=r.viewState.position.lineNumber,a=Math.round(e.getLineContent(s).length/2);i[o]=CursorState$1.fromViewState(MoveOperations.moveLeft(e.cursorConfig,e,r.viewState,n,a))}return i}static _moveRight(e,t,n,i){return t.map((t=>CursorState$1.fromViewState(MoveOperations.moveRight(e.cursorConfig,e,t.viewState,n,i))))}static _moveHalfLineRight(e,t,n){const i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o],s=r.viewState.position.lineNumber,a=Math.round(e.getLineContent(s).length/2);i[o]=CursorState$1.fromViewState(MoveOperations.moveRight(e.cursorConfig,e,r.viewState,n,a))}return i}static _moveDownByViewLines(e,t,n,i){const o=[];for(let r=0,s=t.length;r<s;r++){const s=t[r];o[r]=CursorState$1.fromViewState(MoveOperations.moveDown(e.cursorConfig,e,s.viewState,n,i))}return o}static _moveDownByModelLines(e,t,n,i){const o=[];for(let r=0,s=t.length;r<s;r++){const s=t[r];o[r]=CursorState$1.fromModelState(MoveOperations.moveDown(e.cursorConfig,e.model,s.modelState,n,i))}return o}static _moveUpByViewLines(e,t,n,i){const o=[];for(let r=0,s=t.length;r<s;r++){const s=t[r];o[r]=CursorState$1.fromViewState(MoveOperations.moveUp(e.cursorConfig,e,s.viewState,n,i))}return o}static _moveUpByModelLines(e,t,n,i){const o=[];for(let r=0,s=t.length;r<s;r++){const s=t[r];o[r]=CursorState$1.fromModelState(MoveOperations.moveUp(e.cursorConfig,e.model,s.modelState,n,i))}return o}static _moveToViewPosition(e,t,n,i,o){return CursorState$1.fromViewState(t.viewState.move(n,i,o,0))}static _moveToModelPosition(e,t,n,i,o){return CursorState$1.fromModelState(t.modelState.move(n,i,o,0))}static _moveToViewMinColumn(e,t,n){const i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o],s=r.viewState.position.lineNumber,a=e.getLineMinColumn(s);i[o]=this._moveToViewPosition(e,r,n,s,a)}return i}static _moveToViewFirstNonWhitespaceColumn(e,t,n){const i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o],s=r.viewState.position.lineNumber,a=e.getLineFirstNonWhitespaceColumn(s);i[o]=this._moveToViewPosition(e,r,n,s,a)}return i}static _moveToViewCenterColumn(e,t,n){const i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o],s=r.viewState.position.lineNumber,a=Math.round((e.getLineMaxColumn(s)+e.getLineMinColumn(s))/2);i[o]=this._moveToViewPosition(e,r,n,s,a)}return i}static _moveToViewMaxColumn(e,t,n){const i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o],s=r.viewState.position.lineNumber,a=e.getLineMaxColumn(s);i[o]=this._moveToViewPosition(e,r,n,s,a)}return i}static _moveToViewLastNonWhitespaceColumn(e,t,n){const i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o],s=r.viewState.position.lineNumber,a=e.getLineLastNonWhitespaceColumn(s);i[o]=this._moveToViewPosition(e,r,n,s,a)}return i}}var CursorMove,CursorMove2;CursorMove2=CursorMove||(CursorMove={}),CursorMove2.description={description:"Move cursor to a logical position in the view",args:[{name:"Cursor move argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory logical position value providing where to move the cursor.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',\n\t\t\t\t\t\t'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'\n\t\t\t\t\t\t'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'\n\t\t\t\t\t\t'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'character', 'halfLine'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'select': If 'true' makes the selection. Default is 'false'.\n\t\t\t\t",constraint:function(e){if(!isObject(e))return!1;const t=e;return!(!isString$1(t.to)||!isUndefined(t.select)&&!isBoolean(t.select)||!isUndefined(t.by)&&!isString$1(t.by)||!isUndefined(t.value)&&!isNumber$1(t.value))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},CursorMove2.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},CursorMove2.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"},CursorMove2.parse=function(e){if(!e.to)return null;let t;switch(e.to){case CursorMove2.RawDirection.Left:t=0;break;case CursorMove2.RawDirection.Right:t=1;break;case CursorMove2.RawDirection.Up:t=2;break;case CursorMove2.RawDirection.Down:t=3;break;case CursorMove2.RawDirection.PrevBlankLine:t=4;break;case CursorMove2.RawDirection.NextBlankLine:t=5;break;case CursorMove2.RawDirection.WrappedLineStart:t=6;break;case CursorMove2.RawDirection.WrappedLineFirstNonWhitespaceCharacter:t=7;break;case CursorMove2.RawDirection.WrappedLineColumnCenter:t=8;break;case CursorMove2.RawDirection.WrappedLineEnd:t=9;break;case CursorMove2.RawDirection.WrappedLineLastNonWhitespaceCharacter:t=10;break;case CursorMove2.RawDirection.ViewPortTop:t=11;break;case CursorMove2.RawDirection.ViewPortBottom:t=13;break;case CursorMove2.RawDirection.ViewPortCenter:t=12;break;case CursorMove2.RawDirection.ViewPortIfOutside:t=14;break;default:return null}let n=0;switch(e.by){case CursorMove2.RawUnit.Line:n=1;break;case CursorMove2.RawUnit.WrappedLine:n=2;break;case CursorMove2.RawUnit.Character:n=3;break;case CursorMove2.RawUnit.HalfLine:n=4}return{direction:t,unit:n,select:!!e.select,value:e.value||1}};const USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function createWordRegExp(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const n of USUAL_WORD_SEPARATORS)e.indexOf(n)>=0||(t+="\\"+n);return t+="\\s]+)",new RegExp(t,"g")}const DEFAULT_WORD_REGEXP=createWordRegExp();function ensureValidWordDefinition(e){let t=DEFAULT_WORD_REGEXP;if(e&&e instanceof RegExp)if(e.global)t=e;else{let n="g";e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.unicode&&(n+="u"),t=new RegExp(e.source,n)}return t.lastIndex=0,t}const _defaultConfig={maxLen:1e3,windowSize:15,timeBudget:150};function getWordAtText(e,t,n,i,o=_defaultConfig){if(n.length>o.maxLen){let r=e-o.maxLen/2;return r<0?r=0:i+=r,getWordAtText(e,t,n=n.substring(r,e+o.maxLen/2),i,o)}const r=Date.now(),s=e-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-r>=o.timeBudget);c++){const e=s-o.windowSize*c;t.lastIndex=Math.max(0,e);const i=_findRegexMatchEnclosingPosition(t,n,s,a);if(!i&&l)break;if(l=i,e<=0)break;a=e}if(l){const e={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return t.lastIndex=0,e}return null}function _findRegexMatchEnclosingPosition(e,t,n,i){let o;for(;o=e.exec(t);){const t=o.index||0;if(t<=n&&e.lastIndex>=n)return o;if(i>0&&t>i)return null}return null}var IndentAction$1,IndentAction2;IndentAction2=IndentAction$1||(IndentAction$1={}),IndentAction2[IndentAction2.None=0]="None",IndentAction2[IndentAction2.Indent=1]="Indent",IndentAction2[IndentAction2.IndentOutdent=2]="IndentOutdent",IndentAction2[IndentAction2.Outdent=3]="Outdent";class StandardAutoClosingPairConditional{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,n=e.notIn.length;t<n;t++){switch(e.notIn[t]){case"string":this._inString=!1;break;case"comment":this._inComment=!1;break;case"regex":this._inRegEx=!1}}}isOK(e){switch(e){case 0:return!0;case 1:return this._inComment;case 2:return this._inString;case 3:return this._inRegEx}}shouldAutoClose(e,t){if(0===e.getTokenCount())return!0;const n=e.findTokenIndexAtOffset(t-2),i=e.getStandardTokenType(n);return this.isOK(i)}_findNeutralCharacterInRange(e,t){for(let n=e;n<=t;n++){const e=String.fromCharCode(n);if(!this.open.includes(e)&&!this.close.includes(e))return e}return null}findNeutralCharacter(){return this._neutralCharacterSearched||(this._neutralCharacterSearched=!0,this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(48,57)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(97,122)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(65,90))),this._neutralCharacter}}class AutoClosingPairs{constructor(e){this.autoClosingPairsOpenByStart=new Map,this.autoClosingPairsOpenByEnd=new Map,this.autoClosingPairsCloseByStart=new Map,this.autoClosingPairsCloseByEnd=new Map,this.autoClosingPairsCloseSingleChar=new Map;for(const t of e)appendEntry(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),appendEntry(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),appendEntry(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),appendEntry(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),1===t.close.length&&1===t.open.length&&appendEntry(this.autoClosingPairsCloseSingleChar,t.close,t)}}function appendEntry(e,t,n){e.has(t)?e.get(t).push(n):e.set(t,[n])}class CharacterPairSupport{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map((e=>new StandardAutoClosingPairConditional(e))):e.brackets?this._autoClosingPairs=e.brackets.map((e=>new StandardAutoClosingPairConditional({open:e[0],close:e[1]}))):this._autoClosingPairs=[],e.colorizedBracketPairs?this._colorizedBracketPairs=filterValidBrackets(e.colorizedBracketPairs.map((e=>[e[0],e[1]]))):e.brackets?this._colorizedBracketPairs=filterValidBrackets(e.brackets.map((e=>[e[0],e[1]])).filter((e=>!("<"===e[0]&&">"===e[1])))):this._colorizedBracketPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new StandardAutoClosingPairConditional({open:t.open,close:t.close||""}))}this._autoCloseBefore="string"==typeof e.autoCloseBefore?e.autoCloseBefore:CharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(){return this._autoCloseBefore}getSurroundingPairs(){return this._surroundingPairs}getColorizedBrackets(){return this._colorizedBracketPairs}}function filterValidBrackets(e){return e.filter((([e,t])=>""!==e&&""!==t))}function tail(e,t=0){return e[e.length-(1+t)]}function tail2(e){if(0===e.length)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}function equals$1(e,t,n=((e,t)=>e===t)){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(let i=0,o=e.length;i<o;i++)if(!n(e[i],t[i]))return!1;return!0}function binarySearch(e,t,n){let i=0,o=e.length-1;for(;i<=o;){const r=(i+o)/2|0,s=n(e[r],t);if(s<0)i=r+1;else{if(!(s>0))return r;o=r-1}}return-(i+1)}function findFirstInSorted(e,t){let n=0,i=e.length;if(0===i)return 0;for(;n<i;){const o=Math.floor((n+i)/2);t(e[o])?i=o:n=o+1}return n}function quickSelect(e,t,n){if((e|=0)>=t.length)throw new TypeError("invalid index");let i=t[Math.floor(t.length*Math.random())],o=[],r=[],s=[];for(let a of t){const e=n(a,i);e<0?o.push(a):e>0?r.push(a):s.push(a)}return e<o.length?quickSelect(e,o,n):e<o.length+s.length?s[0]:quickSelect(e-(o.length+s.length),r,n)}function groupBy(e,t){const n=[];let i;for(const o of e.slice(0).sort(t))i&&0===t(i[0],o)?i.push(o):(i=[o],n.push(i));return n}function coalesce(e){return e.filter((e=>!!e))}function isFalsyOrEmpty(e){return!Array.isArray(e)||0===e.length}function isNonEmptyArray(e){return Array.isArray(e)&&e.length>0}function distinct(e,t=(e=>e)){const n=new Set;return e.filter((e=>{const i=t(e);return!n.has(i)&&(n.add(i),!0)}))}function findLast(e,t){const n=lastIndex(e,t);if(-1!==n)return e[n]}function lastIndex(e,t){for(let n=e.length-1;n>=0;n--){if(t(e[n]))return n}return-1}function firstOrDefault(e,t){return e.length>0?e[0]:t}function flatten(e){return[].concat(...e)}function range(e,t){let n="number"==typeof t?e:0;"number"==typeof t?n=e:(n=0,t=e);const i=[];if(n<=t)for(let o=n;o<t;o++)i.push(o);else for(let o=n;o>t;o--)i.push(o);return i}function arrayInsert(e,t,n){const i=e.slice(0,t),o=e.slice(t);return i.concat(n,o)}function pushToStart(e,t){const n=e.indexOf(t);n>-1&&(e.splice(n,1),e.unshift(t))}function pushToEnd(e,t){const n=e.indexOf(t);n>-1&&(e.splice(n,1),e.push(t))}function asArray(e){return Array.isArray(e)?e:[e]}function insertInto(e,t,n){const i=getActualStartIndex(e,t),o=e.length,r=n.length;e.length=o+r;for(let s=o-1;s>=i;s--)e[s+r]=e[s];for(let s=0;s<r;s++)e[s+i]=n[s]}function splice$1(e,t,n,i){const o=getActualStartIndex(e,t),r=e.splice(o,n);return insertInto(e,o,i),r}function getActualStartIndex(e,t){return t<0?Math.max(t+e.length,0):Math.min(t,e.length)}function compareBy(e,t){return(n,i)=>t(e(n),e(i))}CharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED=";:.,=}])> \n\t";const numberComparator=(e,t)=>e-t;function findMaxBy(e,t){if(0===e.length)return;let n=e[0];for(let i=1;i<e.length;i++){const o=e[i];t(o,n)>0&&(n=o)}return n}function findLastMaxBy(e,t){if(0===e.length)return;let n=e[0];for(let i=1;i<e.length;i++){const o=e[i];t(o,n)>=0&&(n=o)}return n}function findMinBy(e,t){return findMaxBy(e,((e,n)=>-t(e,n)))}class ArrayQueue{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const n=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,n}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const n=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,n}peek(){return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}const hasBuffer="undefined"!=typeof Buffer;let textDecoder,_utf16LE_TextDecoder,_utf16BE_TextDecoder,_platformTextDecoder;class VSBuffer{constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}static wrap(e){return hasBuffer&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new VSBuffer(e)}toString(){return hasBuffer?this.buffer.toString():(textDecoder||(textDecoder=new TextDecoder),textDecoder.decode(this.buffer))}}function readUInt16LE(e,t){return e[t+0]<<0>>>0|e[t+1]<<8>>>0}function writeUInt16LE(e,t,n){e[n+0]=255&t,t>>>=8,e[n+1]=255&t}function readUInt32BE(e,t){return e[t]*Math.pow(2,24)+e[t+1]*Math.pow(2,16)+e[t+2]*Math.pow(2,8)+e[t+3]}function writeUInt32BE(e,t,n){e[n+3]=t,t>>>=8,e[n+2]=t,t>>>=8,e[n+1]=t,t>>>=8,e[n]=t}function readUInt8(e,t){return e[t]}function writeUInt8(e,t,n){e[n]=t}function getUTF16LE_TextDecoder(){return _utf16LE_TextDecoder||(_utf16LE_TextDecoder=new TextDecoder("UTF-16LE")),_utf16LE_TextDecoder}function getUTF16BE_TextDecoder(){return _utf16BE_TextDecoder||(_utf16BE_TextDecoder=new TextDecoder("UTF-16BE")),_utf16BE_TextDecoder}function getPlatformTextDecoder(){return _platformTextDecoder||(_platformTextDecoder=isLittleEndian()?getUTF16LE_TextDecoder():getUTF16BE_TextDecoder()),_platformTextDecoder}const hasTextDecoder="undefined"!=typeof TextDecoder;let createStringBuilder,decodeUTF16LE;function standardDecodeUTF16LE(e,t,n){const i=new Uint16Array(e.buffer,t,n);return n>0&&(65279===i[0]||65534===i[0])?compatDecodeUTF16LE(e,t,n):getUTF16LE_TextDecoder().decode(i)}function compatDecodeUTF16LE(e,t,n){const i=[];let o=0;for(let r=0;r<n;r++){const n=readUInt16LE(e,t);t+=2,i[o++]=String.fromCharCode(n)}return i.join("")}hasTextDecoder?(createStringBuilder=e=>new StringBuilder(e),decodeUTF16LE=standardDecodeUTF16LE):(createStringBuilder=e=>new CompatStringBuilder,decodeUTF16LE=compatDecodeUTF16LE);class StringBuilder{constructor(e){this._capacity=0|e,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return null!==this._completedStrings?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(0===this._bufferLength)return"";const e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return getPlatformTextDecoder().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,null===this._completedStrings?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}write1(e){const t=this._capacity-this._bufferLength;t<=1&&(0===t||isHighSurrogate(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCII(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIIString(e){const t=e.length;if(this._bufferLength+t>=this._capacity)return this._flushBuffer(),void(this._completedStrings[this._completedStrings.length]=e);for(let n=0;n<t;n++)this._buffer[this._bufferLength++]=e.charCodeAt(n)}}class CompatStringBuilder{constructor(){this._pieces=[],this._piecesLen=0}reset(){this._pieces=[],this._piecesLen=0}build(){return this._pieces.join("")}write1(e){this._pieces[this._piecesLen++]=String.fromCharCode(e)}appendASCII(e){this._pieces[this._piecesLen++]=String.fromCharCode(e)}appendASCIIString(e){this._pieces[this._piecesLen++]=e}}class RichEditBracket{constructor(e,t,n,i,o,r){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=n,this.close=i,this.forwardRegex=o,this.reversedRegex=r,this._openSet=RichEditBracket._toSet(this.open),this._closeSet=RichEditBracket._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){const t=new Set;for(const n of e)t.add(n);return t}}function groupFuzzyBrackets(e){const t=e.length;e=e.map((e=>[e[0].toLowerCase(),e[1].toLowerCase()]));const n=[];for(let s=0;s<t;s++)n[s]=s;const i=(e,t)=>{const[n,i]=e,[o,r]=t;return n===o||n===r||i===o||i===r},o=(e,i)=>{const o=Math.min(e,i),r=Math.max(e,i);for(let s=0;s<t;s++)n[s]===r&&(n[s]=o)};for(let s=0;s<t;s++){const r=e[s];for(let a=s+1;a<t;a++){i(r,e[a])&&o(n[s],n[a])}}const r=[];for(let s=0;s<t;s++){const i=[],o=[];for(let r=0;r<t;r++)if(n[r]===s){const[t,n]=e[r];i.push(t),o.push(n)}i.length>0&&r.push({open:i,close:o})}return r}class RichEditBrackets{constructor(e,t){this._richEditBracketsBrand=void 0;const n=groupFuzzyBrackets(t);this.brackets=n.map(((t,i)=>new RichEditBracket(e,i,t.open,t.close,getRegexForBracketPair(t.open,t.close,n,i),getReversedRegexForBracketPair(t.open,t.close,n,i)))),this.forwardRegex=getRegexForBrackets(this.brackets),this.reversedRegex=getReversedRegexForBrackets(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const i of this.brackets){for(const e of i.open)this.textIsBracket[e]=i,this.textIsOpenBracket[e]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,e.length);for(const e of i.close)this.textIsBracket[e]=i,this.textIsOpenBracket[e]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,e.length)}}}function collectSuperstrings(e,t,n,i){for(let o=0,r=t.length;o<r;o++){if(o===n)continue;const r=t[o];for(const t of r.open)t.indexOf(e)>=0&&i.push(t);for(const t of r.close)t.indexOf(e)>=0&&i.push(t)}}function lengthcmp(e,t){return e.length-t.length}function unique(e){if(e.length<=1)return e;const t=[],n=new Set;for(const i of e)n.has(i)||(t.push(i),n.add(i));return t}function getRegexForBracketPair(e,t,n,i){let o=[];o=o.concat(e),o=o.concat(t);for(let r=0,s=o.length;r<s;r++)collectSuperstrings(o[r],n,i,o);return o=unique(o),o.sort(lengthcmp),o.reverse(),createBracketOrRegExp(o)}function getReversedRegexForBracketPair(e,t,n,i){let o=[];o=o.concat(e),o=o.concat(t);for(let r=0,s=o.length;r<s;r++)collectSuperstrings(o[r],n,i,o);return o=unique(o),o.sort(lengthcmp),o.reverse(),createBracketOrRegExp(o.map(toReversedString))}function getRegexForBrackets(e){let t=[];for(const n of e){for(const e of n.open)t.push(e);for(const e of n.close)t.push(e)}return t=unique(t),createBracketOrRegExp(t)}function getReversedRegexForBrackets(e){let t=[];for(const n of e){for(const e of n.open)t.push(e);for(const e of n.close)t.push(e)}return t=unique(t),createBracketOrRegExp(t.map(toReversedString))}function prepareBracketForRegExp$1(e){const t=/^[\w ]+$/.test(e);return e=escapeRegExpCharacters(e),t?`\\b${e}\\b`:e}function createBracketOrRegExp(e){return createRegExp(`(${e.map(prepareBracketForRegExp$1).join(")|(")})`,!0)}const toReversedString=function(){let e=null,t=null;return function(n){return e!==n&&(e=n,t=function(e){if(hasTextDecoder){const t=new Uint16Array(e.length);let n=0;for(let i=e.length-1;i>=0;i--)t[n++]=e.charCodeAt(i);return getPlatformTextDecoder().decode(t)}{const t=[];let n=0;for(let i=e.length-1;i>=0;i--)t[n++]=e.charAt(i);return t.join("")}}(e)),t}}();class BracketsUtils{static _findPrevBracketInText(e,t,n,i){const o=n.match(e);if(!o)return null;const r=n.length-(o.index||0),s=o[0].length,a=i+r;return new Range$2(t,a-s+1,t,a+1)}static findPrevBracketInRange(e,t,n,i,o){const r=toReversedString(n).substring(n.length-o,n.length-i);return this._findPrevBracketInText(e,t,r,i)}static findNextBracketInText(e,t,n,i){const o=n.match(e);if(!o)return null;const r=o.index||0,s=o[0].length;if(0===s)return null;const a=i+r;return new Range$2(t,a+1,t,a+1+s)}static findNextBracketInRange(e,t,n,i,o){const r=n.substring(i,o);return this.findNextBracketInText(e,t,r,i)}}class BracketElectricCharacterSupport{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const n of t.close){const t=n.charAt(n.length-1);e.push(t)}return distinct(e)}onElectricCharacter(e,t,n){if(!this._richEditBrackets||0===this._richEditBrackets.brackets.length)return null;const i=t.findTokenIndexAtOffset(n-1);if(ignoreBracketsInToken(t.getStandardTokenType(i)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,n-1)+e,s=BracketsUtils.findPrevBracketInRange(o,1,r,0,r.length);if(!s)return null;const a=r.substring(s.startColumn-1,s.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[a])return null;const l=t.getActualLineContentBefore(s.startColumn-1);return/^\s*$/.test(l)?{matchOpenBracket:a}:null}}function resetGlobalRegex(e){return e.global&&(e.lastIndex=0),!0}class IndentRulesSupport{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&resetGlobalRegex(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&resetGlobalRegex(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&resetGlobalRegex(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&resetGlobalRegex(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class OnEnterSupport{constructor(e){(e=e||{}).brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach((e=>{const t=OnEnterSupport._createOpenBracketRegExp(e[0]),n=OnEnterSupport._createCloseBracketRegExp(e[1]);t&&n&&this._brackets.push({open:e[0],openRegExp:t,close:e[1],closeRegExp:n})})),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,n,i){if(e>=3)for(let o=0,r=this._regExpRules.length;o<r;o++){const e=this._regExpRules[o];if([{reg:e.beforeText,text:n},{reg:e.afterText,text:i},{reg:e.previousLineText,text:t}].every((e=>!e.reg||(e.reg.lastIndex=0,e.reg.test(e.text)))))return e.action}if(e>=2&&n.length>0&&i.length>0)for(let o=0,r=this._brackets.length;o<r;o++){const e=this._brackets[o];if(e.openRegExp.test(n)&&e.closeRegExp.test(i))return{indentAction:IndentAction$1.IndentOutdent}}if(e>=2&&n.length>0)for(let o=0,r=this._brackets.length;o<r;o++){if(this._brackets[o].openRegExp.test(n))return{indentAction:IndentAction$1.Indent}}return null}static _createOpenBracketRegExp(e){let t=escapeRegExpCharacters(e);return/\B/.test(t.charAt(0))||(t="\\b"+t),t+="\\s*$",OnEnterSupport._safeRegExp(t)}static _createCloseBracketRegExp(e){let t=escapeRegExpCharacters(e);return/\B/.test(t.charAt(t.length-1))||(t+="\\b"),t="^\\s*"+t,OnEnterSupport._safeRegExp(t)}static _safeRegExp(e){try{return new RegExp(e)}catch(t){return onUnexpectedError(t),null}}}const IConfigurationService=createDecorator("configurationService");function toValuesTree(e,t){const n=Object.create(null);for(let i in e)addToValueTree(n,i,e[i],t);return n}function addToValueTree(e,t,n,i){const o=t.split("."),r=o.pop();let s=e;for(let a=0;a<o.length;a++){let e=o[a],n=s[e];switch(typeof n){case"undefined":n=s[e]=Object.create(null);break;case"object":break;default:return void i(`Ignoring ${t} as ${o.slice(0,a+1).join(".")} is ${JSON.stringify(n)}`)}s=n}if("object"==typeof s&&null!==s)try{s[r]=n}catch(e2){i(`Ignoring ${t} as ${o.join(".")} is ${JSON.stringify(s)}`)}else i(`Ignoring ${t} as ${o.join(".")} is ${JSON.stringify(s)}`)}function removeFromValueTree(e,t){doRemoveFromValueTree(e,t.split("."))}function doRemoveFromValueTree(e,t){const n=t.shift();if(0!==t.length){if(-1!==Object.keys(e).indexOf(n)){const i=e[n];"object"!=typeof i||Array.isArray(i)||(doRemoveFromValueTree(i,t),0===Object.keys(i).length&&delete e[n])}}else delete e[n]}function getConfigurationValue(e,t,n){const i=function(e,t){let n=e;for(const i of t){if("object"!=typeof n||null===n)return;n=n[i]}return n}(e,t.split("."));return void 0===i?n:i}const ILanguageService=createDecorator("languageService");class SyncDescriptor{constructor(e,t=[],n=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=n}}const _registry=[];function registerSingleton(e,t,n){t instanceof SyncDescriptor||(t=new SyncDescriptor(t,[],n)),_registry.push([e,t])}function getSingletonServiceDescriptors(){return _registry}var __decorate$1A=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1u=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};class LanguageConfigurationServiceChangeEvent{constructor(e){this.languageId=e}affects(e){return!this.languageId||this.languageId===e}}const ILanguageConfigurationService=createDecorator("languageConfigurationService");let LanguageConfigurationService=class extends Disposable{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this.onDidChangeEmitter=this._register(new Emitter$1),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const n=new Set(Object.values(customizedLanguageConfigKeys));this._register(this.configurationService.onDidChangeConfiguration((e=>{const t=e.change.keys.some((e=>n.has(e))),i=e.change.overrides.filter((([e,t])=>t.some((e=>n.has(e))))).map((([e])=>e));if(t)this.configurations.clear(),this.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(void 0));else for(const n of i)this.languageService.isRegisteredLanguageId(n)&&(this.configurations.delete(n),this.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(n)))}))),this._register(LanguageConfigurationRegistry.onDidChange((e=>{this.configurations.delete(e.languageId),this.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(e.languageId))})))}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=computeConfig(e,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};function computeConfig(e,t,n){let i=LanguageConfigurationRegistry.getLanguageConfiguration(e);if(!i){if(!n.isRegisteredLanguageId(e))throw new Error(`Language id "${e}" is not configured nor known`);i=new ResolvedLanguageConfiguration(e,{})}const o=getCustomizedLanguageConfig(i.languageId,t),r=combineLanguageConfigurations([i.underlyingConfig,o]);return new ResolvedLanguageConfiguration(i.languageId,r)}LanguageConfigurationService=__decorate$1A([__param$1u(0,IConfigurationService),__param$1u(1,ILanguageService)],LanguageConfigurationService);const customizedLanguageConfigKeys={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function getCustomizedLanguageConfig(e,t){const n=t.getValue(customizedLanguageConfigKeys.brackets,{overrideIdentifier:e}),i=t.getValue(customizedLanguageConfigKeys.colorizedBracketPairs,{overrideIdentifier:e});return{brackets:validateBracketPairs(n),colorizedBracketPairs:validateBracketPairs(i)}}function validateBracketPairs(e){if(Array.isArray(e))return e.map((e=>{if(Array.isArray(e)&&2===e.length)return[e[0],e[1]]})).filter((e=>!!e))}class LanguageConfigurationChangeEvent{constructor(e){this.languageId=e}}class LanguageConfigurationRegistryImpl{constructor(){this._entries=new Map,this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event}register(e,t,n=0){let i=this._entries.get(e);i||(i=new ComposedLanguageConfiguration(e),this._entries.set(e,i));const o=i.register(t,n);return this._onDidChange.fire(new LanguageConfigurationChangeEvent(e)),toDisposable((()=>{o.dispose(),this._onDidChange.fire(new LanguageConfigurationChangeEvent(e))}))}getLanguageConfiguration(e){const t=this._entries.get(e);return(null==t?void 0:t.getResolvedConfiguration())||null}getComments(e){const t=this.getLanguageConfiguration(e);return t&&t.comments||null}getIndentRulesSupport(e){const t=this.getLanguageConfiguration(e);return t&&t.indentRulesSupport||null}getPrecedingValidLine(e,t,n){const i=e.getLanguageIdAtPosition(t,0);if(t>1){let o,r=-1;for(o=t-1;o>=1;o--){if(e.getLanguageIdAtPosition(o,0)!==i)return r;const t=e.getLineContent(o);if(!n.shouldIgnore(t)&&!/^\s+$/.test(t)&&""!==t)return o;r=o}}return-1}getInheritIndentForLine(e,t,n,i=!0){if(e<4)return null;const o=this.getIndentRulesSupport(t.getLanguageId());if(!o)return null;if(n<=1)return{indentation:"",action:null};const r=this.getPrecedingValidLine(t,n,o);if(r<0)return null;if(r<1)return{indentation:"",action:null};const s=t.getLineContent(r);if(o.shouldIncrease(s)||o.shouldIndentNextLine(s))return{indentation:getLeadingWhitespace(s),action:IndentAction$1.Indent,line:r};if(o.shouldDecrease(s))return{indentation:getLeadingWhitespace(s),action:null,line:r};{if(1===r)return{indentation:getLeadingWhitespace(t.getLineContent(r)),action:null,line:r};const e=r-1,n=o.getIndentMetadata(t.getLineContent(e));if(!(3&n)&&4&n){let n=0;for(let i=e-1;i>0;i--)if(!o.shouldIndentNextLine(t.getLineContent(i))){n=i;break}return{indentation:getLeadingWhitespace(t.getLineContent(n+1)),action:null,line:n+1}}if(i)return{indentation:getLeadingWhitespace(t.getLineContent(r)),action:null,line:r};for(let i=r;i>0;i--){const e=t.getLineContent(i);if(o.shouldIncrease(e))return{indentation:getLeadingWhitespace(e),action:IndentAction$1.Indent,line:i};if(o.shouldIndentNextLine(e)){let e=0;for(let n=i-1;n>0;n--)if(!o.shouldIndentNextLine(t.getLineContent(i))){e=n;break}return{indentation:getLeadingWhitespace(t.getLineContent(e+1)),action:null,line:e+1}}if(o.shouldDecrease(e))return{indentation:getLeadingWhitespace(e),action:null,line:i}}return{indentation:getLeadingWhitespace(t.getLineContent(1)),action:null,line:1}}}getGoodIndentForLine(e,t,n,i,o){if(e<4)return null;const r=this.getLanguageConfiguration(n);if(!r)return null;const s=this.getIndentRulesSupport(n);if(!s)return null;const a=this.getInheritIndentForLine(e,t,i),l=t.getLineContent(i);if(a){const n=a.line;if(void 0!==n){const i=r.onEnter(e,"",t.getLineContent(n),"");if(i){let e=getLeadingWhitespace(t.getLineContent(n));return i.removeText&&(e=e.substring(0,e.length-i.removeText)),i.indentAction===IndentAction$1.Indent||i.indentAction===IndentAction$1.IndentOutdent?e=o.shiftIndent(e):i.indentAction===IndentAction$1.Outdent&&(e=o.unshiftIndent(e)),s.shouldDecrease(l)&&(e=o.unshiftIndent(e)),i.appendText&&(e+=i.appendText),getLeadingWhitespace(e)}}return s.shouldDecrease(l)?a.action===IndentAction$1.Indent?a.indentation:o.unshiftIndent(a.indentation):a.action===IndentAction$1.Indent?o.shiftIndent(a.indentation):a.indentation}return null}getIndentForEnter(e,t,n,i){if(e<4)return null;t.forceTokenization(n.startLineNumber);const o=t.getLineTokens(n.startLineNumber),r=createScopedLineTokens(o,n.startColumn-1),s=r.getLineContent();let a,l,c=!1;if(r.firstCharOffset>0&&o.getLanguageId(0)!==r.languageId?(c=!0,a=s.substr(0,n.startColumn-1-r.firstCharOffset)):a=o.getLineContent().substring(0,n.startColumn-1),n.isEmpty())l=s.substr(n.startColumn-1-r.firstCharOffset);else{l=this.getScopedLineTokens(t,n.endLineNumber,n.endColumn).getLineContent().substr(n.endColumn-1-r.firstCharOffset)}const d=this.getIndentRulesSupport(r.languageId);if(!d)return null;const u=a,h=getLeadingWhitespace(a),g={getLineTokens:e=>t.getLineTokens(e),getLanguageId:()=>t.getLanguageId(),getLanguageIdAtPosition:(e,n)=>t.getLanguageIdAtPosition(e,n),getLineContent:e=>e===n.startLineNumber?u:t.getLineContent(e)},p=getLeadingWhitespace(o.getLineContent()),f=this.getInheritIndentForLine(e,g,n.startLineNumber+1);if(!f){const e=c?p:h;return{beforeEnter:e,afterEnter:e}}let m=c?p:f.indentation;return f.action===IndentAction$1.Indent&&(m=i.shiftIndent(m)),d.shouldDecrease(l)&&(m=i.unshiftIndent(m)),{beforeEnter:c?p:h,afterEnter:m}}getIndentActionForType(e,t,n,i,o){if(e<4)return null;const r=this.getScopedLineTokens(t,n.startLineNumber,n.startColumn);if(r.firstCharOffset)return null;const s=this.getIndentRulesSupport(r.languageId);if(!s)return null;const a=r.getLineContent(),l=a.substr(0,n.startColumn-1-r.firstCharOffset);let c;if(n.isEmpty())c=a.substr(n.startColumn-1-r.firstCharOffset);else{c=this.getScopedLineTokens(t,n.endLineNumber,n.endColumn).getLineContent().substr(n.endColumn-1-r.firstCharOffset)}if(!s.shouldDecrease(l+c)&&s.shouldDecrease(l+i+c)){const i=this.getInheritIndentForLine(e,t,n.startLineNumber,!1);if(!i)return null;let r=i.indentation;return i.action!==IndentAction$1.Indent&&(r=o.unshiftIndent(r)),r}return null}getIndentMetadata(e,t){const n=this.getIndentRulesSupport(e.getLanguageId());return n?t<1||t>e.getLineCount()?null:n.getIndentMetadata(e.getLineContent(t)):null}getEnterAction(e,t,n){const i=this.getScopedLineTokens(t,n.startLineNumber,n.startColumn),o=this.getLanguageConfiguration(i.languageId);if(!o)return null;const r=i.getLineContent(),s=r.substr(0,n.startColumn-1-i.firstCharOffset);let a;if(n.isEmpty())a=r.substr(n.startColumn-1-i.firstCharOffset);else{a=this.getScopedLineTokens(t,n.endLineNumber,n.endColumn).getLineContent().substr(n.endColumn-1-i.firstCharOffset)}let l="";if(n.startLineNumber>1&&0===i.firstCharOffset){const e=this.getScopedLineTokens(t,n.startLineNumber-1);e.languageId===i.languageId&&(l=e.getLineContent())}const c=o.onEnter(e,l,s,a);if(!c)return null;const d=c.indentAction;let u=c.appendText;const h=c.removeText||0;u?d===IndentAction$1.Indent&&(u="\t"+u):u=d===IndentAction$1.Indent||d===IndentAction$1.IndentOutdent?"\t":"";let g=this.getIndentationAtPosition(t,n.startLineNumber,n.startColumn);return h&&(g=g.substring(0,g.length-h)),{indentAction:d,appendText:u,removeText:h,indentation:g}}getIndentationAtPosition(e,t,n){let i=getLeadingWhitespace(e.getLineContent(t));return i.length>n-1&&(i=i.substring(0,n-1)),i}getScopedLineTokens(e,t,n){e.forceTokenization(t);return createScopedLineTokens(e.getLineTokens(t),void 0===n?e.getLineMaxColumn(t)-1:n-1)}}const LanguageConfigurationRegistry=new LanguageConfigurationRegistryImpl;class ComposedLanguageConfiguration{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const n=new LanguageConfigurationContribution(e,t,++this._order);return this._entries.push(n),this._resolved=null,toDisposable((()=>{for(let e=0;e<this._entries.length;e++)if(this._entries[e]===n){this._entries.splice(e,1),this._resolved=null;break}}))}getResolvedConfiguration(){if(!this._resolved){const e=this._resolve();e&&(this._resolved=new ResolvedLanguageConfiguration(this.languageId,e))}return this._resolved}_resolve(){return 0===this._entries.length?null:(this._entries.sort(LanguageConfigurationContribution.cmp),combineLanguageConfigurations(this._entries.map((e=>e.configuration))))}}function combineLanguageConfigurations(e){let t={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const n of e)t={comments:n.comments||t.comments,brackets:n.brackets||t.brackets,wordPattern:n.wordPattern||t.wordPattern,indentationRules:n.indentationRules||t.indentationRules,onEnterRules:n.onEnterRules||t.onEnterRules,autoClosingPairs:n.autoClosingPairs||t.autoClosingPairs,surroundingPairs:n.surroundingPairs||t.surroundingPairs,autoCloseBefore:n.autoCloseBefore||t.autoCloseBefore,folding:n.folding||t.folding,colorizedBracketPairs:n.colorizedBracketPairs||t.colorizedBracketPairs,__electricCharacterSupport:n.__electricCharacterSupport||t.__electricCharacterSupport};return t}class LanguageConfigurationContribution{constructor(e,t,n){this.configuration=e,this.priority=t,this.order=n}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class ResolvedLanguageConfiguration{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new OnEnterSupport(this.underlyingConfig):null,this.comments=ResolvedLanguageConfiguration._handleComments(this.underlyingConfig),this.characterPair=new CharacterPairSupport(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||DEFAULT_WORD_REGEXP,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new IndentRulesSupport(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{}}getWordDefinition(){return ensureValidWordDefinition(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new RichEditBrackets(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new BracketElectricCharacterSupport(this.brackets)),this._electricCharacter}onEnter(e,t,n,i){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,n,i):null}getAutoClosingPairs(){return new AutoClosingPairs(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(){return this.characterPair.getAutoCloseBeforeSet()}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const n={};if(t.lineComment&&(n.lineCommentToken=t.lineComment),t.blockComment){const[e,i]=t.blockComment;n.blockCommentStartToken=e,n.blockCommentEndToken=i}return n}}registerSingleton(ILanguageConfigurationService,LanguageConfigurationService);const repeatCache=Object.create(null);function cachedStringRepeat(e,t){if(t<=0)return"";repeatCache[e]||(repeatCache[e]=["",e]);const n=repeatCache[e];for(let i=n.length;i<=t;i++)n[i]=n[i-1]+e;return n[t]}class ShiftCommand{constructor(e,t){this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}static unshiftIndent(e,t,n,i,o){const r=CursorColumns.visibleColumnFromColumn(e,t,n);if(o){const e=cachedStringRepeat(" ",i);return cachedStringRepeat(e,CursorColumns.prevIndentTabStop(r,i)/i)}return cachedStringRepeat("\t",CursorColumns.prevRenderTabStop(r,n)/n)}static shiftIndent(e,t,n,i,o){const r=CursorColumns.visibleColumnFromColumn(e,t,n);if(o){const e=cachedStringRepeat(" ",i);return cachedStringRepeat(e,CursorColumns.nextIndentTabStop(r,i)/i)}return cachedStringRepeat("\t",CursorColumns.nextRenderTabStop(r,n)/n)}_addEditOperation(e,t,n){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,n):e.addEditOperation(t,n)}getEditOperations(e,t){const n=this._selection.startLineNumber;let i=this._selection.endLineNumber;1===this._selection.endColumn&&n!==i&&(i-=1);const{tabSize:o,indentSize:r,insertSpaces:s}=this._opts,a=n===i;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(n))&&(this._useLastEditRangeForCursorEndPosition=!0);let l=0,c=0;for(let d=n;d<=i;d++,l=c){c=0;const i=e.getLineContent(d);let u,h=firstNonWhitespaceIndex(i);if((!this._opts.isUnshift||0!==i.length&&0!==h)&&(a||this._opts.isUnshift||0!==i.length)){if(-1===h&&(h=i.length),d>1){if(CursorColumns.visibleColumnFromColumn(i,h+1,o)%r!=0&&e.isCheapToTokenize(d-1)){const t=LanguageConfigurationRegistry.getEnterAction(this._opts.autoIndent,e,new Range$2(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)));if(t){if(c=l,t.appendText)for(let e=0,n=t.appendText.length;e<n&&c<r&&32===t.appendText.charCodeAt(e);e++)c++;t.removeText&&(c=Math.max(0,c-t.removeText));for(let e=0;e<c&&(0!==h&&32===i.charCodeAt(h-1));e++)h--}}}this._opts.isUnshift&&0===h||(u=this._opts.isUnshift?ShiftCommand.unshiftIndent(i,h+1,o,r,s):ShiftCommand.shiftIndent(i,h+1,o,r,s),this._addEditOperation(t,new Range$2(d,1,d,h+1),u),d!==n||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=this._selection.startColumn<=h+1))}}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&0===e.getLineLength(n)&&(this._useLastEditRangeForCursorEndPosition=!0);const o=s?cachedStringRepeat(" ",r):"\t";for(let s=n;s<=i;s++){const i=e.getLineContent(s);let l=firstNonWhitespaceIndex(i);if((!this._opts.isUnshift||0!==i.length&&0!==l)&&((a||this._opts.isUnshift||0!==i.length)&&(-1===l&&(l=i.length),!this._opts.isUnshift||0!==l)))if(this._opts.isUnshift){l=Math.min(l,r);for(let e=0;e<l;e++){if(9===i.charCodeAt(e)){l=e+1;break}}this._addEditOperation(t,new Range$2(s,1,s,l+1),"")}else this._addEditOperation(t,new Range$2(s,1,s,1),o),s!==n||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=1===this._selection.startColumn)}}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){if(this._useLastEditRangeForCursorEndPosition){const e=t.getInverseEditOperations()[0];return new Selection$1(e.range.endLineNumber,e.range.endColumn,e.range.endLineNumber,e.range.endColumn)}const n=t.getTrackedSelection(this._selectionId);if(this._selectionStartColumnStaysPut){const e=this._selection.startColumn;return n.startColumn<=e?n:0===n.getDirection()?new Selection$1(n.startLineNumber,e,n.endLineNumber,n.endColumn):new Selection$1(n.endLineNumber,n.endColumn,n.startLineNumber,e)}return n}}class SurroundSelectionCommand{constructor(e,t,n){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=n}getEditOperations(e,t){t.addTrackedEditOperation(new Range$2(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new Range$2(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection)}computeCursorState(e,t){const n=t.getInverseEditOperations(),i=n[0].range,o=n[1].range;return new Selection$1(i.endLineNumber,i.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)}}class TypeOperations{static indent(e,t,n){if(null===t||null===n)return[];const i=[];for(let o=0,r=n.length;o<r;o++)i[o]=new ShiftCommand(n[o],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent});return i}static outdent(e,t,n){const i=[];for(let o=0,r=n.length;o<r;o++)i[o]=new ShiftCommand(n[o],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent});return i}static shiftIndent(e,t,n){return n=n||1,ShiftCommand.shiftIndent(t,t.length+n,e.tabSize,e.indentSize,e.insertSpaces)}static unshiftIndent(e,t,n){return n=n||1,ShiftCommand.unshiftIndent(t,t.length+n,e.tabSize,e.indentSize,e.insertSpaces)}static _distributedPaste(e,t,n,i){const o=[];for(let r=0,s=n.length;r<s;r++)o[r]=new ReplaceCommand(n[r],i[r]);return new EditOperationResult(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,n,i,o){const r=[];for(let s=0,a=n.length;s<a;s++){const e=n[s],t=e.getPosition();if(o&&!e.isEmpty()&&(o=!1),o&&i.indexOf("\n")!==i.length-1&&(o=!1),o){const n=new Range$2(t.lineNumber,1,t.lineNumber,1);r[s]=new ReplaceCommandThatPreservesSelection(n,i,e,!0)}else r[s]=new ReplaceCommand(e,i)}return new EditOperationResult(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,n,i,o){if(i)return null;if(1===t.length)return null;if(o&&o.length===t.length)return o;if("spread"===e.multiCursorPaste){10===n.charCodeAt(n.length-1)&&(n=n.substr(0,n.length-1)),13===n.charCodeAt(n.length-1)&&(n=n.substr(0,n.length-1));const e=splitLines(n);if(e.length===t.length)return e}return null}static paste(e,t,n,i,o,r){const s=this._distributePasteToCursors(e,n,i,o,r);return s?(n=n.sort(Range$2.compareRangesUsingStarts),this._distributedPaste(e,t,n,s)):this._simplePaste(e,t,n,i,o)}static _goodIndentForLine(e,t,n){let i=null,o="";const r=LanguageConfigurationRegistry.getInheritIndentForLine(e.autoIndent,t,n,!1);if(r)i=r.action,o=r.indentation;else if(n>1){let i;for(i=n-1;i>=1;i--){if(lastNonWhitespaceIndex(t.getLineContent(i))>=0)break}if(i<1)return null;const r=t.getLineMaxColumn(i),s=LanguageConfigurationRegistry.getEnterAction(e.autoIndent,t,new Range$2(i,r,i,r));s&&(o=s.indentation+s.appendText)}return i&&(i===IndentAction$1.Indent&&(o=TypeOperations.shiftIndent(e,o)),i===IndentAction$1.Outdent&&(o=TypeOperations.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,n,i){let o="";const r=n.getStartPosition();if(e.insertSpaces){const n=e.visibleColumnFromColumn(t,r),i=e.indentSize,s=i-n%i;for(let e=0;e<s;e++)o+=" "}else o="\t";return new ReplaceCommand(n,o,i)}static tab(e,t,n){const i=[];for(let o=0,r=n.length;o<r;o++){const r=n[o];if(r.isEmpty()){const n=t.getLineContent(r.startLineNumber);if(/^\s*$/.test(n)&&t.isCheapToTokenize(r.startLineNumber)){let s=this._goodIndentForLine(e,t,r.startLineNumber);s=s||"\t";const a=e.normalizeIndentation(s);if(!n.startsWith(a)){i[o]=new ReplaceCommand(new Range$2(r.startLineNumber,1,r.startLineNumber,n.length+1),a,!0);continue}}i[o]=this._replaceJumpToNextIndent(e,t,r,!0)}else{if(r.startLineNumber===r.endLineNumber){const n=t.getLineMaxColumn(r.startLineNumber);if(1!==r.startColumn||r.endColumn!==n){i[o]=this._replaceJumpToNextIndent(e,t,r,!1);continue}}i[o]=new ShiftCommand(r,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent})}}return i}static compositionType(e,t,n,i,o,r,s,a){const l=i.map((e=>this._compositionType(n,e,o,r,s,a)));return new EditOperationResult(4,l,{shouldPushStackElementBefore:shouldPushStackElementBetween(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,n,i,o,r){if(!t.isEmpty())return null;const s=t.getPosition(),a=Math.max(1,s.column-i),l=Math.min(e.getLineMaxColumn(s.lineNumber),s.column+o),c=new Range$2(s.lineNumber,a,s.lineNumber,l);return e.getValueInRange(c)===n&&0===r?null:new ReplaceCommandWithOffsetCursorState(c,n,0,r)}static _typeCommand(e,t,n){return n?new ReplaceCommandWithoutChangingPosition(e,t,!0):new ReplaceCommand(e,t,!0)}static _enter(e,t,n,i){if(0===e.autoIndent)return TypeOperations._typeCommand(i,"\n",n);if(!t.isCheapToTokenize(i.getStartPosition().lineNumber)||1===e.autoIndent){const o=getLeadingWhitespace(t.getLineContent(i.startLineNumber)).substring(0,i.startColumn-1);return TypeOperations._typeCommand(i,"\n"+e.normalizeIndentation(o),n)}const o=LanguageConfigurationRegistry.getEnterAction(e.autoIndent,t,i);if(o){if(o.indentAction===IndentAction$1.None)return TypeOperations._typeCommand(i,"\n"+e.normalizeIndentation(o.indentation+o.appendText),n);if(o.indentAction===IndentAction$1.Indent)return TypeOperations._typeCommand(i,"\n"+e.normalizeIndentation(o.indentation+o.appendText),n);if(o.indentAction===IndentAction$1.IndentOutdent){const t=e.normalizeIndentation(o.indentation),r=e.normalizeIndentation(o.indentation+o.appendText),s="\n"+r+"\n"+t;return n?new ReplaceCommandWithoutChangingPosition(i,s,!0):new ReplaceCommandWithOffsetCursorState(i,s,-1,r.length-t.length,!0)}if(o.indentAction===IndentAction$1.Outdent){const t=TypeOperations.unshiftIndent(e,o.indentation);return TypeOperations._typeCommand(i,"\n"+e.normalizeIndentation(t+o.appendText),n)}}const r=getLeadingWhitespace(t.getLineContent(i.startLineNumber)).substring(0,i.startColumn-1);if(e.autoIndent>=4){const o=LanguageConfigurationRegistry.getIndentForEnter(e.autoIndent,t,i,{unshiftIndent:t=>TypeOperations.unshiftIndent(e,t),shiftIndent:t=>TypeOperations.shiftIndent(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)});if(o){let r=e.visibleColumnFromColumn(t,i.getEndPosition());const s=i.endColumn,a=firstNonWhitespaceIndex(t.getLineContent(i.endLineNumber));if(i=a>=0?i.setEndPosition(i.endLineNumber,Math.max(i.endColumn,a+1)):i.setEndPosition(i.endLineNumber,t.getLineMaxColumn(i.endLineNumber)),n)return new ReplaceCommandWithoutChangingPosition(i,"\n"+e.normalizeIndentation(o.afterEnter),!0);{let t=0;return s<=a+1&&(e.insertSpaces||(r=Math.ceil(r/e.indentSize)),t=Math.min(r+1-e.normalizeIndentation(o.afterEnter).length-1,0)),new ReplaceCommandWithOffsetCursorState(i,"\n"+e.normalizeIndentation(o.afterEnter),0,t,!0)}}}return TypeOperations._typeCommand(i,"\n"+e.normalizeIndentation(r),n)}static _isAutoIndentType(e,t,n){if(e.autoIndent<4)return!1;for(let i=0,o=n.length;i<o;i++)if(!t.isCheapToTokenize(n[i].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,n,i){const o=LanguageConfigurationRegistry.getIndentationAtPosition(t,n.startLineNumber,n.startColumn),r=LanguageConfigurationRegistry.getIndentActionForType(e.autoIndent,t,n,i,{shiftIndent:t=>TypeOperations.shiftIndent(e,t),unshiftIndent:t=>TypeOperations.unshiftIndent(e,t)});if(null===r)return null;if(r!==e.normalizeIndentation(o)){const o=t.getLineFirstNonWhitespaceColumn(n.startLineNumber);return 0===o?TypeOperations._typeCommand(new Range$2(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(r)+i,!1):TypeOperations._typeCommand(new Range$2(n.startLineNumber,1,n.endLineNumber,n.endColumn),e.normalizeIndentation(r)+t.getLineContent(n.startLineNumber).substring(o-1,n.startColumn-1)+i,!1)}return null}static _isAutoClosingOvertype(e,t,n,i,o){if("never"===e.autoClosingOvertype)return!1;if(!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let r=0,s=n.length;r<s;r++){const s=n[r];if(!s.isEmpty())return!1;const a=s.getPosition(),l=t.getLineContent(a.lineNumber);if(l.charAt(a.column-1)!==o)return!1;const c=isQuote(o);if(92===(a.column>2?l.charCodeAt(a.column-2):0)&&c)return!1;if("auto"===e.autoClosingOvertype){let e=!1;for(let t=0,n=i.length;t<n;t++){const n=i[t];if(a.lineNumber===n.startLineNumber&&a.column===n.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingOvertype(e,t,n,i,o){const r=[];for(let s=0,a=i.length;s<a;s++){const e=i[s].getPosition(),t=new Range$2(e.lineNumber,e.column,e.lineNumber,e.column+1);r[s]=new ReplaceCommand(t,o)}return new EditOperationResult(4,r,{shouldPushStackElementBefore:shouldPushStackElementBetween(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){const n=t.charAt(0),i=e.autoClosingPairs.autoClosingPairsOpenByStart.get(n)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(n)||[],r=i.some((e=>t.startsWith(e.open))),s=o.some((e=>t.startsWith(e.close)));return!r&&s}static _findAutoClosingPairOpen(e,t,n,i){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(i);if(!o)return null;let r=null;for(const s of o)if(null===r||s.open.length>r.open.length){let e=!0;for(const o of n){if(t.getValueInRange(new Range$2(o.lineNumber,o.column-s.open.length+1,o.lineNumber,o.column))+i!==s.open){e=!1;break}}e&&(r=s)}return r}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const n=t.close.charAt(t.close.length-1),i=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(n)||[];let o=null;for(const r of i)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!o||r.open.length>o.open.length)&&(o=r);return o}static _getAutoClosingPairClose(e,t,n,i,o){const r=isQuote(i),s=r?e.autoClosingQuotes:e.autoClosingBrackets,a=r?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;if("never"===s)return null;for(const g of n)if(!g.isEmpty())return null;const l=n.map((e=>{const t=e.getPosition();return o?{lineNumber:t.lineNumber,beforeColumn:t.column-i.length,afterColumn:t.column}:{lineNumber:t.lineNumber,beforeColumn:t.column,afterColumn:t.column}})),c=this._findAutoClosingPairOpen(e,t,l.map((e=>new Position$1(e.lineNumber,e.beforeColumn))),i);if(!c)return null;const d=this._findContainedAutoClosingPair(e,c),u=d?d.close:"";let h=!0;for(const g of l){const{lineNumber:n,beforeColumn:o,afterColumn:r}=g,l=t.getLineContent(n),d=l.substring(0,o-1),p=l.substring(r-1);if(p.startsWith(u)||(h=!1),p.length>0){const t=p.charAt(0);if(!TypeOperations._isBeforeClosingBrace(e,p)&&!a(t))return null}if(1===c.open.length&&("'"===i||'"'===i)&&"always"!==s){const t=getMapForWordSeparators(e.wordSeparators);if(d.length>0){const e=d.charCodeAt(d.length-1);if(0===t.get(e))return null}}if(!t.isCheapToTokenize(n))return null;t.forceTokenization(n);const f=createScopedLineTokens(t.getLineTokens(n),o-1);if(!c.shouldAutoClose(f,o-f.firstCharOffset))return null;const m=c.findNeutralCharacter();if(m){const e=t.getTokenTypeIfInsertingCharacter(n,o,m);if(!c.isOK(e))return null}}return h?c.close.substring(0,c.close.length-u.length):c.close}static _runAutoClosingOpenCharType(e,t,n,i,o,r,s){const a=[];for(let l=0,c=i.length;l<c;l++){const e=i[l];a[l]=new TypeWithAutoClosingCommand(e,o,!r,s)}return new EditOperationResult(4,a,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _shouldSurroundChar(e,t){return isQuote(t)?"quotes"===e.autoSurround||"languageDefined"===e.autoSurround:"brackets"===e.autoSurround||"languageDefined"===e.autoSurround}static _isSurroundSelectionType(e,t,n,i){if(!TypeOperations._shouldSurroundChar(e,i)||!e.surroundingPairs.hasOwnProperty(i))return!1;const o=isQuote(i);for(let r=0,s=n.length;r<s;r++){const e=n[r];if(e.isEmpty())return!1;let i=!0;for(let n=e.startLineNumber;n<=e.endLineNumber;n++){const o=t.getLineContent(n),r=n===e.startLineNumber?e.startColumn-1:0,s=n===e.endLineNumber?e.endColumn-1:o.length,a=o.substring(r,s);if(/[^ \t]/.test(a)){i=!1;break}}if(i)return!1;if(o&&e.startLineNumber===e.endLineNumber&&e.startColumn+1===e.endColumn){if(isQuote(t.getValueInRange(e)))return!1}}return!0}static _runSurroundSelectionType(e,t,n,i,o){const r=[];for(let s=0,a=i.length;s<a;s++){const e=i[s],n=t.surroundingPairs[o];r[s]=new SurroundSelectionCommand(e,o,n)}return new EditOperationResult(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isTypeInterceptorElectricChar(e,t,n){return!(1!==n.length||!t.isCheapToTokenize(n[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,n,i,o){if(!t.electricChars.hasOwnProperty(o)||!i.isEmpty())return null;const r=i.getPosition();n.forceTokenization(r.lineNumber);const s=n.getLineTokens(r.lineNumber);let a;try{a=t.onElectricCharacter(o,s,r.column)}catch(e2){return onUnexpectedError(e2),null}if(!a)return null;if(a.matchOpenBracket){const i=(s.getLineContent()+o).lastIndexOf(a.matchOpenBracket)+1,l=n.bracketPairs.findMatchingBracketUp(a.matchOpenBracket,{lineNumber:r.lineNumber,column:i},500);if(l){if(l.startLineNumber===r.lineNumber)return null;const i=getLeadingWhitespace(n.getLineContent(l.startLineNumber)),s=t.normalizeIndentation(i),a=n.getLineContent(r.lineNumber),c=n.getLineFirstNonWhitespaceColumn(r.lineNumber)||r.column,d=s+a.substring(c-1,r.column-1)+o,u=new Range$2(r.lineNumber,1,r.lineNumber,r.column),h=new ReplaceCommand(u,d);return new EditOperationResult(getTypingOperation(d,e),[h],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}static compositionEndWithInterceptors(e,t,n,i,o,r){if(!i||Selection$1.selectionsArrEqual(i,o))return null;let s=null;for(const l of o){if(!l.isEmpty())return null;const e=l.getPosition(),t=n.getValueInRange(new Range$2(e.lineNumber,e.column-1,e.lineNumber,e.column));if(null===s)s=t;else if(s!==t)return null}if(!s)return null;if(this._isAutoClosingOvertype(t,n,o,r,s)){const e=o.map((e=>new ReplaceCommand(new Range$2(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1)));return new EditOperationResult(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const a=this._getAutoClosingPairClose(t,n,o,s,!0);return null!==a?this._runAutoClosingOpenCharType(e,t,n,o,s,!0,a):null}static typeWithInterceptors(e,t,n,i,o,r,s){if(!e&&"\n"===s){const e=[];for(let t=0,r=o.length;t<r;t++)e[t]=TypeOperations._enter(n,i,!1,o[t]);return new EditOperationResult(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(n,i,o)){const e=[];let t=!1;for(let r=0,a=o.length;r<a;r++)if(e[r]=this._runAutoIndentType(n,i,o[r],s),!e[r]){t=!0;break}if(!t)return new EditOperationResult(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoClosingOvertype(n,i,o,r,s))return this._runAutoClosingOvertype(t,n,i,o,s);if(!e){const e=this._getAutoClosingPairClose(n,i,o,s,!1);if(e)return this._runAutoClosingOpenCharType(t,n,i,o,s,!1,e)}if(this._isSurroundSelectionType(n,i,o,s))return this._runSurroundSelectionType(t,n,i,o,s);if(!e&&this._isTypeInterceptorElectricChar(n,i,o)){const e=this._typeInterceptorElectricChar(t,n,i,o[0],s);if(e)return e}const a=[];for(let c=0,d=o.length;c<d;c++)a[c]=new ReplaceCommand(o[c],s);const l=getTypingOperation(s,t);return new EditOperationResult(l,a,{shouldPushStackElementBefore:shouldPushStackElementBetween(t,l),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,n,i,o){const r=[];for(let a=0,l=i.length;a<l;a++)r[a]=new ReplaceCommand(i[a],o);const s=getTypingOperation(o,e);return new EditOperationResult(s,r,{shouldPushStackElementBefore:shouldPushStackElementBetween(e,s),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,n){if(null===t||null===n)return[];const i=[];for(let o=0,r=n.length;o<r;o++){let r=n[o].positionLineNumber;if(1===r)i[o]=new ReplaceCommandWithoutChangingPosition(new Range$2(1,1,1,1),"\n");else{r--;const n=t.getLineMaxColumn(r);i[o]=this._enter(e,t,!1,new Range$2(r,n,r,n))}}return i}static lineInsertAfter(e,t,n){if(null===t||null===n)return[];const i=[];for(let o=0,r=n.length;o<r;o++){const r=n[o].positionLineNumber,s=t.getLineMaxColumn(r);i[o]=this._enter(e,t,!1,new Range$2(r,s,r,s))}return i}static lineBreakInsert(e,t,n){const i=[];for(let o=0,r=n.length;o<r;o++)i[o]=this._enter(e,t,!0,n[o]);return i}}class TypeWithAutoClosingCommand extends ReplaceCommandWithOffsetCursorState{constructor(e,t,n,i){super(e,(n?t:"")+i,0,-i.length),this._openCharacter=t,this._closeCharacter=i,this.closeCharacterRange=null,this.enclosingRange=null}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return this.closeCharacterRange=new Range$2(n.startLineNumber,n.endColumn-this._closeCharacter.length,n.endLineNumber,n.endColumn),this.enclosingRange=new Range$2(n.startLineNumber,n.endColumn-this._openCharacter.length-this._closeCharacter.length,n.endLineNumber,n.endColumn),super.computeCursorState(e,t)}}function getTypingOperation(e,t){return" "===e?5===t||6===t?6:5:4}function shouldPushStackElementBetween(e,t){return!(!isTypingOperation(e)||isTypingOperation(t))||5!==e&&normalizeOperationType(e)!==normalizeOperationType(t)}function normalizeOperationType(e){return 6===e||5===e?"space":e}function isTypingOperation(e){return 4===e||5===e||6===e}var EditorContextKeys,EditorContextKeys2;EditorContextKeys2=EditorContextKeys||(EditorContextKeys={}),EditorContextKeys2.editorSimpleInput=new RawContextKey("editorSimpleInput",!1,!0),EditorContextKeys2.editorTextFocus=new RawContextKey("editorTextFocus",!1,localize("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),EditorContextKeys2.focus=new RawContextKey("editorFocus",!1,localize("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),EditorContextKeys2.textInputFocus=new RawContextKey("textInputFocus",!1,localize("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),EditorContextKeys2.readOnly=new RawContextKey("editorReadonly",!1,localize("editorReadonly","Whether the editor is read only")),EditorContextKeys2.inDiffEditor=new RawContextKey("inDiffEditor",!1,localize("inDiffEditor","Whether the context is a diff editor")),EditorContextKeys2.columnSelection=new RawContextKey("editorColumnSelection",!1,localize("editorColumnSelection","Whether `editor.columnSelection` is enabled")),EditorContextKeys2.writable=EditorContextKeys2.readOnly.toNegated(),EditorContextKeys2.hasNonEmptySelection=new RawContextKey("editorHasSelection",!1,localize("editorHasSelection","Whether the editor has text selected")),EditorContextKeys2.hasOnlyEmptySelection=EditorContextKeys2.hasNonEmptySelection.toNegated(),EditorContextKeys2.hasMultipleSelections=new RawContextKey("editorHasMultipleSelections",!1,localize("editorHasMultipleSelections","Whether the editor has multiple selections")),EditorContextKeys2.hasSingleSelection=EditorContextKeys2.hasMultipleSelections.toNegated(),EditorContextKeys2.tabMovesFocus=new RawContextKey("editorTabMovesFocus",!1,localize("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),EditorContextKeys2.tabDoesNotMoveFocus=EditorContextKeys2.tabMovesFocus.toNegated(),EditorContextKeys2.isInWalkThroughSnippet=new RawContextKey("isInEmbeddedEditor",!1,!0),EditorContextKeys2.canUndo=new RawContextKey("canUndo",!1,!0),EditorContextKeys2.canRedo=new RawContextKey("canRedo",!1,!0),EditorContextKeys2.hoverVisible=new RawContextKey("editorHoverVisible",!1,localize("editorHoverVisible","Whether the editor hover is visible")),EditorContextKeys2.inCompositeEditor=new RawContextKey("inCompositeEditor",void 0,localize("inCompositeEditor","Whether the editor is part of a larger editor (e.g. notebooks)")),EditorContextKeys2.notInCompositeEditor=EditorContextKeys2.inCompositeEditor.toNegated(),EditorContextKeys2.languageId=new RawContextKey("editorLangId","",localize("editorLangId","The language identifier of the editor")),EditorContextKeys2.hasCompletionItemProvider=new RawContextKey("editorHasCompletionItemProvider",!1,localize("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),EditorContextKeys2.hasCodeActionsProvider=new RawContextKey("editorHasCodeActionsProvider",!1,localize("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),EditorContextKeys2.hasCodeLensProvider=new RawContextKey("editorHasCodeLensProvider",!1,localize("editorHasCodeLensProvider","Whether the editor has a code lens provider")),EditorContextKeys2.hasDefinitionProvider=new RawContextKey("editorHasDefinitionProvider",!1,localize("editorHasDefinitionProvider","Whether the editor has a definition provider")),EditorContextKeys2.hasDeclarationProvider=new RawContextKey("editorHasDeclarationProvider",!1,localize("editorHasDeclarationProvider","Whether the editor has a declaration provider")),EditorContextKeys2.hasImplementationProvider=new RawContextKey("editorHasImplementationProvider",!1,localize("editorHasImplementationProvider","Whether the editor has an implementation provider")),EditorContextKeys2.hasTypeDefinitionProvider=new RawContextKey("editorHasTypeDefinitionProvider",!1,localize("editorHasTypeDefinitionProvider","Whether the editor has a type definition provider")),EditorContextKeys2.hasHoverProvider=new RawContextKey("editorHasHoverProvider",!1,localize("editorHasHoverProvider","Whether the editor has a hover provider")),EditorContextKeys2.hasDocumentHighlightProvider=new RawContextKey("editorHasDocumentHighlightProvider",!1,localize("editorHasDocumentHighlightProvider","Whether the editor has a document highlight provider")),EditorContextKeys2.hasDocumentSymbolProvider=new RawContextKey("editorHasDocumentSymbolProvider",!1,localize("editorHasDocumentSymbolProvider","Whether the editor has a document symbol provider")),EditorContextKeys2.hasReferenceProvider=new RawContextKey("editorHasReferenceProvider",!1,localize("editorHasReferenceProvider","Whether the editor has a reference provider")),EditorContextKeys2.hasRenameProvider=new RawContextKey("editorHasRenameProvider",!1,localize("editorHasRenameProvider","Whether the editor has a rename provider")),EditorContextKeys2.hasSignatureHelpProvider=new RawContextKey("editorHasSignatureHelpProvider",!1,localize("editorHasSignatureHelpProvider","Whether the editor has a signature help provider")),EditorContextKeys2.hasInlayHintsProvider=new RawContextKey("editorHasInlayHintsProvider",!1,localize("editorHasInlayHintsProvider","Whether the editor has an inline hints provider")),EditorContextKeys2.hasDocumentFormattingProvider=new RawContextKey("editorHasDocumentFormattingProvider",!1,localize("editorHasDocumentFormattingProvider","Whether the editor has a document formatting provider")),EditorContextKeys2.hasDocumentSelectionFormattingProvider=new RawContextKey("editorHasDocumentSelectionFormattingProvider",!1,localize("editorHasDocumentSelectionFormattingProvider","Whether the editor has a document selection formatting provider")),EditorContextKeys2.hasMultipleDocumentFormattingProvider=new RawContextKey("editorHasMultipleDocumentFormattingProvider",!1,localize("editorHasMultipleDocumentFormattingProvider","Whether the editor has multiple document formatting providers")),EditorContextKeys2.hasMultipleDocumentSelectionFormattingProvider=new RawContextKey("editorHasMultipleDocumentSelectionFormattingProvider",!1,localize("editorHasMultipleDocumentSelectionFormattingProvider","Whether the editor has multiple document selection formatting providers"));const CORE_WEIGHT=0;class CoreEditorCommand extends EditorCommand{runEditorCommand(e,t,n){const i=t._getViewModel();i&&this.runCoreEditorCommand(i,n||{})}}var EditorScroll_,EditorScroll_2,RevealLine_,RevealLine_2,CoreNavigationCommands;EditorScroll_2=EditorScroll_||(EditorScroll_={}),EditorScroll_2.description={description:"Scroll editor in the given direction",args:[{name:"Editor scroll argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory direction value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'up', 'down'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'page', 'halfPage'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n\t\t\t\t",constraint:function(e){if(!isObject(e))return!1;const t=e;return!(!isString$1(t.to)||!isUndefined(t.by)&&!isString$1(t.by)||!isUndefined(t.value)&&!isNumber$1(t.value)||!isUndefined(t.revealCursor)&&!isBoolean(t.revealCursor))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},EditorScroll_2.RawDirection={Up:"up",Down:"down"},EditorScroll_2.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage"},EditorScroll_2.parse=function(e){let t,n;switch(e.to){case EditorScroll_2.RawDirection.Up:t=1;break;case EditorScroll_2.RawDirection.Down:t=2;break;default:return null}switch(e.by){case EditorScroll_2.RawUnit.Line:n=1;break;case EditorScroll_2.RawUnit.WrappedLine:n=2;break;case EditorScroll_2.RawUnit.Page:n=3;break;case EditorScroll_2.RawUnit.HalfPage:n=4;break;default:n=2}return{direction:t,unit:n,value:Math.floor(e.value||1),revealCursor:!!e.revealCursor,select:!!e.select}},RevealLine_2=RevealLine_||(RevealLine_={}),RevealLine_2.description={description:"Reveal the given line at the given logical position",args:[{name:"Reveal line argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'lineNumber': A mandatory line number value.\n\t\t\t\t\t* 'at': Logical position at which line has to be revealed.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'top', 'center', 'bottom'\n\t\t\t\t\t\t```\n\t\t\t\t",constraint:function(e){if(!isObject(e))return!1;const t=e;return!(!isNumber$1(t.lineNumber)&&!isString$1(t.lineNumber)||!isUndefined(t.at)&&!isString$1(t.at))},schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:["number","string"]},at:{type:"string",enum:["top","center","bottom"]}}}}]},RevealLine_2.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"};class EditorOrNativeTextInputCommand{constructor(e){e.addImplementation(1e4,"code-editor",((e,t)=>{const n=e.get(ICodeEditorService).getFocusedCodeEditor();return!(!n||!n.hasTextFocus())&&this._runEditorCommand(e,n,t)})),e.addImplementation(1e3,"generic-dom-input-textarea",((e,t)=>{const n=document.activeElement;return!!(n&&["input","textarea"].indexOf(n.tagName.toLowerCase())>=0)&&(this.runDOMCommand(),!0)})),e.addImplementation(0,"generic-dom",((e,t)=>{const n=e.get(ICodeEditorService).getActiveCodeEditor();return!!n&&(n.focus(),this._runEditorCommand(e,n,t))}))}_runEditorCommand(e,t,n){const i=this.runEditorCommand(e,t,n);return i||!0}}!function(e){class t extends CoreEditorCommand{constructor(e){super(e),this._minimalReveal=e.minimalReveal,this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement();e.setCursorStates(t.source,3,[CursorMoveCommands.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)])&&e.revealPrimaryCursor(t.source,!0,this._minimalReveal)}}e.MoveTo=registerEditorCommand(new t({id:"_moveTo",minimalReveal:!0,inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=registerEditorCommand(new t({id:"_moveToSelect",minimalReveal:!1,inSelectionMode:!0,precondition:void 0}));class n extends CoreEditorCommand{runCoreEditorCommand(e,t){e.model.pushStackElement();const n=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);e.setCursorStates(t.source,3,n.viewStates.map((e=>CursorState$1.fromViewState(e)))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:n.fromLineNumber,fromViewVisualColumn:n.fromVisualColumn,toViewLineNumber:n.toLineNumber,toViewVisualColumn:n.toVisualColumn}),n.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source)}}e.ColumnSelect=registerEditorCommand(new class extends n{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(e,t,n,i){const o=e.model.validatePosition(i.position),r=e.coordinatesConverter.validateViewPosition(new Position$1(i.viewPosition.lineNumber,i.viewPosition.column),o),s=i.doColumnSelect?n.fromViewLineNumber:r.lineNumber,a=i.doColumnSelect?n.fromViewVisualColumn:i.mouseColumn-1;return ColumnSelection.columnSelect(e.cursorConfig,e,s,a,r.lineNumber,i.mouseColumn-1)}}),e.CursorColumnSelectLeft=registerEditorCommand(new class extends n{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,n,i){return ColumnSelection.columnSelectLeft(e.cursorConfig,e,n)}}),e.CursorColumnSelectRight=registerEditorCommand(new class extends n{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,n,i){return ColumnSelection.columnSelectRight(e.cursorConfig,e,n)}});class i extends n{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,n,i){return ColumnSelection.columnSelectUp(e.cursorConfig,e,n,this._isPaged)}}e.CursorColumnSelectUp=registerEditorCommand(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=registerEditorCommand(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:3595,linux:{primary:0}}}));class o extends n{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,n,i){return ColumnSelection.columnSelectDown(e.cursorConfig,e,n,this._isPaged)}}e.CursorColumnSelectDown=registerEditorCommand(new o({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=registerEditorCommand(new o({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:3596,linux:{primary:0}}}));class r extends CoreEditorCommand{constructor(){super({id:"cursorMove",precondition:void 0,description:CursorMove.description})}runCoreEditorCommand(e,t){const n=CursorMove.parse(t);n&&this._runCursorMove(e,t.source,n)}_runCursorMove(e,t,n){e.model.pushStackElement(),e.setCursorStates(t,3,r._move(e,e.getCursorStates(),n)),e.revealPrimaryCursor(t,!0)}static _move(e,t,n){const i=n.select,o=n.value;switch(n.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return CursorMoveCommands.simpleMove(e,t,n.direction,i,o,n.unit);case 11:case 13:case 12:case 14:return CursorMoveCommands.viewportMove(e,t,n.direction,i,o);default:return null}}}e.CursorMoveImpl=r,e.CursorMove=registerEditorCommand(new r);class s extends CoreEditorCommand{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let n=this._staticArgs;-1===this._staticArgs.value&&(n={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:t.pageSize||e.cursorConfig.pageSize}),e.model.pushStackElement(),e.setCursorStates(t.source,3,CursorMoveCommands.simpleMove(e,e.getCursorStates(),n.direction,n.select,n.value,n.unit)),e.revealPrimaryCursor(t.source,!0)}}e.CursorLeft=registerEditorCommand(new s({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=registerEditorCommand(new s({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:1039}})),e.CursorRight=registerEditorCommand(new s({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=registerEditorCommand(new s({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:1041}})),e.CursorUp=registerEditorCommand(new s({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=registerEditorCommand(new s({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=registerEditorCommand(new s({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:11}})),e.CursorPageUpSelect=registerEditorCommand(new s({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:1035}})),e.CursorDown=registerEditorCommand(new s({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=registerEditorCommand(new s({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=registerEditorCommand(new s({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:12}})),e.CursorPageDownSelect=registerEditorCommand(new s({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:1036}})),e.CreateCursor=registerEditorCommand(new class extends CoreEditorCommand{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){let n;n=t.wholeLine?CursorMoveCommands.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):CursorMoveCommands.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);const i=e.getCursorStates();if(i.length>1){const o=n.modelState?n.modelState.position:null,r=n.viewState?n.viewState.position:null;for(let n=0,s=i.length;n<s;n++){const s=i[n];if((!o||s.modelState.selection.containsPosition(o))&&(!r||s.viewState.selection.containsPosition(r)))return i.splice(n,1),e.model.pushStackElement(),void e.setCursorStates(t.source,3,i)}}i.push(n),e.model.pushStackElement(),e.setCursorStates(t.source,3,i)}}),e.LastCursorMoveToSelect=registerEditorCommand(new class extends CoreEditorCommand{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(e,t){const n=e.getLastAddedCursorIndex(),i=e.getCursorStates(),o=i.slice(0);o[n]=CursorMoveCommands.moveTo(e,i[n],!0,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}});class a extends CoreEditorCommand{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,CursorMoveCommands.moveToBeginningOfLine(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorHome=registerEditorCommand(new a({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),e.CursorHomeSelect=registerEditorCommand(new a({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class l extends CoreEditorCommand{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e.getCursorStates())),e.revealPrimaryCursor(t.source,!0)}_exec(e){const t=[];for(let n=0,i=e.length;n<i;n++){const i=e[n],o=i.modelState.position.lineNumber;t[n]=CursorState$1.fromModelState(i.modelState.move(this._inSelectionMode,o,1,0))}return t}}e.CursorLineStart=registerEditorCommand(new l({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:287}}})),e.CursorLineStartSelect=registerEditorCommand(new l({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:1311}}}));class c extends CoreEditorCommand{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,CursorMoveCommands.moveToEndOfLine(e,e.getCursorStates(),this._inSelectionMode,t.sticky||!1)),e.revealPrimaryCursor(t.source,!0)}}e.CursorEnd=registerEditorCommand(new c({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},description:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:localize("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),e.CursorEndSelect=registerEditorCommand(new c({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},description:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:localize("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class d extends CoreEditorCommand{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e,e.getCursorStates())),e.revealPrimaryCursor(t.source,!0)}_exec(e,t){const n=[];for(let i=0,o=t.length;i<o;i++){const o=t[i],r=o.modelState.position.lineNumber,s=e.model.getLineMaxColumn(r);n[i]=CursorState$1.fromModelState(o.modelState.move(this._inSelectionMode,r,s,0))}return n}}e.CursorLineEnd=registerEditorCommand(new d({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:291}}})),e.CursorLineEndSelect=registerEditorCommand(new d({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:1315}}}));class u extends CoreEditorCommand{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,CursorMoveCommands.moveToBeginningOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorTop=registerEditorCommand(new u({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:2062,mac:{primary:2064}}})),e.CursorTopSelect=registerEditorCommand(new u({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:3086,mac:{primary:3088}}}));class h extends CoreEditorCommand{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,CursorMoveCommands.moveToEndOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealPrimaryCursor(t.source,!0)}}e.CursorBottom=registerEditorCommand(new h({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:2061,mac:{primary:2066}}})),e.CursorBottomSelect=registerEditorCommand(new h({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:3085,mac:{primary:3090}}}));class g extends CoreEditorCommand{constructor(){super({id:"editorScroll",precondition:void 0,description:EditorScroll_.description})}runCoreEditorCommand(e,t){const n=EditorScroll_.parse(t);n&&this._runEditorScroll(e,t.source,n)}_runEditorScroll(e,t,n){const i=this._computeDesiredScrollTop(e,n);if(n.revealCursor){const o=e.getCompletelyVisibleViewRangeAtScrollTop(i);e.setCursorStates(t,3,[CursorMoveCommands.findPositionInViewportIfOutside(e,e.getPrimaryCursorState(),o,n.select)])}e.viewLayout.setScrollPosition({scrollTop:i},0)}_computeDesiredScrollTop(e,t){if(1===t.unit){const n=e.getCompletelyVisibleViewRange(),i=e.coordinatesConverter.convertViewRangeToModelRange(n);let o;o=1===t.direction?Math.max(1,i.startLineNumber-t.value):Math.min(e.model.getLineCount(),i.startLineNumber+t.value);const r=e.coordinatesConverter.convertModelPositionToViewPosition(new Position$1(o,1));return e.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber)}let n;n=3===t.unit?e.cursorConfig.pageSize*t.value:4===t.unit?Math.round(e.cursorConfig.pageSize/2)*t.value:t.value;const i=(1===t.direction?-1:1)*n;return e.viewLayout.getCurrentScrollTop()+i*e.cursorConfig.lineHeight}}e.EditorScrollImpl=g,e.EditorScroll=registerEditorCommand(new g),e.ScrollLineUp=registerEditorCommand(new class extends CoreEditorCommand{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(t,n){e.EditorScroll._runEditorScroll(t,n.source,{direction:1,unit:2,value:1,revealCursor:!1,select:!1})}}),e.ScrollPageUp=registerEditorCommand(new class extends CoreEditorCommand{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(t,n){e.EditorScroll._runEditorScroll(t,n.source,{direction:1,unit:3,value:1,revealCursor:!1,select:!1})}}),e.ScrollLineDown=registerEditorCommand(new class extends CoreEditorCommand{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(t,n){e.EditorScroll._runEditorScroll(t,n.source,{direction:2,unit:2,value:1,revealCursor:!1,select:!1})}}),e.ScrollPageDown=registerEditorCommand(new class extends CoreEditorCommand{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(t,n){e.EditorScroll._runEditorScroll(t,n.source,{direction:2,unit:3,value:1,revealCursor:!1,select:!1})}});class p extends CoreEditorCommand{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[CursorMoveCommands.word(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position)]),e.revealPrimaryCursor(t.source,!0)}}e.WordSelect=registerEditorCommand(new p({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),e.WordSelectDrag=registerEditorCommand(new p({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),e.LastCursorWordSelect=registerEditorCommand(new class extends CoreEditorCommand{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(e,t){const n=e.getLastAddedCursorIndex(),i=e.getCursorStates(),o=i.slice(0),r=i[n];o[n]=CursorMoveCommands.word(e,r,r.modelState.hasSelection(),t.position),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}});class f extends CoreEditorCommand{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[CursorMoveCommands.line(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),e.revealPrimaryCursor(t.source,!1)}}e.LineSelect=registerEditorCommand(new f({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),e.LineSelectDrag=registerEditorCommand(new f({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class m extends CoreEditorCommand{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){const n=e.getLastAddedCursorIndex(),i=e.getCursorStates(),o=i.slice(0);o[n]=CursorMoveCommands.line(e,i[n],this._inSelectionMode,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}}e.LastCursorLineSelect=registerEditorCommand(new m({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),e.LastCursorLineSelectDrag=registerEditorCommand(new m({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),e.CancelSelection=registerEditorCommand(new class extends CoreEditorCommand{constructor(){super({id:"cancelSelection",precondition:EditorContextKeys.hasNonEmptySelection,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[CursorMoveCommands.cancelSelection(e,e.getPrimaryCursorState())]),e.revealPrimaryCursor(t.source,!0)}}),e.RemoveSecondaryCursors=registerEditorCommand(new class extends CoreEditorCommand{constructor(){super({id:"removeSecondaryCursors",precondition:EditorContextKeys.hasMultipleSelections,kbOpts:{weight:CORE_WEIGHT+1,kbExpr:EditorContextKeys.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[e.getPrimaryCursorState()]),e.revealPrimaryCursor(t.source,!0),status(localize("removedCursor","Removed secondary cursors"))}}),e.RevealLine=registerEditorCommand(new class extends CoreEditorCommand{constructor(){super({id:"revealLine",precondition:void 0,description:RevealLine_.description})}runCoreEditorCommand(e,t){const n=t,i=n.lineNumber||0;let o="number"==typeof i?i+1:parseInt(i)+1;o<1&&(o=1);const r=e.model.getLineCount();o>r&&(o=r);const s=new Range$2(o,1,o,e.model.getLineMaxColumn(o));let a=0;if(n.at)switch(n.at){case RevealLine_.RawAtArgument.Top:a=3;break;case RevealLine_.RawAtArgument.Center:a=1;break;case RevealLine_.RawAtArgument.Bottom:a=4}const l=e.coordinatesConverter.convertModelRangeToViewRange(s);e.revealRange(t.source,!1,l,a,0)}}),e.SelectAll=new class extends EditorOrNativeTextInputCommand{constructor(){super(SelectAllCommand)}runDOMCommand(){isFirefox&&(document.activeElement.focus(),document.activeElement.select()),document.execCommand("selectAll")}runEditorCommand(e,t,n){const i=t._getViewModel();i&&this.runCoreEditorCommand(i,n)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates("keyboard",3,[CursorMoveCommands.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=registerEditorCommand(new class extends CoreEditorCommand{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[CursorState$1.fromModelSelection(t.selection)])}})}(CoreNavigationCommands||(CoreNavigationCommands={}));const columnSelectionCondition=ContextKeyExpr.and(EditorContextKeys.textInputFocus,EditorContextKeys.columnSelection);function registerColumnSelection(e,t){KeybindingsRegistry.registerKeybindingRule({id:e,primary:t,when:columnSelectionCondition,weight:CORE_WEIGHT+1})}function registerCommand$2(e){return e.register(),e}var CoreEditingCommands;registerColumnSelection(CoreNavigationCommands.CursorColumnSelectLeft.id,1039),registerColumnSelection(CoreNavigationCommands.CursorColumnSelectRight.id,1041),registerColumnSelection(CoreNavigationCommands.CursorColumnSelectUp.id,1040),registerColumnSelection(CoreNavigationCommands.CursorColumnSelectPageUp.id,1035),registerColumnSelection(CoreNavigationCommands.CursorColumnSelectDown.id,1042),registerColumnSelection(CoreNavigationCommands.CursorColumnSelectPageDown.id,1036),function(e){class t extends EditorCommand{runEditorCommand(e,t,n){const i=t._getViewModel();i&&this.runCoreEditingCommand(t,i,n||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=registerEditorCommand(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:EditorContextKeys.writable,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,TypeOperations.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection))))}}),e.Outdent=registerEditorCommand(new class extends t{constructor(){super({id:"outdent",precondition:EditorContextKeys.writable,kbOpts:{weight:CORE_WEIGHT,kbExpr:ContextKeyExpr.and(EditorContextKeys.editorTextFocus,EditorContextKeys.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,TypeOperations.outdent(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.Tab=registerEditorCommand(new class extends t{constructor(){super({id:"tab",precondition:EditorContextKeys.writable,kbOpts:{weight:CORE_WEIGHT,kbExpr:ContextKeyExpr.and(EditorContextKeys.editorTextFocus,EditorContextKeys.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,TypeOperations.tab(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.DeleteLeft=registerEditorCommand(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,n){const[i,o]=DeleteOperations.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)),t.getCursorAutoClosedCharacters());i&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(2)}}),e.DeleteRight=registerEditorCommand(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,n){const[i,o]=DeleteOperations.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)));i&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(3)}}),e.Undo=new class extends EditorOrNativeTextInputCommand{constructor(){super(UndoCommand)}runDOMCommand(){document.execCommand("undo")}runEditorCommand(e,t,n){if(t.hasModel()&&!0!==t.getOption(81))return t.getModel().undo()}},e.Redo=new class extends EditorOrNativeTextInputCommand{constructor(){super(RedoCommand)}runDOMCommand(){document.execCommand("redo")}runEditorCommand(e,t,n){if(t.hasModel()&&!0!==t.getOption(81))return t.getModel().redo()}}}(CoreEditingCommands||(CoreEditingCommands={}));class EditorHandlerCommand extends Command$1{constructor(e,t,n){super({id:e,precondition:void 0,description:n}),this._handlerId=t}runCommand(e,t){const n=e.get(ICodeEditorService).getFocusedCodeEditor();n&&n.trigger("keyboard",this._handlerId,t)}}function registerOverwritableCommand(e,t){registerCommand$2(new EditorHandlerCommand("default:"+e,e)),registerCommand$2(new EditorHandlerCommand(e,e,t))}registerOverwritableCommand("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),registerOverwritableCommand("replacePreviousChar"),registerOverwritableCommand("compositionType"),registerOverwritableCommand("compositionStart"),registerOverwritableCommand("compositionEnd"),registerOverwritableCommand("paste"),registerOverwritableCommand("cut");const IMarkerDecorationsService=createDecorator("markerDecorationsService");var __decorate$1z=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1t=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let MarkerDecorationsContribution=class{constructor(e,t){}dispose(){}};MarkerDecorationsContribution.ID="editor.contrib.markerDecorations",MarkerDecorationsContribution=__decorate$1z([__param$1t(1,IMarkerDecorationsService)],MarkerDecorationsContribution),registerEditorContribution(MarkerDecorationsContribution.ID,MarkerDecorationsContribution);var editor$1="";function deepClone(e){if(!e||"object"!=typeof e)return e;if(e instanceof RegExp)return e;const t=Array.isArray(e)?[]:{};return Object.keys(e).forEach((n=>{e[n]&&"object"==typeof e[n]?t[n]=deepClone(e[n]):t[n]=e[n]})),t}function deepFreeze(e){if(!e||"object"!=typeof e)return e;const t=[e];for(;t.length>0;){const e=t.shift();Object.freeze(e);for(const n in e)if(_hasOwnProperty.call(e,n)){const i=e[n];"object"!=typeof i||Object.isFrozen(i)||t.push(i)}}return e}const _hasOwnProperty=Object.prototype.hasOwnProperty;function cloneAndChange(e,t){return _cloneAndChange(e,t,new Set)}function _cloneAndChange(e,t,n){if(isUndefinedOrNull(e))return e;const i=t(e);if(void 0!==i)return i;if(isArray(e)){const i=[];for(const o of e)i.push(_cloneAndChange(o,t,n));return i}if(isObject(e)){if(n.has(e))throw new Error("Cannot clone recursive data-structure");n.add(e);const i={};for(let o in e)_hasOwnProperty.call(e,o)&&(i[o]=_cloneAndChange(e[o],t,n));return n.delete(e),i}return e}function mixin(e,t,n=!0){return isObject(e)?(isObject(t)&&Object.keys(t).forEach((i=>{i in e?n&&(isObject(e[i])&&isObject(t[i])?mixin(e[i],t[i],n):e[i]=t[i]):e[i]=t[i]})),e):t}function equals(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;let n,i;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(!equals(e[n],t[n]))return!1}else{const o=[];for(i in e)o.push(i);o.sort();const r=[];for(i in t)r.push(i);if(r.sort(),!equals(o,r))return!1;for(n=0;n<o.length;n++)if(!equals(e[o[n]],t[o[n]]))return!1}return!0}function getOrDefault(e,t,n){const i=t(e);return void 0===i?n:i}class ElementSizeObserver extends Disposable{constructor(e,t){super(),this._onDidChange=this._register(new Emitter$1),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){!this._resizeObserver&&this._referenceDomElement&&(this._resizeObserver=new ResizeObserver((e=>{e&&e[0]&&e[0].contentRect?this.observe({width:e[0].contentRect.width,height:e[0].contentRect.height}):this.observe()})),this._resizeObserver.observe(this._referenceDomElement))}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let n=0,i=0;t?(n=t.width,i=t.height):this._referenceDomElement&&(n=this._referenceDomElement.clientWidth,i=this._referenceDomElement.clientHeight),n=Math.max(5,n),i=Math.max(5,i),this._width===n&&this._height===i||(this._width=n,this._height=i,e&&this._onDidChange.fire())}}class FastDomNode{constructor(e){this.domNode=e,this._maxWidth=-1,this._width=-1,this._height=-1,this._top=-1,this._left=-1,this._bottom=-1,this._right=-1,this._fontFamily="",this._fontWeight="",this._fontSize=-1,this._fontStyle="",this._fontFeatureSettings="",this._textDecoration="",this._lineHeight=-1,this._letterSpacing=-100,this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth+"px")}setWidth(e){this._width!==e&&(this._width=e,this.domNode.style.width=this._width+"px")}setHeight(e){this._height!==e&&(this._height=e,this.domNode.style.height=this._height+"px")}setTop(e){this._top!==e&&(this._top=e,this.domNode.style.top=this._top+"px")}unsetTop(){-1!==this._top&&(this._top=-1,this.domNode.style.top="")}setLeft(e){this._left!==e&&(this._left=e,this.domNode.style.left=this._left+"px")}setBottom(e){this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom+"px")}setRight(e){this._right!==e&&(this._right=e,this.domNode.style.right=this._right+"px")}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize+"px")}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight+"px")}setLetterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing+"px")}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function createFastDomNode(e){return new FastDomNode(e)}const EDITOR_MODEL_DEFAULTS={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!1}},MINIMAP_GUTTER_WIDTH=8;class ConfigurationChangedEvent{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class ComputeOptionsMemory{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class BaseEditorOption{constructor(e,t,n,i){this.id=e,this.name=t,this.defaultValue=n,this.schema=i}applyUpdate(e,t){return applyUpdate(e,t)}compute(e,t,n){return n}}class ApplyUpdateResult{constructor(e,t){this.newValue=e,this.didChange=t}}function applyUpdate(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return new ApplyUpdateResult(t,e!==t);if(Array.isArray(e)||Array.isArray(t)){const n=Array.isArray(e)&&Array.isArray(t)&&equals$1(e,t);return new ApplyUpdateResult(t,n)}let n=!1;for(const i in t)if(t.hasOwnProperty(i)){const o=applyUpdate(e[i],t[i]);o.didChange&&(e[i]=o.newValue,n=!0)}return new ApplyUpdateResult(e,n)}class ComputedEditorOption{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return applyUpdate(e,t)}validate(e){return this.defaultValue}}class SimpleEditorOption{constructor(e,t,n,i){this.id=e,this.name=t,this.defaultValue=n,this.schema=i}applyUpdate(e,t){return applyUpdate(e,t)}validate(e){return void 0===e?this.defaultValue:e}compute(e,t,n){return n}}function boolean(e,t){return void 0===e?t:"false"!==e&&Boolean(e)}class EditorBooleanOption extends SimpleEditorOption{constructor(e,t,n,i){void 0!==i&&(i.type="boolean",i.default=n),super(e,t,n,i)}validate(e){return boolean(e,this.defaultValue)}}function clampedInt(e,t,n,i){if(void 0===e)return t;let o=parseInt(e,10);return isNaN(o)?t:(o=Math.max(n,o),o=Math.min(i,o),0|o)}class EditorIntOption extends SimpleEditorOption{constructor(e,t,n,i,o,r){void 0!==r&&(r.type="integer",r.default=n,r.minimum=i,r.maximum=o),super(e,t,n,r),this.minimum=i,this.maximum=o}static clampedInt(e,t,n,i){return clampedInt(e,t,n,i)}validate(e){return EditorIntOption.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}class EditorFloatOption extends SimpleEditorOption{constructor(e,t,n,i,o){void 0!==o&&(o.type="number",o.default=n),super(e,t,n,o),this.validationFn=i}static clamp(e,t,n){return e<t?t:e>n?n:e}static float(e,t){if("number"==typeof e)return e;if(void 0===e)return t;const n=parseFloat(e);return isNaN(n)?t:n}validate(e){return this.validationFn(EditorFloatOption.float(e,this.defaultValue))}}class EditorStringOption extends SimpleEditorOption{static string(e,t){return"string"!=typeof e?t:e}constructor(e,t,n,i){void 0!==i&&(i.type="string",i.default=n),super(e,t,n,i)}validate(e){return EditorStringOption.string(e,this.defaultValue)}}function stringSet(e,t,n){return"string"!=typeof e||-1===n.indexOf(e)?t:e}class EditorStringEnumOption extends SimpleEditorOption{constructor(e,t,n,i,o){void 0!==o&&(o.type="string",o.enum=i,o.default=n),super(e,t,n,o),this._allowedValues=i}validate(e){return stringSet(e,this.defaultValue,this._allowedValues)}}class EditorEnumOption extends BaseEditorOption{constructor(e,t,n,i,o,r,s){void 0!==s&&(s.type="string",s.enum=o,s.default=i),super(e,t,n,s),this._allowedValues=o,this._convert=r}validate(e){return"string"!=typeof e||-1===this._allowedValues.indexOf(e)?this.defaultValue:this._convert(e)}}function _autoIndentFromString(e){switch(e){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class EditorAccessibilitySupport extends BaseEditorOption{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[localize("accessibilitySupport.auto","The editor will use platform APIs to detect when a Screen Reader is attached."),localize("accessibilitySupport.on","The editor will be permanently optimized for usage with a Screen Reader. Word wrapping will be disabled."),localize("accessibilitySupport.off","The editor will never be optimized for usage with a Screen Reader.")],default:"auto",description:localize("accessibilitySupport","Controls whether the editor should run in a mode where it is optimized for screen readers. Setting to on will disable word wrapping.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,n){return 0===n?e.accessibilitySupport:n}}class EditorComments extends BaseEditorOption{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(19,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:localize("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:localize("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertSpace:boolean(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:boolean(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function _cursorBlinkingStyleFromString(e){switch(e){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var TextEditorCursorStyle$1,TextEditorCursorStyle2;function _cursorStyleFromString(e){switch(e){case"line":return TextEditorCursorStyle$1.Line;case"block":return TextEditorCursorStyle$1.Block;case"underline":return TextEditorCursorStyle$1.Underline;case"line-thin":return TextEditorCursorStyle$1.LineThin;case"block-outline":return TextEditorCursorStyle$1.BlockOutline;case"underline-thin":return TextEditorCursorStyle$1.UnderlineThin}}TextEditorCursorStyle2=TextEditorCursorStyle$1||(TextEditorCursorStyle$1={}),TextEditorCursorStyle2[TextEditorCursorStyle2.Line=1]="Line",TextEditorCursorStyle2[TextEditorCursorStyle2.Block=2]="Block",TextEditorCursorStyle2[TextEditorCursorStyle2.Underline=3]="Underline",TextEditorCursorStyle2[TextEditorCursorStyle2.LineThin=4]="LineThin",TextEditorCursorStyle2[TextEditorCursorStyle2.BlockOutline=5]="BlockOutline",TextEditorCursorStyle2[TextEditorCursorStyle2.UnderlineThin=6]="UnderlineThin";class EditorClassName extends ComputedEditorOption{constructor(){super(128)}compute(e,t,n){const i=["monaco-editor"];return t.get(33)&&i.push(t.get(33)),e.extraEditorClassName&&i.push(e.extraEditorClassName),"default"===t.get(66)?i.push("mouse-default"):"copy"===t.get(66)&&i.push("mouse-copy"),t.get(100)&&i.push("showUnused"),t.get(126)&&i.push("showDeprecated"),i.join(" ")}}class EditorEmptySelectionClipboard extends EditorBooleanOption{constructor(){super(32,"emptySelectionClipboard",!0,{description:localize("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,n){return n&&e.emptySelectionClipboard}}class EditorFind extends BaseEditorOption{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(35,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:localize("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[localize("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),localize("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),localize("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:localize("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[localize("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),localize("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),localize("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:localize("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:localize("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:isMacintosh},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:localize("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:localize("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{cursorMoveOnType:boolean(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:"boolean"==typeof e.seedSearchStringFromSelection?e.seedSearchStringFromSelection?"always":"never":stringSet(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:"boolean"==typeof e.autoFindInSelection?e.autoFindInSelection?"always":"never":stringSet(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:boolean(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:boolean(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:boolean(t.loop,this.defaultValue.loop)}}}class EditorFontLigatures extends BaseEditorOption{constructor(){super(45,"fontLigatures",EditorFontLigatures.OFF,{anyOf:[{type:"boolean",description:localize("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:localize("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:localize("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e?EditorFontLigatures.OFF:"true"===e?EditorFontLigatures.ON:e:Boolean(e)?EditorFontLigatures.ON:EditorFontLigatures.OFF}}EditorFontLigatures.OFF='"liga" off, "calt" off',EditorFontLigatures.ON='"liga" on, "calt" on';class EditorFontInfo extends ComputedEditorOption{constructor(){super(44)}compute(e,t,n){return e.fontInfo}}class EditorFontSize extends SimpleEditorOption{constructor(){super(46,"fontSize",EDITOR_FONT_DEFAULTS.fontSize,{type:"number",minimum:6,maximum:100,default:EDITOR_FONT_DEFAULTS.fontSize,description:localize("fontSize","Controls the font size in pixels.")})}validate(e){const t=EditorFloatOption.float(e,this.defaultValue);return 0===t?EDITOR_FONT_DEFAULTS.fontSize:EditorFloatOption.clamp(t,6,100)}compute(e,t,n){return e.fontInfo.fontSize}}class EditorFontWeight extends BaseEditorOption{constructor(){super(47,"fontWeight",EDITOR_FONT_DEFAULTS.fontWeight,{anyOf:[{type:"number",minimum:EditorFontWeight.MINIMUM_VALUE,maximum:EditorFontWeight.MAXIMUM_VALUE,errorMessage:localize("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:EditorFontWeight.SUGGESTION_VALUES}],default:EDITOR_FONT_DEFAULTS.fontWeight,description:localize("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return"normal"===e||"bold"===e?e:String(EditorIntOption.clampedInt(e,EDITOR_FONT_DEFAULTS.fontWeight,EditorFontWeight.MINIMUM_VALUE,EditorFontWeight.MAXIMUM_VALUE))}}EditorFontWeight.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],EditorFontWeight.MINIMUM_VALUE=1,EditorFontWeight.MAXIMUM_VALUE=1e3;class EditorGoToLocation extends BaseEditorOption{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[localize("editor.gotoLocation.multiple.peek","Show peek view of the results (default)"),localize("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a peek view"),localize("editor.gotoLocation.multiple.goto","Go to the primary result and enable peek-less navigation to others")]},n=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(51,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:localize("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:localize("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:localize("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:localize("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:localize("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:localize("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:n,description:localize("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:n,description:localize("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:n,description:localize("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:n,description:localize("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:n,description:localize("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,n,i,o,r;if(!e||"object"!=typeof e)return this.defaultValue;const s=e;return{multiple:stringSet(s.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:null!==(t=s.multipleDefinitions)&&void 0!==t?t:stringSet(s.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:null!==(n=s.multipleTypeDefinitions)&&void 0!==n?n:stringSet(s.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:null!==(i=s.multipleDeclarations)&&void 0!==i?i:stringSet(s.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:null!==(o=s.multipleImplementations)&&void 0!==o?o:stringSet(s.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:null!==(r=s.multipleReferences)&&void 0!==r?r:stringSet(s.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:EditorStringOption.string(s.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:EditorStringOption.string(s.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:EditorStringOption.string(s.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:EditorStringOption.string(s.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:EditorStringOption.string(s.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class EditorHover extends BaseEditorOption{constructor(){const e={enabled:!0,delay:300,sticky:!0,above:!0};super(53,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:localize("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:localize("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:localize("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.above":{type:"boolean",default:e.above,description:localize("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:boolean(t.enabled,this.defaultValue.enabled),delay:EditorIntOption.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:boolean(t.sticky,this.defaultValue.sticky),above:boolean(t.above,this.defaultValue.above)}}}class EditorLayoutInfoComputer extends ComputedEditorOption{constructor(){super(131)}compute(e,t,n){return EditorLayoutInfoComputer.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,n=e.scrollBeyondLastLine?t-1:0,i=(e.viewLineCount+n)/(e.pixelRatio*e.height);return{typicalViewportLineCount:t,extraLinesBeyondLastLine:n,desiredRatio:i,minimapLineCount:Math.floor(e.viewLineCount/i)}}static _computeMinimapLayout(e,t){const n=e.outerWidth,i=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*i),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:i};const r=t.stableMinimapLayoutInput,s=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,a=e.lineHeight,l=e.typicalHalfwidthCharacterWidth,c=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let u=o>=2?Math.round(2*e.minimap.scale):e.minimap.scale;const h=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,f=e.verticalScrollbarWidth,m=e.viewLineCount,v=e.remainingWidth,_=e.isViewportWrapping,C=d?2:3;let b=Math.floor(o*i);const y=b/o;let S=!1,w=!1,E=C*u,x=u/o,T=1;if("fill"===g||"fit"===g){const{typicalViewportLineCount:n,extraLinesBeyondLastLine:r,desiredRatio:l,minimapLineCount:d}=EditorLayoutInfoComputer.computeContainedMinimapLineCount({viewLineCount:m,scrollBeyondLastLine:c,height:i,lineHeight:a,pixelRatio:o});if(m/d>1)S=!0,w=!0,u=1,E=1,x=u/o;else{let i=!1,c=u+1;if("fit"===g){const e=Math.ceil((m+r)*E);_&&s&&v<=t.stableFitRemainingWidth?(i=!0,c=t.stableFitMaxMinimapScale):i=e>b}if("fill"===g||i){S=!0;const i=u;E=Math.min(a*o,Math.max(1,Math.floor(1/l))),_&&s&&v<=t.stableFitRemainingWidth&&(c=t.stableFitMaxMinimapScale),u=Math.min(c,Math.max(1,Math.floor(E/C))),u>i&&(T=Math.min(2,u/i)),x=u/o/T,b=Math.ceil(Math.max(n,m+r)*E),_?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=v,t.stableFitMaxMinimapScale=u):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const I=Math.floor(h*x),k=Math.min(I,Math.max(0,Math.floor((v-f-2)*x/(l+x)))+MINIMAP_GUTTER_WIDTH);let L=Math.floor(o*k);const D=L/o;L=Math.floor(L*T);return{renderMinimap:d?1:2,minimapLeft:"left"===p?0:n-k-f,minimapWidth:k,minimapHeightIsEditorHeight:S,minimapIsSampling:w,minimapScale:u,minimapLineHeight:E,minimapCanvasInnerWidth:L,minimapCanvasInnerHeight:b,minimapCanvasOuterWidth:D,minimapCanvasOuterHeight:y}}static computeLayout(e,t){const n=0|t.outerWidth,i=0|t.outerHeight,o=0|t.lineHeight,r=0|t.lineNumbersDigitCount,s=t.typicalHalfwidthCharacterWidth,a=t.maxDigitWidth,l=t.pixelRatio,c=t.viewLineCount,d=e.get(123),u="inherit"===d?e.get(122):d,h="inherit"===u?e.get(118):u,g=e.get(121),p=e.get(2),f=t.isDominatedByLongLines,m=e.get(50),v=0!==e.get(60).renderType,_=e.get(61),C=e.get(94),b=e.get(65),y=e.get(92),S=y.verticalScrollbarSize,w=y.verticalHasArrows,E=y.arrowSize,x=y.horizontalScrollbarSize,T=e.get(58),I=e.get(37);let k;if("string"==typeof T&&/^\d+(\.\d+)?ch$/.test(T)){const e=parseFloat(T.substr(0,T.length-2));k=EditorIntOption.clampedInt(e*s,0,0,1e3)}else k=EditorIntOption.clampedInt(T,0,0,1e3);I&&(k+=16);let L=0;if(v){const e=Math.max(r,_);L=Math.round(e*a)}let D=0;m&&(D=o);let N=0,O=N+D,A=O+L,P=A+k;const R=n-D-L-k;let M=!1,$=!1,F=-1;2!==p&&("inherit"===u&&f?(M=!0,$=!0):"on"===h||"bounded"===h?$=!0:"wordWrapColumn"===h&&(F=g));const B=EditorLayoutInfoComputer._computeMinimapLayout({outerWidth:n,outerHeight:i,lineHeight:o,typicalHalfwidthCharacterWidth:s,pixelRatio:l,scrollBeyondLastLine:C,minimap:b,verticalScrollbarWidth:S,viewLineCount:c,remainingWidth:R,isViewportWrapping:$},t.memory||new ComputeOptionsMemory);0!==B.renderMinimap&&0===B.minimapLeft&&(N+=B.minimapWidth,O+=B.minimapWidth,A+=B.minimapWidth,P+=B.minimapWidth);const V=R-B.minimapWidth,W=Math.max(1,Math.floor((V-S-2)/s)),H=w?E:0;return $&&(F=Math.max(1,W),"bounded"===h&&(F=Math.min(F,g))),{width:n,height:i,glyphMarginLeft:N,glyphMarginWidth:D,lineNumbersLeft:O,lineNumbersWidth:L,decorationsLeft:A,decorationsWidth:k,contentLeft:P,contentWidth:V,minimap:B,viewportColumn:W,isWordWrapMinified:M,isViewportWrapping:$,wrappingColumn:F,verticalScrollbarWidth:S,horizontalScrollbarHeight:x,overviewRuler:{top:H,width:S,height:i-2*H,right:0}}}}class EditorLightbulb extends BaseEditorOption{constructor(){const e={enabled:!0};super(57,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:localize("codeActions","Enables the code action lightbulb in the editor.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;return{enabled:boolean(e.enabled,this.defaultValue.enabled)}}}class EditorInlayHints extends BaseEditorOption{constructor(){const e={enabled:!0,fontSize:0,fontFamily:""};super(127,"inlayHints",e,{"editor.inlayHints.enabled":{type:"boolean",default:e.enabled,description:localize("inlayHints.enable","Enables the inlay hints in the editor.")},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:localize("inlayHints.fontSize","Controls font size of inlay hints in the editor. A default of 90% of `#editor.fontSize#` is used when the configured value is less than `5` or greater than the editor font size.")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:localize("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the `#editor.fontFamily#` is used.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:boolean(t.enabled,this.defaultValue.enabled),fontSize:EditorIntOption.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:EditorStringOption.string(t.fontFamily,this.defaultValue.fontFamily)}}}class EditorLineHeight extends EditorFloatOption{constructor(){super(59,"lineHeight",EDITOR_FONT_DEFAULTS.lineHeight,(e=>EditorFloatOption.clamp(e,0,150)),{markdownDescription:localize("lineHeight","Controls the line height. \n - Use 0 to automatically compute the line height from the font size.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values.")})}compute(e,t,n){return e.fontInfo.lineHeight}}class EditorMinimap extends BaseEditorOption{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120,scale:1};super(65,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:localize("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[localize("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),localize("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),localize("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:localize("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:localize("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:localize("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:localize("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:localize("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:localize("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:boolean(t.enabled,this.defaultValue.enabled),size:stringSet(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:stringSet(t.side,this.defaultValue.side,["right","left"]),showSlider:stringSet(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:boolean(t.renderCharacters,this.defaultValue.renderCharacters),scale:EditorIntOption.clampedInt(t.scale,1,1,3),maxColumn:EditorIntOption.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function _multiCursorModifierFromString(e){return"ctrlCmd"===e?isMacintosh?"metaKey":"ctrlKey":"altKey"}class EditorPadding extends BaseEditorOption{constructor(){super(75,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:localize("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:localize("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{top:EditorIntOption.clampedInt(t.top,0,0,1e3),bottom:EditorIntOption.clampedInt(t.bottom,0,0,1e3)}}}class EditorParameterHints extends BaseEditorOption{constructor(){const e={enabled:!0,cycle:!1};super(76,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:localize("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:localize("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:boolean(t.enabled,this.defaultValue.enabled),cycle:boolean(t.cycle,this.defaultValue.cycle)}}}class EditorPixelRatio extends ComputedEditorOption{constructor(){super(129)}compute(e,t,n){return e.pixelRatio}}class EditorQuickSuggestions extends BaseEditorOption{constructor(){const e={other:!0,comments:!1,strings:!1};super(79,"quickSuggestions",e,{anyOf:[{type:"boolean"},{type:"object",properties:{strings:{type:"boolean",default:e.strings,description:localize("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{type:"boolean",default:e.comments,description:localize("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{type:"boolean",default:e.other,description:localize("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}}}],default:e,description:localize("quickSuggestions","Controls whether suggestions should automatically show up while typing.")}),this.defaultValue=e}validate(e){if("boolean"==typeof e)return e;if(e&&"object"==typeof e){const t=e,n={other:boolean(t.other,this.defaultValue.other),comments:boolean(t.comments,this.defaultValue.comments),strings:boolean(t.strings,this.defaultValue.strings)};return!!(n.other&&n.comments&&n.strings)||!!(n.other||n.comments||n.strings)&&n}return this.defaultValue}}class EditorRenderLineNumbersOption extends BaseEditorOption{constructor(){super(60,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[localize("lineNumbers.off","Line numbers are not rendered."),localize("lineNumbers.on","Line numbers are rendered as absolute number."),localize("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),localize("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:localize("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,n=this.defaultValue.renderFn;return void 0!==e&&("function"==typeof e?(t=4,n=e):t="interval"===e?3:"relative"===e?2:"on"===e?1:0),{renderType:t,renderFn:n}}}function filterValidationDecorations(e){const t=e.get(87);return"editable"===t?e.get(81):"on"!==t}class EditorRulers extends BaseEditorOption{constructor(){const e=[],t={type:"number",description:localize("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(91,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:localize("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:localize("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(let n of e)if("number"==typeof n)t.push({column:EditorIntOption.clampedInt(n,0,0,1e4),color:null});else if(n&&"object"==typeof n){const e=n;t.push({column:EditorIntOption.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort(((e,t)=>e.column-t.column)),t}return this.defaultValue}}function _scrollbarVisibilityFromString(e,t){if("string"!=typeof e)return t;switch(e){case"hidden":return 2;case"visible":return 3;default:return 1}}class EditorScrollbar$1 extends BaseEditorOption{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(92,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[localize("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),localize("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),localize("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:localize("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[localize("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),localize("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),localize("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:localize("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:localize("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:localize("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:localize("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e,n=EditorIntOption.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),i=EditorIntOption.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:EditorIntOption.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:_scrollbarVisibilityFromString(t.vertical,this.defaultValue.vertical),horizontal:_scrollbarVisibilityFromString(t.horizontal,this.defaultValue.horizontal),useShadows:boolean(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:boolean(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:boolean(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:boolean(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:boolean(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:n,horizontalSliderSize:EditorIntOption.clampedInt(t.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:i,verticalSliderSize:EditorIntOption.clampedInt(t.verticalSliderSize,i,0,1e3),scrollByPage:boolean(t.scrollByPage,this.defaultValue.scrollByPage)}}}const inUntrustedWorkspace="inUntrustedWorkspace",unicodeHighlightConfigKeys={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class UnicodeHighlight extends BaseEditorOption{constructor(){const e={nonBasicASCII:inUntrustedWorkspace,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:inUntrustedWorkspace,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(113,"unicodeHighlight",e,{[unicodeHighlightConfigKeys.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,inUntrustedWorkspace],default:e.nonBasicASCII,description:localize("unicodeHighlight.nonBasicASCII","Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[unicodeHighlightConfigKeys.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:localize("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[unicodeHighlightConfigKeys.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:localize("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[unicodeHighlightConfigKeys.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,inUntrustedWorkspace],default:e.includeComments,description:localize("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to unicode highlighting.")},[unicodeHighlightConfigKeys.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,inUntrustedWorkspace],default:e.includeStrings,description:localize("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to unicode highlighting.")},[unicodeHighlightConfigKeys.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:localize("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[unicodeHighlightConfigKeys.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:localize("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let n=!1;t.allowedCharacters&&(equals(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),n=!0)),t.allowedLocales&&(equals(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),n=!0));const i=super.applyUpdate(e,t);return n?new ApplyUpdateResult(i.newValue,!0):i}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{nonBasicASCII:primitiveSet(t.nonBasicASCII,inUntrustedWorkspace,[!0,!1,inUntrustedWorkspace]),invisibleCharacters:boolean(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:boolean(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:primitiveSet(t.includeComments,inUntrustedWorkspace,[!0,!1,inUntrustedWorkspace]),includeStrings:primitiveSet(t.includeStrings,inUntrustedWorkspace,[!0,!1,inUntrustedWorkspace]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if("object"!=typeof e||!e)return t;const n={};for(const[i,o]of Object.entries(e))!0===o&&(n[i]=!0);return n}}class InlineEditorSuggest extends BaseEditorOption{constructor(){const e={enabled:!0,mode:"subwordSmart"};super(55,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:localize("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:boolean(t.enabled,this.defaultValue.enabled),mode:stringSet(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"])}}}class BracketPairColorization extends BaseEditorOption{constructor(){const e={enabled:EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions.enabled};super(12,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,description:localize("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use 'workbench.colorCustomizations' to override the bracket highlight colors.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;return{enabled:boolean(e.enabled,this.defaultValue.enabled)}}}class GuideOptions extends BaseEditorOption{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(13,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[localize("editor.guides.bracketPairs.true","Enables bracket pair guides."),localize("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),localize("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:localize("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[localize("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),localize("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),localize("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:localize("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:localize("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:localize("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:"boolean",default:e.highlightActiveIndentation,description:localize("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{bracketPairs:primitiveSet(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:primitiveSet(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:boolean(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:boolean(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:boolean(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation)}}}function primitiveSet(e,t,n){const i=n.indexOf(e);return-1===i?t:n[i]}class EditorSuggest extends BaseEditorOption{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!0,localityBonus:!1,shareSuggestSelections:!1,showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(106,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[localize("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),localize("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:localize("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:localize("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:localize("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:localize("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:localize("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:localize("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:localize("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:localize("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:localize("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:localize("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:localize("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertMode:stringSet(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:boolean(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:boolean(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:boolean(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:boolean(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),showIcons:boolean(t.showIcons,this.defaultValue.showIcons),showStatusBar:boolean(t.showStatusBar,this.defaultValue.showStatusBar),preview:boolean(t.preview,this.defaultValue.preview),previewMode:stringSet(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:boolean(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:boolean(t.showMethods,this.defaultValue.showMethods),showFunctions:boolean(t.showFunctions,this.defaultValue.showFunctions),showConstructors:boolean(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:boolean(t.showDeprecated,this.defaultValue.showDeprecated),showFields:boolean(t.showFields,this.defaultValue.showFields),showVariables:boolean(t.showVariables,this.defaultValue.showVariables),showClasses:boolean(t.showClasses,this.defaultValue.showClasses),showStructs:boolean(t.showStructs,this.defaultValue.showStructs),showInterfaces:boolean(t.showInterfaces,this.defaultValue.showInterfaces),showModules:boolean(t.showModules,this.defaultValue.showModules),showProperties:boolean(t.showProperties,this.defaultValue.showProperties),showEvents:boolean(t.showEvents,this.defaultValue.showEvents),showOperators:boolean(t.showOperators,this.defaultValue.showOperators),showUnits:boolean(t.showUnits,this.defaultValue.showUnits),showValues:boolean(t.showValues,this.defaultValue.showValues),showConstants:boolean(t.showConstants,this.defaultValue.showConstants),showEnums:boolean(t.showEnums,this.defaultValue.showEnums),showEnumMembers:boolean(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:boolean(t.showKeywords,this.defaultValue.showKeywords),showWords:boolean(t.showWords,this.defaultValue.showWords),showColors:boolean(t.showColors,this.defaultValue.showColors),showFiles:boolean(t.showFiles,this.defaultValue.showFiles),showReferences:boolean(t.showReferences,this.defaultValue.showReferences),showFolders:boolean(t.showFolders,this.defaultValue.showFolders),showTypeParameters:boolean(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:boolean(t.showSnippets,this.defaultValue.showSnippets),showUsers:boolean(t.showUsers,this.defaultValue.showUsers),showIssues:boolean(t.showIssues,this.defaultValue.showIssues)}}}class SmartSelect extends BaseEditorOption{constructor(){super(102,"smartSelect",{selectLeadingAndTrailingWhitespace:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:localize("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"}})}validate(e){return e&&"object"==typeof e?{selectLeadingAndTrailingWhitespace:boolean(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace)}:this.defaultValue}}class EditorTabFocusMode extends ComputedEditorOption{constructor(){super(130)}compute(e,t,n){return!!t.get(81)||e.tabFocusMode}}function _wrappingIndentFromString(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}}class EditorWrappingInfoComputer extends ComputedEditorOption{constructor(){super(132)}compute(e,t,n){const i=t.get(131);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:i.isWordWrapMinified,isViewportWrapping:i.isViewportWrapping,wrappingColumn:i.wrappingColumn}}}const DEFAULT_WINDOWS_FONT_FAMILY="Consolas, 'Courier New', monospace",DEFAULT_MAC_FONT_FAMILY="Menlo, Monaco, 'Courier New', monospace",DEFAULT_LINUX_FONT_FAMILY="'Droid Sans Mono', 'monospace', monospace",EDITOR_FONT_DEFAULTS={fontFamily:isMacintosh?DEFAULT_MAC_FONT_FAMILY:isLinux?DEFAULT_LINUX_FONT_FAMILY:DEFAULT_WINDOWS_FONT_FAMILY,fontWeight:"normal",fontSize:isMacintosh?12:14,lineHeight:0,letterSpacing:0},editorOptionsRegistry=[];function register$1(e){return editorOptionsRegistry[e.id]=e,e}const EditorOptions={acceptSuggestionOnCommitCharacter:register$1(new EditorBooleanOption(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:localize("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:register$1(new EditorStringEnumOption(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",localize("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:localize("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:register$1(new EditorAccessibilitySupport),accessibilityPageSize:register$1(new EditorIntOption(3,"accessibilityPageSize",10,1,1073741824,{description:localize("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default.")})),ariaLabel:register$1(new EditorStringOption(4,"ariaLabel",localize("editorViewAccessibleLabel","Editor content"))),autoClosingBrackets:register$1(new EditorStringEnumOption(5,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",localize("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),localize("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:localize("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingDelete:register$1(new EditorStringEnumOption(6,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",localize("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:localize("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:register$1(new EditorStringEnumOption(7,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",localize("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:localize("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:register$1(new EditorStringEnumOption(8,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",localize("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),localize("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:localize("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:register$1(new EditorEnumOption(9,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],_autoIndentFromString,{enumDescriptions:[localize("editor.autoIndent.none","The editor will not insert indentation automatically."),localize("editor.autoIndent.keep","The editor will keep the current line's indentation."),localize("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),localize("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),localize("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:localize("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:register$1(new EditorBooleanOption(10,"automaticLayout",!1)),autoSurround:register$1(new EditorStringEnumOption(11,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[localize("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),localize("editor.autoSurround.quotes","Surround with quotes but not brackets."),localize("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:localize("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:register$1(new BracketPairColorization),bracketPairGuides:register$1(new GuideOptions),stickyTabStops:register$1(new EditorBooleanOption(104,"stickyTabStops",!1,{description:localize("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:register$1(new EditorBooleanOption(14,"codeLens",!0,{description:localize("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:register$1(new EditorStringOption(15,"codeLensFontFamily","",{description:localize("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:register$1(new EditorIntOption(16,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:localize("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to `0`, 90% of `#editor.fontSize#` is used.")})),colorDecorators:register$1(new EditorBooleanOption(17,"colorDecorators",!0,{description:localize("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),columnSelection:register$1(new EditorBooleanOption(18,"columnSelection",!1,{description:localize("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:register$1(new EditorComments),contextmenu:register$1(new EditorBooleanOption(20,"contextmenu",!0)),copyWithSyntaxHighlighting:register$1(new EditorBooleanOption(21,"copyWithSyntaxHighlighting",!0,{description:localize("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:register$1(new EditorEnumOption(22,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],_cursorBlinkingStyleFromString,{description:localize("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:register$1(new EditorBooleanOption(23,"cursorSmoothCaretAnimation",!1,{description:localize("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:register$1(new EditorEnumOption(24,"cursorStyle",TextEditorCursorStyle$1.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],_cursorStyleFromString,{description:localize("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:register$1(new EditorIntOption(25,"cursorSurroundingLines",0,0,1073741824,{description:localize("cursorSurroundingLines","Controls the minimal number of visible leading and trailing lines surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:register$1(new EditorStringEnumOption(26,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[localize("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),localize("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],description:localize("cursorSurroundingLinesStyle","Controls when `cursorSurroundingLines` should be enforced.")})),cursorWidth:register$1(new EditorIntOption(27,"cursorWidth",0,0,1073741824,{markdownDescription:localize("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:register$1(new EditorBooleanOption(28,"disableLayerHinting",!1)),disableMonospaceOptimizations:register$1(new EditorBooleanOption(29,"disableMonospaceOptimizations",!1)),domReadOnly:register$1(new EditorBooleanOption(30,"domReadOnly",!1)),dragAndDrop:register$1(new EditorBooleanOption(31,"dragAndDrop",!0,{description:localize("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:register$1(new EditorEmptySelectionClipboard),extraEditorClassName:register$1(new EditorStringOption(33,"extraEditorClassName","")),fastScrollSensitivity:register$1(new EditorFloatOption(34,"fastScrollSensitivity",5,(e=>e<=0?5:e),{markdownDescription:localize("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:register$1(new EditorFind),fixedOverflowWidgets:register$1(new EditorBooleanOption(36,"fixedOverflowWidgets",!1)),folding:register$1(new EditorBooleanOption(37,"folding",!0,{description:localize("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:register$1(new EditorStringEnumOption(38,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[localize("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),localize("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:localize("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:register$1(new EditorBooleanOption(39,"foldingHighlight",!0,{description:localize("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:register$1(new EditorBooleanOption(40,"foldingImportsByDefault",!1,{description:localize("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:register$1(new EditorIntOption(41,"foldingMaximumRegions",5e3,10,65e3,{description:localize("foldingMaximumRegions","The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:register$1(new EditorBooleanOption(42,"unfoldOnClickAfterEndOfLine",!1,{description:localize("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:register$1(new EditorStringOption(43,"fontFamily",EDITOR_FONT_DEFAULTS.fontFamily,{description:localize("fontFamily","Controls the font family.")})),fontInfo:register$1(new EditorFontInfo),fontLigatures2:register$1(new EditorFontLigatures),fontSize:register$1(new EditorFontSize),fontWeight:register$1(new EditorFontWeight),formatOnPaste:register$1(new EditorBooleanOption(48,"formatOnPaste",!1,{description:localize("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:register$1(new EditorBooleanOption(49,"formatOnType",!1,{description:localize("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:register$1(new EditorBooleanOption(50,"glyphMargin",!0,{description:localize("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:register$1(new EditorGoToLocation),hideCursorInOverviewRuler:register$1(new EditorBooleanOption(52,"hideCursorInOverviewRuler",!1,{description:localize("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:register$1(new EditorHover),inDiffEditor:register$1(new EditorBooleanOption(54,"inDiffEditor",!1)),letterSpacing:register$1(new EditorFloatOption(56,"letterSpacing",EDITOR_FONT_DEFAULTS.letterSpacing,(e=>EditorFloatOption.clamp(e,-5,20)),{description:localize("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:register$1(new EditorLightbulb),lineDecorationsWidth:register$1(new SimpleEditorOption(58,"lineDecorationsWidth",10)),lineHeight:register$1(new EditorLineHeight),lineNumbers:register$1(new EditorRenderLineNumbersOption),lineNumbersMinChars:register$1(new EditorIntOption(61,"lineNumbersMinChars",5,1,300)),linkedEditing:register$1(new EditorBooleanOption(62,"linkedEditing",!1,{description:localize("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols, e.g. HTML tags, are updated while editing.")})),links:register$1(new EditorBooleanOption(63,"links",!0,{description:localize("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:register$1(new EditorStringEnumOption(64,"matchBrackets","always",["always","near","never"],{description:localize("matchBrackets","Highlight matching brackets.")})),minimap:register$1(new EditorMinimap),mouseStyle:register$1(new EditorStringEnumOption(66,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:register$1(new EditorFloatOption(67,"mouseWheelScrollSensitivity",1,(e=>0===e?1:e),{markdownDescription:localize("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:register$1(new EditorBooleanOption(68,"mouseWheelZoom",!1,{markdownDescription:localize("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:register$1(new EditorBooleanOption(69,"multiCursorMergeOverlapping",!0,{description:localize("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:register$1(new EditorEnumOption(70,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],_multiCursorModifierFromString,{markdownEnumDescriptions:[localize("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),localize("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:localize({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the multicursor modifier. [Read more](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:register$1(new EditorStringEnumOption(71,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[localize("multiCursorPaste.spread","Each cursor pastes a single line of the text."),localize("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:localize("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),occurrencesHighlight:register$1(new EditorBooleanOption(72,"occurrencesHighlight",!0,{description:localize("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:register$1(new EditorBooleanOption(73,"overviewRulerBorder",!0,{description:localize("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:register$1(new EditorIntOption(74,"overviewRulerLanes",3,0,3)),padding:register$1(new EditorPadding),parameterHints:register$1(new EditorParameterHints),peekWidgetDefaultFocus:register$1(new EditorStringEnumOption(77,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[localize("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),localize("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:localize("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:register$1(new EditorBooleanOption(78,"definitionLinkOpensInPeek",!1,{description:localize("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:register$1(new EditorQuickSuggestions),quickSuggestionsDelay:register$1(new EditorIntOption(80,"quickSuggestionsDelay",10,0,1073741824,{description:localize("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:register$1(new EditorBooleanOption(81,"readOnly",!1)),renameOnType:register$1(new EditorBooleanOption(82,"renameOnType",!1,{description:localize("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:localize("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:register$1(new EditorBooleanOption(83,"renderControlCharacters",!0,{description:localize("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:register$1(new EditorBooleanOption(84,"renderFinalNewline",!0,{description:localize("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:register$1(new EditorStringEnumOption(85,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",localize("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:localize("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:register$1(new EditorBooleanOption(86,"renderLineHighlightOnlyWhenFocus",!1,{description:localize("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:register$1(new EditorStringEnumOption(87,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:register$1(new EditorStringEnumOption(88,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",localize("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),localize("renderWhitespace.selection","Render whitespace characters only on selected text."),localize("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:localize("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:register$1(new EditorIntOption(89,"revealHorizontalRightPadding",30,0,1e3)),roundedSelection:register$1(new EditorBooleanOption(90,"roundedSelection",!0,{description:localize("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:register$1(new EditorRulers),scrollbar:register$1(new EditorScrollbar$1),scrollBeyondLastColumn:register$1(new EditorIntOption(93,"scrollBeyondLastColumn",5,0,1073741824,{description:localize("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:register$1(new EditorBooleanOption(94,"scrollBeyondLastLine",!0,{description:localize("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:register$1(new EditorBooleanOption(95,"scrollPredominantAxis",!0,{description:localize("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:register$1(new EditorBooleanOption(96,"selectionClipboard",!0,{description:localize("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:isLinux})),selectionHighlight:register$1(new EditorBooleanOption(97,"selectionHighlight",!0,{description:localize("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:register$1(new EditorBooleanOption(98,"selectOnLineNumbers",!0)),showFoldingControls:register$1(new EditorStringEnumOption(99,"showFoldingControls","mouseover",["always","mouseover"],{enumDescriptions:[localize("showFoldingControls.always","Always show the folding controls."),localize("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:localize("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:register$1(new EditorBooleanOption(100,"showUnused",!0,{description:localize("showUnused","Controls fading out of unused code.")})),showDeprecated:register$1(new EditorBooleanOption(126,"showDeprecated",!0,{description:localize("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:register$1(new EditorInlayHints),snippetSuggestions:register$1(new EditorStringEnumOption(101,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[localize("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),localize("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),localize("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),localize("snippetSuggestions.none","Do not show snippet suggestions.")],description:localize("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:register$1(new SmartSelect),smoothScrolling:register$1(new EditorBooleanOption(103,"smoothScrolling",!1,{description:localize("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:register$1(new EditorIntOption(105,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:register$1(new EditorSuggest),inlineSuggest:register$1(new InlineEditorSuggest),suggestFontSize:register$1(new EditorIntOption(107,"suggestFontSize",0,0,1e3,{markdownDescription:localize("suggestFontSize","Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.")})),suggestLineHeight:register$1(new EditorIntOption(108,"suggestLineHeight",0,0,1e3,{markdownDescription:localize("suggestLineHeight","Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used. The minimum value is 8.")})),suggestOnTriggerCharacters:register$1(new EditorBooleanOption(109,"suggestOnTriggerCharacters",!0,{description:localize("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:register$1(new EditorStringEnumOption(110,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[localize("suggestSelection.first","Always select the first suggestion."),localize("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),localize("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:localize("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:register$1(new EditorStringEnumOption(111,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[localize("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),localize("tabCompletion.off","Disable tab completions."),localize("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:localize("tabCompletion","Enables tab completions.")})),tabIndex:register$1(new EditorIntOption(112,"tabIndex",0,-1,1073741824)),unicodeHighlight:register$1(new UnicodeHighlight),unusualLineTerminators:register$1(new EditorStringEnumOption(114,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[localize("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),localize("unusualLineTerminators.off","Unusual line terminators are ignored."),localize("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:localize("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:register$1(new EditorBooleanOption(115,"useShadowDOM",!0)),useTabStops:register$1(new EditorBooleanOption(116,"useTabStops",!0,{description:localize("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordSeparators:register$1(new EditorStringOption(117,"wordSeparators",USUAL_WORD_SEPARATORS,{description:localize("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:register$1(new EditorStringEnumOption(118,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[localize("wordWrap.off","Lines will never wrap."),localize("wordWrap.on","Lines will wrap at the viewport width."),localize({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),localize({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:localize({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:register$1(new EditorStringOption(119,"wordWrapBreakAfterCharacters"," \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:register$1(new EditorStringOption(120,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:register$1(new EditorIntOption(121,"wordWrapColumn",80,1,1073741824,{markdownDescription:localize({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:register$1(new EditorStringEnumOption(122,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:register$1(new EditorStringEnumOption(123,"wordWrapOverride2","inherit",["off","on","inherit"])),wrappingIndent:register$1(new EditorEnumOption(124,"wrappingIndent",1,"same",["none","same","indent","deepIndent"],_wrappingIndentFromString,{enumDescriptions:[localize("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),localize("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),localize("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),localize("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:localize("wrappingIndent","Controls the indentation of wrapped lines.")})),wrappingStrategy:register$1(new EditorStringEnumOption(125,"wrappingStrategy","simple",["simple","advanced"],{enumDescriptions:[localize("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),localize("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],description:localize("wrappingStrategy","Controls the algorithm that computes wrapping points.")})),editorClassName:register$1(new EditorClassName),pixelRatio:register$1(new EditorPixelRatio),tabFocusMode:register$1(new EditorTabFocusMode),layoutInfo:register$1(new EditorLayoutInfoComputer),wrappingInfo:register$1(new EditorWrappingInfoComputer)};function applyFontInfo(e,t){e instanceof FastDomNode?(e.setFontFamily(t.getMassagedFontFamily(isSafari?EDITOR_FONT_DEFAULTS.fontFamily:null)),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)):(e.style.fontFamily=t.getMassagedFontFamily(isSafari?EDITOR_FONT_DEFAULTS.fontFamily:null),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px")}class CharWidthRequest{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class DomCharWidthReader{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");applyFontInfo(t,this._bareFontInfo),e.appendChild(t);const n=document.createElement("div");applyFontInfo(n,this._bareFontInfo),n.style.fontWeight="bold",e.appendChild(n);const i=document.createElement("div");applyFontInfo(i,this._bareFontInfo),i.style.fontStyle="italic",e.appendChild(i);const o=[];for(const r of this._requests){let e;0===r.type&&(e=t),2===r.type&&(e=n),1===r.type&&(e=i),e.appendChild(document.createElement("br"));const s=document.createElement("span");DomCharWidthReader._render(s,r),e.appendChild(s),o.push(s)}this._container=e,this._testElements=o}static _render(e,t){if(" "===t.chr){let t=" ";for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let n=t.chr;for(let e=0;e<8;e++)n+=n;e.textContent=n}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){const t=this._requests[e],n=this._testElements[e];t.fulfill(n.offsetWidth/256)}}}function readCharWidths(e,t){new DomCharWidthReader(e,t).read()}const EditorZoom=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new Emitter$1,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(e){e=Math.min(Math.max(-5,e),20),this._zoomLevel!==e&&(this._zoomLevel=e,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},GOLDEN_LINE_HEIGHT_RATIO=isMacintosh?1.5:1.35,MINIMUM_LINE_HEIGHT=8;class BareFontInfo{constructor(e){this._bareFontInfoBrand=void 0,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.lineHeight=0|e.lineHeight,this.letterSpacing=e.letterSpacing}static createFromValidatedSettings(e,t,n){const i=e.get(43),o=e.get(47),r=e.get(46),s=e.get(45),a=e.get(59),l=e.get(56);return BareFontInfo._create(i,o,r,s,a,l,t,n)}static _create(e,t,n,i,o,r,s,a){0===o?o=GOLDEN_LINE_HEIGHT_RATIO*n:o<MINIMUM_LINE_HEIGHT&&(o*=n),(o=Math.round(o))<MINIMUM_LINE_HEIGHT&&(o=MINIMUM_LINE_HEIGHT);const l=1+(a?0:.1*EditorZoom.getZoomLevel());return new BareFontInfo({pixelRatio:s,fontFamily:e,fontWeight:t,fontSize:n*=l,fontFeatureSettings:i,lineHeight:o*=l,letterSpacing:r})}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(e){const t=BareFontInfo._wrapInQuotes(this.fontFamily);return e&&this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}const SERIALIZED_FONT_INFO_VERSION=1;class FontInfo extends BareFontInfo{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=SERIALIZED_FONT_INFO_VERSION,this.isTrusted=t,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWidth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}}class FontMeasurementsImpl extends Disposable{constructor(){super(),this._onDidChange=this._register(new Emitter$1),this.onDidChange=this._onDidChange.event,this._cache=new FontMeasurementsCache,this._evictUntrustedReadingsTimeout=-1}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(window.clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache=new FontMeasurementsCache,this._onDidChange.fire()}_writeToCache(e,t){this._cache.put(e,t),t.isTrusted||-1!==this._evictUntrustedReadingsTimeout||(this._evictUntrustedReadingsTimeout=window.setTimeout((()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()}),5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const n of e)n.isTrusted||(t=!0,this._cache.remove(n));t&&this._onDidChange.fire()}readFontInfo(e){if(!this._cache.has(e)){let t=this._actualReadFontInfo(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new FontInfo({pixelRatio:PixelRatio.value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}_createRequest(e,t,n,i){const o=new CharWidthRequest(e,t);return n.push(o),i&&i.push(o),o}_actualReadFontInfo(e){const t=[],n=[],i=this._createRequest("n",0,t,n),o=this._createRequest("m",0,t,null),r=this._createRequest(" ",0,t,n),s=this._createRequest("0",0,t,n),a=this._createRequest("1",0,t,n),l=this._createRequest("2",0,t,n),c=this._createRequest("3",0,t,n),d=this._createRequest("4",0,t,n),u=this._createRequest("5",0,t,n),h=this._createRequest("6",0,t,n),g=this._createRequest("7",0,t,n),p=this._createRequest("8",0,t,n),f=this._createRequest("9",0,t,n),m=this._createRequest("→",0,t,n),v=this._createRequest("→",0,t,null),_=this._createRequest("·",0,t,n),C=this._createRequest(String.fromCharCode(11825),0,t,null),b="|/-_ilm%";for(let x=0,T=b.length;x<T;x++)this._createRequest(b.charAt(x),0,t,n),this._createRequest(b.charAt(x),1,t,n),this._createRequest(b.charAt(x),2,t,n);readCharWidths(e,t);const y=Math.max(s.width,a.width,l.width,c.width,d.width,u.width,h.width,g.width,p.width,f.width);let S=e.fontFeatureSettings===EditorFontLigatures.OFF;const w=n[0].width;for(let x=1,T=n.length;S&&x<T;x++){const e=w-n[x].width;if(e<-.001||e>.001){S=!1;break}}let E=!0;return S&&v.width!==w&&(E=!1),v.width>m.width&&(E=!1),new FontInfo({pixelRatio:PixelRatio.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:S,typicalHalfwidthCharacterWidth:i.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:E,spaceWidth:r.width,middotWidth:_.width,wsmiddotWidth:C.width,maxDigitWidth:y},!0)}}class FontMeasurementsCache{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const n=e.getId();this._keys[n]=e,this._values[n]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map((e=>this._values[e]))}}const FontMeasurements=new FontMeasurementsImpl,hasOwnProperty$2=Object.prototype.hasOwnProperty;function forEach(e,t){for(let n in e)if(hasOwnProperty$2.call(e,n)){if(!1===t({key:n,value:e[n]},(function(){delete e[n]})))return}}class SetMap{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){const n=this.map.get(e);n&&(n.delete(t),0===n.size&&this.map.delete(e))}forEach(e,t){const n=this.map.get(e);n&&n.forEach(t)}}function migrateOptions(e){const t=e.wordWrap;!0===t?e.wordWrap="on":!1===t&&(e.wordWrap="off");const n=e.lineNumbers;!0===n?e.lineNumbers="on":!1===n&&(e.lineNumbers="off");!1===e.autoClosingBrackets&&(e.autoClosingBrackets="never",e.autoClosingQuotes="never",e.autoSurround="never");"visible"===e.cursorBlinking&&(e.cursorBlinking="solid");const i=e.renderWhitespace;!0===i?e.renderWhitespace="boundary":!1===i&&(e.renderWhitespace="none");const o=e.renderLineHighlight;!0===o?e.renderLineHighlight="line":!1===o&&(e.renderLineHighlight="none");const r=e.acceptSuggestionOnEnter;!0===r?e.acceptSuggestionOnEnter="on":!1===r&&(e.acceptSuggestionOnEnter="off");const s=e.tabCompletion;!1===s?e.tabCompletion="off":!0===s&&(e.tabCompletion="onlySnippets");const a=e.suggest;if(a&&"object"==typeof a.filteredTypes&&a.filteredTypes){const e={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};forEach(e,(e=>{const t=a.filteredTypes[e.key];!1===t&&(a[e.value]=t)}))}const l=e.hover;!0===l?e.hover={enabled:!0}:!1===l&&(e.hover={enabled:!1});const c=e.parameterHints;!0===c?e.parameterHints={enabled:!0}:!1===c&&(e.parameterHints={enabled:!1});const d=e.autoIndent;!0===d?e.autoIndent="full":!1===d&&(e.autoIndent="advanced");const u=e.matchBrackets;!0===u?e.matchBrackets="always":!1===u&&(e.matchBrackets="never");const{renderIndentGuides:h,highlightActiveIndentGuide:g}=e;e.guides||(e.guides={}),void 0!==h&&(e.guides.indentation=!!h),void 0!==g&&(e.guides.highlightActiveIndentation=!!g)}class TabFocusImpl{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new Emitter$1,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus!==e&&(this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus))}}const TabFocus=new TabFocusImpl,IAccessibilityService=createDecorator("accessibilityService"),CONTEXT_ACCESSIBILITY_MODE_ENABLED=new RawContextKey("accessibilityModeEnabled",!1);var __decorate$1y=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1s=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let EditorConfiguration=class extends Disposable{constructor(e,t,n,i){super(),this._accessibilityService=i,this._onDidChange=this._register(new Emitter$1),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new Emitter$1),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._computeOptionsMemory=new ComputeOptionsMemory,this.isSimpleWidget=e,this._containerObserver=this._register(new ElementSizeObserver(n,t.dimension)),this._rawOptions=deepCloneAndMigrateOptions(t),this._validatedOptions=EditorOptionsUtil.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(10)&&this._containerObserver.startObserving(),this._register(EditorZoom.onDidChangeZoomLevel((()=>this._recomputeOptions()))),this._register(TabFocus.onDidChangeTabFocus((()=>this._recomputeOptions()))),this._register(this._containerObserver.onDidChange((()=>this._recomputeOptions()))),this._register(FontMeasurements.onDidChange((()=>this._recomputeOptions()))),this._register(PixelRatio.onDidChange((()=>this._recomputeOptions()))),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized((()=>this._recomputeOptions())))}_recomputeOptions(){const e=this._computeOptions(),t=EditorOptionsUtil.checkEquals(this.options,e);null!==t&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=BareFontInfo.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),n=this._readFontInfo(t),i={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:n,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:TabFocus.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport};return EditorOptionsUtil.computeOptions(this._validatedOptions,i)}_readEnvConfiguration(){return{extraEditorClassName:getExtraEditorClassName(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:isWebKit||isFirefox,pixelRatio:PixelRatio.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return FontMeasurements.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=deepCloneAndMigrateOptions(e);EditorOptionsUtil.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=EditorOptionsUtil.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=digitCount(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}};function digitCount(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}function getExtraEditorClassName(){let e="";return isSafari||isWebkitWebView||(e+="no-user-select "),isSafari&&(e+="no-minimap-shadow "),isMacintosh&&(e+="mac "),e}EditorConfiguration=__decorate$1y([__param$1s(3,IAccessibilityService)],EditorConfiguration);class ValidatedEditorOptions{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class ComputedEditorOptions{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class EditorOptionsUtil{static validateOptions(e){const t=new ValidatedEditorOptions;for(const n of editorOptionsRegistry){const i="_never_"===n.name?void 0:e[n.name];t._write(n.id,n.validate(i))}return t}static computeOptions(e,t){const n=new ComputedEditorOptions;for(const i of editorOptionsRegistry)n._write(i.id,i.compute(t,n,e._read(i.id)));return n}static _deepEquals(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return!(!Array.isArray(e)||!Array.isArray(t))&&equals$1(e,t);if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!EditorOptionsUtil._deepEquals(e[n],t[n]))return!1;return!0}static checkEquals(e,t){const n=[];let i=!1;for(const o of editorOptionsRegistry){const r=!EditorOptionsUtil._deepEquals(e._read(o.id),t._read(o.id));n[o.id]=r,r&&(i=!0)}return i?new ConfigurationChangedEvent(n):null}static applyUpdate(e,t){let n=!1;for(const i of editorOptionsRegistry)if(t.hasOwnProperty(i.name)){const o=i.applyUpdate(e[i.name],t[i.name]);e[i.name]=o.newValue,n=n||o.didChange}return n}}function deepCloneAndMigrateOptions(e){const t=deepClone(e);return migrateOptions(t),t}function memoize(e,t,n){let i=null,o=null;if("function"==typeof n.value?(i="value",o=n.value,o.length):"function"==typeof n.get&&(i="get",o=n.get),!o)throw new Error("not supported");const r=`$memoize$${t}`;n[i]=function(...e){return this.hasOwnProperty(r)||Object.defineProperty(this,r,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,e)}),this[r]}}var __decorate$1x=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},EventType,EventType2,Color2,Format;EventType2=EventType||(EventType={}),EventType2.Tap="-monaco-gesturetap",EventType2.Change="-monaco-gesturechange",EventType2.Start="-monaco-gesturestart",EventType2.End="-monaco-gesturesend",EventType2.Contextmenu="-monaco-gesturecontextmenu";class Gesture extends Disposable{constructor(){super(),this.dispatched=!1,this.activeTouches={},this.handle=null,this.targets=[],this.ignoreTargets=[],this._lastSetTapCountTime=0,this._register(addDisposableListener(document,"touchstart",(e=>this.onTouchStart(e)),{passive:!1})),this._register(addDisposableListener(document,"touchend",(e=>this.onTouchEnd(e)))),this._register(addDisposableListener(document,"touchmove",(e=>this.onTouchMove(e)),{passive:!1}))}static addTarget(e){return Gesture.isTouchDevice()?(Gesture.INSTANCE||(Gesture.INSTANCE=new Gesture),Gesture.INSTANCE.targets.push(e),{dispose:()=>{Gesture.INSTANCE.targets=Gesture.INSTANCE.targets.filter((t=>t!==e))}}):Disposable.None}static ignoreTarget(e){return Gesture.isTouchDevice()?(Gesture.INSTANCE||(Gesture.INSTANCE=new Gesture),Gesture.INSTANCE.ignoreTargets.push(e),{dispose:()=>{Gesture.INSTANCE.ignoreTargets=Gesture.INSTANCE.ignoreTargets.filter((t=>t!==e))}}):Disposable.None}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,i=e.targetTouches.length;n<i;n++){let i=e.targetTouches.item(n);this.activeTouches[i.identifier]={id:i.identifier,initialTarget:i.target,initialTimeStamp:t,initialPageX:i.pageX,initialPageY:i.pageY,rollingTimestamps:[t],rollingPageX:[i.pageX],rollingPageY:[i.pageY]};let o=this.newGestureEvent(EventType.Start,i.target);o.pageX=i.pageX,o.pageY=i.pageY,this.dispatchEvent(o)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e){let t=Date.now(),n=Object.keys(this.activeTouches).length;for(let i=0,o=e.changedTouches.length;i<o;i++){let o=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(o.identifier)))continue;let r=this.activeTouches[o.identifier],s=Date.now()-r.initialTimeStamp;if(s<Gesture.HOLD_DELAY&&Math.abs(r.initialPageX-tail(r.rollingPageX))<30&&Math.abs(r.initialPageY-tail(r.rollingPageY))<30){let e=this.newGestureEvent(EventType.Tap,r.initialTarget);e.pageX=tail(r.rollingPageX),e.pageY=tail(r.rollingPageY),this.dispatchEvent(e)}else if(s>=Gesture.HOLD_DELAY&&Math.abs(r.initialPageX-tail(r.rollingPageX))<30&&Math.abs(r.initialPageY-tail(r.rollingPageY))<30){let e=this.newGestureEvent(EventType.Contextmenu,r.initialTarget);e.pageX=tail(r.rollingPageX),e.pageY=tail(r.rollingPageY),this.dispatchEvent(e)}else if(1===n){let e=tail(r.rollingPageX),n=tail(r.rollingPageY),i=tail(r.rollingTimestamps)-r.rollingTimestamps[0],o=e-r.rollingPageX[0],s=n-r.rollingPageY[0];const a=this.targets.filter((e=>r.initialTarget instanceof Node&&e.contains(r.initialTarget)));this.inertia(a,t,Math.abs(o)/i,o>0?1:-1,e,Math.abs(s)/i,s>0?1:-1,n)}this.dispatchEvent(this.newGestureEvent(EventType.End,r.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){let n=document.createEvent("CustomEvent");return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(e){if(e.type===EventType.Tap){const t=(new Date).getTime();let n=0;n=t-this._lastSetTapCountTime>Gesture.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=t,e.tapCount=n}else e.type!==EventType.Change&&e.type!==EventType.Contextmenu||(this._lastSetTapCountTime=0);for(let t=0;t<this.ignoreTargets.length;t++)if(e.initialTarget instanceof Node&&this.ignoreTargets[t].contains(e.initialTarget))return;this.targets.forEach((t=>{e.initialTarget instanceof Node&&t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}))}inertia(e,t,n,i,o,r,s,a){this.handle=scheduleAtNextAnimationFrame((()=>{let l=Date.now(),c=l-t,d=0,u=0,h=!0;n+=Gesture.SCROLL_FRICTION*c,r+=Gesture.SCROLL_FRICTION*c,n>0&&(h=!1,d=i*n*c),r>0&&(h=!1,u=s*r*c);let g=this.newGestureEvent(EventType.Change);g.translationX=d,g.translationY=u,e.forEach((e=>e.dispatchEvent(g))),h||this.inertia(e,l,n,i,o+d,r,s,a+u)}))}onTouchMove(e){let t=Date.now();for(let n=0,i=e.changedTouches.length;n<i;n++){let i=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(i.identifier)))continue;let o=this.activeTouches[i.identifier],r=this.newGestureEvent(EventType.Change,o.initialTarget);r.translationX=i.pageX-tail(o.rollingPageX),r.translationY=i.pageY-tail(o.rollingPageY),r.pageX=i.pageX,r.pageY=i.pageY,this.dispatchEvent(r),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(i.pageX),o.rollingPageY.push(i.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}function standardMouseMoveMerger(e,t){let n=new StandardMouseEvent(t);return n.preventDefault(),{leftButton:n.leftButton,buttons:n.buttons,posx:n.posx,posy:n.posy}}Gesture.SCROLL_FRICTION=-.005,Gesture.HOLD_DELAY=700,Gesture.CLEAR_TAP_COUNT_TIME=400,__decorate$1x([memoize],Gesture,"isTouchDevice",null);class GlobalMouseMoveMonitor{constructor(){this._hooks=new DisposableStore,this._mouseMoveEventMerger=null,this._mouseMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._mouseMoveEventMerger=null,this._mouseMoveCallback=null;const n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._mouseMoveEventMerger}startMonitoring(e,t,n,i,o){if(this.isMonitoring())return;this._mouseMoveEventMerger=n,this._mouseMoveCallback=i,this._onStopCallback=o;const r=IframeUtils.getSameOriginWindowChain(),s=isIOS?"pointermove":"mousemove",a=r.map((e=>e.window.document)),l=getShadowRoot(e);l&&a.unshift(l);for(const c of a)this._hooks.add(addDisposableThrottledListener(c,s,(e=>{e.buttons===t?this._mouseMoveCallback(e):this.stopMonitoring(!0)}),((e,t)=>this._mouseMoveEventMerger(e,t)))),this._hooks.add(addDisposableListener(c,"mouseup",(e=>this.stopMonitoring(!0))));if(IframeUtils.hasDifferentOriginAncestor()){let e=r[r.length-1];this._hooks.add(addDisposableListener(e.window.document,"mouseout",(e=>{"html"===new StandardMouseEvent(e).target.tagName.toLowerCase()&&this.stopMonitoring(!0)}))),this._hooks.add(addDisposableListener(e.window.document,"mouseover",(e=>{"html"===new StandardMouseEvent(e).target.tagName.toLowerCase()&&this.stopMonitoring(!0)}))),this._hooks.add(addDisposableListener(e.window.document.body,"mouseleave",(e=>{this.stopMonitoring(!0)})))}}}function roundFloat(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}class RGBA{constructor(e,t,n,i=1){this._rgbaBrand=void 0,this.r=0|Math.min(255,Math.max(0,e)),this.g=0|Math.min(255,Math.max(0,t)),this.b=0|Math.min(255,Math.max(0,n)),this.a=roundFloat(Math.max(Math.min(1,i),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class HSLA{constructor(e,t,n,i){this._hslaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=roundFloat(Math.max(Math.min(1,t),0),3),this.l=roundFloat(Math.max(Math.min(1,n),0),3),this.a=roundFloat(Math.max(Math.min(1,i),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,n=e.g/255,i=e.b/255,o=e.a,r=Math.max(t,n,i),s=Math.min(t,n,i);let a=0,l=0;const c=(s+r)/2,d=r-s;if(d>0){switch(l=Math.min(c<=.5?d/(2*c):d/(2-2*c),1),r){case t:a=(n-i)/d+(n<i?6:0);break;case n:a=(i-t)/d+2;break;case i:a=(t-n)/d+4}a*=60,a=Math.round(a)}return new HSLA(a,l,c,o)}static _hue2rgb(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}static toRGBA(e){const t=e.h/360,{s:n,l:i,a:o}=e;let r,s,a;if(0===n)r=s=a=i;else{const e=i<.5?i*(1+n):i+n-i*n,o=2*i-e;r=HSLA._hue2rgb(o,e,t+1/3),s=HSLA._hue2rgb(o,e,t),a=HSLA._hue2rgb(o,e,t-1/3)}return new RGBA(Math.round(255*r),Math.round(255*s),Math.round(255*a),o)}}class HSVA{constructor(e,t,n,i){this._hsvaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=roundFloat(Math.max(Math.min(1,t),0),3),this.v=roundFloat(Math.max(Math.min(1,n),0),3),this.a=roundFloat(Math.max(Math.min(1,i),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,n=e.g/255,i=e.b/255,o=Math.max(t,n,i),r=o-Math.min(t,n,i),s=0===o?0:r/o;let a;return a=0===r?0:o===t?((n-i)/r%6+6)%6:o===n?(i-t)/r+2:(t-n)/r+4,new HSVA(Math.round(60*a),s,o,e.a)}static toRGBA(e){const{h:t,s:n,v:i,a:o}=e,r=i*n,s=r*(1-Math.abs(t/60%2-1)),a=i-r;let[l,c,d]=[0,0,0];return t<60?(l=r,c=s):t<120?(l=s,c=r):t<180?(c=r,d=s):t<240?(c=s,d=r):t<300?(l=s,d=r):t<=360&&(l=r,d=s),l=Math.round(255*(l+a)),c=Math.round(255*(c+a)),d=Math.round(255*(d+a)),new RGBA(l,c,d,o)}}class Color{constructor(e){if(!e)throw new Error("Color needs a value");if(e instanceof RGBA)this.rgba=e;else if(e instanceof HSLA)this._hsla=e,this.rgba=HSLA.toRGBA(e);else{if(!(e instanceof HSVA))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=HSVA.toRGBA(e)}}static fromHex(e){return Color.Format.CSS.parseHex(e)||Color.red}get hsla(){return this._hsla?this._hsla:HSLA.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:HSVA.fromRGBA(this.rgba)}equals(e){return!!e&&RGBA.equals(this.rgba,e.rgba)&&HSLA.equals(this.hsla,e.hsla)&&HSVA.equals(this.hsva,e.hsva)}getRelativeLuminance(){return roundFloat(.2126*Color._relativeLuminanceForComponent(this.rgba.r)+.7152*Color._relativeLuminanceForComponent(this.rgba.g)+.0722*Color._relativeLuminanceForComponent(this.rgba.b),4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3>=128}isLighterThan(e){return this.getRelativeLuminance()>e.getRelativeLuminance()}isDarkerThan(e){return this.getRelativeLuminance()<e.getRelativeLuminance()}lighten(e){return new Color(new HSLA(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new Color(new HSLA(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*e,this.hsla.a))}transparent(e){const{r:t,g:n,b:i,a:o}=this.rgba;return new Color(new RGBA(t,n,i,o*e))}isTransparent(){return 0===this.rgba.a}isOpaque(){return 1===this.rgba.a}opposite(){return new Color(new RGBA(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}toString(){return this._toString||(this._toString=Color.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,n){if(e.isLighterThan(t))return e;n=n||.5;const i=e.getRelativeLuminance(),o=t.getRelativeLuminance();return n=n*(o-i)/o,e.lighten(n)}static getDarkerColor(e,t,n){if(e.isDarkerThan(t))return e;n=n||.5;const i=e.getRelativeLuminance();return n=n*(i-t.getRelativeLuminance())/i,e.darken(n)}}Color.white=new Color(new RGBA(255,255,255,1)),Color.black=new Color(new RGBA(0,0,0,1)),Color.red=new Color(new RGBA(255,0,0,1)),Color.blue=new Color(new RGBA(0,0,255,1)),Color.green=new Color(new RGBA(0,255,0,1)),Color.cyan=new Color(new RGBA(0,255,255,1)),Color.lightgrey=new Color(new RGBA(211,211,211,1)),Color.transparent=new Color(new RGBA(0,0,0,0)),Color2=Color||(Color={}),function(e){function t(e){const t=e.toString(16);return 2!==t.length?"0"+t:t}function n(e){switch(e){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:case 65:return 10;case 98:case 66:return 11;case 99:case 67:return 12;case 100:case 68:return 13;case 101:case 69:return 14;case 102:case 70:return 15}return 0}e.formatRGB=function(e){return 1===e.rgba.a?`rgb(${e.rgba.r}, ${e.rgba.g}, ${e.rgba.b})`:Color2.Format.CSS.formatRGBA(e)},e.formatRGBA=function(e){return`rgba(${e.rgba.r}, ${e.rgba.g}, ${e.rgba.b}, ${+e.rgba.a.toFixed(2)})`},e.formatHSL=function(e){return 1===e.hsla.a?`hsl(${e.hsla.h}, ${(100*e.hsla.s).toFixed(2)}%, ${(100*e.hsla.l).toFixed(2)}%)`:Color2.Format.CSS.formatHSLA(e)},e.formatHSLA=function(e){return`hsla(${e.hsla.h}, ${(100*e.hsla.s).toFixed(2)}%, ${(100*e.hsla.l).toFixed(2)}%, ${e.hsla.a.toFixed(2)})`},e.formatHex=function(e){return`#${t(e.rgba.r)}${t(e.rgba.g)}${t(e.rgba.b)}`},e.formatHexA=function(e,n=!1){return n&&1===e.rgba.a?Color2.Format.CSS.formatHex(e):`#${t(e.rgba.r)}${t(e.rgba.g)}${t(e.rgba.b)}${t(Math.round(255*e.rgba.a))}`},e.format=function(e){return e.isOpaque()?Color2.Format.CSS.formatHex(e):Color2.Format.CSS.formatRGBA(e)},e.parseHex=function(e){const t=e.length;if(0===t)return null;if(35!==e.charCodeAt(0))return null;if(7===t){const t=16*n(e.charCodeAt(1))+n(e.charCodeAt(2)),i=16*n(e.charCodeAt(3))+n(e.charCodeAt(4)),o=16*n(e.charCodeAt(5))+n(e.charCodeAt(6));return new Color2(new RGBA(t,i,o,1))}if(9===t){const t=16*n(e.charCodeAt(1))+n(e.charCodeAt(2)),i=16*n(e.charCodeAt(3))+n(e.charCodeAt(4)),o=16*n(e.charCodeAt(5))+n(e.charCodeAt(6)),r=16*n(e.charCodeAt(7))+n(e.charCodeAt(8));return new Color2(new RGBA(t,i,o,r/255))}if(4===t){const t=n(e.charCodeAt(1)),i=n(e.charCodeAt(2)),o=n(e.charCodeAt(3));return new Color2(new RGBA(16*t+t,16*i+i,16*o+o))}if(5===t){const t=n(e.charCodeAt(1)),i=n(e.charCodeAt(2)),o=n(e.charCodeAt(3)),r=n(e.charCodeAt(4));return new Color2(new RGBA(16*t+t,16*i+i,16*o+o,(16*r+r)/255))}return null}}((Format=Color2.Format||(Color2.Format={})).CSS||(Format.CSS={}));const Extensions$5={JSONContribution:"base.contributions.json"};function normalizeId(e){return e.length>0&&"#"===e.charAt(e.length-1)?e.substring(0,e.length-1):e}class JSONContributionRegistry{constructor(){this._onDidChangeSchema=new Emitter$1,this.schemasById={}}registerSchema(e,t){this.schemasById[normalizeId(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const jsonContributionRegistry=new JSONContributionRegistry;function asCssVariableName(e){return`--vscode-${e.replace(/\./g,"-")}`}Registry.add(Extensions$5.JSONContribution,jsonContributionRegistry);const Extensions$4={ColorContribution:"base.contributions.colors"};class ColorRegistry{constructor(){this._onDidChangeSchema=new Emitter$1,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,n,i=!1,o){let r={id:e,description:n,defaults:t,needsTransparency:i,deprecationMessage:o};this.colorsById[e]=r;let s={type:"string",description:n,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(s.deprecationMessage=o),this.colorSchema.properties[e]=s,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(n),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map((e=>this.colorsById[e]))}resolveDefaultColor(e,t){const n=this.colorsById[e];if(n&&n.defaults){return resolveColorValue(n.defaults[t.type],t)}}getColorSchema(){return this.colorSchema}toString(){return Object.keys(this.colorsById).sort(((e,t)=>{let n=-1===e.indexOf(".")?0:1,i=-1===t.indexOf(".")?0:1;return n!==i?n-i:e.localeCompare(t)})).map((e=>`- \`${e}\`: ${this.colorsById[e].description}`)).join("\n")}}const colorRegistry$1=new ColorRegistry;function registerColor(e,t,n,i,o){return colorRegistry$1.registerColor(e,t,n,i,o)}Registry.add(Extensions$4.ColorContribution,colorRegistry$1);const foreground=registerColor("foreground",{dark:"#CCCCCC",light:"#616161",hc:"#FFFFFF"},localize("foreground","Overall foreground color. This color is only used if not overridden by a component.")),errorForeground=registerColor("errorForeground",{dark:"#F48771",light:"#A1260D",hc:"#F48771"},localize("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));registerColor("descriptionForeground",{light:"#717171",dark:transparent(foreground,.7),hc:transparent(foreground,.7)},localize("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const iconForeground=registerColor("icon.foreground",{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},localize("iconForeground","The default color for icons in the workbench.")),focusBorder=registerColor("focusBorder",{dark:"#007FD4",light:"#0090F1",hc:"#F38518"},localize("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),contrastBorder=registerColor("contrastBorder",{light:null,dark:null,hc:"#6FC3DF"},localize("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),activeContrastBorder=registerColor("contrastActiveBorder",{light:null,dark:null,hc:focusBorder},localize("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));registerColor("selection.background",{light:null,dark:null,hc:null},localize("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.")),registerColor("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hc:Color.black},localize("textSeparatorForeground","Color for text separators."));const textLinkForeground=registerColor("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},localize("textLinkForeground","Foreground color for links in text.")),textLinkActiveForeground=registerColor("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},localize("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));registerColor("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hc:"#D7BA7D"},localize("textPreformatForeground","Foreground color for preformatted text segments.")),registerColor("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hc:null},localize("textBlockQuoteBackground","Background color for block quotes in text.")),registerColor("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hc:Color.white},localize("textBlockQuoteBorder","Border color for block quotes in text."));const textCodeBlockBackground=registerColor("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hc:Color.black},localize("textCodeBlockBackground","Background color for code blocks in text.")),widgetShadow=registerColor("widget.shadow",{dark:transparent(Color.black,.36),light:transparent(Color.black,.16),hc:null},localize("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),inputBackground=registerColor("input.background",{dark:"#3C3C3C",light:Color.white,hc:Color.black},localize("inputBoxBackground","Input box background.")),inputForeground=registerColor("input.foreground",{dark:foreground,light:foreground,hc:foreground},localize("inputBoxForeground","Input box foreground.")),inputBorder=registerColor("input.border",{dark:null,light:null,hc:contrastBorder},localize("inputBoxBorder","Input box border.")),inputActiveOptionBorder=registerColor("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hc:contrastBorder},localize("inputBoxActiveOptionBorder","Border color of activated options in input fields."));registerColor("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hc:null},localize("inputOption.hoverBackground","Background color of activated options in input fields."));const inputActiveOptionBackground=registerColor("inputOption.activeBackground",{dark:transparent(focusBorder,.4),light:transparent(focusBorder,.2),hc:Color.transparent},localize("inputOption.activeBackground","Background hover color of options in input fields.")),inputActiveOptionForeground=registerColor("inputOption.activeForeground",{dark:Color.white,light:Color.black,hc:null},localize("inputOption.activeForeground","Foreground color of activated options in input fields."));registerColor("input.placeholderForeground",{light:transparent(foreground,.5),dark:transparent(foreground,.5),hc:transparent(foreground,.7)},localize("inputPlaceholderForeground","Input box foreground color for placeholder text."));const inputValidationInfoBackground=registerColor("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hc:Color.black},localize("inputValidationInfoBackground","Input validation background color for information severity.")),inputValidationInfoForeground=registerColor("inputValidation.infoForeground",{dark:null,light:null,hc:null},localize("inputValidationInfoForeground","Input validation foreground color for information severity.")),inputValidationInfoBorder=registerColor("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hc:contrastBorder},localize("inputValidationInfoBorder","Input validation border color for information severity.")),inputValidationWarningBackground=registerColor("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hc:Color.black},localize("inputValidationWarningBackground","Input validation background color for warning severity.")),inputValidationWarningForeground=registerColor("inputValidation.warningForeground",{dark:null,light:null,hc:null},localize("inputValidationWarningForeground","Input validation foreground color for warning severity.")),inputValidationWarningBorder=registerColor("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hc:contrastBorder},localize("inputValidationWarningBorder","Input validation border color for warning severity.")),inputValidationErrorBackground=registerColor("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hc:Color.black},localize("inputValidationErrorBackground","Input validation background color for error severity.")),inputValidationErrorForeground=registerColor("inputValidation.errorForeground",{dark:null,light:null,hc:null},localize("inputValidationErrorForeground","Input validation foreground color for error severity.")),inputValidationErrorBorder=registerColor("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hc:contrastBorder},localize("inputValidationErrorBorder","Input validation border color for error severity.")),selectBackground=registerColor("dropdown.background",{dark:"#3C3C3C",light:Color.white,hc:Color.black},localize("dropdownBackground","Dropdown background."));registerColor("dropdown.listBackground",{dark:null,light:null,hc:Color.black},localize("dropdownListBackground","Dropdown list background."));const selectForeground=registerColor("dropdown.foreground",{dark:"#F0F0F0",light:null,hc:Color.white},localize("dropdownForeground","Dropdown foreground.")),selectBorder=registerColor("dropdown.border",{dark:selectBackground,light:"#CECECE",hc:contrastBorder},localize("dropdownBorder","Dropdown border."));registerColor("checkbox.background",{dark:selectBackground,light:selectBackground,hc:selectBackground},localize("checkbox.background","Background color of checkbox widget.")),registerColor("checkbox.foreground",{dark:selectForeground,light:selectForeground,hc:selectForeground},localize("checkbox.foreground","Foreground color of checkbox widget.")),registerColor("checkbox.border",{dark:selectBorder,light:selectBorder,hc:selectBorder},localize("checkbox.border","Border color of checkbox widget."));const buttonForeground=registerColor("button.foreground",{dark:Color.white,light:Color.white,hc:Color.white},localize("buttonForeground","Button foreground color.")),buttonBackground=registerColor("button.background",{dark:"#0E639C",light:"#007ACC",hc:null},localize("buttonBackground","Button background color.")),buttonHoverBackground=registerColor("button.hoverBackground",{dark:lighten(buttonBackground,.2),light:darken(buttonBackground,.2),hc:null},localize("buttonHoverBackground","Button background color when hovering."));registerColor("button.border",{dark:contrastBorder,light:contrastBorder,hc:contrastBorder},localize("buttonBorder","Button border color.")),registerColor("button.secondaryForeground",{dark:Color.white,light:Color.white,hc:Color.white},localize("buttonSecondaryForeground","Secondary button foreground color."));const buttonSecondaryBackground=registerColor("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hc:null},localize("buttonSecondaryBackground","Secondary button background color."));registerColor("button.secondaryHoverBackground",{dark:lighten(buttonSecondaryBackground,.2),light:darken(buttonSecondaryBackground,.2),hc:null},localize("buttonSecondaryHoverBackground","Secondary button background color when hovering."));const badgeBackground=registerColor("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hc:Color.black},localize("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),badgeForeground=registerColor("badge.foreground",{dark:Color.white,light:"#333",hc:Color.white},localize("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),scrollbarShadow=registerColor("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hc:null},localize("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),scrollbarSliderBackground=registerColor("scrollbarSlider.background",{dark:Color.fromHex("#797979").transparent(.4),light:Color.fromHex("#646464").transparent(.4),hc:transparent(contrastBorder,.6)},localize("scrollbarSliderBackground","Scrollbar slider background color.")),scrollbarSliderHoverBackground=registerColor("scrollbarSlider.hoverBackground",{dark:Color.fromHex("#646464").transparent(.7),light:Color.fromHex("#646464").transparent(.7),hc:transparent(contrastBorder,.8)},localize("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),scrollbarSliderActiveBackground=registerColor("scrollbarSlider.activeBackground",{dark:Color.fromHex("#BFBFBF").transparent(.4),light:Color.fromHex("#000000").transparent(.6),hc:contrastBorder},localize("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),progressBarBackground=registerColor("progressBar.background",{dark:Color.fromHex("#0E70C0"),light:Color.fromHex("#0E70C0"),hc:contrastBorder},localize("progressBarBackground","Background color of the progress bar that can show for long running operations.")),editorErrorBackground=registerColor("editorError.background",{dark:null,light:null,hc:null},localize("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),editorErrorForeground=registerColor("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hc:null},localize("editorError.foreground","Foreground color of error squigglies in the editor.")),editorErrorBorder=registerColor("editorError.border",{dark:null,light:null,hc:Color.fromHex("#E47777").transparent(.8)},localize("errorBorder","Border color of error boxes in the editor.")),editorWarningBackground=registerColor("editorWarning.background",{dark:null,light:null,hc:null},localize("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),editorWarningForeground=registerColor("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hc:null},localize("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),editorWarningBorder=registerColor("editorWarning.border",{dark:null,light:null,hc:Color.fromHex("#FFCC00").transparent(.8)},localize("warningBorder","Border color of warning boxes in the editor.")),editorInfoBackground=registerColor("editorInfo.background",{dark:null,light:null,hc:null},localize("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),editorInfoForeground=registerColor("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hc:"#3794FF"},localize("editorInfo.foreground","Foreground color of info squigglies in the editor.")),editorInfoBorder=registerColor("editorInfo.border",{dark:null,light:null,hc:Color.fromHex("#3794FF").transparent(.8)},localize("infoBorder","Border color of info boxes in the editor.")),editorHintForeground=registerColor("editorHint.foreground",{dark:Color.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hc:null},localize("editorHint.foreground","Foreground color of hint squigglies in the editor.")),editorHintBorder=registerColor("editorHint.border",{dark:null,light:null,hc:Color.fromHex("#eeeeee").transparent(.8)},localize("hintBorder","Border color of hint boxes in the editor."));registerColor("sash.hoverBorder",{dark:focusBorder,light:focusBorder,hc:focusBorder},localize("sashActiveBorder","Border color of active sashes."));const editorBackground=registerColor("editor.background",{light:"#fffffe",dark:"#1E1E1E",hc:Color.black},localize("editorBackground","Editor background color.")),editorForeground=registerColor("editor.foreground",{light:"#333333",dark:"#BBBBBB",hc:Color.white},localize("editorForeground","Editor default foreground color.")),editorWidgetBackground=registerColor("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hc:"#0C141F"},localize("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),editorWidgetForeground=registerColor("editorWidget.foreground",{dark:foreground,light:foreground,hc:foreground},localize("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),editorWidgetBorder=registerColor("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hc:contrastBorder},localize("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),editorWidgetResizeBorder=registerColor("editorWidget.resizeBorder",{light:null,dark:null,hc:null},localize("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),quickInputBackground=registerColor("quickInput.background",{dark:editorWidgetBackground,light:editorWidgetBackground,hc:editorWidgetBackground},localize("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),quickInputForeground=registerColor("quickInput.foreground",{dark:editorWidgetForeground,light:editorWidgetForeground,hc:editorWidgetForeground},localize("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),quickInputTitleBackground=registerColor("quickInputTitle.background",{dark:new Color(new RGBA(255,255,255,.105)),light:new Color(new RGBA(0,0,0,.06)),hc:"#000000"},localize("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),pickerGroupForeground=registerColor("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hc:Color.white},localize("pickerGroupForeground","Quick picker color for grouping labels.")),pickerGroupBorder=registerColor("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hc:Color.white},localize("pickerGroupBorder","Quick picker color for grouping borders.")),keybindingLabelBackground=registerColor("keybindingLabel.background",{dark:new Color(new RGBA(128,128,128,.17)),light:new Color(new RGBA(221,221,221,.4)),hc:Color.transparent},localize("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),keybindingLabelForeground=registerColor("keybindingLabel.foreground",{dark:Color.fromHex("#CCCCCC"),light:Color.fromHex("#555555"),hc:Color.white},localize("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),keybindingLabelBorder=registerColor("keybindingLabel.border",{dark:new Color(new RGBA(51,51,51,.6)),light:new Color(new RGBA(204,204,204,.4)),hc:new Color(new RGBA(111,195,223))},localize("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),keybindingLabelBottomBorder=registerColor("keybindingLabel.bottomBorder",{dark:new Color(new RGBA(68,68,68,.6)),light:new Color(new RGBA(187,187,187,.4)),hc:new Color(new RGBA(111,195,223))},localize("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),editorSelectionBackground=registerColor("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},localize("editorSelectionBackground","Color of the editor selection.")),editorSelectionForeground=registerColor("editor.selectionForeground",{light:null,dark:null,hc:"#000000"},localize("editorSelectionForeground","Color of the selected text for high contrast.")),editorInactiveSelection=registerColor("editor.inactiveSelectionBackground",{light:transparent(editorSelectionBackground,.5),dark:transparent(editorSelectionBackground,.5),hc:transparent(editorSelectionBackground,.5)},localize("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),editorSelectionHighlight=registerColor("editor.selectionHighlightBackground",{light:lessProminent(editorSelectionBackground,editorBackground,.3,.6),dark:lessProminent(editorSelectionBackground,editorBackground,.3,.6),hc:null},localize("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),editorSelectionHighlightBorder=registerColor("editor.selectionHighlightBorder",{light:null,dark:null,hc:activeContrastBorder},localize("editorSelectionHighlightBorder","Border color for regions with the same content as the selection.")),editorFindMatch=registerColor("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hc:null},localize("editorFindMatch","Color of the current search match.")),editorFindMatchHighlight=registerColor("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hc:null},localize("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),editorFindRangeHighlight=registerColor("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hc:null},localize("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),editorFindMatchBorder=registerColor("editor.findMatchBorder",{light:null,dark:null,hc:activeContrastBorder},localize("editorFindMatchBorder","Border color of the current search match.")),editorFindMatchHighlightBorder=registerColor("editor.findMatchHighlightBorder",{light:null,dark:null,hc:activeContrastBorder},localize("findMatchHighlightBorder","Border color of the other search matches.")),editorFindRangeHighlightBorder=registerColor("editor.findRangeHighlightBorder",{dark:null,light:null,hc:transparent(activeContrastBorder,.4)},localize("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("searchEditor.findMatchBackground",{light:transparent(editorFindMatchHighlight,.66),dark:transparent(editorFindMatchHighlight,.66),hc:editorFindMatchHighlight},localize("searchEditor.queryMatch","Color of the Search Editor query matches.")),registerColor("searchEditor.findMatchBorder",{light:transparent(editorFindMatchHighlightBorder,.66),dark:transparent(editorFindMatchHighlightBorder,.66),hc:editorFindMatchHighlightBorder},localize("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));const editorHoverHighlight=registerColor("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hc:"#ADD6FF26"},localize("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),editorHoverBackground=registerColor("editorHoverWidget.background",{light:editorWidgetBackground,dark:editorWidgetBackground,hc:editorWidgetBackground},localize("hoverBackground","Background color of the editor hover.")),editorHoverForeground=registerColor("editorHoverWidget.foreground",{light:editorWidgetForeground,dark:editorWidgetForeground,hc:editorWidgetForeground},localize("hoverForeground","Foreground color of the editor hover.")),editorHoverBorder=registerColor("editorHoverWidget.border",{light:editorWidgetBorder,dark:editorWidgetBorder,hc:editorWidgetBorder},localize("hoverBorder","Border color of the editor hover.")),editorHoverStatusBarBackground=registerColor("editorHoverWidget.statusBarBackground",{dark:lighten(editorHoverBackground,.2),light:darken(editorHoverBackground,.05),hc:editorWidgetBackground},localize("statusBarBackground","Background color of the editor hover status bar.")),editorActiveLinkForeground=registerColor("editorLink.activeForeground",{dark:"#4E94CE",light:Color.blue,hc:Color.cyan},localize("activeLinkForeground","Color of active links.")),editorInlayHintForeground=registerColor("editorInlayHint.foreground",{dark:transparent(badgeForeground,.8),light:transparent(badgeForeground,.8),hc:badgeForeground},localize("editorInlayHintForeground","Foreground color of inline hints")),editorInlayHintBackground=registerColor("editorInlayHint.background",{dark:transparent(badgeBackground,.6),light:transparent(badgeBackground,.3),hc:badgeBackground},localize("editorInlayHintBackground","Background color of inline hints")),editorInlayHintTypeForeground=registerColor("editorInlayHint.typeForeground",{dark:editorInlayHintForeground,light:editorInlayHintForeground,hc:editorInlayHintForeground},localize("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),editorInlayHintTypeBackground=registerColor("editorInlayHint.typeBackground",{dark:editorInlayHintBackground,light:editorInlayHintBackground,hc:editorInlayHintBackground},localize("editorInlayHintBackgroundTypes","Background color of inline hints for types")),editorInlayHintParameterForeground=registerColor("editorInlayHint.parameterForeground",{dark:editorInlayHintForeground,light:editorInlayHintForeground,hc:editorInlayHintForeground},localize("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),editorInlayHintParameterBackground=registerColor("editorInlayHint.parameterBackground",{dark:editorInlayHintBackground,light:editorInlayHintBackground,hc:editorInlayHintBackground},localize("editorInlayHintBackgroundParameter","Background color of inline hints for parameters")),editorLightBulbForeground=registerColor("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hc:"#FFCC00"},localize("editorLightBulbForeground","The color used for the lightbulb actions icon.")),editorLightBulbAutoFixForeground=registerColor("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},localize("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon.")),defaultInsertColor=new Color(new RGBA(155,185,85,.2)),defaultRemoveColor=new Color(new RGBA(255,0,0,.2)),diffInserted=registerColor("diffEditor.insertedTextBackground",{dark:defaultInsertColor,light:defaultInsertColor,hc:null},localize("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),diffRemoved=registerColor("diffEditor.removedTextBackground",{dark:defaultRemoveColor,light:defaultRemoveColor,hc:null},localize("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),diffInsertedLine=registerColor("diffEditor.insertedLineBackground",{dark:null,light:null,hc:null},localize("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),diffRemovedLine=registerColor("diffEditor.removedLineBackground",{dark:null,light:null,hc:null},localize("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),diffInsertedLineGutter=registerColor("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hc:null},localize("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted.")),diffRemovedLineGutter=registerColor("diffEditorGutter.removedLineBackground",{dark:null,light:null,hc:null},localize("diffEditorRemovedLineGutter","Background color for the margin where lines got removed.")),diffOverviewRulerInserted=registerColor("diffEditorOverview.insertedForeground",{dark:null,light:null,hc:null},localize("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),diffOverviewRulerRemoved=registerColor("diffEditorOverview.removedForeground",{dark:null,light:null,hc:null},localize("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content.")),diffInsertedOutline=registerColor("diffEditor.insertedTextBorder",{dark:null,light:null,hc:"#33ff2eff"},localize("diffEditorInsertedOutline","Outline color for the text that got inserted.")),diffRemovedOutline=registerColor("diffEditor.removedTextBorder",{dark:null,light:null,hc:"#FF008F"},localize("diffEditorRemovedOutline","Outline color for text that got removed.")),diffBorder=registerColor("diffEditor.border",{dark:null,light:null,hc:contrastBorder},localize("diffEditorBorder","Border color between the two text editors.")),diffDiagonalFill=registerColor("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hc:null},localize("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),listFocusBackground=registerColor("list.focusBackground",{dark:null,light:null,hc:null},localize("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),listFocusForeground=registerColor("list.focusForeground",{dark:null,light:null,hc:null},localize("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),listFocusOutline=registerColor("list.focusOutline",{dark:focusBorder,light:focusBorder,hc:activeContrastBorder},localize("listFocusOutline","List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),listActiveSelectionBackground=registerColor("list.activeSelectionBackground",{dark:"#094771",light:"#0060C0",hc:null},localize("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),listActiveSelectionForeground=registerColor("list.activeSelectionForeground",{dark:Color.white,light:Color.white,hc:null},localize("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),listActiveSelectionIconForeground=registerColor("list.activeSelectionIconForeground",{dark:null,light:null,hc:null},localize("listActiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),listInactiveSelectionBackground=registerColor("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hc:null},localize("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),listInactiveSelectionForeground=registerColor("list.inactiveSelectionForeground",{dark:null,light:null,hc:null},localize("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),listInactiveSelectionIconForeground=registerColor("list.inactiveSelectionIconForeground",{dark:null,light:null,hc:null},localize("listInactiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),listInactiveFocusBackground=registerColor("list.inactiveFocusBackground",{dark:null,light:null,hc:null},localize("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),listInactiveFocusOutline=registerColor("list.inactiveFocusOutline",{dark:null,light:null,hc:null},localize("listInactiveFocusOutline","List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),listHoverBackground=registerColor("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hc:null},localize("listHoverBackground","List/Tree background when hovering over items using the mouse.")),listHoverForeground=registerColor("list.hoverForeground",{dark:null,light:null,hc:null},localize("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),listDropBackground=registerColor("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hc:null},localize("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),listHighlightForeground=registerColor("list.highlightForeground",{dark:"#18A3FF",light:"#0066BF",hc:focusBorder},localize("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),listFocusHighlightForeground=registerColor("list.focusHighlightForeground",{dark:listHighlightForeground,light:ifDefinedThenElse(listActiveSelectionBackground,listHighlightForeground,"#9DDDFF"),hc:listHighlightForeground},localize("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));registerColor("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hc:"#B89500"},localize("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),registerColor("list.errorForeground",{dark:"#F88070",light:"#B01011",hc:null},localize("listErrorForeground","Foreground color of list items containing errors.")),registerColor("list.warningForeground",{dark:"#CCA700",light:"#855F00",hc:null},localize("listWarningForeground","Foreground color of list items containing warnings."));const listFilterWidgetBackground=registerColor("listFilterWidget.background",{light:"#efc1ad",dark:"#653723",hc:Color.black},localize("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),listFilterWidgetOutline=registerColor("listFilterWidget.outline",{dark:Color.transparent,light:Color.transparent,hc:"#f38518"},localize("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),listFilterWidgetNoMatchesOutline=registerColor("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hc:contrastBorder},localize("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches."));registerColor("list.filterMatchBackground",{dark:editorFindMatchHighlight,light:editorFindMatchHighlight,hc:null},localize("listFilterMatchHighlight","Background color of the filtered match.")),registerColor("list.filterMatchBorder",{dark:editorFindMatchHighlightBorder,light:editorFindMatchHighlightBorder,hc:contrastBorder},localize("listFilterMatchHighlightBorder","Border color of the filtered match."));const treeIndentGuidesStroke=registerColor("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hc:"#a9a9a9"},localize("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),tableColumnsBorder=registerColor("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hc:null},localize("tableColumnsBorder","Table border color between columns.")),tableOddRowsBackgroundColor=registerColor("tree.tableOddRowsBackground",{dark:transparent(foreground,.04),light:transparent(foreground,.04),hc:null},localize("tableOddRowsBackgroundColor","Background color for odd table rows."));registerColor("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hc:"#A7A8A9"},localize("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const _deprecatedQuickInputListFocusBackground=registerColor("quickInput.list.focusBackground",{dark:null,light:null,hc:null},"",void 0,localize("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),quickInputListFocusForeground=registerColor("quickInputList.focusForeground",{dark:listActiveSelectionForeground,light:listActiveSelectionForeground,hc:listActiveSelectionForeground},localize("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),quickInputListFocusIconForeground=registerColor("quickInputList.focusIconForeground",{dark:listActiveSelectionIconForeground,light:listActiveSelectionIconForeground,hc:listActiveSelectionIconForeground},localize("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),quickInputListFocusBackground=registerColor("quickInputList.focusBackground",{dark:oneOf(_deprecatedQuickInputListFocusBackground,listActiveSelectionBackground),light:oneOf(_deprecatedQuickInputListFocusBackground,listActiveSelectionBackground),hc:null},localize("quickInput.listFocusBackground","Quick picker background color for the focused item.")),menuBorder=registerColor("menu.border",{dark:null,light:null,hc:contrastBorder},localize("menuBorder","Border color of menus.")),menuForeground=registerColor("menu.foreground",{dark:selectForeground,light:foreground,hc:selectForeground},localize("menuForeground","Foreground color of menu items.")),menuBackground=registerColor("menu.background",{dark:selectBackground,light:selectBackground,hc:selectBackground},localize("menuBackground","Background color of menu items.")),menuSelectionForeground=registerColor("menu.selectionForeground",{dark:listActiveSelectionForeground,light:listActiveSelectionForeground,hc:listActiveSelectionForeground},localize("menuSelectionForeground","Foreground color of the selected menu item in menus.")),menuSelectionBackground=registerColor("menu.selectionBackground",{dark:listActiveSelectionBackground,light:listActiveSelectionBackground,hc:listActiveSelectionBackground},localize("menuSelectionBackground","Background color of the selected menu item in menus.")),menuSelectionBorder=registerColor("menu.selectionBorder",{dark:null,light:null,hc:activeContrastBorder},localize("menuSelectionBorder","Border color of the selected menu item in menus.")),menuSeparatorBackground=registerColor("menu.separatorBackground",{dark:"#BBBBBB",light:"#888888",hc:contrastBorder},localize("menuSeparatorBackground","Color of a separator menu item in menus.")),toolbarHoverBackground=registerColor("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hc:null},localize("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));registerColor("toolbar.hoverOutline",{dark:null,light:null,hc:activeContrastBorder},localize("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse")),registerColor("toolbar.activeBackground",{dark:lighten(toolbarHoverBackground,.1),light:darken(toolbarHoverBackground,.1),hc:null},localize("toolbarActiveBackground","Toolbar background when holding the mouse over actions")),registerColor("editor.snippetTabstopHighlightBackground",{dark:new Color(new RGBA(124,124,124,.3)),light:new Color(new RGBA(10,50,100,.2)),hc:new Color(new RGBA(124,124,124,.3))},localize("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop.")),registerColor("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hc:null},localize("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop.")),registerColor("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hc:null},localize("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet.")),registerColor("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new Color(new RGBA(10,50,100,.5)),hc:"#525252"},localize("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet.")),registerColor("breadcrumb.foreground",{light:transparent(foreground,.8),dark:transparent(foreground,.8),hc:transparent(foreground,.8)},localize("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),registerColor("breadcrumb.background",{light:editorBackground,dark:editorBackground,hc:editorBackground},localize("breadcrumbsBackground","Background color of breadcrumb items.")),registerColor("breadcrumb.focusForeground",{light:darken(foreground,.2),dark:lighten(foreground,.1),hc:lighten(foreground,.1)},localize("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),registerColor("breadcrumb.activeSelectionForeground",{light:darken(foreground,.2),dark:lighten(foreground,.1),hc:lighten(foreground,.1)},localize("breadcrumbsSelectedForegound","Color of selected breadcrumb items.")),registerColor("breadcrumbPicker.background",{light:editorWidgetBackground,dark:editorWidgetBackground,hc:editorWidgetBackground},localize("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const headerTransparency=.5,currentBaseColor=Color.fromHex("#40C8AE").transparent(headerTransparency),incomingBaseColor=Color.fromHex("#40A6FF").transparent(headerTransparency),commonBaseColor=Color.fromHex("#606060").transparent(.4),contentTransparency=.4,rulerTransparency=1,mergeCurrentHeaderBackground=registerColor("merge.currentHeaderBackground",{dark:currentBaseColor,light:currentBaseColor,hc:null},localize("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("merge.currentContentBackground",{dark:transparent(mergeCurrentHeaderBackground,contentTransparency),light:transparent(mergeCurrentHeaderBackground,contentTransparency),hc:transparent(mergeCurrentHeaderBackground,contentTransparency)},localize("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const mergeIncomingHeaderBackground=registerColor("merge.incomingHeaderBackground",{dark:incomingBaseColor,light:incomingBaseColor,hc:null},localize("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("merge.incomingContentBackground",{dark:transparent(mergeIncomingHeaderBackground,contentTransparency),light:transparent(mergeIncomingHeaderBackground,contentTransparency),hc:transparent(mergeIncomingHeaderBackground,contentTransparency)},localize("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const mergeCommonHeaderBackground=registerColor("merge.commonHeaderBackground",{dark:commonBaseColor,light:commonBaseColor,hc:null},localize("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("merge.commonContentBackground",{dark:transparent(mergeCommonHeaderBackground,contentTransparency),light:transparent(mergeCommonHeaderBackground,contentTransparency),hc:transparent(mergeCommonHeaderBackground,contentTransparency)},localize("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const mergeBorder=registerColor("merge.border",{dark:null,light:null,hc:"#C3DF6F"},localize("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));registerColor("editorOverviewRuler.currentContentForeground",{dark:transparent(mergeCurrentHeaderBackground,rulerTransparency),light:transparent(mergeCurrentHeaderBackground,rulerTransparency),hc:mergeBorder},localize("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts.")),registerColor("editorOverviewRuler.incomingContentForeground",{dark:transparent(mergeIncomingHeaderBackground,rulerTransparency),light:transparent(mergeIncomingHeaderBackground,rulerTransparency),hc:mergeBorder},localize("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts.")),registerColor("editorOverviewRuler.commonContentForeground",{dark:transparent(mergeCommonHeaderBackground,rulerTransparency),light:transparent(mergeCommonHeaderBackground,rulerTransparency),hc:mergeBorder},localize("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const overviewRulerFindMatchForeground=registerColor("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hc:"#AB5A00"},localize("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),overviewRulerSelectionHighlightForeground=registerColor("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},localize("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),minimapFindMatch=registerColor("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hc:"#AB5A00"},localize("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),minimapSelectionOccurrenceHighlight=registerColor("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hc:"#ffffff"},localize("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),minimapSelection=registerColor("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hc:"#ffffff"},localize("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),minimapError=registerColor("minimap.errorHighlight",{dark:new Color(new RGBA(255,18,18,.7)),light:new Color(new RGBA(255,18,18,.7)),hc:new Color(new RGBA(255,50,50,1))},localize("minimapError","Minimap marker color for errors.")),minimapWarning=registerColor("minimap.warningHighlight",{dark:editorWarningForeground,light:editorWarningForeground,hc:editorWarningBorder},localize("overviewRuleWarning","Minimap marker color for warnings.")),minimapBackground=registerColor("minimap.background",{dark:null,light:null,hc:null},localize("minimapBackground","Minimap background color.")),minimapForegroundOpacity=registerColor("minimap.foregroundOpacity",{dark:Color.fromHex("#000f"),light:Color.fromHex("#000f"),hc:Color.fromHex("#000f")},localize("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')),minimapSliderBackground=registerColor("minimapSlider.background",{light:transparent(scrollbarSliderBackground,.5),dark:transparent(scrollbarSliderBackground,.5),hc:transparent(scrollbarSliderBackground,.5)},localize("minimapSliderBackground","Minimap slider background color.")),minimapSliderHoverBackground=registerColor("minimapSlider.hoverBackground",{light:transparent(scrollbarSliderHoverBackground,.5),dark:transparent(scrollbarSliderHoverBackground,.5),hc:transparent(scrollbarSliderHoverBackground,.5)},localize("minimapSliderHoverBackground","Minimap slider background color when hovering.")),minimapSliderActiveBackground=registerColor("minimapSlider.activeBackground",{light:transparent(scrollbarSliderActiveBackground,.5),dark:transparent(scrollbarSliderActiveBackground,.5),hc:transparent(scrollbarSliderActiveBackground,.5)},localize("minimapSliderActiveBackground","Minimap slider background color when clicked on.")),problemsErrorIconForeground=registerColor("problemsErrorIcon.foreground",{dark:editorErrorForeground,light:editorErrorForeground,hc:editorErrorForeground},localize("problemsErrorIconForeground","The color used for the problems error icon.")),problemsWarningIconForeground=registerColor("problemsWarningIcon.foreground",{dark:editorWarningForeground,light:editorWarningForeground,hc:editorWarningForeground},localize("problemsWarningIconForeground","The color used for the problems warning icon.")),problemsInfoIconForeground=registerColor("problemsInfoIcon.foreground",{dark:editorInfoForeground,light:editorInfoForeground,hc:editorInfoForeground},localize("problemsInfoIconForeground","The color used for the problems info icon."));function executeTransform(e,t){var n,i,o;switch(e.op){case 0:return null===(n=resolveColorValue(e.value,t))||void 0===n?void 0:n.darken(e.factor);case 1:return null===(i=resolveColorValue(e.value,t))||void 0===i?void 0:i.lighten(e.factor);case 2:return null===(o=resolveColorValue(e.value,t))||void 0===o?void 0:o.transparent(e.factor);case 3:for(const n of e.values){const e=resolveColorValue(n,t);if(e)return e}return;case 5:return resolveColorValue(t.defines(e.if)?e.then:e.else,t);case 4:{const n=resolveColorValue(e.value,t);if(!n)return;const i=resolveColorValue(e.background,t);return i?n.isDarkerThan(i)?Color.getLighterColor(n,i,e.factor).transparent(e.transparency):Color.getDarkerColor(n,i,e.factor).transparent(e.transparency):n.transparent(e.factor*e.transparency)}default:throw assertNever()}}function darken(e,t){return{op:0,value:e,factor:t}}function lighten(e,t){return{op:1,value:e,factor:t}}function transparent(e,t){return{op:2,value:e,factor:t}}function oneOf(...e){return{op:3,values:e}}function ifDefinedThenElse(e,t,n){return{op:5,if:e,then:t,else:n}}function lessProminent(e,t,n,i){return{op:4,value:e,background:t,factor:n,transparency:i}}function resolveColorValue(e,t){if(null!==e)return"string"==typeof e?"#"===e[0]?Color.fromHex(e):t.getColor(e):e instanceof Color?e:"object"==typeof e?executeTransform(e,t):void 0}registerColor("charts.foreground",{dark:foreground,light:foreground,hc:foreground},localize("chartsForeground","The foreground color used in charts.")),registerColor("charts.lines",{dark:transparent(foreground,.5),light:transparent(foreground,.5),hc:transparent(foreground,.5)},localize("chartsLines","The color used for horizontal lines in charts.")),registerColor("charts.red",{dark:editorErrorForeground,light:editorErrorForeground,hc:editorErrorForeground},localize("chartsRed","The red color used in chart visualizations.")),registerColor("charts.blue",{dark:editorInfoForeground,light:editorInfoForeground,hc:editorInfoForeground},localize("chartsBlue","The blue color used in chart visualizations.")),registerColor("charts.yellow",{dark:editorWarningForeground,light:editorWarningForeground,hc:editorWarningForeground},localize("chartsYellow","The yellow color used in chart visualizations.")),registerColor("charts.orange",{dark:minimapFindMatch,light:minimapFindMatch,hc:minimapFindMatch},localize("chartsOrange","The orange color used in chart visualizations.")),registerColor("charts.green",{dark:"#89D185",light:"#388A34",hc:"#89D185"},localize("chartsGreen","The green color used in chart visualizations.")),registerColor("charts.purple",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},localize("chartsPurple","The purple color used in chart visualizations."));const workbenchColorsSchemaId="vscode://schemas/workbench-colors";let schemaRegistry$1=Registry.as(Extensions$5.JSONContribution);schemaRegistry$1.registerSchema(workbenchColorsSchemaId,colorRegistry$1.getColorSchema());const delayer$1=new RunOnceScheduler((()=>schemaRegistry$1.notifySchemaChanged(workbenchColorsSchemaId)),200);colorRegistry$1.onDidChangeSchema((()=>{delayer$1.isScheduled()||delayer$1.schedule()}));class PageCoordinates{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new ClientCoordinates(this.x-StandardWindow.scrollX,this.y-StandardWindow.scrollY)}}class ClientCoordinates{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new PageCoordinates(this.clientX+StandardWindow.scrollX,this.clientY+StandardWindow.scrollY)}}class EditorPagePosition{constructor(e,t,n,i){this.x=e,this.y=t,this.width=n,this.height=i,this._editorPagePositionBrand=void 0}}class CoordinatesRelativeToEditor{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function createEditorPagePosition(e){const t=getDomNodePagePosition(e);return new EditorPagePosition(t.left,t.top,t.width,t.height)}function createCoordinatesRelativeToEditor(e,t,n){const i=t.width/e.offsetWidth,o=t.height/e.offsetHeight,r=(n.x-t.x)/i,s=(n.y-t.y)/o;return new CoordinatesRelativeToEditor(r,s)}class EditorMouseEvent extends StandardMouseEvent{constructor(e,t){super(e),this._editorMouseEventBrand=void 0,this.pos=new PageCoordinates(this.posx,this.posy),this.editorPos=createEditorPagePosition(t),this.relativePos=createCoordinatesRelativeToEditor(t,this.editorPos,this.pos)}}class EditorMouseEventFactory{constructor(e){this._editorViewDomNode=e}_create(e){return new EditorMouseEvent(e,this._editorViewDomNode)}onContextMenu(e,t){return addDisposableListener(e,"contextmenu",(e=>{t(this._create(e))}))}onMouseUp(e,t){return addDisposableListener(e,"mouseup",(e=>{t(this._create(e))}))}onMouseDown(e,t){return addDisposableListener(e,"mousedown",(e=>{t(this._create(e))}))}onMouseLeave(e,t){return addDisposableNonBubblingMouseOutListener(e,(e=>{t(this._create(e))}))}onMouseMoveThrottled(e,t,n,i){return addDisposableThrottledListener(e,"mousemove",t,((e,t)=>n(e,this._create(t))),i)}}class EditorPointerEventFactory{constructor(e){this._editorViewDomNode=e}_create(e){return new EditorMouseEvent(e,this._editorViewDomNode)}onPointerUp(e,t){return addDisposableListener(e,"pointerup",(e=>{t(this._create(e))}))}onPointerDown(e,t){return addDisposableListener(e,"pointerdown",(e=>{t(this._create(e))}))}onPointerLeave(e,t){return addDisposableNonBubblingPointerOutListener(e,(e=>{t(this._create(e))}))}onPointerMoveThrottled(e,t,n,i){return addDisposableThrottledListener(e,"pointermove",t,((e,t)=>n(e,this._create(t))),i)}}class GlobalEditorMouseMoveMonitor extends Disposable{constructor(e){super(),this._editorViewDomNode=e,this._globalMouseMoveMonitor=this._register(new GlobalMouseMoveMonitor),this._keydownListener=null}startMonitoring(e,t,n,i,o){this._keydownListener=addStandardDisposableListener(document,"keydown",(e=>{e.toKeybinding().isModifierKey()||this._globalMouseMoveMonitor.stopMonitoring(!0,e.browserEvent)}),!0);this._globalMouseMoveMonitor.startMonitoring(e,t,((e,t)=>n(e,new EditorMouseEvent(t,this._editorViewDomNode))),i,(e=>{this._keydownListener.dispose(),o(e)}))}stopMonitoring(){this._globalMouseMoveMonitor.stopMonitoring(!0)}}class DynamicCssRules{constructor(e){this._editor=e,this._instanceId=++DynamicCssRules._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new RunOnceScheduler((()=>this.garbageCollect()),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let n=this._rules.get(t);if(!n){const i=this._counter++;n=new RefCountedCssRule(t,`dyn-rule-${this._instanceId}-${i}`,isInShadowDOM(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,n)}return n}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}DynamicCssRules._idPool=0;class RefCountedCssRule{constructor(e,t,n,i){this.key=e,this.className=t,this.properties=i,this._referenceCount=0,this._styleElement=createStyleSheet(n),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let n=`.${e} {`;for(const i in t){const e=t[i];let o;o="object"==typeof e?`var(${asCssVariableName(e.id)})`:e;n+=`\n\t${camelToDashes(i)}: ${o};`}return n+="\n}",n}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function camelToDashes(e){return e.replace(/(^[A-Z])/,(([e])=>e.toLowerCase())).replace(/([A-Z])/g,(([e])=>`-${e.toLowerCase()}`))}class ViewEventHandler extends Disposable{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let n=0,i=e.length;n<i;n++){const i=e[n];switch(i.type){case 0:this.onCompositionStart(i)&&(t=!0);break;case 1:this.onCompositionEnd(i)&&(t=!0);break;case 2:this.onConfigurationChanged(i)&&(t=!0);break;case 3:this.onCursorStateChanged(i)&&(t=!0);break;case 4:this.onDecorationsChanged(i)&&(t=!0);break;case 5:this.onFlushed(i)&&(t=!0);break;case 6:this.onFocusChanged(i)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(i)&&(t=!0);break;case 8:this.onLineMappingChanged(i)&&(t=!0);break;case 9:this.onLinesChanged(i)&&(t=!0);break;case 10:this.onLinesDeleted(i)&&(t=!0);break;case 11:this.onLinesInserted(i)&&(t=!0);break;case 12:this.onRevealRangeRequest(i)&&(t=!0);break;case 13:this.onScrollChanged(i)&&(t=!0);break;case 15:this.onTokensChanged(i)&&(t=!0);break;case 14:this.onThemeChanged(i)&&(t=!0);break;case 16:this.onTokensColorsChanged(i)&&(t=!0);break;case 17:this.onZonesChanged(i)&&(t=!0)}}t&&(this._shouldRender=!0)}}class ViewPart extends ViewEventHandler{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class PartFingerprints{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return null===t?0:parseInt(t,10)}static collect(e,t){const n=[];let i=0;for(;e&&e!==document.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(n[i++]=this.read(e)),e=e.parentElement;const o=new Uint8Array(i);for(let r=0;r<i;r++)o[r]=n[i-r-1];return o}}class RestrictedRenderingContext{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const n=this._viewLayout.getCurrentViewport();this.scrollTop=n.top,this.scrollLeft=n.left,this.viewportWidth=n.width,this.viewportHeight=n.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e){return this._viewLayout.getVerticalOffsetForLineNumber(e)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class RenderingContext extends RestrictedRenderingContext{constructor(e,t,n){super(e,t),this._renderingContextBrand=void 0,this._viewLines=n}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}}class LineVisibleRanges{constructor(e,t,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=n}}class HorizontalRange{constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}static from(e){const t=new Array(e.length);for(let n=0,i=e.length;n<i;n++){const i=e[n];t[n]=new HorizontalRange(i.left,i.width)}return t}toString(){return`[${this.left},${this.width}]`}}class FloatHorizontalRange{constructor(e,t){this._floatHorizontalRangeBrand=void 0,this.left=e,this.width=t}toString(){return`[${this.left},${this.width}]`}static compare(e,t){return e.left-t.left}}class HorizontalPosition{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}}class VisibleRanges{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}class RangeUtil{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,n,i,o){const r=this._createRange();try{return r.setStart(e,t),r.setEnd(n,i),r.getClientRects()}catch(e2){return null}finally{this._detachRange(r,o)}}static _mergeAdjacentRanges(e){if(1===e.length)return e;e.sort(FloatHorizontalRange.compare);const t=[];let n=0,i=e[0];for(let o=1,r=e.length;o<r;o++){const r=e[o];i.left+i.width+.9>=r.left?i.width=Math.max(i.width,r.left+r.width-i.left):(t[n++]=i,i=r)}return t[n++]=i,t}static _createHorizontalRangesFromClientRects(e,t,n){if(!e||0===e.length)return null;const i=[];for(let o=0,r=e.length;o<r;o++){const r=e[o];i[o]=new FloatHorizontalRange(Math.max(0,(r.left-t)/n),r.width/n)}return this._mergeAdjacentRanges(i)}static readHorizontalRanges(e,t,n,i,o,r,s,a){const l=e.children.length-1;if(0>l)return null;if((t=Math.min(l,Math.max(0,t)))===(i=Math.min(l,Math.max(0,i)))&&n===o&&0===n&&!e.children[t].firstChild){const n=e.children[t].getClientRects();return this._createHorizontalRangesFromClientRects(n,r,s)}t!==i&&i>0&&0===o&&(i--,o=1073741824);let c=e.children[t].firstChild,d=e.children[i].firstChild;if(c&&d||(!c&&0===n&&t>0&&(c=e.children[t-1].firstChild,n=1073741824),!d&&0===o&&i>0&&(d=e.children[i-1].firstChild,o=1073741824)),!c||!d)return null;n=Math.min(c.textContent.length,Math.max(0,n)),o=Math.min(d.textContent.length,Math.max(0,o));const u=this._readClientRects(c,n,d,o,a);return this._createHorizontalRangesFromClientRects(u,r,s)}}class LineDecoration{constructor(e,t,n,i){this.startColumn=e,this.endColumn=t,this.className=n,this.type=i,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(!LineDecoration._equals(e[i],t[i]))return!1;return!0}static extractWrapped(e,t,n){if(0===e.length)return e;const i=t+1,o=n+1,r=n-t,s=[];let a=0;for(const l of e)l.endColumn<=i||l.startColumn>=o||(s[a++]=new LineDecoration(Math.max(1,l.startColumn-i+1),Math.min(r+1,l.endColumn-i+1),l.className,l.type));return s}static filter(e,t,n,i){if(0===e.length)return[];const o=[];let r=0;for(let s=0,a=e.length;s<a;s++){const a=e[s],l=a.range;if(l.endLineNumber<t||l.startLineNumber>t)continue;if(l.isEmpty()&&(0===a.type||3===a.type))continue;const c=l.startLineNumber===t?l.startColumn:n,d=l.endLineNumber===t?l.endColumn:i;o[r++]=new LineDecoration(c,d,a.inlineClassName,a.type)}return o}static _typeCompare(e,t){const n=[2,0,1,3];return n[e]-n[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const n=LineDecoration._typeCompare(e.type,t.type);return 0!==n?n:e.className!==t.className?e.className<t.className?-1:1:0}}class DecorationSegment{constructor(e,t,n,i){this.startOffset=e,this.endOffset=t,this.className=n,this.metadata=i}}class Stack{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let t=0;for(let n=0,i=e.length;n<i;n++)t|=e[n];return t}consumeLowerThan(e,t,n){for(;this.count>0&&this.stopOffsets[0]<e;){let e=0;for(;e+1<this.count&&this.stopOffsets[e]===this.stopOffsets[e+1];)e++;n.push(new DecorationSegment(t,this.stopOffsets[e],this.classNames.join(" "),Stack._metadata(this.metadata))),t=this.stopOffsets[e]+1,this.stopOffsets.splice(0,e+1),this.classNames.splice(0,e+1),this.metadata.splice(0,e+1),this.count-=e+1}return this.count>0&&t<e&&(n.push(new DecorationSegment(t,e-1,this.classNames.join(" "),Stack._metadata(this.metadata))),t=e),t}insert(e,t,n){if(0===this.count||this.stopOffsets[this.count-1]<=e)this.stopOffsets.push(e),this.classNames.push(t),this.metadata.push(n);else for(let i=0;i<this.count;i++)if(this.stopOffsets[i]>=e){this.stopOffsets.splice(i,0,e),this.classNames.splice(i,0,t),this.metadata.splice(i,0,n);break}this.count++}}class LineDecorationsNormalizer{static normalize(e,t){if(0===t.length)return[];const n=[],i=new Stack;let o=0;for(let r=0,s=t.length;r<s;r++){const s=t[r];let a=s.startColumn,l=s.endColumn;const c=s.className,d=1===s.type?2:2===s.type?4:0;if(a>1){isHighSurrogate(e.charCodeAt(a-2))&&a--}if(l>1){isHighSurrogate(e.charCodeAt(l-2))&&l--}const u=a-1,h=l-2;o=i.consumeLowerThan(u,o,n),0===i.count&&(o=u),i.insert(h,c,d)}return i.consumeLowerThan(1073741824,o,n),n}}class LinePart{constructor(e,t,n){this._linePartBrand=void 0,this.endIndex=e,this.type=t,this.metadata=n}isWhitespace(){return!!(1&this.metadata)}isPseudoAfter(){return!!(4&this.metadata)}}class LineRange{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class RenderLineInput{constructor(e,t,n,i,o,r,s,a,l,c,d,u,h,g,p,f,m,v,_){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.continuesWithWrappedLine=i,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=s,this.lineTokens=a,this.lineDecorations=l.sort(LineDecoration.compare),this.tabSize=c,this.startVisibleColumn=d,this.spaceWidth=u,this.stopRenderingLineAfter=p,this.renderWhitespace="all"===f?4:"boundary"===f?1:"selection"===f?2:"trailing"===f?3:0,this.renderControlCharacters=m,this.fontLigatures=v,this.selectionsOnLine=_&&_.sort(((e,t)=>e.startOffset<t.startOffset?-1:1));Math.abs(g-u)<Math.abs(h-u)?(this.renderSpaceWidth=g,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=h,this.renderSpaceCharCode=183)}sameSelection(e){if(null===this.selectionsOnLine)return null===e;if(null===e)return!1;if(e.length!==this.selectionsOnLine.length)return!1;for(let t=0;t<this.selectionsOnLine.length;t++)if(!this.selectionsOnLine[t].equals(e[t]))return!1;return!0}equals(e){return this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineContent===e.lineContent&&this.continuesWithWrappedLine===e.continuesWithWrappedLine&&this.isBasicASCII===e.isBasicASCII&&this.containsRTL===e.containsRTL&&this.fauxIndentLength===e.fauxIndentLength&&this.tabSize===e.tabSize&&this.startVisibleColumn===e.startVisibleColumn&&this.spaceWidth===e.spaceWidth&&this.renderSpaceWidth===e.renderSpaceWidth&&this.renderSpaceCharCode===e.renderSpaceCharCode&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.fontLigatures===e.fontLigatures&&LineDecoration.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)}}class DomPosition{constructor(e,t){this.partIndex=e,this.charIndex=t}}class CharacterMapping{constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._absoluteOffsets=new Uint32Array(this.length)}static getPartIndex(e){return(4294901760&e)>>>16}static getCharIndex(e){return(65535&e)>>>0}setColumnInfo(e,t,n,i){const o=(t<<16|n<<0)>>>0;this._data[e-1]=o,this._absoluteOffsets[e-1]=i+n}getAbsoluteOffset(e){return 0===this._absoluteOffsets.length?0:this._absoluteOffsets[e-1]}charOffsetToPartData(e){return 0===this.length?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),n=CharacterMapping.getPartIndex(t),i=CharacterMapping.getCharIndex(t);return new DomPosition(n,i)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,n){if(0===this.length)return 0;const i=(e<<16|n<<0)>>>0;let o=0,r=this.length-1;for(;o+1<r;){const e=o+r>>>1,t=this._data[e];if(t===i)return e;t>i?r=e:o=e}if(o===r)return o;const s=this._data[o],a=this._data[r];if(s===i)return o;if(a===i)return r;const l=CharacterMapping.getPartIndex(s),c=CharacterMapping.getCharIndex(s);let d;d=l!==CharacterMapping.getPartIndex(a)?t:CharacterMapping.getCharIndex(a);return n-c<=d-n?o:r}}class RenderLineOutput{constructor(e,t,n){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=n}}function renderViewLine(e,t){if(0===e.lineContent.length){if(e.lineDecorations.length>0){t.appendASCIIString("<span>");let n=0,i=0,o=0;for(const s of e.lineDecorations)1!==s.type&&2!==s.type||(t.appendASCIIString('<span class="'),t.appendASCIIString(s.className),t.appendASCIIString('"></span>'),1===s.type&&(o|=1,n++),2===s.type&&(o|=2,i++));t.appendASCIIString("</span>");const r=new CharacterMapping(1,n+i);return r.setColumnInfo(1,n,0,0),new RenderLineOutput(r,!1,o)}return t.appendASCIIString("<span><span></span></span>"),new RenderLineOutput(new CharacterMapping(0,0),!1,0)}return _renderLine(resolveRenderLineInput(e),t)}class RenderLineOutput2{constructor(e,t,n,i){this.characterMapping=e,this.html=t,this.containsRTL=n,this.containsForeignElements=i}}function renderViewLine2(e){const t=createStringBuilder(1e4),n=renderViewLine(e,t);return new RenderLineOutput2(n.characterMapping,t.build(),n.containsRTL,n.containsForeignElements)}class ResolvedRenderLineInput{constructor(e,t,n,i,o,r,s,a,l,c,d,u,h,g,p){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.len=i,this.isOverflowing=o,this.parts=r,this.containsForeignElements=s,this.fauxIndentLength=a,this.tabSize=l,this.startVisibleColumn=c,this.containsRTL=d,this.spaceWidth=u,this.renderSpaceCharCode=h,this.renderWhitespace=g,this.renderControlCharacters=p}}function resolveRenderLineInput(e){const t=e.lineContent;let n,i;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter<t.length?(n=!0,i=e.stopRenderingLineAfter):(n=!1,i=t.length);let o=transformAndRemoveOverflowing(e.lineTokens,e.fauxIndentLength,i);e.renderControlCharacters&&!e.isBasicASCII&&(o=extractControlCharacters(t,o)),(4===e.renderWhitespace||1===e.renderWhitespace||2===e.renderWhitespace&&e.selectionsOnLine||3===e.renderWhitespace)&&(o=_applyRenderWhitespace(e,t,i,o));let r=0;if(e.lineDecorations.length>0){for(let t=0,n=e.lineDecorations.length;t<n;t++){const n=e.lineDecorations[t];3===n.type||1===n.type?r|=1:2===n.type&&(r|=2)}o=_applyInlineDecorations(t,i,o,e.lineDecorations)}return e.containsRTL||(o=splitLargeTokens(t,o,!e.isBasicASCII||e.fontLigatures)),new ResolvedRenderLineInput(e.useMonospaceOptimizations,e.canUseHalfwidthRightwardsArrow,t,i,n,o,r,e.fauxIndentLength,e.tabSize,e.startVisibleColumn,e.containsRTL,e.spaceWidth,e.renderSpaceCharCode,e.renderWhitespace,e.renderControlCharacters)}function transformAndRemoveOverflowing(e,t,n){const i=[];let o=0;t>0&&(i[o++]=new LinePart(t,"",0));for(let r=0,s=e.getCount();r<s;r++){const s=e.getEndOffset(r);if(s<=t)continue;const a=e.getClassName(r);if(s>=n){i[o++]=new LinePart(n,a,0);break}i[o++]=new LinePart(s,a,0)}return i}function splitLargeTokens(e,t,n){let i=0;const o=[];let r=0;if(n)for(let s=0,a=t.length;s<a;s++){const n=t[s],a=n.endIndex;if(i+50<a){const t=n.type,s=n.metadata;let l=-1,c=i;for(let n=i;n<a;n++)32===e.charCodeAt(n)&&(l=n),-1!==l&&n-c>=50&&(o[r++]=new LinePart(l+1,t,s),c=l+1,l=-1);c!==a&&(o[r++]=new LinePart(a,t,s))}else o[r++]=n;i=a}else for(let s=0,a=t.length;s<a;s++){const e=t[s],n=e.endIndex,a=n-i;if(a>50){const t=e.type,s=e.metadata,l=Math.ceil(a/50);for(let e=1;e<l;e++){const n=i+50*e;o[r++]=new LinePart(n,t,s)}o[r++]=new LinePart(n,t,s)}else o[r++]=e;i=n}return o}function isControlCharacter(e){return e<32?9!==e:127===e||(e>=8234&&e<=8238||e>=8294&&e<=8297||e>=8206&&e<=8207||1564===e)}function extractControlCharacters(e,t){const n=[];let i=new LinePart(0,"",0),o=0;for(const r of t){const t=r.endIndex;for(;o<t;o++){isControlCharacter(e.charCodeAt(o))&&(o>i.endIndex&&(i=new LinePart(o,r.type,r.metadata),n.push(i)),i=new LinePart(o+1,"mtkcontrol",r.metadata),n.push(i))}o>i.endIndex&&(i=new LinePart(t,r.type,r.metadata),n.push(i))}return n}function _applyRenderWhitespace(e,t,n,i){const o=e.continuesWithWrappedLine,r=e.fauxIndentLength,s=e.tabSize,a=e.startVisibleColumn,l=e.useMonospaceOptimizations,c=e.selectionsOnLine,d=1===e.renderWhitespace,u=3===e.renderWhitespace,h=e.renderSpaceWidth!==e.spaceWidth,g=[];let p=0,f=0,m=i[f].type,v=i[f].endIndex;const _=i.length;let C,b=!1,y=firstNonWhitespaceIndex(t);-1===y?(b=!0,y=n,C=n):C=lastNonWhitespaceIndex(t);let S=!1,w=0,E=c&&c[w],x=a%s;for(let I=r;I<n;I++){const e=t.charCodeAt(I);let o;if(E&&I>=E.endOffset&&(w++,E=c&&c[w]),I<y||I>C)o=!0;else if(9===e)o=!0;else if(32===e)if(d)if(S)o=!0;else{const e=I+1<n?t.charCodeAt(I+1):0;o=32===e||9===e}else o=!0;else o=!1;if(o&&c&&(o=!!E&&E.startOffset<=I&&E.endOffset>I),o&&u&&(o=b||I>C),S){if(!o||!l&&x>=s){if(h){for(let e=(p>0?g[p-1].endIndex:r)+1;e<=I;e++)g[p++]=new LinePart(e,"mtkw",1)}else g[p++]=new LinePart(I,"mtkw",1);x%=s}}else(I===v||o&&I>r)&&(g[p++]=new LinePart(I,m,0),x%=s);for(9===e?x=s:isFullWidthCharacter(e)?x+=2:x++,S=o;I===v&&(f++,f<_);)m=i[f].type,v=i[f].endIndex}let T=!1;if(S)if(o&&d){const e=n>0?t.charCodeAt(n-1):0,i=n>1?t.charCodeAt(n-2):0;32===e&&32!==i&&9!==i||(T=!0)}else T=!0;if(T)if(h){for(let e=(p>0?g[p-1].endIndex:r)+1;e<=n;e++)g[p++]=new LinePart(e,"mtkw",1)}else g[p++]=new LinePart(n,"mtkw",1);else g[p++]=new LinePart(n,m,0);return g}function _applyInlineDecorations(e,t,n,i){i.sort(LineDecoration.compare);const o=LineDecorationsNormalizer.normalize(e,i),r=o.length;let s=0;const a=[];let l=0,c=0;for(let u=0,h=n.length;u<h;u++){const e=n[u],t=e.endIndex,i=e.type,d=e.metadata;for(;s<r&&o[s].startOffset<t;){const e=o[s];if(e.startOffset>c&&(c=e.startOffset,a[l++]=new LinePart(c,i,d)),!(e.endOffset+1<=t)){c=t,a[l++]=new LinePart(c,i+" "+e.className,d|e.metadata);break}c=e.endOffset+1,a[l++]=new LinePart(c,i+" "+e.className,d|e.metadata),s++}t>c&&(c=t,a[l++]=new LinePart(c,i,d))}const d=n[n.length-1].endIndex;if(s<r&&o[s].startOffset===d)for(;s<r&&o[s].startOffset===d;){const e=o[s];a[l++]=new LinePart(c,e.className,e.metadata),s++}return a}function _renderLine(e,t){const n=e.fontIsMonospace,i=e.canUseHalfwidthRightwardsArrow,o=e.containsForeignElements,r=e.lineContent,s=e.len,a=e.isOverflowing,l=e.parts,c=e.fauxIndentLength,d=e.tabSize,u=e.startVisibleColumn,h=e.containsRTL,g=e.spaceWidth,p=e.renderSpaceCharCode,f=e.renderWhitespace,m=e.renderControlCharacters,v=new CharacterMapping(s+1,l.length);let _=!1,C=0,b=u,y=0,S=0,w=0,E=0;h?t.appendASCIIString('<span dir="ltr">'):t.appendASCIIString("<span>");for(let x=0,T=l.length;x<T;x++){E+=w;const e=l[x],a=e.endIndex,u=e.type,h=0!==f&&e.isWhitespace(),T=h&&!n&&("mtkw"===u||!o),I=C===a&&e.isPseudoAfter();if(y=0,t.appendASCIIString('<span class="'),t.appendASCIIString(T?"mtkz":u),t.appendASCII(34),h){let e=0;{let t=C,n=b;for(;t<a;t++){const i=0|(9===r.charCodeAt(t)?d-n%d:1);e+=i,t>=c&&(n+=i)}}for(T&&(t.appendASCIIString(' style="width:'),t.appendASCIIString(String(g*e)),t.appendASCIIString('px"')),t.appendASCII(62);C<a;C++){v.setColumnInfo(C+1,x-S,y,E),S=0;let e;if(9===r.charCodeAt(C)){e=d-b%d|0,!i||e>1?t.write1(8594):t.write1(65515);for(let n=2;n<=e;n++)t.write1(160)}else e=1,t.write1(p);y+=e,C>=c&&(b+=e)}w=e}else{let e=0;for(t.appendASCII(62);C<a;C++){v.setColumnInfo(C+1,x-S,y,E),S=0;const n=r.charCodeAt(C);let i=1,o=1;switch(n){case 9:i=d-b%d,o=i;for(let e=1;e<=i;e++)t.write1(160);break;case 32:t.write1(160);break;case 60:t.appendASCIIString("<");break;case 62:t.appendASCIIString(">");break;case 38:t.appendASCIIString("&");break;case 0:m?t.write1(9216):t.appendASCIIString("�");break;case 65279:case 8232:case 8233:case 133:t.write1(65533);break;default:isFullWidthCharacter(n)&&o++,m&&n<32?t.write1(9216+n):m&&127===n?t.write1(9249):m&&isControlCharacter(n)?(t.appendASCIIString("[U+"),t.appendASCIIString(to4CharHex(n)),t.appendASCIIString("]"),i=8):t.write1(n)}y+=i,e+=i,C>=c&&(b+=o)}w=e}I?S++:S=0,C>=s&&!_&&e.isPseudoAfter()&&(_=!0,v.setColumnInfo(C+1,x,y,E)),t.appendASCIIString("</span>")}return _||v.setColumnInfo(s+1,l.length-1,y,E),a&&t.appendASCIIString("<span>…</span>"),t.appendASCIIString("</span>"),new RenderLineOutput(v,h,o)}function to4CharHex(e){return e.toString(16).toUpperCase().padStart(4,"0")}const canUseFastRenderedViewLine=!!isNative||!(isLinux||isFirefox||isSafari);let monospaceAssumptionsAreValid=!0;class DomReadingContext{constructor(e,t){this._domNode=e,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1,this.endNode=t}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}}class ViewLineOptions{constructor(e,t){this.themeType=t;const n=e.options,i=n.get(44);this.renderWhitespace=n.get(88),this.renderControlCharacters=n.get(83),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.useMonospaceOptimizations=i.isMonospace&&!n.get(29),this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=n.get(59),this.stopRenderingLineAfter=n.get(105),this.fontLigatures=n.get(45)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class ViewLine{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(!this._renderedViewLine)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=createFastDomNode(e)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return(this._options.themeType===ColorScheme.HIGH_CONTRAST||"selection"===this._options.renderWhitespace)&&(this._isMaybeInvalid=!0,!0)}renderLine(e,t,n,i){if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;const o=n.getViewLineRenderingData(e),r=this._options,s=LineDecoration.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let a=null;if(r.themeType===ColorScheme.HIGH_CONTRAST||"selection"===this._options.renderWhitespace){const t=n.selections;for(const n of t){if(n.endLineNumber<e||n.startLineNumber>e)continue;const t=n.startLineNumber===e?n.startColumn:o.minColumn,i=n.endLineNumber===e?n.endColumn:o.maxColumn;t<i&&(r.themeType===ColorScheme.HIGH_CONTRAST||"selection"!==this._options.renderWhitespace?s.push(new LineDecoration(t,i,"inline-selected-text",0)):(a||(a=[]),a.push(new LineRange(t-1,i-1))))}}const l=new RenderLineInput(r.useMonospaceOptimizations,r.canUseHalfwidthRightwardsArrow,o.content,o.continuesWithWrappedLine,o.isBasicASCII,o.containsRTL,o.minColumn-1,o.tokens,s,o.tabSize,o.startVisibleColumn,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==EditorFontLigatures.OFF,a);if(this._renderedViewLine&&this._renderedViewLine.input.equals(l))return!1;i.appendASCIIString('<div style="top:'),i.appendASCIIString(String(t)),i.appendASCIIString("px;height:"),i.appendASCIIString(String(this._options.lineHeight)),i.appendASCIIString('px;" class="'),i.appendASCIIString(ViewLine.CLASS_NAME),i.appendASCIIString('">');const c=renderViewLine(l,i);i.appendASCIIString("</div>");let d=null;return monospaceAssumptionsAreValid&&canUseFastRenderedViewLine&&o.isBasicASCII&&r.useMonospaceOptimizations&&0===c.containsForeignElements&&o.content.length<300&&l.lineTokens.getCount()<100&&(d=new FastRenderedViewLine(this._renderedViewLine?this._renderedViewLine.domNode:null,l,c.characterMapping)),d||(d=createRenderedLine(this._renderedViewLine?this._renderedViewLine.domNode:null,l,c.characterMapping,c.containsRTL,c.containsForeignElements)),this._renderedViewLine=d,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(){return this._renderedViewLine?this._renderedViewLine.getWidth():0}getWidthIsFast(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()}needsMonospaceFontCheck(){return!!this._renderedViewLine&&this._renderedViewLine instanceof FastRenderedViewLine}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof FastRenderedViewLine?this._renderedViewLine.monospaceAssumptionsAreValid():monospaceAssumptionsAreValid}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof FastRenderedViewLine&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,n,i){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),n=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,n));const o=this._renderedViewLine.input.stopRenderingLineAfter;let r=!1;-1!==o&&t>o+1&&n>o+1&&(r=!0),-1!==o&&t>o+1&&(t=o+1),-1!==o&&n>o+1&&(n=o+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,n,i);return s&&s.length>0?new VisibleRanges(r,s):null}getColumnOfNodeOffset(e,t,n){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,n):1}}ViewLine.CLASS_NAME="view-line";class FastRenderedViewLine{constructor(e,t,n){this.domNode=e,this.input=t,this._characterMapping=n,this._charWidth=t.spaceWidth}getWidth(){return Math.round(this._getCharPosition(this._characterMapping.length))}getWidthIsFast(){return!0}monospaceAssumptionsAreValid(){if(!this.domNode)return monospaceAssumptionsAreValid;const e=this.getWidth(),t=this.domNode.domNode.firstChild.offsetWidth;return Math.abs(e-t)>=2&&(monospaceAssumptionsAreValid=!1),monospaceAssumptionsAreValid}toSlowRenderedLine(){return createRenderedLine(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,n,i){const o=this._getCharPosition(t),r=this._getCharPosition(n);return[new FloatHorizontalRange(o,r-o)]}_getCharPosition(e){const t=this._characterMapping.getAbsoluteOffset(e);return this._charWidth*t}getColumnOfNodeOffset(e,t,n){const i=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.getColumn(new DomPosition(o,n),i)}}class RenderedViewLine{constructor(e,t,n,i,o){if(this.domNode=e,this.input=t,this._characterMapping=n,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!i||0===this._characterMapping.length){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let e=0,t=this._characterMapping.length;e<=t;e++)this._pixelOffsetCache[e]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(){return this.domNode?(-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth),this._cachedWidth):0}getWidthIsFast(){return-1!==this._cachedWidth}getVisibleRangesForRange(e,t,n,i){if(!this.domNode)return null;if(null!==this._pixelOffsetCache){const o=this._readPixelOffset(this.domNode,e,t,i);if(-1===o)return null;const r=this._readPixelOffset(this.domNode,e,n,i);return-1===r?null:[new FloatHorizontalRange(o,r-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,n,i)}_readVisibleRangesForRange(e,t,n,i,o){if(n===i){const i=this._readPixelOffset(e,t,n,o);return-1===i?null:[new FloatHorizontalRange(i,0)]}return this._readRawVisibleRangesForRange(e,n,i,o)}_readPixelOffset(e,t,n,i){if(0===this._characterMapping.length){if(0===this._containsForeignElements)return 0;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth();const t=this._getReadingTarget(e);return t.firstChild?t.firstChild.offsetWidth:0}if(null!==this._pixelOffsetCache){const o=this._pixelOffsetCache[n];if(-1!==o)return o;const r=this._actualReadPixelOffset(e,t,n,i);return this._pixelOffsetCache[n]=r,r}return this._actualReadPixelOffset(e,t,n,i)}_actualReadPixelOffset(e,t,n,i){if(0===this._characterMapping.length){const t=RangeUtil.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,i.clientRectDeltaLeft,i.clientRectScale,i.endNode);return t&&0!==t.length?t[0].left:-1}if(n===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth();const o=this._characterMapping.getDomPosition(n),r=RangeUtil.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,i.clientRectDeltaLeft,i.clientRectScale,i.endNode);if(!r||0===r.length)return-1;const s=r[0].left;if(this.input.isBasicASCII){const e=this._characterMapping.getAbsoluteOffset(n),t=Math.round(this.input.spaceWidth*e);if(Math.abs(t-s)<=1)return t}return s}_readRawVisibleRangesForRange(e,t,n,i){if(1===t&&n===this._characterMapping.length)return[new FloatHorizontalRange(0,this.getWidth())];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(n);return RangeUtil.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,i.clientRectDeltaLeft,i.clientRectScale,i.endNode)}getColumnOfNodeOffset(e,t,n){const i=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.getColumn(new DomPosition(o,n),i)}}class WebKitRenderedViewLine extends RenderedViewLine{_readVisibleRangesForRange(e,t,n,i,o){const r=super._readVisibleRangesForRange(e,t,n,i,o);if(!r||0===r.length||n===i||1===n&&i===this._characterMapping.length)return r;if(!this.input.containsRTL){const n=this._readPixelOffset(e,t,i,o);if(-1!==n){const e=r[r.length-1];e.left<n&&(e.width=n-e.left)}}return r}}const createRenderedLine=isWebKit?createWebKitRenderedLine:createNormalRenderedLine;function createWebKitRenderedLine(e,t,n,i,o){return new WebKitRenderedViewLine(e,t,n,i,o)}function createNormalRenderedLine(e,t,n,i,o){return new RenderedViewLine(e,t,n,i,o)}class UnknownHitTestResult{constructor(e=null){this.hitTarget=e,this.type=0}}class ContentHitTestResult{constructor(e,t,n){this.position=e,this.spanNode=t,this.injectedText=n,this.type=1}}var HitTestResult;(HitTestResult||(HitTestResult={})).createFromDOMInfo=function(e,t,n){const i=e.getPositionFromDOMInfo(t,n);return i?new ContentHitTestResult(i,t,null):new UnknownHitTestResult(t)};class PointerHandlerLastRenderData{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}class MouseTarget{static _deduceRage(e,t=null){return!t&&e?new Range$2(e.lineNumber,e.column,e.lineNumber,e.column):null!=t?t:null}static createUnknown(e,t,n){return{type:0,element:e,mouseColumn:t,position:n,range:this._deduceRage(n)}}static createTextarea(e,t){return{type:1,element:e,mouseColumn:t,position:null,range:null}}static createMargin(e,t,n,i,o,r){return{type:e,element:t,mouseColumn:n,position:i,range:o,detail:r}}static createViewZone(e,t,n,i,o){return{type:e,element:t,mouseColumn:n,position:i,range:this._deduceRage(i),detail:o}}static createContentText(e,t,n,i,o){return{type:6,element:e,mouseColumn:t,position:n,range:this._deduceRage(n,i),detail:o}}static createContentEmpty(e,t,n,i){return{type:7,element:e,mouseColumn:t,position:n,range:this._deduceRage(n),detail:i}}static createContentWidget(e,t,n){return{type:9,element:e,mouseColumn:t,position:null,range:null,detail:n}}static createScrollbar(e,t,n){return{type:11,element:e,mouseColumn:t,position:n,range:this._deduceRage(n)}}static createOverlayWidget(e,t,n){return{type:12,element:e,mouseColumn:t,position:null,range:null,detail:n}}static createOutsideEditor(e,t){return{type:13,element:null,mouseColumn:e,position:t,range:this._deduceRage(t)}}static _typeToString(e){return 1===e?"TEXTAREA":2===e?"GUTTER_GLYPH_MARGIN":3===e?"GUTTER_LINE_NUMBERS":4===e?"GUTTER_LINE_DECORATIONS":5===e?"GUTTER_VIEW_ZONE":6===e?"CONTENT_TEXT":7===e?"CONTENT_EMPTY":8===e?"CONTENT_VIEW_ZONE":9===e?"CONTENT_WIDGET":10===e?"OVERVIEW_RULER":11===e?"SCROLLBAR":12===e?"OVERLAY_WIDGET":"UNKNOWN"}static toString(e){return this._typeToString(e.type)+": "+e.position+" - "+e.range+" - "+JSON.stringify(e.detail)}}class ElementPath{static isTextArea(e){return 2===e.length&&3===e[0]&&6===e[1]}static isChildOfViewLines(e){return e.length>=4&&3===e[0]&&7===e[3]}static isStrictChildOfViewLines(e){return e.length>4&&3===e[0]&&7===e[3]}static isChildOfScrollableElement(e){return e.length>=2&&3===e[0]&&5===e[1]}static isChildOfMinimap(e){return e.length>=2&&3===e[0]&&8===e[1]}static isChildOfContentWidgets(e){return e.length>=4&&3===e[0]&&1===e[3]}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&2===e[0]}static isChildOfOverlayWidgets(e){return e.length>=2&&3===e[0]&&4===e[1]}}class HitTestContext{constructor(e,t,n){this.viewModel=e.viewModel;const i=e.configuration.options;this.layoutInfo=i.get(131),this.viewDomNode=t.viewDomNode,this.lineHeight=i.get(59),this.stickyTabStops=i.get(104),this.typicalHalfwidthCharacterWidth=i.get(44).typicalHalfwidthCharacterWidth,this.lastRenderData=n,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return HitTestContext.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const n=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(n){const i=n.verticalOffset+n.height/2,o=e.viewModel.getLineCount();let r,s=null,a=null;return n.afterLineNumber!==o&&(a=new Position$1(n.afterLineNumber+1,1)),n.afterLineNumber>0&&(s=new Position$1(n.afterLineNumber,e.viewModel.getLineMaxColumn(n.afterLineNumber))),r=null===a?s:null===s?a:t<i?s:a,{viewZoneId:n.id,afterLineNumber:n.afterLineNumber,positionBefore:s,positionAfter:a,position:r}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){const e=this._context.viewModel.getLineCount(),t=this._context.viewModel.getLineMaxColumn(e);return{range:new Range$2(e,t,e,t),isAfterLines:!0}}const t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),n=this._context.viewModel.getLineMaxColumn(t);return{range:new Range$2(t,1,t,n),isAfterLines:!1}}getLineNumberAtVerticalOffset(e){return this._context.viewLayout.getLineNumberAtVerticalOffset(e)}isAfterLines(e){return this._context.viewLayout.isAfterLines(e)}isInTopPadding(e){return this._context.viewLayout.isInTopPadding(e)}isInBottomPadding(e){return this._context.viewLayout.isInBottomPadding(e)}getVerticalOffsetForLineNumber(e){return this._context.viewLayout.getVerticalOffsetForLineNumber(e)}findAttribute(e,t){return HitTestContext._findAttribute(e,t,this._viewHelper.viewDomNode)}static _findAttribute(e,t,n){for(;e&&e!==document.body;){if(e.hasAttribute&&e.hasAttribute(t))return e.getAttribute(t);if(e===n)return null;e=e.parentNode}return null}getLineWidth(e){return this._viewHelper.getLineWidth(e)}visibleRangeForPosition(e,t){return this._viewHelper.visibleRangeForPosition(e,t)}getPositionFromDOMInfo(e,t){return this._viewHelper.getPositionFromDOMInfo(e,t)}getCurrentScrollTop(){return this._context.viewLayout.getCurrentScrollTop()}getCurrentScrollLeft(){return this._context.viewLayout.getCurrentScrollLeft()}}class BareHitTestRequest{constructor(e,t,n,i){this.editorPos=t,this.pos=n,this.relativePos=i,this.mouseVerticalOffset=Math.max(0,e.getCurrentScrollTop()+this.relativePos.y),this.mouseContentHorizontalOffset=e.getCurrentScrollLeft()+this.relativePos.x-e.layoutInfo.contentLeft,this.isInMarginArea=this.relativePos.x<e.layoutInfo.contentLeft&&this.relativePos.x>=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,MouseTargetFactory._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class HitTestRequest extends BareHitTestRequest{constructor(e,t,n,i,o){super(e,t,n,i),this._ctx=e,o?(this.target=o,this.targetPath=PartFingerprints.collect(o,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\n\ttarget: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?CursorColumns.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return MouseTarget.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return MouseTarget.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,n,i){return MouseTarget.createMargin(e,this.target,this._getMouseColumn(t),t,n,i)}fulfillViewZone(e,t,n){return MouseTarget.createViewZone(e,this.target,this._getMouseColumn(t),t,n)}fulfillContentText(e,t,n){return MouseTarget.createContentText(this.target,this._getMouseColumn(e),e,t,n)}fulfillContentEmpty(e,t){return MouseTarget.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return MouseTarget.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return MouseTarget.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return MouseTarget.createOverlayWidget(this.target,this._getMouseColumn(),e)}withTarget(e){return new HitTestRequest(this._ctx,this.editorPos,this.pos,this.relativePos,e)}}const EMPTY_CONTENT_AFTER_LINES={isAfterLines:!0};function createEmptyContentDataInLines(e){return{isAfterLines:!1,horizontalDistanceToText:e}}class MouseTargetFactory{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,n=PartFingerprints.collect(t,this._viewHelper.viewDomNode);return!(!ElementPath.isChildOfContentWidgets(n)&&!ElementPath.isChildOfOverflowingContentWidgets(n))||!!ElementPath.isChildOfOverlayWidgets(n)}createMouseTarget(e,t,n,i,o){const r=new HitTestContext(this._context,this._viewHelper,e),s=new HitTestRequest(r,t,n,i,o);try{return MouseTargetFactory._createMouseTarget(r,s,!1)}catch(a){return s.fulfillUnknown()}}static _createMouseTarget(e,t,n){if(null===t.target){if(n)return t.fulfillUnknown();const i=MouseTargetFactory._doHitTest(e,t);return 1===i.type?MouseTargetFactory.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):this._createMouseTarget(e,t.withTarget(i.hitTarget),!0)}const i=t;let o=null;return o=o||MouseTargetFactory._hitTestContentWidget(e,i),o=o||MouseTargetFactory._hitTestOverlayWidget(e,i),o=o||MouseTargetFactory._hitTestMinimap(e,i),o=o||MouseTargetFactory._hitTestScrollbarSlider(e,i),o=o||MouseTargetFactory._hitTestViewZone(e,i),o=o||MouseTargetFactory._hitTestMargin(e,i),o=o||MouseTargetFactory._hitTestViewCursor(e,i),o=o||MouseTargetFactory._hitTestTextArea(e,i),o=o||MouseTargetFactory._hitTestViewLines(e,i,n),o=o||MouseTargetFactory._hitTestScrollbar(e,i),o||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(ElementPath.isChildOfContentWidgets(t.targetPath)||ElementPath.isChildOfOverflowingContentWidgets(t.targetPath)){const n=e.findAttribute(t.target,"widgetId");return n?t.fulfillContentWidget(n):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(ElementPath.isChildOfOverlayWidgets(t.targetPath)){const n=e.findAttribute(t.target,"widgetId");return n?t.fulfillOverlayWidget(n):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const n=e.lastRenderData.lastViewCursorsRenderData;for(const e of n)if(t.target===e.domNode)return t.fulfillContentText(e.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const n=e.lastRenderData.lastViewCursorsRenderData,i=t.mouseContentHorizontalOffset,o=t.mouseVerticalOffset;for(const r of n){if(i<r.contentLeft)continue;if(i>r.contentLeft+r.width)continue;const n=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(n<=o&&o<=n+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const n=e.getZoneAtCoord(t.mouseVerticalOffset);if(n){const e=t.isInContentArea?8:5;return t.fulfillViewZone(e,n.position,n)}return null}static _hitTestTextArea(e,t){return ElementPath.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const n=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),i=n.range.getStartPosition();let o=Math.abs(t.relativePos.x);const r={isAfterLines:n.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,i,n.range,r):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,i,n.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,i,n.range,r)))}return null}static _hitTestViewLines(e,t,n){if(!ElementPath.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new Position$1(1,1),EMPTY_CONTENT_AFTER_LINES);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const n=e.viewModel.getLineCount(),i=e.viewModel.getLineMaxColumn(n);return t.fulfillContentEmpty(new Position$1(n,i),EMPTY_CONTENT_AFTER_LINES)}if(n){if(ElementPath.isStrictChildOfViewLines(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.viewModel.getLineLength(n)){const i=e.getLineWidth(n),o=createEmptyContentDataInLines(t.mouseContentHorizontalOffset-i);return t.fulfillContentEmpty(new Position$1(n,1),o)}const i=e.getLineWidth(n);if(t.mouseContentHorizontalOffset>=i){const o=createEmptyContentDataInLines(t.mouseContentHorizontalOffset-i),r=new Position$1(n,e.viewModel.getLineMaxColumn(n));return t.fulfillContentEmpty(r,o)}}return t.fulfillUnknown()}const i=MouseTargetFactory._doHitTest(e,t);return 1===i.type?MouseTargetFactory.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):this._createMouseTarget(e,t.withTarget(i.hitTarget),!0)}static _hitTestMinimap(e,t){if(ElementPath.isChildOfMinimap(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),i=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new Position$1(n,i))}return null}static _hitTestScrollbarSlider(e,t){if(ElementPath.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){const n=t.target.className;if(n&&/\b(slider|scrollbar)\b/.test(n)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),i=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new Position$1(n,i))}}return null}static _hitTestScrollbar(e,t){if(ElementPath.isChildOfScrollableElement(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),i=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new Position$1(n,i))}return null}getMouseColumn(e){const t=this._context.configuration.options,n=t.get(131),i=this._context.viewLayout.getCurrentScrollLeft()+e.x-n.contentLeft;return MouseTargetFactory._getMouseColumn(i,t.get(44).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){if(e<0)return 1;return Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,n,i,o){const r=i.lineNumber,s=i.column,a=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>a){const e=createEmptyContentDataInLines(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(i,e)}const l=e.visibleRangeForPosition(r,s);if(!l)return t.fulfillUnknown(i);const c=l.left;if(t.mouseContentHorizontalOffset===c)return t.fulfillContentText(i,null,{mightBeForeignElement:!!o,injectedText:o});const d=[];if(d.push({offset:l.left,column:s}),s>1){const t=e.visibleRangeForPosition(r,s-1);t&&d.push({offset:t.left,column:s-1})}if(s<e.viewModel.getLineMaxColumn(r)){const t=e.visibleRangeForPosition(r,s+1);t&&d.push({offset:t.left,column:s+1})}d.sort(((e,t)=>e.offset-t.offset));const u=t.pos.toClientCoordinates(),h=n.getBoundingClientRect(),g=h.left<=u.clientX&&u.clientX<=h.right;for(let p=1;p<d.length;p++){const e=d[p-1],n=d[p];if(e.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=n.offset){const s=new Range$2(r,e.column,r,n.column);return t.fulfillContentText(i,s,{mightBeForeignElement:!g||!!o,injectedText:o})}}return t.fulfillContentText(i,null,{mightBeForeignElement:!g||!!o,injectedText:o})}static _doHitTestWithCaretRangeFromPoint(e,t){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),i=e.getVerticalOffsetForLineNumber(n)+Math.floor(e.lineHeight/2);let o=t.pos.y+(i-t.mouseVerticalOffset);o<=t.editorPos.y&&(o=t.editorPos.y+1),o>=t.editorPos.y+t.editorPos.height&&(o=t.editorPos.y+t.editorPos.height-1);const r=new PageCoordinates(t.pos.x,o),s=this._actualDoHitTestWithCaretRangeFromPoint(e,r.toClientCoordinates());return 1===s.type?s:this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const n=getShadowRoot(e.viewDomNode);let i;if(i=n?void 0===n.caretRangeFromPoint?shadowCaretRangeFromPoint(n,t.clientX,t.clientY):n.caretRangeFromPoint(t.clientX,t.clientY):document.caretRangeFromPoint(t.clientX,t.clientY),!i||!i.startContainer)return new UnknownHitTestResult;const o=i.startContainer;if(o.nodeType===o.TEXT_NODE){const t=o.parentNode,n=t?t.parentNode:null,r=n?n.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===ViewLine.CLASS_NAME?HitTestResult.createFromDOMInfo(e,t,i.startOffset):new UnknownHitTestResult(o.parentNode)}if(o.nodeType===o.ELEMENT_NODE){const t=o.parentNode,n=t?t.parentNode:null;return(n&&n.nodeType===n.ELEMENT_NODE?n.className:null)===ViewLine.CLASS_NAME?HitTestResult.createFromDOMInfo(e,o,o.textContent.length):new UnknownHitTestResult(o)}return new UnknownHitTestResult}static _doHitTestWithCaretPositionFromPoint(e,t){const n=document.caretPositionFromPoint(t.clientX,t.clientY);if(n.offsetNode.nodeType===n.offsetNode.TEXT_NODE){const t=n.offsetNode.parentNode,i=t?t.parentNode:null,o=i?i.parentNode:null;return(o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===ViewLine.CLASS_NAME?HitTestResult.createFromDOMInfo(e,n.offsetNode.parentNode,n.offset):new UnknownHitTestResult(n.offsetNode.parentNode)}if(n.offsetNode.nodeType===n.offsetNode.ELEMENT_NODE){const t=n.offsetNode.parentNode,i=t&&t.nodeType===t.ELEMENT_NODE?t.className:null,o=t?t.parentNode:null,r=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(i===ViewLine.CLASS_NAME){const t=n.offsetNode.childNodes[Math.min(n.offset,n.offsetNode.childNodes.length-1)];if(t)return HitTestResult.createFromDOMInfo(e,t,0)}else if(r===ViewLine.CLASS_NAME)return HitTestResult.createFromDOMInfo(e,n.offsetNode,0)}return new UnknownHitTestResult(n.offsetNode)}static _snapToSoftTabBoundary(e,t){const n=t.getLineContent(e.lineNumber),{tabSize:i}=t.model.getOptions(),o=AtomicTabMoveOperations.atomicPosition(n,e.column-1,i,2);return-1!==o?new Position$1(e.lineNumber,o+1):e}static _doHitTest(e,t){let n=new UnknownHitTestResult;if("function"==typeof document.caretRangeFromPoint?n=this._doHitTestWithCaretRangeFromPoint(e,t):document.caretPositionFromPoint&&(n=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),1===n.type){const t=e.viewModel.getInjectedTextAt(n.position),i=e.viewModel.normalizePosition(n.position,2);!t&&i.equals(n.position)||(n=new ContentHitTestResult(i,n.spanNode,t))}return 1===n.type&&e.stickyTabStops&&(n=new ContentHitTestResult(this._snapToSoftTabBoundary(n.position,e.viewModel),n.spanNode,n.injectedText)),n}}function shadowCaretRangeFromPoint(e,t,n){const i=document.createRange();let o=e.elementFromPoint(t,n);if(null!==o){for(;o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE&&o.lastChild&&o.lastChild.firstChild;)o=o.lastChild;const e=o.getBoundingClientRect(),n=window.getComputedStyle(o,null).getPropertyValue("font"),r=o.innerText;let s,a=e.left,l=0;if(t>e.left+e.width)l=r.length;else{const e=CharWidthReader.getInstance();for(let i=0;i<r.length+1;i++){if(s=e.getCharWidth(r.charAt(i),n)/2,a+=s,t<a){l=i;break}a+=s}}i.setStart(o.firstChild,l),i.setEnd(o.firstChild,l)}return i}class CharWidthReader{constructor(){this._cache={},this._canvas=document.createElement("canvas")}static getInstance(){return CharWidthReader._INSTANCE||(CharWidthReader._INSTANCE=new CharWidthReader),CharWidthReader._INSTANCE}getCharWidth(e,t){const n=e+t;if(this._cache[n])return this._cache[n];const i=this._canvas.getContext("2d");i.font=t;const o=i.measureText(e).width;return this._cache[n]=o,o}}function createMouseMoveEventMerger(e){return function(t,n){let i=!1;return e&&(i=e.mouseTargetIsWidget(n)),i||n.preventDefault(),n}}CharWidthReader._INSTANCE=null;class MouseHandler extends ViewEventHandler{constructor(e,t,n){super(),this._context=e,this.viewController=t,this.viewHelper=n,this.mouseTargetFactory=new MouseTargetFactory(this._context,n),this._mouseDownOperation=this._register(new MouseDownOperation(this._context,this.viewController,this.viewHelper,((e,t)=>this._createMouseTarget(e,t)),(e=>this._getMouseColumn(e)))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(131).height;const i=new EditorMouseEventFactory(this.viewHelper.viewDomNode);this._register(i.onContextMenu(this.viewHelper.viewDomNode,(e=>this._onContextMenu(e,!0)))),this._register(i.onMouseMoveThrottled(this.viewHelper.viewDomNode,(e=>this._onMouseMove(e)),createMouseMoveEventMerger(this.mouseTargetFactory),MouseHandler.MOUSE_MOVE_MINIMUM_TIME)),this._register(i.onMouseUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(i.onMouseLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e)))),this._register(i.onMouseDown(this.viewHelper.viewDomNode,(e=>this._onMouseDown(e))));this._register(addDisposableListener(this.viewHelper.viewDomNode,EventType$1.MOUSE_WHEEL,(e=>{if(this.viewController.emitMouseWheel(e),!this._context.configuration.options.get(68))return;const t=new StandardWheelEvent(e);if(isMacintosh?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey){const e=EditorZoom.getZoomLevel(),n=t.deltaY>0?1:-1;EditorZoom.setZoomLevel(e+n),t.preventDefault(),t.stopPropagation()}}),{capture:!0,passive:!1})),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(131)){const e=this._context.configuration.options.get(131).height;this._height!==e&&(this._height=e,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}onScrollChanged(e){return this._mouseDownOperation.onScrollChanged(),!1}getTargetAtClientPoint(e,t){const n=new ClientCoordinates(e,t).toPageCoordinates(),i=createEditorPagePosition(this.viewHelper.viewDomNode);if(n.y<i.y||n.y>i.y+i.height||n.x<i.x||n.x>i.x+i.width)return null;const o=createCoordinatesRelativeToEditor(this.viewHelper.viewDomNode,i,n);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),i,n,o,null)}_createMouseTarget(e,t){let n=e.target;if(!this.viewHelper.viewDomNode.contains(n)){const t=getShadowRoot(this.viewHelper.viewDomNode);t&&(n=t.elementsFromPoint(e.posx,e.posy).find((e=>this.viewHelper.viewDomNode.contains(e))))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?n:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){if(this._mouseDownOperation.isActive())return;e.timestamp<this.lastMouseLeaveTime||this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)})}_onMouseLeave(e){this.lastMouseLeaveTime=(new Date).getTime(),this.viewController.emitMouseLeave({event:e,target:null})}_onMouseUp(e){this.viewController.emitMouseUp({event:e,target:this._createMouseTarget(e,!0)})}_onMouseDown(e){const t=this._createMouseTarget(e,!0),n=6===t.type||7===t.type,i=2===t.type||3===t.type||4===t.type,o=3===t.type,r=this._context.configuration.options.get(98),s=8===t.type||5===t.type,a=9===t.type;let l=e.leftButton||e.middleButton;isMacintosh&&e.leftButton&&e.ctrlKey&&(l=!1);const c=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(l&&(n||o&&r))c(),this._mouseDownOperation.start(t.type,e);else if(i)e.preventDefault();else if(s){const n=t.detail;this.viewHelper.shouldSuppressMouseDownOnViewZone(n.viewZoneId)&&(c(),this._mouseDownOperation.start(t.type,e),e.preventDefault())}else a&&this.viewHelper.shouldSuppressMouseDownOnWidget(t.detail)&&(c(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:t})}}MouseHandler.MOUSE_MOVE_MINIMUM_TIME=100;class MouseDownOperation extends Disposable{constructor(e,t,n,i,o){super(),this._context=e,this._viewController=t,this._viewHelper=n,this._createMouseTarget=i,this._getMouseColumn=o,this._mouseMoveMonitor=this._register(new GlobalEditorMouseMoveMonitor(this._viewHelper.viewDomNode)),this._onScrollTimeout=this._register(new TimeoutTimer),this._mouseState=new MouseDownState,this._currentSelection=new Selection$1(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!0);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):this._dispatchMouse(t,!0))}start(e,t){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(3===e),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.position),t.detail=this._mouseState.count;const i=this._context.configuration.options;if(!i.get(81)&&i.get(31)&&!i.get(18)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&6===n.type&&n.position&&this._currentSelection.containsPosition(n.position))return this._mouseState.isDragAndDrop=!0,this._isActive=!0,void this._mouseMoveMonitor.startMonitoring(t.target,t.buttons,createMouseMoveEventMerger(null),(e=>this._onMouseDownThenMove(e)),(e=>{const t=this._findMousePosition(this._lastMouseEvent,!0);e&&e instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:t?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()}));this._mouseState.isDragAndDrop=!1,this._dispatchMouse(n,t.shiftKey),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(t.target,t.buttons,createMouseMoveEventMerger(null),(e=>this._onMouseDownThenMove(e)),(()=>this._stop())))}_stop(){this._isActive=!1,this._onScrollTimeout.cancel()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onScrollChanged(){this._isActive&&this._onScrollTimeout.setIfNotSet((()=>{if(!this._lastMouseEvent)return;const e=this._findMousePosition(this._lastMouseEvent,!1);e&&(this._mouseState.isDragAndDrop||this._dispatchMouse(e,!0))}),10)}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,n=this._context.viewModel,i=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posy<t.y){const n=Math.max(i.getCurrentScrollTop()-(t.y-e.posy),0),r=HitTestContext.getZoneAtCoord(this._context,n);if(r){const e=this._helpPositionJumpOverViewZone(r);if(e)return MouseTarget.createOutsideEditor(o,e)}const s=i.getLineNumberAtVerticalOffset(n);return MouseTarget.createOutsideEditor(o,new Position$1(s,1))}if(e.posy>t.y+t.height){const t=i.getCurrentScrollTop()+e.relativePos.y,r=HitTestContext.getZoneAtCoord(this._context,t);if(r){const e=this._helpPositionJumpOverViewZone(r);if(e)return MouseTarget.createOutsideEditor(o,e)}const s=i.getLineNumberAtVerticalOffset(t);return MouseTarget.createOutsideEditor(o,new Position$1(s,n.getLineMaxColumn(s)))}const r=i.getLineNumberAtVerticalOffset(i.getCurrentScrollTop()+e.relativePos.y);return e.posx<t.x?MouseTarget.createOutsideEditor(o,new Position$1(r,1)):e.posx>t.x+t.width?MouseTarget.createOutsideEditor(o,new Position$1(r,n.getLineMaxColumn(r))):null}_findMousePosition(e,t){const n=this._getPositionOutsideEditor(e);if(n)return n;const i=this._createMouseTarget(e,t);if(!i.position)return null;if(8===i.type||5===i.type){const e=this._helpPositionJumpOverViewZone(i.detail);if(e)return MouseTarget.createViewZone(i.type,i.element,i.mouseColumn,e,i.detail)}return i}_helpPositionJumpOverViewZone(e){const t=new Position$1(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),n=e.positionBefore,i=e.positionAfter;return n&&i?n.isBefore(t)?n:i:null}_dispatchMouse(e,t){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:6===e.type&&null!==e.detail.injectedText})}}class MouseDownState{constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const n=(new Date).getTime();n-this._lastSetMouseDownCountTime>MouseDownState.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=n,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}var Mimes,Mimes2,TextAreaSyntethicEvents;MouseDownState.CLEAR_MOUSE_DOWN_COUNT_TIME=400,Mimes2=Mimes||(Mimes={}),Mimes2.text="text/plain",Mimes2.binary="application/octet-stream",Mimes2.unknown="application/unknown",Mimes2.markdown="text/markdown",Mimes2.latex="text/latex",Mimes2.uriList="text/uri-list";class TextAreaState{constructor(e,t,n,i,o){this.value=e,this.selectionStart=t,this.selectionEnd=n,this.selectionStartPosition=i,this.selectionEndPosition=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e){return new TextAreaState(e.getValue(),e.getSelectionStart(),e.getSelectionEnd(),null,null)}collapseSelection(){return new TextAreaState(this.value,this.value.length,this.value.length,null,null)}writeToTextArea(e,t,n){t.setValue(e,this.value),n&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const t=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selectionStartPosition,t,-1)}if(e>=this.selectionEnd){const t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selectionEndPosition,t,1)}const t=this.value.substring(this.selectionStart,e);if(-1===t.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(this.selectionStartPosition,t,1);const n=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selectionEndPosition,n,-1)}_finishDeduceEditorPosition(e,t,n){let i=0,o=-1;for(;-1!==(o=t.indexOf("\n",o+1));)i++;return[e,n*t.length,i]}static deduceInput(e,t,n){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const i=Math.min(commonPrefixLength(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(commonSuffixLength(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(i,e.value.length-o);const r=t.value.substring(i,t.value.length-o),s=e.selectionStart-i,a=e.selectionEnd-i;if(t.selectionStart-i===t.selectionEnd-i){return{text:r,replacePrevCharCnt:e.selectionStart-i,replaceNextCharCnt:0,positionDelta:0}}return{text:r,replacePrevCharCnt:a-s,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const n=Math.min(commonPrefixLength(e.value,t.value),e.selectionEnd),i=Math.min(commonSuffixLength(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(n,e.value.length-i),r=t.value.substring(n,t.value.length-i);e.selectionStart;const s=e.selectionEnd-n;t.selectionStart;const a=t.selectionEnd-n;return{text:r,replacePrevCharCnt:s,replaceNextCharCnt:o.length-s,positionDelta:a-r.length}}}TextAreaState.EMPTY=new TextAreaState("",0,0,null,null);class PagedScreenReaderStrategy{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const n=e*t;return new Range$2(n+1,1,n+t+1,1)}static fromEditorSelection(e,t,n,i,o){const r=PagedScreenReaderStrategy._getPageOfLine(n.startLineNumber,i),s=PagedScreenReaderStrategy._getRangeForPage(r,i),a=PagedScreenReaderStrategy._getPageOfLine(n.endLineNumber,i),l=PagedScreenReaderStrategy._getRangeForPage(a,i),c=s.intersectRanges(new Range$2(1,1,n.startLineNumber,n.startColumn));let d=t.getValueInRange(c,1);const u=t.getLineCount(),h=t.getLineMaxColumn(u),g=l.intersectRanges(new Range$2(n.endLineNumber,n.endColumn,u,h));let p,f=t.getValueInRange(g,1);if(r===a||r+1===a)p=t.getValueInRange(n,1);else{const e=s.intersectRanges(n),i=l.intersectRanges(n);p=t.getValueInRange(e,1)+String.fromCharCode(8230)+t.getValueInRange(i,1)}if(o){const e=500;d.length>e&&(d=d.substring(d.length-e,d.length)),f.length>e&&(f=f.substring(0,e)),p.length>2*e&&(p=p.substring(0,e)+String.fromCharCode(8230)+p.substring(p.length-e,p.length))}return new TextAreaState(d+p+f,d.length,d.length+p.length,new Position$1(n.startLineNumber,n.startColumn),new Position$1(n.endLineNumber,n.endColumn))}}(TextAreaSyntethicEvents||(TextAreaSyntethicEvents={})).Tap="-monaco-textarea-synthetic-tap";const CopyOptions={forceCopyWithSyntaxHighlighting:!1};class InMemoryClipboardMetadataManager{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}InMemoryClipboardMetadataManager.INSTANCE=new InMemoryClipboardMetadataManager;class CompositionContext{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){const t={text:e=e||"",replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}class TextAreaInput extends Disposable{constructor(e,t,n,i){super(),this._host=e,this._textArea=t,this._OS=n,this._browser=i,this._onFocus=this._register(new Emitter$1),this.onFocus=this._onFocus.event,this._onBlur=this._register(new Emitter$1),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new Emitter$1),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new Emitter$1),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new Emitter$1),this.onCut=this._onCut.event,this._onPaste=this._register(new Emitter$1),this.onPaste=this._onPaste.event,this._onType=this._register(new Emitter$1),this.onType=this._onType.event,this._onCompositionStart=this._register(new Emitter$1),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new Emitter$1),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new Emitter$1),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new Emitter$1),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new RunOnceScheduler((()=>this._onCut.fire()),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new RunOnceScheduler((()=>this.writeScreenReaderContent("asyncFocusGain")),0)),this._textAreaState=TextAreaState.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let o=null;this._register(this._textArea.onKeyDown((e=>{const t=new StandardKeyboardEvent(e);(109===t.keyCode||this._currentComposition&&1===t.keyCode)&&t.stopPropagation(),t.equals(9)&&t.preventDefault(),o=t,this._onKeyDown.fire(t)}))),this._register(this._textArea.onKeyUp((e=>{const t=new StandardKeyboardEvent(e);this._onKeyUp.fire(t)}))),this._register(this._textArea.onCompositionStart((e=>{const t=new CompositionContext;if(this._currentComposition)this._currentComposition=t;else{if(this._currentComposition=t,2===this._OS&&o&&o.equals(109)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&("ArrowRight"===o.code||"ArrowLeft"===o.code))return t.handleCompositionUpdate("x"),void this._onCompositionStart.fire({data:e.data});this._browser.isAndroid,this._onCompositionStart.fire({data:e.data})}}))),this._register(this._textArea.onCompositionUpdate((e=>{const t=this._currentComposition;if(!t)return;if(this._browser.isAndroid){const t=TextAreaState.readFromTextArea(this._textArea),n=TextAreaState.deduceAndroidCompositionInput(this._textAreaState,t);return this._textAreaState=t,this._onType.fire(n),void this._onCompositionUpdate.fire(e)}const n=t.handleCompositionUpdate(e.data);this._textAreaState=TextAreaState.readFromTextArea(this._textArea),this._onType.fire(n),this._onCompositionUpdate.fire(e)}))),this._register(this._textArea.onCompositionEnd((e=>{const t=this._currentComposition;if(!t)return;if(this._currentComposition=null,this._browser.isAndroid){const e=TextAreaState.readFromTextArea(this._textArea),t=TextAreaState.deduceAndroidCompositionInput(this._textAreaState,e);return this._textAreaState=e,this._onType.fire(t),void this._onCompositionEnd.fire()}const n=t.handleCompositionUpdate(e.data);this._textAreaState=TextAreaState.readFromTextArea(this._textArea),this._onType.fire(n),this._onCompositionEnd.fire()}))),this._register(this._textArea.onInput((e=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const t=TextAreaState.readFromTextArea(this._textArea),n=TextAreaState.deduceInput(this._textAreaState,t,2===this._OS);0===n.replacePrevCharCnt&&1===n.text.length&&isHighSurrogate(n.text.charCodeAt(0))||(this._textAreaState=t,""===n.text&&0===n.replacePrevCharCnt&&0===n.replaceNextCharCnt&&0===n.positionDelta||this._onType.fire(n))}))),this._register(this._textArea.onCut((e=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()}))),this._register(this._textArea.onCopy((e=>{this._ensureClipboardGetsEditorSelection(e)}))),this._register(this._textArea.onPaste((e=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),e.preventDefault(),!e.clipboardData)return;let[t,n]=ClipboardEventUtils.getTextData(e.clipboardData);t&&(n=n||InMemoryClipboardMetadataManager.INSTANCE.get(t),this._onPaste.fire({text:t,metadata:n}))}))),this._register(this._textArea.onFocus((()=>{const e=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!e&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()}))),this._register(this._textArea.onBlur((()=>{this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)}))),this._register(this._textArea.onSyntheticTap((()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())})))}_installSelectionChangeListener(){let e=0;return addDisposableListener(document,"selectionchange",(t=>{if(!this._hasFocus)return;if(this._currentComposition)return;if(!this._browser.isChrome)return;const n=Date.now(),i=n-e;if(e=n,i<5)return;const o=n-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100)return;if(!this._textAreaState.selectionStartPosition||!this._textAreaState.selectionEndPosition)return;const r=this._textArea.getValue();if(this._textAreaState.value!==r)return;const s=this._textArea.getSelectionStart(),a=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===s&&this._textAreaState.selectionEnd===a)return;const l=this._textAreaState.deduceEditorPosition(s),c=this._host.deduceModelPosition(l[0],l[1],l[2]),d=this._textAreaState.deduceEditorPosition(a),u=this._host.deduceModelPosition(d[0],d[1],d[2]),h=new Selection$1(c.lineNumber,c.column,u.lineNumber,u.column);this._onSelectionChangeRequest.fire(h)}))}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeScreenReaderContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeScreenReaderContent(e){this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent(this._textAreaState))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),n={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};InMemoryClipboardMetadataManager.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,"\n"):t.text,n),e.preventDefault(),e.clipboardData&&ClipboardEventUtils.setTextData(e.clipboardData,t.text,t.html,n)}}class ClipboardEventUtils{static getTextData(e){const t=e.getData(Mimes.text);let n=null;const i=e.getData("vscode-editor-data");if("string"==typeof i)try{n=JSON.parse(i),1!==n.version&&(n=null)}catch(o){}return[t,n]}static setTextData(e,t,n,i){e.setData(Mimes.text,t),"string"==typeof n&&e.setData("text/html",n),e.setData("vscode-editor-data",JSON.stringify(i))}}class TextAreaWrapper extends Disposable{constructor(e){super(),this._actual=e,this.onKeyDown=this._register(createEventEmitter(this._actual,"keydown")).event,this.onKeyUp=this._register(createEventEmitter(this._actual,"keyup")).event,this.onCompositionStart=this._register(createEventEmitter(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(createEventEmitter(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(createEventEmitter(this._actual,"compositionend")).event,this.onInput=this._register(createEventEmitter(this._actual,"input")).event,this.onCut=this._register(createEventEmitter(this._actual,"cut")).event,this.onCopy=this._register(createEventEmitter(this._actual,"copy")).event,this.onPaste=this._register(createEventEmitter(this._actual,"paste")).event,this.onFocus=this._register(createEventEmitter(this._actual,"focus")).event,this.onBlur=this._register(createEventEmitter(this._actual,"blur")).event,this._onSyntheticTap=this._register(new Emitter$1),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(addDisposableListener(this._actual,TextAreaSyntethicEvents.Tap,(()=>this._onSyntheticTap.fire())))}hasFocus(){const e=getShadowRoot(this._actual);return e?e.activeElement===this._actual:!!isInDOM(this._actual)&&document.activeElement===this._actual}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const n=this._actual;n.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),n.value=t)}getSelectionStart(){return"backward"===this._actual.selectionDirection?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return"backward"===this._actual.selectionDirection?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,n){const i=this._actual;let o=null;const r=getShadowRoot(i);o=r?r.activeElement:document.activeElement;const s=o===i,a=i.selectionStart,l=i.selectionEnd;if(s&&a===t&&l===n)isFirefox&&window.parent!==window&&i.focus();else{if(s)return this.setIgnoreSelectionChangeTime("setSelectionRange"),i.setSelectionRange(t,n),void(isFirefox&&window.parent!==window&&i.focus());try{const e=saveParentsScrollTop(i);this.setIgnoreSelectionChangeTime("setSelectionRange"),i.focus(),i.setSelectionRange(t,n),restoreParentsScrollTop(i,e)}catch(e2){}}}}class PointerEventHandler extends MouseHandler{constructor(e,t,n){super(e,t,n),this._register(Gesture.addTarget(this.viewHelper.linesContentDomNode)),this._register(addDisposableListener(this.viewHelper.linesContentDomNode,EventType.Tap,(e=>this.onTap(e)))),this._register(addDisposableListener(this.viewHelper.linesContentDomNode,EventType.Change,(e=>this.onChange(e)))),this._register(addDisposableListener(this.viewHelper.linesContentDomNode,EventType.Contextmenu,(e=>this._onContextMenu(new EditorMouseEvent(e,this.viewHelper.viewDomNode),!1)))),this._lastPointerType="mouse",this._register(addDisposableListener(this.viewHelper.linesContentDomNode,"pointerdown",(e=>{const t=e.pointerType;this._lastPointerType="mouse"!==t?"touch"===t?"touch":"pen":"mouse"})));const i=new EditorPointerEventFactory(this.viewHelper.viewDomNode);this._register(i.onPointerMoveThrottled(this.viewHelper.viewDomNode,(e=>this._onMouseMove(e)),createMouseMoveEventMerger(this.mouseTargetFactory),MouseHandler.MOUSE_MOVE_MINIMUM_TIME)),this._register(i.onPointerUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(i.onPointerLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e)))),this._register(i.onPointerDown(this.viewHelper.viewDomNode,(e=>this._onMouseDown(e))))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new EditorMouseEvent(e,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:6===t.type&&null!==t.detail.injectedText})}onChange(e){"touch"===this._lastPointerType&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e){"touch"!==e.browserEvent.pointerType&&super._onMouseDown(e)}}class TouchHandler extends MouseHandler{constructor(e,t,n){super(e,t,n),this._register(Gesture.addTarget(this.viewHelper.linesContentDomNode)),this._register(addDisposableListener(this.viewHelper.linesContentDomNode,EventType.Tap,(e=>this.onTap(e)))),this._register(addDisposableListener(this.viewHelper.linesContentDomNode,EventType.Change,(e=>this.onChange(e)))),this._register(addDisposableListener(this.viewHelper.linesContentDomNode,EventType.Contextmenu,(e=>this._onContextMenu(new EditorMouseEvent(e,this.viewHelper.viewDomNode),!1))))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new EditorMouseEvent(e,this.viewHelper.viewDomNode),!1);if(t.position){const e=document.createEvent("CustomEvent");e.initEvent(TextAreaSyntethicEvents.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class PointerHandler extends Disposable{constructor(e,t,n){super(),isIOS&&BrowserFeatures.pointerEvents?this.handler=this._register(new PointerEventHandler(e,t,n)):window.TouchEvent?this.handler=this._register(new TouchHandler(e,t,n)):this.handler=this._register(new MouseHandler(e,t,n))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}var textAreaHandler="",lineNumbers="";class DynamicViewOverlay extends ViewEventHandler{}const editorLineHighlight=registerColor("editor.lineHighlightBackground",{dark:null,light:null,hc:null},localize("lineHighlight","Background color for the highlight of line at the cursor position.")),editorLineHighlightBorder=registerColor("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hc:"#f38518"},localize("lineHighlightBorderBox","Background color for the border around the line at the cursor position.")),editorRangeHighlight=registerColor("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hc:null},localize("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0),editorRangeHighlightBorder=registerColor("editor.rangeHighlightBorder",{dark:null,light:null,hc:activeContrastBorder},localize("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0),editorSymbolHighlight=registerColor("editor.symbolHighlightBackground",{dark:editorFindMatchHighlight,light:editorFindMatchHighlight,hc:null},localize("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0),editorSymbolHighlightBorder=registerColor("editor.symbolHighlightBorder",{dark:null,light:null,hc:activeContrastBorder},localize("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0),editorCursorForeground=registerColor("editorCursor.foreground",{dark:"#AEAFAD",light:Color.black,hc:Color.white},localize("caret","Color of the editor cursor.")),editorCursorBackground=registerColor("editorCursor.background",null,localize("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),editorWhitespaces=registerColor("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hc:"#e3e4e229"},localize("editorWhitespaces","Color of whitespace characters in the editor.")),editorIndentGuides=registerColor("editorIndentGuide.background",{dark:editorWhitespaces,light:editorWhitespaces,hc:editorWhitespaces},localize("editorIndentGuides","Color of the editor indentation guides.")),editorActiveIndentGuides=registerColor("editorIndentGuide.activeBackground",{dark:editorWhitespaces,light:editorWhitespaces,hc:editorWhitespaces},localize("editorActiveIndentGuide","Color of the active editor indentation guides.")),editorLineNumbers=registerColor("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hc:Color.white},localize("editorLineNumbers","Color of editor line numbers.")),deprecatedEditorActiveLineNumber=registerColor("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hc:activeContrastBorder},localize("editorActiveLineNumber","Color of editor active line number"),!1,localize("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),editorActiveLineNumber=registerColor("editorLineNumber.activeForeground",{dark:deprecatedEditorActiveLineNumber,light:deprecatedEditorActiveLineNumber,hc:deprecatedEditorActiveLineNumber},localize("editorActiveLineNumber","Color of editor active line number")),editorRuler=registerColor("editorRuler.foreground",{dark:"#5A5A5A",light:Color.lightgrey,hc:Color.white},localize("editorRuler","Color of the editor rulers."));registerColor("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hc:"#999999"},localize("editorCodeLensForeground","Foreground color of editor CodeLens"));const editorBracketMatchBackground=registerColor("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hc:"#0064001a"},localize("editorBracketMatchBackground","Background color behind matching brackets")),editorBracketMatchBorder=registerColor("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hc:contrastBorder},localize("editorBracketMatchBorder","Color for matching brackets boxes")),editorOverviewRulerBorder=registerColor("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hc:"#7f7f7f4d"},localize("editorOverviewRulerBorder","Color of the overview ruler border.")),editorOverviewRulerBackground=registerColor("editorOverviewRuler.background",null,localize("editorOverviewRulerBackground","Background color of the editor overview ruler. Only used when the minimap is enabled and placed on the right side of the editor.")),editorGutter=registerColor("editorGutter.background",{dark:editorBackground,light:editorBackground,hc:editorBackground},localize("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),editorUnnecessaryCodeBorder=registerColor("editorUnnecessaryCode.border",{dark:null,light:null,hc:Color.fromHex("#fff").transparent(.8)},localize("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor.")),editorUnnecessaryCodeOpacity=registerColor("editorUnnecessaryCode.opacity",{dark:Color.fromHex("#000a"),light:Color.fromHex("#0007"),hc:null},localize("unnecessaryCodeOpacity","Opacity of unnecessary (unused) source code in the editor. For example, \"#000000c0\" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.")),ghostTextBorder=registerColor("editorGhostText.border",{dark:null,light:null,hc:Color.fromHex("#fff").transparent(.8)},localize("editorGhostTextBorder","Border color of ghost text in the editor.")),ghostTextForeground=registerColor("editorGhostText.foreground",{dark:Color.fromHex("#ffffff56"),light:Color.fromHex("#0007"),hc:null},localize("editorGhostTextForeground","Foreground color of the ghost text in the editor.")),ghostTextBackground=registerColor("editorGhostText.background",{dark:null,light:null,hc:null},localize("editorGhostTextBackground","Background color of the ghost text in the editor.")),rulerRangeDefault=new Color(new RGBA(0,122,204,.6));registerColor("editorOverviewRuler.rangeHighlightForeground",{dark:rulerRangeDefault,light:rulerRangeDefault,hc:rulerRangeDefault},localize("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0);const overviewRulerError=registerColor("editorOverviewRuler.errorForeground",{dark:new Color(new RGBA(255,18,18,.7)),light:new Color(new RGBA(255,18,18,.7)),hc:new Color(new RGBA(255,50,50,1))},localize("overviewRuleError","Overview ruler marker color for errors.")),overviewRulerWarning=registerColor("editorOverviewRuler.warningForeground",{dark:editorWarningForeground,light:editorWarningForeground,hc:editorWarningBorder},localize("overviewRuleWarning","Overview ruler marker color for warnings.")),overviewRulerInfo=registerColor("editorOverviewRuler.infoForeground",{dark:editorInfoForeground,light:editorInfoForeground,hc:editorInfoBorder},localize("overviewRuleInfo","Overview ruler marker color for infos.")),editorBracketHighlightingForeground1=registerColor("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hc:"#FFD700"},localize("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),editorBracketHighlightingForeground2=registerColor("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hc:"#DA70D6"},localize("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),editorBracketHighlightingForeground3=registerColor("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hc:"#87CEFA"},localize("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),editorBracketHighlightingForeground4=registerColor("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},localize("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),editorBracketHighlightingForeground5=registerColor("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},localize("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),editorBracketHighlightingForeground6=registerColor("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},localize("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),editorBracketHighlightingUnexpectedBracketForeground=registerColor("editorBracketHighlight.unexpectedBracket.foreground",{dark:new Color(new RGBA(255,18,18,.8)),light:new Color(new RGBA(255,18,18,.8)),hc:new Color(new RGBA(255,50,50,1))},localize("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),editorBracketPairGuideBackground1=registerColor("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hc:"#00000000"},localize("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),editorBracketPairGuideBackground2=registerColor("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hc:"#00000000"},localize("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),editorBracketPairGuideBackground3=registerColor("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hc:"#00000000"},localize("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),editorBracketPairGuideBackground4=registerColor("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},localize("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),editorBracketPairGuideBackground5=registerColor("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},localize("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),editorBracketPairGuideBackground6=registerColor("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},localize("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),editorBracketPairGuideActiveBackground1=registerColor("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hc:"#00000000"},localize("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),editorBracketPairGuideActiveBackground2=registerColor("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hc:"#00000000"},localize("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),editorBracketPairGuideActiveBackground3=registerColor("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hc:"#00000000"},localize("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),editorBracketPairGuideActiveBackground4=registerColor("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},localize("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),editorBracketPairGuideActiveBackground5=registerColor("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},localize("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),editorBracketPairGuideActiveBackground6=registerColor("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},localize("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));registerColor("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hc:"#ff0000"},localize("editorUnicodeHighlight.border","Border color used to highlight unicode characters.")),registerThemingParticipant(((e,t)=>{const n=e.getColor(editorBackground);n&&t.addRule(`.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: ${n}; }`);const i=e.getColor(editorForeground);i&&t.addRule(`.monaco-editor, .monaco-editor .inputarea.ime-input { color: ${i}; }`);const o=e.getColor(editorGutter);o&&t.addRule(`.monaco-editor .margin { background-color: ${o}; }`);const r=e.getColor(editorRangeHighlight);r&&t.addRule(`.monaco-editor .rangeHighlight { background-color: ${r}; }`);const s=e.getColor(editorRangeHighlightBorder);s&&t.addRule(`.monaco-editor .rangeHighlight { border: 1px ${"hc"===e.type?"dotted":"solid"} ${s}; }`);const a=e.getColor(editorSymbolHighlight);a&&t.addRule(`.monaco-editor .symbolHighlight { background-color: ${a}; }`);const l=e.getColor(editorSymbolHighlightBorder);l&&t.addRule(`.monaco-editor .symbolHighlight { border: 1px ${"hc"===e.type?"dotted":"solid"} ${l}; }`);const c=e.getColor(editorWhitespaces);c&&(t.addRule(`.monaco-editor .mtkw { color: ${c} !important; }`),t.addRule(`.monaco-editor .mtkz { color: ${c} !important; }`))}));class LineNumbersOverlay extends DynamicViewOverlay{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new Position$1(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(59);const t=e.get(60);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(84);const n=e.get(131);this._lineNumbersLeft=n.lineNumbersLeft,this._lineNumbersWidth=n.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let n=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,n=!0),2!==this._renderLineNumbers&&3!==this._renderLineNumbers||(n=!0),n}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position$1(e,1));if(1!==t.column)return"";const n=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(n);if(2===this._renderLineNumbers){const e=Math.abs(this._lastCursorModelPosition.lineNumber-n);return 0===e?'<span class="relative-current-line-number">'+n+"</span>":String(e)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===n||n%10==0?String(n):"":String(n)}prepareRender(e){if(0===this._renderLineNumbers)return void(this._renderResult=null);const t=isLinux?this._lineHeight%2==0?" lh-even":" lh-odd":"",n=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,o='<div class="'+LineNumbersOverlay.CLASS_NAME+t+'" style="left:'+this._lineNumbersLeft+"px;width:"+this._lineNumbersWidth+'px;">',r=this._context.viewModel.getLineCount(),s=[];for(let a=n;a<=i;a++){const e=a-n;if(!this._renderFinalNewline&&a===r&&0===this._context.viewModel.getLineLength(a)){s[e]="";continue}const i=this._getLineRenderLineNumber(a);i?a===this._activeLineNumber?s[e]='<div class="active-line-number '+LineNumbersOverlay.CLASS_NAME+t+'" style="left:'+this._lineNumbersLeft+"px;width:"+this._lineNumbersWidth+'px;">'+i+"</div>":s[e]=o+i+"</div>":s[e]=""}this._renderResult=s}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}LineNumbersOverlay.CLASS_NAME="line-numbers",registerThemingParticipant(((e,t)=>{const n=e.getColor(editorLineNumbers);n&&t.addRule(`.monaco-editor .line-numbers { color: ${n}; }`);const i=e.getColor(editorActiveLineNumber);i&&t.addRule(`.monaco-editor .line-numbers.active-line-number { color: ${i}; }`)}));class Margin extends ViewPart{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(131);this._canUseLayerHinting=!t.get(28),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._domNode=createFastDomNode(document.createElement("div")),this._domNode.setClassName(Margin.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=createFastDomNode(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(Margin.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(131);return this._canUseLayerHinting=!t.get(28),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const n=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(n),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(n)}}Margin.CLASS_NAME="glyph-margin",Margin.OUTER_CLASS_NAME="margin";var mouseCursor="";const MOUSE_CURSOR_TEXT_CSS_CLASS_NAME="monaco-mouse-cursor-text";var __awaiter$14=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},CompletionItemKinds,InlineCompletionTriggerKind$1,InlineCompletionTriggerKind2,SignatureHelpTriggerKind$1,SignatureHelpTriggerKind2,DocumentHighlightKind$1,DocumentHighlightKind2,SymbolKinds,Command,InlayHintKind$1,InlayHintKind2;class TokenizationRegistry$1{constructor(){this._map=new Map,this._factories=new Map,this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event,this._colorMap=null}fire(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._map.set(e,t),this.fire([e]),toDisposable((()=>{this._map.get(e)===t&&(this._map.delete(e),this.fire([e]))}))}registerFactory(e,t){var n;null===(n=this._factories.get(e))||void 0===n||n.dispose();const i=new TokenizationSupportFactoryData(this,e,t);return this._factories.set(e,i),toDisposable((()=>{const t=this._factories.get(e);t&&t===i&&(this._factories.delete(e),t.dispose())}))}getOrCreate(e){return __awaiter$14(this,void 0,void 0,(function*(){const t=this.get(e);if(t)return t;const n=this._factories.get(e);return!n||n.isResolved?null:(yield n.resolve(),this.get(e))}))}get(e){return this._map.get(e)||null}isResolved(e){if(this.get(e))return!0;const t=this._factories.get(e);return!(t&&!t.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._map.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}}class TokenizationSupportFactoryData extends Disposable{constructor(e,t,n){super(),this._registry=e,this._languageId=t,this._factory=n,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}get isResolved(){return this._isResolved}dispose(){this._isDisposed=!0,super.dispose()}resolve(){return __awaiter$14(this,void 0,void 0,(function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}))}_create(){return __awaiter$14(this,void 0,void 0,(function*(){const e=yield Promise.resolve(this._factory.createTokenizationSupport());this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}))}}class TokenMetadata{static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static getFontStyle(e){return(15360&e)>>>10}static getForeground(e){return(8372224&e)>>>14}static getBackground(e){return(4286578688&e)>>>23}static getClassNameFromMetadata(e){let t="mtk"+this.getForeground(e);const n=this.getFontStyle(e);return 1&n&&(t+=" mtki"),2&n&&(t+=" mtkb"),4&n&&(t+=" mtku"),8&n&&(t+=" mtks"),t}static getInlineStyleFromMetadata(e,t){const n=this.getForeground(e),i=this.getFontStyle(e);let o=`color: ${t[n]};`;1&i&&(o+="font-style: italic;"),2&i&&(o+="font-weight: bold;");let r="";return 4&i&&(r+=" underline"),8&i&&(r+=" line-through"),r&&(o+=`text-decoration:${r};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),n=this.getFontStyle(e);return{foreground:t,italic:Boolean(1&n),bold:Boolean(2&n),underline:Boolean(4&n),strikethrough:Boolean(8&n)}}}class Token$2{constructor(e,t,n){this._tokenBrand=void 0,this.offset=e,this.type=t,this.language=n}toString(){return"("+this.offset+", "+this.type+")"}}class TokenizationResult{constructor(e,t){this._tokenizationResultBrand=void 0,this.tokens=e,this.endState=t}}class EncodedTokenizationResult{constructor(e,t){this._encodedTokenizationResultBrand=void 0,this.tokens=e,this.endState=t}}function isLocationLink(e){return e&&URI.isUri(e.uri)&&Range$2.isIRange(e.range)&&(Range$2.isIRange(e.originSelectionRange)||Range$2.isIRange(e.targetSelectionRange))}!function(e){const t=new Map;t.set(0,Codicon.symbolMethod),t.set(1,Codicon.symbolFunction),t.set(2,Codicon.symbolConstructor),t.set(3,Codicon.symbolField),t.set(4,Codicon.symbolVariable),t.set(5,Codicon.symbolClass),t.set(6,Codicon.symbolStruct),t.set(7,Codicon.symbolInterface),t.set(8,Codicon.symbolModule),t.set(9,Codicon.symbolProperty),t.set(10,Codicon.symbolEvent),t.set(11,Codicon.symbolOperator),t.set(12,Codicon.symbolUnit),t.set(13,Codicon.symbolValue),t.set(15,Codicon.symbolEnum),t.set(14,Codicon.symbolConstant),t.set(15,Codicon.symbolEnum),t.set(16,Codicon.symbolEnumMember),t.set(17,Codicon.symbolKeyword),t.set(27,Codicon.symbolSnippet),t.set(18,Codicon.symbolText),t.set(19,Codicon.symbolColor),t.set(20,Codicon.symbolFile),t.set(21,Codicon.symbolReference),t.set(22,Codicon.symbolCustomColor),t.set(23,Codicon.symbolFolder),t.set(24,Codicon.symbolTypeParameter),t.set(25,Codicon.account),t.set(26,Codicon.issues),e.toIcon=function(e){let n=t.get(e);return n||(n=Codicon.symbolProperty),n};const n=new Map;n.set("method",0),n.set("function",1),n.set("constructor",2),n.set("field",3),n.set("variable",4),n.set("class",5),n.set("struct",6),n.set("interface",7),n.set("module",8),n.set("property",9),n.set("event",10),n.set("operator",11),n.set("unit",12),n.set("value",13),n.set("constant",14),n.set("enum",15),n.set("enum-member",16),n.set("enumMember",16),n.set("keyword",17),n.set("snippet",27),n.set("text",18),n.set("color",19),n.set("file",20),n.set("reference",21),n.set("customcolor",22),n.set("folder",23),n.set("type-parameter",24),n.set("typeParameter",24),n.set("account",25),n.set("issue",26),e.fromString=function(e,t){let i=n.get(e);return void 0!==i||t||(i=9),i}}(CompletionItemKinds||(CompletionItemKinds={})),InlineCompletionTriggerKind2=InlineCompletionTriggerKind$1||(InlineCompletionTriggerKind$1={}),InlineCompletionTriggerKind2[InlineCompletionTriggerKind2.Automatic=0]="Automatic",InlineCompletionTriggerKind2[InlineCompletionTriggerKind2.Explicit=1]="Explicit",SignatureHelpTriggerKind2=SignatureHelpTriggerKind$1||(SignatureHelpTriggerKind$1={}),SignatureHelpTriggerKind2[SignatureHelpTriggerKind2.Invoke=1]="Invoke",SignatureHelpTriggerKind2[SignatureHelpTriggerKind2.TriggerCharacter=2]="TriggerCharacter",SignatureHelpTriggerKind2[SignatureHelpTriggerKind2.ContentChange=3]="ContentChange",DocumentHighlightKind2=DocumentHighlightKind$1||(DocumentHighlightKind$1={}),DocumentHighlightKind2[DocumentHighlightKind2.Text=0]="Text",DocumentHighlightKind2[DocumentHighlightKind2.Read=1]="Read",DocumentHighlightKind2[DocumentHighlightKind2.Write=2]="Write",function(e){const t=new Map;t.set(0,Codicon.symbolFile),t.set(1,Codicon.symbolModule),t.set(2,Codicon.symbolNamespace),t.set(3,Codicon.symbolPackage),t.set(4,Codicon.symbolClass),t.set(5,Codicon.symbolMethod),t.set(6,Codicon.symbolProperty),t.set(7,Codicon.symbolField),t.set(8,Codicon.symbolConstructor),t.set(9,Codicon.symbolEnum),t.set(10,Codicon.symbolInterface),t.set(11,Codicon.symbolFunction),t.set(12,Codicon.symbolVariable),t.set(13,Codicon.symbolConstant),t.set(14,Codicon.symbolString),t.set(15,Codicon.symbolNumber),t.set(16,Codicon.symbolBoolean),t.set(17,Codicon.symbolArray),t.set(18,Codicon.symbolObject),t.set(19,Codicon.symbolKey),t.set(20,Codicon.symbolNull),t.set(21,Codicon.symbolEnumMember),t.set(22,Codicon.symbolStruct),t.set(23,Codicon.symbolEvent),t.set(24,Codicon.symbolOperator),t.set(25,Codicon.symbolTypeParameter),e.toIcon=function(e){let n=t.get(e);return n||(n=Codicon.symbolProperty),n}}(SymbolKinds||(SymbolKinds={}));class FoldingRangeKind{constructor(e){this.value=e}}FoldingRangeKind.Comment=new FoldingRangeKind("comment"),FoldingRangeKind.Imports=new FoldingRangeKind("imports"),FoldingRangeKind.Region=new FoldingRangeKind("region"),(Command||(Command={})).is=function(e){return!(!e||"object"!=typeof e)&&"string"==typeof e.id&&"string"==typeof e.title},InlayHintKind2=InlayHintKind$1||(InlayHintKind$1={}),InlayHintKind2[InlayHintKind2.Type=1]="Type",InlayHintKind2[InlayHintKind2.Parameter=2]="Parameter";const TokenizationRegistry=new TokenizationRegistry$1;class VisibleTextAreaData{constructor(e,t,n,i,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=n,this.widthOfHiddenLineTextBefore=i,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new Position$1(this.modelLineNumber,this.distanceToModelLineStart+1),n=new Position$1(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(this._previousPresentation=e||{foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const canUseZeroSizeTextarea=isFirefox;class TextAreaHandler extends ViewPart{constructor(e,t,n){super(e),this._primaryCursorPosition=new Position$1(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=n,this._scrollLeft=0,this._scrollTop=0;const i=this._context.configuration.options,o=i.get(131);this._setAccessibilityOptions(i),this._contentLeft=o.contentLeft,this._contentWidth=o.contentWidth,this._contentHeight=o.height,this._fontInfo=i.get(44),this._lineHeight=i.get(59),this._emptySelectionClipboard=i.get(32),this._copyWithSyntaxHighlighting=i.get(21),this._visibleTextArea=null,this._selections=[new Selection$1(1,1,1,1)],this._modelSelections=[new Selection$1(1,1,1,1)],this._lastRenderPosition=null,this.textArea=createFastDomNode(document.createElement("textarea")),PartFingerprints.write(this.textArea,6),this.textArea.setClassName(`inputarea ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`),this.textArea.setAttribute("wrap","off"),this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(i)),this.textArea.setAttribute("tabindex",String(i.get(112))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",localize("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),i.get(30)&&i.get(81)&&this.textArea.setAttribute("readonly","true"),this.textAreaCover=createFastDomNode(document.createElement("div")),this.textAreaCover.setPosition("absolute");const r={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:e=>this._context.viewModel.getLineMaxColumn(e),getValueInRange:(e,t)=>this._context.viewModel.getValueInRange(e,t)},s={getDataToCopy:()=>{const e=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,isWindows),t=this._context.viewModel.model.getEOL(),n=this._emptySelectionClipboard&&1===this._modelSelections.length&&this._modelSelections[0].isEmpty(),i=Array.isArray(e)?e:null,o=Array.isArray(e)?e.join(t):e;let r,s=null;if(CopyOptions.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&o.length<65536){const e=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);e&&(r=e.html,s=e.mode)}return{isFromEmptySelection:n,multicursorText:i,text:o,html:r,mode:s}},getScreenReaderContent:e=>{if(1===this._accessibilitySupport){if(isMacintosh){const e=this._selections[0];if(e.isEmpty()){const t=e.getStartPosition();let n=this._getWordBeforePosition(t);if(0===n.length&&(n=this._getCharacterBeforePosition(t)),n.length>0)return new TextAreaState(n,n.length,n.length,t,t)}}return TextAreaState.EMPTY}if(isAndroid){const e=this._selections[0];if(e.isEmpty()){const t=e.getStartPosition(),[n,i]=this._getAndroidWordAtPosition(t);if(n.length>0)return new TextAreaState(n,i,i,t,t)}return TextAreaState.EMPTY}return PagedScreenReaderStrategy.fromEditorSelection(e,r,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport)},deduceModelPosition:(e,t,n)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(e,t,n)},a=this._register(new TextAreaWrapper(this.textArea.domNode));this._textAreaInput=this._register(new TextAreaInput(s,a,OS,browser)),this._register(this._textAreaInput.onKeyDown((e=>{this._viewController.emitKeyDown(e)}))),this._register(this._textAreaInput.onKeyUp((e=>{this._viewController.emitKeyUp(e)}))),this._register(this._textAreaInput.onPaste((e=>{let t=!1,n=null,i=null;e.metadata&&(t=this._emptySelectionClipboard&&!!e.metadata.isFromEmptySelection,n=void 0!==e.metadata.multicursorText?e.metadata.multicursorText:null,i=e.metadata.mode),this._viewController.paste(e.text,t,n,i)}))),this._register(this._textAreaInput.onCut((()=>{this._viewController.cut()}))),this._register(this._textAreaInput.onType((e=>{e.replacePrevCharCnt||e.replaceNextCharCnt||e.positionDelta?this._viewController.compositionType(e.text,e.replacePrevCharCnt,e.replaceNextCharCnt,e.positionDelta):this._viewController.type(e.text)}))),this._register(this._textAreaInput.onSelectionChangeRequest((e=>{this._viewController.setSelection(e)}))),this._register(this._textAreaInput.onCompositionStart((e=>{const t=this.textArea.domNode,n=this._modelSelections[0],{distanceToModelLineStart:i,widthOfHiddenTextBefore:o}=(()=>{const e=t.value.substring(0,Math.min(t.selectionStart,t.selectionEnd)),i=e.lastIndexOf("\n"),o=e.substring(i+1),r=o.lastIndexOf("\t"),s=o.length-r-1,a=n.getStartPosition(),l=Math.min(a.column-1,s);return{distanceToModelLineStart:a.column-1-l,widthOfHiddenTextBefore:measureText(o.substring(0,o.length-l),this._fontInfo)}})(),{distanceToModelLineEnd:r}=(()=>{const e=t.value.substring(Math.max(t.selectionStart,t.selectionEnd)),i=e.indexOf("\n"),o=-1===i?e:e.substring(0,i),r=o.indexOf("\t"),s=-1===r?o.length:o.length-r-1,a=n.getEndPosition(),l=Math.min(this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column,s);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column-l}})();this._context.viewModel.revealRange("keyboard",!0,Range$2.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new VisibleTextAreaData(this._context,n.startLineNumber,i,o,r),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()}))),this._register(this._textAreaInput.onCompositionUpdate((e=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())}))),this._register(this._textAreaInput.onCompositionEnd((()=>{this._visibleTextArea=null,this._render(),this.textArea.setClassName(`inputarea ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()}))),this._register(this._textAreaInput.onFocus((()=>{this._context.viewModel.setHasFocus(!0)}))),this._register(this._textAreaInput.onBlur((()=>{this._context.viewModel.setHasFocus(!1)})))}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),n=getMapForWordSeparators('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?');let i=!0,o=e.column,r=!0,s=e.column,a=0;for(;a<50&&(i||r);){if(i&&o<=1&&(i=!1),i){const e=t.charCodeAt(o-2);0!==n.get(e)?i=!1:o--}if(r&&s>t.length&&(r=!1),r){const e=t.charCodeAt(s-1);0!==n.get(e)?r=!1:s++}a++}return[t.substring(o-1,s-1),e.column-o]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),n=getMapForWordSeparators(this._context.configuration.options.get(117));let i=e.column,o=0;for(;i>1;){const r=t.charCodeAt(i-2);if(0!==n.get(r)||o>50)return t.substring(i-1,e.column-1);o++,i--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const t=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!isHighSurrogate(t.charCodeAt(0)))return t}return""}_getAriaLabel(e){return 1===e.get(2)?localize("accessibilityOffAriaLabel","The editor is not accessible at this time. Press {0} for options.",isLinux?"Shift+Alt+F1":"Alt+F1"):e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);2===this._accessibilitySupport&&t===EditorOptions.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(131);return this._setAccessibilityOptions(t),this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._contentHeight=n.height,this._fontInfo=t.get(44),this._lineHeight=t.get(59),this._emptySelectionClipboard=t.get(32),this._copyWithSyntaxHighlighting=t.get(21),this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("tabindex",String(t.get(112))),(e.hasChanged(30)||e.hasChanged(81))&&(t.get(30)&&t.get(81)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}prepareRender(e){this._primaryCursorPosition=new Position$1(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),this._visibleTextArea&&this._visibleTextArea.prepareRender(e)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){if(this._visibleTextArea){const e=this._visibleTextArea.visibleTextareaStart,t=this._visibleTextArea.visibleTextareaEnd,n=this._visibleTextArea.startPosition,i=this._visibleTextArea.endPosition;if(n&&i&&e&&t&&t.left>=this._scrollLeft&&e.left<=this._scrollLeft+this._contentWidth){const o=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,r=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let s=this._visibleTextArea.widthOfHiddenLineTextBefore,a=this._contentLeft+e.left-this._scrollLeft,l=t.left-e.left+1;if(a<this._contentLeft){const e=this._contentLeft-a;a+=e,s+=e,l-=e}l>this._contentWidth&&(l=this._contentWidth);const c=this._context.viewModel.getViewLineData(n.lineNumber),d=c.tokens.findTokenIndexAtOffset(n.column-1),u=d===c.tokens.findTokenIndexAtOffset(i.column-1),h=this._visibleTextArea.definePresentation(u?c.tokens.getPresentation(d):null);this.textArea.domNode.scrollTop=r*this._lineHeight,this.textArea.domNode.scrollLeft=s,this._doRender({lastRenderPosition:null,top:o,left:a,width:l,height:this._lineHeight,useCover:!1,color:(TokenizationRegistry.getColorMap()||[])[h.foreground],italic:h.italic,bold:h.bold,underline:h.underline,strikethrough:h.strikethrough})}return}if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(e<this._contentLeft||e>this._contentLeft+this._contentWidth)return void this._renderAtTopLeft();const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight)this._renderAtTopLeft();else if(isMacintosh){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:e,width:canUseZeroSizeTextarea?0:1,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const n=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=n*this._lineHeight}else this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:e,width:canUseZeroSizeTextarea?0:1,height:canUseZeroSizeTextarea?0:1,useCover:!1})}_newlinecount(e){let t=0,n=-1;for(;;){if(n=e.indexOf("\n",n+1),-1===n)break;t++}return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:canUseZeroSizeTextarea?0:1,height:canUseZeroSizeTextarea?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,n=this.textAreaCover;applyFontInfo(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?Color.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),n.setTop(e.useCover?e.top:0),n.setLeft(e.useCover?e.left:0),n.setWidth(e.useCover?e.width:0),n.setHeight(e.useCover?e.height:0);const i=this._context.configuration.options;i.get(50)?n.setClassName("monaco-editor-background textAreaCover "+Margin.OUTER_CLASS_NAME):0!==i.get(60).renderType?n.setClassName("monaco-editor-background textAreaCover "+LineNumbersOverlay.CLASS_NAME):n.setClassName("monaco-editor-background textAreaCover")}}function measureText(e,t){if(0===e.length)return 0;const n=document.createElement("div");n.style.position="absolute",n.style.top="-50000px",n.style.width="50000px";const i=document.createElement("span");applyFontInfo(i,t),i.style.whiteSpace="pre",i.append(e),n.appendChild(i),document.body.appendChild(n);const o=i.offsetWidth;return document.body.removeChild(n),o}class ViewController{constructor(e,t,n,i){this.configuration=e,this.viewModel=t,this.userInputEvents=n,this.commandDelegate=i}paste(e,t,n,i){this.commandDelegate.paste(e,t,n,i)}type(e){this.commandDelegate.type(e)}compositionType(e,t,n,i){this.commandDelegate.compositionType(e,t,n,i)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){CoreNavigationCommands.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new Position$1(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(70)){case"altKey":return e.altKey;case"ctrlKey":return e.ctrlKey;case"metaKey":return e.metaKey;default:return!1}}_hasNonMulticursorModifier(e){switch(this.configuration.options.get(70)){case"altKey":return e.ctrlKey||e.metaKey;case"ctrlKey":return e.altKey||e.metaKey;case"metaKey":return e.ctrlKey||e.altKey;default:return!1}}dispatchMouse(e){const t=this.configuration.options,n=isLinux&&t.get(96),i=t.get(18);e.middleButton&&!n?this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):e.mouseDownCount>=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position):this._lastCursorLineSelect(e.position):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):2===e.mouseDownCount?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position):e.inSelectionMode?this._wordSelectDrag(e.position):this._wordSelect(e.position)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey||i?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position):this.moveTo(e.position)}_usualArgs(e){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e}}moveTo(e){CoreNavigationCommands.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_moveToSelect(e){CoreNavigationCommands.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_columnSelect(e,t,n){e=this._validateViewColumn(e),CoreNavigationCommands.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:n})}_createCursor(e,t){e=this._validateViewColumn(e),CoreNavigationCommands.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e){CoreNavigationCommands.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelect(e){CoreNavigationCommands.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelectDrag(e){CoreNavigationCommands.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorWordSelect(e){CoreNavigationCommands.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelect(e){CoreNavigationCommands.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelectDrag(e){CoreNavigationCommands.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelect(e){CoreNavigationCommands.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelectDrag(e){CoreNavigationCommands.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_selectAll(){CoreNavigationCommands.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class ViewUserInputEvents{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){this.onKeyDown&&this.onKeyDown(e)}emitKeyUp(e){this.onKeyUp&&this.onKeyUp(e)}emitContextMenu(e){this.onContextMenu&&this.onContextMenu(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove&&this.onMouseMove(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave&&this.onMouseLeave(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown&&this.onMouseDown(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp&&this.onMouseUp(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag&&this.onMouseDrag(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop&&this.onMouseDrop(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled&&this.onMouseDropCanceled()}emitMouseWheel(e){this.onMouseWheel&&this.onMouseWheel(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return ViewUserInputEvents.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const n=Object.assign({},e);return n.position&&(n.position=t.convertViewPositionToModelPosition(n.position)),n.range&&(n.range=t.convertViewRangeToModelRange(n.range)),n}}var _a$c;class RenderedLinesCollection{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Error("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(0===this.getCount())return null;const n=this.getStartLineNumber(),i=this.getEndLineNumber();if(t<n){const n=t-e+1;return this._rendLineNumberStart-=n,null}if(e>i)return null;let o=0,r=0;for(let s=n;s<=i;s++){const n=s-this._rendLineNumberStart;e<=s&&s<=t&&(0===r?(o=n,r=1):r++)}if(e<n){let i=0;i=t<n?t-e+1:n-e,this._rendLineNumberStart-=i}return this._lines.splice(o,r)}onLinesChanged(e,t){if(0===this.getCount())return!1;const n=this.getStartLineNumber(),i=this.getEndLineNumber();let o=!1;for(let r=e;r<=t;r++)r>=n&&r<=i&&(this._lines[r-this._rendLineNumberStart].onContentChanged(),o=!0);return o}onLinesInserted(e,t){if(0===this.getCount())return null;const n=t-e+1,i=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=i)return this._rendLineNumberStart+=n,null;if(e>o)return null;if(n+e>o){return this._lines.splice(e-this._rendLineNumberStart,o-e+1)}const r=[];for(let d=0;d<n;d++)r[d]=this._createLine();const s=e-this._rendLineNumberStart,a=this._lines.slice(0,s),l=this._lines.slice(s,this._lines.length-n),c=this._lines.slice(this._lines.length-n,this._lines.length);return this._lines=a.concat(r).concat(l),c}onTokensChanged(e){if(0===this.getCount())return!1;const t=this.getStartLineNumber(),n=this.getEndLineNumber();let i=!1;for(let o=0,r=e.length;o<r;o++){const r=e[o];if(r.toLineNumber<t||r.fromLineNumber>n)continue;const s=Math.max(t,r.fromLineNumber),a=Math.min(n,r.toLineNumber);for(let e=s;e<=a;e++){const t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),i=!0}}return i}}class VisibleLinesCollection{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new RenderedLinesCollection((()=>this._host.createVisibleLine()))}_createDomNode(){const e=createFastDomNode(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(131)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.toLineNumber)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let n=0,i=t.length;n<i;n++){const e=t[n].getDomNode();e&&this.domNode.domNode.removeChild(e)}return!0}onLinesInserted(e){const t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let n=0,i=t.length;n<i;n++){const e=t[n].getDomNode();e&&this.domNode.domNode.removeChild(e)}return!0}onScrollChanged(e){return e.scrollTopChanged}onTokensChanged(e){return this._linesCollection.onTokensChanged(e.ranges)}onZonesChanged(e){return!0}getStartLineNumber(){return this._linesCollection.getStartLineNumber()}getEndLineNumber(){return this._linesCollection.getEndLineNumber()}getVisibleLine(e){return this._linesCollection.getLine(e)}renderLines(e){const t=this._linesCollection._get(),n=new ViewLayerRenderer(this.domNode.domNode,this._host,e),i={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},o=n.render(i,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(o.rendLineNumberStart,o.lines)}}class ViewLayerRenderer{constructor(e,t,n){this.domNode=e,this.host=t,this.viewportData=n}render(e,t,n,i){const o={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(o.rendLineNumberStart+o.linesLength-1<t||n<o.rendLineNumberStart){o.rendLineNumberStart=t,o.linesLength=n-t+1,o.lines=[];for(let e=t;e<=n;e++)o.lines[e-t]=this.host.createVisibleLine();return this._finishRendering(o,!0,i),o}if(this._renderUntouchedLines(o,Math.max(t-o.rendLineNumberStart,0),Math.min(n-o.rendLineNumberStart,o.linesLength-1),i,t),o.rendLineNumberStart>t){const e=t,r=Math.min(n,o.rendLineNumberStart-1);e<=r&&(this._insertLinesBefore(o,e,r,i,t),o.linesLength+=r-e+1)}else if(o.rendLineNumberStart<t){const e=Math.min(o.linesLength,t-o.rendLineNumberStart);e>0&&(this._removeLinesBefore(o,e),o.linesLength-=e)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1<n){const e=o.rendLineNumberStart+o.linesLength,r=n;e<=r&&(this._insertLinesAfter(o,e,r,i,t),o.linesLength+=r-e+1)}else if(o.rendLineNumberStart+o.linesLength-1>n){const e=Math.max(0,n-o.rendLineNumberStart+1),t=o.linesLength-1-e+1;t>0&&(this._removeLinesAfter(o,t),o.linesLength-=t)}return this._finishRendering(o,!1,i),o}_renderUntouchedLines(e,t,n,i,o){const r=e.rendLineNumberStart,s=e.lines;for(let a=t;a<=n;a++){const e=r+a;s[a].layoutLine(e,i[e-o])}}_insertLinesBefore(e,t,n,i,o){const r=[];let s=0;for(let a=t;a<=n;a++)r[s++]=this.host.createVisibleLine();e.lines=r.concat(e.lines)}_removeLinesBefore(e,t){for(let n=0;n<t;n++){const t=e.lines[n].getDomNode();t&&this.domNode.removeChild(t)}e.lines.splice(0,t)}_insertLinesAfter(e,t,n,i,o){const r=[];let s=0;for(let a=t;a<=n;a++)r[s++]=this.host.createVisibleLine();e.lines=e.lines.concat(r)}_removeLinesAfter(e,t){const n=e.linesLength-t;for(let i=0;i<t;i++){const t=e.lines[n+i].getDomNode();t&&this.domNode.removeChild(t)}e.lines.splice(n,t)}_finishRenderingNewLines(e,t,n,i){ViewLayerRenderer._ttPolicy&&(n=ViewLayerRenderer._ttPolicy.createHTML(n));const o=this.domNode.lastChild;t||!o?this.domNode.innerHTML=n:o.insertAdjacentHTML("afterend",n);let r=this.domNode.lastChild;for(let s=e.linesLength-1;s>=0;s--){const t=e.lines[s];i[s]&&(t.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,n){const i=document.createElement("div");ViewLayerRenderer._ttPolicy&&(t=ViewLayerRenderer._ttPolicy.createHTML(t)),i.innerHTML=t;for(let o=0;o<e.linesLength;o++){const t=e.lines[o];if(n[o]){const e=i.firstChild,n=t.getDomNode();n.parentNode.replaceChild(e,n),t.setDomNode(e)}}}_finishRendering(e,t,n){const i=ViewLayerRenderer._sb,o=e.linesLength,r=e.lines,s=e.rendLineNumberStart,a=[];{i.reset();let l=!1;for(let e=0;e<o;e++){const t=r[e];a[e]=!1;if(t.getDomNode())continue;t.renderLine(e+s,n[e],this.viewportData,i)&&(a[e]=!0,l=!0)}l&&this._finishRenderingNewLines(e,t,i.build(),a)}{i.reset();let t=!1;const l=[];for(let e=0;e<o;e++){const o=r[e];if(l[e]=!1,a[e])continue;o.renderLine(e+s,n[e],this.viewportData,i)&&(l[e]=!0,t=!0)}t&&this._finishRenderingInvalidLines(e,i.build(),l)}}}ViewLayerRenderer._ttPolicy=null===(_a$c=window.trustedTypes)||void 0===_a$c?void 0:_a$c.createPolicy("editorViewLayer",{createHTML:e=>e}),ViewLayerRenderer._sb=createStringBuilder(1e5);class ViewOverlays extends ViewPart{constructor(e){super(e),this._visibleLines=new VisibleLinesCollection(this),this.domNode=this._visibleLines.domNode,this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;e<t;e++){if(this._dynamicOverlays[e].shouldRender())return!0}return!1}dispose(){super.dispose();for(let e=0,t=this._dynamicOverlays.length;e<t;e++){this._dynamicOverlays[e].dispose()}this._dynamicOverlays=[]}getDomNode(){return this.domNode}createVisibleLine(){return new ViewOverlayLine(this._context.configuration,this._dynamicOverlays)}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let i=t;i<=n;i++){this._visibleLines.getVisibleLine(i).onConfigurationChanged(e)}return!0}onFlushed(e){return this._visibleLines.onFlushed(e)}onFocusChanged(e){return this._isFocused=e.isFocused,!0}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onScrollChanged(e){return this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._visibleLines.onZonesChanged(e)}prepareRender(e){const t=this._dynamicOverlays.filter((e=>e.shouldRender()));for(let n=0,i=t.length;n<i;n++){const i=t[n];i.prepareRender(e),i.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName("focused",this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}}class ViewOverlayLine{constructor(e,t){this._configuration=e,this._lineHeight=this._configuration.options.get(59),this._dynamicOverlays=t,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=createFastDomNode(e)}onContentChanged(){}onTokensChanged(){}onConfigurationChanged(e){this._lineHeight=this._configuration.options.get(59)}renderLine(e,t,n,i){let o="";for(let r=0,s=this._dynamicOverlays.length;r<s;r++){o+=this._dynamicOverlays[r].render(n.startLineNumber,e)}return this._renderedContent!==o&&(this._renderedContent=o,i.appendASCIIString('<div style="position:absolute;top:'),i.appendASCIIString(String(t)),i.appendASCIIString("px;width:100%;height:"),i.appendASCIIString(String(this._lineHeight)),i.appendASCIIString('px;">'),i.appendASCIIString(o),i.appendASCIIString("</div>"),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class ContentViewOverlays extends ViewOverlays{constructor(e){super(e);const t=this._context.configuration.options.get(131);this._contentWidth=t.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const t=this._context.configuration.options.get(131);return this._contentWidth=t.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class MarginViewOverlays extends ViewOverlays{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(131);this._contentLeft=n.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),applyFontInfo(this.domNode,t.get(44))}onConfigurationChanged(e){const t=this._context.configuration.options;applyFontInfo(this.domNode,t.get(44));const n=t.get(131);return this._contentLeft=n.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class Coordinate{constructor(e,t){this._coordinateBrand=void 0,this.top=e,this.left=t}}class ViewContentWidgets extends ViewPart{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=createFastDomNode(document.createElement("div")),PartFingerprints.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=createFastDomNode(document.createElement("div")),PartFingerprints.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].onLineMappingChanged(e);return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}addWidget(e){const t=new Widget$1(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,n){this._widgets[e.getId()].setPosition(t,n),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t];delete this._widgets[t];const n=e.domNode.domNode;n.parentNode.removeChild(n),n.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return!!this._widgets.hasOwnProperty(e)&&this._widgets[e].suppressMouseDown}onBeforeRender(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const n of t)this._widgets[n].render(e)}}class Widget$1{constructor(e,t,n){this._context=e,this._viewDomNode=t,this._actual=n,this.domNode=createFastDomNode(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const i=this._context.configuration.options,o=i.get(131);this._fixedOverflowWidgets=i.get(36),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=i.get(59),this._range=null,this._viewRange=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(59),e.hasChanged(131)){const e=t.get(131);this._contentLeft=e.contentLeft,this._contentWidth=e.contentWidth,this._maxWidth=this._getMaxWidth()}}onLineMappingChanged(e){this._setPosition(this._range)}_setPosition(e){if(this._range=e,this._viewRange=null,this._range){const e=this._context.viewModel.model.validateRange(this._range);(this._context.viewModel.coordinatesConverter.modelPositionIsVisible(e.getStartPosition())||this._context.viewModel.coordinatesConverter.modelPositionIsVisible(e.getEndPosition()))&&(this._viewRange=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(e))}}_getMaxWidth(){return this.allowEditorOverflow?window.innerWidth||document.documentElement.offsetWidth||document.body.offsetWidth:this._contentWidth}setPosition(e,t){this._setPosition(e),this._preference=t,this._viewRange&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,n,i,o){const r=e.top,s=r,a=t.top+this._lineHeight,l=r-i,c=s>=i,d=a,u=o.viewportHeight-a>=i;let h=e.left,g=t.left;return h+n>o.scrollLeft+o.viewportWidth&&(h=o.scrollLeft+o.viewportWidth-n),g+n>o.scrollLeft+o.viewportWidth&&(g=o.scrollLeft+o.viewportWidth-n),h<o.scrollLeft&&(h=o.scrollLeft),g<o.scrollLeft&&(g=o.scrollLeft),{fitsAbove:c,aboveTop:l,aboveLeft:h,fitsBelow:u,belowTop:d,belowLeft:g}}_layoutHorizontalSegmentInPage(e,t,n,i){const o=Math.max(0,t.left-i),r=Math.min(t.left+t.width+i,e.width);let s=t.left+n-StandardWindow.scrollX;if(s+i>r){const e=s-(r-i);s-=e,n-=e}if(s<o){const e=s-o;s-=e,n-=e}return[n,s]}_layoutBoxInPage(e,t,n,i,o){const r=e.top-i,s=t.top+this._lineHeight,a=getDomNodePagePosition(this._viewDomNode.domNode),l=a.top+r-StandardWindow.scrollY,c=a.top+s-StandardWindow.scrollY,d=getClientArea(document.body),[u,h]=this._layoutHorizontalSegmentInPage(d,a,e.left-o.scrollLeft+this._contentLeft,n),[g,p]=this._layoutHorizontalSegmentInPage(d,a,t.left-o.scrollLeft+this._contentLeft,n),f=l>=22,m=c+i<=d.height-22;return this._fixedOverflowWidgets?{fitsAbove:f,aboveTop:Math.max(l,22),aboveLeft:h,fitsBelow:m,belowTop:c,belowLeft:p}:{fitsAbove:f,aboveTop:r,aboveLeft:u,fitsBelow:m,belowTop:s,belowLeft:g}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new Coordinate(e.top,e.left+this._contentLeft)}_getTopAndBottomLeft(e){if(!this._viewRange)return[null,null];const t=e.linesVisibleRangesForRange(this._viewRange,!1);if(!t||0===t.length)return[null,null];let n=t[0],i=t[0];for(const c of t)c.lineNumber<n.lineNumber&&(n=c),c.lineNumber>i.lineNumber&&(i=c);let o=1073741824;for(const c of n.ranges)c.left<o&&(o=c.left);let r=1073741824;for(const c of i.ranges)c.left<r&&(r=c.left);const s=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.scrollTop,a=new Coordinate(s,o),l=e.getVerticalOffsetForLineNumber(i.lineNumber)-e.scrollTop;return[a,new Coordinate(l,r)]}_prepareRenderWidget(e){if(!this._preference||0===this._preference.length)return null;const[t,n]=this._getTopAndBottomLeft(e);if(!t||!n)return null;if(-1===this._cachedDomNodeOffsetWidth||-1===this._cachedDomNodeOffsetHeight){let e=null;if("function"==typeof this._actual.beforeRender&&(e=safeInvoke(this._actual.beforeRender,this._actual)),e)this._cachedDomNodeOffsetWidth=e.width,this._cachedDomNodeOffsetHeight=e.height;else{const e=this.domNode.domNode;this._cachedDomNodeOffsetWidth=e.offsetWidth,this._cachedDomNodeOffsetHeight=e.offsetHeight}}let i;i=this.allowEditorOverflow?this._layoutBoxInPage(t,n,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):this._layoutBoxInViewport(t,n,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let o=1;o<=2;o++)for(const e of this._preference)if(1===e){if(!i)return null;if(2===o||i.fitsAbove)return{coordinate:new Coordinate(i.aboveTop,i.aboveLeft),position:1}}else{if(2!==e)return this.allowEditorOverflow?{coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(t),position:0}:{coordinate:t,position:0};if(!i)return null;if(2===o||i.fitsBelow)return{coordinate:new Coordinate(i.belowTop,i.belowLeft),position:2}}return null}onBeforeRender(e){this._viewRange&&this._preference&&(this._viewRange.endLineNumber<e.startLineNumber||this._viewRange.startLineNumber>e.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData)return this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),void("function"==typeof this._actual.afterRender&&safeInvoke(this._actual.afterRender,this._actual,null));this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),"function"==typeof this._actual.afterRender&&safeInvoke(this._actual.afterRender,this._actual,this._renderData.position)}}function safeInvoke(e,t,...n){try{return e.call(t,...n)}catch(i){return null}}var currentLineHighlight="";class AbstractLineHighlightOverlay extends DynamicViewOverlay{constructor(e){super(),this._context=e;const t=this._context.configuration.options,n=t.get(131);this._lineHeight=t.get(59),this._renderLineHighlight=t.get(85),this._renderLineHighlightOnlyWhenFocus=t.get(86),this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new Selection$1(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=this._selections.map((e=>e.positionLineNumber));t.sort(((e,t)=>e-t)),equals$1(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const n=this._selections.every((e=>e.isEmpty()));return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(131);return this._lineHeight=t.get(59),this._renderLineHighlight=t.get(85),this._renderLineHighlightOnlyWhenFocus=t.get(86),this._contentLeft=n.contentLeft,this._contentWidth=n.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return!!this._renderLineHighlightOnlyWhenFocus&&(this._focused=e.isFocused,!0)}prepareRender(e){if(!this._shouldRenderThis())return void(this._renderData=null);const t=this._renderOne(e),n=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let r=0;const s=[];for(let a=n;a<=i;a++){const e=a-n;for(;r<o&&this._cursorLineNumbers[r]<a;)r++;r<o&&this._cursorLineNumbers[r]===a?s[e]=t:s[e]=""}this._renderData=s}render(e,t){if(!this._renderData)return"";const n=t-e;return n>=this._renderData.length?"":this._renderData[n]}_shouldRenderInMargin(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class CurrentLineHighlightOverlay extends AbstractLineHighlightOverlay{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderOther()?" current-line-both":"")}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class CurrentLineMarginHighlightOverlay extends AbstractLineHighlightOverlay{_renderOne(e){return`<div class="${"current-line"+(this._shouldRenderInMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"")}" style="width:${this._contentLeft}px; height:${this._lineHeight}px;"></div>`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}registerThemingParticipant(((e,t)=>{const n=e.getColor(editorLineHighlight);if(n&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${n}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${n}; border: none; }`)),!n||n.isTransparent()||e.defines(editorLineHighlightBorder)){const n=e.getColor(editorLineHighlightBorder);n&&(t.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${n}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${n}; }`),"hc"===e.type&&(t.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}}));var decorations="";class DecorationsOverlay extends DynamicViewOverlay{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(59),this._typicalHalfwidthCharacterWidth=t.get(44).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(59),this._typicalHalfwidthCharacterWidth=t.get(44).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let n=[],i=0;for(let a=0,l=t.length;a<l;a++){const e=t[a];e.options.className&&(n[i++]=e)}n=n.sort(((e,t)=>{if(e.options.zIndex<t.options.zIndex)return-1;if(e.options.zIndex>t.options.zIndex)return 1;const n=e.options.className,i=t.options.className;return n<i?-1:n>i?1:Range$2.compareRangesUsingStarts(e.range,t.range)}));const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,s=[];for(let a=o;a<=r;a++){s[a-o]=""}this._renderWholeLineDecorations(e,n,s),this._renderNormalDecorations(e,n,s),this._renderResult=s}_renderWholeLineDecorations(e,t,n){const i=String(this._lineHeight),o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let s=0,a=t.length;s<a;s++){const e=t[s];if(!e.options.isWholeLine)continue;const a='<div class="cdr '+e.options.className+'" style="left:0;width:100%;height:'+i+'px;"></div>',l=Math.max(e.range.startLineNumber,o),c=Math.min(e.range.endLineNumber,r);for(let t=l;t<=c;t++){n[t-o]+=a}}}_renderNormalDecorations(e,t,n){const i=String(this._lineHeight),o=e.visibleRange.startLineNumber;let r=null,s=!1,a=null;for(let l=0,c=t.length;l<c;l++){const c=t[l];if(c.options.isWholeLine)continue;const d=c.options.className,u=Boolean(c.options.showIfCollapsed);let h=c.range;u&&1===h.endColumn&&h.endLineNumber!==h.startLineNumber&&(h=new Range$2(h.startLineNumber,h.startColumn,h.endLineNumber-1,this._context.viewModel.getLineMaxColumn(h.endLineNumber-1))),r===d&&s===u&&Range$2.areIntersectingOrTouching(a,h)?a=Range$2.plusRange(a,h):(null!==r&&this._renderNormalDecoration(e,a,r,s,i,o,n),r=d,s=u,a=h)}null!==r&&this._renderNormalDecoration(e,a,r,s,i,o,n)}_renderNormalDecoration(e,t,n,i,o,r,s){const a=e.linesVisibleRangesForRange(t,"findMatch"===n);if(a)for(let l=0,c=a.length;l<c;l++){const e=a[l];if(e.outsideRenderedLine)continue;const t=e.lineNumber-r;if(i&&1===e.ranges.length){const t=e.ranges[0];if(t.width<this._typicalHalfwidthCharacterWidth){const n=Math.round(t.left+t.width/2),i=Math.max(0,Math.round(n-this._typicalHalfwidthCharacterWidth/2));e.ranges[0]=new HorizontalRange(i,this._typicalHalfwidthCharacterWidth)}}for(let i=0,r=e.ranges.length;i<r;i++){const r=e.ranges[i],a='<div class="cdr '+n+'" style="left:'+String(r.left)+"px;width:"+String(r.width)+"px;height:"+o+'px;"></div>';s[t]+=a}}}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}class Widget extends Disposable{onclick(e,t){this._register(addDisposableListener(e,EventType$1.CLICK,(e=>t(new StandardMouseEvent(e)))))}onmousedown(e,t){this._register(addDisposableListener(e,EventType$1.MOUSE_DOWN,(e=>t(new StandardMouseEvent(e)))))}onmouseover(e,t){this._register(addDisposableListener(e,EventType$1.MOUSE_OVER,(e=>t(new StandardMouseEvent(e)))))}onnonbubblingmouseout(e,t){this._register(addDisposableNonBubblingMouseOutListener(e,(e=>t(new StandardMouseEvent(e)))))}onkeydown(e,t){this._register(addDisposableListener(e,EventType$1.KEY_DOWN,(e=>t(new StandardKeyboardEvent(e)))))}onkeyup(e,t){this._register(addDisposableListener(e,EventType$1.KEY_UP,(e=>t(new StandardKeyboardEvent(e)))))}oninput(e,t){this._register(addDisposableListener(e,EventType$1.INPUT,t))}onblur(e,t){this._register(addDisposableListener(e,EventType$1.BLUR,t))}onfocus(e,t){this._register(addDisposableListener(e,EventType$1.FOCUS,t))}ignoreGesture(e){Gesture.ignoreTarget(e)}}const ARROW_IMG_SIZE=11;class ScrollbarArrow extends Widget{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",void 0!==e.top&&(this.bgDomNode.style.top="0px"),void 0!==e.left&&(this.bgDomNode.style.left="0px"),void 0!==e.bottom&&(this.bgDomNode.style.bottom="0px"),void 0!==e.right&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...e.icon.classNamesArray),this.domNode.style.position="absolute",this.domNode.style.width=ARROW_IMG_SIZE+"px",this.domNode.style.height=ARROW_IMG_SIZE+"px",void 0!==e.top&&(this.domNode.style.top=e.top+"px"),void 0!==e.left&&(this.domNode.style.left=e.left+"px"),void 0!==e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),void 0!==e.right&&(this.domNode.style.right=e.right+"px"),this._mouseMoveMonitor=this._register(new GlobalMouseMoveMonitor),this.onmousedown(this.bgDomNode,(e=>this._arrowMouseDown(e))),this.onmousedown(this.domNode,(e=>this._arrowMouseDown(e))),this._mousedownRepeatTimer=this._register(new IntervalTimer),this._mousedownScheduleRepeatTimer=this._register(new TimeoutTimer)}_arrowMouseDown(e){this._onActivate(),this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancelAndSet((()=>{this._mousedownRepeatTimer.cancelAndSet((()=>this._onActivate()),1e3/24)}),200),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,standardMouseMoveMerger,(e=>{}),(()=>{this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancel()})),e.preventDefault()}}class ScrollbarVisibilityController extends Disposable{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new TimeoutTimer)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return 2!==this._visibility&&(3===this._visibility||this._rawShouldBeVisible)}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet((()=>{this._domNode&&this._domNode.setClassName(this._visibleClassName)}),0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode&&this._domNode.setClassName(this._invisibleClassName+(e?" fade":"")))}}const MOUSE_DRAG_RESET_DISTANCE$1=140;class AbstractScrollbar extends Widget{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new ScrollbarVisibilityController(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._mouseMoveMonitor=this._register(new GlobalMouseMoveMonitor),this._shouldRender=!0,this.domNode=createFastDomNode(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this.onmousedown(this.domNode.domNode,(e=>this._domNodeMouseDown(e)))}_createArrow(e){const t=this._register(new ScrollbarArrow(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,i){this.slider=createFastDomNode(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),"number"==typeof n&&this.slider.setWidth(n),"number"==typeof i&&this.slider.setHeight(i),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this.onmousedown(this.slider.domNode,(e=>{e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,(()=>{})))})),this.onclick(this.slider.domNode,(e=>{e.leftButton&&e.stopPropagation()}))}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodeMouseDown(e){e.target===this.domNode.domNode&&this._onMouseDown(e)}delegateMouseDown(e){const t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),i=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderMousePosition(e);n<=o&&o<=i?e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,(()=>{}))):this._onMouseDown(e)}_onMouseDown(e){let t,n;if(e.target===this.domNode.domNode&&"number"==typeof e.browserEvent.offsetX&&"number"==typeof e.browserEvent.offsetY)t=e.browserEvent.offsetX,n=e.browserEvent.offsetY;else{const i=getDomNodePagePosition(this.domNode.domNode);t=e.posx-i.left,n=e.posy-i.top}const i=this._mouseDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(i):this._scrollbarState.getDesiredScrollPositionFromOffset(i)),e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,(()=>{})))}_sliderMouseDown(e,t){const n=this._sliderMousePosition(e),i=this._sliderOrthogonalMousePosition(e),o=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,standardMouseMoveMerger,(e=>{const t=this._sliderOrthogonalMousePosition(e),r=Math.abs(t-i);if(isWindows&&r>MOUSE_DRAG_RESET_DISTANCE$1)return void this._setDesiredScrollPositionNow(o.getScrollPosition());const s=this._sliderMousePosition(e)-n;this._setDesiredScrollPositionNow(o.getDesiredScrollPositionFromDelta(s))}),(()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd(),t()})),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const MINIMUM_SLIDER_SIZE=20;class ScrollbarState{constructor(e,t,n,i,o,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=i,this._scrollSize=o,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new ScrollbarState(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,n,i,o){const r=Math.max(0,n-e),s=Math.max(0,r-2*t),a=i>0&&i>n;if(!a)return{computedAvailableSize:Math.round(r),computedIsNeeded:a,computedSliderSize:Math.round(s),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(MINIMUM_SLIDER_SIZE,Math.floor(n*s/i))),c=(s-l)/(i-n),d=o*c;return{computedAvailableSize:Math.round(r),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:c,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=ScrollbarState._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let n=this._scrollPosition;return t<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;const t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}}class HorizontalScrollbar extends AbstractScrollbar{constructor(e,t,n){const i=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new ScrollbarState(t.horizontalHasArrows?t.arrowSize:0,2===t.horizontal?0:t.horizontalScrollbarSize,2===t.vertical?0:t.verticalScrollbarSize,i.width,i.scrollWidth,o.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){const e=(t.arrowSize-ARROW_IMG_SIZE)/2,n=(t.horizontalScrollbarSize-ARROW_IMG_SIZE)/2;this._createArrow({className:"scra",icon:Codicon.scrollbarButtonLeft,top:n,left:e,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new StandardWheelEvent(null,1,0))}),this._createArrow({className:"scra",icon:Codicon.scrollbarButtonRight,top:n,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new StandardWheelEvent(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_mouseDownRelativePosition(e,t){return e}_sliderMousePosition(e){return e.posx}_sliderOrthogonalMousePosition(e){return e.posy}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(2===e.horizontal?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class VerticalScrollbar extends AbstractScrollbar{constructor(e,t,n){const i=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new ScrollbarState(t.verticalHasArrows?t.arrowSize:0,2===t.vertical?0:t.verticalScrollbarSize,0,i.height,i.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const e=(t.arrowSize-ARROW_IMG_SIZE)/2,n=(t.verticalScrollbarSize-ARROW_IMG_SIZE)/2;this._createArrow({className:"scra",icon:Codicon.scrollbarButtonUp,top:e,left:n,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new StandardWheelEvent(null,0,1))}),this._createArrow({className:"scra",icon:Codicon.scrollbarButtonDown,top:void 0,left:n,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new StandardWheelEvent(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_mouseDownRelativePosition(e,t){return t}_sliderMousePosition(e){return e.posy}_sliderOrthogonalMousePosition(e){return e.posx}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class ScrollState{constructor(e,t,n,i,o,r,s){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,n|=0,i|=0,o|=0,r|=0,s|=0),this.rawScrollLeft=i,this.rawScrollTop=s,t<0&&(t=0),i+t>n&&(i=n-t),i<0&&(i=0),o<0&&(o=0),s+o>r&&(s=r-o),s<0&&(s=0),this.width=t,this.scrollWidth=n,this.scrollLeft=i,this.height=o,this.scrollHeight=r,this.scrollTop=s}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new ScrollState(this._forceIntegerValues,void 0!==e.width?e.width:this.width,void 0!==e.scrollWidth?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,void 0!==e.height?e.height:this.height,void 0!==e.scrollHeight?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new ScrollState(this._forceIntegerValues,this.width,this.scrollWidth,void 0!==e.scrollLeft?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,void 0!==e.scrollTop?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const n=this.width!==e.width,i=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,r=this.height!==e.height,s=this.scrollHeight!==e.scrollHeight,a=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:i,scrollLeftChanged:o,heightChanged:r,scrollHeightChanged:s,scrollTopChanged:a}}}class Scrollable extends Disposable{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Emitter$1),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new ScrollState(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){const n=this._state.withScrollDimensions(e,t);this._setState(n,Boolean(this._smoothScrolling)),this._smoothScrolling&&this._smoothScrolling.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:void 0===e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:void 0===e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};const n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let i;i=t?new SmoothScrollingOperation(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=i}else{const t=this._state.withScrollPosition(e);this._smoothScrolling=SmoothScrollingOperation.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);return this._setState(t,!0),this._smoothScrolling?e.isDone?(this._smoothScrolling.dispose(),void(this._smoothScrolling=null)):void(this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))):void 0}_setState(e,t){const n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}}class SmoothScrollingUpdate{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}}function createEaseOutCubic(e,t){const n=t-e;return function(t){return e+n*easeOutCubic(t)}}function createComposed(e,t,n){return function(i){return i<n?e(i/n):t((i-n)/(1-n))}}class SmoothScrollingOperation{constructor(e,t,n,i){this.from=e,this.to=t,this.duration=i,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,n){if(Math.abs(e-t)>2.5*n){let i,o;return e<t?(i=e+.75*n,o=t-.75*n):(i=e-.75*n,o=t+.75*n),createComposed(createEaseOutCubic(e,i),createEaseOutCubic(o,t),.33)}return createEaseOutCubic(e,t)}dispose(){null!==this.animationFrameDisposable&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){const t=(e-this.startTime)/this.duration;if(t<1){const e=this.scrollLeft(t),n=this.scrollTop(t);return new SmoothScrollingUpdate(e,n,!1)}return new SmoothScrollingUpdate(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,n){return SmoothScrollingOperation.start(e,t,n)}static start(e,t,n){n+=10;const i=Date.now()-10;return new SmoothScrollingOperation(e,t,i,n)}}function easeInCubic(e){return Math.pow(e,3)}function easeOutCubic(e){return 1-easeInCubic(1-e)}var scrollbars="";const HIDE_TIMEOUT=500,SCROLL_WHEEL_SENSITIVITY=50;class MouseWheelClassifierItem{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}}class MouseWheelClassifier{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(-1===this._front&&-1===this._rear)return!1;let e=1,t=0,n=1,i=this._rear;for(;;){const o=i===this._front?e:Math.pow(2,-n);if(e-=o,t+=this._memory[i].score*o,i===this._front)break;i=(this._capacity+i-1)%this._capacity,n++}return t<=.5}accept(e,t,n){const i=new MouseWheelClassifierItem(e,t,n);i.score=this._computeScore(i),-1===this._front&&-1===this._rear?(this._memory[0]=i,this._front=0,this._rear=0):(this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=i)}_computeScore(e){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return(-1!==this._front||-1!==this._rear)&&this._memory[this._rear],this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}MouseWheelClassifier.INSTANCE=new MouseWheelClassifier;class AbstractScrollableElement extends Widget{constructor(e,t,n){super(),this._onScroll=this._register(new Emitter$1),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Emitter$1),e.style.overflow="hidden",this._options=resolveOptions$1(t),this._scrollable=n,this._register(this._scrollable.onScroll((e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)})));const i={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new VerticalScrollbar(this._scrollable,this._options,i)),this._horizontalScrollbar=this._register(new HorizontalScrollbar(this._scrollable,this._options,i)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=createFastDomNode(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=createFastDomNode(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=createFastDomNode(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,(e=>this._onMouseOver(e))),this.onnonbubblingmouseout(this._listenOnDomNode,(e=>this._onMouseOut(e))),this._hideTimeout=this._register(new TimeoutTimer),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=dispose(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarMouseDown(e){this._verticalScrollbar.delegateMouseDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,isMacintosh&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){void 0!==e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),void 0!==e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),void 0!==e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),void 0!==e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),void 0!==e.horizontal&&(this._options.horizontal=e.horizontal),void 0!==e.vertical&&(this._options.vertical=e.vertical),void 0!==e.horizontalScrollbarSize&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),void 0!==e.verticalScrollbarSize&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),void 0!==e.scrollByPage&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=dispose(this._mouseWheelToDispose),e)){const e=e=>{this._onMouseWheel(new StandardWheelEvent(e))};this._mouseWheelToDispose.push(addDisposableListener(this._listenOnDomNode,EventType$1.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){const t=MouseWheelClassifier.INSTANCE;{const n=window.devicePixelRatio/getZoomFactor();isWindows||isLinux?t.accept(Date.now(),e.deltaX/n,e.deltaY/n):t.accept(Date.now(),e.deltaX,e.deltaY)}let n=!1;if(e.deltaY||e.deltaX){let i=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(Math.abs(i)>=Math.abs(o)?o=0:i=0),this._options.flipAxes&&([i,o]=[o,i]);const r=!isMacintosh&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!r||o||(o=i,i=0),e.browserEvent&&e.browserEvent.altKey&&(o*=this._options.fastScrollSensitivity,i*=this._options.fastScrollSensitivity);const s=this._scrollable.getFutureScrollPosition();let a={};if(i){const e=SCROLL_WHEEL_SENSITIVITY*i,t=s.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(a,t)}if(o){const e=SCROLL_WHEEL_SENSITIVITY*o,t=s.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(a,t)}if(a=this._scrollable.validateScrollPosition(a),s.scrollLeft!==a.scrollLeft||s.scrollTop!==a.scrollTop){this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),n=!0}}let i=n;!i&&this._options.alwaysConsumeMouseWheel&&(i=!0),!i&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(i=!0),i&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,i=n?" left":"",o=t?" top":"",r=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${i}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${o}${i}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseOut(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet((()=>this._hide()),HIDE_TIMEOUT)}}class ScrollableElement extends AbstractScrollableElement{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const n=new Scrollable({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:e=>scheduleAtNextAnimationFrame(e)});super(e,t,n),this._register(n)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class SmoothScrollableElement extends AbstractScrollableElement{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class DomScrollableElement extends AbstractScrollableElement{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const n=new Scrollable({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:e=>scheduleAtNextAnimationFrame(e)});super(e,t,n),this._register(n),this._element=e,this.onScroll((e=>{e.scrollTopChanged&&(this._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this._element.scrollLeft=e.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function resolveOptions$1(e){const t={lazyRender:void 0!==e.lazyRender&&e.lazyRender,className:void 0!==e.className?e.className:"",useShadows:void 0===e.useShadows||e.useShadows,handleMouseWheel:void 0===e.handleMouseWheel||e.handleMouseWheel,flipAxes:void 0!==e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:void 0!==e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:void 0!==e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:void 0!==e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:void 0!==e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:void 0!==e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:void 0===e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:void 0===e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:void 0!==e.arrowSize?e.arrowSize:11,listenOnDomNode:void 0!==e.listenOnDomNode?e.listenOnDomNode:null,horizontal:void 0!==e.horizontal?e.horizontal:1,horizontalScrollbarSize:void 0!==e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:void 0!==e.horizontalHasArrows&&e.horizontalHasArrows,vertical:void 0!==e.vertical?e.vertical:1,verticalScrollbarSize:void 0!==e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:void 0!==e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:void 0!==e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:void 0!==e.scrollByPage&&e.scrollByPage};return t.horizontalSliderSize=void 0!==e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=void 0!==e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,isMacintosh&&(t.className+=" mac"),t}class EditorScrollbar extends ViewPart{constructor(e,t,n,i){super(e);const o=this._context.configuration.options,r=o.get(92),s=o.get(67),a=o.get(34),l=o.get(95),c={listenOnDomNode:n.domNode,className:"editor-scrollable "+getThemeTypeSelector(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:s,fastScrollSensitivity:a,scrollPredominantAxis:l,scrollByPage:r.scrollByPage};this.scrollbar=this._register(new SmoothScrollableElement(t.domNode,c,this._context.viewLayout.getScrollable())),PartFingerprints.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=createFastDomNode(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(e,t,n)=>{const i={};if(t){const t=e.scrollTop;t&&(i.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(n){const t=e.scrollLeft;t&&(i.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(i,1)};this._register(addDisposableListener(n.domNode,"scroll",(e=>d(n.domNode,!0,!0)))),this._register(addDisposableListener(t.domNode,"scroll",(e=>d(t.domNode,!0,!1)))),this._register(addDisposableListener(i.domNode,"scroll",(e=>d(i.domNode,!0,!1)))),this._register(addDisposableListener(this.scrollbarDomNode.domNode,"scroll",(e=>d(this.scrollbarDomNode.domNode,!0,!1))))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(131);this.scrollbarDomNode.setLeft(t.contentLeft);"right"===e.get(65).side?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarMouseDown(e){this.scrollbar.delegateVerticalScrollbarMouseDown(e)}onConfigurationChanged(e){if(e.hasChanged(92)||e.hasChanged(67)||e.hasChanged(34)){const e=this._context.configuration.options,t=e.get(92),n=e.get(67),i=e.get(34),o=e.get(95),r={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:n,fastScrollSensitivity:i,scrollPredominantAxis:o};this.scrollbar.updateOptions(r)}return e.hasChanged(131)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+getThemeTypeSelector(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}registerThemingParticipant(((e,t)=>{const n=e.getColor(scrollbarShadow);n&&t.addRule(`\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tbox-shadow: ${n} 0 6px 6px -6px inset;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tbox-shadow: ${n} 6px 0 6px -6px inset;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\tbox-shadow: ${n} 6px 6px 6px -6px inset;\n\t\t\t}\n\t\t`);const i=e.getColor(scrollbarSliderBackground);i&&t.addRule(`\n\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\tbackground: ${i};\n\t\t\t}\n\t\t`);const o=e.getColor(scrollbarSliderHoverBackground);o&&t.addRule(`\n\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\tbackground: ${o};\n\t\t\t}\n\t\t`);const r=e.getColor(scrollbarSliderActiveBackground);r&&t.addRule(`\n\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\tbackground: ${r};\n\t\t\t}\n\t\t`)}));var glyphMargin="";class DecorationToRender{constructor(e,t,n){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(n)}}class DedupOverlay extends DynamicViewOverlay{_render(e,t,n){const i=[];for(let s=e;s<=t;s++){i[s-e]=[]}if(0===n.length)return i;n.sort(((e,t)=>e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className<t.className?-1:1));let o=null,r=0;for(let s=0,a=n.length;s<a;s++){const a=n[s],l=a.className;let c=Math.max(a.startLineNumber,e)-e;const d=Math.min(a.endLineNumber,t)-e;o===l?(c=Math.max(r+1,c),r=Math.max(r,d)):(o=l,r=d);for(let e=c;e<=r;e++)i[e].push(o)}return i}}class GlyphMarginOverlay extends DedupOverlay{constructor(e){super(),this._context=e;const t=this._context.configuration.options,n=t.get(131);this._lineHeight=t.get(59),this._glyphMargin=t.get(50),this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(131);return this._lineHeight=t.get(59),this._glyphMargin=t.get(50),this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),n=[];let i=0;for(let o=0,r=t.length;o<r;o++){const e=t[o],r=e.options.glyphMarginClassName;r&&(n[i++]=new DecorationToRender(e.range.startLineNumber,e.range.endLineNumber,r))}return n}prepareRender(e){if(!this._glyphMargin)return void(this._renderResult=null);const t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,i=this._render(t,n,this._getDecorations(e)),o=this._lineHeight.toString(),r='" style="left:'+this._glyphMarginLeft.toString()+"px;width:"+this._glyphMarginWidth.toString()+"px;height:"+o+'px;"></div>',s=[];for(let a=t;a<=n;a++){const e=a-t,n=i[e];0===n.length?s[e]="":s[e]='<div class="cgmr codicon '+n.join(" ")+r}this._renderResult=s}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}var indentGuides="",HorizontalGuidesState,HorizontalGuidesState2;class TextModelPart{constructor(){this._isDisposed=!1}dispose(){this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function computeIndentLevel(e,t){let n=0,i=0;const o=e.length;for(;i<o;){const o=e.charCodeAt(i);if(32===o)n++;else{if(9!==o)break;n=n-n%t+t}i++}return i===o?-1:n}HorizontalGuidesState2=HorizontalGuidesState||(HorizontalGuidesState={}),HorizontalGuidesState2[HorizontalGuidesState2.Disabled=0]="Disabled",HorizontalGuidesState2[HorizontalGuidesState2.EnabledForActive=1]="EnabledForActive",HorizontalGuidesState2[HorizontalGuidesState2.Enabled=2]="Enabled";class IndentGuide{constructor(e,t,n){this.visibleColumn=e,this.className=t,this.horizontalLine=n}}class IndentGuideHorizontalLine{constructor(e,t){this.top=e,this.endColumn=t}}class GuidesTextModelPart extends TextModelPart{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return computeIndentLevel(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,n){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=Boolean(o&&o.offSide);let s=-2,a=-1,l=-2,c=-1;const d=e=>{if(-1!==s&&(-2===s||s>e-1)){s=-1,a=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){s=t,a=e;break}}}if(-2===l){l=-1,c=-1;for(let t=e;t<i;t++){const e=this._computeIndentLevel(t);if(e>=0){l=t,c=e;break}}}};let u=-2,h=-1,g=-2,p=-1;const f=e=>{if(-2===u){u=-1,h=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){u=t,h=e;break}}}if(-1!==g&&(-2===g||g<e-1)){g=-1,p=-1;for(let t=e;t<i;t++){const e=this._computeIndentLevel(t);if(e>=0){g=t,p=e;break}}}};let m=0,v=!0,_=0,C=!0,b=0,y=0;for(let S=0;v||C;S++){const o=e-S,s=e+S;S>1&&(o<1||o<t)&&(v=!1),S>1&&(s>i||s>n)&&(C=!1),S>5e4&&(v=!1,C=!1);let g=-1;if(v&&o>=1){const e=this._computeIndentLevel(o-1);e>=0?(l=o-1,c=e,g=Math.ceil(e/this.textModel.getOptions().indentSize)):(d(o),g=this._getIndentLevelForWhitespaceLine(r,a,c))}let w=-1;if(C&&s<=i){const e=this._computeIndentLevel(s-1);e>=0?(u=s-1,h=e,w=Math.ceil(e/this.textModel.getOptions().indentSize)):(f(s),w=this._getIndentLevelForWhitespaceLine(r,h,p))}if(0!==S){if(1===S){if(s<=i&&w>=0&&y+1===w){v=!1,m=s,_=s,b=w;continue}if(o>=1&&g>=0&&g-1===y){C=!1,m=o,_=o,b=g;continue}if(m=e,_=e,b=y,0===b)return{startLineNumber:m,endLineNumber:_,indent:b}}v&&(g>=b?m=o:v=!1),C&&(w>=b?_=s:C=!1)}else y=g}return{startLineNumber:m,endLineNumber:_,indent:b}}getLinesBracketGuides(e,t,n,i){var o,r,s,a,l;const c=[],d=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new Range$2(e,1,t,this.textModel.getLineMaxColumn(t)));let u;if(n&&d.length>0){u=null===(o=findLast(e<=n.lineNumber&&n.lineNumber<=t?d.filter((e=>Range$2.strictContainsPosition(e.range,n))):this.textModel.bracketPairs.getBracketPairsInRange(Range$2.fromPositions(n)),(e=>e.range.startLineNumber!==e.range.endLineNumber)))||void 0===o?void 0:o.range}const h=new ArrayQueue(d),g=new Array,p=new Array,f=new BracketPairGuidesClassNames;for(let m=e;m<=t;m++){let e=new Array;p.length>0&&(e=e.concat(p),p.length=0),c.push(e);for(const n of h.takeWhile((e=>e.openingBracketRange.startLineNumber<=m))||[]){if(n.range.startLineNumber===n.range.endLineNumber)continue;const e=Math.min(this.getVisibleColumnFromPosition(n.openingBracketRange.getStartPosition()),this.getVisibleColumnFromPosition(null!==(s=null===(r=n.closingBracketRange)||void 0===r?void 0:r.getStartPosition())&&void 0!==s?s:n.range.getEndPosition()),n.minVisibleColumnIndentation+1);let t=!1;if(n.closingBracketRange){firstNonWhitespaceIndex(this.textModel.getLineContent(n.closingBracketRange.startLineNumber))<n.closingBracketRange.startColumn-1&&(t=!0)}const i=n.openingBracketRange.getStartPosition(),o=null!==(l=null===(a=n.closingBracketRange)||void 0===a?void 0:a.getStartPosition())&&void 0!==l?l:n.range.getEndPosition();void 0===n.closingBracketRange?g[n.nestingLevel]=null:g[n.nestingLevel]={nestingLevel:n.nestingLevel,guideVisibleColumn:e,start:i,visibleStartColumn:this.getVisibleColumnFromPosition(i),end:o,visibleEndColumn:this.getVisibleColumnFromPosition(o),bracketPair:n,renderHorizontalEndLineAtTheBottom:t}}for(const n of g){if(!n)continue;const t=u&&n.bracketPair.range.equalsRange(u),o=f.getInlineClassNameOfLevel(n.nestingLevel)+(i.highlightActive&&t?" "+f.activeClassName:"");(t&&i.horizontalGuides!==HorizontalGuidesState.Disabled||i.includeInactive&&i.horizontalGuides===HorizontalGuidesState.Enabled)&&(n.start.lineNumber===m&&n.guideVisibleColumn<n.visibleStartColumn&&e.push(new IndentGuide(n.guideVisibleColumn,o,new IndentGuideHorizontalLine(!1,n.start.column))),n.end.lineNumber===m+1&&n.guideVisibleColumn<n.visibleEndColumn&&p.push(new IndentGuide(n.guideVisibleColumn,o,new IndentGuideHorizontalLine(!n.renderHorizontalEndLineAtTheBottom,n.end.column))))}let t=Number.MAX_SAFE_INTEGER;for(let n=g.length-1;n>=0;n--){const o=g[n];if(!o)continue;const r=i.highlightActive&&u&&o.bracketPair.range.equalsRange(u),s=f.getInlineClassNameOfLevel(o.nestingLevel)+(r?" "+f.activeClassName:"");(r||i.includeInactive)&&o.renderHorizontalEndLineAtTheBottom&&o.end.lineNumber===m+1&&p.push(new IndentGuide(o.guideVisibleColumn,s,null)),o.end.lineNumber<=m||o.start.lineNumber>=m||(o.guideVisibleColumn>=t&&!r||(t=o.guideVisibleColumn,(r||i.includeInactive)&&e.push(new IndentGuide(o.guideVisibleColumn,s,null))))}e.sort(((e,t)=>e.visibleColumn-t.visibleColumn))}return c}getVisibleColumnFromPosition(e){return CursorColumns.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new Error("Illegal value for startLineNumber");if(t<1||t>n)throw new Error("Illegal value for endLineNumber");const i=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=Boolean(o&&o.offSide),s=new Array(t-e+1);let a=-2,l=-1,c=-2,d=-1;for(let u=e;u<=t;u++){const t=u-e,o=this._computeIndentLevel(u-1);if(o>=0)a=u-1,l=o,s[t]=Math.ceil(o/i.indentSize);else{if(-2===a){a=-1,l=-1;for(let e=u-2;e>=0;e--){const t=this._computeIndentLevel(e);if(t>=0){a=e,l=t;break}}}if(-1!==c&&(-2===c||c<u-1)){c=-1,d=-1;for(let e=u;e<n;e++){const t=this._computeIndentLevel(e);if(t>=0){c=e,d=t;break}}}s[t]=this._getIndentLevelForWhitespaceLine(r,l,d)}}return s}_getIndentLevelForWhitespaceLine(e,t,n){const i=this.textModel.getOptions();return-1===t||-1===n?0:t<n?1+Math.floor(t/i.indentSize):t===n||e?Math.ceil(n/i.indentSize):1+Math.floor(n/i.indentSize)}}class BracketPairGuidesClassNames{constructor(){this.activeClassName="indent-active"}getInlineClassNameOfLevel(e){return"bracket-indent-guide lvl-"+e%30}}class IndentGuidesOverlay extends DynamicViewOverlay{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,n=t.get(132),i=t.get(44);this._lineHeight=t.get(59),this._spaceWidth=i.spaceWidth,this._maxIndentLeft=-1===n.wrappingColumn?-1:n.wrappingColumn*i.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(13),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(132),i=t.get(44);return this._lineHeight=t.get(59),this._spaceWidth=i.spaceWidth,this._maxIndentLeft=-1===n.wrappingColumn?-1:n.wrappingColumn*i.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(13),!0}onCursorStateChanged(e){var t;const n=e.selections[0].getPosition();return!(null===(t=this._primaryPosition)||void 0===t?void 0:t.equals(n))&&(this._primaryPosition=n,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){var t,n,i,o;if(!this._bracketPairGuideOptions.indentation&&!1===this._bracketPairGuideOptions.bracketPairs)return void(this._renderResult=null);const r=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,a=e.scrollWidth,l=this._lineHeight,c=this._primaryPosition,d=this.getGuidesByLine(r,s,c),u=[];for(let h=r;h<=s;h++){const s=h-r,c=d[s];let g="";const p=null!==(n=null===(t=e.visibleRangeForPosition(new Position$1(h,1)))||void 0===t?void 0:t.left)&&void 0!==n?n:0;for(const t of c){const n=p+(t.visibleColumn-1)*this._spaceWidth;if(n>a||this._maxIndentLeft>0&&n>this._maxIndentLeft)break;const r=t.horizontalLine?t.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",s=t.horizontalLine?(null!==(o=null===(i=e.visibleRangeForPosition(new Position$1(h,t.horizontalLine.endColumn)))||void 0===i?void 0:i.left)&&void 0!==o?o:n+this._spaceWidth)-n:this._spaceWidth;g+=`<div class="core-guide ${t.className} ${r}" style="left:${n}px;height:${l}px;width:${s}px"></div>`}u[s]=g}this._renderResult=u}getGuidesByLine(e,t,n){const i=!1!==this._bracketPairGuideOptions.bracketPairs?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,n,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:!0===this._bracketPairGuideOptions.bracketPairsHorizontal?HorizontalGuidesState.Enabled:"active"===this._bracketPairGuideOptions.bracketPairsHorizontal?HorizontalGuidesState.EnabledForActive:HorizontalGuidesState.Disabled,includeInactive:!0===this._bracketPairGuideOptions.bracketPairs}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let r=0,s=0,a=0;if(this._bracketPairGuideOptions.highlightActiveIndentation&&n){const i=this._context.viewModel.getActiveIndentGuide(n.lineNumber,e,t);r=i.startLineNumber,s=i.endLineNumber,a=i.indent}const{indentSize:l}=this._context.viewModel.model.getOptions(),c=[];for(let d=e;d<=t;d++){const t=new Array;c.push(t);const n=i?i[d-e]:[],u=new ArrayQueue(n),h=o?o[d-e]:[];for(let e=1;e<=h;e++){const i=(e-1)*l+1,o=0===n.length&&r<=d&&d<=s&&e===a;t.push(...u.takeWhile((e=>e.visibleColumn<i))||[]);const c=u.peek();c&&c.visibleColumn===i&&!c.horizontalLine||t.push(new IndentGuide(i,o?"core-guide-indent-active":"core-guide-indent",null))}t.push(...u.takeWhile((e=>!0))||[])}return c}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}function transparentToUndefined(e){if(!e||!e.isTransparent())return e}registerThemingParticipant(((e,t)=>{const n=e.getColor(editorIndentGuides);n&&t.addRule(`.monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 ${n} inset; }`);const i=e.getColor(editorActiveIndentGuides)||n;i&&t.addRule(`.monaco-editor .lines-content .core-guide-indent-active { box-shadow: 1px 0 0 0 ${i} inset; }`);const o=[{bracketColor:editorBracketHighlightingForeground1,guideColor:editorBracketPairGuideBackground1,guideColorActive:editorBracketPairGuideActiveBackground1},{bracketColor:editorBracketHighlightingForeground2,guideColor:editorBracketPairGuideBackground2,guideColorActive:editorBracketPairGuideActiveBackground2},{bracketColor:editorBracketHighlightingForeground3,guideColor:editorBracketPairGuideBackground3,guideColorActive:editorBracketPairGuideActiveBackground3},{bracketColor:editorBracketHighlightingForeground4,guideColor:editorBracketPairGuideBackground4,guideColorActive:editorBracketPairGuideActiveBackground4},{bracketColor:editorBracketHighlightingForeground5,guideColor:editorBracketPairGuideBackground5,guideColorActive:editorBracketPairGuideActiveBackground5},{bracketColor:editorBracketHighlightingForeground6,guideColor:editorBracketPairGuideBackground6,guideColorActive:editorBracketPairGuideActiveBackground6}],r=new BracketPairGuidesClassNames,s=o.map((t=>{var n,i;const o=e.getColor(t.bracketColor),r=e.getColor(t.guideColor),s=e.getColor(t.guideColorActive),a=transparentToUndefined(null!==(n=transparentToUndefined(r))&&void 0!==n?n:null==o?void 0:o.transparent(.3)),l=transparentToUndefined(null!==(i=transparentToUndefined(s))&&void 0!==i?i:o);if(a&&l)return{guideColor:a,guideColorActive:l}})).filter(isDefined);if(s.length>0){for(let e=0;e<30;e++){const n=s[e%s.length];t.addRule(`.monaco-editor .${r.getInlineClassNameOfLevel(e).replace(/ /g,".")} { --guide-color: ${n.guideColor}; --guide-color-active: ${n.guideColorActive}; }`)}t.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),t.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),t.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),t.addRule(`.monaco-editor .vertical.${r.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${r.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${r.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}}));var viewLines="";class LastRenderedData{constructor(){this._currentVisibleRange=new Range$2(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class HorizontalRevealRangeRequest{constructor(e,t,n,i,o,r,s){this.minimalReveal=e,this.lineNumber=t,this.startColumn=n,this.endColumn=i,this.startScrollTop=o,this.stopScrollTop=r,this.scrollType=s,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class HorizontalRevealSelectionsRequest{constructor(e,t,n,i,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=n,this.stopScrollTop=i,this.scrollType=o,this.type="selections";let r=t[0].startLineNumber,s=t[0].endLineNumber;for(let a=1,l=t.length;a<l;a++){const e=t[a];r=Math.min(r,e.startLineNumber),s=Math.max(s,e.endLineNumber)}this.minLineNumber=r,this.maxLineNumber=s}}class ViewLines extends ViewPart{constructor(e,t){super(e),this._linesContent=t,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new VisibleLinesCollection(this),this.domNode=this._visibleLines.domNode;const n=this._context.configuration,i=this._context.configuration.options,o=i.get(44),r=i.get(132),s=i.get(131);this._lineHeight=i.get(59),this._typicalHalfwidthCharacterWidth=o.typicalHalfwidthCharacterWidth,this._isViewportWrapping=r.isViewportWrapping,this._revealHorizontalRightPadding=i.get(89),this._horizontalScrollbarHeight=s.horizontalScrollbarHeight,this._cursorSurroundingLines=i.get(25),this._cursorSurroundingLinesStyle=i.get(26),this._canUseLayerHinting=!i.get(28),this._viewLineOptions=new ViewLineOptions(n,this._context.theme.type),PartFingerprints.write(this.domNode,7),this.domNode.setClassName(`view-lines ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`),applyFontInfo(this.domNode,o),this._maxLineWidth=0,this._asyncUpdateLineWidths=new RunOnceScheduler((()=>{this._updateLineWidthsSlow()}),200),this._asyncCheckMonospaceFontAssumptions=new RunOnceScheduler((()=>{this._checkMonospaceFontAssumptions()}),2e3),this._lastRenderedData=new LastRenderedData,this._horizontalRevealRequest=null}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new ViewLine(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(132)&&(this._maxLineWidth=0);const t=this._context.configuration.options,n=t.get(44),i=t.get(132),o=t.get(131);return this._lineHeight=t.get(59),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._isViewportWrapping=i.isViewportWrapping,this._revealHorizontalRightPadding=t.get(89),this._horizontalScrollbarHeight=o.horizontalScrollbarHeight,this._cursorSurroundingLines=t.get(25),this._cursorSurroundingLinesStyle=t.get(26),this._canUseLayerHinting=!t.get(28),applyFontInfo(this.domNode,n),this._onOptionsMaybeChanged(),e.hasChanged(131)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new ViewLineOptions(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const e=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let t=e;t<=n;t++){this._visibleLines.getVisibleLine(t).onOptionsChanged(this._viewLineOptions)}return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();let i=!1;for(let o=t;o<=n;o++)i=this._visibleLines.getVisibleLine(o).onSelectionChanged()||i;return i}onDecorationsChanged(e){{const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let n=e;n<=t;n++)this._visibleLines.getVisibleLine(n).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(-1===t)return!1;let n=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?n={scrollTop:n.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new HorizontalRevealRangeRequest(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new HorizontalRevealSelectionsRequest(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const i=Math.abs(this._context.viewLayout.getCurrentScrollTop()-n.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(n,i),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),n=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>n)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const n=this._getViewLineDomNode(e);if(null===n)return null;const i=this._getLineNumberFor(n);if(-1===i)return null;if(i<1||i>this._context.viewModel.getLineCount())return null;if(1===this._context.viewModel.getLineMaxColumn(i))return new Position$1(i,1);const o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(i<o||i>r)return null;let s=this._visibleLines.getVisibleLine(i).getColumnOfNodeOffset(i,e,t);const a=this._context.viewModel.getLineMinColumn(i);return s<a&&(s=a),new Position$1(i,s)}_getViewLineDomNode(e){for(;e&&1===e.nodeType;){if(e.className===ViewLine.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let i=t;i<=n;i++){if(e===this._visibleLines.getVisibleLine(i).getDomNode())return i}return-1}getLineWidth(e){const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();return e<t||e>n?-1:this._visibleLines.getVisibleLine(e).getWidth()}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const n=e.endLineNumber,i=Range$2.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!i)return null;let o=[],r=0;const s=new DomReadingContext(this.domNode.domNode,this._textRangeRestingSpot);let a=0;t&&(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position$1(i.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),c=this._visibleLines.getEndLineNumber();for(let d=i.startLineNumber;d<=i.endLineNumber;d++){if(d<l||d>c)continue;const e=d===i.startLineNumber?i.startColumn:1,u=d===i.endLineNumber?i.endColumn:this._context.viewModel.getLineMaxColumn(d),h=this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(d,e,u,s);if(h){if(t&&d<n){const e=a;a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position$1(d+1,1)).lineNumber,e!==a&&(h.ranges[h.ranges.length-1].width+=this._typicalHalfwidthCharacterWidth)}o[r++]=new LineVisibleRanges(h.outsideRenderedLine,d,HorizontalRange.from(h.ranges))}}return 0===r?null:o}_visibleRangesForLineRange(e,t,n){return this.shouldRender()||e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber()?null:this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,n,new DomReadingContext(this.domNode.domNode,this._textRangeRestingSpot))}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new HorizontalPosition(t.outsideRenderedLine,t.ranges[0].left):null}updateLineWidths(){this._updateLineWidths(!1)}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();let i=1,o=!0;for(let r=t;r<=n;r++){const t=this._visibleLines.getVisibleLine(r);!e||t.getWidthIsFast()?i=Math.max(i,t.getWidth()):o=!1}return o&&1===t&&n===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(i),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const n=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let o=n;o<=i;o++){const n=this._visibleLines.getVisibleLine(o);if(n.needsMonospaceFontCheck()){const i=n.getWidth();i>t&&(t=i,e=o)}}if(-1!==e&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=n;o<=i;o++){this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const e=this._computeScrollLeftToReveal(t);e&&(this._isViewportWrapping||this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()||this._asyncUpdateLineWidths.schedule(),isLinux&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let n=e;n<=t;n++){if(this._visibleLines.getVisibleLine(n).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth<t&&(this._maxLineWidth=t,this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,n,i,o,r){const s=e.top,a=e.height,l=s+a;let c,d,u;if(o&&o.length>0){let e=o[0].startLineNumber,t=o[0].endLineNumber;for(let n=1,i=o.length;n<i;n++){const i=o[n];e=Math.min(e,i.startLineNumber),t=Math.max(t,i.endLineNumber)}c=!1,d=this._context.viewLayout.getVerticalOffsetForLineNumber(e),u=this._context.viewLayout.getVerticalOffsetForLineNumber(t)+this._lineHeight}else{if(!i)return-1;c=!0,d=this._context.viewLayout.getVerticalOffsetForLineNumber(i.startLineNumber),u=this._context.viewLayout.getVerticalOffsetForLineNumber(i.endLineNumber)+this._lineHeight}if(("mouse"===t||n)&&"default"===this._cursorSurroundingLinesStyle)n||(d-=this._lineHeight);else{const e=Math.min(a/this._lineHeight/2,this._cursorSurroundingLines);d-=e*this._lineHeight,u+=Math.max(0,e-1)*this._lineHeight}let h;if(0!==r&&4!==r||(u+=n?this._horizontalScrollbarHeight:this._lineHeight),u-d>a){if(!c)return-1;h=d}else if(5===r||6===r)if(6===r&&s<=d&&u<=l)h=s;else{const e=d-Math.max(5*this._lineHeight,.2*a),t=u-a;h=Math.max(t,e)}else if(1===r||2===r)if(2===r&&s<=d&&u<=l)h=s;else{const e=(d+u)/2;h=Math.max(0,e-a/2)}else h=this._computeMinimumScrolling(s,l,d,u,3===r,4===r);return h}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),n=t.left,i=n+t.width;let o=1073741824,r=0;if("range"===e.type){const t=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!t)return null;for(const e of t.ranges)o=Math.min(o,Math.round(e.left)),r=Math.max(r,Math.round(e.left+e.width))}else for(const s of e.selections){if(s.startLineNumber!==s.endLineNumber)return null;const e=this._visibleRangesForLineRange(s.startLineNumber,s.startColumn,s.endColumn);if(!e)return null;for(const t of e.ranges)o=Math.min(o,Math.round(t.left)),r=Math.max(r,Math.round(t.left+t.width))}if(e.minimalReveal||(o=Math.max(0,o-ViewLines.HORIZONTAL_EXTRA_PX),r+=this._revealHorizontalRightPadding),"selections"===e.type&&r-o>t.width)return null;return{scrollLeft:this._computeMinimumScrolling(n,i,o,r),maxHorizontalOffset:r}}_computeMinimumScrolling(e,t,n,i,o,r){o=!!o,r=!!r;const s=(t|=0)-(e|=0);return(i|=0)-(n|=0)<s?o?n:r?Math.max(0,i-s):n<e?n:i>t?Math.max(0,i-s):e:n}}ViewLines.HORIZONTAL_EXTRA_PX=30;var linesDecorations="";class LinesDecorationsOverlay extends DedupOverlay{constructor(e){super(),this._context=e;const t=this._context.configuration.options.get(131);this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options.get(131);return this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),n=[];let i=0;for(let o=0,r=t.length;o<r;o++){const e=t[o],r=e.options.linesDecorationsClassName;r&&(n[i++]=new DecorationToRender(e.range.startLineNumber,e.range.endLineNumber,r));const s=e.options.firstLineDecorationClassName;s&&(n[i++]=new DecorationToRender(e.range.startLineNumber,e.range.startLineNumber,s))}return n}prepareRender(e){const t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,i=this._render(t,n,this._getDecorations(e)),o='" style="left:'+this._decorationsLeft.toString()+"px;width:"+this._decorationsWidth.toString()+'px;"></div>',r=[];for(let s=t;s<=n;s++){const e=s-t,n=i[e];let a="";for(let t=0,i=n.length;t<i;t++)a+='<div class="cldr '+n[t]+o;r[e]=a}this._renderResult=r}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var marginDecorations="";class MarginViewLineDecorationsOverlay extends DedupOverlay{constructor(e){super(),this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),n=[];let i=0;for(let o=0,r=t.length;o<r;o++){const e=t[o],r=e.options.marginClassName;r&&(n[i++]=new DecorationToRender(e.range.startLineNumber,e.range.endLineNumber,r))}return n}prepareRender(e){const t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,i=this._render(t,n,this._getDecorations(e)),o=[];for(let r=t;r<=n;r++){const e=r-t,n=i[e];let s="";for(let t=0,i=n.length;t<i;t++)s+='<div class="cmdr '+n[t]+'" style=""></div>';o[e]=s}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var minimap="";class RGBA8{constructor(e,t,n,i){this._rgba8Brand=void 0,this.r=RGBA8._clamp(e),this.g=RGBA8._clamp(t),this.b=RGBA8._clamp(n),this.a=RGBA8._clamp(i)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:0|e}}RGBA8.Empty=new RGBA8(0,0,0,0);class MinimapTokensColorTracker extends Disposable{constructor(){super(),this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(TokenizationRegistry.onDidChange((e=>{e.changedColorMap&&this._updateColorMap()})))}static getInstance(){return this._INSTANCE||(this._INSTANCE=markAsSingleton(new MinimapTokensColorTracker)),this._INSTANCE}_updateColorMap(){const e=TokenizationRegistry.getColorMap();if(!e)return this._colors=[RGBA8.Empty],void(this._backgroundIsLight=!0);this._colors=[RGBA8.Empty];for(let n=1;n<e.length;n++){const t=e[n].rgba;this._colors[n]=new RGBA8(t.r,t.g,t.b,Math.round(255*t.a))}const t=e[2].getRelativeLuminance();this._backgroundIsLight=t>=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}MinimapTokensColorTracker._INSTANCE=null;class Viewport{constructor(e,t,n,i){this._viewportBrand=void 0,this.top=0|e,this.left=0|t,this.width=0|n,this.height=0|i}}class MinimapLinesRenderingData{constructor(e,t){this.tabSize=e,this.data=t}}class ViewLineData{constructor(e,t,n,i,o,r,s){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=n,this.maxColumn=i,this.startVisibleColumn=o,this.tokens=r,this.inlineDecorations=s}}class ViewLineRenderingData{constructor(e,t,n,i,o,r,s,a,l,c){this.minColumn=e,this.maxColumn=t,this.content=n,this.continuesWithWrappedLine=i,this.isBasicASCII=ViewLineRenderingData.isBasicASCII(n,r),this.containsRTL=ViewLineRenderingData.containsRTL(n,this.isBasicASCII,o),this.tokens=s,this.inlineDecorations=a,this.tabSize=l,this.startVisibleColumn=c}static isBasicASCII(e,t){return!t||isBasicASCII(e)}static containsRTL(e,t,n){return!(t||!n)&&containsRTL(e)}}class InlineDecoration{constructor(e,t,n){this.range=e,this.inlineClassName=t,this.type=n}}class SingleLineInlineDecoration{constructor(e,t,n,i){this.startOffset=e,this.endOffset=t,this.inlineClassName=n,this.inlineClassNameAffectsLetterSpacing=i}toInlineDecoration(e){return new InlineDecoration(new Range$2(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class ViewModelDecoration{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class OverviewRulerDecorationsGroup{constructor(e,t,n){this.color=e,this.zIndex=t,this.data=n}static cmp(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:e.color>t.color?1:0:e.zIndex-t.zIndex}}const allCharCodes=(()=>{const e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})(),getCharIndex=(e,t)=>(e-=32)<0||e>96?t<=2?(e+96)%96:95:e;class MinimapCharRenderer{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=MinimapCharRenderer.soften(e,.8),this.charDataLight=MinimapCharRenderer.soften(e,50/60)}static soften(e,t){const n=new Uint8ClampedArray(e.length);for(let i=0,o=e.length;i<o;i++)n[i]=toUint8(e[i]*t);return n}renderChar(e,t,n,i,o,r,s,a,l,c,d){const u=1*this.scale,h=2*this.scale,g=d?1:h;if(t+u>e.width||n+g>e.height)return;const p=c?this.charDataLight:this.charDataNormal,f=getCharIndex(i,l),m=4*e.width,v=s.r,_=s.g,C=s.b,b=o.r-v,y=o.g-_,S=o.b-C,w=Math.max(r,a),E=e.data;let x=f*u*h,T=n*m+4*t;for(let I=0;I<g;I++){let e=T;for(let t=0;t<u;t++){const t=p[x++]/255*(r/255);E[e++]=v+b*t,E[e++]=_+y*t,E[e++]=C+S*t,E[e++]=w}T+=m}}blockRenderChar(e,t,n,i,o,r,s,a){const l=1*this.scale,c=2*this.scale,d=a?1:c;if(t+l>e.width||n+d>e.height)return;const u=4*e.width,h=o/255*.5,g=r.r,p=r.g,f=r.b,m=g+(i.r-g)*h,v=p+(i.g-p)*h,_=f+(i.b-f)*h,C=Math.max(o,s),b=e.data;let y=n*u+4*t;for(let S=0;S<d;S++){let e=y;for(let t=0;t<l;t++)b[e++]=m,b[e++]=v,b[e++]=_,b[e++]=C;y+=u}}}const charTable={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15},decodeData=e=>{const t=new Uint8ClampedArray(e.length/2);for(let n=0;n<e.length;n+=2)t[n>>1]=charTable[e[n]]<<4|15&charTable[e[n+1]];return t},prebakedMiniMaps={1:once$1((()=>decodeData("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792"))),2:once$1((()=>decodeData("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126")))};class MinimapCharRendererFactory{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let n;return n=prebakedMiniMaps[e]?new MinimapCharRenderer(prebakedMiniMaps[e](),e):MinimapCharRendererFactory.createFromSampleData(MinimapCharRendererFactory.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=n,n}static createSampleData(e){const t=document.createElement("canvas"),n=t.getContext("2d");t.style.height="16px",t.height=16,t.width=960,t.style.width="960px",n.fillStyle="#ffffff",n.font=`bold 16px ${e}`,n.textBaseline="middle";let i=0;for(const o of allCharCodes)n.fillText(String.fromCharCode(o),i,8),i+=10;return n.getImageData(0,0,960,16)}static createFromSampleData(e,t){if(61440!==e.length)throw new Error("Unexpected source in MinimapCharRenderer");const n=MinimapCharRendererFactory._downsample(e,t);return new MinimapCharRenderer(n,t)}static _downsampleChar(e,t,n,i,o){const r=1*o,s=2*o;let a=i,l=0;for(let c=0;c<s;c++){const i=c/s*16,o=(c+1)/s*16;for(let s=0;s<r;s++){const c=s/r*10,d=(s+1)/r*10;let u=0,h=0;for(let n=i;n<o;n++){const i=t+3840*Math.floor(n),o=1-(n-Math.floor(n));for(let t=c;t<d;t++){const n=1-(t-Math.floor(t)),r=i+4*Math.floor(t),s=n*o;h+=s,u+=e[r]*e[r+3]/255*s}}const g=u/h;l=Math.max(l,g),n[a++]=toUint8(g)}}return l}static _downsample(e,t){const n=2*t*1*t,i=96*n,o=new Uint8ClampedArray(i);let r=0,s=0,a=0;for(let l=0;l<96;l++)a=Math.max(a,this._downsampleChar(e,s,o,r,t)),r+=n,s+=40;if(a>0){const e=255/a;for(let t=0;t<i;t++)o[t]*=e}return o}}var OverviewRulerLane$1,OverviewRulerLane2,MinimapPosition$1,MinimapPosition2,InjectedTextCursorStops$1,InjectedTextCursorStops2;OverviewRulerLane2=OverviewRulerLane$1||(OverviewRulerLane$1={}),OverviewRulerLane2[OverviewRulerLane2.Left=1]="Left",OverviewRulerLane2[OverviewRulerLane2.Center=2]="Center",OverviewRulerLane2[OverviewRulerLane2.Right=4]="Right",OverviewRulerLane2[OverviewRulerLane2.Full=7]="Full",MinimapPosition2=MinimapPosition$1||(MinimapPosition$1={}),MinimapPosition2[MinimapPosition2.Inline=1]="Inline",MinimapPosition2[MinimapPosition2.Gutter=2]="Gutter",InjectedTextCursorStops2=InjectedTextCursorStops$1||(InjectedTextCursorStops$1={}),InjectedTextCursorStops2[InjectedTextCursorStops2.Both=0]="Both",InjectedTextCursorStops2[InjectedTextCursorStops2.Right=1]="Right",InjectedTextCursorStops2[InjectedTextCursorStops2.Left=2]="Left",InjectedTextCursorStops2[InjectedTextCursorStops2.None=3]="None";class TextModelResolvedOptions{constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,0|e.tabSize),this.indentSize=0|e.tabSize,this.insertSpaces=Boolean(e.insertSpaces),this.defaultEOL=0|e.defaultEOL,this.trimAutoWhitespace=Boolean(e.trimAutoWhitespace),this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&equals(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class FindMatch{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}class ValidAnnotatedEditOperation{constructor(e,t,n,i,o,r){this.identifier=e,this.range=t,this.text=n,this.forceMoveMarkers=i,this.isAutoWhitespaceEdit=o,this._isTracked=r}}class SearchData{constructor(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n}}class ApplyEditsResult{constructor(e,t,n){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=n}}function shouldSynchronizeModel(e){return!e.isTooLargeForSyncing()&&!e.isForSimpleWidget}const MOUSE_DRAG_RESET_DISTANCE=140,GUTTER_DECORATION_WIDTH=2;class MinimapOptions{constructor(e,t,n){const i=e.options,o=i.get(129),r=i.get(131),s=r.minimap,a=i.get(44),l=i.get(65);this.renderMinimap=s.renderMinimap,this.size=l.size,this.minimapHeightIsEditorHeight=s.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=i.get(94),this.showSlider=l.showSlider,this.pixelRatio=o,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.lineHeight=i.get(59),this.minimapLeft=s.minimapLeft,this.minimapWidth=s.minimapWidth,this.minimapHeight=r.height,this.canvasInnerWidth=s.minimapCanvasInnerWidth,this.canvasInnerHeight=s.minimapCanvasInnerHeight,this.canvasOuterWidth=s.minimapCanvasOuterWidth,this.canvasOuterHeight=s.minimapCanvasOuterHeight,this.isSampling=s.minimapIsSampling,this.editorHeight=r.height,this.fontScale=s.minimapScale,this.minimapLineHeight=s.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.charRenderer=once$1((()=>MinimapCharRendererFactory.create(this.fontScale,a.fontFamily))),this.defaultBackgroundColor=n.getColor(2),this.backgroundColor=MinimapOptions._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=MinimapOptions._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const n=e.getColor(minimapBackground);return n?new RGBA8(n.rgba.r,n.rgba.g,n.rgba.b,Math.round(255*n.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(minimapForegroundOpacity);return t?RGBA8._clamp(Math.round(255*t.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.showSlider===e.showSlider&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class MinimapLayout{constructor(e,t,n,i,o,r,s,a){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=n,this._computedSliderRatio=i,this.sliderTop=o,this.sliderHeight=r,this.startLineNumber=s,this.endLineNumber=a}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}static create(e,t,n,i,o,r,s,a,l,c,d){const u=e.pixelRatio,h=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/h),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){const t=a*e.lineHeight+(e.scrollBeyondLastLine?o-e.lineHeight:0),n=Math.max(1,Math.floor(o*o/t)),i=Math.max(0,e.minimapHeight-n),r=i/(c-o),d=l*r,u=i>0,h=Math.floor(e.canvasInnerHeight/e.minimapLineHeight);return new MinimapLayout(l,c,u,r,d,n,1,Math.min(s,h))}let f,m;if(r&&n!==s){const e=n-t+1;f=Math.floor(e*h/u)}else{const e=o/p;f=Math.floor(e*h/u)}m=e.scrollBeyondLastLine?(s-1)*h/u:Math.max(0,s*h/u-f),m=Math.min(e.minimapHeight-f,m);const v=m/(c-o),_=l*v;let C=0;if(e.scrollBeyondLastLine){C=o/p-1}if(g>=s+C){return new MinimapLayout(l,c,m>0,v,_,f,1,s)}{let e=Math.max(1,Math.floor(t-_*u/h));d&&d.scrollHeight===c&&(d.scrollTop>l&&(e=Math.min(e,d.startLineNumber)),d.scrollTop<l&&(e=Math.max(e,d.startLineNumber)));const n=Math.min(s,e+g-1);return new MinimapLayout(l,c,!0,v,(t-e+(l-i)/p)*h/u,f,e,n)}}}class MinimapLine{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}MinimapLine.INVALID=new MinimapLine(-1);class RenderData{constructor(e,t,n){this.renderedLayout=e,this._imageData=t,this._renderedLines=new RenderedLinesCollection((()=>MinimapLine.INVALID)),this._renderedLines._set(e.startLineNumber,n)}linesEquals(e){if(!this.scrollEquals(e))return!1;const t=this._renderedLines._get().lines;for(let n=0,i=t.length;n<i;n++)if(-1===t[n].dy)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){const e=this._renderedLines._get();return{imageData:this._imageData,rendLineNumberStart:e.rendLineNumberStart,lines:e.lines}}onLinesChanged(e,t){return this._renderedLines.onLinesChanged(e,t)}onLinesDeleted(e,t){this._renderedLines.onLinesDeleted(e,t)}onLinesInserted(e,t){this._renderedLines.onLinesInserted(e,t)}onTokensChanged(e){return this._renderedLines.onTokensChanged(e)}}class MinimapBuffers{constructor(e,t,n,i){this._backgroundFillData=MinimapBuffers._createBackgroundFillData(t,n,i),this._buffers=[e.createImageData(t,n),e.createImageData(t,n)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;const e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,t,n){const i=n.r,o=n.g,r=n.b,s=n.a,a=new Uint8ClampedArray(e*t*4);let l=0;for(let c=0;c<t;c++)for(let t=0;t<e;t++)a[l]=i,a[l+1]=o,a[l+2]=r,a[l+3]=s,l+=4;return a}}class MinimapSamplingState{constructor(e,t){this.samplingRatio=e,this.minimapLines=t}static compute(e,t,n){if(0===e.renderMinimap||!e.isSampling)return[null,[]];const i=e.pixelRatio,o=e.lineHeight,r=e.scrollBeyondLastLine,{minimapLineCount:s}=EditorLayoutInfoComputer.computeContainedMinimapLineCount({viewLineCount:t,scrollBeyondLastLine:r,height:e.editorHeight,lineHeight:o,pixelRatio:i}),a=t/s,l=a/2;if(!n||0===n.minimapLines.length){const e=[];if(e[0]=1,s>1){for(let t=0,n=s-1;t<n;t++)e[t]=Math.round(t*a+l);e[s-1]=t}return[new MinimapSamplingState(a,e),[]]}const c=n.minimapLines,d=c.length,u=[];let h=0,g=0,p=1;let f=[],m=null;for(let v=0;v<s;v++){const e=Math.max(p,Math.round(v*a)),n=Math.max(e,Math.round((v+1)*a));for(;h<d&&c[h]<e;){if(f.length<10){const e=h+1+g;m&&"deleted"===m.type&&m._oldIndex===h-1?m.deleteToLineNumber++:(m={type:"deleted",_oldIndex:h,deleteFromLineNumber:e,deleteToLineNumber:e},f.push(m)),g--}h++}let i;if(h<d&&c[h]<=n)i=c[h],h++;else if(i=0===v?1:v+1===s?t:Math.round(v*a+l),f.length<10){const e=h+1+g;m&&"inserted"===m.type&&m._i===v-1?m.insertToLineNumber++:(m={type:"inserted",_i:v,insertFromLineNumber:e,insertToLineNumber:e},f.push(m)),g++}u[v]=i,p=i}if(f.length<10)for(;h<d;){const e=h+1+g;m&&"deleted"===m.type&&m._oldIndex===h-1?m.deleteToLineNumber++:(m={type:"deleted",_oldIndex:h,deleteFromLineNumber:e,deleteToLineNumber:e},f.push(m)),g--,h++}else f=[{type:"flush"}];return[new MinimapSamplingState(a,u),f]}modelLineToMinimapLine(e){return Math.min(this.minimapLines.length,Math.max(1,Math.round(e/this.samplingRatio)))}modelLineRangeToMinimapLineRange(e,t){let n=this.modelLineToMinimapLine(e)-1;for(;n>0&&this.minimapLines[n-1]>=e;)n--;let i=this.modelLineToMinimapLine(t)-1;for(;i+1<this.minimapLines.length&&this.minimapLines[i+1]<=t;)i++;if(n===i){const i=this.minimapLines[n];if(i<e||i>t)return null}return[n+1,i+1]}decorationLineRangeToMinimapLineRange(e,t){let n=this.modelLineToMinimapLine(e),i=this.modelLineToMinimapLine(t);return e!==t&&i===n&&(i===this.minimapLines.length?n>1&&n--:i++),[n,i]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let n=this.minimapLines.length,i=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]<e.fromLineNumber);o--)this.minimapLines[o]<=e.toLineNumber?(this.minimapLines[o]=Math.max(1,e.fromLineNumber-1),n=Math.min(n,o),i=Math.max(i,o)):this.minimapLines[o]-=t;return[n,i]}onLinesInserted(e){const t=e.toLineNumber-e.fromLineNumber+1;for(let n=this.minimapLines.length-1;n>=0&&!(this.minimapLines[n]<e.fromLineNumber);n--)this.minimapLines[n]+=t}}class Minimap extends ViewPart{constructor(e){super(e),this.tokensColorTracker=MinimapTokensColorTracker.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new MinimapOptions(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=MinimapSamplingState.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new InnerMinimap(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new MinimapOptions(this._context.configuration,this._context.theme,this.tokensColorTracker);return!this.options.equals(e)&&(this.options=e,this._recreateLineSampling(),this._actual.onDidChangeOptions(),!0)}onConfigurationChanged(e){return this._onOptionsMaybeChanged()}onCursorStateChanged(e){return this._selections=e.selections,this._minimapSelections=null,this._actual.onSelectionChanged()}onDecorationsChanged(e){return!!e.affectsMinimap&&this._actual.onDecorationsChanged()}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(this._samplingState){const t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.toLineNumber);return!!t&&this._actual.onLinesChanged(t[0],t[1])}return this._actual.onLinesChanged(e.fromLineNumber,e.toLineNumber)}onLinesDeleted(e){if(this._samplingState){const[t,n]=this._samplingState.onLinesDeleted(e);return t<=n&&this._actual.onLinesChanged(t+1,n+1),this._shouldCheckSampling=!0,!0}return this._actual.onLinesDeleted(e.fromLineNumber,e.toLineNumber)}onLinesInserted(e){return this._samplingState?(this._samplingState.onLinesInserted(e),this._shouldCheckSampling=!0,!0):this._actual.onLinesInserted(e.fromLineNumber,e.toLineNumber)}onScrollChanged(e){return this._actual.onScrollChanged()}onThemeChanged(e){return this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(this._samplingState){const t=[];for(const n of e.ranges){const e=this._samplingState.modelLineRangeToMinimapLineRange(n.fromLineNumber,n.toLineNumber);e&&t.push({fromLineNumber:e[0],toLineNumber:e[1]})}return!!t.length&&this._actual.onTokensChanged(t)}return this._actual.onTokensChanged(e.ranges)}onTokensColorsChanged(e){return this._onOptionsMaybeChanged(),this._actual.onTokensColorsChanged()}onZonesChanged(e){return this._actual.onZonesChanged()}prepareRender(e){this._shouldCheckSampling&&(this._shouldCheckSampling=!1,this._recreateLineSampling())}render(e){let t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),n=this._samplingState.modelLineToMinimapLine(n));const i={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:n,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(i)}_recreateLineSampling(){this._minimapSelections=null;const e=Boolean(this._samplingState),[t,n]=MinimapSamplingState.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const i of n)switch(i.type){case"deleted":this._actual.onLinesDeleted(i.deleteFromLineNumber,i.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(i.insertFromLineNumber,i.insertToLineNumber);break;case"flush":this._actual.onFlushed()}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,n){if(this._samplingState){const i=[];for(let o=0,r=t-e+1;o<r;o++)n[o]?i[o]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+o-1]):i[o]=null;return i}return this._context.viewModel.getMinimapLinesRenderingData(e,t,n).data}getSelections(){if(null===this._minimapSelections)if(this._samplingState){this._minimapSelections=[];for(const e of this._selections){const[t,n]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new Selection$1(t,e.startColumn,n,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){let n;if(this._samplingState){const i=this._samplingState.minimapLines[e-1],o=this._samplingState.minimapLines[t-1];n=new Range$2(i,1,o,this._context.viewModel.getLineMaxColumn(o))}else n=new Range$2(e,1,t,this._context.viewModel.getLineMaxColumn(t));const i=this._context.viewModel.getDecorationsInViewport(n);if(this._samplingState){const e=[];for(const t of i){if(!t.options.minimap)continue;const n=t.range,i=this._samplingState.modelLineToMinimapLine(n.startLineNumber),o=this._samplingState.modelLineToMinimapLine(n.endLineNumber);e.push(new ViewModelDecoration(new Range$2(i,n.startColumn,o,n.endColumn),t.options))}return e}return i}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new Range$2(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class InnerMinimap extends Disposable{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(minimapSelection),this._domNode=createFastDomNode(document.createElement("div")),PartFingerprints.write(this._domNode,8),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=createFastDomNode(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=createFastDomNode(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=createFastDomNode(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=createFastDomNode(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=createFastDomNode(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._mouseDownListener=addStandardDisposableListener(this._domNode.domNode,"mousedown",(e=>{e.preventDefault();if(0===this._model.options.renderMinimap)return;if(!this._lastRenderData)return;if("proportional"!==this._model.options.size){if(e.leftButton&&this._lastRenderData){const t=getDomNodePagePosition(this._slider.domNode),n=t.top+t.height/2;this._startSliderDragging(e.buttons,e.posx,n,e.posy,this._lastRenderData.renderedLayout)}return}const t=this._model.options.minimapLineHeight,n=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.browserEvent.offsetY;let i=Math.floor(n/t)+this._lastRenderData.renderedLayout.startLineNumber;i=Math.min(i,this._model.getLineCount()),this._model.revealLineNumber(i)})),this._sliderMouseMoveMonitor=new GlobalMouseMoveMonitor,this._sliderMouseDownListener=addStandardDisposableListener(this._slider.domNode,"mousedown",(e=>{e.preventDefault(),e.stopPropagation(),e.leftButton&&this._lastRenderData&&this._startSliderDragging(e.buttons,e.posx,e.posy,e.posy,this._lastRenderData.renderedLayout)})),this._gestureDisposable=Gesture.addTarget(this._domNode.domNode),this._sliderTouchStartListener=addDisposableListener(this._domNode.domNode,EventType.Start,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))}),{passive:!1}),this._sliderTouchMoveListener=addDisposableListener(this._domNode.domNode,EventType.Change,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)}),{passive:!1}),this._sliderTouchEndListener=addStandardDisposableListener(this._domNode.domNode,EventType.End,(e=>{e.preventDefault(),e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)}))}_startSliderDragging(e,t,n,i,o){this._slider.toggleClassName("active",!0);const r=(e,i)=>{const r=Math.abs(i-t);if(isWindows&&r>MOUSE_DRAG_RESET_DISTANCE)return void this._model.setScrollTop(o.scrollTop);const s=e-n;this._model.setScrollTop(o.getDesiredScrollTopFromDelta(s))};i!==n&&r(i,t),this._sliderMouseMoveMonitor.startMonitoring(this._slider.domNode,e,standardMouseMoveMerger,(e=>r(e.posy,e.posx)),(()=>{this._slider.toggleClassName("active",!1)}))}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,n=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(n)}dispose(){this._mouseDownListener.dispose(),this._sliderMouseMoveMonitor.dispose(),this._sliderMouseDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){return"always"===this._model.options.showSlider?"minimap slider-always":"minimap slider-mouseover"}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new MinimapBuffers(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return!!this._lastRenderData&&this._lastRenderData.onLinesChanged(e,t)}onLinesDeleted(e,t){return this._lastRenderData&&this._lastRenderData.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData&&this._lastRenderData.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(minimapSelection),this._renderDecorations=!0,!0}onTokensChanged(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(0===this._model.options.renderMinimap)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const t=MinimapLayout.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(t.sliderNeeded?"block":"none"),this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(Range$2.compareRangesUsingStarts);const n=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);n.sort(((e,t)=>(e.options.zIndex||0)-(t.options.zIndex||0)));const{canvasInnerWidth:i,canvasInnerHeight:o}=this._model.options,r=this._model.options.minimapLineHeight,s=this._model.options.minimapCharWidth,a=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,i,o);const c=new ContiguousLineMap(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,c,e,r),this._renderDecorationsLineHighlights(l,n,c,e,r);const d=new ContiguousLineMap(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,d,e,r,a,s,i),this._renderDecorationsHighlights(l,n,d,e,r,a,s,i)}}_renderSelectionLineHighlights(e,t,n,i,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,s=0;for(const a of t){const t=Math.max(i.startLineNumber,a.startLineNumber),l=Math.min(i.endLineNumber,a.endLineNumber);if(t>l)continue;for(let e=t;e<=l;e++)n.set(e,!0);const c=(t-i.startLineNumber)*o,d=(l-i.startLineNumber)*o+o;s>=c||(s>r&&e.fillRect(MINIMAP_GUTTER_WIDTH,r,e.canvas.width,s-r),r=c),s=d}s>r&&e.fillRect(MINIMAP_GUTTER_WIDTH,r,e.canvas.width,s-r)}_renderDecorationsLineHighlights(e,t,n,i,o){const r=new Map;for(let s=t.length-1;s>=0;s--){const a=t[s],l=a.options.minimap;if(!l||l.position!==MinimapPosition$1.Inline)continue;const c=Math.max(i.startLineNumber,a.range.startLineNumber),d=Math.min(i.endLineNumber,a.range.endLineNumber);if(c>d)continue;const u=l.getColor(this._theme.value);if(!u||u.isTransparent())continue;let h=r.get(u.toString());h||(h=u.transparent(.5).toString(),r.set(u.toString(),h)),e.fillStyle=h;for(let t=c;t<=d;t++){if(n.has(t))continue;n.set(t,!0);const r=(c-i.startLineNumber)*o;e.fillRect(MINIMAP_GUTTER_WIDTH,r,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,n,i,o,r,s,a){if(this._selectionColor&&!this._selectionColor.isTransparent())for(const l of t){const t=Math.max(i.startLineNumber,l.startLineNumber),c=Math.min(i.endLineNumber,l.endLineNumber);if(!(t>c))for(let d=t;d<=c;d++)this.renderDecorationOnLine(e,n,l,this._selectionColor,i,d,o,o,r,s,a)}}_renderDecorationsHighlights(e,t,n,i,o,r,s,a){for(const l of t){const t=l.options.minimap;if(!t)continue;const c=Math.max(i.startLineNumber,l.range.startLineNumber),d=Math.min(i.endLineNumber,l.range.endLineNumber);if(c>d)continue;const u=t.getColor(this._theme.value);if(u&&!u.isTransparent())for(let h=c;h<=d;h++)switch(t.position){case MinimapPosition$1.Inline:this.renderDecorationOnLine(e,n,l.range,u,i,h,o,o,r,s,a);continue;case MinimapPosition$1.Gutter:{const t=(h-i.startLineNumber)*o,n=2;this.renderDecoration(e,u,n,t,GUTTER_DECORATION_WIDTH,o);continue}}}}renderDecorationOnLine(e,t,n,i,o,r,s,a,l,c,d){const u=(r-o.startLineNumber)*a;if(u+s<0||u>this._model.options.canvasInnerHeight)return;const{startLineNumber:h,endLineNumber:g}=n,p=h===r?n.startColumn:1,f=g===r?n.endColumn:this._model.getLineMaxColumn(r),m=this.getXOffsetForPosition(t,r,p,l,c,d),v=this.getXOffsetForPosition(t,r,f,l,c,d);this.renderDecoration(e,i,m,u,v-m,s)}getXOffsetForPosition(e,t,n,i,o,r){if(1===n)return MINIMAP_GUTTER_WIDTH;if((n-1)*o>=r)return r;let s=e.get(t);if(!s){const n=this._model.getLineContent(t);s=[MINIMAP_GUTTER_WIDTH];let a=MINIMAP_GUTTER_WIDTH;for(let e=1;e<n.length+1;e++){const t=n.charCodeAt(e-1),l=a+(9===t?i*o:isFullWidthCharacter(t)?2*o:o);if(l>=r){s[e]=r;break}s[e]=l,a=l}e.set(t,s)}return n-1<s.length?s[n-1]:r}renderDecoration(e,t,n,i,o,r){e.fillStyle=t&&t.toString()||"",e.fillRect(n,i,o,r)}renderLines(e){const t=e.startLineNumber,n=e.endLineNumber,i=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const t=this._lastRenderData._get();return new RenderData(e,t.imageData,t.lines)}const o=this._getBuffer();if(!o)return null;const[r,s,a]=InnerMinimap._renderUntouchedLines(o,t,n,i,this._lastRenderData),l=this._model.getMinimapLinesRenderingData(t,n,a),c=this._model.getOptions().tabSize,d=this._model.options.defaultBackgroundColor,u=this._model.options.backgroundColor,h=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,p=g.backgroundIsLight(),f=this._model.options.renderMinimap,m=this._model.options.charRenderer(),v=this._model.options.fontScale,_=this._model.options.minimapCharWidth,C=(1===f?2:3)*v,b=i>C?Math.floor((i-C)/2):0,y=u.a/255,S=new RGBA8(Math.round((u.r-d.r)*y+d.r),Math.round((u.g-d.g)*y+d.g),Math.round((u.b-d.b)*y+d.b),255);let w=0;const E=[];for(let I=0,k=n-t+1;I<k;I++)a[I]&&InnerMinimap._renderLine(o,S,u.a,p,f,_,g,h,m,w,b,c,l[I],v,i),E[I]=new MinimapLine(w),w+=i;const x=-1===r?0:r,T=(-1===s?o.height:s)-x;return this._canvas.domNode.getContext("2d").putImageData(o,0,0,0,x,o.width,T),new RenderData(e,o,E)}static _renderUntouchedLines(e,t,n,i,o){const r=[];if(!o){for(let e=0,i=n-t+1;e<i;e++)r[e]=!0;return[-1,-1,r]}const s=o._get(),a=s.imageData.data,l=s.rendLineNumberStart,c=s.lines,d=c.length,u=e.width,h=e.data,g=(n-t+1)*i*u*4;let p=-1,f=-1,m=-1,v=-1,_=-1,C=-1,b=0;for(let y=t;y<=n;y++){const e=y-t,n=y-l,o=n>=0&&n<d?c[n].dy:-1;if(-1===o){r[e]=!0,b+=i;continue}const s=o*u*4,S=(o+i)*u*4,w=b*u*4,E=(b+i)*u*4;v===s&&C===w?(v=S,C=E):(-1!==m&&(h.set(a.subarray(m,v),_),-1===p&&0===m&&m===_&&(p=v),-1===f&&v===g&&m===_&&(f=m)),m=s,v=S,_=w,C=E),r[e]=!1,b+=i}-1!==m&&(h.set(a.subarray(m,v),_),-1===p&&0===m&&m===_&&(p=v),-1===f&&v===g&&m===_&&(f=m));return[-1===p?-1:p/(4*u),-1===f?-1:f/(4*u),r]}static _renderLine(e,t,n,i,o,r,s,a,l,c,d,u,h,g,p){const f=h.content,m=h.tokens,v=e.width-r,_=1===p;let C=MINIMAP_GUTTER_WIDTH,b=0,y=0;for(let S=0,w=m.getCount();S<w;S++){const h=m.getEndOffset(S),p=m.getForeground(S),w=s.getColor(p);for(;b<h;b++){if(C>v)return;const s=f.charCodeAt(b);if(9===s){const e=u-(b+y)%u;y+=e-1,C+=e*r}else if(32===s)C+=r;else{const u=isFullWidthCharacter(s)?2:1;for(let h=0;h<u;h++)if(2===o?l.blockRenderChar(e,C,c+d,w,a,t,n,_):l.renderChar(e,C,c+d,s,w,a,t,n,g,i,_),C+=r,C>v)return}}}}}class ContiguousLineMap{constructor(e,t,n){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=n,this._values=[];for(let i=0,o=this._endLineNumber-this._startLineNumber+1;i<o;i++)this._values[i]=n}has(e){return this.get(e)!==this._defaultValue}set(e,t){e<this._startLineNumber||e>this._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return e<this._startLineNumber||e>this._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}registerThemingParticipant(((e,t)=>{const n=e.getColor(minimapSliderBackground);n&&t.addRule(`.monaco-editor .minimap-slider .minimap-slider-horizontal { background: ${n}; }`);const i=e.getColor(minimapSliderHoverBackground);i&&t.addRule(`.monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: ${i}; }`);const o=e.getColor(minimapSliderActiveBackground);o&&t.addRule(`.monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: ${o}; }`);const r=e.getColor(scrollbarShadow);r&&t.addRule(`.monaco-editor .minimap-shadow-visible { box-shadow: ${r} -6px 0 6px -6px inset; }`)}));var overlayWidgets="";class ViewOverlayWidgets extends ViewPart{constructor(e){super(e);const t=this._context.configuration.options.get(131);this._widgets={},this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,this._domNode=createFastDomNode(document.createElement("div")),PartFingerprints.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options.get(131);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}addWidget(e){const t=createFastDomNode(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){const n=this._widgets[e.getId()];return n.preference!==t&&(n.preference=t,this.setShouldRender(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.parentNode.removeChild(e),this.setShouldRender()}}_renderWidget(e){const t=e.domNode;if(null!==e.preference)if(0===e.preference)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(1===e.preference){const e=t.domNode.clientHeight;t.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else 2===e.preference&&(t.setTop(0),t.domNode.style.right="50%");else t.unsetTop()}prepareRender(e){}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets);for(let n=0,i=t.length;n<i;n++){const e=t[n];this._renderWidget(this._widgets[e])}}}class Settings{constructor(e,t){const n=e.options;this.lineHeight=n.get(59),this.pixelRatio=n.get(129),this.overviewRulerLanes=n.get(74),this.renderBorder=n.get(73);const i=t.getColor(editorOverviewRulerBorder);this.borderColor=i?i.toString():null,this.hideCursor=n.get(52);const o=t.getColor(editorCursorForeground);this.cursorColor=o?o.transparent(.7).toString():null,this.themeType=t.type;const r=n.get(65),s=r.enabled,a=r.side,l=s?t.getColor(editorOverviewRulerBackground)||TokenizationRegistry.getDefaultBackground():null;this.backgroundColor=null===l||"left"===a?null:Color.Format.CSS.formatHex(l);const c=n.get(131).overviewRuler;this.top=c.top,this.right=c.right,this.domWidth=c.width,this.domHeight=c.height,0===this.overviewRulerLanes?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[d,u]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=d,this.w=u}_initLanes(e,t,n){const i=t-e;if(n>=3){const t=Math.floor(i/3),n=Math.floor(i/3),o=i-t-n,r=e+t;return[[0,e,r,e,e+t+o,e,r,e],[0,t,o,t+o,n,t+o+n,o+n,t+o+n]]}if(2===n){const t=Math.floor(i/2),n=i-t;return[[0,e,e,e,e+t,e,e,e],[0,t,t,t,n,t+n,t+n,t+n]]}return[[0,e,e,e,e,e,e,e],[0,i,i,i,i,i,i,i]]}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&this.backgroundColor===e.backgroundColor&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class DecorationsOverviewRuler extends ViewPart{constructor(e){super(e),this._domNode=createFastDomNode(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=TokenizationRegistry.onDidChange((e=>{e.changedColorMap&&this._updateSettings(!0)})),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new Settings(this._context.configuration,this._context.theme);return(!this._settings||!this._settings.equals(t))&&(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}onConfigurationChanged(e){return this._updateSettings(!1)}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,n=e.selections.length;t<n;t++)this._cursorPositions[t]=e.selections[t].getPosition();return this._cursorPositions.sort(Position$1.compare),!0}onDecorationsChanged(e){return!!e.affectsOverviewRuler}onFlushed(e){return!0}onScrollChanged(e){return e.scrollHeightChanged}onZonesChanged(e){return!0}onThemeChanged(e){return this._updateSettings(!1)}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render()}_render(){if(0===this._settings.overviewRulerLanes)return this._domNode.setBackgroundColor(this._settings.backgroundColor?this._settings.backgroundColor:""),void this._domNode.setDisplay("none");this._domNode.setDisplay("block");const e=this._settings.canvasWidth,t=this._settings.canvasHeight,n=this._settings.lineHeight,i=this._context.viewLayout,o=t/this._context.viewLayout.getScrollHeight(),r=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme),s=6*this._settings.pixelRatio|0,a=s/2|0,l=this._domNode.domNode.getContext("2d");null===this._settings.backgroundColor?l.clearRect(0,0,e,t):(l.fillStyle=this._settings.backgroundColor,l.fillRect(0,0,e,t));const c=this._settings.x,d=this._settings.w;r.sort(OverviewRulerDecorationsGroup.cmp);for(const u of r){const e=u.color,r=u.data;l.fillStyle=e;let h=0,g=0,p=0;for(let u=0,f=r.length/3;u<f;u++){const e=r[3*u],f=r[3*u+1],m=r[3*u+2];let v=i.getVerticalOffsetForLineNumber(f)*o|0,_=(i.getVerticalOffsetForLineNumber(m)+n)*o|0;if(_-v<s){let e=(v+_)/2|0;e<a?e=a:e+a>t&&(e=t-a),v=e-a,_=e+a}v>p+1||e!==h?(0!==u&&l.fillRect(c[h],g,d[h],p-g),h=e,g=v,p=_):_>p&&(p=_)}l.fillRect(c[h],g,d[h],p-g)}if(!this._settings.hideCursor&&this._settings.cursorColor){const e=2*this._settings.pixelRatio|0,n=e/2|0,r=this._settings.x[7],s=this._settings.w[7];l.fillStyle=this._settings.cursorColor;let a=-100,c=-100;for(let d=0,u=this._cursorPositions.length;d<u;d++){const u=this._cursorPositions[d];let h=i.getVerticalOffsetForLineNumber(u.lineNumber)*o|0;h<n?h=n:h+n>t&&(h=t-n);const g=h-n,p=g+e;g>c+1?(0!==d&&l.fillRect(r,a,s,c-a),a=g,c=p):p>c&&(c=p)}l.fillRect(r,a,s,c-a)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(l.beginPath(),l.lineWidth=1,l.strokeStyle=this._settings.borderColor,l.moveTo(0,0),l.lineTo(0,t),l.stroke(),l.moveTo(0,0),l.lineTo(e,0),l.stroke())}}class ColorZone{constructor(e,t,n){this._colorZoneBrand=void 0,this.from=0|e,this.to=0|t,this.colorId=0|n}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class OverviewRulerZone{constructor(e,t,n,i){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=n,this.color=i,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.color<t.color?-1:1}setColorZone(e){this._colorZone=e}getColorZones(){return this._colorZone}}class OverviewZoneManager{constructor(e){this._getVerticalOffsetForLine=e,this._zones=[],this._colorZonesInvalid=!1,this._lineHeight=0,this._domWidth=0,this._domHeight=0,this._outerHeight=0,this._pixelRatio=1,this._lastAssignedId=0,this._color2Id=Object.create(null),this._id2Color=[]}getId2Color(){return this._id2Color}setZones(e){this._zones=e,this._zones.sort(OverviewRulerZone.compare)}setLineHeight(e){return this._lineHeight!==e&&(this._lineHeight=e,this._colorZonesInvalid=!0,!0)}setPixelRatio(e){this._pixelRatio=e,this._colorZonesInvalid=!0}getDOMWidth(){return this._domWidth}getCanvasWidth(){return this._domWidth*this._pixelRatio}setDOMWidth(e){return this._domWidth!==e&&(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight!==e&&(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight!==e&&(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){const e=this._colorZonesInvalid,t=Math.floor(this._lineHeight),n=Math.floor(this.getCanvasHeight()),i=n/Math.floor(this._outerHeight),o=Math.floor(4*this._pixelRatio/2),r=[];for(let s=0,a=this._zones.length;s<a;s++){const a=this._zones[s];if(!e){const e=a.getColorZones();if(e){r.push(e);continue}}const l=this._getVerticalOffsetForLine(a.startLineNumber),c=0===a.heightInLines?this._getVerticalOffsetForLine(a.endLineNumber)+t:l+a.heightInLines*t,d=Math.floor(i*l),u=Math.floor(i*c);let h=Math.floor((d+u)/2),g=u-h;g<o&&(g=o),h-g<0&&(h=g),h+g>n&&(h=n-g);const p=a.color;let f=this._color2Id[p];f||(f=++this._lastAssignedId,this._color2Id[p]=f,this._id2Color[f]=p);const m=new ColorZone(h-g,h+g,f);a.setColorZone(m),r.push(m)}return this._colorZonesInvalid=!1,r.sort(ColorZone.compare),r}}class OverviewRuler extends ViewEventHandler{constructor(e,t){super(),this._context=e;const n=this._context.configuration.options;this._domNode=createFastDomNode(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new OverviewZoneManager((e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e))),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(n.get(59)),this._zoneManager.setPixelRatio(n.get(129)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(59)&&(this._zoneManager.setLineHeight(t.get(59)),this._render()),e.hasChanged(129)&&(this._zoneManager.setPixelRatio(t.get(129)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(0===this._zoneManager.getOuterHeight())return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),n=this._zoneManager.resolveColorZones(),i=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),n.length>0&&this._renderOneLane(o,n,i,e),!0}_renderOneLane(e,t,n,i){let o=0,r=0,s=0;for(const a of t){const t=a.colorId,l=a.from,c=a.to;t!==o?(e.fillRect(0,r,i,s-r),o=t,e.fillStyle=n[o],r=l,s=c):s>=l?s=Math.max(s,c):(e.fillRect(0,r,i,s-r),r=l,s=c)}e.fillRect(0,r,i,s-r)}}var rulers="";class Rulers extends ViewPart{constructor(e){super(e),this.domNode=createFastDomNode(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(91),this._typicalHalfwidthCharacterWidth=t.get(44).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(91),this._typicalHalfwidthCharacterWidth=t.get(44).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e<t){const{tabSize:n}=this._context.viewModel.model.getOptions(),i=n;let o=t-e;for(;o>0;){const e=createFastDomNode(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(i),this.domNode.appendChild(e),this._renderedRulers.push(e),o--}return}let n=e-t;for(;n>0;){const e=this._renderedRulers.pop();this.domNode.removeChild(e),n--}}render(e){this._ensureRulersCount();for(let t=0,n=this._rulers.length;t<n;t++){const n=this._renderedRulers[t],i=this._rulers[t];n.setBoxShadow(i.color?`1px 0 0 0 ${i.color} inset`:""),n.setHeight(Math.min(e.scrollHeight,1e6)),n.setLeft(i.column*this._typicalHalfwidthCharacterWidth)}}}registerThemingParticipant(((e,t)=>{const n=e.getColor(editorRuler);n&&t.addRule(`.monaco-editor .view-ruler { box-shadow: 1px 0 0 0 ${n} inset; }`)}));var scrollDecoration="";class ScrollDecorationViewPart extends ViewPart{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const t=this._context.configuration.options.get(92);this._useShadows=t.useShadows,this._domNode=createFastDomNode(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){const e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e&&(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){const e=this._context.configuration.options.get(131);0===e.minimap.renderMinimap||e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?this._width=e.width:this._width=e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}onConfigurationChanged(e){const t=this._context.configuration.options.get(92);return this._useShadows=t.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}registerThemingParticipant(((e,t)=>{const n=e.getColor(scrollbarShadow);n&&t.addRule(`.monaco-editor .scroll-decoration { box-shadow: ${n} 0 6px 6px -6px inset; }`)}));var selections="";class HorizontalRangeWithStyle{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class LineVisibleRangesWithStyle{constructor(e,t){this.lineNumber=e,this.ranges=t}}function toStyledRange(e){return new HorizontalRangeWithStyle(e)}function toStyled(e){return new LineVisibleRangesWithStyle(e.lineNumber,e.ranges.map(toStyledRange))}class SelectionsOverlay extends DynamicViewOverlay{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(59),this._roundedSelection=t.get(90),this._typicalHalfwidthCharacterWidth=t.get(44).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(59),this._roundedSelection=t.get(90),this._typicalHalfwidthCharacterWidth=t.get(44).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,n=e.length;t<n;t++){if(e[t].ranges.length>1)return!0}return!1}_enrichVisibleRangesWithStyle(e,t,n){const i=this._typicalHalfwidthCharacterWidth/4;let o=null,r=null;if(n&&n.length>0&&t.length>0){const i=t[0].lineNumber;if(i===e.startLineNumber)for(let e=0;!o&&e<n.length;e++)n[e].lineNumber===i&&(o=n[e].ranges[0]);const s=t[t.length-1].lineNumber;if(s===e.endLineNumber)for(let e=n.length-1;!r&&e>=0;e--)n[e].lineNumber===s&&(r=n[e].ranges[0]);o&&!o.startStyle&&(o=null),r&&!r.startStyle&&(r=null)}for(let s=0,a=t.length;s<a;s++){const e=t[s].ranges[0],n=e.left,l=e.left+e.width,c={top:0,bottom:0},d={top:0,bottom:0};if(s>0){const e=t[s-1].ranges[0].left,o=t[s-1].ranges[0].left+t[s-1].ranges[0].width;abs(n-e)<i?c.top=2:n>e&&(c.top=1),abs(l-o)<i?d.top=2:e<l&&l<o&&(d.top=1)}else o&&(c.top=o.startStyle.top,d.top=o.endStyle.top);if(s+1<a){const e=t[s+1].ranges[0].left,o=t[s+1].ranges[0].left+t[s+1].ranges[0].width;abs(n-e)<i?c.bottom=2:e<n&&n<o&&(c.bottom=1),abs(l-o)<i?d.bottom=2:l<o&&(d.bottom=1)}else r&&(c.bottom=r.startStyle.bottom,d.bottom=r.endStyle.bottom);e.startStyle=c,e.endStyle=d}}_getVisibleRangesWithStyle(e,t,n){const i=(t.linesVisibleRangesForRange(e,!0)||[]).map(toStyled);return!this._visibleRangesHaveGaps(i)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,i,n),i}_createSelectionPiece(e,t,n,i,o){return'<div class="cslr '+n+'" style="top:'+e.toString()+"px;left:"+i.toString()+"px;width:"+o.toString()+"px;height:"+t+'px;"></div>'}_actualRenderOneSelection(e,t,n,i){if(0===i.length)return;const o=!!i[0].ranges[0].startStyle,r=this._lineHeight.toString(),s=(this._lineHeight-1).toString(),a=i[0].lineNumber,l=i[i.length-1].lineNumber;for(let c=0,d=i.length;c<d;c++){const d=i[c],u=d.lineNumber,h=u-t,g=n&&(u===l||u===a)?s:r,p=n&&u===a?1:0;let f="",m="";for(let e=0,t=d.ranges.length;e<t;e++){const t=d.ranges[e];if(o){const e=t.startStyle,n=t.endStyle;if(1===e.top||1===e.bottom){f+=this._createSelectionPiece(p,g,SelectionsOverlay.SELECTION_CLASS_NAME,t.left-SelectionsOverlay.ROUNDED_PIECE_WIDTH,SelectionsOverlay.ROUNDED_PIECE_WIDTH);let n=SelectionsOverlay.EDITOR_BACKGROUND_CLASS_NAME;1===e.top&&(n+=" "+SelectionsOverlay.SELECTION_TOP_RIGHT),1===e.bottom&&(n+=" "+SelectionsOverlay.SELECTION_BOTTOM_RIGHT),f+=this._createSelectionPiece(p,g,n,t.left-SelectionsOverlay.ROUNDED_PIECE_WIDTH,SelectionsOverlay.ROUNDED_PIECE_WIDTH)}if(1===n.top||1===n.bottom){f+=this._createSelectionPiece(p,g,SelectionsOverlay.SELECTION_CLASS_NAME,t.left+t.width,SelectionsOverlay.ROUNDED_PIECE_WIDTH);let e=SelectionsOverlay.EDITOR_BACKGROUND_CLASS_NAME;1===n.top&&(e+=" "+SelectionsOverlay.SELECTION_TOP_LEFT),1===n.bottom&&(e+=" "+SelectionsOverlay.SELECTION_BOTTOM_LEFT),f+=this._createSelectionPiece(p,g,e,t.left+t.width,SelectionsOverlay.ROUNDED_PIECE_WIDTH)}}let n=SelectionsOverlay.SELECTION_CLASS_NAME;if(o){const e=t.startStyle,i=t.endStyle;0===e.top&&(n+=" "+SelectionsOverlay.SELECTION_TOP_LEFT),0===e.bottom&&(n+=" "+SelectionsOverlay.SELECTION_BOTTOM_LEFT),0===i.top&&(n+=" "+SelectionsOverlay.SELECTION_TOP_RIGHT),0===i.bottom&&(n+=" "+SelectionsOverlay.SELECTION_BOTTOM_RIGHT)}m+=this._createSelectionPiece(p,g,n,t.left,t.width)}e[h][0]+=f,e[h][1]+=m}}prepareRender(e){const t=[],n=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber;for(let r=n;r<=i;r++){t[r-n]=["",""]}const o=[];for(let r=0,s=this._selections.length;r<s;r++){const i=this._selections[r];if(i.isEmpty()){o[r]=null;continue}const s=this._getVisibleRangesWithStyle(i,e,this._previousFrameVisibleRangesWithStyle[r]);o[r]=s,this._actualRenderOneSelection(t,n,this._selections.length>1,s)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map((([e,t])=>e+t))}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}}function abs(e){return e<0?-e:e}SelectionsOverlay.SELECTION_CLASS_NAME="selected-text",SelectionsOverlay.SELECTION_TOP_LEFT="top-left-radius",SelectionsOverlay.SELECTION_BOTTOM_LEFT="bottom-left-radius",SelectionsOverlay.SELECTION_TOP_RIGHT="top-right-radius",SelectionsOverlay.SELECTION_BOTTOM_RIGHT="bottom-right-radius",SelectionsOverlay.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",SelectionsOverlay.ROUNDED_PIECE_WIDTH=10,registerThemingParticipant(((e,t)=>{const n=e.getColor(editorSelectionBackground);n&&t.addRule(`.monaco-editor .focused .selected-text { background-color: ${n}; }`);const i=e.getColor(editorInactiveSelection);i&&t.addRule(`.monaco-editor .selected-text { background-color: ${i}; }`);const o=e.getColor(editorSelectionForeground);o&&!o.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${o}; }`)}));var viewCursors="";class ViewCursorRenderData{constructor(e,t,n,i,o,r){this.top=e,this.left=t,this.width=n,this.height=i,this.textContent=o,this.textContentClassName=r}}class ViewCursor{constructor(e){this._context=e;const t=this._context.configuration.options,n=t.get(44);this._cursorStyle=t.get(24),this._lineHeight=t.get(59),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(27),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=createFastDomNode(document.createElement("div")),this._domNode.setClassName(`cursor ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),applyFontInfo(this._domNode,n),this._domNode.setDisplay("none"),this._position=new Position$1(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(44);return this._cursorStyle=t.get(24),this._lineHeight=t.get(59),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(27),this._typicalHalfwidthCharacterWidth),applyFontInfo(this._domNode,n),!0}onCursorPositionChanged(e){return this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,n=this._context.viewModel.getLineContent(e),[i,o]=getCharContainingOffset(n,t-1);return[new Position$1(e,i+1),n.substring(i,o)]}_prepareRender(e){let t="";const[n,i]=this._getGraphemeAwarePosition();if(this._cursorStyle===TextEditorCursorStyle$1.Line||this._cursorStyle===TextEditorCursorStyle$1.LineThin){const o=e.visibleRangeForPosition(n);if(!o||o.outsideRenderedLine)return null;let r;this._cursorStyle===TextEditorCursorStyle$1.Line?(r=computeScreenAwareSize(this._lineCursorWidth>0?this._lineCursorWidth:2),r>2&&(t=i)):r=computeScreenAwareSize(1);let s=o.left;r>=2&&s>=1&&(s-=1);const a=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta;return new ViewCursorRenderData(a,s,r,this._lineHeight,t,"")}const o=e.linesVisibleRangesForRange(new Range$2(n.lineNumber,n.column,n.lineNumber,n.column+i.length),!1);if(!o||0===o.length)return null;const r=o[0];if(r.outsideRenderedLine||0===r.ranges.length)return null;const s=r.ranges[0],a=s.width<1?this._typicalHalfwidthCharacterWidth:s.width;let l="";if(this._cursorStyle===TextEditorCursorStyle$1.Block){const e=this._context.viewModel.getViewLineData(n.lineNumber);t=i;const o=e.tokens.findTokenIndexAtOffset(n.column-1);l=e.tokens.getClassName(o)}let c=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return this._cursorStyle!==TextEditorCursorStyle$1.Underline&&this._cursorStyle!==TextEditorCursorStyle$1.UnderlineThin||(c+=this._lineHeight-2,d=2),new ViewCursorRenderData(c,s.left,a,d,t,l)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class ViewCursors extends ViewPart{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(81),this._cursorBlinking=t.get(22),this._cursorStyle=t.get(24),this._cursorSmoothCaretAnimation=t.get(23),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new ViewCursor(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=createFastDomNode(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new TimeoutTimer,this._cursorFlatBlinkInterval=new IntervalTimer,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(81),this._cursorBlinking=t.get(22),this._cursorStyle=t.get(24),this._cursorSmoothCaretAnimation=t.get(23),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let n=0,i=this._secondaryCursors.length;n<i;n++)this._secondaryCursors[n].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t){if(this._primaryCursor.onCursorPositionChanged(e),this._updateBlinking(),this._secondaryCursors.length<t.length){const e=t.length-this._secondaryCursors.length;for(let t=0;t<e;t++){const e=new ViewCursor(this._context);this._domNode.domNode.insertBefore(e.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(e)}}else if(this._secondaryCursors.length>t.length){const e=this._secondaryCursors.length-t.length;for(let t=0;t<e;t++)this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),this._secondaryCursors.splice(0,1)}for(let n=0;n<t.length;n++)this._secondaryCursors[n].onCursorPositionChanged(t[n])}onCursorStateChanged(e){const t=[];for(let i=0,o=e.selections.length;i<o;i++)t[i]=e.selections[i].getPosition();this._onCursorPositionChanged(t[0],t.slice(1));const n=e.selections[0].isEmpty();return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,this._updateDomClassName()),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onFocusChanged(e){return this._editorHasFocus=e.isFocused,this._updateBlinking(),!1}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onTokensChanged(e){const t=t=>{for(let n=0,i=e.ranges.length;n<i;n++)if(e.ranges[n].fromLineNumber<=t.lineNumber&&t.lineNumber<=e.ranges[n].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(const n of this._secondaryCursors)if(t(n.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return this._isComposingInput?0:this._editorHasFocus?this._readOnly?5:this._cursorBlinking:0}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();const e=this._getCursorBlinking(),t=0===e,n=5===e;t?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),t||n||(1===e?this._cursorFlatBlinkInterval.cancelAndSet((()=>{this._isVisible?this._hide():this._show()}),ViewCursors.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet((()=>{this._blinkingEnabled=!0,this._updateDomClassName()}),ViewCursors.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case TextEditorCursorStyle$1.Line:e+=" cursor-line-style";break;case TextEditorCursorStyle$1.Block:e+=" cursor-block-style";break;case TextEditorCursorStyle$1.Underline:e+=" cursor-underline-style";break;case TextEditorCursorStyle$1.LineThin:e+=" cursor-line-thin-style";break;case TextEditorCursorStyle$1.BlockOutline:e+=" cursor-block-outline-style";break;case TextEditorCursorStyle$1.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return this._cursorSmoothCaretAnimation&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].show();this._isVisible=!0}_hide(){this._primaryCursor.hide();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].hide();this._isVisible=!1}prepareRender(e){this._primaryCursor.prepareRender(e);for(let t=0,n=this._secondaryCursors.length;t<n;t++)this._secondaryCursors[t].prepareRender(e)}render(e){const t=[];let n=0;const i=this._primaryCursor.render(e);i&&(t[n++]=i);for(let o=0,r=this._secondaryCursors.length;o<r;o++){const i=this._secondaryCursors[o].render(e);i&&(t[n++]=i)}this._renderData=t}getLastRenderData(){return this._renderData}}ViewCursors.BLINK_INTERVAL=500,registerThemingParticipant(((e,t)=>{const n=e.getColor(editorCursorForeground);if(n){let i=e.getColor(editorCursorBackground);i||(i=n.opposite()),t.addRule(`.monaco-editor .inputarea.ime-input { caret-color: ${n}; }`),t.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${n}; border-color: ${n}; color: ${i}; }`),"hc"===e.type&&t.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${i}; border-right: 1px solid ${i}; }`)}}));const invalidFunc$1=()=>{throw new Error("Invalid change accessor")};class ViewZones extends ViewPart{constructor(e){super(e);const t=this._context.configuration.options,n=t.get(131);this._lineHeight=t.get(59),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,this.domNode=createFastDomNode(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=createFastDomNode(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const i of e)t.set(i.id,i);let n=!1;return this._context.viewModel.changeWhitespace((e=>{const i=Object.keys(this._zones);for(let o=0,r=i.length;o<r;o++){const r=i[o],s=this._zones[r],a=this._computeWhitespaceProps(s.delegate);s.isInHiddenArea=a.isInHiddenArea;const l=t.get(r);!l||l.afterLineNumber===a.afterViewLineNumber&&l.height===a.heightInPx||(e.changeOneWhitespace(r,a.afterViewLineNumber,a.heightInPx),this._safeCallOnComputedHeight(s.delegate,a.heightInPx),n=!0)}})),n}onConfigurationChanged(e){const t=this._context.configuration.options,n=t.get(131);return this._lineHeight=t.get(59),this._contentWidth=n.contentWidth,this._contentLeft=n.contentLeft,e.hasChanged(59)&&this._recomputeWhitespacesProps(),!0}onLineMappingChanged(e){return this._recomputeWhitespacesProps()}onLinesDeleted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}onLinesInserted(e){return!0}_getZoneOrdinal(e){return void 0!==e.afterColumn?e.afterColumn:1e4}_computeWhitespaceProps(e){if(0===e.afterLineNumber)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let t,n;if(void 0!==e.afterColumn)t=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{const n=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new Position$1(n,this._context.viewModel.model.getLineMaxColumn(n))}n=t.column===this._context.viewModel.model.getLineMaxColumn(t.lineNumber)?this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber+1,column:1}):this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber,column:t.column+1});const i=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t,e.afterColumnAffinity),o=this._context.viewModel.coordinatesConverter.modelPositionIsVisible(n);return{isInHiddenArea:!o,afterViewLineNumber:i.lineNumber,heightInPx:o?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.viewModel.changeWhitespace((n=>{const i={addZone:e=>(t=!0,this._addZone(n,e)),removeZone:e=>{e&&(t=this._removeZone(n,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(n,e)||t)}};safeInvoke1Arg(e,i),i.addZone=invalidFunc$1,i.removeZone=invalidFunc$1,i.layoutZone=invalidFunc$1})),t}_addZone(e,t){const n=this._computeWhitespaceProps(t),i={whitespaceId:e.insertWhitespace(n.afterViewLineNumber,this._getZoneOrdinal(t),n.heightInPx,n.minWidthInPx),delegate:t,isInHiddenArea:n.isInHiddenArea,isVisible:!1,domNode:createFastDomNode(t.domNode),marginDomNode:t.marginDomNode?createFastDomNode(t.marginDomNode):null};return this._safeCallOnComputedHeight(i.delegate,n.heightInPx),i.domNode.setPosition("absolute"),i.domNode.domNode.style.width="100%",i.domNode.setDisplay("none"),i.domNode.setAttribute("monaco-view-zone",i.whitespaceId),this.domNode.appendChild(i.domNode),i.marginDomNode&&(i.marginDomNode.setPosition("absolute"),i.marginDomNode.domNode.style.width="100%",i.marginDomNode.setDisplay("none"),i.marginDomNode.setAttribute("monaco-view-zone",i.whitespaceId),this.marginDomNode.appendChild(i.marginDomNode)),this._zones[i.whitespaceId]=i,this.setShouldRender(),i.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const n=this._zones[t];return delete this._zones[t],e.removeWhitespace(n.whitespaceId),n.domNode.removeAttribute("monaco-visible-view-zone"),n.domNode.removeAttribute("monaco-view-zone"),n.domNode.domNode.parentNode.removeChild(n.domNode.domNode),n.marginDomNode&&(n.marginDomNode.removeAttribute("monaco-visible-view-zone"),n.marginDomNode.removeAttribute("monaco-view-zone"),n.marginDomNode.domNode.parentNode.removeChild(n.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const n=this._zones[t],i=this._computeWhitespaceProps(n.delegate);return n.isInHiddenArea=i.isInHiddenArea,e.changeOneWhitespace(n.whitespaceId,i.afterViewLineNumber,i.heightInPx),this._safeCallOnComputedHeight(n.delegate,i.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!1}_heightInPixels(e){return"number"==typeof e.heightInPx?e.heightInPx:"number"==typeof e.heightInLines?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return"number"==typeof e.minWidthInPx?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if("function"==typeof e.onComputedHeight)try{e.onComputedHeight(t)}catch(e2){onUnexpectedError(e2)}}_safeCallOnDomNodeTop(e,t){if("function"==typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(e2){onUnexpectedError(e2)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,n={};let i=!1;for(const r of t)this._zones[r.id].isInHiddenArea||(n[r.id]=r,i=!0);const o=Object.keys(this._zones);for(let r=0,s=o.length;r<s;r++){const t=o[r],i=this._zones[t];let s=0,a=0,l="none";n.hasOwnProperty(t)?(s=n[t].verticalOffset-e.bigNumbersDelta,a=n[t].height,l="block",i.isVisible||(i.domNode.setAttribute("monaco-visible-view-zone","true"),i.isVisible=!0),this._safeCallOnDomNodeTop(i.delegate,e.getScrolledTopFromAbsoluteTop(n[t].verticalOffset))):(i.isVisible&&(i.domNode.removeAttribute("monaco-visible-view-zone"),i.isVisible=!1),this._safeCallOnDomNodeTop(i.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),i.domNode.setTop(s),i.domNode.setHeight(a),i.domNode.setDisplay(l),i.marginDomNode&&(i.marginDomNode.setTop(s),i.marginDomNode.setHeight(a),i.marginDomNode.setDisplay(l))}i&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}function safeInvoke1Arg(e,t){try{return e(t)}catch(e2){onUnexpectedError(e2)}}class EditorTheme{constructor(e){this._theme=e}get type(){return this._theme.type}get value(){return this._theme}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class ViewContext{constructor(e,t,n){this.configuration=e,this.theme=new EditorTheme(t),this.viewModel=n,this.viewLayout=n.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}class ViewportData{constructor(e,t,n,i){this.selections=e,this.startLineNumber=0|t.startLineNumber,this.endLineNumber=0|t.endLineNumber,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=0|t.bigNumbersDelta,this.whitespaceViewportData=n,this._model=i,this.visibleRange=new Range$2(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class View extends ViewEventHandler{constructor(e,t,n,i,o,r){super(),this._selections=[new Selection$1(1,1,1,1)],this._renderAnimationFrame=null;const s=new ViewController(t,i,o,e);this._context=new ViewContext(t,n,i),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=new TextAreaHandler(this._context,s,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=createFastDomNode(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=createFastDomNode(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=createFastDomNode(document.createElement("div")),PartFingerprints.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new EditorScrollbar(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new ViewLines(this._context,this._linesContent),this._viewZones=new ViewZones(this._context),this._viewParts.push(this._viewZones);const a=new DecorationsOverviewRuler(this._context);this._viewParts.push(a);const l=new ScrollDecorationViewPart(this._context);this._viewParts.push(l);const c=new ContentViewOverlays(this._context);this._viewParts.push(c),c.addDynamicOverlay(new CurrentLineHighlightOverlay(this._context)),c.addDynamicOverlay(new SelectionsOverlay(this._context)),c.addDynamicOverlay(new IndentGuidesOverlay(this._context)),c.addDynamicOverlay(new DecorationsOverlay(this._context));const d=new MarginViewOverlays(this._context);this._viewParts.push(d),d.addDynamicOverlay(new CurrentLineMarginHighlightOverlay(this._context)),d.addDynamicOverlay(new GlyphMarginOverlay(this._context)),d.addDynamicOverlay(new MarginViewLineDecorationsOverlay(this._context)),d.addDynamicOverlay(new LinesDecorationsOverlay(this._context)),d.addDynamicOverlay(new LineNumbersOverlay(this._context));const u=new Margin(this._context);u.getDomNode().appendChild(this._viewZones.marginDomNode),u.getDomNode().appendChild(d.getDomNode()),this._viewParts.push(u),this._contentWidgets=new ViewContentWidgets(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new ViewCursors(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new ViewOverlayWidgets(this._context),this._viewParts.push(this._overlayWidgets);const h=new Rulers(this._context);this._viewParts.push(h);const g=new Minimap(this._context);if(this._viewParts.push(g),a){const e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(a.getDomNode(),e.insertBefore)}this._linesContent.appendChild(c.getDomNode()),this._linesContent.appendChild(h.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(u.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(l.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(g.getDomNode()),this.domNode.appendChild(this._overflowGuardContainer),r?r.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new PointerHandler(this._context,s,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._renderNow()}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new PointerHandlerLastRenderData(e,t)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new Position$1(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const e=this._context.configuration.options.get(131);this.domNode.setWidth(e.width),this.domNode.setHeight(e.height),this._overflowGuardContainer.setWidth(e.width),this._overflowGuardContainer.setHeight(e.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(128)+" "+getThemeTypeSelector(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){null!==this._renderAnimationFrame&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){null===this._renderAnimationFrame&&(this._renderAnimationFrame=runAtThisOrScheduleAtNextAnimationFrame(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){safeInvokeNoArg((()=>this._actualRender()))}_getViewPartsToRender(){const e=[];let t=0;for(const n of this._viewParts)n.shouldRender()&&(e[t++]=n);return e}_actualRender(){if(!isInDOM(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&0===e.length)return;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const n=new ViewportData(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(n),this._viewLines.shouldRender()&&(this._viewLines.renderText(n),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const i=new RenderingContext(this._context.viewLayout,n,this._viewLines);for(const o of e)o.prepareRender(i);for(const o of e)o.render(i),o.onDidRender()}delegateVerticalScrollbarMouseDown(e){this._scrollbar.delegateVerticalScrollbarMouseDown(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop},1),this._context.viewModel.tokenizeViewport(),this._renderNow(),this._viewLines.updateLineWidths(),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},1)}getOffsetForColumn(e,t){const n=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),i=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new Position$1(i.lineNumber,i.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const n=this._pointerHandler.getTargetAtClientPoint(e,t);return n?ViewUserInputEvents.convertViewToModelMouseTarget(n,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new OverviewRuler(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const e of this._viewParts)e.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){let t=e.position&&e.position.range||null;if(null===t){const n=e.position?e.position.position:null;null!==n&&(t=new Range$2(n.lineNumber,n.column,n.lineNumber,n.column))}const n=e.position?e.position.preference:null;this._contentWidgets.setWidgetPosition(e.widget,t,n),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}}function safeInvokeNoArg(e){try{return e()}catch(e2){onUnexpectedError(e2)}}class Cursor{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new SingleCursorState(new Range$2(1,1,1,1),0,new Position$1(1,1),0),new SingleCursorState(new Range$2(1,1,1,1),0,new Position$1(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new CursorState$1(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return Selection$1.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,n){this._setState(e,t,n)}static _validatePositionWithCache(e,t,n,i){return t.equals(n)?i:e.normalizePosition(t,2)}static _validateViewState(e,t){const n=t.position,i=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),r=e.normalizePosition(n,2),s=this._validatePositionWithCache(e,i,n,r),a=this._validatePositionWithCache(e,o,i,s);return n.equals(r)&&i.equals(s)&&o.equals(a)?t:new SingleCursorState(Range$2.fromPositions(s,a),t.selectionStartLeftoverVisibleColumns+i.column-s.column,r,t.leftoverVisibleColumns+n.column-r.column)}_setState(e,t,n){if(n&&(n=Cursor._validateViewState(e.viewModel,n)),t){const n=e.model.validateRange(t.selectionStart),i=t.selectionStart.equalsRange(n)?t.selectionStartLeftoverVisibleColumns:0,o=e.model.validatePosition(t.position),r=t.position.equals(o)?t.leftoverVisibleColumns:0;t=new SingleCursorState(n,i,o,r)}else{if(!n)return;const i=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(n.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(n.position));t=new SingleCursorState(i,n.selectionStartLeftoverVisibleColumns,o,n.leftoverVisibleColumns)}if(n){const i=e.coordinatesConverter.validateViewRange(n.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(n.position,t.position);n=new SingleCursorState(i,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const i=e.coordinatesConverter.convertModelPositionToViewPosition(new Position$1(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new Position$1(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new Range$2(i.lineNumber,i.column,o.lineNumber,o.column),s=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);n=new SingleCursorState(r,t.selectionStartLeftoverVisibleColumns,s,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=n,this._updateTrackedRange(e)}}class CursorCollection{constructor(e){this.context=e,this.cursors=[new Cursor(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map((e=>e.readSelectionFromMarkers(this.context)))}getAll(){return this.cursors.map((e=>e.asCursorState()))}getViewPositions(){return this.cursors.map((e=>e.viewState.position))}getTopMostViewPosition(){return findMinBy(this.cursors,compareBy((e=>e.viewState.position),Position$1.compare)).viewState.position}getBottomMostViewPosition(){return findLastMaxBy(this.cursors,compareBy((e=>e.viewState.position),Position$1.compare)).viewState.position}getSelections(){return this.cursors.map((e=>e.modelState.selection))}getViewSelections(){return this.cursors.map((e=>e.viewState.selection))}setSelections(e){this.setStates(CursorState$1.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){null!==e&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,n=e.length;if(t<n){const e=n-t;for(let t=0;t<e;t++)this._addSecondaryCursor()}else if(t>n){const e=t-n;for(let t=0;t<e;t++)this._removeSecondaryCursor(this.cursors.length-2)}for(let i=0;i<n;i++)this.cursors[i+1].setState(this.context,e[i].modelState,e[i].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.cursors.push(new Cursor(this.context)),this.lastAddedCursorIndex=this.cursors.length-1}getLastAddedCursorIndex(){return 1===this.cursors.length||0===this.lastAddedCursorIndex?0:this.lastAddedCursorIndex}_removeSecondaryCursor(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(1===this.cursors.length)return;const e=this.cursors.slice(0),t=[];for(let n=0,i=e.length;n<i;n++)t.push({index:n,selection:e[n].modelState.selection});t.sort(compareBy((e=>e.selection),Range$2.compareRangesUsingStarts));for(let n=0;n<t.length-1;n++){const i=t[n],o=t[n+1],r=i.selection,s=o.selection;if(!this.context.cursorConfig.multiCursorMergeOverlapping)continue;let a;if(a=s.isEmpty()||r.isEmpty()?s.getStartPosition().isBeforeOrEqual(r.getEndPosition()):s.getStartPosition().isBefore(r.getEndPosition()),a){const r=i.index<o.index?n:n+1,s=i.index<o.index?n+1:n,a=t[s].index,l=t[r].index,c=t[s].selection,d=t[r].selection;if(!c.equalsSelection(d)){const n=c.plusRange(d),i=c.selectionStartLineNumber===c.startLineNumber&&c.selectionStartColumn===c.startColumn,o=d.selectionStartLineNumber===d.startLineNumber&&d.selectionStartColumn===d.startColumn;let s,u;a===this.lastAddedCursorIndex?(s=i,this.lastAddedCursorIndex=l):s=o,u=s?new Selection$1(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new Selection$1(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn),t[r].selection=u;const h=CursorState$1.fromModelSelection(u);e[l].setState(this.context,h.modelState,h.viewState)}for(const e of t)e.index>a&&e.index--;e.splice(a,1),t.splice(s,1),this._removeSecondaryCursor(a-1),n--}}}}class CursorContext{constructor(e,t,n,i){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=n,this.cursorConfig=i}}class ModelRawFlush{constructor(){this.changeType=1}}class LineInjectedText{constructor(e,t,n,i,o){this.ownerId=e,this.lineNumber=t,this.column=n,this.options=i,this.order=o}static applyInjectedText(e,t){if(!t||0===t.length)return e;let n="",i=0;for(const o of t)n+=e.substring(i,o.column-1),i=o.column-1,n+=o.options.content;return n+=e.substring(i),n}static fromDecorations(e){const t=[];for(const n of e)n.options.before&&n.options.before.content.length>0&&t.push(new LineInjectedText(n.ownerId,n.range.startLineNumber,n.range.startColumn,n.options.before,0)),n.options.after&&n.options.after.content.length>0&&t.push(new LineInjectedText(n.ownerId,n.range.endLineNumber,n.range.endColumn,n.options.after,1));return t.sort(((e,t)=>e.lineNumber===t.lineNumber?e.column===t.column?e.order-t.order:e.column-t.column:e.lineNumber-t.lineNumber)),t}}class ModelRawLineChanged{constructor(e,t,n){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=n}}class ModelRawLinesDeleted{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class ModelRawLinesInserted{constructor(e,t,n,i){this.changeType=4,this.injectedTexts=i,this.fromLineNumber=e,this.toLineNumber=t,this.detail=n}}class ModelRawEOLChanged{constructor(){this.changeType=5}}class ModelRawContentChangedEvent{constructor(e,t,n,i){this.changes=e,this.versionId=t,this.isUndoing=n,this.isRedoing=i,this.resultingSelection=null}containsEvent(e){for(let t=0,n=this.changes.length;t<n;t++){if(this.changes[t].changeType===e)return!0}return!1}static merge(e,t){const n=[].concat(e.changes).concat(t.changes),i=t.versionId,o=e.isUndoing||t.isUndoing,r=e.isRedoing||t.isRedoing;return new ModelRawContentChangedEvent(n,i,o,r)}}class ModelInjectedTextChangedEvent{constructor(e){this.changes=e}}class InternalModelContentChangeEvent{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){const t=ModelRawContentChangedEvent.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),n=InternalModelContentChangeEvent._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new InternalModelContentChangeEvent(t,n)}static _mergeChangeEvents(e,t){return{changes:[].concat(e.changes).concat(t.changes),eol:t.eol,versionId:t.versionId,isUndoing:e.isUndoing||t.isUndoing,isRedoing:e.isRedoing||t.isRedoing,isFlush:e.isFlush||t.isFlush}}}class ViewCompositionStartEvent{constructor(){this.type=0}}class ViewCompositionEndEvent{constructor(){this.type=1}}class ViewConfigurationChangedEvent{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class ViewCursorStateChangedEvent{constructor(e,t){this.type=3,this.selections=e,this.modelSelections=t}}class ViewDecorationsChangedEvent{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0)}}class ViewFlushedEvent{constructor(){this.type=5}}class ViewFocusChangedEvent{constructor(e){this.type=6,this.isFocused=e}}class ViewLanguageConfigurationEvent{constructor(){this.type=7}}class ViewLineMappingChangedEvent{constructor(){this.type=8}}class ViewLinesChangedEvent{constructor(e,t){this.type=9,this.fromLineNumber=e,this.toLineNumber=t}}class ViewLinesDeletedEvent{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class ViewLinesInsertedEvent{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class ViewRevealRangeRequestEvent{constructor(e,t,n,i,o,r,s){this.source=e,this.minimalReveal=t,this.range=n,this.selections=i,this.verticalType=o,this.revealHorizontal=r,this.scrollType=s,this.type=12}}class ViewScrollChangedEvent{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class ViewThemeChangedEvent{constructor(e){this.theme=e,this.type=14}}class ViewTokensChangedEvent{constructor(e){this.type=15,this.ranges=e}}class ViewTokensColorsChangedEvent{constructor(){this.type=16}}class ViewZonesChangedEvent$1{constructor(){this.type=17}}class ViewModelEventDispatcher extends Disposable{constructor(){super(),this._onEvent=this._register(new Emitter$1),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,n=this._outgoingEvents.length;t<n;t++)if(this._outgoingEvents[t].kind===e.kind)return void(this._outgoingEvents[t]=this._outgoingEvents[t].merge(e));this._outgoingEvents.push(e)}_emitOutgoingEvents(){for(;this._outgoingEvents.length>0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,n=this._eventHandlers.length;t<n;t++)this._eventHandlers[t];this._eventHandlers.push(e)}removeViewEventHandler(e){for(let t=0;t<this._eventHandlers.length;t++)if(this._eventHandlers[t]===e){this._eventHandlers.splice(t,1);break}}beginEmitViewEvents(){return this._collectorCnt++,1===this._collectorCnt&&(this._collector=new ViewModelEventsCollector),this._collector}endEmitViewEvents(){if(this._collectorCnt--,0===this._collectorCnt){const e=this._collector.outgoingEvents,t=this._collector.viewEvents;this._collector=null;for(const n of e)this._addOutgoingEvent(n);t.length>0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const n of t)n.handleEvents(e)}}}class ViewModelEventsCollector{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class ContentSizeChangedEvent{constructor(e,t,n,i){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=n,this.contentHeight=i,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}merge(e){return 0!==e.kind?this:new ContentSizeChangedEvent(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class FocusChangedEvent{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}merge(e){return 1!==e.kind?this:new FocusChangedEvent(this.oldHasFocus,e.hasFocus)}}class ScrollChangedEvent{constructor(e,t,n,i,o,r,s,a){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=n,this._oldScrollTop=i,this.scrollWidth=o,this.scrollLeft=r,this.scrollHeight=s,this.scrollTop=a,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!(this.scrollWidthChanged||this.scrollLeftChanged||this.scrollHeightChanged||this.scrollTopChanged)}merge(e){return 2!==e.kind?this:new ScrollChangedEvent(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class ViewZonesChangedEvent{constructor(){this.kind=3}isNoOp(){return!1}merge(e){return this}}class CursorStateChangedEvent{constructor(e,t,n,i,o,r,s){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=n,this.modelVersionId=i,this.source=o,this.reason=r,this.reachedMaxCursorCount=s}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(!e[i].equalsSelection(t[i]))return!1;return!0}isNoOp(){return CursorStateChangedEvent._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}merge(e){return 6!==e.kind?this:new CursorStateChangedEvent(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}class ReadOnlyEditAttemptEvent{constructor(){this.kind=5}isNoOp(){return!1}merge(e){return this}}class CursorsController extends Disposable{constructor(e,t,n,i){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=n,this.context=new CursorContext(this._model,this._viewModel,this._coordinatesConverter,i),this._cursors=new CursorCollection(this.context),this._hasFocus=!1,this._isHandling=!1,this._isDoingComposition=!1,this._selectionsWhenCompositionStarted=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=dispose(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new CursorContext(this._model,this._viewModel,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){const e=this._cursors.getSelections();for(let t=0;t<this._autoClosedActions.length;t++){const n=this._autoClosedActions[t];n.isValid(e)||(n.dispose(),this._autoClosedActions.splice(t,1),t--)}}}getPrimaryCursorState(){return this._cursors.getPrimaryCursor()}getLastAddedCursorIndex(){return this._cursors.getLastAddedCursorIndex()}getCursorStates(){return this._cursors.getAll()}setStates(e,t,n,i){let o=!1;null!==i&&i.length>CursorsController.MAX_CURSOR_COUNT&&(i=i.slice(0,CursorsController.MAX_CURSOR_COUNT),o=!0);const r=CursorModelState.from(this._model,this);return this._cursors.setStates(i),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,n,r,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,n,i,o,r){const s=this._cursors.getViewPositions();let a=null,l=null;s.length>1?l=this._cursors.getViewSelections():a=Range$2.fromPositions(s[0],s[0]),e.emitViewEvent(new ViewRevealRangeRequestEvent(t,n,a,l,i,o,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let n=0,i=t.length;n<i;n++){const i=t[n];e.push({inSelectionMode:!i.isEmpty(),selectionStart:{lineNumber:i.selectionStartLineNumber,column:i.selectionStartColumn},position:{lineNumber:i.positionLineNumber,column:i.positionColumn}})}return e}restoreState(e,t){const n=[];for(let i=0,o=t.length;i<o;i++){const e=t[i];let o=1,r=1;e.position&&e.position.lineNumber&&(o=e.position.lineNumber),e.position&&e.position.column&&(r=e.position.column);let s=o,a=r;e.selectionStart&&e.selectionStart.lineNumber&&(s=e.selectionStart.lineNumber),e.selectionStart&&e.selectionStart.column&&(a=e.selectionStart.column),n.push({selectionStartLineNumber:s,selectionStartColumn:a,positionLineNumber:o,positionColumn:r})}this.setStates(e,"restoreState",0,CursorState$1.fromModelSelections(n)),this.revealPrimary(e,"restoreState",!1,0,!0,1)}onModelContentChanged(e,t){if(t instanceof ModelInjectedTextChangedEvent){if(this._isHandling)return;this._isHandling=!0;try{this.setStates(e,"modelChange",0,this.getCursorStates())}finally{this._isHandling=!1}}else{if(this._knownModelVersionId=t.versionId,this._isHandling)return;const n=t.containsEvent(1);if(this._prevEditOperationType=0,n)this._cursors.dispose(),this._cursors=new CursorCollection(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&t.resultingSelection&&t.resultingSelection.length>0){const n=CursorState$1.fromModelSelections(t.resultingSelection);this.setStates(e,"modelChange",t.isUndoing?5:t.isRedoing?6:2,n)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,CursorState$1.fromModelSelections(t))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),n=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:n.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,n)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,n,i){this.setStates(e,t,i,CursorState$1.fromModelSelections(n))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const n=[],i=[];for(let s=0,a=e.length;s<a;s++)n.push({range:e[s],options:{description:"auto-closed-character",inlineClassName:"auto-closed-character",stickiness:1}}),i.push({range:t[s],options:{description:"auto-closed-enclosing",stickiness:1}});const o=this._model.deltaDecorations([],n),r=this._model.deltaDecorations([],i);this._autoClosedActions.push(new AutoClosedAction(this._model,o,r))}_executeEditOperation(e){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const t=CommandExecutor.executeCommands(this._model,this._cursors.getSelections(),e.commands);if(t){this._interpretCommandResult(t);const n=[],i=[];for(let t=0;t<e.commands.length;t++){const o=e.commands[t];o instanceof TypeWithAutoClosingCommand&&o.enclosingRange&&o.closeCharacterRange&&(n.push(o.closeCharacterRange),i.push(o.enclosingRange))}n.length>0&&this._pushAutoClosedAction(n,i),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,n,i,o){const r=CursorModelState.from(this._model,this);if(r.equals(i))return!1;const s=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new ViewCursorStateChangedEvent(a,s)),!i||i.cursorState.length!==r.cursorState.length||r.cursorState.some(((e,t)=>!e.modelState.equals(i.cursorState[t].modelState)))){const a=i?i.cursorState.map((e=>e.modelState.selection)):null,l=i?i.modelVersionId:0;e.emitOutgoingEvent(new CursorStateChangedEvent(a,s,l,r.modelVersionId,t||"keyboard",n,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let n=0,i=e.length;n<i;n++){const i=e[n];if(!i.text||i.text.indexOf("\n")>=0)return null;const o=i.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const r=o[1],s=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(r);if(!s||1!==s.length)return null;const a=s[0].open,l=i.text.length-o[2].length-1,c=i.text.lastIndexOf(a,l-1);if(-1===c)return null;t.push([c,l])}return t}executeEdits(e,t,n,i){let o=null;"snippet"===t&&(o=this._findAutoClosingPairs(n)),o&&(n[0]._isTracked=!0);const r=[],s=[],a=this._model.pushEditOperations(this.getSelections(),n,(e=>{if(o)for(let n=0,i=o.length;n<i;n++){const[t,i]=o[n],a=e[n],l=a.range.startLineNumber,c=a.range.startColumn-1+t,d=a.range.startColumn-1+i;r.push(new Range$2(l,d+1,l,d+2)),s.push(new Range$2(l,c+1,l,d+2))}const t=i(e);return t&&(this._isHandling=!0),t}));a&&(this._isHandling=!1,this.setSelections(e,t,a,0)),r.length>0&&this._pushAutoClosedAction(r,s)}_executeEdit(e,t,n,i=0){if(this.context.cursorConfig.readOnly)return;const o=CursorModelState.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){onUnexpectedError(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,n,i,o,!1)&&this.revealPrimary(t,n,!1,0,!0,0)}setIsDoingComposition(e){this._isDoingComposition=e}getAutoClosedCharacters(){return AutoClosedAction.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._selectionsWhenCompositionStarted=this.getSelections().slice(0)}endComposition(e,t){this._executeEdit((()=>{"keyboard"===t&&(this._executeEditOperation(TypeOperations.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this._selectionsWhenCompositionStarted,this.getSelections(),this.getAutoClosedCharacters())),this._selectionsWhenCompositionStarted=null)}),e,t)}type(e,t,n){this._executeEdit((()=>{if("keyboard"===n){const e=t.length;let n=0;for(;n<e;){const e=nextCharLength(t,n),i=t.substr(n,e);this._executeEditOperation(TypeOperations.typeWithInterceptors(this._isDoingComposition,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),i)),n+=e}}else this._executeEditOperation(TypeOperations.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))}),e,n)}compositionType(e,t,n,i,o,r){if(0!==t.length||0!==n||0!==i)this._executeEdit((()=>{this._executeEditOperation(TypeOperations.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,n,i,o))}),e,r);else if(0!==o){const t=this.getSelections().map((e=>{const t=e.getPosition();return new Selection$1(t.lineNumber,t.column+o,t.lineNumber,t.column+o)}));this.setSelections(e,r,t,0)}}paste(e,t,n,i,o){this._executeEdit((()=>{this._executeEditOperation(TypeOperations.paste(this.context.cursorConfig,this._model,this.getSelections(),t,n,i||[]))}),e,o,4)}cut(e,t){this._executeEdit((()=>{this._executeEditOperation(DeleteOperations.cut(this.context.cursorConfig,this._model,this.getSelections()))}),e,t)}executeCommand(e,t,n){this._executeEdit((()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new EditOperationResult(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))}),e,n)}executeCommands(e,t,n){this._executeEdit((()=>{this._executeEditOperation(new EditOperationResult(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))}),e,n)}}CursorsController.MAX_CURSOR_COUNT=1e4;class CursorModelState{constructor(e,t){this.modelVersionId=e,this.cursorState=t}static from(e,t){return new CursorModelState(e.getVersionId(),t.getCursorStates())}equals(e){if(!e)return!1;if(this.modelVersionId!==e.modelVersionId)return!1;if(this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,n=this.cursorState.length;t<n;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class AutoClosedAction{constructor(e,t,n){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=n}static getAllAutoClosedCharacters(e){let t=[];for(const n of e)t=t.concat(n.getAutoClosedCharactersRanges());return t}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._model.deltaDecorations(this._autoClosedEnclosingDecorations,[])}getAutoClosedCharactersRanges(){const e=[];for(let t=0;t<this._autoClosedCharactersDecorations.length;t++){const n=this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);n&&e.push(n)}return e}isValid(e){const t=[];for(let n=0;n<this._autoClosedEnclosingDecorations.length;n++){const e=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[n]);if(e&&(t.push(e),e.startLineNumber!==e.endLineNumber))return!1}t.sort(Range$2.compareRangesUsingStarts),e.sort(Range$2.compareRangesUsingStarts);for(let n=0;n<e.length;n++){if(n>=t.length)return!1;if(!t[n].strictContainsRange(e[n]))return!1}return!0}}class CommandExecutor{static executeCommands(e,t,n){const i={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(i,n);for(let r=0,s=i.trackedRanges.length;r<s;r++)i.model._setTrackedRange(i.trackedRanges[r],null,0);return o}static _innerExecuteCommands(e,t){if(this._arrayIsEmpty(t))return null;const n=this._getEditOperations(e,t);if(0===n.operations.length)return null;const i=n.operations,o=this._getLoserCursorMap(i);if(o.hasOwnProperty("0"))return null;const r=[];for(let l=0,c=i.length;l<c;l++)o.hasOwnProperty(i[l].identifier.major.toString())||r.push(i[l]);n.hadTrackedEditOperation&&r.length>0&&(r[0]._isTracked=!0);let s=e.model.pushEditOperations(e.selectionsBefore,r,(n=>{const i=[];for(let t=0;t<e.selectionsBefore.length;t++)i[t]=[];for(const e of n)e.identifier&&i[e.identifier.major].push(e);const o=(e,t)=>e.identifier.minor-t.identifier.minor,r=[];for(let s=0;s<e.selectionsBefore.length;s++)i[s].length>0?(i[s].sort(o),r[s]=t[s].computeCursorState(e.model,{getInverseEditOperations:()=>i[s],getTrackedSelection:t=>{const n=parseInt(t,10),i=e.model._getTrackedRange(e.trackedRanges[n]);return 0===e.trackedRangesDirection[n]?new Selection$1(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn):new Selection$1(i.endLineNumber,i.endColumn,i.startLineNumber,i.startColumn)}})):r[s]=e.selectionsBefore[s];return r}));s||(s=e.selectionsBefore);const a=[];for(let l in o)o.hasOwnProperty(l)&&a.push(parseInt(l,10));a.sort(((e,t)=>t-e));for(const l of a)s.splice(l,1);return s}static _arrayIsEmpty(e){for(let t=0,n=e.length;t<n;t++)if(e[t])return!1;return!0}static _getEditOperations(e,t){let n=[],i=!1;for(let o=0,r=t.length;o<r;o++){const r=t[o];if(r){const t=this._getEditOperationsFromCommand(e,o,r);n=n.concat(t.operations),i=i||t.hadTrackedEditOperation}}return{operations:n,hadTrackedEditOperation:i}}static _getEditOperationsFromCommand(e,t,n){const i=[];let o=0;const r=(e,r,s=!1)=>{Range$2.isEmpty(e)&&""===r||i.push({identifier:{major:t,minor:o++},range:e,text:r,forceMoveMarkers:s,isAutoWhitespaceEdit:n.insertsAutoWhitespace})};let s=!1;const a={addEditOperation:r,addTrackedEditOperation:(e,t,n)=>{s=!0,r(e,t,n)},trackSelection:(t,n)=>{const i=Selection$1.liftSelection(t);let o;if(i.isEmpty())if("boolean"==typeof n)o=n?2:3;else{const t=e.model.getLineMaxColumn(i.startLineNumber);o=i.startColumn===t?2:3}else o=1;const r=e.trackedRanges.length,s=e.model._setTrackedRange(null,i,o);return e.trackedRanges[r]=s,e.trackedRangesDirection[r]=i.getDirection(),r.toString()}};try{n.getEditOperations(e.model,a)}catch(e2){return onUnexpectedError(e2),{operations:[],hadTrackedEditOperation:!1}}return{operations:i,hadTrackedEditOperation:s}}static _getLoserCursorMap(e){(e=e.slice(0)).sort(((e,t)=>-Range$2.compareRangesUsingEnds(e.range,t.range)));const t={};for(let n=1;n<e.length;n++){const i=e[n-1],o=e[n];if(Range$2.getStartPosition(i.range).isBefore(Range$2.getEndPosition(o.range))){let r;r=i.identifier.major>o.identifier.major?i.identifier.major:o.identifier.major,t[r.toString()]=!0;for(let t=0;t<e.length;t++)e[t].identifier.major===r&&(e.splice(t,1),t<n&&n--,t--);n>0&&n--}}return t}}class InternalEditorAction{constructor(e,t,n,i,o,r){this.id=e,this.label=t,this.alias=n,this._precondition=i,this._run=o,this._contextKeyService=r}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(){return this.isSupported()?this._run():Promise.resolve(void 0)}}const EditorType={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},Extensions$3={Configuration:"base.contributions.configuration"},resourceLanguageSettingsSchemaId="vscode://schemas/settings/resourceLanguage",contributionRegistry=Registry.as(Extensions$5.JSONContribution);class ConfigurationRegistry{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new Emitter$1,this._onDidUpdateConfiguration=new Emitter$1,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:localize("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!1,errorMessage:"Unknown editor configuration setting",allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.excludedConfigurationProperties={},contributionRegistry.registerSchema(resourceLanguageSettingsSchemaId,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const n=this.doRegisterConfigurations(e,t);contributionRegistry.registerSchema(resourceLanguageSettingsSchemaId,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}registerDefaultConfigurations(e){var t;const n=[],i=[];for(const{overrides:o,source:r}of e)for(const e in o)if(n.push(e),OVERRIDE_PROPERTY_REGEX.test(e)){const n=Object.assign(Object.assign({},(null===(t=this.configurationDefaultsOverrides.get(e))||void 0===t?void 0:t.value)||{}),o[e]);this.configurationDefaultsOverrides.set(e,{source:r,value:n});const s={type:"object",default:n,description:localize("defaultLanguageConfiguration.description","Configure settings to be overridden for {0} language.",e),$ref:resourceLanguageSettingsSchemaId,defaultDefaultValue:n,source:isString$1(r)?void 0:r};i.push(...overrideIdentifiersFromKey(e)),this.configurationProperties[e]=s,this.defaultLanguageConfigurationOverridesNode.properties[e]=s}else{this.configurationDefaultsOverrides.set(e,{value:o[e],source:r});const t=this.configurationProperties[e];t&&(this.updatePropertyDefaultValue(e,t),this.updateSchema(e,t))}this.registerOverrideIdentifiers(i),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n,defaultsOverrides:!0})}registerOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t){const n=[];return e.forEach((e=>{n.push(...this.validateAndRegisterProperties(e,t,e.extensionInfo,e.restrictedProperties)),this.configurationContributors.push(e),this.registerJSONConfiguration(e)})),n}validateAndRegisterProperties(e,t=!0,n,i,o=3){o=isUndefinedOrNull(e.scope)?o:e.scope;let r=[],s=e.properties;if(s)for(let l in s){if(t&&validateProperty(l)){delete s[l];continue}const e=s[l];e.source=n,e.defaultDefaultValue=s[l].default,this.updatePropertyDefaultValue(l,e),OVERRIDE_PROPERTY_REGEX.test(l)?e.scope=void 0:(e.scope=isUndefinedOrNull(e.scope)?o:e.scope,e.restricted=isUndefinedOrNull(e.restricted)?!!(null==i?void 0:i.includes(l)):e.restricted),!s[l].hasOwnProperty("included")||s[l].included?(this.configurationProperties[l]=s[l],!s[l].deprecationMessage&&s[l].markdownDeprecationMessage&&(s[l].deprecationMessage=s[l].markdownDeprecationMessage),r.push(l)):(this.excludedConfigurationProperties[l]=s[l],delete s[l])}let a=e.allOf;if(a)for(let l of a)r.push(...this.validateAndRegisterProperties(l,t,n,i,o));return r}getConfigurationProperties(){return this.configurationProperties}registerJSONConfiguration(e){const t=e=>{let n=e.properties;if(n)for(const t in n)this.updateSchema(t,n[t]);let i=e.allOf;i&&i.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:case 2:case 6:case 3:case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,n={type:"object",description:localize("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:localize("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:resourceLanguageSettingsSchemaId};this.updatePropertyDefaultValue(t,n)}this._onDidSchemaChange.fire()}registerOverridePropertyPatternKey(){localize("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),localize("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const n=this.configurationDefaultsOverrides.get(e);let i=null==n?void 0:n.value,o=null==n?void 0:n.source;isUndefined(i)&&(i=t.defaultDefaultValue,o=void 0),isUndefined(i)&&(i=getDefaultValue(t.type)),t.default=i,t.defaultValueSource=o}}const OVERRIDE_IDENTIFIER_PATTERN="\\[([^\\]]+)\\]",OVERRIDE_IDENTIFIER_REGEX=new RegExp(OVERRIDE_IDENTIFIER_PATTERN,"g"),OVERRIDE_PROPERTY_PATTERN=`^(${OVERRIDE_IDENTIFIER_PATTERN})+$`,OVERRIDE_PROPERTY_REGEX=new RegExp(OVERRIDE_PROPERTY_PATTERN);function overrideIdentifiersFromKey(e){const t=[];if(OVERRIDE_PROPERTY_REGEX.test(e)){let n=OVERRIDE_IDENTIFIER_REGEX.exec(e);for(;null==n?void 0:n.length;){const i=n[1].trim();i&&t.push(i),n=OVERRIDE_IDENTIFIER_REGEX.exec(e)}}return distinct(t)}function getDefaultValue(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const configurationRegistry$2=new ConfigurationRegistry;function validateProperty(e){return e.trim()?OVERRIDE_PROPERTY_REGEX.test(e)?localize("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",e):void 0!==configurationRegistry$2.getConfigurationProperties()[e]?localize("config.property.duplicate","Cannot register '{0}'. This property is already registered.",e):null:localize("config.property.empty","Cannot register an empty property")}Registry.add(Extensions$3.Configuration,configurationRegistry$2);const Extensions$2={ModesRegistry:"editor.modesRegistry"};class EditorModesRegistry{constructor(){this._onDidChangeLanguages=new Emitter$1,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,n=this._languages.length;t<n;t++)if(this._languages[t]===e)return void this._languages.splice(t,1)}}}getLanguages(){return this._languages}}const ModesRegistry=new EditorModesRegistry;Registry.add(Extensions$2.ModesRegistry,ModesRegistry);const PLAINTEXT_LANGUAGE_ID="plaintext",PLAINTEXT_EXTENSION=".txt";ModesRegistry.registerLanguage({id:PLAINTEXT_LANGUAGE_ID,extensions:[PLAINTEXT_EXTENSION],aliases:[localize("plainText.alias","Plain Text"),"text"],mimetypes:[Mimes.text]}),LanguageConfigurationRegistry.register(PLAINTEXT_LANGUAGE_ID,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0),Registry.as(Extensions$3.Configuration).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1}}}]);class LineTokens{constructor(e,t,n){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=n}static createEmpty(e,t){const n=LineTokens.defaultTokenMetadata,i=new Uint32Array(2);return i[0]=e.length,i[1]=n,new LineTokens(i,e,t)}equals(e){return e instanceof LineTokens&&this.slicedEquals(e,0,this._tokensCount)}slicedEquals(e,t,n){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;const i=t<<1,o=i+(n<<1);for(let r=i;r<o;r++)if(this._tokens[r]!==e._tokens[r])return!1;return!0}getLineContent(){return this._text}getCount(){return this._tokensCount}getStartOffset(e){return e>0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[1+(e<<1)]}getLanguageId(e){const t=this._tokens[1+(e<<1)],n=TokenMetadata.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(n)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return TokenMetadata.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return TokenMetadata.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return TokenMetadata.getClassNameFromMetadata(t)}getInlineStyle(e,t){const n=this._tokens[1+(e<<1)];return TokenMetadata.getInlineStyleFromMetadata(n,t)}getPresentation(e){const t=this._tokens[1+(e<<1)];return TokenMetadata.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return LineTokens.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,n){return new SliceLineTokens(this,e,t,n)}static convertToEndOffset(e,t){const n=(e.length>>>1)-1;for(let i=0;i<n;i++)e[i<<1]=e[i+1<<1];e[n<<1]=t}static findIndexInTokensArray(e,t){if(e.length<=2)return 0;let n=0,i=(e.length>>>1)-1;for(;n<i;){const o=n+Math.floor((i-n)/2),r=e[o<<1];if(r===t)return o+1;r<t?n=o+1:r>t&&(i=o)}return n}withInserted(e){if(0===e.length)return this;let t=0,n=0,i="";const o=new Array;let r=0;for(;;){const s=t<this._tokensCount?this._tokens[t<<1]:-1,a=n<e.length?e[n]:null;if(-1!==s&&(null===a||s<=a.offset)){i+=this._text.substring(r,s);const e=this._tokens[1+(t<<1)];o.push(i.length,e),t++,r=s}else{if(!a)break;if(a.offset>r){i+=this._text.substring(r,a.offset);const e=this._tokens[1+(t<<1)];o.push(i.length,e),r=a.offset}i+=a.text,o.push(i.length,a.tokenMetadata),n++}}return new LineTokens(new Uint32Array(o),i,this._languageIdCodec)}}LineTokens.defaultTokenMetadata=16793600;class SliceLineTokens{constructor(e,t,n,i){this._source=e,this._startOffset=t,this._endOffset=n,this._deltaOffset=i,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let o=this._firstTokenIndex,r=e.getCount();o<r;o++){if(e.getStartOffset(o)>=n)break;this._tokensCount++}}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof SliceLineTokens&&(this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount))}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}const NullState=new class{clone(){return this}equals(e){return this===e}};function nullTokenize(e,t){return new TokenizationResult([new Token$2(0,"",e)],t)}function nullTokenizeEncoded(e,t){const n=new Uint32Array(2);return n[0]=0,n[1]=(16384|e<<0|2<<23)>>>0,new EncodedTokenizationResult(n,null===t?NullState:t)}var __awaiter$13=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const fallback={getInitialState:()=>NullState,tokenizeEncoded:(e,t,n)=>nullTokenizeEncoded(0,n)};function tokenizeToString(e,t,n){return __awaiter$13(this,void 0,void 0,(function*(){if(!n)return _tokenizeToString(t,e.languageIdCodec,fallback);const i=yield TokenizationRegistry.getOrCreate(n);return _tokenizeToString(t,e.languageIdCodec,i||fallback)}))}function tokenizeLineToHTML(e,t,n,i,o,r,s){let a="<div>",l=i,c=0,d=!0;for(let u=0,h=t.getCount();u<h;u++){const h=t.getEndOffset(u);if(h<=i)continue;let g="";for(;l<h&&l<o;l++){const t=e.charCodeAt(l);switch(t){case 9:{let e=r-(l+c)%r;for(c+=e-1;e>0;)s&&d?(g+=" ",d=!1):(g+=" ",d=!0),e--;break}case 60:g+="<",d=!1;break;case 62:g+=">",d=!1;break;case 38:g+="&",d=!1;break;case 0:g+="�",d=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",d=!1;break;case 13:g+="​",d=!1;break;case 32:s&&d?(g+=" ",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(t),d=!1}}if(a+=`<span style="${t.getInlineStyle(u,n)}">${g}</span>`,h>o||l>=o)break}return a+="</div>",a}function _tokenizeToString(e,t,n){let i='<div class="monaco-tokenized-source">';const o=splitLines(e);let r=n.getInitialState();for(let s=0,a=o.length;s<a;s++){const e=o[s];s>0&&(i+="<br/>");const a=n.tokenizeEncoded(e,!0,r);LineTokens.convertToEndOffset(a.tokens,e.length);const l=new LineTokens(a.tokens,e,t).inflate();let c=0;for(let t=0,n=l.getCount();t<n;t++){const n=l.getClassName(t),o=l.getEndOffset(t);i+=`<span class="${n}">${escape(e.substring(c,o))}</span>`,c=o}r=a.endState}return i+="</div>",i}class PendingChanges{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,n=this._changes,i=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,n,i)}}class EditorWhitespace{constructor(e,t,n,i,o){this.id=e,this.afterLineNumber=t,this.ordinal=n,this.height=i,this.minWidth=o,this.prefixSum=0}}class LinesLayout{constructor(e,t,n,i){this._instanceId=singleLetterHash(++LinesLayout.INSTANCE_COUNT),this._pendingChanges=new PendingChanges,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=n,this._paddingBottom=i}static findInsertionIndex(e,t,n){let i=0,o=e.length;for(;i<o;){const r=i+o>>>1;t===e[r].afterLineNumber?n<e[r].ordinal?o=r:i=r+1:t<e[r].afterLineNumber?o=r:i=r+1}return i}setLineHeight(e){this._checkPendingChanges(),this._lineHeight=e}setPadding(e,t){this._paddingTop=e,this._paddingBottom=t}onFlushed(e){this._checkPendingChanges(),this._lineCount=e}changeWhitespace(e){let t=!1;try{e({insertWhitespace:(e,n,i,o)=>{t=!0,e|=0,n|=0,i|=0,o|=0;const r=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new EditorWhitespace(r,e,n,i,o)),r},changeOneWhitespace:(e,n,i)=>{t=!0,n|=0,i|=0,this._pendingChanges.change({id:e,newAfterLineNumber:n,newHeight:i})},removeWhitespace:e=>{t=!0,this._pendingChanges.remove({id:e})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,n){if((e.length>0||n.length>0)&&(this._minWidth=-1),e.length+t.length+n.length<=1){for(const t of e)this._insertWhitespace(t);for(const e of t)this._changeOneWhitespace(e.id,e.newAfterLineNumber,e.newHeight);for(const e of n){const t=this._findWhitespaceIndex(e.id);-1!==t&&this._removeWhitespace(t)}return}const i=new Set;for(const a of n)i.add(a.id);const o=new Map;for(const a of t)o.set(a.id,a);const r=e=>{const t=[];for(const n of e)if(!i.has(n.id)){if(o.has(n.id)){const e=o.get(n.id);n.afterLineNumber=e.newAfterLineNumber,n.height=e.newHeight}t.push(n)}return t},s=r(this._arr).concat(r(e));s.sort(((e,t)=>e.afterLineNumber===t.afterLineNumber?e.ordinal-t.ordinal:e.afterLineNumber-t.afterLineNumber)),this._arr=s,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=LinesLayout.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let n=0,i=t.length;n<i;n++)if(t[n].id===e)return n;return-1}_changeOneWhitespace(e,t,n){const i=this._findWhitespaceIndex(e);if(-1!==i&&(this._arr[i].height!==n&&(this._arr[i].height=n,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,i-1)),this._arr[i].afterLineNumber!==t)){const e=this._arr[i];this._removeWhitespace(i),e.afterLineNumber=t,this._insertWhitespace(e)}}_removeWhitespace(e){this._arr.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1)}onLinesDeleted(e,t){this._checkPendingChanges(),e|=0,t|=0,this._lineCount-=t-e+1;for(let n=0,i=this._arr.length;n<i;n++){const i=this._arr[n].afterLineNumber;e<=i&&i<=t?this._arr[n].afterLineNumber=e-1:i>t&&(this._arr[n].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e|=0,t|=0,this._lineCount+=t-e+1;for(let n=0,i=this._arr.length;n<i;n++){e<=this._arr[n].afterLineNumber&&(this._arr[n].afterLineNumber+=t-e+1)}}getWhitespacesTotalHeight(){return this._checkPendingChanges(),0===this._arr.length?0:this.getWhitespacesAccumulatedHeight(this._arr.length-1)}getWhitespacesAccumulatedHeight(e){this._checkPendingChanges(),e|=0;let t=Math.max(0,this._prefixSumValidIndex+1);0===t&&(this._arr[0].prefixSum=this._arr[0].height,t++);for(let n=t;n<=e;n++)this._arr[n].prefixSum=this._arr[n-1].prefixSum+this._arr[n].height;return this._prefixSumValidIndex=Math.max(this._prefixSumValidIndex,e),this._arr[e].prefixSum}getLinesTotalHeight(){this._checkPendingChanges();return this._lineHeight*this._lineCount+this.getWhitespacesTotalHeight()+this._paddingTop+this._paddingBottom}getWhitespaceAccumulatedHeightBeforeLineNumber(e){this._checkPendingChanges(),e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e);return-1===t?0:this.getWhitespacesAccumulatedHeight(t)}_findLastWhitespaceBeforeLineNumber(e){e|=0;const t=this._arr;let n=0,i=t.length-1;for(;n<=i;){const o=n+((i-n|0)/2|0)|0;if(t[o].afterLineNumber<e){if(o+1>=t.length||t[o+1].afterLineNumber>=e)return o;n=o+1|0}else i=o-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t<this._arr.length?t:-1}getFirstWhitespaceIndexAfterLineNumber(e){return this._checkPendingChanges(),e|=0,this._findFirstWhitespaceAfterLineNumber(e)}getVerticalOffsetForLineNumber(e){let t;this._checkPendingChanges(),t=(e|=0)>1?this._lineHeight*(e-1):0;return t+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e)+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),-1===this._minWidth){let e=0;for(let t=0,n=this._arr.length;t<n;t++)e=Math.max(e,this._arr[t].minWidth);this._minWidth=e}return this._minWidth}isAfterLines(e){this._checkPendingChanges();return e>this.getLinesTotalHeight()}isInTopPadding(e){return 0!==this._paddingTop&&(this._checkPendingChanges(),e<this._paddingTop)}isInBottomPadding(e){if(0===this._paddingBottom)return!1;this._checkPendingChanges();return e>=this.getLinesTotalHeight()-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),(e|=0)<0)return 1;const t=0|this._lineCount,n=this._lineHeight;let i=1,o=t;for(;i<o;){const t=(i+o)/2|0,r=0|this.getVerticalOffsetForLineNumber(t);if(e>=r+n)i=t+1;else{if(e>=r)return t;o=t}}return i>t?t:i}getLinesViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const n=this._lineHeight,i=0|this.getLineNumberAtOrAfterVerticalOffset(e),o=0|this.getVerticalOffsetForLineNumber(i);let r=0|this._lineCount,s=0|this.getFirstWhitespaceIndexAfterLineNumber(i);const a=0|this.getWhitespacesCount();let l,c;-1===s?(s=a,c=r+1,l=0):(c=0|this.getAfterLineNumberForWhitespaceIndex(s),l=0|this.getHeightForWhitespaceIndex(s));let d=o,u=d;const h=5e5;let g=0;o>=h&&(g=Math.floor(o/h)*h,g=Math.floor(g/n)*n,u-=g);const p=[],f=e+(t-e)/2;let m=-1;for(let b=i;b<=r;b++){if(-1===m){const e=d,t=d+n;(e<=f&&f<t||e>f)&&(m=b)}for(d+=n,p[b-i]=u,u+=n;c===b;)u+=l,d+=l,s++,s>=a?c=r+1:(c=0|this.getAfterLineNumberForWhitespaceIndex(s),l=0|this.getHeightForWhitespaceIndex(s));if(d>=t){r=b;break}}-1===m&&(m=r);const v=0|this.getVerticalOffsetForLineNumber(r);let _=i,C=r;return _<C&&o<e&&_++,_<C&&v+n>t&&C--,{bigNumbersDelta:g,startLineNumber:i,endLineNumber:r,relativeVerticalOffset:p,centeredLineNumber:m,completelyVisibleStartLineNumber:_,completelyVisibleEndLineNumber:C}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e|=0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let n,i;return n=t>=1?this._lineHeight*t:0,i=e>0?this.getWhitespacesAccumulatedHeight(e-1):0,n+i+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e|=0;let t=0,n=this.getWhitespacesCount()-1;if(n<0)return-1;if(e>=this.getVerticalOffsetForWhitespaceIndex(n)+this.getHeightForWhitespaceIndex(n))return-1;for(;t<n;){const i=Math.floor((t+n)/2),o=this.getVerticalOffsetForWhitespaceIndex(i);if(e>=o+this.getHeightForWhitespaceIndex(i))t=i+1;else{if(e>=o)return i;n=i}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e|=0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0)return null;if(t>=this.getWhitespacesCount())return null;const n=this.getVerticalOffsetForWhitespaceIndex(t);if(n>e)return null;const i=this.getHeightForWhitespaceIndex(t);return{id:this.getIdForWhitespaceIndex(t),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:n,height:i}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const n=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),i=this.getWhitespacesCount()-1;if(n<0)return[];const o=[];for(let r=n;r<=i;r++){const e=this.getVerticalOffsetForWhitespaceIndex(r),n=this.getHeightForWhitespaceIndex(r);if(e>=t)break;o.push({id:this.getIdForWhitespaceIndex(r),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:e,height:n})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].height}}LinesLayout.INSTANCE_COUNT=0;const SMOOTH_SCROLLING_TIME=125;class EditorScrollDimensions{constructor(e,t,n,i){(e|=0)<0&&(e=0),(t|=0)<0&&(t=0),(n|=0)<0&&(n=0),(i|=0)<0&&(i=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=n,this.contentHeight=i,this.scrollHeight=Math.max(n,i)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class EditorScrollable extends Disposable{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new Emitter$1),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new EditorScrollDimensions(0,0,0,0),this._scrollable=this._register(new Scrollable({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const n=t.contentWidth!==e.contentWidth,i=t.contentHeight!==e.contentHeight;(n||i)&&this._onDidContentSizeChange.fire(new ContentSizeChangedEvent(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}}class ViewLayout extends Disposable{constructor(e,t,n){super(),this._configuration=e;const i=this._configuration.options,o=i.get(131),r=i.get(75);this._linesLayout=new LinesLayout(t,i.get(59),r.top,r.bottom),this._scrollable=this._register(new EditorScrollable(0,n)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new EditorScrollDimensions(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(103)?SMOOTH_SCROLLING_TIME:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(59)&&this._linesLayout.setLineHeight(t.get(59)),e.hasChanged(75)){const e=t.get(75);this._linesLayout.setPadding(e.top,e.bottom)}if(e.hasChanged(131)){const e=t.get(131),n=e.contentWidth,i=e.height,o=this._scrollable.getScrollDimensions(),r=o.contentWidth;this._scrollable.setScrollDimensions(new EditorScrollDimensions(n,o.contentWidth,i,this._getContentHeight(n,i,r)))}else this._updateHeight();e.hasChanged(103)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const n=this._configuration.options.get(92);return 2===n.horizontal||e>=t?0:n.horizontalScrollbarSize}_getContentHeight(e,t,n){const i=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return i.get(94)?o+=Math.max(0,t-i.get(59)-i.get(75).bottom):o+=this._getHorizontalScrollbarHeight(e,n),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,n=e.height,i=e.contentWidth;this._scrollable.setScrollDimensions(new EditorScrollDimensions(t,e.contentWidth,n,this._getContentHeight(t,n,i)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Viewport(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Viewport(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(e){const t=this._configuration.options,n=t.get(132),i=t.get(44);if(n.isViewportWrapping){const n=t.get(131),o=t.get(65);return e>n.contentWidth+i.typicalHalfwidthCharacterWidth&&o.enabled&&"right"===o.side?e+n.verticalScrollbarWidth:e}{const n=t.get(93)*i.typicalHalfwidthCharacterWidth,o=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+n,o)}}setMaxLineWidth(e){const t=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new EditorScrollDimensions(t.width,this._computeContentWidth(e),t.height,t.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,n=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n),scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e){return this._linesLayout.getVerticalOffsetForLineNumber(e)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){1===t?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}deltaScrollNow(e,t){const n=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:n.scrollLeft+e,scrollTop:n.scrollTop+t})}}class ViewModelDecorations{constructor(e,t,n,i,o){this.editorId=e,this.model=t,this.configuration=n,this._linesCollection=i,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let n=this._decorationsCache[t];if(!n){const i=e.range,o=e.options;let r;if(o.isWholeLine){const e=this._coordinatesConverter.convertModelPositionToViewPosition(new Position$1(i.startLineNumber,1),0),t=this._coordinatesConverter.convertModelPositionToViewPosition(new Position$1(i.endLineNumber,this.model.getLineMaxColumn(i.endLineNumber)),1);r=new Range$2(e.lineNumber,e.column,t.lineNumber,t.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(i,1);n=new ViewModelDecoration(r,o),this._decorationsCache[t]=n}return n}getDecorationsViewportData(e){let t=null!==this._cachedModelDecorationsResolver;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsViewportData(e),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}_getDecorationsViewportData(e){const t=this._linesCollection.getDecorationsInRange(e,this.editorId,filterValidationDecorations(this.configuration.options)),n=e.startLineNumber,i=e.endLineNumber,o=[];let r=0;const s=[];for(let a=n;a<=i;a++)s[a-n]=[];for(let a=0,l=t.length;a<l;a++){const e=t[a],l=e.options;if(!isModelDecorationVisible(this.model,e))continue;const c=this._getOrCreateViewModelDecoration(e),d=c.range;if(o[r++]=c,l.inlineClassName){const e=new InlineDecoration(d,l.inlineClassName,l.inlineClassNameAffectsLetterSpacing?3:0),t=Math.max(n,d.startLineNumber),o=Math.min(i,d.endLineNumber);for(let i=t;i<=o;i++)s[i-n].push(e)}if(l.beforeContentClassName&&n<=d.startLineNumber&&d.startLineNumber<=i){const e=new InlineDecoration(new Range$2(d.startLineNumber,d.startColumn,d.startLineNumber,d.startColumn),l.beforeContentClassName,1);s[d.startLineNumber-n].push(e)}if(l.afterContentClassName&&n<=d.endLineNumber&&d.endLineNumber<=i){const e=new InlineDecoration(new Range$2(d.endLineNumber,d.endColumn,d.endLineNumber,d.endColumn),l.afterContentClassName,2);s[d.endLineNumber-n].push(e)}}return{decorations:o,inlineDecorations:s}}}function isModelDecorationVisible(e,t){return(!t.options.hideInCommentTokens||!isModelDecorationInComment(e,t))&&(!t.options.hideInStringTokens||!isModelDecorationInString(e,t))}function isModelDecorationInComment(e,t){return testTokensInRange(e,t.range,(e=>1===e))}function isModelDecorationInString(e,t){return testTokensInRange(e,t.range,(e=>2===e))}function testTokensInRange(e,t,n){for(let i=t.startLineNumber;i<=t.endLineNumber;i++){const o=e.getLineTokens(i),r=i===t.startLineNumber,s=i===t.endLineNumber;let a=r?o.findTokenIndexAtOffset(t.startColumn-1):0;for(;a<o.getCount();){if(s){if(o.getStartOffset(a)>t.endColumn-1)break}if(!n(o.getStandardTokenType(a)))return!1;a++}}return!0}class BracketInfo{constructor(e,t,n){this.range=e,this.nestingLevel=t,this.isInvalid=n}}class BracketPairInfo{constructor(e,t,n,i){this.range=e,this.openingBracketRange=t,this.closingBracketRange=n,this.nestingLevel=i}}class BracketPairWithMinIndentationInfo extends BracketPairInfo{constructor(e,t,n,i,o){super(e,t,n,i),this.minVisibleColumnIndentation=o}}class LengthObj{constructor(e,t){this.lineCount=e,this.columnCount=t}toString(){return`${this.lineCount},${this.columnCount}`}}function lengthDiff(e,t,n,i){return e!==n?toLength(n-e,i):toLength(0,i-t)}LengthObj.zero=new LengthObj(0,0);const lengthZero=0;function lengthIsZero(e){return 0===e}const factor=Math.pow(2,26);function toLength(e,t){return e*factor+t}function lengthToObj(e){const t=e,n=Math.floor(t/factor);return new LengthObj(n,t-n*factor)}function lengthGetLineCount(e){return Math.floor(e/factor)}function lengthGetColumnCountIfZeroLineCount(e){return e}function lengthAdd(e,t){return t<factor?e+t:e-e%factor+t}function lengthDiffNonNegative(e,t){const n=e,i=t;if(i-n<=0)return lengthZero;const o=Math.floor(n/factor),r=Math.floor(i/factor),s=i-r*factor;if(o===r){return toLength(0,s-(n-o*factor))}return toLength(r-o,s)}function lengthLessThan(e,t){return e<t}function lengthLessThanEqual(e,t){return e<=t}function lengthGreaterThanEqual(e,t){return e>=t}function positionToLength(e){return toLength(e.lineNumber-1,e.column-1)}function lengthsToRange(e,t){const n=e,i=Math.floor(n/factor),o=n-i*factor,r=t,s=Math.floor(r/factor);return new Range$2(i+1,o+1,s+1,r-s*factor+1)}function lengthOfString(e){const t=splitLines(e);return toLength(t.length-1,t[t.length-1].length)}class TextEditInfo{constructor(e,t,n){this.startOffset=e,this.endOffset=t,this.newLength=n}}class BeforeEditPositionMapper{constructor(e,t){this.documentLength=t,this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map((e=>TextEditInfoCache.from(e)))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx];return lengthDiffNonNegative(e,t?this.translateOldToCur(t.offsetObj):this.documentLength)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?toLength(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):toLength(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=lengthToObj(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?toLength(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):toLength(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const t=this.edits[this.nextEditIdx],n=this.translateOldToCur(t.endOffsetAfterObj);if(!lengthLessThanEqual(n,e))break;{this.nextEditIdx++;const e=lengthToObj(n),i=lengthToObj(this.translateOldToCur(t.endOffsetBeforeObj)),o=e.lineCount-i.lineCount;this.deltaOldToNewLineCount+=o;const r=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,s=e.columnCount-i.columnCount;this.deltaOldToNewColumnCount=r+s,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}}}}class TextEditInfoCache{constructor(e,t,n){this.endOffsetBeforeObj=lengthToObj(t),this.endOffsetAfterObj=lengthToObj(lengthAdd(e,n)),this.offsetObj=lengthToObj(e)}static from(e){return new TextEditInfoCache(e.startOffset,e.endOffset,e.newLength)}}const emptyArr=new Array;class SmallImmutableSet{constructor(e,t){this.items=e,this.additionalItems=t}static create(e,t){if(e<=128&&0===t.length){let n=SmallImmutableSet.cache[e];return n||(n=new SmallImmutableSet(e,t),SmallImmutableSet.cache[e]=n),n}return new SmallImmutableSet(e,t)}static getEmpty(){return this.empty}add(e,t){const n=t.getKey(e);let i=n>>5;if(0===i){const e=1<<n|this.items;return e===this.items?this:SmallImmutableSet.create(e,this.additionalItems)}i--;const o=this.additionalItems.slice(0);for(;o.length<i;)o.push(0);return o[i]|=1<<(31&n),SmallImmutableSet.create(this.items,o)}merge(e){const t=this.items|e.items;if(this.additionalItems===emptyArr&&e.additionalItems===emptyArr)return t===this.items?this:t===e.items?e:SmallImmutableSet.create(t,emptyArr);const n=new Array;for(let i=0;i<Math.max(this.additionalItems.length,e.additionalItems.length);i++){const t=this.additionalItems[i]||0,o=e.additionalItems[i]||0;n.push(t|o)}return SmallImmutableSet.create(t,n)}intersects(e){if(0!=(this.items&e.items))return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if(0!=(this.additionalItems[t]&e.additionalItems[t]))return!0;return!1}}SmallImmutableSet.cache=new Array(129),SmallImmutableSet.empty=SmallImmutableSet.create(0,emptyArr);const identityKeyProvider={getKey:e=>e};class DenseKeyProvider{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return void 0===t&&(t=this.items.size,this.items.set(e,t)),t}}class BaseAstNode{constructor(e){this._length=e}get length(){return this._length}}class PairAstNode extends BaseAstNode{constructor(e,t,n,i,o){super(e),this.openingBracket=t,this.child=n,this.closingBracket=i,this.missingOpeningBracketIds=o}static create(e,t,n){let i=e.length;return t&&(i=lengthAdd(i,t.length)),n&&(i=lengthAdd(i,n.length)),new PairAstNode(i,e,t,n,t?t.missingOpeningBracketIds:SmallImmutableSet.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=new Array;return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}canBeReused(e){return null!==this.closingBracket&&!e.intersects(this.missingOpeningBracketIds)}deepClone(){return new PairAstNode(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(lengthAdd(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class ListAstNode extends BaseAstNode{constructor(e,t,n){super(e),this.listHeight=t,this._missingOpeningBracketIds=n,this.cachedMinIndentation=-1}static create23(e,t,n,i=!1){let o=e.length,r=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=lengthAdd(o,t.length),r=r.merge(t.missingOpeningBracketIds),n){if(e.listHeight!==n.listHeight)throw new Error("Invalid list heights");o=lengthAdd(o,n.length),r=r.merge(n.missingOpeningBracketIds)}return i?new Immutable23ListAstNode(o,e.listHeight+1,e,t,n,r):new TwoThreeListAstNode(o,e.listHeight+1,e,t,n,r)}static getEmpty(){return new ImmutableArrayListAstNode(lengthZero,0,[],SmallImmutableSet.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(0===e)return;const t=this.getChild(e-1),n=4===t.kind?t.toMutable():t;return t!==n&&this.setChild(e-1,n),n}makeFirstElementMutable(){this.throwIfImmutable();if(0===this.childrenLength)return;const e=this.getChild(0),t=4===e.kind?e.toMutable():e;return e!==t&&this.setChild(0,t),t}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds))return!1;let t,n=this;for(;4===n.kind&&(t=n.childrenLength)>0;)n=n.getChild(t-1);return n.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,n=this.getChild(0).missingOpeningBracketIds;for(let i=1;i<e;i++){const e=this.getChild(i);t=lengthAdd(t,e.length),n=n.merge(e.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=n,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(-1!==this.cachedMinIndentation)return this.cachedMinIndentation;let n=Number.MAX_SAFE_INTEGER,i=e;for(let o=0;o<this.childrenLength;o++){const e=this.getChild(o);e&&(n=Math.min(n,e.computeMinIndentation(i,t)),i=lengthAdd(i,e.length))}return this.cachedMinIndentation=n,n}}class TwoThreeListAstNode extends ListAstNode{constructor(e,t,n,i,o,r){super(e,t,r),this._item1=n,this._item2=i,this._item3=o}get childrenLength(){return null!==this._item3?3:2}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw new Error("Invalid child index")}setChild(e,t){switch(e){case 0:return void(this._item1=t);case 1:return void(this._item2=t);case 2:return void(this._item3=t)}throw new Error("Invalid child index")}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}deepClone(){return new TwoThreeListAstNode(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw new Error("Cannot append to a full (2,3) tree node");this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}unappendChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw new Error("Cannot prepend to a full (2,3) tree node");this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}}class Immutable23ListAstNode extends TwoThreeListAstNode{toMutable(){return new TwoThreeListAstNode(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class ArrayListAstNode extends ListAstNode{constructor(e,t,n,i){super(e,t,i),this._children=n}get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}deepClone(){const e=new Array(this._children.length);for(let t=0;t<this._children.length;t++)e[t]=this._children[t].deepClone();return new ArrayListAstNode(this.length,this.listHeight,e,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();const e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();const e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}}class ImmutableArrayListAstNode extends ArrayListAstNode{toMutable(){return new ArrayListAstNode(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const emptyArray=[];class ImmutableLeafAstNode extends BaseAstNode{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return emptyArray}deepClone(){return this}}class TextAstNode extends ImmutableLeafAstNode{get kind(){return 0}get missingOpeningBracketIds(){return SmallImmutableSet.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const n=lengthToObj(e),i=(0===n.columnCount?n.lineCount:n.lineCount+1)+1,o=lengthGetLineCount(lengthAdd(e,this.length))+1;let r=Number.MAX_SAFE_INTEGER;for(let s=i;s<=o;s++){const e=t.getLineFirstNonWhitespaceColumn(s),n=t.getLineContent(s);if(0===e)continue;const i=CursorColumns.visibleColumnFromColumn(n,e,t.getOptions().tabSize);r=Math.min(r,i)}return r}}class BracketAstNode extends ImmutableLeafAstNode{constructor(e,t,n){super(e),this.languageId=t,this.bracketIds=n}static create(e,t,n){return new BracketAstNode(e,t,n)}get kind(){return 1}get missingOpeningBracketIds(){return SmallImmutableSet.getEmpty()}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class InvalidBracketAstNode extends ImmutableLeafAstNode{constructor(e,t){super(t),this.missingOpeningBracketIds=e}get kind(){return 3}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class Token$1{constructor(e,t,n,i,o){this.length=e,this.kind=t,this.bracketId=n,this.bracketIds=i,this.astNode=o}}class TextBufferTokenizer{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new NonPeekableTextBufferTokenizer(this.textModel,this.bracketTokens),this._offset=lengthZero,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return toLength(this.textBufferLineCount,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=lengthAdd(this._offset,e);const t=lengthToObj(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=lengthAdd(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class NonPeekableTextBufferTokenizer{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset)):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const e=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=lengthGetColumnCountIfZeroLineCount(e.length),e}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;null===this.line&&(this.lineTokens=this.textModel.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let n=0;for(;;){const i=this.lineTokens,o=i.getCount();let r=null;if(this.lineTokenOffset<o){const s=i.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<o&&s===i.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const a=0===TokenMetadata.getTokenType(s),l=i.getEndOffset(this.lineTokenOffset);if(a&&l!==this.lineCharOffset){const e=i.getLanguageId(this.lineTokenOffset),t=this.line.substring(this.lineCharOffset,l),n=this.bracketTokens.getSingleLanguageBracketTokens(e),o=n.regExpGlobal;if(o){o.lastIndex=0;const e=o.exec(t);e&&(r=n.getToken(e[0]),r&&(this.lineCharOffset+=e.index))}}if(n+=l-this.lineCharOffset,r){if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=r;break}return this.lineCharOffset+=lengthGetColumnCountIfZeroLineCount(r.length),r}this.lineTokenOffset++,this.lineCharOffset=l}else{if(this.lineIdx===this.textBufferLineCount-1)break;if(this.lineIdx++,this.lineTokens=this.textModel.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,n+=33,n>1e3)break}if(n>1500)break}const i=lengthDiff(e,t,this.lineIdx,this.lineCharOffset);return new Token$1(i,0,-1,SmallImmutableSet.getEmpty(),new TextAstNode(i))}}class FastTokenizer{constructor(e,t){this.text=e,this._offset=lengthZero,this.idx=0;const n=t.getRegExpStr()?new RegExp(t.getRegExpStr()+"|\n","g"):null,i=[];let o,r=0,s=0,a=0,l=0;const c=new Array;for(let h=0;h<60;h++)c.push(new Token$1(toLength(0,h),0,-1,SmallImmutableSet.getEmpty(),new TextAstNode(toLength(0,h))));const d=new Array;for(let h=0;h<60;h++)d.push(new Token$1(toLength(1,h),0,-1,SmallImmutableSet.getEmpty(),new TextAstNode(toLength(1,h))));if(n)for(n.lastIndex=0;null!==(o=n.exec(e));){const e=o.index,n=o[0];if("\n"===n)r++,s=e+1;else{if(a!==e){let t;if(l===r){const n=e-a;if(n<c.length)t=c[n];else{const e=toLength(0,n);t=new Token$1(e,0,-1,SmallImmutableSet.getEmpty(),new TextAstNode(e))}}else{const n=r-l,i=e-s;if(1===n&&i<d.length)t=d[i];else{const e=toLength(n,i);t=new Token$1(e,0,-1,SmallImmutableSet.getEmpty(),new TextAstNode(e))}}i.push(t)}i.push(t.getToken(n)),a=e+n.length,l=r}}const u=e.length;if(a!==u){const e=l===r?toLength(0,u-a):toLength(r-l,u-s);i.push(new Token$1(e,0,-1,SmallImmutableSet.getEmpty(),new TextAstNode(e)))}this.length=toLength(r,u-s),this.tokens=i}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new NotSupportedError}}class BracketTokens{constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}static createFromLanguage(e,t){function n(e,n){return t.getKey(`${e}:::${n}`)}const i=e.characterPair.getColorizedBrackets(),o=new Map,r=new Set;for(const[a,l]of i){r.add(a);let t=o.get(l);const i=n(e.languageId,a);t||(t={openingBrackets:SmallImmutableSet.getEmpty(),first:i},o.set(l,t)),t.openingBrackets=t.openingBrackets.add(i,identityKeyProvider)}const s=new Map;for(const[a,l]of o){const t=toLength(0,a.length);s.set(a,new Token$1(t,2,l.first,l.openingBrackets,BracketAstNode.create(t,e.languageId,l.openingBrackets)))}for(const a of r){const t=toLength(0,a.length),i=n(e.languageId,a),o=SmallImmutableSet.getEmpty().add(i,identityKeyProvider);s.set(a,new Token$1(t,1,i,o,BracketAstNode.create(t,e.languageId,o)))}return new BracketTokens(s)}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map((e=>prepareBracketForRegExp(e))).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"g"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e)}findClosingTokenText(e){for(const[t,n]of this.map)if(n.bracketIds.intersects(e))return t}get isEmpty(){return 0===this.map.size}}function prepareBracketForRegExp(e){const t=escapeRegExpCharacters(e);return/^[\w ]+$/.test(e)?`\\b${t}\\b`:t}class LanguageAgnosticBracketTokens{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){const t=this.languageIdToBracketTokens.get(e);if(!t)return!1;const n=BracketTokens.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider).getRegExpStr();return t.getRegExpStr()!==n}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=BracketTokens.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function concat23Trees(e){if(0===e.length)return null;if(1===e.length)return e[0];let t=0;function n(){if(t>=e.length)return null;const n=t,i=e[n].listHeight;for(t++;t<e.length&&e[t].listHeight===i;)t++;return t-n>=2?concat23TreesOfSameHeight(0===n&&t===e.length?e:e.slice(n,t),!1):e[n]}let i=n(),o=n();if(!o)return i;for(let r=n();r;r=n())heightDiff(i,o)<=heightDiff(o,r)?(i=concat$1(i,o),o=r):o=concat$1(o,r);return concat$1(i,o)}function concat23TreesOfSameHeight(e,t=!1){if(0===e.length)return null;if(1===e.length)return e[0];let n=e.length;for(;n>3;){const i=n>>1;for(let o=0;o<i;o++){const i=o<<1;e[o]=ListAstNode.create23(e[i],e[i+1],i+3===n?e[i+2]:null,t)}n=i}return ListAstNode.create23(e[0],e[1],n>=3?e[2]:null,t)}function heightDiff(e,t){return Math.abs(e.listHeight-t.listHeight)}function concat$1(e,t){return e.listHeight===t.listHeight?ListAstNode.create23(e,t,null,!1):e.listHeight>t.listHeight?append(e,t):prepend(t,e)}function append(e,t){let n=e=e.toMutable();const i=new Array;let o;for(;;){if(t.listHeight===n.listHeight){o=t;break}if(4!==n.kind)throw new Error("unexpected");i.push(n),n=n.makeLastElementMutable()}for(let r=i.length-1;r>=0;r--){const e=i[r];o?e.childrenLength>=3?o=ListAstNode.create23(e.unappendChild(),o,null,!1):(e.appendChildOfSameHeight(o),o=void 0):e.handleChildrenChanged()}return o?ListAstNode.create23(e,o,null,!1):e}function prepend(e,t){let n=e=e.toMutable();const i=new Array;for(;t.listHeight!==n.listHeight;){if(4!==n.kind)throw new Error("unexpected");i.push(n),n=n.makeFirstElementMutable()}let o=t;for(let r=i.length-1;r>=0;r--){const e=i[r];o?e.childrenLength>=3?o=ListAstNode.create23(o,e.unprependChild(),null,!1):(e.prependChildOfSameHeight(o),o=void 0):e.handleChildrenChanged()}return o?ListAstNode.create23(o,e,null,!1):e}class NodeReader{constructor(e){this.lastOffset=lengthZero,this.nextNodes=[e],this.offsets=[lengthZero],this.idxs=[]}readLongestNodeAt(e,t){if(lengthLessThan(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const n=lastOrUndefined(this.nextNodes);if(!n)return;const i=lastOrUndefined(this.offsets);if(lengthLessThan(e,i))return;if(lengthLessThan(i,e))if(lengthAdd(i,n.length)<=e)this.nextNodeAfterCurrent();else{const e=getNextChildIdx(n);-1!==e?(this.nextNodes.push(n.getChild(e)),this.offsets.push(i),this.idxs.push(e)):this.nextNodeAfterCurrent()}else{if(t(n))return this.nextNodeAfterCurrent(),n;{const e=getNextChildIdx(n);if(-1===e)return void this.nextNodeAfterCurrent();this.nextNodes.push(n.getChild(e)),this.offsets.push(i),this.idxs.push(e)}}}}nextNodeAfterCurrent(){for(;;){const e=lastOrUndefined(this.offsets),t=lastOrUndefined(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),0===this.idxs.length)break;const n=lastOrUndefined(this.nextNodes),i=getNextChildIdx(n,this.idxs[this.idxs.length-1]);if(-1!==i){this.nextNodes.push(n.getChild(i)),this.offsets.push(lengthAdd(e,t.length)),this.idxs[this.idxs.length-1]=i;break}this.idxs.pop()}}}function getNextChildIdx(e,t=-1){for(;;){if(++t>=e.childrenLength)return-1;if(e.getChild(t))return t}}function lastOrUndefined(e){return e.length>0?e[e.length-1]:void 0}function parseDocument(e,t,n,i){return new Parser(e,t,n,i).parseDocument()}class Parser{constructor(e,t,n,i){if(this.tokenizer=e,this.createImmutableLists=i,this._itemsConstructed=0,this._itemsFromCache=0,n&&i)throw new Error("Not supported");this.oldNodeReader=n?new NodeReader(n):void 0,this.positionMapper=new BeforeEditPositionMapper(t,e.length)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(SmallImmutableSet.getEmpty());return e||(e=ListAstNode.getEmpty()),e}parseList(e){const t=new Array;for(;;){const n=this.tokenizer.peek();if(!n||2===n.kind&&n.bracketIds.intersects(e))break;const i=this.parseChild(e);4===i.kind&&0===i.childrenLength||t.push(i)}return this.oldNodeReader?concat23Trees(t):concat23TreesOfSameHeight(t,this.createImmutableLists)}parseChild(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(!lengthIsZero(t)){const n=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),(n=>{if(!lengthLessThan(n.length,t))return!1;return n.canBeReused(e)}));if(n)return this._itemsFromCache++,this.tokenizer.skip(n.length),n}}this._itemsConstructed++;const t=this.tokenizer.read();switch(t.kind){case 2:return new InvalidBracketAstNode(t.bracketIds,t.length);case 0:return t.astNode;case 1:{const n=e.merge(t.bracketIds),i=this.parseList(n),o=this.tokenizer.peek();return o&&2===o.kind&&(o.bracketId===t.bracketId||o.bracketIds.intersects(t.bracketIds))?(this.tokenizer.read(),PairAstNode.create(t.astNode,i,o.astNode)):PairAstNode.create(t.astNode,i,null)}default:throw new Error("unexpected")}}}class BracketPairsTree extends Disposable{constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new Emitter$1,this.denseKeyProvider=new DenseKeyProvider,this.brackets=new LanguageAgnosticBracketTokens(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,0===e.backgroundTokenizationState){const e=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),t=new FastTokenizer(this.textModel.getValue(),e);this.initialAstWithoutTokens=parseDocument(t,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}else 2===e.backgroundTokenizationState?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):1===e.backgroundTokenizationState&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens)}didLanguageChange(e){return this.brackets.didLanguageChange(e)}handleDidChangeBackgroundTokenizationState(){if(2===this.textModel.backgroundTokenizationState){const e=void 0===this.initialAstWithoutTokens;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map((e=>new TextEditInfo(toLength(e.fromLineNumber-1,0),toLength(e.toLineNumber,0),toLength(e.toLineNumber-e.fromLineNumber+1,0))));this.astWithTokens=this.parseDocumentFromTextBuffer(t,this.astWithTokens,!1),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=e.changes.map((e=>{const t=Range$2.lift(e.range);return new TextEditInfo(positionToLength(t.getStartPosition()),positionToLength(t.getEndPosition()),lengthOfString(e.text))})).reverse();this.astWithTokens=this.parseDocumentFromTextBuffer(t,this.astWithTokens,!1),this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(t,this.initialAstWithoutTokens,!1))}parseDocumentFromTextBuffer(e,t,n){const i=t;return parseDocument(new TextBufferTokenizer(this.textModel,this.brackets),e,i,n)}getBracketsInRange(e){const t=toLength(e.startLineNumber-1,e.startColumn-1),n=toLength(e.endLineNumber-1,e.endColumn-1),i=new Array,o=this.initialAstWithoutTokens||this.astWithTokens;return collectBrackets(o,lengthZero,o.length,t,n,i),i}getBracketPairsInRange(e,t){const n=new Array,i=positionToLength(e.getStartPosition()),o=positionToLength(e.getEndPosition()),r=this.initialAstWithoutTokens||this.astWithTokens,s=new CollectBracketPairsContext(n,t,this.textModel);return collectBracketPairs(r,lengthZero,r.length,i,o,s),n}}function collectBrackets(e,t,n,i,o,r,s=0){if(4===e.kind)for(const a of e.children)n=lengthAdd(t,a.length),lengthLessThanEqual(t,o)&&lengthGreaterThanEqual(n,i)&&collectBrackets(a,t,n,i,o,r,s),t=n;else if(2===e.kind){s++;if(n=lengthAdd(t,e.openingBracket.length),lengthLessThanEqual(t,o)&&lengthGreaterThanEqual(n,i)){const i=lengthsToRange(t,n);r.push(new BracketInfo(i,s-1,!e.closingBracket))}t=n;if(e.child){const a=e.child;n=lengthAdd(t,a.length),lengthLessThanEqual(t,o)&&lengthGreaterThanEqual(n,i)&&collectBrackets(a,t,n,i,o,r,s),t=n}if(e.closingBracket){if(n=lengthAdd(t,e.closingBracket.length),lengthLessThanEqual(t,o)&&lengthGreaterThanEqual(n,i)){const e=lengthsToRange(t,n);r.push(new BracketInfo(e,s-1,!1))}t=n}}else if(3===e.kind){const e=lengthsToRange(t,n);r.push(new BracketInfo(e,s-1,!0))}else if(1===e.kind){const e=lengthsToRange(t,n);r.push(new BracketInfo(e,s-1,!1))}}class CollectBracketPairsContext{constructor(e,t,n){this.result=e,this.includeMinIndentation=t,this.textModel=n}}function collectBracketPairs(e,t,n,i,o,r,s=0){var a;if(2===e.kind){const i=lengthAdd(t,e.openingBracket.length);let o=-1;r.includeMinIndentation&&(o=e.computeMinIndentation(t,r.textModel)),r.result.push(new BracketPairWithMinIndentationInfo(lengthsToRange(t,n),lengthsToRange(t,i),e.closingBracket?lengthsToRange(lengthAdd(i,(null===(a=e.child)||void 0===a?void 0:a.length)||lengthZero),n):void 0,s,o)),s++}let l=t;for(const c of e.children){const e=l;l=lengthAdd(l,c.length),lengthLessThanEqual(e,o)&&lengthLessThanEqual(i,l)&&collectBracketPairs(c,e,l,i,o,r,s)}}class BracketPairsTextModelPart extends Disposable{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new MutableDisposable),this.onDidChangeEmitter=new Emitter$1,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange((e=>{var t;e.languageId&&!(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.didLanguageChange(e.languageId))||(this.bracketPairsTree.clear(),this.updateBracketPairsTree())})))}get isDocumentSupported(){return this.textModel.getValueLength()<=5e6}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;null===(t=this.bracketPairsTree.value)||void 0===t||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;null===(e=this.bracketPairsTree.value)||void 0===e||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;null===(t=this.bracketPairsTree.value)||void 0===t||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.isDocumentSupported){if(!this.bracketPairsTree.value){const e=new DisposableStore;this.bracketPairsTree.value=createDisposableRef$1(e.add(new BracketPairsTree(this.textModel,(e=>this.languageConfigurationService.getLanguageConfiguration(e)))),e),e.add(this.bracketPairsTree.value.object.onDidChange((e=>this.onDidChangeEmitter.fire(e)))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!1))||[]}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!0))||[]}getBracketsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketsInRange(e))||[]}findMatchingBracketUp(e,t,n){const i=e.toLowerCase(),o=this.textModel.validatePosition(t),r=this.textModel.getLanguageIdAtPosition(o.lineNumber,o.column),s=this.languageConfigurationService.getLanguageConfiguration(r).brackets;if(!s)return null;const a=s.textIsBracket[i];return a?stripBracketSearchCanceled(this._findMatchingBracketUp(a,o,createTimeBasedContinueBracketSearchPredicate(n))):null}matchBracket(e,t){const n=createTimeBasedContinueBracketSearchPredicate(t);return this._matchBracket(this.textModel.validatePosition(e),n)}_establishBracketSearchOffsets(e,t,n,i){const o=t.getCount(),r=t.getLanguageId(i);let s=Math.max(0,e.column-1-n.maxBracketLength);for(let l=i-1;l>=0;l--){const e=t.getEndOffset(l);if(e<=s)break;if(ignoreBracketsInToken(t.getStandardTokenType(l))||t.getLanguageId(l)!==r){s=e;break}}let a=Math.min(t.getLineContent().length,e.column-1+n.maxBracketLength);for(let l=i+1;l<o;l++){const e=t.getStartOffset(l);if(e>=a)break;if(ignoreBracketsInToken(t.getStandardTokenType(l))||t.getLanguageId(l)!==r){a=e;break}}return{searchStartOffset:s,searchEndOffset:a}}_matchBracket(e,t){const n=e.lineNumber,i=this.textModel.getLineTokens(n),o=this.textModel.getLineContent(n),r=i.findTokenIndexAtOffset(e.column-1);if(r<0)return null;const s=this.languageConfigurationService.getLanguageConfiguration(i.getLanguageId(r)).brackets;if(s&&!ignoreBracketsInToken(i.getStandardTokenType(r))){let{searchStartOffset:a,searchEndOffset:l}=this._establishBracketSearchOffsets(e,i,s,r),c=null;for(;;){const i=BracketsUtils.findNextBracketInRange(s.forwardRegex,n,o,a,l);if(!i)break;if(i.startColumn<=e.column&&e.column<=i.endColumn){const e=o.substring(i.startColumn-1,i.endColumn-1).toLowerCase(),n=this._matchFoundBracket(i,s.textIsBracket[e],s.textIsOpenBracket[e],t);if(n){if(n instanceof BracketSearchCanceled)return null;c=n}}a=i.endColumn-1}if(c)return c}if(r>0&&i.getStartOffset(r)===e.column-1){const s=r-1,a=this.languageConfigurationService.getLanguageConfiguration(i.getLanguageId(s)).brackets;if(a&&!ignoreBracketsInToken(i.getStandardTokenType(s))){const{searchStartOffset:r,searchEndOffset:l}=this._establishBracketSearchOffsets(e,i,a,s),c=BracketsUtils.findPrevBracketInRange(a.reversedRegex,n,o,r,l);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn){const e=o.substring(c.startColumn-1,c.endColumn-1).toLowerCase(),n=this._matchFoundBracket(c,a.textIsBracket[e],a.textIsOpenBracket[e],t);if(n)return n instanceof BracketSearchCanceled?null:n}}}return null}_matchFoundBracket(e,t,n,i){if(!t)return null;const o=n?this._findMatchingBracketDown(t,e.getEndPosition(),i):this._findMatchingBracketUp(t,e.getStartPosition(),i);return o?o instanceof BracketSearchCanceled?o:[e,o]:null}_findMatchingBracketUp(e,t,n){const i=e.languageId,o=e.reversedRegex;let r=-1,s=0;const a=(t,i,a,l)=>{for(;;){if(n&&++s%100==0&&!n())return BracketSearchCanceled.INSTANCE;const c=BracketsUtils.findPrevBracketInRange(o,t,i,a,l);if(!c)break;const d=i.substring(c.startColumn-1,c.endColumn-1).toLowerCase();if(e.isOpen(d)?r++:e.isClose(d)&&r--,0===r)return c;l=c.startColumn-1}return null};for(let l=t.lineNumber;l>=1;l--){const e=this.textModel.getLineTokens(l),n=e.getCount(),o=this.textModel.getLineContent(l);let r=n-1,s=o.length,c=o.length;l===t.lineNumber&&(r=e.findTokenIndexAtOffset(t.column-1),s=t.column-1,c=t.column-1);let d=!0;for(;r>=0;r--){const t=e.getLanguageId(r)===i&&!ignoreBracketsInToken(e.getStandardTokenType(r));if(t)d?s=e.getStartOffset(r):(s=e.getStartOffset(r),c=e.getEndOffset(r));else if(d&&s!==c){const e=a(l,o,s,c);if(e)return e}d=t}if(d&&s!==c){const e=a(l,o,s,c);if(e)return e}}return null}_findMatchingBracketDown(e,t,n){const i=e.languageId,o=e.forwardRegex;let r=1,s=0;const a=(t,i,a,l)=>{for(;;){if(n&&++s%100==0&&!n())return BracketSearchCanceled.INSTANCE;const c=BracketsUtils.findNextBracketInRange(o,t,i,a,l);if(!c)break;const d=i.substring(c.startColumn-1,c.endColumn-1).toLowerCase();if(e.isOpen(d)?r++:e.isClose(d)&&r--,0===r)return c;a=c.endColumn-1}return null},l=this.textModel.getLineCount();for(let c=t.lineNumber;c<=l;c++){const e=this.textModel.getLineTokens(c),n=e.getCount(),o=this.textModel.getLineContent(c);let r=0,s=0,l=0;c===t.lineNumber&&(r=e.findTokenIndexAtOffset(t.column-1),s=t.column-1,l=t.column-1);let d=!0;for(;r<n;r++){const t=e.getLanguageId(r)===i&&!ignoreBracketsInToken(e.getStandardTokenType(r));if(t)d||(s=e.getStartOffset(r)),l=e.getEndOffset(r);else if(d&&s!==l){const e=a(c,o,s,l);if(e)return e}d=t}if(d&&s!==l){const e=a(c,o,s,l);if(e)return e}}return null}findPrevBracket(e){const t=this.textModel.validatePosition(e);let n=null,i=null;for(let o=t.lineNumber;o>=1;o--){const e=this.textModel.getLineTokens(o),r=e.getCount(),s=this.textModel.getLineContent(o);let a=r-1,l=s.length,c=s.length;if(o===t.lineNumber){a=e.findTokenIndexAtOffset(t.column-1),l=t.column-1,c=t.column-1;const o=e.getLanguageId(a);n!==o&&(n=o,i=this.languageConfigurationService.getLanguageConfiguration(n).brackets)}let d=!0;for(;a>=0;a--){const t=e.getLanguageId(a);if(n!==t){if(i&&d&&l!==c){const e=BracketsUtils.findPrevBracketInRange(i.reversedRegex,o,s,l,c);if(e)return this._toFoundBracket(i,e);d=!1}n=t,i=this.languageConfigurationService.getLanguageConfiguration(n).brackets}const r=!!i&&!ignoreBracketsInToken(e.getStandardTokenType(a));if(r)d?l=e.getStartOffset(a):(l=e.getStartOffset(a),c=e.getEndOffset(a));else if(i&&d&&l!==c){const e=BracketsUtils.findPrevBracketInRange(i.reversedRegex,o,s,l,c);if(e)return this._toFoundBracket(i,e)}d=r}if(i&&d&&l!==c){const e=BracketsUtils.findPrevBracketInRange(i.reversedRegex,o,s,l,c);if(e)return this._toFoundBracket(i,e)}}return null}findNextBracket(e){const t=this.textModel.validatePosition(e),n=this.textModel.getLineCount();let i=null,o=null;for(let r=t.lineNumber;r<=n;r++){const e=this.textModel.getLineTokens(r),n=e.getCount(),s=this.textModel.getLineContent(r);let a=0,l=0,c=0;if(r===t.lineNumber){a=e.findTokenIndexAtOffset(t.column-1),l=t.column-1,c=t.column-1;const n=e.getLanguageId(a);i!==n&&(i=n,o=this.languageConfigurationService.getLanguageConfiguration(i).brackets)}let d=!0;for(;a<n;a++){const t=e.getLanguageId(a);if(i!==t){if(o&&d&&l!==c){const e=BracketsUtils.findNextBracketInRange(o.forwardRegex,r,s,l,c);if(e)return this._toFoundBracket(o,e);d=!1}i=t,o=this.languageConfigurationService.getLanguageConfiguration(i).brackets}const n=!!o&&!ignoreBracketsInToken(e.getStandardTokenType(a));if(n)d||(l=e.getStartOffset(a)),c=e.getEndOffset(a);else if(o&&d&&l!==c){const e=BracketsUtils.findNextBracketInRange(o.forwardRegex,r,s,l,c);if(e)return this._toFoundBracket(o,e)}d=n}if(o&&d&&l!==c){const e=BracketsUtils.findNextBracketInRange(o.forwardRegex,r,s,l,c);if(e)return this._toFoundBracket(o,e)}}return null}findEnclosingBrackets(e,t){const n=createTimeBasedContinueBracketSearchPredicate(t),i=this.textModel.validatePosition(e),o=this.textModel.getLineCount(),r=new Map;let s=[];const a=(e,t)=>{if(!r.has(e)){const n=[];for(let e=0,i=t?t.brackets.length:0;e<i;e++)n[e]=0;r.set(e,n)}s=r.get(e)};let l=0;const c=(e,t,i,o,r)=>{for(;;){if(n&&++l%100==0&&!n())return BracketSearchCanceled.INSTANCE;const a=BracketsUtils.findNextBracketInRange(e.forwardRegex,t,i,o,r);if(!a)break;const c=i.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),d=e.textIsBracket[c];if(d&&(d.isOpen(c)?s[d.index]++:d.isClose(c)&&s[d.index]--,-1===s[d.index]))return this._matchFoundBracket(a,d,!1,n);o=a.endColumn-1}return null};let d=null,u=null;for(let h=i.lineNumber;h<=o;h++){const e=this.textModel.getLineTokens(h),t=e.getCount(),n=this.textModel.getLineContent(h);let o=0,r=0,s=0;if(h===i.lineNumber){o=e.findTokenIndexAtOffset(i.column-1),r=i.column-1,s=i.column-1;const t=e.getLanguageId(o);d!==t&&(d=t,u=this.languageConfigurationService.getLanguageConfiguration(d).brackets,a(d,u))}let l=!0;for(;o<t;o++){const t=e.getLanguageId(o);if(d!==t){if(u&&l&&r!==s){const e=c(u,h,n,r,s);if(e)return stripBracketSearchCanceled(e);l=!1}d=t,u=this.languageConfigurationService.getLanguageConfiguration(d).brackets,a(d,u)}const i=!!u&&!ignoreBracketsInToken(e.getStandardTokenType(o));if(i)l||(r=e.getStartOffset(o)),s=e.getEndOffset(o);else if(u&&l&&r!==s){const e=c(u,h,n,r,s);if(e)return stripBracketSearchCanceled(e)}l=i}if(u&&l&&r!==s){const e=c(u,h,n,r,s);if(e)return stripBracketSearchCanceled(e)}}return null}_toFoundBracket(e,t){if(!t)return null;let n=this.textModel.getValueInRange(t);n=n.toLowerCase();const i=e.textIsBracket[n];return i?{range:t,open:i.open,close:i.close,isOpen:e.textIsOpenBracket[n]}:null}}function createDisposableRef$1(e,t){return{object:e,dispose:()=>null==t?void 0:t.dispose()}}function createTimeBasedContinueBracketSearchPredicate(e){if(void 0===e)return()=>!0;{const t=Date.now();return()=>Date.now()-t<=e}}class BracketSearchCanceled{constructor(){this._searchCanceledBrand=void 0}}function stripBracketSearchCanceled(e){return e instanceof BracketSearchCanceled?null:e}BracketSearchCanceled.INSTANCE=new BracketSearchCanceled;class ColorizedBracketPairsDecorationProvider extends Disposable{constructor(e){super(),this.textModel=e,this.colorProvider=new ColorProvider,this.onDidChangeEmitter=new Emitter$1,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange((e=>{this.onDidChangeEmitter.fire()})))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,n){if(void 0===t)return[];if(!this.colorizationOptions.enabled)return[];const i=new Array,o=this.textModel.bracketPairs.getBracketsInRange(e);for(const r of o)i.push({id:`bracket${r.range.toString()}-${r.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(r)},ownerId:0,range:r.range});return i}getAllDecorations(e,t){return void 0===e?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new Range$2(1,1,this.textModel.getLineCount(),1),e,t):[]}}class ColorProvider{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(e.nestingLevel)}getInlineClassNameOfLevel(e){return"bracket-highlighting-"+e%30}}function escapeNewLine(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}registerThemingParticipant(((e,t)=>{const n=[editorBracketHighlightingForeground1,editorBracketHighlightingForeground2,editorBracketHighlightingForeground3,editorBracketHighlightingForeground4,editorBracketHighlightingForeground5,editorBracketHighlightingForeground6],i=new ColorProvider;t.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${e.getColor(editorBracketHighlightingUnexpectedBracketForeground)}; }`);const o=n.map((t=>e.getColor(t))).filter((e=>!!e)).filter((e=>!e.isTransparent()));for(let r=0;r<30;r++){const e=o[r%o.length];t.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(r)} { color: ${e}; }`)}}));class TextChange{constructor(e,t,n,i){this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=i}get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}toString(){return 0===this.oldText.length?`(insert@${this.oldPosition} "${escapeNewLine(this.newText)}")`:0===this.newText.length?`(delete@${this.oldPosition} "${escapeNewLine(this.oldText)}")`:`(replace@${this.oldPosition} "${escapeNewLine(this.oldText)}" with "${escapeNewLine(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,n){const i=t.length;writeUInt32BE(e,i,n),n+=4;for(let o=0;o<i;o++)writeUInt16LE(e,t.charCodeAt(o),n),n+=2;return n}static _readString(e,t){const n=readUInt32BE(e,t);return decodeUTF16LE(e,t+=4,n)}writeSize(){return 8+TextChange._writeStringSize(this.oldText)+TextChange._writeStringSize(this.newText)}write(e,t){return writeUInt32BE(e,this.oldPosition,t),t+=4,writeUInt32BE(e,this.newPosition,t),t+=4,t=TextChange._writeString(e,this.oldText,t),t=TextChange._writeString(e,this.newText,t)}static read(e,t,n){const i=readUInt32BE(e,t),o=readUInt32BE(e,t+=4);t+=4;const r=TextChange._readString(e,t);t+=TextChange._writeStringSize(r);const s=TextChange._readString(e,t);return t+=TextChange._writeStringSize(s),n.push(new TextChange(i,r,o,s)),t}}function compressConsecutiveTextChanges(e,t){if(null===e||0===e.length)return t;return new TextChangeCompressor(e,t).compress()}class TextChangeCompressor{constructor(e,t){this._prevEdits=e,this._currEdits=t,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let e=0,t=0,n=this._getPrev(e),i=this._getCurr(t);for(;e<this._prevLen||t<this._currLen;){if(null===n){this._acceptCurr(i),i=this._getCurr(++t);continue}if(null===i){this._acceptPrev(n),n=this._getPrev(++e);continue}if(i.oldEnd<=n.newPosition){this._acceptCurr(i),i=this._getCurr(++t);continue}if(n.newEnd<=i.oldPosition){this._acceptPrev(n),n=this._getPrev(++e);continue}if(i.oldPosition<n.newPosition){const[e,t]=TextChangeCompressor._splitCurr(i,n.newPosition-i.oldPosition);this._acceptCurr(e),i=t;continue}if(n.newPosition<i.oldPosition){const[e,t]=TextChangeCompressor._splitPrev(n,i.oldPosition-n.newPosition);this._acceptPrev(e),n=t;continue}let o,r;if(i.oldEnd===n.newEnd)o=n,r=i,n=this._getPrev(++e),i=this._getCurr(++t);else if(i.oldEnd<n.newEnd){const[e,s]=TextChangeCompressor._splitPrev(n,i.oldLength);o=e,r=i,n=s,i=this._getCurr(++t)}else{const[t,s]=TextChangeCompressor._splitCurr(i,n.newLength);o=n,r=t,n=this._getPrev(++e),i=s}this._result[this._resultLen++]=new TextChange(o.oldPosition,o.oldText,r.newPosition,r.newText),this._prevDeltaOffset+=o.newLength-o.oldLength,this._currDeltaOffset+=r.newLength-r.oldLength}const o=TextChangeCompressor._merge(this._result);return TextChangeCompressor._removeNoOps(o)}_acceptCurr(e){this._result[this._resultLen++]=TextChangeCompressor._rebaseCurr(this._prevDeltaOffset,e),this._currDeltaOffset+=e.newLength-e.oldLength}_getCurr(e){return e<this._currLen?this._currEdits[e]:null}_acceptPrev(e){this._result[this._resultLen++]=TextChangeCompressor._rebasePrev(this._currDeltaOffset,e),this._prevDeltaOffset+=e.newLength-e.oldLength}_getPrev(e){return e<this._prevLen?this._prevEdits[e]:null}static _rebaseCurr(e,t){return new TextChange(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new TextChange(t.oldPosition,t.oldText,t.newPosition+e,t.newText)}static _splitPrev(e,t){const n=e.newText.substr(0,t),i=e.newText.substr(t);return[new TextChange(e.oldPosition,e.oldText,e.newPosition,n),new TextChange(e.oldEnd,"",e.newPosition+t,i)]}static _splitCurr(e,t){const n=e.oldText.substr(0,t),i=e.oldText.substr(t);return[new TextChange(e.oldPosition,n,e.newPosition,e.newText),new TextChange(e.oldPosition+t,i,e.newEnd,"")]}static _merge(e){if(0===e.length)return e;const t=[];let n=0,i=e[0];for(let o=1;o<e.length;o++){const r=e[o];i.oldEnd===r.oldPosition?i=new TextChange(i.oldPosition,i.oldText+r.oldText,i.newPosition,i.newText+r.newText):(t[n++]=i,i=r)}return t[n++]=i,t}static _removeNoOps(e){if(0===e.length)return e;const t=[];let n=0;for(let i=0;i<e.length;i++){const o=e[i];o.oldText!==o.newText&&(t[n++]=o)}return t}}function isPathSeparator(e){return 47===e||92===e}function toSlashes(e){return e.replace(/[\\/]/g,posix.sep)}function toPosixPath(e){return-1===e.indexOf("/")&&(e=toSlashes(e)),/^[a-zA-Z]:(\/|$)/.test(e)&&(e="/"+e),e}function getRoot(e,t=posix.sep){if(!e)return"";const n=e.length,i=e.charCodeAt(0);if(isPathSeparator(i)){if(isPathSeparator(e.charCodeAt(1))&&!isPathSeparator(e.charCodeAt(2))){let i=3;const o=i;for(;i<n&&!isPathSeparator(e.charCodeAt(i));i++);if(o!==i&&!isPathSeparator(e.charCodeAt(i+1)))for(i+=1;i<n;i++)if(isPathSeparator(e.charCodeAt(i)))return e.slice(0,i+1).replace(/[\\/]/g,t)}return t}if(isWindowsDriveLetter(i)&&58===e.charCodeAt(1))return isPathSeparator(e.charCodeAt(2))?e.slice(0,2)+t:e.slice(0,2);let o=e.indexOf("://");if(-1!==o)for(o+=3;o<n;o++)if(isPathSeparator(e.charCodeAt(o)))return e.slice(0,o+1);return""}function isEqualOrParent(e,t,n,i=sep){if(e===t)return!0;if(!e||!t)return!1;if(t.length>e.length)return!1;if(n){if(!startsWithIgnoreCase(e,t))return!1;if(t.length===e.length)return!0;let n=t.length;return t.charAt(t.length-1)===i&&n--,e.charAt(n)===i}return t.charAt(t.length-1)!==i&&(t+=i),0===e.indexOf(t)}function isWindowsDriveLetter(e){return e>=65&&e<=90||e>=97&&e<=122}function isRootOrDriveLetter(e){const t=normalize(e);return isWindows?!(e.length>3)&&(hasDriveLetter(t)&&(2===e.length||92===t.charCodeAt(2))):t===posix.sep}function hasDriveLetter(e,t){return!!(void 0!==t?t:isWindows)&&(isWindowsDriveLetter(e.charCodeAt(0))&&58===e.charCodeAt(1))}function originalFSPath(e){return uriToFsPath(e,!0)}class ExtUri{constructor(e){this._ignorePathCasing=e}compare(e,t,n=!1){return e===t?0:compare(this.getComparisonKey(e,n),this.getComparisonKey(t,n))}isEqual(e,t,n=!1){return e===t||!(!e||!t)&&this.getComparisonKey(e,n)===this.getComparisonKey(t,n)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,n=!1){if(e.scheme===t.scheme){if(e.scheme===Schemas.file)return isEqualOrParent(originalFSPath(e),originalFSPath(t),this._ignorePathCasing(e))&&e.query===t.query&&(n||e.fragment===t.fragment);if(isEqualAuthority(e.authority,t.authority))return isEqualOrParent(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(n||e.fragment===t.fragment)}return!1}joinPath(e,...t){return URI.joinPath(e,...t)}basenameOrAuthority(e){return basename(e)||e.authority}basename(e){return posix.basename(e.path)}extname(e){return posix.extname(e.path)}dirname(e){if(0===e.path.length)return e;let t;return e.scheme===Schemas.file?t=URI.file(dirname$1(originalFSPath(e))).path:(t=posix.dirname(e.path),e.authority&&t.length&&47!==t.charCodeAt(0)&&(t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return t=e.scheme===Schemas.file?URI.file(normalize(originalFSPath(e))).path:posix.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!isEqualAuthority(e.authority,t.authority))return;if(e.scheme===Schemas.file){const n=relative(originalFSPath(e),originalFSPath(t));return isWindows?toSlashes(n):n}let n=e.path||"/",i=t.path||"/";if(this._ignorePathCasing(e)){let e=0;for(const t=Math.min(n.length,i.length);e<t&&(n.charCodeAt(e)===i.charCodeAt(e)||n.charAt(e).toLowerCase()===i.charAt(e).toLowerCase());e++);n=i.substr(0,e)+n.substr(e)}return posix.relative(n,i)}resolvePath(e,t){if(e.scheme===Schemas.file){const n=URI.file(resolve(originalFSPath(e),t));return e.with({authority:n.authority,path:n.path})}return t=toPosixPath(t),e.with({path:posix.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&"/"===e.path[0]}isEqualAuthority(e,t){return e===t||void 0!==e&&void 0!==t&&equalsIgnoreCase(e,t)}hasTrailingPathSeparator(e,t=sep){if(e.scheme===Schemas.file){const n=originalFSPath(e);return n.length>getRoot(n).length&&n[n.length-1]===t}{const t=e.path;return t.length>1&&47===t.charCodeAt(t.length-1)&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=sep){return hasTrailingPathSeparator(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=sep){let n=!1;if(e.scheme===Schemas.file){const i=originalFSPath(e);n=void 0!==i&&i.length===getRoot(i).length&&i[i.length-1]===t}else{t="/";const i=e.path;n=1===i.length&&47===i.charCodeAt(i.length-1)}return n||hasTrailingPathSeparator(e,t)?e:e.with({path:e.path+"/"})}}const extUri=new ExtUri((()=>!1));new ExtUri((e=>e.scheme!==Schemas.file||!isLinux)),new ExtUri((e=>!0));const isEqual=extUri.isEqual.bind(extUri);extUri.isEqualOrParent.bind(extUri),extUri.getComparisonKey.bind(extUri);const basenameOrAuthority=extUri.basenameOrAuthority.bind(extUri),basename=extUri.basename.bind(extUri),extname=extUri.extname.bind(extUri),dirname=extUri.dirname.bind(extUri),joinPath=extUri.joinPath.bind(extUri),normalizePath=extUri.normalizePath.bind(extUri);extUri.relativePath.bind(extUri);const resolvePath=extUri.resolvePath.bind(extUri);extUri.isAbsolutePath.bind(extUri);const isEqualAuthority=extUri.isEqualAuthority.bind(extUri),hasTrailingPathSeparator=extUri.hasTrailingPathSeparator.bind(extUri);var DataUri,DataUri2;function uriGetComparisonKey(e){return e.toString()}extUri.removeTrailingPathSeparator.bind(extUri),extUri.addTrailingPathSeparator.bind(extUri),DataUri2=DataUri||(DataUri={}),DataUri2.META_DATA_LABEL="label",DataUri2.META_DATA_DESCRIPTION="description",DataUri2.META_DATA_SIZE="size",DataUri2.META_DATA_MIME="mime",DataUri2.parseMetaData=function(e){const t=new Map;e.path.substring(e.path.indexOf(";")+1,e.path.lastIndexOf(";")).split(";").forEach((e=>{const[n,i]=e.split(":");n&&i&&t.set(n,i)}));const n=e.path.substring(0,e.path.indexOf(";"));return n&&t.set(DataUri2.META_DATA_MIME,n),t};class SingleModelEditStackData{constructor(e,t,n,i,o,r,s){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=n,this.afterEOL=i,this.beforeCursorState=o,this.afterCursorState=r,this.changes=s}static create(e,t){const n=e.getAlternativeVersionId(),i=getModelEOL(e);return new SingleModelEditStackData(n,n,i,i,t,t,[])}append(e,t,n,i,o){t.length>0&&(this.changes=compressConsecutiveTextChanges(this.changes,t)),this.afterEOL=n,this.afterVersionId=i,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,n){if(writeUInt32BE(e,t?t.length:0,n),n+=4,t)for(const i of t)writeUInt32BE(e,i.selectionStartLineNumber,n),n+=4,writeUInt32BE(e,i.selectionStartColumn,n),n+=4,writeUInt32BE(e,i.positionLineNumber,n),n+=4,writeUInt32BE(e,i.positionColumn,n),n+=4;return n}static _readSelections(e,t,n){const i=readUInt32BE(e,t);t+=4;for(let o=0;o<i;o++){const i=readUInt32BE(e,t),o=readUInt32BE(e,t+=4),r=readUInt32BE(e,t+=4),s=readUInt32BE(e,t+=4);t+=4,n.push(new Selection$1(i,o,r,s))}return t}serialize(){let e=10+SingleModelEditStackData._writeSelectionsSize(this.beforeCursorState)+SingleModelEditStackData._writeSelectionsSize(this.afterCursorState)+4;for(const i of this.changes)e+=i.writeSize();const t=new Uint8Array(e);let n=0;writeUInt32BE(t,this.beforeVersionId,n),n+=4,writeUInt32BE(t,this.afterVersionId,n),n+=4,writeUInt8(t,this.beforeEOL,n),n+=1,writeUInt8(t,this.afterEOL,n),n+=1,n=SingleModelEditStackData._writeSelections(t,this.beforeCursorState,n),n=SingleModelEditStackData._writeSelections(t,this.afterCursorState,n),writeUInt32BE(t,this.changes.length,n),n+=4;for(const i of this.changes)n=i.write(t,n);return t.buffer}static deserialize(e){const t=new Uint8Array(e);let n=0;const i=readUInt32BE(t,n);n+=4;const o=readUInt32BE(t,n);n+=4;const r=readUInt8(t,n);n+=1;const s=readUInt8(t,n);n+=1;const a=[];n=SingleModelEditStackData._readSelections(t,n,a);const l=[];n=SingleModelEditStackData._readSelections(t,n,l);const c=readUInt32BE(t,n);n+=4;const d=[];for(let u=0;u<c;u++)n=TextChange.read(t,n,d);return new SingleModelEditStackData(i,o,r,s,a,l,d)}}class SingleModelEditStackElement{constructor(e,t){this.model=e,this._data=SingleModelEditStackData.create(e,t)}get type(){return 0}get resource(){return URI.isUri(this.model)?this.model:this.model.uri}get label(){return localize("edit","Typing")}toString(){return(this._data instanceof SingleModelEditStackData?this._data:SingleModelEditStackData.deserialize(this._data)).changes.map((e=>e.toString())).join(", ")}matchesResource(e){return(URI.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof SingleModelEditStackData}append(e,t,n,i,o){this._data instanceof SingleModelEditStackData&&this._data.append(e,t,n,i,o)}close(){this._data instanceof SingleModelEditStackData&&(this._data=this._data.serialize())}open(){this._data instanceof SingleModelEditStackData||(this._data=SingleModelEditStackData.deserialize(this._data))}undo(){if(URI.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof SingleModelEditStackData&&(this._data=this._data.serialize());const e=SingleModelEditStackData.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(URI.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof SingleModelEditStackData&&(this._data=this._data.serialize());const e=SingleModelEditStackData.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof SingleModelEditStackData&&(this._data=this._data.serialize()),this._data.byteLength+168}}class MultiModelEditStackElement{constructor(e,t){this.type=1,this.label=e,this._isOpen=!0,this._editStackElementsArr=t.slice(0),this._editStackElementsMap=new Map;for(const n of this._editStackElementsArr){const e=uriGetComparisonKey(n.resource);this._editStackElementsMap.set(e,n)}this._delegate=null}get resources(){return this._editStackElementsArr.map((e=>e.resource))}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=uriGetComparisonKey(e);return this._editStackElementsMap.has(t)}setModel(e){const t=uriGetComparisonKey(URI.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=uriGetComparisonKey(e.uri);if(this._editStackElementsMap.has(t)){return this._editStackElementsMap.get(t).canAppend(e)}return!1}append(e,t,n,i,o){const r=uriGetComparisonKey(e.uri);this._editStackElementsMap.get(r).append(e,t,n,i,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=uriGetComparisonKey(e);if(this._editStackElementsMap.has(t)){return this._editStackElementsMap.get(t).heapSize()}return 0}split(){return this._editStackElementsArr}toString(){let e=[];for(const t of this._editStackElementsArr)e.push(`${basename(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function getModelEOL(e){return"\n"===e.getEOL()?0:1}function isEditStackElement(e){return!!e&&(e instanceof SingleModelEditStackElement||e instanceof MultiModelEditStackElement)}class EditStack{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);isEditStackElement(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);isEditStackElement(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e){const t=this._undoRedoService.getLastElement(this._model.uri);if(isEditStackElement(t)&&t.canAppend(this._model))return t;const n=new SingleModelEditStackElement(this._model,e);return this._undoRedoService.pushElement(n),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null);this._model.setEOL(e),t.append(this._model,[],getModelEOL(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,n){const i=this._getOrCreateEditStackElement(e),o=this._model.applyEdits(t,!0),r=EditStack._computeCursorState(n,o),s=o.map(((e,t)=>({index:t,textChange:e.textChange})));return s.sort(((e,t)=>e.textChange.oldPosition===t.textChange.oldPosition?e.index-t.index:e.textChange.oldPosition-t.textChange.oldPosition)),i.append(this._model,s.map((e=>e.textChange)),getModelEOL(this._model),this._model.getAlternativeVersionId(),r),r}static _computeCursorState(e,t){try{return e?e(t):null}catch(e2){return onUnexpectedError(e2),null}}}class SpacesDiffResult{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function spacesDiff(e,t,n,i,o){let r;for(o.spacesDiff=0,o.looksLikeAlignment=!1,r=0;r<t&&r<i;r++){if(e.charCodeAt(r)!==n.charCodeAt(r))break}let s=0,a=0;for(let h=r;h<t;h++){32===e.charCodeAt(h)?s++:a++}let l=0,c=0;for(let h=r;h<i;h++){32===n.charCodeAt(h)?l++:c++}if(s>0&&a>0)return;if(l>0&&c>0)return;const d=Math.abs(a-c),u=Math.abs(s-l);if(0===d)return o.spacesDiff=u,void(u>0&&0<=l-1&&l-1<e.length&&l<n.length&&32!==n.charCodeAt(l)&&32===e.charCodeAt(l-1)&&44===e.charCodeAt(e.length-1)&&(o.looksLikeAlignment=!0));u%d!=0||(o.spacesDiff=u/d)}function guessIndentation(e,t,n){const i=Math.min(e.getLineCount(),1e4);let o=0,r=0,s="",a=0;const l=[2,4,6,8,3,5,7],c=[0,0,0,0,0,0,0,0,0],d=new SpacesDiffResult;for(let g=1;g<=i;g++){const i=e.getLineLength(g),l=e.getLineContent(g),u=i<=65536;let h=!1,p=0,f=0,m=0;for(let t=0,n=i;t<n;t++){const n=u?l.charCodeAt(t):e.getLineCharCode(g,t);if(9===n)m++;else{if(32!==n){h=!0,p=t;break}f++}}if(!h)continue;if(m>0?o++:f>1&&r++,spacesDiff(s,a,l,p,d),d.looksLikeAlignment&&(!n||t!==d.spacesDiff))continue;const v=d.spacesDiff;v<=8&&c[v]++,s=l,a=p}let u=n;o!==r&&(u=o<r);let h=t;if(u){let e=u?0:.1*i;l.forEach((t=>{const n=c[t];n>e&&(e=n,h=t)})),4===h&&c[4]>0&&c[2]>0&&c[2]>=c[4]/2&&(h=2)}return{insertSpaces:u,tabSize:h}}function getNodeColor(e){return(1&e.metadata)>>>0}function setNodeColor(e,t){e.metadata=254&e.metadata|t<<0}function getNodeIsVisited(e){return(2&e.metadata)>>>1==1}function setNodeIsVisited(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function getNodeIsForValidation(e){return(4&e.metadata)>>>2==1}function setNodeIsForValidation(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function getNodeStickiness(e){return(24&e.metadata)>>>3}function _setNodeStickiness(e,t){e.metadata=231&e.metadata|t<<3}function getCollapseOnReplaceEdit(e){return(32&e.metadata)>>>5==1}function setCollapseOnReplaceEdit(e,t){e.metadata=223&e.metadata|(t?1:0)<<5}class IntervalNode{constructor(e,t,n){this.metadata=0,this.parent=this,this.left=this,this.right=this,setNodeColor(this,1),this.start=t,this.end=n,this.delta=0,this.maxEnd=n,this.id=e,this.ownerId=0,this.options=null,setNodeIsForValidation(this,!1),_setNodeStickiness(this,1),setCollapseOnReplaceEdit(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=null,setNodeIsVisited(this,!1)}reset(e,t,n,i){this.start=t,this.end=n,this.maxEnd=n,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=i}setOptions(e){this.options=e;const t=this.options.className;setNodeIsForValidation(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),_setNodeStickiness(this,this.options.stickiness),setCollapseOnReplaceEdit(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,n){this.cachedVersionId!==n&&(this.range=null),this.cachedVersionId=n,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const SENTINEL$1=new IntervalNode(null,0,0);SENTINEL$1.parent=SENTINEL$1,SENTINEL$1.left=SENTINEL$1,SENTINEL$1.right=SENTINEL$1,setNodeColor(SENTINEL$1,0);class IntervalTree{constructor(){this.root=SENTINEL$1,this.requestNormalizeDelta=!1}intervalSearch(e,t,n,i,o){return this.root===SENTINEL$1?[]:intervalSearch(this,e,t,n,i,o)}search(e,t,n){return this.root===SENTINEL$1?[]:search(this,e,t,n)}collectNodesFromOwner(e){return collectNodesFromOwner(this,e)}collectNodesPostOrder(){return collectNodesPostOrder(this)}insert(e){rbTreeInsert(this,e),this._normalizeDeltaIfNecessary()}delete(e){rbTreeDelete(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const n=e;let i=0;for(;e!==this.root;)e===e.parent.right&&(i+=e.parent.delta),e=e.parent;const o=n.start+i,r=n.end+i;n.setCachedOffsets(o,r,t)}acceptReplace(e,t,n,i){const o=searchForEditing(this,e,e+t);for(let r=0,s=o.length;r<s;r++){rbTreeDelete(this,o[r])}this._normalizeDeltaIfNecessary(),noOverlapReplace(this,e,e+t,n),this._normalizeDeltaIfNecessary();for(let r=0,s=o.length;r<s;r++){const s=o[r];s.start=s.cachedAbsoluteStart,s.end=s.cachedAbsoluteEnd,nodeAcceptEdit(s,e,e+t,n,i),s.maxEnd=s.end,rbTreeInsert(this,s)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,normalizeDelta(this))}}function normalizeDelta(e){let t=e.root,n=0;for(;t!==SENTINEL$1;)t.left===SENTINEL$1||getNodeIsVisited(t.left)?t.right===SENTINEL$1||getNodeIsVisited(t.right)?(t.start=n+t.start,t.end=n+t.end,t.delta=0,recomputeMaxEnd(t),setNodeIsVisited(t,!0),setNodeIsVisited(t.left,!1),setNodeIsVisited(t.right,!1),t===t.parent.right&&(n-=t.parent.delta),t=t.parent):(n+=t.delta,t=t.right):t=t.left;setNodeIsVisited(e.root,!1)}function adjustMarkerBeforeColumn(e,t,n,i){return e<n||!(e>n)&&(1!==i&&(2===i||t))}function nodeAcceptEdit(e,t,n,i,o){const r=getNodeStickiness(e),s=0===r||2===r,a=1===r||2===r,l=n-t,c=i,d=Math.min(l,c),u=e.start;let h=!1;const g=e.end;let p=!1;t<=u&&g<=n&&getCollapseOnReplaceEdit(e)&&(e.start=t,h=!0,e.end=t,p=!0);{const e=o?1:l>0?2:0;!h&&adjustMarkerBeforeColumn(u,s,t,e)&&(h=!0),!p&&adjustMarkerBeforeColumn(g,a,t,e)&&(p=!0)}if(d>0&&!o){const e=l>c?2:0;!h&&adjustMarkerBeforeColumn(u,s,t+d,e)&&(h=!0),!p&&adjustMarkerBeforeColumn(g,a,t+d,e)&&(p=!0)}{const i=o?1:0;!h&&adjustMarkerBeforeColumn(u,s,n,i)&&(e.start=t+c,h=!0),!p&&adjustMarkerBeforeColumn(g,a,n,i)&&(e.end=t+c,p=!0)}const f=c-l;h||(e.start=Math.max(0,u+f)),p||(e.end=Math.max(0,g+f)),e.start>e.end&&(e.end=e.start)}function searchForEditing(e,t,n){let i=e.root,o=0,r=0,s=0,a=0;const l=[];let c=0;for(;i!==SENTINEL$1;)if(getNodeIsVisited(i))setNodeIsVisited(i.left,!1),setNodeIsVisited(i.right,!1),i===i.parent.right&&(o-=i.parent.delta),i=i.parent;else{if(!getNodeIsVisited(i.left)){if(r=o+i.maxEnd,r<t){setNodeIsVisited(i,!0);continue}if(i.left!==SENTINEL$1){i=i.left;continue}}s=o+i.start,s>n?setNodeIsVisited(i,!0):(a=o+i.end,a>=t&&(i.setCachedOffsets(s,a,0),l[c++]=i),setNodeIsVisited(i,!0),i.right===SENTINEL$1||getNodeIsVisited(i.right)||(o+=i.delta,i=i.right))}return setNodeIsVisited(e.root,!1),l}function noOverlapReplace(e,t,n,i){let o=e.root,r=0,s=0,a=0;const l=i-(n-t);for(;o!==SENTINEL$1;)if(getNodeIsVisited(o))setNodeIsVisited(o.left,!1),setNodeIsVisited(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),recomputeMaxEnd(o),o=o.parent;else{if(!getNodeIsVisited(o.left)){if(s=r+o.maxEnd,s<t){setNodeIsVisited(o,!0);continue}if(o.left!==SENTINEL$1){o=o.left;continue}}a=r+o.start,a>n?(o.start+=l,o.end+=l,o.delta+=l,(o.delta<-1073741824||o.delta>1073741824)&&(e.requestNormalizeDelta=!0),setNodeIsVisited(o,!0)):(setNodeIsVisited(o,!0),o.right===SENTINEL$1||getNodeIsVisited(o.right)||(r+=o.delta,o=o.right))}setNodeIsVisited(e.root,!1)}function collectNodesFromOwner(e,t){let n=e.root;const i=[];let o=0;for(;n!==SENTINEL$1;)getNodeIsVisited(n)?(setNodeIsVisited(n.left,!1),setNodeIsVisited(n.right,!1),n=n.parent):n.left===SENTINEL$1||getNodeIsVisited(n.left)?(n.ownerId===t&&(i[o++]=n),setNodeIsVisited(n,!0),n.right===SENTINEL$1||getNodeIsVisited(n.right)||(n=n.right)):n=n.left;return setNodeIsVisited(e.root,!1),i}function collectNodesPostOrder(e){let t=e.root;const n=[];let i=0;for(;t!==SENTINEL$1;)getNodeIsVisited(t)?(setNodeIsVisited(t.left,!1),setNodeIsVisited(t.right,!1),t=t.parent):t.left===SENTINEL$1||getNodeIsVisited(t.left)?t.right===SENTINEL$1||getNodeIsVisited(t.right)?(n[i++]=t,setNodeIsVisited(t,!0)):t=t.right:t=t.left;return setNodeIsVisited(e.root,!1),n}function search(e,t,n,i){let o=e.root,r=0,s=0,a=0;const l=[];let c=0;for(;o!==SENTINEL$1;){if(getNodeIsVisited(o)){setNodeIsVisited(o.left,!1),setNodeIsVisited(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==SENTINEL$1&&!getNodeIsVisited(o.left)){o=o.left;continue}s=r+o.start,a=r+o.end,o.setCachedOffsets(s,a,i);let e=!0;t&&o.ownerId&&o.ownerId!==t&&(e=!1),n&&getNodeIsForValidation(o)&&(e=!1),e&&(l[c++]=o),setNodeIsVisited(o,!0),o.right===SENTINEL$1||getNodeIsVisited(o.right)||(r+=o.delta,o=o.right)}return setNodeIsVisited(e.root,!1),l}function intervalSearch(e,t,n,i,o,r){let s=e.root,a=0,l=0,c=0,d=0;const u=[];let h=0;for(;s!==SENTINEL$1;)if(getNodeIsVisited(s))setNodeIsVisited(s.left,!1),setNodeIsVisited(s.right,!1),s===s.parent.right&&(a-=s.parent.delta),s=s.parent;else{if(!getNodeIsVisited(s.left)){if(l=a+s.maxEnd,l<t){setNodeIsVisited(s,!0);continue}if(s.left!==SENTINEL$1){s=s.left;continue}}if(c=a+s.start,c>n)setNodeIsVisited(s,!0);else{if(d=a+s.end,d>=t){s.setCachedOffsets(c,d,r);let e=!0;i&&s.ownerId&&s.ownerId!==i&&(e=!1),o&&getNodeIsForValidation(s)&&(e=!1),e&&(u[h++]=s)}setNodeIsVisited(s,!0),s.right===SENTINEL$1||getNodeIsVisited(s.right)||(a+=s.delta,s=s.right)}}return setNodeIsVisited(e.root,!1),u}function rbTreeInsert(e,t){if(e.root===SENTINEL$1)return t.parent=SENTINEL$1,t.left=SENTINEL$1,t.right=SENTINEL$1,setNodeColor(t,0),e.root=t,e.root;treeInsert(e,t),recomputeMaxEndWalkToRoot(t.parent);let n=t;for(;n!==e.root&&1===getNodeColor(n.parent);)if(n.parent===n.parent.parent.left){const t=n.parent.parent.right;1===getNodeColor(t)?(setNodeColor(n.parent,0),setNodeColor(t,0),setNodeColor(n.parent.parent,1),n=n.parent.parent):(n===n.parent.right&&(n=n.parent,leftRotate$2(e,n)),setNodeColor(n.parent,0),setNodeColor(n.parent.parent,1),rightRotate$1(e,n.parent.parent))}else{const t=n.parent.parent.left;1===getNodeColor(t)?(setNodeColor(n.parent,0),setNodeColor(t,0),setNodeColor(n.parent.parent,1),n=n.parent.parent):(n===n.parent.left&&(n=n.parent,rightRotate$1(e,n)),setNodeColor(n.parent,0),setNodeColor(n.parent.parent,1),leftRotate$2(e,n.parent.parent))}return setNodeColor(e.root,0),t}function treeInsert(e,t){let n=0,i=e.root;const o=t.start,r=t.end;for(;;){if(intervalCompare(o,r,i.start+n,i.end+n)<0){if(i.left===SENTINEL$1){t.start-=n,t.end-=n,t.maxEnd-=n,i.left=t;break}i=i.left}else{if(i.right===SENTINEL$1){t.start-=n+i.delta,t.end-=n+i.delta,t.maxEnd-=n+i.delta,i.right=t;break}n+=i.delta,i=i.right}}t.parent=i,t.left=SENTINEL$1,t.right=SENTINEL$1,setNodeColor(t,1)}function rbTreeDelete(e,t){let n,i;if(t.left===SENTINEL$1?(n=t.right,i=t,n.delta+=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta):t.right===SENTINEL$1?(n=t.left,i=t):(i=leftest$1(t.right),n=i.right,n.start+=i.delta,n.end+=i.delta,n.delta+=i.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta,i.delta=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0)),i===e.root)return e.root=n,setNodeColor(n,0),t.detach(),resetSentinel$1(),recomputeMaxEnd(n),void(e.root.parent=SENTINEL$1);const o=1===getNodeColor(i);if(i===i.parent.left?i.parent.left=n:i.parent.right=n,i===t?n.parent=i.parent:(i.parent===t?n.parent=i:n.parent=i.parent,i.left=t.left,i.right=t.right,i.parent=t.parent,setNodeColor(i,getNodeColor(t)),t===e.root?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left!==SENTINEL$1&&(i.left.parent=i),i.right!==SENTINEL$1&&(i.right.parent=i)),t.detach(),o)return recomputeMaxEndWalkToRoot(n.parent),i!==t&&(recomputeMaxEndWalkToRoot(i),recomputeMaxEndWalkToRoot(i.parent)),void resetSentinel$1();let r;for(recomputeMaxEndWalkToRoot(n),recomputeMaxEndWalkToRoot(n.parent),i!==t&&(recomputeMaxEndWalkToRoot(i),recomputeMaxEndWalkToRoot(i.parent));n!==e.root&&0===getNodeColor(n);)n===n.parent.left?(r=n.parent.right,1===getNodeColor(r)&&(setNodeColor(r,0),setNodeColor(n.parent,1),leftRotate$2(e,n.parent),r=n.parent.right),0===getNodeColor(r.left)&&0===getNodeColor(r.right)?(setNodeColor(r,1),n=n.parent):(0===getNodeColor(r.right)&&(setNodeColor(r.left,0),setNodeColor(r,1),rightRotate$1(e,r),r=n.parent.right),setNodeColor(r,getNodeColor(n.parent)),setNodeColor(n.parent,0),setNodeColor(r.right,0),leftRotate$2(e,n.parent),n=e.root)):(r=n.parent.left,1===getNodeColor(r)&&(setNodeColor(r,0),setNodeColor(n.parent,1),rightRotate$1(e,n.parent),r=n.parent.left),0===getNodeColor(r.left)&&0===getNodeColor(r.right)?(setNodeColor(r,1),n=n.parent):(0===getNodeColor(r.left)&&(setNodeColor(r.right,0),setNodeColor(r,1),leftRotate$2(e,r),r=n.parent.left),setNodeColor(r,getNodeColor(n.parent)),setNodeColor(n.parent,0),setNodeColor(r.left,0),rightRotate$1(e,n.parent),n=e.root));setNodeColor(n,0),resetSentinel$1()}function leftest$1(e){for(;e.left!==SENTINEL$1;)e=e.left;return e}function resetSentinel$1(){SENTINEL$1.parent=SENTINEL$1,SENTINEL$1.delta=0,SENTINEL$1.start=0,SENTINEL$1.end=0}function leftRotate$2(e,t){const n=t.right;n.delta+=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,t.right=n.left,n.left!==SENTINEL$1&&(n.left.parent=t),n.parent=t.parent,t.parent===SENTINEL$1?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n,recomputeMaxEnd(t),recomputeMaxEnd(n)}function rightRotate$1(e,t){const n=t.left;t.delta-=n.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=n.delta,t.end-=n.delta,t.left=n.right,n.right!==SENTINEL$1&&(n.right.parent=t),n.parent=t.parent,t.parent===SENTINEL$1?e.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n,recomputeMaxEnd(t),recomputeMaxEnd(n)}function computeMaxEnd(e){let t=e.end;if(e.left!==SENTINEL$1){const n=e.left.maxEnd;n>t&&(t=n)}if(e.right!==SENTINEL$1){const n=e.right.maxEnd+e.delta;n>t&&(t=n)}return t}function recomputeMaxEnd(e){e.maxEnd=computeMaxEnd(e)}function recomputeMaxEndWalkToRoot(e){for(;e!==SENTINEL$1;){const t=computeMaxEnd(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}function intervalCompare(e,t,n,i){return e===n?t-i:e-n}class TreeNode{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==SENTINEL)return leftest(this.right);let e=this;for(;e.parent!==SENTINEL&&e.parent.left!==e;)e=e.parent;return e.parent===SENTINEL?SENTINEL:e.parent}prev(){if(this.left!==SENTINEL)return righttest(this.left);let e=this;for(;e.parent!==SENTINEL&&e.parent.right!==e;)e=e.parent;return e.parent===SENTINEL?SENTINEL:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const SENTINEL=new TreeNode(null,0);function leftest(e){for(;e.left!==SENTINEL;)e=e.left;return e}function righttest(e){for(;e.right!==SENTINEL;)e=e.right;return e}function calculateSize(e){return e===SENTINEL?0:e.size_left+e.piece.length+calculateSize(e.right)}function calculateLF(e){return e===SENTINEL?0:e.lf_left+e.piece.lineFeedCnt+calculateLF(e.right)}function resetSentinel(){SENTINEL.parent=SENTINEL}function leftRotate$1(e,t){const n=t.right;n.size_left+=t.size_left+(t.piece?t.piece.length:0),n.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=n.left,n.left!==SENTINEL&&(n.left.parent=t),n.parent=t.parent,t.parent===SENTINEL?e.root=n:t.parent.left===t?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n}function rightRotate(e,t){const n=t.left;t.left=n.right,n.right!==SENTINEL&&(n.right.parent=t),n.parent=t.parent,t.size_left-=n.size_left+(n.piece?n.piece.length:0),t.lf_left-=n.lf_left+(n.piece?n.piece.lineFeedCnt:0),t.parent===SENTINEL?e.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n}function rbDelete(e,t){let n,i;if(t.left===SENTINEL?(i=t,n=i.right):t.right===SENTINEL?(i=t,n=i.left):(i=leftest(t.right),n=i.right),i===e.root)return e.root=n,n.color=0,t.detach(),resetSentinel(),void(e.root.parent=SENTINEL);const o=1===i.color;if(i===i.parent.left?i.parent.left=n:i.parent.right=n,i===t?(n.parent=i.parent,recomputeTreeMetadata(e,n)):(i.parent===t?n.parent=i:n.parent=i.parent,recomputeTreeMetadata(e,n),i.left=t.left,i.right=t.right,i.parent=t.parent,i.color=t.color,t===e.root?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left!==SENTINEL&&(i.left.parent=i),i.right!==SENTINEL&&(i.right.parent=i),i.size_left=t.size_left,i.lf_left=t.lf_left,recomputeTreeMetadata(e,i)),t.detach(),n.parent.left===n){const t=calculateSize(n),i=calculateLF(n);if(t!==n.parent.size_left||i!==n.parent.lf_left){const o=t-n.parent.size_left,r=i-n.parent.lf_left;n.parent.size_left=t,n.parent.lf_left=i,updateTreeMetadata(e,n.parent,o,r)}}if(recomputeTreeMetadata(e,n.parent),o)return void resetSentinel();let r;for(;n!==e.root&&0===n.color;)n===n.parent.left?(r=n.parent.right,1===r.color&&(r.color=0,n.parent.color=1,leftRotate$1(e,n.parent),r=n.parent.right),0===r.left.color&&0===r.right.color?(r.color=1,n=n.parent):(0===r.right.color&&(r.left.color=0,r.color=1,rightRotate(e,r),r=n.parent.right),r.color=n.parent.color,n.parent.color=0,r.right.color=0,leftRotate$1(e,n.parent),n=e.root)):(r=n.parent.left,1===r.color&&(r.color=0,n.parent.color=1,rightRotate(e,n.parent),r=n.parent.left),0===r.left.color&&0===r.right.color?(r.color=1,n=n.parent):(0===r.left.color&&(r.right.color=0,r.color=1,leftRotate$1(e,r),r=n.parent.left),r.color=n.parent.color,n.parent.color=0,r.left.color=0,rightRotate(e,n.parent),n=e.root));n.color=0,resetSentinel()}function fixInsert(e,t){for(recomputeTreeMetadata(e,t);t!==e.root&&1===t.parent.color;)if(t.parent===t.parent.parent.left){const n=t.parent.parent.right;1===n.color?(t.parent.color=0,n.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&leftRotate$1(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,rightRotate(e,t.parent.parent))}else{const n=t.parent.parent.left;1===n.color?(t.parent.color=0,n.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&rightRotate(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,leftRotate$1(e,t.parent.parent))}e.root.color=0}function updateTreeMetadata(e,t,n,i){for(;t!==e.root&&t!==SENTINEL;)t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=i),t=t.parent}function recomputeTreeMetadata(e,t){let n=0,i=0;if(t!==e.root){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t!==e.root)for(n=calculateSize((t=t.parent).left)-t.size_left,i=calculateLF(t.left)-t.lf_left,t.size_left+=n,t.lf_left+=i;t!==e.root&&(0!==n||0!==i);)t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=i),t=t.parent}}SENTINEL.parent=SENTINEL,SENTINEL.left=SENTINEL,SENTINEL.right=SENTINEL,SENTINEL.color=0;const LIMIT_FIND_COUNT$1=999;class SearchParams{constructor(e,t,n,i){this.searchString=e,this.isRegex=t,this.matchCase=n,this.wordSeparators=i}parseSearchRequest(){if(""===this.searchString)return null;let e;e=this.isRegex?isMultilineRegexSource(this.searchString):this.searchString.indexOf("\n")>=0;let t=null;try{t=createRegExp(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(i){return null}if(!t)return null;let n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new SearchData(t,this.wordSeparators?getMapForWordSeparators(this.wordSeparators):null,n?this.searchString:null)}}function isMultilineRegexSource(e){if(!e||0===e.length)return!1;for(let t=0,n=e.length;t<n;t++){if(92===e.charCodeAt(t)){if(t++,t>=n)break;const i=e.charCodeAt(t);if(110===i||114===i||87===i)return!0}}return!1}function createFindMatch(e,t,n){if(!n)return new FindMatch(e,null);const i=[];for(let o=0,r=t.length;o<r;o++)i[o]=t[o];return new FindMatch(e,i)}class LineFeedCounter{constructor(e){const t=[];let n=0;for(let i=0,o=e.length;i<o;i++)10===e.charCodeAt(i)&&(t[n++]=i);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let n=0,i=t.length-1;if(-1===i)return 0;if(e<=t[0])return 0;for(;n<i;){const o=n+((i-n)/2>>0);t[o]>=e?i=o-1:t[o+1]>=e?(n=o,i=o):n=o+1}return n+1}}class TextModelSearch{static findMatches(e,t,n,i,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,n,new Searcher(r.wordSeparators,r.regex),i,o):this._doFindMatchesLineByLine(e,n,r,i,o):[]}static _getMultilineMatchRange(e,t,n,i,o,r){let s,a,l=0;if(i?(l=i.findLineFeedCountBeforeOffset(o),s=t+o+l):s=t+o,i){const e=i.findLineFeedCountBeforeOffset(o+r.length)-l;a=s+r.length+e}else a=s+r.length;const c=e.getPositionAt(s),d=e.getPositionAt(a);return new Range$2(c.lineNumber,c.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,n,i,o){const r=e.getOffsetAt(t.getStartPosition()),s=e.getValueInRange(t,1),a="\r\n"===e.getEOL()?new LineFeedCounter(s):null,l=[];let c,d=0;for(n.reset(0);c=n.next(s);)if(l[d++]=createFindMatch(this._getMultilineMatchRange(e,r,s,a,c.index,c[0]),c,i),d>=o)return l;return l}static _doFindMatchesLineByLine(e,t,n,i,o){const r=[];let s=0;if(t.startLineNumber===t.endLineNumber){const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return s=this._findMatchesInLine(n,a,t.startLineNumber,t.startColumn-1,s,r,i,o),r}const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);s=this._findMatchesInLine(n,a,t.startLineNumber,t.startColumn-1,s,r,i,o);for(let l=t.startLineNumber+1;l<t.endLineNumber&&s<o;l++)s=this._findMatchesInLine(n,e.getLineContent(l),l,0,s,r,i,o);if(s<o){const a=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);s=this._findMatchesInLine(n,a,t.endLineNumber,0,s,r,i,o)}return r}static _findMatchesInLine(e,t,n,i,o,r,s,a){const l=e.wordSeparators;if(!s&&e.simpleSearch){const s=e.simpleSearch,c=s.length,d=t.length;let u=-c;for(;-1!==(u=t.indexOf(s,u+c));)if((!l||isValidMatch(l,t,d,u,c))&&(r[o++]=new FindMatch(new Range$2(n,u+1+i,n,u+1+c+i),null),o>=a))return o;return o}const c=new Searcher(e.wordSeparators,e.regex);let d;c.reset(0);do{if(d=c.next(t),d&&(r[o++]=createFindMatch(new Range$2(n,d.index+1+i,n,d.index+1+d[0].length+i),d,s),o>=a))return o}while(d);return o}static findNextMatch(e,t,n,i){const o=t.parseSearchRequest();if(!o)return null;const r=new Searcher(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,n,r,i):this._doFindNextMatchLineByLine(e,n,r,i)}static _doFindNextMatchMultiline(e,t,n,i){const o=new Position$1(t.lineNumber,1),r=e.getOffsetAt(o),s=e.getLineCount(),a=e.getValueInRange(new Range$2(o.lineNumber,o.column,s,e.getLineMaxColumn(s)),1),l="\r\n"===e.getEOL()?new LineFeedCounter(a):null;n.reset(t.column-1);let c=n.next(a);return c?createFindMatch(this._getMultilineMatchRange(e,r,a,l,c.index,c[0]),c,i):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new Position$1(1,1),n,i):null}static _doFindNextMatchLineByLine(e,t,n,i){const o=e.getLineCount(),r=t.lineNumber,s=e.getLineContent(r),a=this._findFirstMatchInLine(n,s,r,t.column,i);if(a)return a;for(let l=1;l<=o;l++){const t=(r+l-1)%o,s=e.getLineContent(t+1),a=this._findFirstMatchInLine(n,s,t+1,1,i);if(a)return a}return null}static _findFirstMatchInLine(e,t,n,i,o){e.reset(i-1);const r=e.next(t);return r?createFindMatch(new Range$2(n,r.index+1,n,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,n,i){const o=t.parseSearchRequest();if(!o)return null;const r=new Searcher(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,n,r,i):this._doFindPreviousMatchLineByLine(e,n,r,i)}static _doFindPreviousMatchMultiline(e,t,n,i){const o=this._doFindMatchesMultiline(e,new Range$2(1,1,t.lineNumber,t.column),n,i,10*LIMIT_FIND_COUNT$1);if(o.length>0)return o[o.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new Position$1(r,e.getLineMaxColumn(r)),n,i):null}static _doFindPreviousMatchLineByLine(e,t,n,i){const o=e.getLineCount(),r=t.lineNumber,s=e.getLineContent(r).substring(0,t.column-1),a=this._findLastMatchInLine(n,s,r,i);if(a)return a;for(let l=1;l<=o;l++){const t=(o+r-l-1)%o,s=e.getLineContent(t+1),a=this._findLastMatchInLine(n,s,t+1,i);if(a)return a}return null}static _findLastMatchInLine(e,t,n,i){let o,r=null;for(e.reset(0);o=e.next(t);)r=createFindMatch(new Range$2(n,o.index+1,n,o.index+1+o[0].length),o,i);return r}}function leftIsWordBounday(e,t,n,i,o){if(0===i)return!0;const r=t.charCodeAt(i-1);if(0!==e.get(r))return!0;if(13===r||10===r)return!0;if(o>0){const n=t.charCodeAt(i);if(0!==e.get(n))return!0}return!1}function rightIsWordBounday(e,t,n,i,o){if(i+o===n)return!0;const r=t.charCodeAt(i+o);if(0!==e.get(r))return!0;if(13===r||10===r)return!0;if(o>0){const n=t.charCodeAt(i+o-1);if(0!==e.get(n))return!0}return!1}function isValidMatch(e,t,n,i,o){return leftIsWordBounday(e,t,n,i,o)&&rightIsWordBounday(e,t,n,i,o)}class Searcher{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let n;do{if(this._prevMatchStartIndex+this._prevMatchLength===t)return null;if(n=this._searchRegex.exec(e),!n)return null;const i=n.index,o=n[0].length;if(i===this._prevMatchStartIndex&&o===this._prevMatchLength){if(0===o){getNextCodePoint(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=i,this._prevMatchLength=o,!this._wordSeparators||isValidMatch(this._wordSeparators,e,t,i,o))return n}while(n);return null}}const AverageBufferSize=65535;function createUintArray(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}class LineStarts{constructor(e,t,n,i,o){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=i,this.isBasicASCII=o}}function createLineStartsFast(e,t=!0){const n=[0];let i=1;for(let o=0,r=e.length;o<r;o++){const t=e.charCodeAt(o);13===t?o+1<r&&10===e.charCodeAt(o+1)?(n[i++]=o+2,o++):n[i++]=o+1:10===t&&(n[i++]=o+1)}return t?createUintArray(n):n}function createLineStarts(e,t){e.length=0,e[0]=0;let n=1,i=0,o=0,r=0,s=!0;for(let l=0,c=t.length;l<c;l++){const a=t.charCodeAt(l);13===a?l+1<c&&10===t.charCodeAt(l+1)?(r++,e[n++]=l+2,l++):(i++,e[n++]=l+1):10===a?(o++,e[n++]=l+1):s&&9!==a&&(a<32||a>126)&&(s=!1)}const a=new LineStarts(createUintArray(e),i,o,r,s);return e.length=0,a}class Piece{constructor(e,t,n,i,o){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=i,this.length=o}}class StringBuffer{constructor(e,t){this.buffer=e,this.lineStarts=t}}class PieceTreeSnapshot{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==SENTINEL&&e.iterate(e.root,(e=>(e!==SENTINEL&&this._pieces.push(e.piece),!0)))}read(){return 0===this._pieces.length?0===this._index?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:0===this._index?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class PieceTreeSearchCache{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber<e&&n.nodeStartLineNumber+n.node.piece.lineFeedCnt>=e)return n}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const n=this._cache;for(let i=0;i<n.length;i++){const o=n[i];(null===o.node.parent||o.nodeStartOffset>=e)&&(n[i]=null,t=!0)}if(t){const e=[];for(const t of n)null!==t&&e.push(t);this._cache=e}}}class PieceTreeBase{constructor(e,t,n){this.create(e,t,n)}create(e,t,n){this._buffers=[new StringBuffer("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=SENTINEL,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=n;let i=null;for(let o=0,r=e.length;o<r;o++)if(e[o].buffer.length>0){e[o].lineStarts||(e[o].lineStarts=createLineStartsFast(e[o].buffer));const t=new Piece(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),i=this.rbInsertRight(i,t)}this._searchCache=new PieceTreeSearchCache(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=AverageBufferSize,n=t-Math.floor(t/3),i=2*n;let o="",r=0;const s=[];if(this.iterate(this.root,(t=>{const a=this.getNodeContent(t),l=a.length;if(r<=n||r+l<i)return o+=a,r+=l,!0;const c=o.replace(/\r\n|\r|\n/g,e);return s.push(new StringBuffer(c,createLineStartsFast(c))),o=a,r=l,!0})),r>0){const t=o.replace(/\r\n|\r|\n/g,e);s.push(new StringBuffer(t,createLineStartsFast(t)))}this.create(s,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new PieceTreeSnapshot(this,e)}getOffsetAt(e,t){let n=0,i=this.root;for(;i!==SENTINEL;)if(i.left!==SENTINEL&&i.lf_left+1>=e)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt+1>=e){n+=i.size_left;return n+(this.getAccumulatedValue(i,e-i.lf_left-2)+t-1)}e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right}return n}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,n=0;const i=e;for(;t!==SENTINEL;)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+o.index,0===o.index){const e=this.getOffsetAt(n+1,1);return new Position$1(n+1,i-e+1)}return new Position$1(n+1,o.remainder+1)}if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===SENTINEL){const t=this.getOffsetAt(n+1,1);return new Position$1(n+1,i-e-t+1)}t=t.right}return new Position$1(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const n=this.nodeAt2(e.startLineNumber,e.startColumn),i=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(n,i);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const n=e.node,i=this._buffers[n.piece.bufferIndex].buffer,o=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return i.substring(o+e.remainder,o+t.remainder)}let n=e.node;const i=this._buffers[n.piece.bufferIndex].buffer,o=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);let r=i.substring(o+e.remainder,o+n.piece.length);for(n=n.next();n!==SENTINEL;){const e=this._buffers[n.piece.bufferIndex].buffer,i=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(n===t.node){r+=e.substring(i,i+t.remainder);break}r+=e.substr(i,n.piece.length),n=n.next()}return r}getLinesContent(){const e=[];let t=0,n="",i=!1;return this.iterate(this.root,(o=>{if(o===SENTINEL)return!0;const r=o.piece;let s=r.length;if(0===s)return!0;const a=this._buffers[r.bufferIndex].buffer,l=this._buffers[r.bufferIndex].lineStarts,c=r.start.line,d=r.end.line;let u=l[c]+r.start.column;if(i&&(10===a.charCodeAt(u)&&(u++,s--),e[t++]=n,n="",i=!1,0===s))return!0;if(c===d)return this._EOLNormalized||13!==a.charCodeAt(u+s-1)?n+=a.substr(u,s):(i=!0,n+=a.substr(u,s-1)),!0;n+=this._EOLNormalized?a.substring(u,Math.max(u,l[c+1]-this._EOLLength)):a.substring(u,l[c+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=n;for(let i=c+1;i<d;i++)n=this._EOLNormalized?a.substring(l[i],l[i+1]-this._EOLLength):a.substring(l[i],l[i+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=n;return this._EOLNormalized||13!==a.charCodeAt(l[d]+r.end.column-1)?n=a.substr(l[d],r.end.column):(i=!0,0===r.end.column?t--:n=a.substr(l[d],r.end.column-1)),!0})),i&&(e[t++]=n,n=""),e[t++]=n,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e||(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,"")),this._lastVisitedLine.value}_getCharCode(e){if(e.remainder===e.node.piece.length){const t=e.node.next();if(!t)return 0;const n=this._buffers[t.piece.bufferIndex],i=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return n.buffer.charCodeAt(i)}{const t=this._buffers[e.node.piece.bufferIndex],n=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(n)}}getLineCharCode(e,t){const n=this.nodeAt2(e,t+1);return this._getCharCode(n)}getLineLength(e){if(e===this.getLineCount()){const t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}findMatchesInNode(e,t,n,i,o,r,s,a,l,c,d){const u=this._buffers[e.piece.bufferIndex],h=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),g=this.offsetInBuffer(e.piece.bufferIndex,o),p=this.offsetInBuffer(e.piece.bufferIndex,r);let f;const m={line:0,column:0};let v,_;t._wordSeparators?(v=u.buffer.substring(g,p),_=e=>e+g,t.reset(0)):(v=u.buffer,_=e=>e,t.reset(g));do{if(f=t.next(v),f){if(_(f.index)>=p)return c;this.positionInBuffer(e,_(f.index)-h,m);const t=this.getLineFeedCnt(e.piece.bufferIndex,o,m),r=m.line===o.line?m.column-o.column+i:m.column+1,s=r+f[0].length;if(d[c++]=createFindMatch(new Range$2(n+t,r,n+t,s),f,a),_(f.index)+f[0].length>=p)return c;if(c>=l)return c}}while(f);return c}findMatchesLineByLine(e,t,n,i){const o=[];let r=0;const s=new Searcher(t.wordSeparators,t.regex);let a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];const l=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===l)return[];let c=this.positionInBuffer(a.node,a.remainder);const d=this.positionInBuffer(l.node,l.remainder);if(a.node===l.node)return this.findMatchesInNode(a.node,s,e.startLineNumber,e.startColumn,c,d,t,n,i,r,o),o;let u=e.startLineNumber,h=a.node;for(;h!==l.node;){const l=this.getLineFeedCnt(h.piece.bufferIndex,c,h.piece.end);if(l>=1){const a=this._buffers[h.piece.bufferIndex].lineStarts,d=this.offsetInBuffer(h.piece.bufferIndex,h.piece.start),g=a[c.line+l],p=u===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(h,s,u,p,c,this.positionInBuffer(h,g-d),t,n,i,r,o),r>=i)return o;u+=l}const d=u===e.startLineNumber?e.startColumn-1:0;if(u===e.endLineNumber){const a=this.getLineContent(u).substring(d,e.endColumn-1);return r=this._findMatchesInLine(t,s,a,e.endLineNumber,d,r,o,n,i),o}if(r=this._findMatchesInLine(t,s,this.getLineContent(u).substr(d),u,d,r,o,n,i),r>=i)return o;u++,a=this.nodeAt2(u,1),h=a.node,c=this.positionInBuffer(a.node,a.remainder)}if(u===e.endLineNumber){const a=u===e.startLineNumber?e.startColumn-1:0,l=this.getLineContent(u).substring(a,e.endColumn-1);return r=this._findMatchesInLine(t,s,l,e.endLineNumber,a,r,o,n,i),o}const g=u===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(l.node,s,u,g,c,d,t,n,i,r,o),o}_findMatchesInLine(e,t,n,i,o,r,s,a,l){const c=e.wordSeparators;if(!a&&e.simpleSearch){const t=e.simpleSearch,a=t.length,d=n.length;let u=-a;for(;-1!==(u=n.indexOf(t,u+a));)if((!c||isValidMatch(c,n,d,u,a))&&(s[r++]=new FindMatch(new Range$2(i,u+1+o,i,u+1+a+o),null),r>=l))return r;return r}let d;t.reset(0);do{if(d=t.next(n),d&&(s[r++]=createFindMatch(new Range$2(i,d.index+1+o,i,d.index+1+d[0].length+o),d,a),r>=l))return r}while(d);return r}insert(e,t,n=!1){if(this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==SENTINEL){const{node:n,remainder:i,nodeStartOffset:o}=this.nodeAt(e),r=n.piece,s=r.bufferIndex,a=this.positionInBuffer(n,i);if(0===n.piece.bufferIndex&&r.end.line===this._lastChangeBufferPos.line&&r.end.column===this._lastChangeBufferPos.column&&o+r.length===e&&t.length<AverageBufferSize)return this.appendToNode(n,t),void this.computeBufferMetadata();if(o===e)this.insertContentToNodeLeft(t,n),this._searchCache.validate(e);else if(o+n.piece.length>e){const e=[];let o=new Piece(r.bufferIndex,a,r.end,this.getLineFeedCnt(r.bufferIndex,a,r.end),this.offsetInBuffer(s,r.end)-this.offsetInBuffer(s,a));if(this.shouldCheckCRLF()&&this.endWithCR(t)){if(10===this.nodeCharCodeAt(n,i)){const e={line:o.start.line+1,column:0};o=new Piece(o.bufferIndex,e,o.end,this.getLineFeedCnt(o.bufferIndex,e,o.end),o.length-1),t+="\n"}}if(this.shouldCheckCRLF()&&this.startWithLF(t)){if(13===this.nodeCharCodeAt(n,i-1)){const o=this.positionInBuffer(n,i-1);this.deleteNodeTail(n,o),t="\r"+t,0===n.piece.length&&e.push(n)}else this.deleteNodeTail(n,a)}else this.deleteNodeTail(n,a);const l=this.createNewPieces(t);o.length>0&&this.rbInsertRight(n,o);let c=n;for(let t=0;t<l.length;t++)c=this.rbInsertRight(c,l[t]);this.deleteNodes(e)}else this.insertContentToNodeRight(t,n)}else{const e=this.createNewPieces(t);let n=this.rbInsertLeft(null,e[0]);for(let t=1;t<e.length;t++)n=this.rbInsertRight(n,e[t])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===SENTINEL)return;const n=this.nodeAt(e),i=this.nodeAt(e+t),o=n.node,r=i.node;if(o===r){const r=this.positionInBuffer(o,n.remainder),s=this.positionInBuffer(o,i.remainder);if(n.nodeStartOffset===e){if(t===o.piece.length){const e=o.next();return rbDelete(this,o),this.validateCRLFWithPrevNode(e),void this.computeBufferMetadata()}return this.deleteNodeHead(o,s),this._searchCache.validate(e),this.validateCRLFWithPrevNode(o),void this.computeBufferMetadata()}return n.nodeStartOffset+o.piece.length===e+t?(this.deleteNodeTail(o,r),this.validateCRLFWithNextNode(o),void this.computeBufferMetadata()):(this.shrinkNode(o,r,s),void this.computeBufferMetadata())}const s=[],a=this.positionInBuffer(o,n.remainder);this.deleteNodeTail(o,a),this._searchCache.validate(e),0===o.piece.length&&s.push(o);const l=this.positionInBuffer(r,i.remainder);this.deleteNodeHead(r,l),0===r.piece.length&&s.push(r);for(let d=o.next();d!==SENTINEL&&d!==r;d=d.next())s.push(d);const c=0===o.piece.length?o.prev():o;this.deleteNodes(s),this.validateCRLFWithNextNode(c),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const n=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const i=t.piece,o={line:i.start.line+1,column:0},r=new Piece(i.bufferIndex,o,i.end,this.getLineFeedCnt(i.bufferIndex,o,i.end),i.length-1);t.piece=r,e+="\n",updateTreeMetadata(this,t,-1,-1),0===t.piece.length&&n.push(t)}const i=this.createNewPieces(e);let o=this.rbInsertLeft(t,i[i.length-1]);for(let r=i.length-2;r>=0;r--)o=this.rbInsertLeft(o,i[r]);this.validateCRLFWithPrevNode(o),this.deleteNodes(n)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");const n=this.createNewPieces(e),i=this.rbInsertRight(t,n[0]);let o=i;for(let r=1;r<n.length;r++)o=this.rbInsertRight(o,n[r]);this.validateCRLFWithPrevNode(i)}positionInBuffer(e,t,n){const i=e.piece,o=e.piece.bufferIndex,r=this._buffers[o].lineStarts,s=r[i.start.line]+i.start.column+t;let a=i.start.line,l=i.end.line,c=0,d=0,u=0;for(;a<=l&&(c=a+(l-a)/2|0,u=r[c],c!==l);)if(d=r[c+1],s<u)l=c-1;else{if(!(s>=d))break;a=c+1}return n?(n.line=c,n.column=s-u,null):{line:c,column:s-u}}getLineFeedCnt(e,t,n){if(0===n.column)return n.line-t.line;const i=this._buffers[e].lineStarts;if(n.line===i.length-1)return n.line-t.line;const o=i[n.line+1],r=i[n.line]+n.column;if(o>r+1)return n.line-t.line;const s=r-1;return 13===this._buffers[e].buffer.charCodeAt(s)?n.line-t.line+1:n.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)rbDelete(this,e[t])}createNewPieces(e){if(e.length>AverageBufferSize){const t=[];for(;e.length>AverageBufferSize;){const n=e.charCodeAt(AverageBufferSize-1);let i;13===n||n>=55296&&n<=56319?(i=e.substring(0,AverageBufferSize-1),e=e.substring(AverageBufferSize-1)):(i=e.substring(0,AverageBufferSize),e=e.substring(AverageBufferSize));const o=createLineStartsFast(i);t.push(new Piece(this._buffers.length,{line:0,column:0},{line:o.length-1,column:i.length-o[o.length-1]},o.length-1,i.length)),this._buffers.push(new StringBuffer(i,o))}const n=createLineStartsFast(e);return t.push(new Piece(this._buffers.length,{line:0,column:0},{line:n.length-1,column:e.length-n[n.length-1]},n.length-1,e.length)),this._buffers.push(new StringBuffer(e,n)),t}let t=this._buffers[0].buffer.length;const n=createLineStartsFast(e,!1);let i=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&0!==t&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},i=this._lastChangeBufferPos;for(let e=0;e<n.length;e++)n[e]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(n.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(0!==t)for(let e=0;e<n.length;e++)n[e]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(n.slice(1)),this._buffers[0].buffer+=e}const o=this._buffers[0].buffer.length,r=this._buffers[0].lineStarts.length-1,s={line:r,column:o-this._buffers[0].lineStarts[r]},a=new Piece(0,i,s,this.getLineFeedCnt(0,i,s),o-t);return this._lastChangeBufferPos=s,[a]}getLineRawContent(e,t=0){let n=this.root,i="";const o=this._searchCache.get2(e);if(o){n=o.node;const r=this.getAccumulatedValue(n,e-o.nodeStartLineNumber-1),s=this._buffers[n.piece.bufferIndex].buffer,a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(o.nodeStartLineNumber+n.piece.lineFeedCnt!==e){const i=this.getAccumulatedValue(n,e-o.nodeStartLineNumber);return s.substring(a+r,a+i-t)}i=s.substring(a+r,a+n.piece.length)}else{let o=0;const r=e;for(;n!==SENTINEL;)if(n.left!==SENTINEL&&n.lf_left>=e-1)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt>e-1){const i=this.getAccumulatedValue(n,e-n.lf_left-2),s=this.getAccumulatedValue(n,e-n.lf_left-1),a=this._buffers[n.piece.bufferIndex].buffer,l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return o+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:o,nodeStartLineNumber:r-(e-1-n.lf_left)}),a.substring(l+i,l+s-t)}if(n.lf_left+n.piece.lineFeedCnt===e-1){const t=this.getAccumulatedValue(n,e-n.lf_left-2),o=this._buffers[n.piece.bufferIndex].buffer,r=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);i=o.substring(r+t,r+n.piece.length);break}e-=n.lf_left+n.piece.lineFeedCnt,o+=n.size_left+n.piece.length,n=n.right}}for(n=n.next();n!==SENTINEL;){const e=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(n,0),r=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return i+=e.substring(r,r+o-t),i}{const t=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);i+=e.substr(t,n.piece.length)}n=n.next()}return i}computeBufferMetadata(){let e=this.root,t=1,n=0;for(;e!==SENTINEL;)t+=e.lf_left+e.piece.lineFeedCnt,n+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=n,this._searchCache.validate(this._length)}getIndexOf(e,t){const n=e.piece,i=this.positionInBuffer(e,t),o=i.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){const t=this.getLineFeedCnt(e.piece.bufferIndex,n.start,i);if(t!==o)return{index:t,remainder:0}}return{index:o,remainder:i.column}}getAccumulatedValue(e,t){if(t<0)return 0;const n=e.piece,i=this._buffers[n.bufferIndex].lineStarts,o=n.start.line+t+1;return o>n.end.line?i[n.end.line]+n.end.column-i[n.start.line]-n.start.column:i[o]-i[n.start.line]-n.start.column}deleteNodeTail(e,t){const n=e.piece,i=n.lineFeedCnt,o=this.offsetInBuffer(n.bufferIndex,n.end),r=t,s=this.offsetInBuffer(n.bufferIndex,r),a=this.getLineFeedCnt(n.bufferIndex,n.start,r),l=a-i,c=s-o,d=n.length+c;e.piece=new Piece(n.bufferIndex,n.start,r,a,d),updateTreeMetadata(this,e,c,l)}deleteNodeHead(e,t){const n=e.piece,i=n.lineFeedCnt,o=this.offsetInBuffer(n.bufferIndex,n.start),r=t,s=this.getLineFeedCnt(n.bufferIndex,r,n.end),a=s-i,l=o-this.offsetInBuffer(n.bufferIndex,r),c=n.length+l;e.piece=new Piece(n.bufferIndex,r,n.end,s,c),updateTreeMetadata(this,e,l,a)}shrinkNode(e,t,n){const i=e.piece,o=i.start,r=i.end,s=i.length,a=i.lineFeedCnt,l=t,c=this.getLineFeedCnt(i.bufferIndex,i.start,l),d=this.offsetInBuffer(i.bufferIndex,t)-this.offsetInBuffer(i.bufferIndex,o);e.piece=new Piece(i.bufferIndex,i.start,l,c,d),updateTreeMetadata(this,e,d-s,c-a);const u=new Piece(i.bufferIndex,n,r,this.getLineFeedCnt(i.bufferIndex,n,r),this.offsetInBuffer(i.bufferIndex,r)-this.offsetInBuffer(i.bufferIndex,n)),h=this.rbInsertRight(e,u);this.validateCRLFWithPrevNode(h)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");const n=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),i=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=createLineStartsFast(t,!1);for(let u=0;u<o.length;u++)o[u]+=i;if(n){const e=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:i-e}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(o.slice(1));const r=this._buffers[0].lineStarts.length-1,s={line:r,column:this._buffers[0].buffer.length-this._buffers[0].lineStarts[r]},a=e.piece.length+t.length,l=e.piece.lineFeedCnt,c=this.getLineFeedCnt(0,e.piece.start,s),d=c-l;e.piece=new Piece(e.piece.bufferIndex,e.piece.start,s,c,a),this._lastChangeBufferPos=s,updateTreeMetadata(this,e,t.length,d)}nodeAt(e){let t=this.root;const n=this._searchCache.get(e);if(n)return{node:n.node,nodeStartOffset:n.nodeStartOffset,remainder:e-n.nodeStartOffset};let i=0;for(;t!==SENTINEL;)if(t.size_left>e)t=t.left;else{if(t.size_left+t.piece.length>=e){i+=t.size_left;const n={node:t,remainder:e-t.size_left,nodeStartOffset:i};return this._searchCache.set(n),n}e-=t.size_left+t.piece.length,i+=t.size_left+t.piece.length,t=t.right}return null}nodeAt2(e,t){let n=this.root,i=0;for(;n!==SENTINEL;)if(n.left!==SENTINEL&&n.lf_left>=e-1)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(n,e-n.lf_left-2),r=this.getAccumulatedValue(n,e-n.lf_left-1);return i+=n.size_left,{node:n,remainder:Math.min(o+t-1,r),nodeStartOffset:i}}if(n.lf_left+n.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(n,e-n.lf_left-2);if(o+t-1<=n.piece.length)return{node:n,remainder:o+t-1,nodeStartOffset:i};t-=n.piece.length-o;break}e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==SENTINEL;){if(n.piece.lineFeedCnt>0){const e=this.getAccumulatedValue(n,0),i=this.offsetOfNode(n);return{node:n,remainder:Math.min(t-1,e),nodeStartOffset:i}}if(n.piece.length>=t-1){return{node:n,remainder:t-1,nodeStartOffset:this.offsetOfNode(n)}}t-=n.piece.length,n=n.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const n=this._buffers[e.piece.bufferIndex],i=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return n.buffer.charCodeAt(i)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&"\n"===this._EOL)}startWithLF(e){if("string"==typeof e)return 10===e.charCodeAt(0);if(e===SENTINEL||0===e.piece.lineFeedCnt)return!1;const t=e.piece,n=this._buffers[t.bufferIndex].lineStarts,i=t.start.line,o=n[i]+t.start.column;if(i===n.length-1)return!1;return!(n[i+1]>o+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(o)}endWithCR(e){return"string"==typeof e?13===e.charCodeAt(e.length-1):e!==SENTINEL&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const n=[],i=this._buffers[e.piece.bufferIndex].lineStarts;let o;o=0===e.piece.end.column?{line:e.piece.end.line-1,column:i[e.piece.end.line]-i[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,s=e.piece.lineFeedCnt-1;e.piece=new Piece(e.piece.bufferIndex,e.piece.start,o,s,r),updateTreeMetadata(this,e,-1,-1),0===e.piece.length&&n.push(e);const a={line:t.piece.start.line+1,column:0},l=t.piece.length-1,c=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new Piece(t.piece.bufferIndex,a,t.piece.end,c,l),updateTreeMetadata(this,t,-1,-1),0===t.piece.length&&n.push(t);const d=this.createNewPieces("\r\n");this.rbInsertRight(e,d[0]);for(let u=0;u<n.length;u++)rbDelete(this,n[u])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const n=t.next();if(this.startWithLF(n)){if(e+="\n",1===n.piece.length)rbDelete(this,n);else{const e=n.piece,t={line:e.start.line+1,column:0},i=e.length-1,o=this.getLineFeedCnt(e.bufferIndex,t,e.end);n.piece=new Piece(e.bufferIndex,t,e.end,o,i),updateTreeMetadata(this,n,-1,-1)}return!0}}return!1}iterate(e,t){if(e===SENTINEL)return t(SENTINEL);const n=this.iterate(e.left,t);return n?t(e)&&this.iterate(e.right,t):n}getNodeContent(e){if(e===SENTINEL)return"";const t=this._buffers[e.piece.bufferIndex];let n;const i=e.piece,o=this.offsetInBuffer(i.bufferIndex,i.start),r=this.offsetInBuffer(i.bufferIndex,i.end);return n=t.buffer.substring(o,r),n}getPieceContent(e){const t=this._buffers[e.bufferIndex],n=this.offsetInBuffer(e.bufferIndex,e.start),i=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(n,i)}rbInsertRight(e,t){const n=new TreeNode(t,1);n.left=SENTINEL,n.right=SENTINEL,n.parent=SENTINEL,n.size_left=0,n.lf_left=0;if(this.root===SENTINEL)this.root=n,n.color=0;else if(e.right===SENTINEL)e.right=n,n.parent=e;else{const t=leftest(e.right);t.left=n,n.parent=t}return fixInsert(this,n),n}rbInsertLeft(e,t){const n=new TreeNode(t,1);if(n.left=SENTINEL,n.right=SENTINEL,n.parent=SENTINEL,n.size_left=0,n.lf_left=0,this.root===SENTINEL)this.root=n,n.color=0;else if(e.left===SENTINEL)e.left=n,n.parent=e;else{const t=righttest(e.left);t.right=n,n.parent=t}return fixInsert(this,n),n}}function countEOL(e){let t=0,n=0,i=0,o=0;for(let r=0,s=e.length;r<s;r++){const a=e.charCodeAt(r);13===a?(0===t&&(n=r),t++,r+1<s&&10===e.charCodeAt(r+1)?(o|=2,r++):o|=3,i=r+1):10===a&&(o|=1,0===t&&(n=r),t++,i=r+1)}return 0===t&&(n=e.length),[t,n,e.length-i,o]}class PieceTreeTextBuffer extends Disposable{constructor(e,t,n,i,o,r,s){super(),this._onDidChangeContent=this._register(new Emitter$1),this._BOM=t,this._mightContainNonBasicASCII=!r,this._mightContainRTL=i,this._mightContainUnusualLineTerminators=o,this._pieceTree=new PieceTreeBase(e,n,s)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const n=e+t,i=this.getPositionAt(e),o=this.getPositionAt(n);return new Range$2(i.lineNumber,i.column,o.lineNumber,o.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const n=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,n)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const n=this.getOffsetAt(e.startLineNumber,e.startColumn);return this.getOffsetAt(e.endLineNumber,e.endColumn)-n}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let n=0;const i=e.startLineNumber,o=e.endLineNumber;for(let t=i;t<=o;t++){const r=this.getLineContent(t),s=t===i?e.startColumn-1:0,a=t===o?e.endColumn-1:r.length;for(let e=s;e<a;e++)isHighSurrogate(r.charCodeAt(e))?(n+=1,e+=1):n+=1}return n+=this._getEndOfLine(t).length*(o-i),n}return this.getValueLengthInRange(e,t)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){const t=firstNonWhitespaceIndex(this.getLineContent(e));return-1===t?0:t+1}getLineLastNonWhitespaceColumn(e){const t=lastNonWhitespaceIndex(this.getLineContent(e));return-1===t?0:t+2}_getEndOfLine(e){switch(e){case 1:return"\n";case 2:return"\r\n";case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,n){let i=this._mightContainRTL,o=this._mightContainUnusualLineTerminators,r=this._mightContainNonBasicASCII,s=!0,a=[];for(let p=0;p<e.length;p++){const t=e[p];s&&t._isTracked&&(s=!1);const n=t.range;if(t.text){let e=!0;r||(e=!isBasicASCII(t.text),r=e),!i&&e&&(i=containsRTL(t.text)),!o&&e&&(o=containsUnusualLineTerminators(t.text))}let l="",c=0,d=0,u=0;if(t.text){let e;[c,d,u,e]=countEOL(t.text);const n=this.getEOL(),i="\r\n"===n?2:1;l=0===e||e===i?t.text:t.text.replace(/\r\n|\r|\n/g,n)}a[p]={sortIndex:p,identifier:t.identifier||null,range:n,rangeOffset:this.getOffsetAt(n.startLineNumber,n.startColumn),rangeLength:this.getValueLengthInRange(n),text:l,eolCount:c,firstLineLength:d,lastLineLength:u,forceMoveMarkers:Boolean(t.forceMoveMarkers),isAutoWhitespaceEdit:t.isAutoWhitespaceEdit||!1}}a.sort(PieceTreeTextBuffer._sortOpsAscending);let l=!1;for(let p=0,f=a.length-1;p<f;p++){const e=a[p].range.getEndPosition(),t=a[p+1].range.getStartPosition();if(t.isBeforeOrEqual(e)){if(t.isBefore(e))throw new Error("Overlapping ranges are not allowed!");l=!0}}s&&(a=this._reduceOperations(a));const c=n||t?PieceTreeTextBuffer._getInverseEditRanges(a):[],d=[];if(t)for(let p=0;p<a.length;p++){const e=a[p],t=c[p];if(e.isAutoWhitespaceEdit&&e.range.isEmpty())for(let n=t.startLineNumber;n<=t.endLineNumber;n++){let i="";n===t.startLineNumber&&(i=this.getLineContent(e.range.startLineNumber),-1!==firstNonWhitespaceIndex(i))||d.push({lineNumber:n,oldContent:i})}}let u=null;if(n){let e=0;u=[];for(let t=0;t<a.length;t++){const n=a[t],i=c[t],o=this.getValueInRange(n.range),r=n.rangeOffset+e;e+=n.text.length-o.length,u[t]={sortIndex:n.sortIndex,identifier:n.identifier,range:i,text:o,textChange:new TextChange(n.rangeOffset,o,r,n.text)}}l||u.sort(((e,t)=>e.sortIndex-t.sortIndex))}this._mightContainRTL=i,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=r;const h=this._doApplyEdits(a);let g=null;if(t&&d.length>0){d.sort(((e,t)=>t.lineNumber-e.lineNumber)),g=[];for(let e=0,t=d.length;e<t;e++){const t=d[e].lineNumber;if(e>0&&d[e-1].lineNumber===t)continue;const n=d[e].oldContent,i=this.getLineContent(t);0!==i.length&&i!==n&&-1===firstNonWhitespaceIndex(i)&&g.push(t)}}return this._onDidChangeContent.fire(),new ApplyEditsResult(u,h,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const n=e[0].range,i=e[e.length-1].range,o=new Range$2(n.startLineNumber,n.startColumn,i.endLineNumber,i.endColumn);let r=n.startLineNumber,s=n.startColumn;const a=[];for(let h=0,g=e.length;h<g;h++){const n=e[h],i=n.range;t=t||n.forceMoveMarkers,a.push(this.getValueInRange(new Range$2(r,s,i.startLineNumber,i.startColumn))),n.text.length>0&&a.push(n.text),r=i.endLineNumber,s=i.endColumn}const l=a.join(""),[c,d,u]=countEOL(l);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:l,eolCount:c,firstLineLength:d,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(PieceTreeTextBuffer._sortOpsDescending);const t=[];for(let n=0;n<e.length;n++){const i=e[n],o=i.range.startLineNumber,r=i.range.startColumn,s=i.range.endLineNumber,a=i.range.endColumn;if(o===s&&r===a&&0===i.text.length)continue;i.text?(this._pieceTree.delete(i.rangeOffset,i.rangeLength),this._pieceTree.insert(i.rangeOffset,i.text,!0)):this._pieceTree.delete(i.rangeOffset,i.rangeLength);const l=new Range$2(o,r,s,a);t.push({range:l,rangeLength:i.rangeLength,text:i.text,rangeOffset:i.rangeOffset,forceMoveMarkers:i.forceMoveMarkers})}return t}findMatchesLineByLine(e,t,n,i){return this._pieceTree.findMatchesLineByLine(e,t,n,i)}static _getInverseEditRanges(e){const t=[];let n=0,i=0,o=null;for(let r=0,s=e.length;r<s;r++){const s=e[r];let a,l,c;if(o?o.range.endLineNumber===s.range.startLineNumber?(a=n,l=i+(s.range.startColumn-o.range.endColumn)):(a=n+(s.range.startLineNumber-o.range.endLineNumber),l=s.range.startColumn):(a=s.range.startLineNumber,l=s.range.startColumn),s.text.length>0){const e=s.eolCount+1;c=1===e?new Range$2(a,l,a,l+s.firstLineLength):new Range$2(a,l,a+e-1,s.lastLineLength+1)}else c=new Range$2(a,l,a,l);n=c.endLineNumber,i=c.endColumn,t.push(c),o=s}return t}static _sortOpsAscending(e,t){const n=Range$2.compareRangesUsingEnds(e.range,t.range);return 0===n?e.sortIndex-t.sortIndex:n}static _sortOpsDescending(e,t){const n=Range$2.compareRangesUsingEnds(e.range,t.range);return 0===n?t.sortIndex-e.sortIndex:-n}}class PieceTreeTextBufferFactory{constructor(e,t,n,i,o,r,s,a,l){this._chunks=e,this._bom=t,this._cr=n,this._lf=i,this._crlf=o,this._containsRTL=r,this._containsUnusualLineTerminators=s,this._isBasicASCII=a,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":n>t/2?"\r\n":"\n"}create(e){const t=this._getEOL(e),n=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(let o=0,r=n.length;o<r;o++){const e=n[o].buffer.replace(/\r\n|\r|\n/g,t),i=createLineStartsFast(e);n[o]=new StringBuffer(e,i)}const i=new PieceTreeTextBuffer(n,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:i,disposable:i}}}class PieceTreeTextBufferBuilder{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(0===e.length)return;0===this.chunks.length&&startsWithUTF8BOM(e)&&(this.BOM=UTF8_BOM_CHARACTER,e=e.substr(1));const t=e.charCodeAt(e.length-1);13===t||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){(t||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=createLineStarts(this._tmpLineStarts,e);this.chunks.push(new StringBuffer(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),this.isBasicASCII||this.containsRTL||(this.containsRTL=containsRTL(e)),this.isBasicASCII||this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=containsUnusualLineTerminators(e))}finish(e=!0){return this._finish(),new PieceTreeTextBufferFactory(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=createLineStartsFast(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}}}class ContiguousMultilineTokens{constructor(e,t){this._startLineNumber=e,this._tokens=t}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class ContiguousMultilineTokensBuilder{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){const n=this._tokens[this._tokens.length-1];if(n.endLineNumber+1===e)return void n.appendLineTokens(t)}this._tokens.push(new ContiguousMultilineTokens(e,[t]))}finalize(){return this._tokens}}class ContiguousGrowingArray{constructor(e){this._default=e,this._store=[]}get(e){return e<this._store.length?this._store[e]:this._default}set(e,t){for(;e>=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}delete(e,t){0===t||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(0===t||e>=this._store.length)return;const n=[];for(let i=0;i<t;i++)n[i]=this._default;this._store=arrayInsert(this._store,e,n)}}class TokenizationStateStore{constructor(e,t){this.tokenizationSupport=e,this.initialState=t,this._lineBeginState=new ContiguousGrowingArray(null),this._lineNeedsTokenization=new ContiguousGrowingArray(!0),this._firstLineNeedsTokenization=0,this._lineBeginState.set(0,this.initialState)}get invalidLineStartIndex(){return this._firstLineNeedsTokenization}markMustBeTokenized(e){this._lineNeedsTokenization.set(e,!0),this._firstLineNeedsTokenization=Math.min(this._firstLineNeedsTokenization,e)}getBeginState(e){return this._lineBeginState.get(e)}setEndState(e,t,n){if(this._lineNeedsTokenization.set(t,!1),this._firstLineNeedsTokenization=t+1,t===e-1)return;const i=this._lineBeginState.get(t+1);if(null===i||!n.equals(i))return this._lineBeginState.set(t+1,n),void this.markMustBeTokenized(t+1);let o=t+1;for(;o<e&&!this._lineNeedsTokenization.get(o);)o++;this._firstLineNeedsTokenization=o}applyEdits(e,t){this.markMustBeTokenized(e.startLineNumber-1),this._lineBeginState.delete(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineNeedsTokenization.delete(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineBeginState.insert(e.startLineNumber,t),this._lineNeedsTokenization.insert(e.startLineNumber,t)}}class TextModelTokenization extends Disposable{constructor(e,t){super(),this._textModel=e,this._languageIdCodec=t,this._isScheduled=!1,this._isDisposed=!1,this._tokenizationStateStore=null,this._register(TokenizationRegistry.onDidChange((e=>{const t=this._textModel.getLanguageId();-1!==e.changedLanguages.indexOf(t)&&(this._resetTokenizationState(),this._textModel.clearTokens())}))),this._resetTokenizationState()}dispose(){this._isDisposed=!0,super.dispose()}handleDidChangeContent(e){if(e.isFlush)this._resetTokenizationState();else{if(this._tokenizationStateStore)for(let t=0,n=e.changes.length;t<n;t++){const n=e.changes[t],[i]=countEOL(n.text);this._tokenizationStateStore.applyEdits(n.range,i)}this._beginBackgroundTokenization()}}handleDidChangeAttached(){this._beginBackgroundTokenization()}handleDidChangeLanguage(e){this._resetTokenizationState(),this._textModel.clearTokens()}_resetTokenizationState(){const[e,t]=initializeTokenization(this._textModel);this._tokenizationStateStore=e&&t?new TokenizationStateStore(e,t):null,this._beginBackgroundTokenization()}_beginBackgroundTokenization(){!this._isScheduled&&this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._isScheduled=!0,runWhenIdle((e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)})))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),n=()=>{!this._isDisposed&&this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._backgroundTokenizeForAtLeast1ms(),Date.now()<t?setTimeout0(n):this._beginBackgroundTokenization())};n()}_backgroundTokenizeForAtLeast1ms(){const e=this._textModel.getLineCount(),t=new ContiguousMultilineTokensBuilder,n=StopWatch.create(!1);do{if(n.elapsed()>1)break;if(this._tokenizeOneInvalidLine(t)>=e)break}while(this._hasLinesToTokenize());this._textModel.setTokens(t.finalize(),!this._hasLinesToTokenize())}tokenizeViewport(e,t){const n=new ContiguousMultilineTokensBuilder;this._tokenizeViewport(n,e,t),this._textModel.setTokens(n.finalize(),!this._hasLinesToTokenize())}reset(){this._resetTokenizationState(),this._textModel.clearTokens()}forceTokenization(e){const t=new ContiguousMultilineTokensBuilder;this._updateTokensUntilLine(t,e),this._textModel.setTokens(t.finalize(),!this._hasLinesToTokenize())}getTokenTypeIfInsertingCharacter(e,t){if(!this._tokenizationStateStore)return 0;this.forceTokenization(e.lineNumber);const n=this._tokenizationStateStore.getBeginState(e.lineNumber-1);if(!n)return 0;const i=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),r=o.substring(0,e.column-1)+t+o.substring(e.column-1),s=safeTokenize(this._languageIdCodec,i,this._tokenizationStateStore.tokenizationSupport,r,!0,n),a=new LineTokens(s.tokens,r,this._languageIdCodec);if(0===a.getCount())return 0;const l=a.findTokenIndexAtOffset(e.column-1);return a.getStandardTokenType(l)}tokenizeLineWithEdit(e,t,n){const i=e.lineNumber,o=e.column;if(!this._tokenizationStateStore)return null;this.forceTokenization(i);const r=this._tokenizationStateStore.getBeginState(i-1);if(!r)return null;const s=this._textModel.getLineContent(i),a=s.substring(0,o-1)+n+s.substring(o-1+t),l=this._textModel.getLanguageIdAtPosition(i,0),c=safeTokenize(this._languageIdCodec,l,this._tokenizationStateStore.tokenizationSupport,a,!0,r);return new LineTokens(c.tokens,a,this._languageIdCodec)}isCheapToTokenize(e){if(!this._tokenizationStateStore)return!0;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return!(e>t)&&(e<t||this._textModel.getLineLength(e)<2048)}_hasLinesToTokenize(){return!!this._tokenizationStateStore&&this._tokenizationStateStore.invalidLineStartIndex<this._textModel.getLineCount()}_tokenizeOneInvalidLine(e){if(!this._tokenizationStateStore||!this._hasLinesToTokenize())return this._textModel.getLineCount()+1;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return this._updateTokensUntilLine(e,t),t}_updateTokensUntilLine(e,t){if(!this._tokenizationStateStore)return;const n=this._textModel.getLanguageId(),i=this._textModel.getLineCount(),o=t-1;for(let r=this._tokenizationStateStore.invalidLineStartIndex;r<=o;r++){const t=this._textModel.getLineContent(r+1),o=this._tokenizationStateStore.getBeginState(r),s=safeTokenize(this._languageIdCodec,n,this._tokenizationStateStore.tokenizationSupport,t,!0,o);e.add(r+1,s.tokens),this._tokenizationStateStore.setEndState(i,r,s.endState),r=this._tokenizationStateStore.invalidLineStartIndex-1}}_tokenizeViewport(e,t,n){if(!this._tokenizationStateStore)return;if(n<=this._tokenizationStateStore.invalidLineStartIndex)return;if(t<=this._tokenizationStateStore.invalidLineStartIndex)return void this._updateTokensUntilLine(e,n);let i=this._textModel.getLineFirstNonWhitespaceColumn(t);const o=[];let r=null;for(let l=t-1;i>1&&l>=1;l--){const e=this._textModel.getLineFirstNonWhitespaceColumn(l);if(0!==e&&e<i){if(r=this._tokenizationStateStore.getBeginState(l-1),r)break;o.push(this._textModel.getLineContent(l)),i=e}}r||(r=this._tokenizationStateStore.initialState);const s=this._textModel.getLanguageId();let a=r;for(let l=o.length-1;l>=0;l--){a=safeTokenize(this._languageIdCodec,s,this._tokenizationStateStore.tokenizationSupport,o[l],!1,a).endState}for(let l=t;l<=n;l++){const t=this._textModel.getLineContent(l),n=safeTokenize(this._languageIdCodec,s,this._tokenizationStateStore.tokenizationSupport,t,!0,a);e.add(l,n.tokens),this._tokenizationStateStore.markMustBeTokenized(l-1),a=n.endState}}}function initializeTokenization(e){if(e.isTooLargeForTokenization())return[null,null];const t=TokenizationRegistry.get(e.getLanguageId());if(!t)return[null,null];let n;try{n=t.getInitialState()}catch(e2){return onUnexpectedError(e2),[null,null]}return[t,n]}function safeTokenize(e,t,n,i,o,r){let s=null;if(n)try{s=n.tokenizeEncoded(i,o,r.clone())}catch(e2){onUnexpectedError(e2)}return s||(s=nullTokenizeEncoded(e.encodeLanguageId(t),r)),LineTokens.convertToEndOffset(s.tokens,i.length),s}const EMPTY_LINE_TOKENS=new Uint32Array(0).buffer;class ContiguousTokensEditing{static deleteBeginning(e,t){return null===e||e===EMPTY_LINE_TOKENS?e:ContiguousTokensEditing.delete(e,0,t)}static deleteEnding(e,t){if(null===e||e===EMPTY_LINE_TOKENS)return e;const n=toUint32Array(e),i=n[n.length-2];return ContiguousTokensEditing.delete(e,t,i)}static delete(e,t,n){if(null===e||e===EMPTY_LINE_TOKENS||t===n)return e;const i=toUint32Array(e),o=i.length>>>1;if(0===t&&i[i.length-2]===n)return EMPTY_LINE_TOKENS;const r=LineTokens.findIndexInTokensArray(i,t),s=r>0?i[r-1<<1]:0;if(n<i[r<<1]){const s=n-t;for(let e=r;e<o;e++)i[e<<1]-=s;return e}let a,l;s!==t?(i[r<<1]=t,a=r+1<<1,l=t):(a=r<<1,l=s);const c=n-t;for(let u=r+1;u<o;u++){const e=i[u<<1]-c;e>l&&(i[a++]=e,i[a++]=i[1+(u<<1)],l=e)}if(a===i.length)return e;const d=new Uint32Array(a);return d.set(i.subarray(0,a),0),d.buffer}static append(e,t){if(t===EMPTY_LINE_TOKENS)return e;if(e===EMPTY_LINE_TOKENS)return t;if(null===e)return e;if(null===t)return null;const n=toUint32Array(e),i=toUint32Array(t),o=i.length>>>1,r=new Uint32Array(n.length+i.length);r.set(n,0);let s=n.length;const a=n[n.length-2];for(let l=0;l<o;l++)r[s++]=i[l<<1]+a,r[s++]=i[1+(l<<1)];return r.buffer}static insert(e,t,n){if(null===e||e===EMPTY_LINE_TOKENS)return e;const i=toUint32Array(e),o=i.length>>>1;let r=LineTokens.findIndexInTokensArray(i,t);if(r>0){i[r-1<<1]===t&&r--}for(let s=r;s<o;s++)i[s<<1]+=n;return e}}function toUint32Array(e){return e instanceof Uint32Array?e:new Uint32Array(e)}class ContiguousTokensStore{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}getTokens(e,t,n){let i=null;if(t<this._len&&(i=this._lineTokens[t]),null!==i&&i!==EMPTY_LINE_TOKENS)return new LineTokens(toUint32Array(i),n,this._languageIdCodec);const o=new Uint32Array(2);return o[0]=n.length,o[1]=getDefaultMetadata(this._languageIdCodec.encodeLanguageId(e)),new LineTokens(o,n,this._languageIdCodec)}static _massageTokens(e,t,n){const i=n?toUint32Array(n):null;if(0===t){let t=!1;if(i&&i.length>1&&(t=TokenMetadata.getLanguageId(i[1])!==e),!t)return EMPTY_LINE_TOKENS}if(!i||0===i.length){const n=new Uint32Array(2);return n[0]=t,n[1]=getDefaultMetadata(e),n.buffer}return i[i.length-2]=t,0===i.byteOffset&&i.byteLength===i.buffer.byteLength?i.buffer:i}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(0===t)return;const n=[];for(let i=0;i<t;i++)n[i]=null;this._lineTokens=arrayInsert(this._lineTokens,e,n),this._len+=t}setTokens(e,t,n,i,o){const r=ContiguousTokensStore._massageTokens(this._languageIdCodec.encodeLanguageId(e),n,i);this._ensureLine(t);const s=this._lineTokens[t];return this._lineTokens[t]=r,!!o&&!ContiguousTokensStore._equals(s,r)}static _equals(e,t){if(!e||!t)return!e&&!t;const n=toUint32Array(e),i=toUint32Array(t);if(n.length!==i.length)return!1;for(let o=0,r=n.length;o<r;o++)if(n[o]!==i[o])return!1;return!0}acceptEdit(e,t,n){this._acceptDeleteRange(e),this._acceptInsertText(new Position$1(e.startLineNumber,e.startColumn),t,n)}_acceptDeleteRange(e){const t=e.startLineNumber-1;if(t>=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;return void(this._lineTokens[t]=ContiguousTokensEditing.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1))}this._lineTokens[t]=ContiguousTokensEditing.deleteEnding(this._lineTokens[t],e.startColumn-1);const n=e.endLineNumber-1;let i=null;n<this._len&&(i=ContiguousTokensEditing.deleteBeginning(this._lineTokens[n],e.endColumn-1)),this._lineTokens[t]=ContiguousTokensEditing.append(this._lineTokens[t],i),this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t,n){if(0===t&&0===n)return;const i=e.lineNumber-1;i>=this._len||(0!==t?(this._lineTokens[i]=ContiguousTokensEditing.deleteEnding(this._lineTokens[i],e.column-1),this._lineTokens[i]=ContiguousTokensEditing.insert(this._lineTokens[i],e.column-1,n),this._insertLines(e.lineNumber,t)):this._lineTokens[i]=ContiguousTokensEditing.insert(this._lineTokens[i],e.column-1,n))}}function getDefaultMetadata(e){return(16384|e<<0|2<<23)>>>0}class SparseTokensStore{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return 0===this._pieces.length}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let n=e;if(t.length>0){const i=t[0].getRange(),o=t[t.length-1].getRange();if(!i||!o)return e;n=e.plusRange(i).plusRange(o)}let i=null;for(let o=0,r=this._pieces.length;o<r;o++){const e=this._pieces[o];if(e.endLineNumber<n.startLineNumber)continue;if(e.startLineNumber>n.endLineNumber){i=i||{index:o};break}if(e.removeTokens(n),e.isEmpty()){this._pieces.splice(o,1),o--,r--;continue}if(e.endLineNumber<n.startLineNumber)continue;if(e.startLineNumber>n.endLineNumber){i=i||{index:o};continue}const[t,s]=e.split(n);t.isEmpty()?i=i||{index:o}:s.isEmpty()||(this._pieces.splice(o,1,t,s),o++,r++,i=i||{index:o})}return i=i||{index:this._pieces.length},t.length>0&&(this._pieces=arrayInsert(this._pieces,i.index,t)),n}isComplete(){return this._isComplete}addSparseTokens(e,t){const n=this._pieces;if(0===n.length)return t;const i=n[SparseTokensStore._findFirstPieceWithLine(n,e)].getLineTokens(e);if(!i)return t;const o=t.getCount(),r=i.getCount();let s=0;const a=[];let l=0,c=0;const d=(e,t)=>{e!==c&&(c=e,a[l++]=e,a[l++]=t)};for(let u=0;u<r;u++){const e=i.getStartCharacter(u),n=i.getEndCharacter(u),r=i.getMetadata(u),a=((1&r?1024:0)|(2&r?2048:0)|(4&r?4096:0)|(8&r?8192:0)|(16&r?8372224:0)|(32&r?4286578688:0))>>>0,l=~a>>>0;for(;s<o&&t.getEndOffset(s)<=e;)d(t.getEndOffset(s),t.getMetadata(s)),s++;for(s<o&&t.getStartOffset(s)<e&&d(e,t.getMetadata(s));s<o&&t.getEndOffset(s)<n;)d(t.getEndOffset(s),t.getMetadata(s)&l|r&a),s++;if(s<o)d(n,t.getMetadata(s)&l|r&a),t.getEndOffset(s)===n&&s++;else{const e=Math.min(Math.max(0,s-1),o-1);d(n,t.getMetadata(e)&l|r&a)}}for(;s<o;)d(t.getEndOffset(s),t.getMetadata(s)),s++;return new LineTokens(new Uint32Array(a),t.getLineContent(),this._languageIdCodec)}static _findFirstPieceWithLine(e,t){let n=0,i=e.length-1;for(;n<i;){let o=n+Math.floor((i-n)/2);if(e[o].endLineNumber<t)n=o+1;else{if(!(e[o].startLineNumber>t)){for(;o>n&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}i=o-1}}return n}acceptEdit(e,t,n,i,o){for(const r of this._pieces)r.acceptEdit(e,t,n,i,o)}}const IUndoRedoService=createDecorator("undoRedoService");class ResourceEditStackSnapshot{constructor(e,t){this.resource=e,this.elements=t}}class UndoRedoGroup{constructor(){this.id=UndoRedoGroup._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}UndoRedoGroup._ID=0,UndoRedoGroup.None=new UndoRedoGroup;class UndoRedoSource{constructor(){this.id=UndoRedoSource._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}UndoRedoSource._ID=0,UndoRedoSource.None=new UndoRedoSource;var __decorate$1w=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1r=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};function createTextBufferBuilder(){return new PieceTreeTextBufferBuilder}function createTextBufferFactory(e){const t=createTextBufferBuilder();return t.acceptChunk(e),t.finish()}function createTextBuffer(e,t){return("string"==typeof e?createTextBufferFactory(e):e).create(t)}let MODEL_ID$1=0;const LIMIT_FIND_COUNT=999,LONG_LINE_BOUNDARY=1e4;class TextModelSnapshot{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,n=0;for(;;){const i=this._source.read();if(null===i)return this._eos=!0,0===t?null:e.join("");if(i.length>0&&(e[t++]=i,n+=i.length),n>=65536)return e.join("")}}}const invalidFunc=()=>{throw new Error("Invalid change accessor")};let TextModel=class e extends Disposable{constructor(t,n,i,o=null,r,s,a){super(),this._undoRedoService=r,this._languageService=s,this._languageConfigurationService=a,this._onWillDispose=this._register(new Emitter$1),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new DidChangeDecorationsEmitter((e=>this.handleBeforeFireDecorationsChangedEvent(e)))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeLanguage=this._register(new Emitter$1),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new Emitter$1),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new Emitter$1),this.onDidChangeTokens=this._onDidChangeTokens.event,this._onDidChangeOptions=this._register(new Emitter$1),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new Emitter$1),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new Emitter$1),this._eventEmitter=this._register(new DidChangeContentEmitter),this._backgroundTokenizationState=0,this._onBackgroundTokenizationStateChanged=this._register(new Emitter$1),MODEL_ID$1++,this.id="$model"+MODEL_ID$1,this.isForSimpleWidget=i.isForSimpleWidget,this._associatedResource=null==o?URI.parse("inmemory://model/"+MODEL_ID$1):o,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=createTextBuffer(t,i.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=e.resolveOptions(this._buffer,i);const d=this._buffer.getLineCount(),u=this._buffer.getValueLengthInRange(new Range$2(1,1,d,this._buffer.getLineLength(d)+1),0);i.largeFileOptimizations?this._isTooLargeForTokenization=u>e.LARGE_FILE_SIZE_THRESHOLD||d>e.LARGE_FILE_LINE_COUNT_THRESHOLD:this._isTooLargeForTokenization=!1,this._isTooLargeForSyncing=u>e.MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this._isDisposing=!1,this._languageId=n,this._languageRegistryListener=this._languageConfigurationService.onDidChange((e=>{e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._instanceId=singleLetterHash(MODEL_ID$1),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new DecorationsTrees,this._commandManager=new EditStack(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._tokens=new ContiguousTokensStore(this._languageService.languageIdCodec),this._semanticTokens=new SparseTokensStore(this._languageService.languageIdCodec),this._tokenization=new TextModelTokenization(this,this._languageService.languageIdCodec),this._bracketPairColorizer=this._register(new BracketPairsTextModelPart(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new GuidesTextModelPart(this,this._languageConfigurationService)),this._decorationProvider=this._register(new ColorizedBracketPairsDecorationProvider(this)),this._register(this._decorationProvider.onDidChange((()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})))}static resolveOptions(e,t){if(t.detectIndentation){const n=guessIndentation(e,t.tabSize,t.insertSpaces);return new TextModelResolvedOptions({tabSize:n.tabSize,indentSize:n.tabSize,insertSpaces:n.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new TextModelResolvedOptions({tabSize:t.tabSize,indentSize:t.indentSize,insertSpaces:t.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}onDidChangeContent(e){return this._eventEmitter.slowEvent((t=>e(t.contentChangedEvent)))}onDidChangeContentOrInjectedText(e){return combinedDisposable(this._eventEmitter.fastEvent((t=>e(t.rawContentChangedEvent))),this._onDidChangeInjectedText.event((t=>e(t))))}get bracketPairs(){return this._bracketPairColorizer}get guides(){return this._guidesTextModelPart}get backgroundTokenizationState(){return this._backgroundTokenizationState}handleTokenizationProgress(e){if(2===this._backgroundTokenizationState)return;const t=e?2:1;this._backgroundTokenizationState!==t&&(this._backgroundTokenizationState=t,this._bracketPairColorizer.handleDidChangeBackgroundTokenizationState(),this._onBackgroundTokenizationStateChanged.fire())}dispose(){this._isDisposing=!0,this._onWillDispose.fire(),this._languageRegistryListener.dispose(),this._tokenization.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this._isDisposing=!1;const e=new PieceTreeTextBuffer([],"","\n",!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=Disposable.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this._isDisposing||(this._bracketPairColorizer.handleDidChangeContent(t),this._tokenization.handleDidChangeContent(t),this._eventEmitter.fire(new InternalModelContentChangeEvent(e,t)))}setValue(e){if(this._assertNotDisposed(),null===e)return;const{textBuffer:t,disposable:n}=createTextBuffer(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,n)}_createContentChanged2(e,t,n,i,o,r,s){return{changes:[{range:e,rangeOffset:t,rangeLength:n,text:i}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:s}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const n=this.getFullModelRange(),i=this.getValueLengthInRange(n),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._tokens.flush(),this._semanticTokens.flush(),this._decorations=Object.create(null),this._decorationsTree=new DecorationsTrees,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new ModelRawContentChangedEvent([new ModelRawFlush],this._versionId,!1,!1),this._createContentChanged2(new Range$2(1,1,o,r),0,i,this.getValue(),!1,!1,!0))}setEOL(e){this._assertNotDisposed();const t=1===e?"\r\n":"\n";if(this._buffer.getEOL()===t)return;const n=this.getFullModelRange(),i=this.getValueLengthInRange(n),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new ModelRawContentChangedEvent([new ModelRawEOLChanged],this._versionId,!1,!1),this._createContentChanged2(new Range$2(1,1,o,r),0,i,this.getValue(),!1,!1,!1))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let n=0,i=t.length;n<i;n++){const i=t[n],o=i.range,r=i.cachedAbsoluteStart-i.start,s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);i.cachedAbsoluteStart=s,i.cachedAbsoluteEnd=a,i.cachedVersionId=e,i.start=s-r,i.end=a-r,recomputeMaxEnd(i)}}onBeforeAttached(){this._attachedEditorCount++,1===this._attachedEditorCount&&(this._tokenization.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0))}onBeforeDetached(){this._attachedEditorCount--,0===this._attachedEditorCount&&(this._tokenization.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0))}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const n=this._buffer.getLineCount();for(let i=1;i<=n;i++){const n=this._buffer.getLineLength(i);n>=LONG_LINE_BOUNDARY?t+=n:e+=n}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=void 0!==e.tabSize?e.tabSize:this._options.tabSize,n=void 0!==e.indentSize?e.indentSize:this._options.indentSize,i=void 0!==e.insertSpaces?e.insertSpaces:this._options.insertSpaces,o=void 0!==e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=void 0!==e.bracketColorizationOptions?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,s=new TextModelResolvedOptions({tabSize:t,indentSize:n,insertSpaces:i,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:r});if(this._options.equals(s))return;const a=this._options.createChangeEvent(s);this._options=s,this._bracketPairColorizer.handleDidChangeOptions(a),this._decorationProvider.handleDidChangeOptions(a),this._onDidChangeOptions.fire(a)}detectIndentation(e,t){this._assertNotDisposed();const n=guessIndentation(this._buffer,t,e);this.updateOptions({insertSpaces:n.insertSpaces,tabSize:n.tabSize,indentSize:n.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),normalizeIndentation(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(UNUSUAL_LINE_TERMINATORS.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map((e=>({range:e.range,text:null}))),(()=>null))}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){this._assertNotDisposed();const n=this.getFullModelRange(),i=this.getValueInRange(n,e);return t?this._buffer.getBOM()+i:i}createSnapshot(e=!1){return new TextModelSnapshot(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const n=this.getFullModelRange(),i=this.getValueLengthInRange(n,e);return t?this._buffer.getBOM().length+i:i}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){return this._assertNotDisposed(),this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),"\n"===this._buffer.getEOL()?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),n=e.startLineNumber,i=e.startColumn;let o=Math.floor("number"!=typeof n||isNaN(n)?1:n),r=Math.floor("number"!=typeof i||isNaN(i)?1:i);if(o<1)o=1,r=1;else if(o>t)o=t,r=this.getLineMaxColumn(o);else if(r<=1)r=1;else{const e=this.getLineMaxColumn(o);r>=e&&(r=e)}const s=e.endLineNumber,a=e.endColumn;let l=Math.floor("number"!=typeof s||isNaN(s)?1:s),c=Math.floor("number"!=typeof a||isNaN(a)?1:a);if(l<1)l=1,c=1;else if(l>t)l=t,c=this.getLineMaxColumn(l);else if(c<=1)c=1;else{const e=this.getLineMaxColumn(l);c>=e&&(c=e)}return n===o&&i===r&&s===l&&a===c&&e instanceof Range$2&&!(e instanceof Selection$1)?e:new Range$2(o,r,l,c)}_isValidPosition(e,t,n){if("number"!=typeof e||"number"!=typeof t)return!1;if(isNaN(e)||isNaN(t))return!1;if(e<1||t<1)return!1;if((0|e)!==e||(0|t)!==t)return!1;if(e>this._buffer.getLineCount())return!1;if(1===t)return!0;if(t>this.getLineMaxColumn(e))return!1;if(1===n){if(isHighSurrogate(this._buffer.getLineCharCode(e,t-2)))return!1}return!0}_validatePosition(e,t,n){const i=Math.floor("number"!=typeof e||isNaN(e)?1:e),o=Math.floor("number"!=typeof t||isNaN(t)?1:t),r=this._buffer.getLineCount();if(i<1)return new Position$1(1,1);if(i>r)return new Position$1(r,this.getLineMaxColumn(r));if(o<=1)return new Position$1(i,1);const s=this.getLineMaxColumn(i);if(o>=s)return new Position$1(i,s);if(1===n){if(isHighSurrogate(this._buffer.getLineCharCode(i,o-2)))return new Position$1(i,o-1)}return new Position$1(i,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof Position$1&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const n=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(n,i,0))return!1;if(!this._isValidPosition(o,r,0))return!1;if(1===t){const e=i>1?this._buffer.getLineCharCode(n,i-2):0,t=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,s=isHighSurrogate(e),a=isHighSurrogate(t);return!s&&!a}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof Range$2&&!(e instanceof Selection$1)&&this._isValidRange(e,1))return e;const t=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),i=t.lineNumber,o=t.column,r=n.lineNumber,s=n.column;{const e=o>1?this._buffer.getLineCharCode(i,o-2):0,t=s>1&&s<=this._buffer.getLineLength(r)?this._buffer.getLineCharCode(r,s-2):0,n=isHighSurrogate(e),a=isHighSurrogate(t);return n||a?i===r&&o===s?new Range$2(i,o-1,r,s-1):n&&a?new Range$2(i,o-1,r,s+1):n?new Range$2(i,o-1,r,s):new Range$2(i,o,r,s+1):new Range$2(i,o,r,s)}}modifyPosition(e,t){this._assertNotDisposed();const n=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,n)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new Range$2(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,n,i){return this._buffer.findMatchesLineByLine(e,t,n,i)}findMatches(e,t,n,i,o,r,s=LIMIT_FIND_COUNT){this._assertNotDisposed();let a=null;null!==t&&(Array.isArray(t)||(t=[t]),t.every((e=>Range$2.isIRange(e)))&&(a=t.map((e=>this.validateRange(e))))),null===a&&(a=[this.getFullModelRange()]),a=a.sort(((e,t)=>e.startLineNumber-t.startLineNumber||e.startColumn-t.startColumn));const l=[];let c;if(l.push(a.reduce(((e,t)=>Range$2.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t)))),!n&&e.indexOf("\n")<0){const t=new SearchParams(e,n,i,o).parseSearchRequest();if(!t)return[];c=e=>this.findMatchesLineByLine(e,t,r,s)}else c=t=>TextModelSearch.findMatches(this,new SearchParams(e,n,i,o),t,r,s);return l.map(c).reduce(((e,t)=>e.concat(t)),[])}findNextMatch(e,t,n,i,o,r){this._assertNotDisposed();const s=this.validatePosition(t);if(!n&&e.indexOf("\n")<0){const t=new SearchParams(e,n,i,o).parseSearchRequest();if(!t)return null;const a=this.getLineCount();let l=new Range$2(s.lineNumber,s.column,a,this.getLineMaxColumn(a)),c=this.findMatchesLineByLine(l,t,r,1);return TextModelSearch.findNextMatch(this,new SearchParams(e,n,i,o),s,r),c.length>0?c[0]:(l=new Range$2(1,1,s.lineNumber,this.getLineMaxColumn(s.lineNumber)),c=this.findMatchesLineByLine(l,t,r,1),c.length>0?c[0]:null)}return TextModelSearch.findNextMatch(this,new SearchParams(e,n,i,o),s,r)}findPreviousMatch(e,t,n,i,o,r){this._assertNotDisposed();const s=this.validatePosition(t);return TextModelSearch.findPreviousMatch(this,new SearchParams(e,n,i,o),s,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if(("\n"===this.getEOL()?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof ValidAnnotatedEditOperation?e:new ValidAnnotatedEditOperation(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let n=0,i=e.length;n<i;n++)t[n]=this._validateEditOperation(e[n]);return t}pushEditOperations(e,t,n){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),n)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,n){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const n=t.map((e=>({range:this.validateRange(e.range),text:e.text})));let i=!0;if(e)for(let t=0,o=e.length;t<o;t++){const o=e[t];let r=!1;for(let e=0,t=n.length;e<t;e++){const t=n[e].range,i=t.startLineNumber>o.endLineNumber,s=o.startLineNumber>t.endLineNumber;if(!i&&!s){r=!0;break}}if(!r){i=!1;break}}if(i)for(let e=0,o=this._trimAutoWhitespaceLines.length;e<o;e++){const i=this._trimAutoWhitespaceLines[e],o=this.getLineMaxColumn(i);let r=!0;for(let e=0,t=n.length;e<t;e++){const t=n[e].range,s=n[e].text;if(!(i<t.startLineNumber||i>t.endLineNumber)&&!(i===t.startLineNumber&&t.startColumn===o&&t.isEmpty()&&s&&s.length>0&&"\n"===s.charAt(0)||i===t.startLineNumber&&1===t.startColumn&&t.isEmpty()&&s&&s.length>0&&"\n"===s.charAt(s.length-1))){r=!1;break}}if(r){const e=new Range$2(i,1,i,o);t.push(new ValidAnnotatedEditOperation(null,e,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,n)}_applyUndo(e,t,n,i){const o=e.map((e=>{const t=this.getPositionAt(e.newPosition),n=this.getPositionAt(e.newEnd);return{range:new Range$2(t.lineNumber,t.column,n.lineNumber,n.column),text:e.oldText}}));this._applyUndoRedoEdits(o,t,!0,!1,n,i)}_applyRedo(e,t,n,i){const o=e.map((e=>{const t=this.getPositionAt(e.oldPosition),n=this.getPositionAt(e.oldEnd);return{range:new Range$2(t.lineNumber,t.column,n.lineNumber,n.column),text:e.newText}}));this._applyUndoRedoEdits(o,t,!1,!0,n,i)}_applyUndoRedoEdits(e,t,n,i,o,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=n,this._isRedoing=i,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const n=this._validateEditOperations(e);return this._doApplyEdits(n,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const n=this._buffer.getLineCount(),i=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),r=i.changes;if(this._trimAutoWhitespaceLines=i.trimAutoWhitespaceLineNumbers,0!==r.length){for(let n=0,i=r.length;n<i;n++){const e=r[n],[t,i,o]=countEOL(e.text);this._tokens.acceptEdit(e.range,t,i),this._semanticTokens.acceptEdit(e.range,t,i,o,e.text.length>0?e.text.charCodeAt(0):0),this._decorationsTree.acceptReplace(e.rangeOffset,e.rangeLength,e.text.length,e.forceMoveMarkers)}const e=[];this._increaseVersionId();let t=n;for(let n=0,i=r.length;n<i;n++){const i=r[n],[s]=countEOL(i.text);this._onDidChangeDecorations.fire();const a=i.range.startLineNumber,l=i.range.endLineNumber,c=l-a,d=s,u=Math.min(c,d),h=d-c,g=o-t-h+a,p=g,f=g+d,m=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new Position$1(p,1)),this.getOffsetAt(new Position$1(f,this.getLineMaxColumn(f))),0),v=LineInjectedText.fromDecorations(m),_=new ArrayQueue(v);for(let t=u;t>=0;t--){const n=a+t,i=g+t;_.takeFromEndWhile((e=>e.lineNumber>i));const o=_.takeFromEndWhile((e=>e.lineNumber===i));e.push(new ModelRawLineChanged(n,this.getLineContent(i),o))}if(u<c){const t=a+u;e.push(new ModelRawLinesDeleted(t+1,l))}if(u<d){const n=new ArrayQueue(v),i=a+u,r=d-u,s=o-t-r+i+1,l=[],c=[];for(let e=0;e<r;e++){const t=s+e;c[e]=this.getLineContent(t),n.takeWhile((e=>e.lineNumber<t)),l[e]=n.takeWhile((e=>e.lineNumber===t))}e.push(new ModelRawLinesInserted(i+1,a+d,c,l))}t+=h}this._emitContentChangedEvent(new ModelRawContentChangedEvent(e,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return null===i.reverseEdits?void 0:i.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(null===e||0===e.size)return;const t=[...e].map((e=>new ModelRawLineChanged(e,this.getLineContent(e),this._getInjectedTextInLine(e))));this._onDidChangeInjectedText.fire(new ModelInjectedTextChangedEvent(t))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const n={addDecoration:(t,n)=>this._deltaDecorationsImpl(e,[],[{range:t,options:n}])[0],changeDecoration:(e,t)=>{this._changeDecorationImpl(e,t)},changeDecorationOptions:(e,t)=>{this._changeDecorationOptionsImpl(e,_normalizeOptions(t))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},deltaDecorations:(t,n)=>0===t.length&&0===n.length?[]:this._deltaDecorationsImpl(e,t,n)};let i=null;try{i=t(n)}catch(e2){onUnexpectedError(e2)}return n.addDecoration=invalidFunc,n.changeDecoration=invalidFunc,n.changeDecorationOptions=invalidFunc,n.removeDecoration=invalidFunc,n.deltaDecorations=invalidFunc,i}deltaDecorations(e,t,n=0){if(this._assertNotDisposed(),e||(e=[]),0===e.length&&0===t.length)return[];try{return this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(n,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,n){const i=e?this._decorations[e]:null;if(!i)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:TRACKED_RANGE_OPTIONS[n]}])[0]:null;if(!t)return this._decorationsTree.delete(i),delete this._decorations[i.id],null;const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),s=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(i),i.reset(this.getVersionId(),r,s,o),i.setOptions(TRACKED_RANGE_OPTIONS[n]),this._decorationsTree.insert(i),i.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let n=0,i=t.length;n<i;n++){const e=t[n];this._decorationsTree.delete(e),delete this._decorations[e.id]}}getDecorationOptions(e){const t=this._decorations[e];return t?t.options:null}getDecorationRange(e){const t=this._decorations[e];return t?this._decorationsTree.getNodeRange(this,t):null}getLineDecorations(e,t=0,n=!1){return e<1||e>this.getLineCount()?[]:this.getLinesDecorations(e,e,t,n)}getLinesDecorations(e,t,n=0,i=!1){const o=this.getLineCount(),r=Math.min(o,Math.max(1,e)),s=Math.min(o,Math.max(1,t)),a=this.getLineMaxColumn(s),l=new Range$2(r,1,s,a),c=this._getDecorationsInRange(l,n,i);return c.push(...this._decorationProvider.getDecorationsInRange(l,n,i)),c}getDecorationsInRange(e,t=0,n=!1){const i=this.validateRange(e),o=this._getDecorationsInRange(i,t,n);return o.push(...this._decorationProvider.getDecorationsInRange(i,t,n)),o}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),n=t+this._buffer.getLineLength(e),i=this._decorationsTree.getInjectedTextInInterval(this,t,n,0);return LineInjectedText.fromDecorations(i).filter((t=>t.lineNumber===e))}getAllDecorations(e=0,t=!1){let n=this._decorationsTree.getAll(this,e,t,!1);return n=n.concat(this._decorationProvider.getAllDecorations(e,t)),n}_getDecorationsInRange(e,t,n){const i=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,i,o,t,n)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const n=this._decorations[e];if(!n)return;if(n.options.after){const t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.endLineNumber)}if(n.options.before){const t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.startLineNumber)}const i=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(i.startLineNumber,i.startColumn),r=this._buffer.getOffsetAt(i.endLineNumber,i.endColumn);this._decorationsTree.delete(n),n.reset(this.getVersionId(),o,r,i),this._decorationsTree.insert(n),this._onDidChangeDecorations.checkAffectedAndFire(n.options),n.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(i.endLineNumber),n.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(i.startLineNumber)}_changeDecorationOptionsImpl(e,t){const n=this._decorations[e];if(!n)return;const i=!(!n.options.overviewRuler||!n.options.overviewRuler.color),o=!(!t.overviewRuler||!t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(n.options),this._onDidChangeDecorations.checkAffectedAndFire(t),n.options.after||t.after){const e=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(n.options.before||t.before){const e=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}i!==o?(this._decorationsTree.delete(n),n.setOptions(t),this._decorationsTree.insert(n)):n.setOptions(t)}_deltaDecorationsImpl(e,t,n){const i=this.getVersionId(),o=t.length;let r=0;const s=n.length;let a=0;const l=new Array(s);for(;r<o||a<s;){let c=null;if(r<o){do{c=this._decorations[t[r++]]}while(!c&&r<o);if(c){if(c.options.after){const e=this._decorationsTree.getNodeRange(this,c);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(c.options.before){const e=this._decorationsTree.getNodeRange(this,c);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}this._decorationsTree.delete(c),this._onDidChangeDecorations.checkAffectedAndFire(c.options)}}if(a<s){if(!c){const e=++this._lastDecorationId,t=`${this._instanceId};${e}`;c=new IntervalNode(t,0,0),this._decorations[t]=c}const t=n[a],o=this._validateRangeRelaxedNoAllocations(t.range),r=_normalizeOptions(t.options),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),d=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);c.ownerId=e,c.reset(i,s,d,o),c.setOptions(r),c.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.endLineNumber),c.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.startLineNumber),this._onDidChangeDecorations.checkAffectedAndFire(r),this._decorationsTree.insert(c),l[a]=c.id,a++}else c&&delete this._decorations[c.id]}return l}setTokens(e,t=!1){if(0!==e.length){const t=[];for(let n=0,i=e.length;n<i;n++){const i=e[n];let o=0,r=0,s=!1;for(let e=i.startLineNumber;e<=i.endLineNumber;e++)if(s)this._tokens.setTokens(this._languageId,e-1,this._buffer.getLineLength(e),i.getLineTokens(e),!1),r=e;else{this._tokens.setTokens(this._languageId,e-1,this._buffer.getLineLength(e),i.getLineTokens(e),!0)&&(s=!0,o=e,r=e)}s&&t.push({fromLineNumber:o,toLineNumber:r})}t.length>0&&this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!1,ranges:t})}this.handleTokenizationProgress(t)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:null!==e,ranges:[{fromLineNumber:1,toLineNumber:this.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const n=this.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!0,ranges:[{fromLineNumber:n.startLineNumber,toLineNumber:n.endLineNumber}]})}tokenizeViewport(e,t){e=Math.max(1,e),t=Math.min(this._buffer.getLineCount(),t),this._tokenization.tokenizeViewport(e,t)}clearTokens(){this._tokens.flush(),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!0,semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._buffer.getLineCount()}]})}_emitModelTokensChangedEvent(e){this._isDisposing||(this._bracketPairColorizer.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}resetTokenization(){this._tokenization.reset()}forceTokenization(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");this._tokenization.forceTokenization(e)}isCheapToTokenize(e){return this._tokenization.isCheapToTokenize(e)}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._getLineTokens(e)}_getLineTokens(e){const t=this.getLineContent(e),n=this._tokens.getTokens(this._languageId,e-1,t);return this._semanticTokens.addSparseTokens(e,n)}getLanguageId(){return this._languageId}setMode(e){if(this._languageId===e)return;const t={oldLanguage:this._languageId,newLanguage:e};this._languageId=e,this._bracketPairColorizer.handleDidChangeLanguage(t),this._tokenization.handleDidChangeLanguage(t),this._onDidChangeLanguage.fire(t),this._onDidChangeLanguageConfiguration.fire({})}getLanguageIdAtPosition(e,t){const n=this.validatePosition(new Position$1(e,t)),i=this.getLineTokens(n.lineNumber);return i.getLanguageId(i.findTokenIndexAtOffset(n.column-1))}getTokenTypeIfInsertingCharacter(e,t,n){const i=this.validatePosition(new Position$1(e,t));return this._tokenization.getTokenTypeIfInsertingCharacter(i,n)}tokenizeLineWithEdit(e,t,n){const i=this.validatePosition(e);return this._tokenization.tokenizeLineWithEdit(i,t,n)}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}getWordAtPosition(t){this._assertNotDisposed();const n=this.validatePosition(t),i=this.getLineContent(n.lineNumber),o=this._getLineTokens(n.lineNumber),r=o.findTokenIndexAtOffset(n.column-1),[s,a]=e._findLanguageBoundaries(o,r),l=getWordAtText(n.column,this.getLanguageConfiguration(o.getLanguageId(r)).getWordDefinition(),i.substring(s,a),s);if(l&&l.startColumn<=t.column&&t.column<=l.endColumn)return l;if(r>0&&s===n.column-1){const[s,a]=e._findLanguageBoundaries(o,r-1),l=getWordAtText(n.column,this.getLanguageConfiguration(o.getLanguageId(r-1)).getWordDefinition(),i.substring(s,a),s);if(l&&l.startColumn<=t.column&&t.column<=l.endColumn)return l}return null}static _findLanguageBoundaries(e,t){const n=e.getLanguageId(t);let i=0;for(let r=t;r>=0&&e.getLanguageId(r)===n;r--)i=e.getStartOffset(r);let o=e.getLineContent().length;for(let r=t,s=e.getCount();r<s&&e.getLanguageId(r)===n;r++)o=e.getEndOffset(r);return[i,o]}getWordUntilPosition(e){const t=this.getWordAtPosition(e);return t?{word:t.word.substr(0,e.column-t.startColumn),startColumn:t.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}}normalizePosition(e,t){return e}getLineIndentColumn(e){return indentOfLine(this.getLineContent(e))+1}};function indentOfLine(e){let t=0;for(const n of e){if(" "!==n&&"\t"!==n)break;t++}return t}function isNodeInOverviewRuler(e){return!(!e.options.overviewRuler||!e.options.overviewRuler.color)}function isNodeInjectedText(e){return!!e.options.after||!!e.options.before}TextModel.MODEL_SYNC_LIMIT=52428800,TextModel.LARGE_FILE_SIZE_THRESHOLD=20971520,TextModel.LARGE_FILE_LINE_COUNT_THRESHOLD=3e5,TextModel.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:EDITOR_MODEL_DEFAULTS.tabSize,indentSize:EDITOR_MODEL_DEFAULTS.indentSize,insertSpaces:EDITOR_MODEL_DEFAULTS.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:EDITOR_MODEL_DEFAULTS.trimAutoWhitespace,largeFileOptimizations:EDITOR_MODEL_DEFAULTS.largeFileOptimizations,bracketPairColorizationOptions:EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions},TextModel=__decorate$1w([__param$1r(4,IUndoRedoService),__param$1r(5,ILanguageService),__param$1r(6,ILanguageConfigurationService)],TextModel);class DecorationsTrees{constructor(){this._decorationsTree0=new IntervalTree,this._decorationsTree1=new IntervalTree,this._injectedTextDecorationsTree=new IntervalTree}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1)}_ensureNodesHaveRanges(e,t){for(const n of t)null===n.range&&(n.range=e.getRangeAt(n.cachedAbsoluteStart,n.cachedAbsoluteEnd));return t}getAllInInterval(e,t,n,i,o){const r=e.getVersionId(),s=this._intervalSearch(t,n,i,o,r);return this._ensureNodesHaveRanges(e,s)}_intervalSearch(e,t,n,i,o){const r=this._decorationsTree0.intervalSearch(e,t,n,i,o),s=this._decorationsTree1.intervalSearch(e,t,n,i,o),a=this._injectedTextDecorationsTree.intervalSearch(e,t,n,i,o);return r.concat(s).concat(a)}getInjectedTextInInterval(e,t,n,i){const o=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,n,i,!1,o);return this._ensureNodesHaveRanges(e,r).filter((e=>e.options.showIfCollapsed||!e.range.isEmpty()))}getAllInjectedText(e,t){const n=e.getVersionId(),i=this._injectedTextDecorationsTree.search(t,!1,n);return this._ensureNodesHaveRanges(e,i).filter((e=>e.options.showIfCollapsed||!e.range.isEmpty()))}getAll(e,t,n,i){const o=e.getVersionId(),r=this._search(t,n,i,o);return this._ensureNodesHaveRanges(e,r)}_search(e,t,n,i){if(n)return this._decorationsTree1.search(e,t,i);{const n=this._decorationsTree0.search(e,t,i),o=this._decorationsTree1.search(e,t,i),r=this._injectedTextDecorationsTree.search(e,t,i);return n.concat(o).concat(r)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),n=this._decorationsTree1.collectNodesFromOwner(e),i=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(n).concat(i)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),n=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(n)}insert(e){isNodeInjectedText(e)?this._injectedTextDecorationsTree.insert(e):isNodeInOverviewRuler(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){isNodeInjectedText(e)?this._injectedTextDecorationsTree.delete(e):isNodeInOverviewRuler(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const n=e.getVersionId();return t.cachedVersionId!==n&&this._resolveNode(t,n),null===t.range&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){isNodeInjectedText(e)?this._injectedTextDecorationsTree.resolveNode(e,t):isNodeInOverviewRuler(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,n,i){this._decorationsTree0.acceptReplace(e,t,n,i),this._decorationsTree1.acceptReplace(e,t,n,i),this._injectedTextDecorationsTree.acceptReplace(e,t,n,i)}}function cleanClassName(e){return e.replace(/[^a-z0-9\-_]/gi," ")}class DecorationOptions{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class ModelDecorationOverviewRulerOptions extends DecorationOptions{constructor(e){super(e),this._resolvedColor=null,this.position="number"==typeof e.position?e.position:OverviewRulerLane$1.Center}getColor(e){return this._resolvedColor||("light"!==e.type&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if("string"==typeof e)return e;const n=e?t.getColor(e.id):null;return n?n.toString():""}}class ModelDecorationMinimapOptions extends DecorationOptions{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||("light"!==e.type&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return"string"==typeof e?Color.fromHex(e):t.getColor(e.id)}}class ModelDecorationInjectedTextOptions{constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}static from(e){return e instanceof ModelDecorationInjectedTextOptions?e:new ModelDecorationInjectedTextOptions(e)}}class ModelDecorationOptions{constructor(e){var t,n;this.description=e.description,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?cleanClassName(e.className):null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new ModelDecorationOverviewRulerOptions(e.overviewRuler):null,this.minimap=e.minimap?new ModelDecorationMinimapOptions(e.minimap):null,this.glyphMarginClassName=e.glyphMarginClassName?cleanClassName(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?cleanClassName(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?cleanClassName(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?cleanClassName(e.marginClassName):null,this.inlineClassName=e.inlineClassName?cleanClassName(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?cleanClassName(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?cleanClassName(e.afterContentClassName):null,this.after=e.after?ModelDecorationInjectedTextOptions.from(e.after):null,this.before=e.before?ModelDecorationInjectedTextOptions.from(e.before):null,this.hideInCommentTokens=null!==(t=e.hideInCommentTokens)&&void 0!==t&&t,this.hideInStringTokens=null!==(n=e.hideInStringTokens)&&void 0!==n&&n}static register(e){return new ModelDecorationOptions(e)}static createDynamic(e){return new ModelDecorationOptions(e)}}ModelDecorationOptions.EMPTY=ModelDecorationOptions.register({description:"empty"});const TRACKED_RANGE_OPTIONS=[ModelDecorationOptions.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),ModelDecorationOptions.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),ModelDecorationOptions.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),ModelDecorationOptions.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function _normalizeOptions(e){return e instanceof ModelDecorationOptions?e:ModelDecorationOptions.createDynamic(e)}class DidChangeDecorationsEmitter extends Disposable{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new Emitter$1),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFire=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;if(this._deferredCnt--,0===this._deferredCnt){if(this._shouldFire){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler};this._shouldFire=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._actual.fire(e)}null===(e=this._affectedInjectedTextLines)||void 0===e||e.clear(),this._affectedInjectedTextLines=null}}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!(!e.minimap||!e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!(!e.overviewRuler||!e.overviewRuler.color)),this._shouldFire=!0}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._shouldFire=!0}}class DidChangeContentEmitter extends Disposable{constructor(){super(),this._fastEmitter=this._register(new Emitter$1),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new Emitter$1),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,0===this._deferredCnt&&null!==this._deferredEvent){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){this._deferredCnt>0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))}}function createModelLineProjection(e,t){return null===e?t?IdentityModelLineProjection.INSTANCE:HiddenModelLineProjection.INSTANCE:new ModelLineProjection(e,t)}class ModelLineProjection{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,n){this._assertVisible();const i=n>0?this._projectionData.breakOffsets[n-1]:0,o=this._projectionData.breakOffsets[n];let r;if(null!==this._projectionData.injectionOffsets){const n=this._projectionData.injectionOffsets.map(((e,t)=>new LineInjectedText(0,0,e+1,this._projectionData.injectionOptions[t],0)));r=LineInjectedText.applyInjectedText(e.getLineContent(t),n).substring(i,o)}else r=e.getValueInRange({startLineNumber:t,startColumn:i+1,endLineNumber:t,endColumn:o+1});return n>0&&(r=spaces(this._projectionData.wrappedTextIndentLength)+r),r}getViewLineLength(e,t,n){return this._assertVisible(),this._projectionData.getLineLength(n)}getViewLineMinColumn(e,t,n){return this._assertVisible(),this._projectionData.getMinOutputOffset(n)+1}getViewLineMaxColumn(e,t,n){return this._assertVisible(),this._projectionData.getMaxOutputOffset(n)+1}getViewLineData(e,t,n){const i=new Array;return this.getViewLinesData(e,t,n,1,0,[!0],i),i[0]}getViewLinesData(e,t,n,i,o,r,s){this._assertVisible();const a=this._projectionData,l=a.injectionOffsets,c=a.injectionOptions;let d,u=null;if(l){u=[];let e=0,t=0;for(let n=0;n<a.getOutputLineCount();n++){const i=new Array;u[n]=i;const o=n>0?a.breakOffsets[n-1]:0,r=a.breakOffsets[n];for(;t<l.length;){const s=c[t].content.length,d=l[t]+e,u=d+s;if(d>r)break;if(o<u){const e=c[t];if(e.inlineClassName){const t=n>0?a.wrappedTextIndentLength:0,s=t+Math.max(d-o,0),l=t+Math.min(u-o,r);s!==l&&i.push(new SingleLineInlineDecoration(s,l,e.inlineClassName,e.inlineClassNameAffectsLetterSpacing))}}if(!(u<=r))break;e+=s,t++}}}d=l?e.getLineTokens(t).withInserted(l.map(((e,t)=>({offset:e,text:c[t].content,tokenMetadata:LineTokens.defaultTokenMetadata})))):e.getLineTokens(t);for(let h=n;h<n+i;h++){const e=o+h-n;r[e]?s[e]=this._getViewLineData(d,u?u[h]:null,h):s[e]=null}}_getViewLineData(e,t,n){this._assertVisible();const i=this._projectionData,o=n>0?i.wrappedTextIndentLength:0,r=n>0?i.breakOffsets[n-1]:0,s=i.breakOffsets[n],a=e.sliceAndInflate(r,s,o);let l=a.getLineContent();n>0&&(l=spaces(i.wrappedTextIndentLength)+l);const c=this._projectionData.getMinOutputOffset(n)+1,d=l.length+1,u=n+1<this.getViewLineCount(),h=0===n?0:i.breakOffsetsVisibleColumn[n-1];return new ViewLineData(l,u,c,d,h,a,t)}getModelColumnOfViewPosition(e,t){return this._assertVisible(),this._projectionData.translateToInputOffset(e,t-1)+1}getViewPositionOfModelPosition(e,t,n=2){this._assertVisible();return this._projectionData.translateToOutputPosition(t-1,n).toPosition(e)}getViewLineNumberOfModelPosition(e,t){this._assertVisible();return e+this._projectionData.translateToOutputPosition(t-1).outputLineIndex}normalizePosition(e,t,n){const i=t.lineNumber-e;return this._projectionData.normalizeOutputPosition(e,t.column-1,n).toPosition(i)}getInjectedTextAt(e,t){return this._projectionData.getInjectedText(e,t-1)}_assertVisible(){if(!this._isVisible)throw new Error("Not supported")}}class IdentityModelLineProjection{constructor(){}isVisible(){return!0}setVisible(e){return e?this:HiddenModelLineProjection.INSTANCE}getProjectionData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,n){return e.getLineContent(t)}getViewLineLength(e,t,n){return e.getLineLength(t)}getViewLineMinColumn(e,t,n){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,n){return e.getLineMaxColumn(t)}getViewLineData(e,t,n){const i=e.getLineTokens(t),o=i.getLineContent();return new ViewLineData(o,!1,1,o.length+1,0,i.inflate(),null)}getViewLinesData(e,t,n,i,o,r,s){r[o]?s[o]=this.getViewLineData(e,t,0):s[o]=null}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new Position$1(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,n){return t}getInjectedTextAt(e,t){return null}}IdentityModelLineProjection.INSTANCE=new IdentityModelLineProjection;class HiddenModelLineProjection{constructor(){}isVisible(){return!1}setVisible(e){return e?IdentityModelLineProjection.INSTANCE:this}getProjectionData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,n){throw new Error("Not supported")}getViewLineLength(e,t,n){throw new Error("Not supported")}getViewLineMinColumn(e,t,n){throw new Error("Not supported")}getViewLineMaxColumn(e,t,n){throw new Error("Not supported")}getViewLineData(e,t,n){throw new Error("Not supported")}getViewLinesData(e,t,n,i,o,r,s){throw new Error("Not supported")}getModelColumnOfViewPosition(e,t){throw new Error("Not supported")}getViewPositionOfModelPosition(e,t){throw new Error("Not supported")}getViewLineNumberOfModelPosition(e,t){throw new Error("Not supported")}normalizePosition(e,t,n){throw new Error("Not supported")}getInjectedTextAt(e,t){throw new Error("Not supported")}}HiddenModelLineProjection.INSTANCE=new HiddenModelLineProjection;let _spaces=[""];function spaces(e){if(e>=_spaces.length)for(let t=1;t<=e;t++)_spaces[t]=_makeSpaces(t);return _spaces[e]}function _makeSpaces(e){return new Array(e+1).join(" ")}class PrefixSumComputer{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=toUint32(e);const n=this.values,i=this.prefixSum,o=t.length;return 0!==o&&(this.values=new Uint32Array(n.length+o),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+o),this.values.set(t,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(i.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=toUint32(e),t=toUint32(t),this.values[e]!==t&&(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=toUint32(e),t=toUint32(t);const n=this.values,i=this.prefixSum;if(e>=n.length)return!1;const o=n.length-e;return t>=o&&(t=o),0!==t&&(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(i.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return 0===this.values.length?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=toUint32(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,n=this.values.length-1,i=0,o=0,r=0;for(;t<=n;)if(i=t+(n-t)/2|0,o=this.prefixSum[i],r=o-this.values[i],e<r)n=i-1;else{if(!(e>=o))break;t=i+1}return new PrefixSumIndexOfResult(i,e-r)}}class ConstantTimePrefixSumComputer{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),0===e?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],n=t>0?this._prefixSum[t-1]:0;return new PrefixSumIndexOfResult(t,e-n)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=arrayInsert(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e<t;e++){const t=this._values[e],n=e>0?this._prefixSum[e-1]:0;this._prefixSum[e]=n+t;for(let i=0;i<t;i++)this._indexBySum[n+i]=e}this._prefixSum.length=this._values.length,this._indexBySum.length=this._prefixSum[this._prefixSum.length-1],this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,t){this._values[e]!==t&&(this._values[e]=t,this._invalidate(e))}}class PrefixSumIndexOfResult{constructor(e,t){this.index=e,this.remainder=t,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}class ViewModelLinesFromProjectedModel{constructor(e,t,n,i,o,r,s,a,l){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=n,this._monospaceLineBreaksComputerFactory=i,this.fontInfo=o,this.tabSize=r,this.wrappingStrategy=s,this.wrappingColumn=a,this.wrappingIndent=l,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new CoordinatesConverter(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const n=this.model.getLinesContent(),i=this.model.getInjectedTextDecorations(this._editorId),o=n.length,r=this.createLineBreaksComputer(),s=new ArrayQueue(LineInjectedText.fromDecorations(i));for(let p=0;p<o;p++){const e=s.takeWhile((e=>e.lineNumber===p+1));r.addRequest(n[p],e,t?t[p]:null)}const a=r.finalize(),l=[],c=this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e))).sort(Range$2.compareRangesUsingStarts);let d=1,u=0,h=-1,g=h+1<c.length?u+1:o+2;for(let p=0;p<o;p++){const e=p+1;e===g&&(h++,d=c[h].startLineNumber,u=c[h].endLineNumber,g=h+1<c.length?u+1:o+2);const t=e>=d&&e<=u,n=createModelLineProjection(a[p],!t);l[p]=n.getViewLineCount(),this.modelLineProjections[p]=n}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new ConstantTimePrefixSumComputer(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e)))}setHiddenAreas(e){const t=normalizeLineRanges(e.map((e=>this.model.validateRange(e)))),n=this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e))).sort(Range$2.compareRangesUsingStarts);if(t.length===n.length){let e=!1;for(let i=0;i<t.length;i++)if(!t[i].equalsRange(n[i])){e=!0;break}if(!e)return!1}const i=t.map((e=>({range:e,options:ModelDecorationOptions.EMPTY})));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,i);const o=t;let r=1,s=0,a=-1,l=a+1<o.length?s+1:this.modelLineProjections.length+2,c=!1;for(let d=0;d<this.modelLineProjections.length;d++){const e=d+1;e===l&&(a++,r=o[a].startLineNumber,s=o[a].endLineNumber,l=a+1<o.length?s+1:this.modelLineProjections.length+2);let t=!1;if(e>=r&&e<=s?this.modelLineProjections[d].isVisible()&&(this.modelLineProjections[d]=this.modelLineProjections[d].setVisible(!1),t=!0):(c=!0,this.modelLineProjections[d].isVisible()||(this.modelLineProjections[d]=this.modelLineProjections[d].setVisible(!0),t=!0)),t){const e=this.modelLineProjections[d].getViewLineCount();this.projectedModelLineLineCounts.setValue(d,e)}}return c||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return!(e<1||e>this.modelLineProjections.length)&&this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize!==e&&(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,n,i){const o=this.fontInfo.equals(e),r=this.wrappingStrategy===t,s=this.wrappingColumn===n,a=this.wrappingIndent===i;if(o&&r&&s&&a)return!1;const l=o&&r&&!s&&a;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=n,this.wrappingIndent=i;let c=null;if(l){c=[];for(let e=0,t=this.modelLineProjections.length;e<t;e++)c[e]=this.modelLineProjections[e].getProjectionData()}return this._constructLines(!1,c),!0}createLineBreaksComputer(){return("advanced"===this.wrappingStrategy?this._domLineBreaksComputerFactory:this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo,this.tabSize,this.wrappingColumn,this.wrappingIndent)}onModelFlushed(){this._constructLines(!0,null)}onModelLinesDeleted(e,t,n){if(!e||e<=this._validModelVersionId)return null;const i=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,o=this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections.splice(t-1,n-t+1),this.projectedModelLineLineCounts.removeValues(t-1,n-t+1),new ViewLinesDeletedEvent(i,o)}onModelLinesInserted(e,t,n,i){if(!e||e<=this._validModelVersionId)return null;const o=t>2&&!this.modelLineProjections[t-2].isVisible(),r=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let s=0;const a=[],l=[];for(let c=0,d=i.length;c<d;c++){const e=createModelLineProjection(i[c],!o);a.push(e);const t=e.getViewLineCount();s+=t,l[c]=t}return this.modelLineProjections=this.modelLineProjections.slice(0,t-1).concat(a).concat(this.modelLineProjections.slice(t-1)),this.projectedModelLineLineCounts.insertValues(t-1,l),new ViewLinesInsertedEvent(r,r+s-1)}onModelLineChanged(e,t,n){if(null!==e&&e<=this._validModelVersionId)return[!1,null,null,null];const i=t-1,o=this.modelLineProjections[i].getViewLineCount(),r=createModelLineProjection(n,this.modelLineProjections[i].isVisible());this.modelLineProjections[i]=r;const s=this.modelLineProjections[i].getViewLineCount();let a=!1,l=0,c=-1,d=0,u=-1,h=0,g=-1;o>s?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,c=l+s-1,h=c+1,g=h+(o-s)-1,a=!0):o<s?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,c=l+o-1,d=c+1,u=d+(s-o)-1,a=!0):(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,c=l+s-1),this.projectedModelLineLineCounts.setValue(i,s);return[a,l<=c?new ViewLinesChangedEvent(l,c):null,d<=u?new ViewLinesInsertedEvent(d,u):null,h<=g?new ViewLinesDeletedEvent(h,g):null]}acceptVersionId(e){this._validModelVersionId=e,1!==this.modelLineProjections.length||this.modelLineProjections[0].isVisible()||this.setHiddenAreas([])}getViewLineCount(){return this.projectedModelLineLineCounts.getTotalSum()}_toValidViewLineNumber(e){if(e<1)return 1;const t=this.getViewLineCount();return e>t?t:0|e}getActiveIndentGuide(e,t,n){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),n=this._toValidViewLineNumber(n);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(n,this.getViewLineMinColumn(n)),s=this.model.guides.getActiveIndentGuide(i.lineNumber,o.lineNumber,r.lineNumber),a=this.convertModelPositionToViewPosition(s.startLineNumber,1),l=this.convertModelPositionToViewPosition(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:l.lineNumber,indent:s.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),n=t.index,i=t.remainder;return new ViewLineInfo(n+1,i)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],n=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),i=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new Position$1(e.modelLineNumber,i)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],n=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),i=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,n);return new Position$1(e.modelLineNumber,i)}getViewLineInfosGroupedByModelRanges(e,t){const n=this.getViewLineInfo(e),i=this.getViewLineInfo(t),o=new Array;let r=this.getModelStartPositionOfViewLine(n),s=new Array;for(let a=n.modelLineNumber;a<=i.modelLineNumber;a++){const e=this.modelLineProjections[a-1];if(e.isVisible()){const t=a===n.modelLineNumber?n.modelLineWrappedLineIdx:0,o=a===i.modelLineNumber?i.modelLineWrappedLineIdx+1:e.getViewLineCount();for(let e=t;e<o;e++)s.push(new ViewLineInfo(a,e))}if(!e.isVisible()&&r){const e=new Position$1(a-1,this.model.getLineMaxColumn(a-1)+1),t=Range$2.fromPositions(r,e);o.push(new ViewLineInfoGroupedByModelRange(t,s)),s=[],r=null}else e.isVisible()&&!r&&(r=new Position$1(a,1))}if(r){const e=Range$2.fromPositions(r,this.getModelEndPositionOfViewLine(i));o.push(new ViewLineInfoGroupedByModelRange(e,s))}return o}getViewLinesBracketGuides(e,t,n,i){const o=n?this.convertViewPositionToModelPosition(n.lineNumber,n.column):null,r=[];for(const s of this.getViewLineInfosGroupedByModelRanges(e,t)){const e=s.modelRange.startLineNumber,t=this.model.guides.getLinesBracketGuides(e,s.modelRange.endLineNumber,o,i);for(const n of s.viewLines)if(n.isWrappedLineContinuation&&1===this.getMinColumnOfViewLine(n))r.push([]);else{let i=t[n.modelLineNumber-e];i=i.map((e=>e.horizontalLine?new IndentGuide(e.visibleColumn,e.className,new IndentGuideHorizontalLine(e.horizontalLine.top,this.convertModelPositionToViewPosition(n.modelLineNumber,e.horizontalLine.endColumn).column)):e)),r.push(i)}}return r}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),i=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const r=[],s=[],a=n.lineNumber-1,l=i.lineNumber-1;let c=null;for(let g=a;g<=l;g++){const e=this.modelLineProjections[g];if(e.isVisible()){const t=e.getViewLineNumberOfModelPosition(0,g===a?n.column:1),i=e.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),o=i-t+1;let l=0;o>1&&1===e.getViewLineMinColumn(this.model,g+1,i)&&(l=0===t?1:2),r.push(o),s.push(l),null===c&&(c=new Position$1(g+1,0))}else null!==c&&(o=o.concat(this.model.guides.getLinesIndentGuides(c.lineNumber,g)),c=null)}null!==c&&(o=o.concat(this.model.guides.getLinesIndentGuides(c.lineNumber,i.lineNumber)),c=null);const d=t-e+1,u=new Array(d);let h=0;for(let g=0,p=o.length;g<p;g++){let e=o[g];const t=Math.min(d-h,r[g]),n=s[g];let i;i=2===n?0:1===n?1:t;for(let o=0;o<t;o++)o===i&&(e=0),u[h++]=e}return u}getViewLineContent(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineContent(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineLength(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineLength(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMinColumn(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMinColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMaxColumn(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMaxColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineData(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineData(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLinesData(e,t,n){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.projectedModelLineLineCounts.getIndexOf(e-1);let o=e;const r=i.index,s=i.remainder,a=[];for(let l=r,c=this.model.getLineCount();l<c;l++){const i=this.modelLineProjections[l];if(!i.isVisible())continue;const c=l===r?s:0;let d=i.getViewLineCount()-c,u=!1;if(o+d>t&&(u=!0,d=t-o+1),i.getViewLinesData(this.model,l+1,c,d,o-e,n,a),o+=d,u)break}return a}validateViewPosition(e,t,n){e=this._toValidViewLineNumber(e);const i=this.projectedModelLineLineCounts.getIndexOf(e-1),o=i.index,r=i.remainder,s=this.modelLineProjections[o],a=s.getViewLineMinColumn(this.model,o+1,r),l=s.getViewLineMaxColumn(this.model,o+1,r);t<a&&(t=a),t>l&&(t=l);const c=s.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new Position$1(o+1,c)).equals(n)?new Position$1(e,t):this.convertModelPositionToViewPosition(n.lineNumber,n.column)}validateViewRange(e,t){const n=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),i=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new Range$2(n.lineNumber,n.column,i.lineNumber,i.column)}convertViewPositionToModelPosition(e,t){const n=this.getViewLineInfo(e),i=this.modelLineProjections[n.modelLineNumber-1].getModelColumnOfViewPosition(n.modelLineWrappedLineIdx,t);return this.model.validatePosition(new Position$1(n.modelLineNumber,i))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),n=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new Range$2(t.lineNumber,t.column,n.lineNumber,n.column)}convertModelPositionToViewPosition(e,t,n=2){const i=this.model.validatePosition(new Position$1(e,t)),o=i.lineNumber,r=i.column;let s=o-1,a=!1;for(;s>0&&!this.modelLineProjections[s].isVisible();)s--,a=!0;if(0===s&&!this.modelLineProjections[s].isVisible())return new Position$1(1,1);const l=1+this.projectedModelLineLineCounts.getPrefixSum(s);let c;return c=a?this.modelLineProjections[s].getViewPositionOfModelPosition(l,this.model.getLineMaxColumn(s+1),n):this.modelLineProjections[o-1].getViewPositionOfModelPosition(l,r,n),c}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const n=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return Range$2.fromPositions(n)}{const t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),n=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new Range$2(t.lineNumber,t.column,n.lineNumber,n.column)}}getViewLineNumberOfModelPosition(e,t){let n=e-1;if(this.modelLineProjections[n].isVisible()){const e=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(e,t)}for(;n>0&&!this.modelLineProjections[n].isVisible();)n--;if(0===n&&!this.modelLineProjections[n].isVisible())return 1;const i=1+this.projectedModelLineLineCounts.getPrefixSum(n);return this.modelLineProjections[n].getViewLineNumberOfModelPosition(i,this.model.getLineMaxColumn(n+1))}getDecorationsInRange(e,t,n){const i=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),o=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(o.lineNumber-i.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new Range$2(i.lineNumber,1,o.lineNumber,o.column),t,n);let r=[];const s=i.lineNumber-1,a=o.lineNumber-1;let l=null;for(let h=s;h<=a;h++){if(this.modelLineProjections[h].isVisible())null===l&&(l=new Position$1(h+1,h===s?i.column:1));else if(null!==l){const e=this.model.getLineMaxColumn(h);r=r.concat(this.model.getDecorationsInRange(new Range$2(l.lineNumber,l.column,h,e),t,n)),l=null}}null!==l&&(r=r.concat(this.model.getDecorationsInRange(new Range$2(l.lineNumber,l.column,o.lineNumber,o.column),t,n)),l=null),r.sort(((e,t)=>{const n=Range$2.compareRangesUsingStarts(e.range,t.range);return 0===n?e.id<t.id?-1:e.id>t.id?1:0:n}));let c=[],d=0,u=null;for(const h of r){const e=h.id;u!==e&&(u=e,c[d++]=h)}return c}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const n=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[n.modelLineNumber-1].normalizePosition(n.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return 0===t.modelLineWrappedLineIdx?this.model.getLineIndentColumn(t.modelLineNumber):0}}function normalizeLineRanges(e){if(0===e.length)return[];const t=e.slice();t.sort(Range$2.compareRangesUsingStarts);const n=[];let i=t[0].startLineNumber,o=t[0].endLineNumber;for(let r=1,s=t.length;r<s;r++){const e=t[r];e.startLineNumber>o+1?(n.push(new Range$2(i,1,o,1)),i=e.startLineNumber,o=e.endLineNumber):e.endLineNumber>o&&(o=e.endLineNumber)}return n.push(new Range$2(i,1,o,1)),n}class ViewLineInfo{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}get isWrappedLineContinuation(){return this.modelLineWrappedLineIdx>0}}class ViewLineInfoGroupedByModelRange{constructor(e,t){this.modelRange=e,this.viewLines=t}}class CoordinatesConverter{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class ViewModelLinesFromModelAsIs{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new IdentityCoordinatesConverter(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,n,i){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,n,i)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,n){return new ViewLinesDeletedEvent(t,n)}onModelLinesInserted(e,t,n,i){return new ViewLinesInsertedEvent(t,n)}onModelLineChanged(e,t,n){return[!1,new ViewLinesChangedEvent(t,t),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,n){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,n){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const n=t-e+1,i=new Array(n);for(let o=0;o<n;o++)i[o]=0;return i}getViewLineContent(e){return this.model.getLineContent(e)}getViewLineLength(e){return this.model.getLineLength(e)}getViewLineMinColumn(e){return this.model.getLineMinColumn(e)}getViewLineMaxColumn(e){return this.model.getLineMaxColumn(e)}getViewLineData(e){const t=this.model.getLineTokens(e),n=t.getLineContent();return new ViewLineData(n,!1,1,n.length+1,0,t.inflate(),null)}getViewLinesData(e,t,n){const i=this.model.getLineCount();e=Math.min(Math.max(1,e),i),t=Math.min(Math.max(1,t),i);const o=[];for(let r=e;r<=t;r++){const t=r-e;o[t]=n[t]?this.getViewLineData(r):null}return o}getDecorationsInRange(e,t,n){return this.model.getDecorationsInRange(e,t,n)}normalizePosition(e,t){return this.model.normalizePosition(e,t)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}getInjectedTextAt(e){return null}}class IdentityCoordinatesConverter{constructor(e){this._lines=e}_validPosition(e){return this._lines.model.validatePosition(e)}_validRange(e){return this._lines.model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,t){return this._validPosition(t)}validateViewRange(e,t){return this._validRange(t)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){const t=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class ViewModel extends Disposable{constructor(e,t,n,i,o,r,s,a){if(super(),this.languageConfigurationService=s,this._themeService=a,this._editorId=e,this._configuration=t,this.model=n,this._eventDispatcher=new ViewModelEventDispatcher,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new CursorConfiguration(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._tokenizeViewportSoon=this._register(new RunOnceScheduler((()=>this.tokenizeViewport()),50)),this._updateConfigurationViewLineCount=this._register(new RunOnceScheduler((()=>this._updateConfigurationViewLineCountNow()),0)),this._hasFocus=!1,this._viewportStartLine=-1,this._viewportStartLineTrackedRange=null,this._viewportStartLineDelta=0,this.model.isTooLargeForTokenization())this._lines=new ViewModelLinesFromModelAsIs(this.model);else{const e=this._configuration.options,t=e.get(44),n=e.get(125),r=e.get(132),s=e.get(124);this._lines=new ViewModelLinesFromProjectedModel(this._editorId,this.model,i,o,t,this.model.getOptions().tabSize,n,r.wrappingColumn,s)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new CursorsController(n,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new ViewLayout(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll((e=>{e.scrollTopChanged&&this._tokenizeViewportSoon.schedule(),this._eventDispatcher.emitSingleViewEvent(new ViewScrollChangedEvent(e)),this._eventDispatcher.emitOutgoingEvent(new ScrollChangedEvent(e.oldScrollWidth,e.oldScrollLeft,e.oldScrollHeight,e.oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop))}))),this._register(this.viewLayout.onDidContentSizeChange((e=>{this._eventDispatcher.emitOutgoingEvent(e)}))),this._decorations=new ViewModelDecorations(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}}))),this._register(MinimapTokensColorTracker.getInstance().onDidChange((()=>{this._eventDispatcher.emitSingleViewEvent(new ViewTokensColorsChangedEvent)}))),this._register(this._themeService.onDidColorThemeChange((e=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new ViewThemeChangedEvent(e))}))),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStartLineTrackedRange=this.model._setTrackedRange(this._viewportStartLineTrackedRange,null,1),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}tokenizeViewport(){const e=this.viewLayout.getLinesViewportData(),t=new Range$2(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber)),n=this._toModelVisibleRanges(t);for(const i of n)this.model.tokenizeViewport(i.startLineNumber,i.endLineNumber)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new ViewFocusChangedEvent(e)),this._eventDispatcher.emitOutgoingEvent(new FocusChangedEvent(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new ViewCompositionStartEvent)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new ViewCompositionEndEvent)}_onConfigurationChanged(e,t){let n=null;if(-1!==this._viewportStartLine){const e=new Position$1(this._viewportStartLine,this.getLineMinColumn(this._viewportStartLine));n=this.coordinatesConverter.convertViewPositionToModelPosition(e)}let i=!1;const o=this._configuration.options,r=o.get(44),s=o.get(125),a=o.get(132),l=o.get(124);if(this._lines.setWrappingSettings(r,s,a.wrappingColumn,l)&&(e.emitViewEvent(new ViewFlushedEvent),e.emitViewEvent(new ViewLineMappingChangedEvent),e.emitViewEvent(new ViewDecorationsChangedEvent(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),0!==this.viewLayout.getCurrentScrollTop()&&(i=!0),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(81)&&(this._decorations.reset(),e.emitViewEvent(new ViewDecorationsChangedEvent(null))),e.emitViewEvent(new ViewConfigurationChangedEvent(t)),this.viewLayout.onConfigurationChanged(t),i&&n){const e=this.coordinatesConverter.convertModelPositionToViewPosition(n),t=this.viewLayout.getVerticalOffsetForLineNumber(e.lineNumber);this.viewLayout.setScrollPosition({scrollTop:t+this._viewportStartLineDelta},1)}CursorConfiguration.shouldRecreate(t)&&(this.cursorConfig=new CursorConfiguration(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();let n=!1,i=!1;const o=e.changes,r=e instanceof ModelRawContentChangedEvent?e.versionId:null,s=this._lines.createLineBreaksComputer();for(const e of o)switch(e.changeType){case 4:for(let t=0;t<e.detail.length;t++){const n=e.detail[t];let i=e.injectedTexts[t];i&&(i=i.filter((e=>!e.ownerId||e.ownerId===this._editorId))),s.addRequest(n,i,null)}break;case 2:{let t=null;e.injectedText&&(t=e.injectedText.filter((e=>!e.ownerId||e.ownerId===this._editorId))),s.addRequest(e.detail,t,null);break}}const a=s.finalize(),l=new ArrayQueue(a);for(const e of o)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new ViewFlushedEvent),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),n=!0;break;case 3:{const i=this._lines.onModelLinesDeleted(r,e.fromLineNumber,e.toLineNumber);null!==i&&(t.emitViewEvent(i),this.viewLayout.onLinesDeleted(i.fromLineNumber,i.toLineNumber)),n=!0;break}case 4:{const i=l.takeCount(e.detail.length),o=this._lines.onModelLinesInserted(r,e.fromLineNumber,e.toLineNumber,i);null!==o&&(t.emitViewEvent(o),this.viewLayout.onLinesInserted(o.fromLineNumber,o.toLineNumber)),n=!0;break}case 2:{const n=l.dequeue(),[o,s,a,c]=this._lines.onModelLineChanged(r,e.lineNumber,n);i=o,s&&t.emitViewEvent(s),a&&(t.emitViewEvent(a),this.viewLayout.onLinesInserted(a.fromLineNumber,a.toLineNumber)),c&&(t.emitViewEvent(c),this.viewLayout.onLinesDeleted(c.fromLineNumber,c.toLineNumber));break}}null!==r&&this._lines.acceptVersionId(r),this.viewLayout.onHeightMaybeChanged(),!n&&i&&(t.emitViewEvent(new ViewLineMappingChangedEvent),t.emitViewEvent(new ViewDecorationsChangedEvent(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}if(this._viewportStartLine=-1,this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&this._viewportStartLineTrackedRange){const e=this.model._getTrackedRange(this._viewportStartLineTrackedRange);if(e){const t=this.coordinatesConverter.convertModelPositionToViewPosition(e.getStartPosition()),n=this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);this.viewLayout.setScrollPosition({scrollTop:n+this._viewportStartLineDelta},1)}}try{const t=this._eventDispatcher.beginEmitViewEvents();this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._tokenizeViewportSoon.schedule()}))),this._register(this.model.onDidChangeTokens((e=>{const t=[];for(let n=0,i=e.ranges.length;n<i;n++){const i=e.ranges[n],o=this.coordinatesConverter.convertModelPositionToViewPosition(new Position$1(i.fromLineNumber,1)).lineNumber,r=this.coordinatesConverter.convertModelPositionToViewPosition(new Position$1(i.toLineNumber,this.model.getLineMaxColumn(i.toLineNumber))).lineNumber;t[n]={fromLineNumber:o,toLineNumber:r}}this._eventDispatcher.emitSingleViewEvent(new ViewTokensChangedEvent(t)),e.tokenizationSupportChanged&&this._tokenizeViewportSoon.schedule()}))),this._register(this.model.onDidChangeLanguageConfiguration((e=>{this._eventDispatcher.emitSingleViewEvent(new ViewLanguageConfigurationEvent),this.cursorConfig=new CursorConfiguration(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig)}))),this._register(this.model.onDidChangeLanguage((e=>{this.cursorConfig=new CursorConfiguration(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig)}))),this._register(this.model.onDidChangeOptions((e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const e=this._eventDispatcher.beginEmitViewEvents();e.emitViewEvent(new ViewFlushedEvent),e.emitViewEvent(new ViewLineMappingChangedEvent),e.emitViewEvent(new ViewDecorationsChangedEvent(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new CursorConfiguration(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig)}))),this._register(this.model.onDidChangeDecorations((e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new ViewDecorationsChangedEvent(e))})))}setHiddenAreas(e){let t=!1;try{const n=this._eventDispatcher.beginEmitViewEvents();t=this._lines.setHiddenAreas(e),t&&(n.emitViewEvent(new ViewFlushedEvent),n.emitViewEvent(new ViewLineMappingChangedEvent),n.emitViewEvent(new ViewDecorationsChangedEvent(null)),this._cursor.onLineMappingChanged(n),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),t&&this._eventDispatcher.emitOutgoingEvent(new ViewZonesChangedEvent)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(131),t=this._configuration.options.get(59),n=Math.max(20,Math.round(e.height/t)),i=this.viewLayout.getLinesViewportData(),o=Math.max(1,i.completelyVisibleStartLineNumber-n),r=Math.min(this.getLineCount(),i.completelyVisibleEndLineNumber+n);return this._toModelVisibleRanges(new Range$2(o,this.getLineMinColumn(o),r,this.getLineMaxColumn(r)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),n=this._lines.getHiddenAreas();if(0===n.length)return[t];const i=[];let o=0,r=t.startLineNumber,s=t.startColumn;const a=t.endLineNumber,l=t.endColumn;for(let c=0,d=n.length;c<d;c++){const e=n[c].startLineNumber,t=n[c].endLineNumber;t<r||(e>a||(r<e&&(i[o++]=new Range$2(r,s,e-1,this.model.getLineMaxColumn(e-1))),r=t+1,s=1))}return(r<a||r===a&&s<l)&&(i[o++]=new Range$2(r,s,a,l)),i}getCompletelyVisibleViewRange(){const e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,n=e.completelyVisibleEndLineNumber;return new Range$2(t,this.getLineMinColumn(t),n,this.getLineMaxColumn(n))}getCompletelyVisibleViewRangeAtScrollTop(e){const t=this.viewLayout.getLinesViewportDataAtScrollTop(e),n=t.completelyVisibleStartLineNumber,i=t.completelyVisibleEndLineNumber;return new Range$2(n,this.getLineMinColumn(n),i,this.getLineMaxColumn(i))}saveState(){const e=this.viewLayout.saveState(),t=e.scrollTop,n=this.viewLayout.getLineNumberAtVerticalOffset(t),i=this.coordinatesConverter.convertViewPositionToModelPosition(new Position$1(n,this.getLineMinColumn(n))),o=this.viewLayout.getVerticalOffsetForLineNumber(n)-t;return{scrollLeft:e.scrollLeft,firstPosition:i,firstPositionDeltaTop:o}}reduceRestoreState(e){if(void 0===e.firstPosition)return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),n=this.coordinatesConverter.convertModelPositionToViewPosition(t),i=this.viewLayout.getVerticalOffsetForLineNumber(n.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:i}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,n){this._viewportStartLine=e;const i=this.coordinatesConverter.convertViewPositionToModelPosition(new Position$1(e,this.getLineMinColumn(e)));this._viewportStartLineTrackedRange=this.model._setTrackedRange(this._viewportStartLineTrackedRange,new Range$2(i.lineNumber,i.column,i.lineNumber,i.column),1);const o=this.viewLayout.getVerticalOffsetForLineNumber(e),r=this.viewLayout.getCurrentScrollTop();this._viewportStartLineDelta=r-o}getActiveIndentGuide(e,t,n){return this._lines.getActiveIndentGuide(e,t,n)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,n,i){return this._lines.getViewLinesBracketGuides(e,t,n,i)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=firstNonWhitespaceIndex(this.getLineContent(e));return-1===t?0:t+1}getLineLastNonWhitespaceColumn(e){const t=lastNonWhitespaceIndex(this.getLineContent(e));return-1===t?0:t+2}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewLineRenderingData(e,t){const n=this.model.mightContainRTL(),i=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),r=this._lines.getViewLineData(t);let s=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return r.inlineDecorations&&(s=[...s,...r.inlineDecorations.map((e=>e.toInlineDecoration(t)))]),new ViewLineRenderingData(r.minColumn,r.maxColumn,r.content,r.continuesWithWrappedLine,n,i,r.tokens,s,o,r.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,n){const i=this._lines.getViewLinesData(e,t,n);return new MinimapLinesRenderingData(this.getTabSize(),i)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,filterValidationDecorations(this._configuration.options)),n=new OverviewRulerDecorations;for(const i of t){const t=i.options,o=t.overviewRuler;if(!o)continue;const r=o.position;if(0===r)continue;const s=o.getColor(e.value),a=this.coordinatesConverter.getViewLineNumberOfModelPosition(i.range.startLineNumber,i.range.startColumn),l=this.coordinatesConverter.getViewLineNumberOfModelPosition(i.range.endLineNumber,i.range.endColumn);n.accept(s,t.zIndex,a,l,r)}return n.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const e=t.options.overviewRuler;e&&e.invalidateCachedColor();const n=t.options.minimap;n&&n.invalidateCachedColor()}}getValueInRange(e,t){const n=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(n,t)}deduceModelPositionRelativeToViewPosition(e,t,n){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e);2===this.model.getEOL().length&&(t<0?t-=n:t+=n);const o=this.model.getOffsetAt(i)+t;return this.model.getPositionAt(o)}getPlainTextToCopy(e,t,n){const i=n?"\r\n":this.model.getEOL();(e=e.slice(0)).sort(Range$2.compareRangesUsingStarts);let o=!1,r=!1;for(const a of e)a.isEmpty()?o=!0:r=!0;if(!r){if(!t)return"";const n=e.map((e=>e.startLineNumber));let o="";for(let e=0;e<n.length;e++)e>0&&n[e-1]===n[e]||(o+=this.model.getLineContent(n[e])+i);return o}if(o&&t){const t=[];let i=0;for(const o of e){const e=o.startLineNumber;o.isEmpty()?e!==i&&t.push(this.model.getLineContent(e)):t.push(this.model.getValueInRange(o,n?2:0)),i=e}return 1===t.length?t[0]:t}const s=[];for(const a of e)a.isEmpty()||s.push(this.model.getValueInRange(a,n?2:0));return 1===s.length?s[0]:s}getRichTextToCopy(e,t){const n=this.model.getLanguageId();if(n===PLAINTEXT_LANGUAGE_ID)return null;if(1!==e.length)return null;let i=e[0];if(i.isEmpty()){if(!t)return null;const e=i.startLineNumber;i=new Range$2(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}const o=this._configuration.options.get(44),r=this._getColorMap();let s;if(/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===EDITOR_FONT_DEFAULTS.fontFamily)s=EDITOR_FONT_DEFAULTS.fontFamily;else{s=o.fontFamily,s=s.replace(/"/g,"'");if(!/[,']/.test(s)){/[+ ]/.test(s)&&(s=`'${s}'`)}s=`${s}, ${EDITOR_FONT_DEFAULTS.fontFamily}`}return{mode:n,html:`<div style="color: ${r[1]};background-color: ${r[2]};font-family: ${s};font-weight: ${o.fontWeight};font-size: ${o.fontSize}px;line-height: ${o.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(i,r)+"</div>"}}_getHTMLToCopy(e,t){const n=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,r=e.endColumn,s=this.getTabSize();let a="";for(let l=n;l<=o;l++){const e=this.model.getLineTokens(l),c=e.getLineContent(),d=l===n?i-1:0,u=l===o?r-1:c.length;a+=""===c?"<br>":tokenizeLineToHTML(c,e.inflate(),t,d,u,s,isWindows)}return a}_getColorMap(){const e=TokenizationRegistry.getColorMap(),t=["#000000"];if(e)for(let n=1,i=e.length;n<i;n++)t[n]=Color.Format.CSS.formatHex(e[n]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,n){return this._withViewEventsCollector((i=>this._cursor.setStates(i,e,t,n)))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,n=0){this._withViewEventsCollector((i=>this._cursor.setSelections(i,e,t,n)))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector((t=>this._cursor.restoreState(t,e)))}_executeCursorEdit(e){this._cursor.context.cursorConfig.readOnly?this._eventDispatcher.emitOutgoingEvent(new ReadOnlyEditAttemptEvent):this._withViewEventsCollector(e)}executeEdits(e,t,n){this._executeCursorEdit((i=>this._cursor.executeEdits(i,e,t,n)))}startComposition(){this._cursor.setIsDoingComposition(!0),this._executeCursorEdit((e=>this._cursor.startComposition(e)))}endComposition(e){this._cursor.setIsDoingComposition(!1),this._executeCursorEdit((t=>this._cursor.endComposition(t,e)))}type(e,t){this._executeCursorEdit((n=>this._cursor.type(n,e,t)))}compositionType(e,t,n,i,o){this._executeCursorEdit((r=>this._cursor.compositionType(r,e,t,n,i,o)))}paste(e,t,n,i){this._executeCursorEdit((o=>this._cursor.paste(o,e,t,n,i)))}cut(e){this._executeCursorEdit((t=>this._cursor.cut(t,e)))}executeCommand(e,t){this._executeCursorEdit((n=>this._cursor.executeCommand(n,e,t)))}executeCommands(e,t){this._executeCursorEdit((n=>this._cursor.executeCommands(n,e,t)))}revealPrimaryCursor(e,t,n=!1){this._withViewEventsCollector((i=>this._cursor.revealPrimary(i,e,n,0,t,0)))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),n=new Range$2(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new ViewRevealRangeRequestEvent(e,!1,n,null,0,!0,0))))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),n=new Range$2(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new ViewRevealRangeRequestEvent(e,!1,n,null,0,!0,0))))}revealRange(e,t,n,i,o){this._withViewEventsCollector((r=>r.emitViewEvent(new ViewRevealRangeRequestEvent(e,!1,n,null,i,t,o))))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new ViewZonesChangedEvent$1),this._eventDispatcher.emitOutgoingEvent(new ViewZonesChangedEvent))}_withViewEventsCollector(e){try{return e(this._eventDispatcher.beginEmitViewEvents())}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class OverviewRulerDecorations{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,n,i,o){const r=this._asMap[e];if(r){const e=r.data,t=e[e.length-3],s=e[e.length-1];if(t===o&&s+1>=n)return void(i>s&&(e[e.length-1]=i));e.push(o,n,i)}else{const r=new OverviewRulerDecorationsGroup(e,t,[o,n,i]);this._asMap[e]=r,this.asArray.push(r)}}}class ServiceCollection{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){const n=this._entries.get(e);return this._entries.set(e,t),n}get(e){return this._entries.get(e)}}var Severity$1,Severity2;Severity2=Severity$1||(Severity$1={}),Severity2[Severity2.Ignore=0]="Ignore",Severity2[Severity2.Info=1]="Info",Severity2[Severity2.Warning=2]="Warning",Severity2[Severity2.Error=3]="Error",function(e){const t="error",n="warning",i="info";e.fromValue=function(o){return o?equalsIgnoreCase(t,o)?e.Error:equalsIgnoreCase(n,o)||equalsIgnoreCase("warn",o)?e.Warning:equalsIgnoreCase(i,o)?e.Info:e.Ignore:e.Ignore},e.toString=function(o){switch(o){case e.Error:return t;case e.Warning:return n;case e.Info:return i;default:return"ignore"}}}(Severity$1||(Severity$1={}));var Severity$2=Severity$1,Severity=Severity$2;const INotificationService=createDecorator("notificationService");class NoOpNotification{}class ModelLineProjectionData{constructor(e,t,n,i,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=n,this.breakOffsetsVisibleColumn=i,this.wrappedTextIndentLength=o}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let n=this.breakOffsets[e]-t;return e>0&&(n+=this.wrappedTextIndentLength),n}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let n=0===e?t:this.breakOffsets[e-1]+t;if(null!==this.injectionOffsets)for(let i=0;i<this.injectionOffsets.length&&n>this.injectionOffsets[i];i++)n<this.injectionOffsets[i]+this.injectionOptions[i].content.length?n=this.injectionOffsets[i]:n-=this.injectionOptions[i].content.length;return n}translateToOutputPosition(e,t=2){let n=e;if(null!==this.injectionOffsets)for(let i=0;i<this.injectionOffsets.length&&!(e<this.injectionOffsets[i])&&(1===t||e!==this.injectionOffsets[i]);i++)n+=this.injectionOptions[i].content.length;return this.offsetInInputWithInjectionsToOutputPosition(n,t)}offsetInInputWithInjectionsToOutputPosition(e,t=2){let n=0,i=this.breakOffsets.length-1,o=0,r=0;for(;n<=i;){o=n+(i-n)/2|0;const s=this.breakOffsets[o];if(r=o>0?this.breakOffsets[o-1]:0,0===t)if(e<=r)i=o-1;else{if(!(e>s))break;n=o+1}else if(e<r)i=o-1;else{if(!(e>=s))break;n=o+1}}let s=e-r;return o>0&&(s+=this.wrappedTextIndentLength),new OutputPosition(o,s)}normalizeOutputPosition(e,t,n){if(null!==this.injectionOffsets){const i=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(i,n);if(o!==i)return this.offsetInInputWithInjectionsToOutputPosition(o,n)}if(0===n){if(e>0&&t===this.getMinOutputOffset(e))return new OutputPosition(e-1,this.getMaxOutputOffset(e-1))}else if(1===n){if(e<this.getOutputLineCount()-1&&t===this.getMaxOutputOffset(e))return new OutputPosition(e+1,this.getMinOutputOffset(e+1))}return new OutputPosition(e,t)}outputPositionToOffsetInInputWithInjections(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));return(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const n=this.getInjectedTextAtOffset(e);if(!n)return e;if(2===t){if(e===n.offsetInInputWithInjections+n.length&&hasRightCursorStop(this.injectionOptions[n.injectedTextIndex].cursorStops))return n.offsetInInputWithInjections+n.length;{let e=n.offsetInInputWithInjections;if(hasLeftCursorStop(this.injectionOptions[n.injectedTextIndex].cursorStops))return e;let t=n.injectedTextIndex-1;for(;t>=0&&this.injectionOffsets[t]===this.injectionOffsets[n.injectedTextIndex]&&!hasRightCursorStop(this.injectionOptions[t].cursorStops)&&(e-=this.injectionOptions[t].content.length,!hasLeftCursorStop(this.injectionOptions[t].cursorStops));)t--;return e}}if(1===t){let e=n.offsetInInputWithInjections+n.length,t=n.injectedTextIndex;for(;t+1<this.injectionOffsets.length&&this.injectionOffsets[t+1]===this.injectionOffsets[t];)e+=this.injectionOptions[t+1].content.length,t++;return e}if(0===t){let e=n.offsetInInputWithInjections,t=n.injectedTextIndex;for(;t-1>=0&&this.injectionOffsets[t-1]===this.injectionOffsets[t];)e-=this.injectionOptions[t-1].content.length,t--;return e}assertNever()}getInjectedText(e,t){const n=this.outputPositionToOffsetInInputWithInjections(e,t),i=this.getInjectedTextAtOffset(n);return i?{options:this.injectionOptions[i.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,n=this.injectionOptions;if(null!==t){let i=0;for(let o=0;o<t.length;o++){const r=n[o].content.length,s=t[o]+i,a=t[o]+i+r;if(s>e)break;if(e<=a)return{injectedTextIndex:o,offsetInInputWithInjections:s,length:r};i+=r}}}}function hasRightCursorStop(e){return null==e||(e===InjectedTextCursorStops$1.Right||e===InjectedTextCursorStops$1.Both)}function hasLeftCursorStop(e){return null==e||(e===InjectedTextCursorStops$1.Left||e===InjectedTextCursorStops$1.Both)}class OutputPosition{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new Position$1(e+this.outputLineIndex,this.outputOffset+1)}}class MonospaceLineBreaksComputerFactory{constructor(e,t){this.classifier=new WrappingCharacterClassifier(e,t)}static create(e){return new MonospaceLineBreaksComputerFactory(e.get(120),e.get(119))}createLineBreaksComputer(e,t,n,i){const o=[],r=[],s=[];return{addRequest:(e,t,n)=>{o.push(e),r.push(t),s.push(n)},finalize:()=>{const a=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,l=[];for(let e=0,c=o.length;e<c;e++){const c=r[e],d=s[e];!d||d.injectionOptions||c?l[e]=createLineBreaks$1(this.classifier,o[e],c,t,n,a,i):l[e]=createLineBreaksFromPreviousLineBreaks(this.classifier,d,o[e],t,n,a,i)}return arrPool1.length=0,arrPool2.length=0,l}}}}class WrappingCharacterClassifier extends CharacterClassifier{constructor(e,t){super(0);for(let n=0;n<e.length;n++)this.set(e.charCodeAt(n),1);for(let n=0;n<t.length;n++)this.set(t.charCodeAt(n),2)}get(e){return e>=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let arrPool1=[],arrPool2=[];function createLineBreaksFromPreviousLineBreaks(e,t,n,i,o,r,s){if(-1===o)return null;const a=n.length;if(a<=1)return null;const l=t.breakOffsets,c=t.breakOffsetsVisibleColumn,d=computeWrappedTextIndentLength(n,i,o,r,s),u=o-d,h=arrPool1,g=arrPool2;let p=0,f=0,m=0,v=o;const _=l.length;let C=0;if(C>=0){let e=Math.abs(c[C]-v);for(;C+1<_;){const t=Math.abs(c[C+1]-v);if(t>=e)break;e=t,C++}}for(;C<_;){let t=C<0?0:l[C],o=C<0?0:c[C];f>t&&(t=f,o=m);let s=0,d=0,b=0,y=0;if(o<=v){let m=o,_=0===t?0:n.charCodeAt(t-1),C=0===t?0:e.get(_),S=!0;for(let o=t;o<a;o++){const t=o,a=n.charCodeAt(o);let l,c;if(isHighSurrogate(a)?(o++,l=0,c=2):(l=e.get(a),c=computeCharWidth(a,m,i,r)),t>f&&canBreak(_,C,a,l)&&(s=t,d=m),m+=c,m>v){t>f?(b=t,y=m-c):(b=o+1,y=m),m-d>u&&(s=0),S=!1;break}_=a,C=l}if(S){p>0&&(h[p]=l[l.length-1],g[p]=c[l.length-1],p++);break}}if(0===s){let a=o,l=n.charCodeAt(t),c=e.get(l),h=!1;for(let i=t-1;i>=f;i--){const t=i+1,o=n.charCodeAt(i);if(9===o){h=!0;break}let g,p;if(isLowSurrogate(o)?(i--,g=0,p=2):(g=e.get(o),p=isFullWidthCharacter(o)?r:1),a<=v){if(0===b&&(b=t,y=a),a<=v-u)break;if(canBreak(o,g,l,c)){s=t,d=a;break}}a-=p,l=o,c=g}if(0!==s){const e=u-(y-d);if(e<=i){const t=n.charCodeAt(b);let o;o=isHighSurrogate(t)?2:computeCharWidth(t,y,i,r),e-o<0&&(s=0)}}if(h){C--;continue}}if(0===s&&(s=b,d=y),s<=f){const e=n.charCodeAt(f);isHighSurrogate(e)?(s=f+2,d=m+2):(s=f+1,d=m+computeCharWidth(e,m,i,r))}for(f=s,h[p]=s,m=d,g[p]=d,p++,v=d+u;C<0||C<_&&c[C]<d;)C++;let S=Math.abs(c[C]-v);for(;C+1<_;){const e=Math.abs(c[C+1]-v);if(e>=S)break;S=e,C++}}return 0===p?null:(h.length=p,g.length=p,arrPool1=t.breakOffsets,arrPool2=t.breakOffsetsVisibleColumn,t.breakOffsets=h,t.breakOffsetsVisibleColumn=g,t.wrappedTextIndentLength=d,t)}function createLineBreaks$1(e,t,n,i,o,r,s){const a=LineInjectedText.applyInjectedText(t,n);let l,c;if(n&&n.length>0?(l=n.map((e=>e.options)),c=n.map((e=>e.column-1))):(l=null,c=null),-1===o)return l?new ModelLineProjectionData(c,l,[a.length],[],0):null;const d=a.length;if(d<=1)return l?new ModelLineProjectionData(c,l,[a.length],[],0):null;const u=computeWrappedTextIndentLength(a,i,o,r,s),h=o-u,g=[],p=[];let f=0,m=0,v=0,_=o,C=a.charCodeAt(0),b=e.get(C),y=computeCharWidth(C,0,i,r),S=1;isHighSurrogate(C)&&(y+=1,C=a.charCodeAt(1),b=e.get(C),S++);for(let w=S;w<d;w++){const t=w,n=a.charCodeAt(w);let o,s;isHighSurrogate(n)?(w++,o=0,s=2):(o=e.get(n),s=computeCharWidth(n,y,i,r)),canBreak(C,b,n,o)&&(m=t,v=y),y+=s,y>_&&((0===m||y-v>h)&&(m=t,v=y-s),g[f]=m,p[f]=v,f++,_=v+h,m=0),C=n,b=o}return 0!==f||n&&0!==n.length?(g[f]=d,p[f]=y,new ModelLineProjectionData(c,l,g,p,u)):null}function computeCharWidth(e,t,n,i){return 9===e?n-t%n:isFullWidthCharacter(e)||e<32?i:1}function tabCharacterWidth(e,t){return t-e%t}function canBreak(e,t,n,i){return 32!==n&&(2===t||3===t&&2!==i||1===i||3===i&&1!==t)}function computeWrappedTextIndentLength(e,t,n,i,o){let r=0;if(0!==o){const s=firstNonWhitespaceIndex(e);if(-1!==s){for(let n=0;n<s;n++){r+=9===e.charCodeAt(n)?tabCharacterWidth(r,t):1}const a=3===o?2:2===o?1:0;for(let e=0;e<a;e++){r+=tabCharacterWidth(r,t)}r+i>n&&(r=0)}}return r}var _a$b;const ttPolicy$4=null===(_a$b=window.trustedTypes)||void 0===_a$b?void 0:_a$b.createPolicy("domLineBreaksComputer",{createHTML:e=>e});class DOMLineBreaksComputerFactory{static create(){return new DOMLineBreaksComputerFactory}constructor(){}createLineBreaksComputer(e,t,n,i){const o=[],r=[];return{addRequest:(e,t,n)=>{o.push(e),r.push(t)},finalize:()=>createLineBreaks(o,e,t,n,i,r)}}}function createLineBreaks(e,t,n,i,o,r){var s;function a(t){const n=r[t];if(n){const i=LineInjectedText.applyInjectedText(e[t],n),o=n.map((e=>e.options)),r=n.map((e=>e.column-1));return new ModelLineProjectionData(r,o,[i.length],[],0)}return null}if(-1===i){const t=[];for(let n=0,i=e.length;n<i;n++)t[n]=a(n);return t}const l=Math.round(i*t.typicalHalfwidthCharacterWidth),c=3===o?2:2===o?1:0,d=Math.round(n*c),u=Math.ceil(t.spaceWidth*d),h=document.createElement("div");applyFontInfo(h,t);const g=createStringBuilder(1e4),p=[],f=[],m=[],v=[],_=[];for(let E=0;E<e.length;E++){const i=LineInjectedText.applyInjectedText(e[E],r[E]);let s=0,a=0,c=l;if(0!==o)if(s=firstNonWhitespaceIndex(i),-1===s)s=0;else{for(let t=0;t<s;t++){a+=9===i.charCodeAt(t)?n-a%n:1}const e=Math.ceil(t.spaceWidth*a);e+t.typicalFullwidthCharacterWidth>l?(s=0,a=0):c=l-e}const d=i.substr(s),h=renderLine(d,a,n,c,g,u);p[E]=s,f[E]=a,m[E]=d,v[E]=h[0],_[E]=h[1]}const C=g.build(),b=null!==(s=null==ttPolicy$4?void 0:ttPolicy$4.createHTML(C))&&void 0!==s?s:C;h.innerHTML=b,h.style.position="absolute",h.style.top="10000",h.style.wordWrap="break-word",document.body.appendChild(h);const y=document.createRange(),S=Array.prototype.slice.call(h.children,0),w=[];for(let E=0;E<e.length;E++){const e=readLineBreaks(y,S[E],m[E],v[E]);if(null===e){w[E]=a(E);continue}const t=p[E],n=f[E]+d,i=_[E],o=[];for(let r=0,a=e.length;r<a;r++)o[r]=i[e[r]];if(0!==t)for(let r=0,a=e.length;r<a;r++)e[r]+=t;let s,l;const c=r[E];c?(s=c.map((e=>e.options)),l=c.map((e=>e.column-1))):(s=null,l=null),w[E]=new ModelLineProjectionData(l,s,e,o,n)}return document.body.removeChild(h),w}function renderLine(e,t,n,i,o,r){if(0!==r){const e=String(r);o.appendASCIIString('<div style="text-indent: -'),o.appendASCIIString(e),o.appendASCIIString("px; padding-left: "),o.appendASCIIString(e),o.appendASCIIString("px; box-sizing: border-box; width:")}else o.appendASCIIString('<div style="width:');o.appendASCIIString(String(i)),o.appendASCIIString('px;">');const s=e.length;let a=t,l=0;const c=[],d=[];let u=0<s?e.charCodeAt(0):0;o.appendASCIIString("<span>");for(let h=0;h<s;h++){0!==h&&h%16384==0&&o.appendASCIIString("</span><span>"),c[h]=l,d[h]=a;const t=u;u=h+1<s?e.charCodeAt(h+1):0;let i=1,r=1;switch(t){case 9:i=n-a%n,r=i;for(let e=1;e<=i;e++)e<i?o.write1(160):o.appendASCII(32);break;case 32:32===u?o.write1(160):o.appendASCII(32);break;case 60:o.appendASCIIString("<");break;case 62:o.appendASCIIString(">");break;case 38:o.appendASCIIString("&");break;case 0:o.appendASCIIString("�");break;case 65279:case 8232:case 8233:case 133:o.write1(65533);break;default:isFullWidthCharacter(t)&&r++,t<32?o.write1(9216+t):o.write1(t)}l+=i,a+=r}return o.appendASCIIString("</span>"),c[e.length]=l,d[e.length]=a,o.appendASCIIString("</div>"),[c,d]}function readLineBreaks(e,t,n,i){if(n.length<=1)return null;const o=Array.prototype.slice.call(t.children,0),r=[];try{discoverBreaks(e,o,i,0,null,n.length-1,null,r)}catch(s){return null}return 0===r.length?null:(r.push(n.length),r)}function discoverBreaks(e,t,n,i,o,r,s,a){if(i===r)return;if(o=o||readClientRect(e,t,n[i],n[i+1]),s=s||readClientRect(e,t,n[r],n[r+1]),Math.abs(o[0].top-s[0].top)<=.1)return;if(i+1===r)return void a.push(r);const l=i+(r-i)/2|0,c=readClientRect(e,t,n[l],n[l+1]);discoverBreaks(e,t,n,i,o,l,c,a),discoverBreaks(e,t,n,l,c,r,s,a)}function readClientRect(e,t,n,i){return e.setStart(t[n/16384|0].firstChild,n%16384),e.setEnd(t[i/16384|0].firstChild,i%16384),e.getClientRects()}const ILanguageFeaturesService=createDecorator("ILanguageFeaturesService");var __decorate$1v=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1q=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let EDITOR_ID=0;class ModelData$1{constructor(e,t,n,i,o){this.model=e,this.viewModel=t,this.view=n,this.hasRealView=i,this.listenersToRemove=o}dispose(){dispose(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let CodeEditorWidget=class e extends Disposable{constructor(e,t,n,i,o,r,s,a,l,c,d,u){super(),this.languageConfigurationService=d,this._onDidDispose=this._register(new Emitter$1),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new Emitter$1),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new Emitter$1),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new Emitter$1),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new Emitter$1),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new Emitter$1),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeConfiguration=this._register(new Emitter$1),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new Emitter$1),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new Emitter$1),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new Emitter$1),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Emitter$1),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new Emitter$1),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new BooleanEventEmitter),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new BooleanEventEmitter),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Emitter$1),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Emitter$1),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Emitter$1),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Emitter$1),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Emitter$1),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Emitter$1),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Emitter$1),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Emitter$1),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Emitter$1),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Emitter$1),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onContextMenu=this._register(new Emitter$1),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Emitter$1),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Emitter$1),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Emitter$1),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Emitter$1),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Emitter$1),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new Emitter$1),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new Emitter$1),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new Emitter$1),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new Emitter$1),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._bannerDomNode=null;const h=Object.assign({},t);let g;this._domElement=e,this._overflowWidgetsDomNode=h.overflowWidgetsDomNode,delete h.overflowWidgetsDomNode,this._id=++EDITOR_ID,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=n.telemetryData,this._configuration=this._register(this._createConfiguration(n.isSimpleWidget||!1,h,c)),this._register(this._configuration.onDidChange((e=>{this._onDidChangeConfiguration.fire(e);const t=this._configuration.options;if(e.hasChanged(131)){const e=t.get(131);this._onDidLayoutChange.fire(e)}}))),this._contextKeyService=this._register(s.createScoped(this._domElement)),this._notificationService=l,this._codeEditorService=o,this._commandService=r,this._themeService=a,this._register(new EditorContextKeysManager(this,this._contextKeyService)),this._register(new EditorModeContext(this,this._contextKeyService,u)),this._instantiationService=i.createChild(new ServiceCollection([IContextKeyService,this._contextKeyService])),this._modelData=null,this._contributions={},this._actions={},this._focusTracker=new CodeEditorWidgetFocusTracker(e),this._register(this._focusTracker.onChange((()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())}))),this._contentWidgets={},this._overlayWidgets={},g=Array.isArray(n.contributions)?n.contributions:EditorExtensionsRegistry.getEditorContributions();for(const f of g)if(this._contributions[f.id])onUnexpectedError(new Error(`Cannot have two contributions with the same id ${f.id}`));else try{const e=this._instantiationService.createInstance(f.ctor,this);this._contributions[f.id]=e}catch(p){onUnexpectedError(p)}EditorExtensionsRegistry.getEditorActions().forEach((e=>{if(this._actions[e.id])return void onUnexpectedError(new Error(`Cannot have two actions with the same id ${e.id}`));const t=new InternalEditorAction(e.id,e.label,e.alias,withNullAsUndefined(e.precondition),(()=>this._instantiationService.invokeFunction((t=>Promise.resolve(e.runEditorCommand(t,this,null))))),this._contextKeyService);this._actions[t.id]=t})),this._codeEditorService.addCodeEditor(this)}get isSimpleWidget(){return this._configuration.isSimpleWidget}_createConfiguration(e,t,n){return new EditorConfiguration(e,t,this._domElement,n)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return EditorType.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose();const e=Object.keys(this._contributions);for(let t=0,n=e.length;t<n;t++){const n=e[t];this._contributions[n].dispose()}this._contributions={},this._actions={},this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?WordOperations.getWordAtPosition(this._modelData.model,this._configuration.options.get(117),e):null}getValue(e=null){if(!this._modelData)return"";const t=!(!e||!e.preserveBOM);let n=0;return e&&e.lineEnding&&"\n"===e.lineEnding?n=1:e&&e.lineEnding&&"\r\n"===e.lineEnding&&(n=2),this._modelData.model.getValue(n,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(null===this._modelData&&null===t)return;if(this._modelData&&this._modelData.model===t)return;const n=this.hasTextFocus(),i=this._detachModel();this._attachModel(t),n&&this.hasModel()&&this.focus();const o={oldModelUrl:i?i.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(i)}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(let e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(let n in t)this._removeDecorationType(e+"-"+n)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetForPosition(e,t,n){const i=e.model.validatePosition({lineNumber:t,column:n}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber)}getTopForLineNumber(t){return this._modelData?e._getVerticalOffsetForPosition(this._modelData,t,1):-1}getTopForPosition(t,n){return this._modelData?e._getVerticalOffsetForPosition(this._modelData,t,n):-1}setHiddenAreas(e){this._modelData&&this._modelData.viewModel.setHiddenAreas(e.map((e=>Range$2.lift(e))))}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),n=this._modelData.model.getOptions().tabSize;return CursorColumns.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,n)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!Position$1.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,n,i){if(!this._modelData)return;if(!Range$2.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",n,r,t,i)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,n){if("number"!=typeof e)throw new Error("Invalid arguments");this._sendRevealRange(new Range$2(e,1,e,1),t,!1,n)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,n,i){if(!Position$1.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new Range$2(e.lineNumber,e.column,e.lineNumber,e.column),t,n,i)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const n=Selection$1.isISelection(e),i=Range$2.isIRange(e);if(!n&&!i)throw new Error("Invalid arguments");if(n)this._setSelectionImpl(e,t);else if(i){const n={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(n,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const n=new Selection$1(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[n])}revealLines(e,t,n=0){this._revealLines(e,t,0,n)}revealLinesInCenter(e,t,n=0){this._revealLines(e,t,1,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._revealLines(e,t,2,n)}revealLinesNearTop(e,t,n=0){this._revealLines(e,t,5,n)}_revealLines(e,t,n,i){if("number"!=typeof e||"number"!=typeof t)throw new Error("Invalid arguments");this._sendRevealRange(new Range$2(e,1,t,1),n,!1,i)}revealRange(e,t=0,n=!1,i=!0){this._revealRange(e,n?1:0,i,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,n,i){if(!Range$2.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(Range$2.lift(e),t,n,i)}setSelections(e,t="api",n=0){if(this._modelData){if(!e||0===e.length)throw new Error("Invalid arguments");for(let t=0,n=e.length;t<n;t++)if(!Selection$1.isISelection(e[t]))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,e,n)}}getContentWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getContentWidth():-1}getScrollWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollWidth():-1}getScrollLeft(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollLeft():-1}getContentHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getContentHeight():-1}getScrollHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollHeight():-1}getScrollTop(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollTop():-1}setScrollLeft(e,t=1){if(this._modelData){if("number"!=typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollLeft:e},t)}}setScrollTop(e,t=1){if(this._modelData){if("number"!=typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollTop:e},t)}}setScrollPosition(e,t=1){this._modelData&&this._modelData.viewModel.viewLayout.setScrollPosition(e,t)}saveViewState(){if(!this._modelData)return null;const e={},t=Object.keys(this._contributions);for(const n of t){const t=this._contributions[n];"function"==typeof t.saveViewState&&(e[n]=t.saveViewState())}return{cursorState:this._modelData.viewModel.saveCursorState(),viewState:this._modelData.viewModel.saveState(),contributionsState:e}}restoreViewState(e){if(!this._modelData||!this._modelData.hasRealView)return;const t=e;if(t&&t.cursorState&&t.viewState){const e=t.cursorState;Array.isArray(e)?e.length>0&&this._modelData.viewModel.restoreCursorState(e):this._modelData.viewModel.restoreCursorState([e]);const n=t.contributionsState||{},i=Object.keys(this._contributions);for(let t=0,r=i.length;t<r;t++){const e=i[t],o=this._contributions[e];"function"==typeof o.restoreViewState&&o.restoreViewState(n[e])}const o=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(o)}}getContribution(e){return this._contributions[e]||null}getActions(){const e=[],t=Object.keys(this._actions);for(let n=0,i=t.length;n<i;n++){const i=t[n];e.push(this._actions[i])}return e}getSupportedActions(){let e=this.getActions();return e=e.filter((e=>e.isSupported())),e}getAction(e){return this._actions[e]||null}trigger(e,t,n){switch(n=n||{},t){case"compositionStart":return void this._startComposition();case"compositionEnd":return void this._endComposition(e);case"type":{const t=n;return void this._type(e,t.text||"")}case"replacePreviousChar":{const t=n;return void this._compositionType(e,t.text||"",t.replaceCharCnt||0,0,0)}case"compositionType":{const t=n;return void this._compositionType(e,t.text||"",t.replacePrevCharCnt||0,t.replaceNextCharCnt||0,t.positionDelta||0)}case"paste":{const t=n;return void this._paste(e,t.text||"",t.pasteOnNewLine||!1,t.multicursorText||null,t.mode||null)}case"cut":return void this._cut(e)}const i=this.getAction(t);i?Promise.resolve(i.run()).then(void 0,onUnexpectedError):this._modelData&&(this._triggerEditorCommand(e,t,n)||this._triggerCommand(t,n))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){this._modelData&&0!==t.length&&("keyboard"===e&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),"keyboard"===e&&this._onDidType.fire(t))}_compositionType(e,t,n,i,o){this._modelData&&this._modelData.viewModel.compositionType(t,n,i,o,e)}_paste(e,t,n,i,o){if(!this._modelData||0===t.length)return;const r=this._modelData.viewModel.getSelection().getStartPosition();this._modelData.viewModel.paste(t,n,i,e);const s=this._modelData.viewModel.getSelection().getStartPosition();"keyboard"===e&&this._onDidPaste.fire({range:new Range$2(r.lineNumber,r.column,s.lineNumber,s.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,n){const i=EditorExtensionsRegistry.getEditorCommand(t);return!!i&&((n=n||{}).source=e,this._instantiationService.invokeFunction((e=>{Promise.resolve(i.runEditorCommand(e,this,n)).then(void 0,onUnexpectedError)})),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!!this._modelData&&(!this._configuration.options.get(81)&&(this._modelData.model.pushStackElement(),!0))}popUndoStop(){return!!this._modelData&&(!this._configuration.options.get(81)&&(this._modelData.model.popStackElement(),!0))}executeEdits(e,t,n){if(!this._modelData)return!1;if(this._configuration.options.get(81))return!1;let i;return i=n?Array.isArray(n)?()=>n:n:()=>null,this._modelData.viewModel.executeEdits(e,t,i),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,filterValidationDecorations(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,filterValidationDecorations(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?0===e.length&&0===t.length?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(131)}createOverviewRuler(e){return this._modelData&&this._modelData.hasRealView?this._modelData.view.createOverviewRuler(e):null}getContainerDomNode(){return this._domElement}getDomNode(){return this._modelData&&this._modelData.hasRealView?this._modelData.view.domNode.domNode:null}delegateVerticalScrollbarMouseDown(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateVerticalScrollbarMouseDown(e)}layout(e){this._configuration.observeContainer(e),this.render()}focus(){this._modelData&&this._modelData.hasRealView&&this._modelData.view.focus()}hasTextFocus(){return!(!this._modelData||!this._modelData.hasRealView)&&this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const n=this._contentWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(n)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const e=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(e)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId()),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const n=this._overlayWidgets[t];n.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(n)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const e=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(e)}}changeViewZones(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getTargetAtClientPoint(e,t):null}getScrolledVisiblePosition(t){if(!this._modelData||!this._modelData.hasRealView)return null;const n=this._modelData.model.validatePosition(t),i=this._configuration.options,o=i.get(131);return{top:e._getVerticalOffsetForPosition(this._modelData,n.lineNumber,n.column)-this.getScrollTop(),left:this._modelData.view.getOffsetForColumn(n.lineNumber,n.column)+o.glyphMarginWidth+o.lineNumbersWidth+o.decorationsWidth-this.getScrollLeft(),height:i.get(59)}}getOffsetForColumn(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getOffsetForColumn(e,t):-1}render(e=!1){this._modelData&&this._modelData.hasRealView&&this._modelData.view.render(!0,e)}setAriaOptions(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.setAriaOptions(e)}applyFontInfo(e){applyFontInfo(e,this._configuration.options.get(44))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e)return void(this._modelData=null);const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount()),e.onBeforeAttached();const n=new ViewModel(this._id,this._configuration,e,DOMLineBreaksComputerFactory.create(),MonospaceLineBreaksComputerFactory.create(this._configuration.options),(e=>scheduleAtNextAnimationFrame(e)),this.languageConfigurationService,this._themeService);t.push(e.onDidChangeDecorations((e=>this._onDidChangeModelDecorations.fire(e)))),t.push(e.onDidChangeLanguage((t=>{this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._onDidChangeModelLanguage.fire(t)}))),t.push(e.onDidChangeLanguageConfiguration((e=>this._onDidChangeModelLanguageConfiguration.fire(e)))),t.push(e.onDidChangeContent((e=>this._onDidChangeModelContent.fire(e)))),t.push(e.onDidChangeOptions((e=>this._onDidChangeModelOptions.fire(e)))),t.push(e.onWillDispose((()=>this.setModel(null)))),t.push(n.onEvent((e=>{switch(e.kind){case 0:this._onDidContentSizeChange.fire(e);break;case 1:this._editorTextFocus.setValue(e.hasFocus);break;case 2:this._onDidScrollChange.fire(e);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{e.reachedMaxCursorCount&&this._notificationService.warn(localize("cursors.maximum","The number of cursors has been limited to {0}.",CursorsController.MAX_CURSOR_COUNT));const t=[];for(let o=0,r=e.selections.length;o<r;o++)t[o]=e.selections[o].getPosition();const n={position:t[0],secondaryPositions:t.slice(1),reason:e.reason,source:e.source};this._onDidChangeCursorPosition.fire(n);const i={selection:e.selections[0],secondarySelections:e.selections.slice(1),modelVersionId:e.modelVersionId,oldSelections:e.oldSelections,oldModelVersionId:e.oldModelVersionId,source:e.source,reason:e.reason};this._onDidChangeCursorSelection.fire(i);break}}})));const[i,o]=this._createView(n);if(o){this._domElement.appendChild(i.domNode.domNode);let t=Object.keys(this._contentWidgets);for(let e=0,n=t.length;e<n;e++){const n=t[e];i.addContentWidget(this._contentWidgets[n])}t=Object.keys(this._overlayWidgets);for(let e=0,n=t.length;e<n;e++){const n=t[e];i.addOverlayWidget(this._overlayWidgets[n])}i.render(!1,!0),i.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new ModelData$1(e,n,i,o,t)}_createView(e){let t;t=this.isSimpleWidget?{paste:(e,t,n,i)=>{this._paste("keyboard",e,t,n,i)},type:e=>{this._type("keyboard",e)},compositionType:(e,t,n,i)=>{this._compositionType("keyboard",e,t,n,i)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:{paste:(e,t,n,i)=>{const o={text:e,pasteOnNewLine:t,multicursorText:n,mode:i};this._commandService.executeCommand("paste",o)},type:e=>{const t={text:e};this._commandService.executeCommand("type",t)},compositionType:(e,t,n,i)=>{if(n||i){const o={text:e,replacePrevCharCnt:t,replaceNextCharCnt:n,positionDelta:i};this._commandService.executeCommand("compositionType",o)}else{const n={text:e,replaceCharCnt:t};this._commandService.executeCommand("replacePreviousChar",n)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const n=new ViewUserInputEvents(e.coordinatesConverter);n.onKeyDown=e=>this._onKeyDown.fire(e),n.onKeyUp=e=>this._onKeyUp.fire(e),n.onContextMenu=e=>this._onContextMenu.fire(e),n.onMouseMove=e=>this._onMouseMove.fire(e),n.onMouseLeave=e=>this._onMouseLeave.fire(e),n.onMouseDown=e=>this._onMouseDown.fire(e),n.onMouseUp=e=>this._onMouseUp.fire(e),n.onMouseDrag=e=>this._onMouseDrag.fire(e),n.onMouseDrop=e=>this._onMouseDrop.fire(e),n.onMouseDropCanceled=e=>this._onMouseDropCanceled.fire(e),n.onMouseWheel=e=>this._onMouseWheel.fire(e);return[new View(t,this._configuration,this._themeService.getColorTheme(),e,n,this._overflowWidgetsDomNode),!0]}_postDetachModelCleanup(e){e&&e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return null!==this._modelData}};CodeEditorWidget=__decorate$1v([__param$1q(3,IInstantiationService),__param$1q(4,ICodeEditorService),__param$1q(5,ICommandService),__param$1q(6,IContextKeyService),__param$1q(7,IThemeService),__param$1q(8,INotificationService),__param$1q(9,IAccessibilityService),__param$1q(10,ILanguageConfigurationService),__param$1q(11,ILanguageFeaturesService)],CodeEditorWidget);class BooleanEventEmitter extends Disposable{constructor(){super(),this._onDidChangeToTrue=this._register(new Emitter$1),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new Emitter$1),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,2===this._value?this._onDidChangeToTrue.fire():1===this._value&&this._onDidChangeToFalse.fire())}}class EditorContextKeysManager extends Disposable{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=EditorContextKeys.editorSimpleInput.bindTo(t),this._editorFocus=EditorContextKeys.focus.bindTo(t),this._textInputFocus=EditorContextKeys.textInputFocus.bindTo(t),this._editorTextFocus=EditorContextKeys.editorTextFocus.bindTo(t),this._editorTabMovesFocus=EditorContextKeys.tabMovesFocus.bindTo(t),this._editorReadonly=EditorContextKeys.readOnly.bindTo(t),this._inDiffEditor=EditorContextKeys.inDiffEditor.bindTo(t),this._editorColumnSelection=EditorContextKeys.columnSelection.bindTo(t),this._hasMultipleSelections=EditorContextKeys.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=EditorContextKeys.hasNonEmptySelection.bindTo(t),this._canUndo=EditorContextKeys.canUndo.bindTo(t),this._canRedo=EditorContextKeys.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration((()=>this._updateFromConfig()))),this._register(this._editor.onDidChangeCursorSelection((()=>this._updateFromSelection()))),this._register(this._editor.onDidFocusEditorWidget((()=>this._updateFromFocus()))),this._register(this._editor.onDidBlurEditorWidget((()=>this._updateFromFocus()))),this._register(this._editor.onDidFocusEditorText((()=>this._updateFromFocus()))),this._register(this._editor.onDidBlurEditorText((()=>this._updateFromFocus()))),this._register(this._editor.onDidChangeModel((()=>this._updateFromModel()))),this._register(this._editor.onDidChangeConfiguration((()=>this._updateFromModel()))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._editorTabMovesFocus.set(e.get(130)),this._editorReadonly.set(e.get(81)),this._inDiffEditor.set(e.get(54)),this._editorColumnSelection.set(e.get(18))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some((e=>!e.isEmpty())))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class EditorModeContext extends Disposable{constructor(e,t,n){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=n,this._langId=EditorContextKeys.languageId.bindTo(t),this._hasCompletionItemProvider=EditorContextKeys.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=EditorContextKeys.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=EditorContextKeys.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=EditorContextKeys.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=EditorContextKeys.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=EditorContextKeys.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=EditorContextKeys.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=EditorContextKeys.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=EditorContextKeys.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=EditorContextKeys.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=EditorContextKeys.hasReferenceProvider.bindTo(t),this._hasRenameProvider=EditorContextKeys.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=EditorContextKeys.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=EditorContextKeys.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=EditorContextKeys.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=EditorContextKeys.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=EditorContextKeys.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=EditorContextKeys.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=EditorContextKeys.isInWalkThroughSnippet.bindTo(t);const i=()=>this._update();this._register(e.onDidChangeModel(i)),this._register(e.onDidChangeModelLanguage(i)),this._register(n.completionProvider.onDidChange(i)),this._register(n.codeActionProvider.onDidChange(i)),this._register(n.codeLensProvider.onDidChange(i)),this._register(n.definitionProvider.onDidChange(i)),this._register(n.declarationProvider.onDidChange(i)),this._register(n.implementationProvider.onDidChange(i)),this._register(n.typeDefinitionProvider.onDidChange(i)),this._register(n.hoverProvider.onDidChange(i)),this._register(n.documentHighlightProvider.onDidChange(i)),this._register(n.documentSymbolProvider.onDidChange(i)),this._register(n.referenceProvider.onDidChange(i)),this._register(n.renameProvider.onDidChange(i)),this._register(n.documentFormattingEditProvider.onDidChange(i)),this._register(n.documentRangeFormattingEditProvider.onDidChange(i)),this._register(n.signatureHelpProvider.onDidChange(i)),this._register(n.inlayHintsProvider.onDidChange(i)),i()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents((()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()}))}_update(){const e=this._editor.getModel();e?this._contextKeyService.bufferChangeEvents((()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===Schemas.walkThroughSnippet)})):this.reset()}}class CodeEditorWidgetFocusTracker extends Disposable{constructor(e){super(),this._onChange=this._register(new Emitter$1),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(trackFocus(e)),this._register(this._domFocusTracker.onDidFocus((()=>{this._hasFocus=!0,this._onChange.fire(void 0)}))),this._register(this._domFocusTracker.onDidBlur((()=>{this._hasFocus=!1,this._onChange.fire(void 0)})))}hasFocus(){return this._hasFocus}}const squigglyStart=encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='"),squigglyEnd=encodeURIComponent("'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>");function getSquigglySVGData(e){return squigglyStart+encodeURIComponent(e.toString())+squigglyEnd}const dotdotdotStart=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),dotdotdotEnd=encodeURIComponent('"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>');function getDotDotDotSVGData(e){return dotdotdotStart+encodeURIComponent(e.toString())+dotdotdotEnd}registerThemingParticipant(((e,t)=>{const n=e.getColor(editorErrorBorder);n&&t.addRule(`.monaco-editor .squiggly-error { border-bottom: 4px double ${n}; }`);const i=e.getColor(editorErrorForeground);i&&t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${getSquigglySVGData(i)}") repeat-x bottom left; }`);const o=e.getColor(editorErrorBackground);o&&t.addRule(`.monaco-editor .squiggly-error::before { display: block; content: ''; width: 100%; height: 100%; background: ${o}; }`);const r=e.getColor(editorWarningBorder);r&&t.addRule(`.monaco-editor .squiggly-warning { border-bottom: 4px double ${r}; }`);const s=e.getColor(editorWarningForeground);s&&t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${getSquigglySVGData(s)}") repeat-x bottom left; }`);const a=e.getColor(editorWarningBackground);a&&t.addRule(`.monaco-editor .squiggly-warning::before { display: block; content: ''; width: 100%; height: 100%; background: ${a}; }`);const l=e.getColor(editorInfoBorder);l&&t.addRule(`.monaco-editor .squiggly-info { border-bottom: 4px double ${l}; }`);const c=e.getColor(editorInfoForeground);c&&t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${getSquigglySVGData(c)}") repeat-x bottom left; }`);const d=e.getColor(editorInfoBackground);d&&t.addRule(`.monaco-editor .squiggly-info::before { display: block; content: ''; width: 100%; height: 100%; background: ${d}; }`);const u=e.getColor(editorHintBorder);u&&t.addRule(`.monaco-editor .squiggly-hint { border-bottom: 2px dotted ${u}; }`);const h=e.getColor(editorHintForeground);h&&t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${getDotDotDotSVGData(h)}") no-repeat bottom left; }`);const g=e.getColor(editorUnnecessaryCodeOpacity);g&&t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${g.rgba.a}; }`);const p=e.getColor(editorUnnecessaryCodeBorder);p&&t.addRule(`.monaco-editor.showUnused .squiggly-unnecessary { border-bottom: 2px dashed ${p}; }`);const f=e.getColor(editorForeground)||"inherit";t.addRule(`.monaco-editor.showDeprecated .squiggly-inline-deprecated { text-decoration: line-through; text-decoration-color: ${f}}`)}));var diffEditor="";class DomEmitter{constructor(e,t,n){const i=e=>this.emitter.fire(e);this.emitter=new Emitter$1({onFirstListenerAdd:()=>e.addEventListener(t,i,n),onLastListenerRemove:()=>e.removeEventListener(t,i,n)})}get event(){return this.emitter.event}dispose(){this.emitter.dispose()}}function stopEvent(e){return e.preventDefault(),e.stopPropagation(),e}var sash="",__decorate$1u=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};let DEBUG=!1;var OrthogonalEdge,OrthogonalEdge2;OrthogonalEdge2=OrthogonalEdge||(OrthogonalEdge={}),OrthogonalEdge2.North="north",OrthogonalEdge2.South="south",OrthogonalEdge2.East="east",OrthogonalEdge2.West="west";let globalSize=4;const onDidChangeGlobalSize=new Emitter$1;let globalHoverDelay=300;const onDidChangeHoverDelay=new Emitter$1;class MouseEventFactory{constructor(){this.disposables=new DisposableStore}get onPointerMove(){return this.disposables.add(new DomEmitter(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new DomEmitter(window,"mouseup")).event}dispose(){this.disposables.dispose()}}__decorate$1u([memoize],MouseEventFactory.prototype,"onPointerMove",null),__decorate$1u([memoize],MouseEventFactory.prototype,"onPointerUp",null);class GestureEventFactory{constructor(e){this.el=e,this.disposables=new DisposableStore}get onPointerMove(){return this.disposables.add(new DomEmitter(this.el,EventType.Change)).event}get onPointerUp(){return this.disposables.add(new DomEmitter(this.el,EventType.End)).event}dispose(){this.disposables.dispose()}}__decorate$1u([memoize],GestureEventFactory.prototype,"onPointerMove",null),__decorate$1u([memoize],GestureEventFactory.prototype,"onPointerUp",null);class OrthogonalPointerEventFactory{constructor(e){this.factory=e}get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}dispose(){}}__decorate$1u([memoize],OrthogonalPointerEventFactory.prototype,"onPointerMove",null),__decorate$1u([memoize],OrthogonalPointerEventFactory.prototype,"onPointerUp",null);const PointerEventsDisabledCssClass="pointer-events-disabled";class Sash extends Disposable{constructor(e,t,n){super(),this.hoverDelay=globalHoverDelay,this.hoverDelayer=this._register(new Delayer(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new Emitter$1),this._onDidStart=this._register(new Emitter$1),this._onDidChange=this._register(new Emitter$1),this._onDidReset=this._register(new Emitter$1),this._onDidEnd=this._register(new Emitter$1),this.orthogonalStartSashDisposables=this._register(new DisposableStore),this.orthogonalStartDragHandleDisposables=this._register(new DisposableStore),this.orthogonalEndSashDisposables=this._register(new DisposableStore),this.orthogonalEndDragHandleDisposables=this._register(new DisposableStore),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=append$1(e,$$c(".monaco-sash")),n.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${n.orthogonalEdge}`),isMacintosh&&this.el.classList.add("mac");const i=this._register(new DomEmitter(this.el,"mousedown")).event;this._register(i((e=>this.onPointerStart(e,new MouseEventFactory)),this));const o=this._register(new DomEmitter(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new DomEmitter(this.el,"mouseenter")).event;this._register(r((()=>Sash.onMouseEnter(this))));const s=this._register(new DomEmitter(this.el,"mouseleave")).event;this._register(s((()=>Sash.onMouseLeave(this)))),this._register(Gesture.addTarget(this.el));const a=Event$1.map(this._register(new DomEmitter(this.el,EventType.Start)).event,(e=>{var t;return Object.assign(Object.assign({},e),{target:null!==(t=e.initialTarget)&&void 0!==t?t:null})}));this._register(a((e=>this.onPointerStart(e,new GestureEventFactory(this.el))),this));const l=this._register(new DomEmitter(this.el,EventType.Tap)).event,c=Event$1.map(Event$1.filter(Event$1.debounce(l,((e,t)=>{var n;return{event:t,count:(null!==(n=null==e?void 0:e.count)&&void 0!==n?n:0)+1}}),250),(({count:e})=>2===e)),(({event:e})=>{var t;return Object.assign(Object.assign({},e),{target:null!==(t=e.initialTarget)&&void 0!==t?t:null})}));this._register(c(this.onPointerDoublePress,this)),"number"==typeof n.size?(this.size=n.size,0===n.orientation?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=globalSize,this._register(onDidChangeGlobalSize.event((e=>{this.size=e,this.layout()})))),this._register(onDidChangeHoverDelay.event((e=>this.hoverDelay=e))),this.layoutProvider=t,this.orthogonalStartSash=n.orthogonalStartSash,this.orthogonalEndSash=n.orthogonalEndSash,this.orientation=n.orientation||0,1===this.orientation?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",DEBUG),this.layout()}get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",0===e),this.el.classList.toggle("minimum",1===e),this.el.classList.toggle("maximum",2===e),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=t=>{this.orthogonalStartDragHandleDisposables.clear(),0!==t&&(this._orthogonalStartDragHandle=append$1(this.el,$$c(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(toDisposable((()=>this._orthogonalStartDragHandle.remove()))),this.orthogonalStartDragHandleDisposables.add(new DomEmitter(this._orthogonalStartDragHandle,"mouseenter")).event((()=>Sash.onMouseEnter(e)),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new DomEmitter(this._orthogonalStartDragHandle,"mouseleave")).event((()=>Sash.onMouseLeave(e)),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}set orthogonalEndSash(e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=t=>{this.orthogonalEndDragHandleDisposables.clear(),0!==t&&(this._orthogonalEndDragHandle=append$1(this.el,$$c(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(toDisposable((()=>this._orthogonalEndDragHandle.remove()))),this.orthogonalEndDragHandleDisposables.add(new DomEmitter(this._orthogonalEndDragHandle,"mouseenter")).event((()=>Sash.onMouseEnter(e)),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new DomEmitter(this._orthogonalEndDragHandle,"mouseleave")).event((()=>Sash.onMouseLeave(e)),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}onPointerStart(e,t){EventHelper.stop(e);let n=!1;if(!e.__orthogonalSashEvent){const i=this.getOrthogonalSash(e);i&&(n=!0,e.__orthogonalSashEvent=!0,i.onPointerStart(e,new OrthogonalPointerEventFactory(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new OrthogonalPointerEventFactory(t))),!this.state)return;const i=getElementsByTagName("iframe");for(const u of i)u.classList.add(PointerEventsDisabledCssClass);const o=e.pageX,r=e.pageY,s=e.altKey,a={startX:o,currentX:o,startY:r,currentY:r,altKey:s};this.el.classList.add("active"),this._onDidStart.fire(a);const l=createStyleSheet(this.el),c=()=>{let e="";e=n?"all-scroll":1===this.orientation?1===this.state?"s-resize":2===this.state?"n-resize":isMacintosh?"row-resize":"ns-resize":1===this.state?"e-resize":2===this.state?"w-resize":isMacintosh?"col-resize":"ew-resize",l.textContent=`* { cursor: ${e} !important; }`},d=new DisposableStore;c(),n||this.onDidEnablementChange.event(c,null,d);t.onPointerMove((e=>{EventHelper.stop(e,!1);const t={startX:o,currentX:e.pageX,startY:r,currentY:e.pageY,altKey:s};this._onDidChange.fire(t)}),null,d),t.onPointerUp((e=>{EventHelper.stop(e,!1),this.el.removeChild(l),this.el.classList.remove("active"),this._onDidEnd.fire(),d.dispose();for(const t of i)t.classList.remove(PointerEventsDisabledCssClass)}),null,d),d.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger((()=>e.el.classList.add("hover")),e.hoverDelay).then(void 0,(()=>{})),!t&&e.linkedSash&&Sash.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Sash.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Sash.onMouseLeave(this)}layout(){if(0===this.orientation){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){if(e.target&&e.target instanceof HTMLElement)return e.target.classList.contains("orthogonal-drag-handle")?e.target.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash:void 0}dispose(){super.dispose(),this.el.remove()}}class StableEditorScrollState{constructor(e,t,n){this._visiblePosition=e,this._visiblePositionScrollDelta=t,this._cursorPosition=n}static capture(e){let t=null,n=0;if(0!==e.getScrollTop()){const i=e.getVisibleRanges();if(i.length>0){t=i[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);n=e.getScrollTop()-o}}return new StableEditorScrollState(t,n,e.getPosition())}restore(e){if(this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){const t=e.getPosition();if(!this._cursorPosition||!t)return;const n=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+n)}}var diffReview="";const DataTransfers={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Mimes.text,TERMINALS:"Terminals"};class DragAndDropData{constructor(e){this.data=e}update(){}getData(){return this.data}}const StaticDND={CurrentDragAndDropData:void 0};var actionbar="";class BaseActionViewItem extends Disposable{constructor(e,t,n={}){super(),this.options=n,this._context=e||this,this._action=t,t instanceof Action&&this._register(t.onDidChange((e=>{this.element&&this.handleActionChangeEvent(e)})))}handleActionChangeEvent(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new ActionRunner)),this._actionRunner}set actionRunner(e){this._actionRunner=e}getAction(){return this._action}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(Gesture.addTarget(e));const n=this.options&&this.options.draggable;n&&(e.draggable=!0,isFirefox&&this._register(addDisposableListener(e,EventType$1.DRAG_START,(e=>{var t;return null===(t=e.dataTransfer)||void 0===t?void 0:t.setData(DataTransfers.TEXT,this._action.label)})))),this._register(addDisposableListener(t,EventType.Tap,(e=>this.onClick(e,!0)))),this._register(addDisposableListener(t,EventType$1.MOUSE_DOWN,(e=>{n||EventHelper.stop(e,!0),this._action.enabled&&0===e.button&&t.classList.add("active")}))),isMacintosh&&this._register(addDisposableListener(t,EventType$1.CONTEXT_MENU,(e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)}))),this._register(addDisposableListener(t,EventType$1.CLICK,(e=>{EventHelper.stop(e,!0),this.options&&this.options.isMenu||this.onClick(e)}))),this._register(addDisposableListener(t,EventType$1.DBLCLICK,(e=>{EventHelper.stop(e,!0)}))),[EventType$1.MOUSE_UP,EventType$1.MOUSE_OUT].forEach((e=>{this._register(addDisposableListener(t,e,(e=>{EventHelper.stop(e),t.classList.remove("active")})))}))}onClick(e,t=!1){var n;EventHelper.stop(e,!0);const i=isUndefinedOrNull(this._context)?(null===(n=this.options)||void 0===n?void 0:n.useEventAsContext)?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}updateTooltip(){}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),super.dispose()}}class ActionViewItem extends BaseActionViewItem{constructor(e,t,n={}){super(e,t,n),this.options=n,this.options.icon=void 0!==n.icon&&n.icon,this.options.label=void 0===n.label||n.label,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=append$1(this.element,$$c("a.action-label"))),this.label&&(this._action.id===Separator.ID?this.label.setAttribute("role","presentation"):this.options.isMenu?this.label.setAttribute("role","menuitem"):this.label.setAttribute("role","button")),this.options.label&&this.options.keybinding&&this.element&&(append$1(this.element,$$c("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.getAction().label)}updateTooltip(){let e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=localize({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e&&this.label&&(this.label.title=e)}updateClass(){this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getAction().class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):this.label&&this.label.classList.remove("codicon")}updateEnabled(){this.getAction().enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),this.element&&this.element.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),this.element&&this.element.classList.add("disabled"))}updateChecked(){this.label&&(this.getAction().checked?this.label.classList.add("checked"):this.label.classList.remove("checked"))}}var __awaiter$12=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class ActionBar extends Disposable{constructor(e,t={}){var n,i,o,r,s,a;let l,c;switch(super(),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new Emitter$1),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new Emitter$1({onFirstListenerAdd:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new Emitter$1),this.onDidRun=this._onDidRun.event,this._onBeforeRun=this._register(new Emitter$1),this.onBeforeRun=this._onBeforeRun.event,this.options=t,this._context=null!==(n=t.context)&&void 0!==n?n:null,this._orientation=null!==(i=this.options.orientation)&&void 0!==i?i:0,this._triggerKeys={keyDown:null!==(r=null===(o=this.options.triggerKeys)||void 0===o?void 0:o.keyDown)&&void 0!==r&&r,keys:null!==(a=null===(s=this.options.triggerKeys)||void 0===s?void 0:s.keys)&&void 0!==a?a:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new ActionRunner,this._register(this._actionRunner)),this._register(this._actionRunner.onDidRun((e=>this._onDidRun.fire(e)))),this._register(this._actionRunner.onBeforeRun((e=>this._onBeforeRun.fire(e)))),this._actionIds=[],this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",!1!==t.animated&&this.domNode.classList.add("animated"),this._orientation){case 0:l=[15],c=[17];break;case 1:l=[16],c=[18],this.domNode.className+=" vertical"}this._register(addDisposableListener(this.domNode,EventType$1.KEY_DOWN,(e=>{const t=new StandardKeyboardEvent(e);let n=!0;const i="number"==typeof this.focusedItem?this.viewItems[this.focusedItem]:void 0;l&&(t.equals(l[0])||t.equals(l[1]))?n=this.focusPrevious():c&&(t.equals(c[0])||t.equals(c[1]))?n=this.focusNext():t.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():t.equals(14)?n=this.focusFirst():t.equals(13)?n=this.focusLast():t.equals(2)&&i instanceof BaseActionViewItem&&i.trapsArrowNavigation?n=this.focusNext():this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown?this.doTrigger(t):this.triggerKeyDown=!0:n=!1,n&&(t.preventDefault(),t.stopPropagation())}))),this._register(addDisposableListener(this.domNode,EventType$1.KEY_UP,(e=>{const t=new StandardKeyboardEvent(e);this.isTriggerKeyEvent(t)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(t)),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026))&&this.updateFocusedItem()}))),this.focusTracker=this._register(trackFocus(this.domNode)),this._register(this.focusTracker.onDidBlur((()=>{getActiveElement()!==this.domNode&&isAncestor$1(getActiveElement(),this.domNode)||(this._onDidBlur.fire(),this.focusedItem=void 0,this.previouslyFocusedItem=void 0,this.triggerKeyDown=!1)}))),this._register(this.focusTracker.onDidFocus((()=>this.updateFocusedItem()))),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.actionsList.setAttribute("role","toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=2?this.actionsList.setAttribute("role","toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const e=this.viewItems.find((e=>e instanceof BaseActionViewItem&&e.isEnabled()));e instanceof BaseActionViewItem&&e.setFocusable(!0)}else this.viewItems.forEach((e=>{e instanceof BaseActionViewItem&&e.setFocusable(!1)}))}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach((n=>{t=t||e.equals(n)})),t}updateFocusedItem(){for(let e=0;e<this.actionsList.children.length;e++){const t=this.actionsList.children[e];if(isAncestor$1(getActiveElement(),t)){this.focusedItem=e;break}}}get context(){return this._context}set context(e){this._context=e,this.viewItems.forEach((t=>t.setActionContext(e)))}get actionRunner(){return this._actionRunner}set actionRunner(e){e&&(this._actionRunner=e,this.viewItems.forEach((t=>t.actionRunner=e)))}getContainer(){return this.domNode}push(e,t={}){const n=Array.isArray(e)?e:[e];let i=isNumber$1(t.index)?t.index:null;n.forEach((e=>{const n=document.createElement("li");let o;n.className="action-item",n.setAttribute("role","presentation"),this.options.allowContextMenu||this._register(addDisposableListener(n,EventType$1.CONTEXT_MENU,(e=>{EventHelper.stop(e,!0)}))),this.options.actionViewItemProvider&&(o=this.options.actionViewItemProvider(e)),o||(o=new ActionViewItem(this.context,e,t)),o.actionRunner=this._actionRunner,o.setActionContext(this.context),o.render(n),this.focusable&&o instanceof BaseActionViewItem&&0===this.viewItems.length&&o.setFocusable(!0),null===i||i<0||i>=this.actionsList.children.length?(this.actionsList.appendChild(n),this.viewItems.push(o),this._actionIds.push(e.id)):(this.actionsList.insertBefore(n,this.actionsList.children[i]),this.viewItems.splice(i,0,o),this._actionIds.splice(i,0,e.id),i++)})),"number"==typeof this.focusedItem&&this.focus(this.focusedItem),this.refreshRole()}clear(){dispose(this.viewItems),this.viewItems=[],this._actionIds=[],clearNode(this.actionsList),this.refreshRole()}length(){return this.viewItems.length}focus(e){let t,n=!1;if(void 0===e?n=!0:"number"==typeof e?t=e:"boolean"==typeof e&&(n=e),n&&void 0===this.focusedItem){const e=this.viewItems.findIndex((e=>e.isEnabled()));this.focusedItem=-1===e?void 0:e,this.updateFocus(void 0,void 0,!0)}else void 0!==t&&(this.focusedItem=t),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(void 0===this.focusedItem)this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&this.options.focusOnlyEnabledItems&&!n.isEnabled());return this.updateFocus(),!0}focusPrevious(e){if(void 0===this.focusedItem)this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let n;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}n=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&this.options.focusOnlyEnabledItems&&!n.isEnabled());return this.updateFocus(!0),!0}updateFocus(e,t,n=!1){var i;void 0===this.focusedItem&&this.actionsList.focus({preventScroll:t}),void 0!==this.previouslyFocusedItem&&this.previouslyFocusedItem!==this.focusedItem&&(null===(i=this.viewItems[this.previouslyFocusedItem])||void 0===i||i.blur());const o=void 0!==this.focusedItem&&this.viewItems[this.focusedItem];if(o){let i=!0;isFunction(o.focus)||(i=!1),this.options.focusOnlyEnabledItems&&isFunction(o.isEnabled)&&!o.isEnabled()&&(i=!1),i?(n||this.previouslyFocusedItem!==this.focusedItem)&&(o.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(void 0===this.focusedItem)return;const t=this.viewItems[this.focusedItem];if(t instanceof BaseActionViewItem){const n=null===t._context||void 0===t._context?e:t._context;this.run(t._action,n)}}run(e,t){return __awaiter$12(this,void 0,void 0,(function*(){yield this._actionRunner.run(e,t)}))}dispose(){dispose(this.viewItems),this.viewItems=[],this._actionIds=[],this.getContainer().remove(),super.dispose()}}const Extensions$1={IconContribution:"base.contributions.icons"};var IconContribution;(IconContribution||(IconContribution={})).getDefinition=function(e,t){let n=e.defaults;for(;ThemeIcon.isThemeIcon(n);){const e=iconRegistry.getIcon(n.id);if(!e)return;n=e.defaults}return n};class IconRegistry{constructor(){this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:localize("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:localize("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${CSSIcon.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,n,i){const o=this.iconsById[e];if(o){if(n&&!o.description){o.description=n,this.iconSchema.properties[e].markdownDescription=`${n} $(${e})`;const t=this.iconReferenceSchema.enum.indexOf(e);-1!==t&&(this.iconReferenceSchema.enumDescriptions[t]=n),this._onDidChange.fire()}return o}let r={id:e,description:n,defaults:t,deprecationMessage:i};this.iconsById[e]=r;let s={$ref:"#/definitions/icons"};return i&&(s.deprecationMessage=i),n&&(s.markdownDescription=`${n}: $(${e})`),this.iconSchema.properties[e]=s,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(n||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map((e=>this.iconsById[e]))}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(e,t)=>e.id.localeCompare(t.id),t=e=>{for(;ThemeIcon.isThemeIcon(e.defaults);)e=this.iconsById[e.defaults.id];return`codicon codicon-${e?e.id:""}`};let n=[];n.push("| preview | identifier | default codicon ID | description"),n.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const i=Object.keys(this.iconsById).map((e=>this.iconsById[e]));for(const o of i.filter((e=>!!e.description)).sort(e))n.push(`|<i class="${t(o)}"></i>|${o.id}|${ThemeIcon.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);n.push("| preview | identifier "),n.push("| ----------- | --------------------------------- |");for(const o of i.filter((e=>!ThemeIcon.isThemeIcon(e.defaults))).sort(e))n.push(`|<i class="${t(o)}"></i>|${o.id}|`);return n.join("\n")}}const iconRegistry=new IconRegistry;function registerIcon(e,t,n,i){return iconRegistry.registerIcon(e,t,n,i)}function getIconRegistry(){return iconRegistry}function initialize(){for(const e of Codicon.getAll())iconRegistry.registerIcon(e.id,e.definition,e.description)}Registry.add(Extensions$1.IconContribution,iconRegistry),initialize();const iconsSchemaId="vscode://schemas/icons";let schemaRegistry=Registry.as(Extensions$5.JSONContribution);schemaRegistry.registerSchema(iconsSchemaId,iconRegistry.getIconSchema());const delayer=new RunOnceScheduler((()=>schemaRegistry.notifySchemaChanged(iconsSchemaId)),200);iconRegistry.onDidChange((()=>{delayer.isScheduled()||delayer.schedule()}));const widgetClose=registerIcon("widget-close",Codicon.close,localize("widgetClose","Icon for the close action in widgets."));registerIcon("goto-previous-location",Codicon.arrowUp,localize("previousChangeIcon","Icon for goto previous editor location.")),registerIcon("goto-next-location",Codicon.arrowDown,localize("nextChangeIcon","Icon for goto next editor location.")),ThemeIcon.modify(Codicon.sync,"spin"),ThemeIcon.modify(Codicon.loading,"spin");var __decorate$1t=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1p=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$11=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},_a$a;const DIFF_LINES_PADDING=3;class DiffEntry{constructor(e,t,n,i){this.originalLineStart=e,this.originalLineEnd=t,this.modifiedLineStart=n,this.modifiedLineEnd=i}getType(){return 0===this.originalLineStart?1:0===this.modifiedLineStart?2:0}}class Diff{constructor(e){this.entries=e}}const diffReviewInsertIcon=registerIcon("diff-review-insert",Codicon.add,localize("diffReviewInsertIcon","Icon for 'Insert' in diff review.")),diffReviewRemoveIcon=registerIcon("diff-review-remove",Codicon.remove,localize("diffReviewRemoveIcon","Icon for 'Remove' in diff review.")),diffReviewCloseIcon=registerIcon("diff-review-close",Codicon.close,localize("diffReviewCloseIcon","Icon for 'Close' in diff review."));let DiffReview=class e extends Disposable{constructor(e,t){super(),this._languageService=t,this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=createFastDomNode(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=createFastDomNode(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new ActionBar(this.actionBarContainer.domNode)),this._actionBar.push(new Action("diffreview.close",localize("label.close","Close"),"close-diff-review "+ThemeIcon.asClassName(diffReviewCloseIcon),!0,(()=>__awaiter$11(this,void 0,void 0,(function*(){return this.hide()})))),{label:!1,icon:!0}),this.domNode=createFastDomNode(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=createFastDomNode(document.createElement("div")),this._content.setClassName("diff-review-content"),this._content.setAttribute("role","code"),this.scrollbar=this._register(new DomScrollableElement(this._content.domNode,{})),this.domNode.domNode.appendChild(this.scrollbar.getDomNode()),this._register(e.onDidUpdateDiff((()=>{this._isVisible&&(this._diffs=this._compute(),this._render())}))),this._register(e.getModifiedEditor().onDidChangeCursorPosition((()=>{this._isVisible&&this._render()}))),this._register(addStandardDisposableListener(this.domNode.domNode,"click",(e=>{e.preventDefault();const t=findParentWithClass(e.target,"diff-review-row");t&&this._goToRow(t)}))),this._register(addStandardDisposableListener(this.domNode.domNode,"keydown",(e=>{(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),this._goToRow(this._getNextRow())),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),this._goToRow(this._getPrevRow())),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033))&&(e.preventDefault(),this.hide()),(e.equals(10)||e.equals(3))&&(e.preventDefault(),this.accept())}))),this._diffs=[],this._currentDiff=null}prev(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let t=-1;for(let e=0,n=this._diffs.length;e<n;e++)if(this._diffs[e]===this._currentDiff){t=e;break}e=this._diffs.length+t-1}else e=this._findDiffIndex(this._diffEditor.getPosition());if(0===this._diffs.length)return;e%=this._diffs.length;const t=this._diffs[e].entries;this._diffEditor.setPosition(new Position$1(t[0].modifiedLineStart,1)),this._diffEditor.setSelection({startColumn:1,startLineNumber:t[0].modifiedLineStart,endColumn:1073741824,endLineNumber:t[t.length-1].modifiedLineEnd}),this._isVisible=!0,this._diffEditor.doLayout(),this._render(),this._goToRow(this._getNextRow())}next(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let t=-1;for(let e=0,n=this._diffs.length;e<n;e++)if(this._diffs[e]===this._currentDiff){t=e;break}e=t+1}else e=this._findDiffIndex(this._diffEditor.getPosition());if(0===this._diffs.length)return;e%=this._diffs.length;const t=this._diffs[e].entries;this._diffEditor.setPosition(new Position$1(t[0].modifiedLineStart,1)),this._diffEditor.setSelection({startColumn:1,startLineNumber:t[0].modifiedLineStart,endColumn:1073741824,endLineNumber:t[t.length-1].modifiedLineEnd}),this._isVisible=!0,this._diffEditor.doLayout(),this._render(),this._goToRow(this._getNextRow())}accept(){let e=-1;const t=this._getCurrentFocusedRow();if(t){const n=parseInt(t.getAttribute("data-line"),10);isNaN(n)||(e=n)}this.hide(),-1!==e&&(this._diffEditor.setPosition(new Position$1(e,1)),this._diffEditor.revealPosition(new Position$1(e,1),1))}hide(){this._isVisible=!1,this._diffEditor.updateOptions({readOnly:!1}),this._diffEditor.focus(),this._diffEditor.doLayout(),this._render()}_getPrevRow(){const e=this._getCurrentFocusedRow();return e?e.previousElementSibling?e.previousElementSibling:e:this._getFirstRow()}_getNextRow(){const e=this._getCurrentFocusedRow();return e?e.nextElementSibling?e.nextElementSibling:e:this._getFirstRow()}_getFirstRow(){return this.domNode.domNode.querySelector(".diff-review-row")}_getCurrentFocusedRow(){const e=document.activeElement;return e&&/diff-review-row/.test(e.className)?e:null}_goToRow(e){const t=this._getCurrentFocusedRow();e.tabIndex=0,e.focus(),t&&t!==e&&(t.tabIndex=-1),this.scrollbar.scanDomNode()}isVisible(){return this._isVisible}layout(e,t,n){this._width=t,this.shadow.setTop(e-6),this.shadow.setWidth(t),this.shadow.setHeight(this._isVisible?6:0),this.domNode.setTop(e),this.domNode.setWidth(t),this.domNode.setHeight(n),this._content.setHeight(n),this._content.setWidth(t),this._isVisible?(this.actionBarContainer.setAttribute("aria-hidden","false"),this.actionBarContainer.setDisplay("block")):(this.actionBarContainer.setAttribute("aria-hidden","true"),this.actionBarContainer.setDisplay("none"))}_compute(){const t=this._diffEditor.getLineChanges();if(!t||0===t.length)return[];const n=this._diffEditor.getOriginalEditor().getModel(),i=this._diffEditor.getModifiedEditor().getModel();return n&&i?e._mergeAdjacent(t,n.getLineCount(),i.getLineCount()):[]}static _mergeAdjacent(e,t,n){if(!e||0===e.length)return[];const i=[];let o=0;for(let l=0,c=e.length;l<c;l++){const r=e[l],s=r.originalStartLineNumber,a=r.originalEndLineNumber,d=r.modifiedStartLineNumber,u=r.modifiedEndLineNumber,h=[];let g=0;{const t=0===a?s:s-1,n=0===u?d:d-1;let i=1,o=1;if(l>0){const t=e[l-1];i=0===t.originalEndLineNumber?t.originalStartLineNumber+1:t.originalEndLineNumber+1,o=0===t.modifiedEndLineNumber?t.modifiedStartLineNumber+1:t.modifiedEndLineNumber+1}let r=t-DIFF_LINES_PADDING+1,c=n-DIFF_LINES_PADDING+1;if(r<i){const e=i-r;r+=e,c+=e}if(c<o){const e=o-c;r+=e,c+=e}h[g++]=new DiffEntry(r,t,c,n)}0!==a&&(h[g++]=new DiffEntry(s,a,0,0)),0!==u&&(h[g++]=new DiffEntry(0,0,d,u));{const i=0===a?s+1:a+1,o=0===u?d+1:u+1;let r=t,p=n;if(l+1<c){const t=e[l+1];r=0===t.originalEndLineNumber?t.originalStartLineNumber:t.originalStartLineNumber-1,p=0===t.modifiedEndLineNumber?t.modifiedStartLineNumber:t.modifiedStartLineNumber-1}let f=i+DIFF_LINES_PADDING-1,m=o+DIFF_LINES_PADDING-1;if(f>r){const e=r-f;f+=e,m+=e}if(m>p){const e=p-m;f+=e,m+=e}h[g++]=new DiffEntry(i,f,o,m)}i[o++]=new Diff(h)}let r=i[0].entries;const s=[];let a=0;for(let l=1,c=i.length;l<c;l++){const e=i[l].entries,t=r[r.length-1],n=e[0];0===t.getType()&&0===n.getType()&&n.originalLineStart<=t.originalLineEnd?(r[r.length-1]=new DiffEntry(t.originalLineStart,n.originalLineEnd,t.modifiedLineStart,n.modifiedLineEnd),r=r.concat(e.slice(1))):(s[a++]=new Diff(r),r=e)}return s[a++]=new Diff(r),s}_findDiffIndex(e){const t=e.lineNumber;for(let n=0,i=this._diffs.length;n<i;n++){const e=this._diffs[n].entries;if(t<=e[e.length-1].modifiedLineEnd)return n}return 0}_render(){const t=this._diffEditor.getOriginalEditor().getOptions(),n=this._diffEditor.getModifiedEditor().getOptions(),i=this._diffEditor.getOriginalEditor().getModel(),o=this._diffEditor.getModifiedEditor().getModel(),r=i.getOptions(),s=o.getOptions();if(!this._isVisible||!i||!o)return clearNode(this._content.domNode),this._currentDiff=null,void this.scrollbar.scanDomNode();this._diffEditor.updateOptions({readOnly:!0});const a=this._findDiffIndex(this._diffEditor.getPosition());if(this._diffs[a]===this._currentDiff)return;this._currentDiff=this._diffs[a];const l=this._diffs[a].entries,c=document.createElement("div");c.className="diff-review-table",c.setAttribute("role","list"),c.setAttribute("aria-label",'Difference review. Use "Stage | Unstage | Revert Selected Ranges" commands'),applyFontInfo(c,n.get(44));let d=0,u=0,h=0,g=0;for(let e=0,w=l.length;e<w;e++){const t=l[e],n=t.originalLineStart,i=t.originalLineEnd,o=t.modifiedLineStart,r=t.modifiedLineEnd;0!==n&&(0===d||n<d)&&(d=n),0!==i&&(0===u||i>u)&&(u=i),0!==o&&(0===h||o<h)&&(h=o),0!==r&&(0===g||r>g)&&(g=r)}const p=document.createElement("div");p.className="diff-review-row";const f=document.createElement("div");f.className="diff-review-cell diff-review-summary";const m=u-d+1,v=g-h+1;f.appendChild(document.createTextNode(`${a+1}/${this._diffs.length}: @@ -${d},${m} +${h},${v} @@`)),p.setAttribute("data-line",String(h));const _=e=>0===e?localize("no_lines_changed","no lines changed"):1===e?localize("one_line_changed","1 line changed"):localize("more_lines_changed","{0} lines changed",e),C=_(m),b=_(v);p.setAttribute("aria-label",localize({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",a+1,this._diffs.length,d,C,h,b)),p.appendChild(f),p.setAttribute("role","listitem"),c.appendChild(p);const y=n.get(59);let S=h;for(let w=0,E=l.length;w<E;w++){const a=l[w];e._renderSection(c,a,S,y,this._width,t,i,r,n,o,s,this._languageService.languageIdCodec),0!==a.modifiedLineStart&&(S=a.modifiedLineEnd)}clearNode(this._content.domNode),this._content.domNode.appendChild(c),this.scrollbar.scanDomNode()}static _renderSection(t,n,i,o,r,s,a,l,c,d,u,h){const g=n.getType();let p="diff-review-row",f="";let m=null;switch(g){case 1:p="diff-review-row line-insert",f=" char-insert",m=diffReviewInsertIcon;break;case 2:p="diff-review-row line-delete",f=" char-delete",m=diffReviewRemoveIcon}const v=n.originalLineStart,_=n.originalLineEnd,C=n.modifiedLineStart,b=n.modifiedLineEnd,y=Math.max(b-C,_-v),S=s.get(131),w=S.glyphMarginWidth+S.lineNumbersWidth,E=c.get(131),x=10+E.glyphMarginWidth+E.lineNumbersWidth;for(let T=0;T<=y;T++){const n=0===v?0:v+T,_=0===C?0:C+T,b=document.createElement("div");b.style.minWidth=r+"px",b.className=p,b.setAttribute("role","listitem"),0!==_&&(i=_),b.setAttribute("data-line",String(i));const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${o}px`,b.appendChild(y);const S=document.createElement("span");S.style.width=w+"px",S.style.minWidth=w+"px",S.className="diff-review-line-number"+f,0!==n?S.appendChild(document.createTextNode(String(n))):S.innerText=" ",y.appendChild(S);const E=document.createElement("span");E.style.width=x+"px",E.style.minWidth=x+"px",E.style.paddingRight="10px",E.className="diff-review-line-number"+f,0!==_?E.appendChild(document.createTextNode(String(_))):E.innerText=" ",y.appendChild(E);const I=document.createElement("span");if(I.className="diff-review-spacer",m){const e=document.createElement("span");e.className=ThemeIcon.asClassName(m),e.innerText=" ",I.appendChild(e)}else I.innerText=" ";let k;if(y.appendChild(I),0!==_){let t=this._renderLine(d,c,u.tabSize,_,h);e._ttPolicy&&(t=e._ttPolicy.createHTML(t)),y.insertAdjacentHTML("beforeend",t),k=d.getLineContent(_)}else{let t=this._renderLine(a,s,l.tabSize,n,h);e._ttPolicy&&(t=e._ttPolicy.createHTML(t)),y.insertAdjacentHTML("beforeend",t),k=a.getLineContent(n)}0===k.length&&(k=localize("blankLine","blank"));let L="";switch(g){case 0:L=n===_?localize({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",k,n):localize("equalLine","{0} original line {1} modified line {2}",k,n,_);break;case 1:L=localize("insertLine","+ {0} modified line {1}",k,_);break;case 2:L=localize("deleteLine","- {0} original line {1}",k,n)}b.setAttribute("aria-label",L),t.appendChild(b)}}static _renderLine(e,t,n,i,o){const r=e.getLineContent(i),s=t.get(44),a=LineTokens.createEmpty(r,o),l=ViewLineRenderingData.isBasicASCII(r,e.mightContainNonBasicASCII()),c=ViewLineRenderingData.containsRTL(r,l,e.mightContainRTL());return renderViewLine2(new RenderLineInput(s.isMonospace&&!t.get(29),s.canUseHalfwidthRightwardsArrow,r,!1,l,c,0,a,[],n,0,s.spaceWidth,s.middotWidth,s.wsmiddotWidth,t.get(105),t.get(88),t.get(83),t.get(45)!==EditorFontLigatures.OFF,null)).html}};DiffReview._ttPolicy=null===(_a$a=window.trustedTypes)||void 0===_a$a?void 0:_a$a.createPolicy("diffReview",{createHTML:e=>e}),DiffReview=__decorate$1t([__param$1p(1,ILanguageService)],DiffReview),registerThemingParticipant(((e,t)=>{const n=e.getColor(editorLineNumbers);n&&t.addRule(`.monaco-diff-editor .diff-review-line-number { color: ${n}; }`);const i=e.getColor(scrollbarShadow);i&&t.addRule(`.monaco-diff-editor .diff-review-shadow { box-shadow: ${i} 0 -6px 6px -6px inset; }`)}));class DiffReviewNext extends EditorAction{constructor(){super({id:"editor.action.diffReview.next",label:localize("editor.action.diffReview.next","Go to Next Difference"),alias:"Go to Next Difference",precondition:ContextKeyExpr.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:65,weight:100}})}run(e,t){const n=findFocusedDiffEditor(e);n&&n.diffReviewNext()}}class DiffReviewPrev extends EditorAction{constructor(){super({id:"editor.action.diffReview.prev",label:localize("editor.action.diffReview.prev","Go to Previous Difference"),alias:"Go to Previous Difference",precondition:ContextKeyExpr.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:1089,weight:100}})}run(e,t){const n=findFocusedDiffEditor(e);n&&n.diffReviewPrev()}}function findFocusedDiffEditor(e){const t=e.get(ICodeEditorService),n=t.listDiffEditors(),i=t.getActiveCodeEditor();if(!i)return null;for(let o=0,r=n.length;o<r;o++){const e=n[o];if(e.getModifiedEditor().getId()===i.getId()||e.getOriginalEditor().getId()===i.getId())return e}return null}registerEditorAction(DiffReviewNext),registerEditorAction(DiffReviewPrev);const ID_EDITOR_WORKER_SERVICE="editorWorkerService",IEditorWorkerService=createDecorator(ID_EDITOR_WORKER_SERVICE),IContextViewService=createDecorator("contextViewService"),IContextMenuService=createDecorator("contextMenuService");var __awaiter$10=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class InlineDiffMargin extends Disposable{constructor(e,t,n,i,o,r){super(),this._viewZoneId=e,this._marginDomNode=t,this.editor=n,this.diff=i,this._contextMenuService=o,this._clipboardService=r,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=Codicon.lightBulb.classNames+" lightbulb-glyph",this._diffActions.style.position="absolute";const s=n.getOption(59),a=n.getModel().getEOL();this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${s}px`,this._diffActions.style.lineHeight=`${s}px`,this._marginDomNode.appendChild(this._diffActions);const l=[],c=0===i.modifiedEndLineNumber;l.push(new Action("diff.clipboard.copyDeletedContent",c?i.originalEndLineNumber>i.modifiedStartLineNumber?localize("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):localize("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):i.originalEndLineNumber>i.modifiedStartLineNumber?localize("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):localize("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,(()=>__awaiter$10(this,void 0,void 0,(function*(){const e=new Range$2(i.originalStartLineNumber,1,i.originalEndLineNumber+1,1),t=i.originalModel.getValueInRange(e);yield this._clipboardService.writeText(t)})))));let d,u=0;i.originalEndLineNumber>i.modifiedStartLineNumber&&(d=new Action("diff.clipboard.copyDeletedLineContent",c?localize("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",i.originalStartLineNumber):localize("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",i.originalStartLineNumber),void 0,!0,(()=>__awaiter$10(this,void 0,void 0,(function*(){const e=i.originalModel.getLineContent(i.originalStartLineNumber+u);if(""===e){const e=i.originalModel.getEndOfLineSequence();yield this._clipboardService.writeText(0===e?"\n":"\r\n")}else yield this._clipboardService.writeText(e)})))),l.push(d));n.getOption(81)||l.push(new Action("diff.inline.revertChange",localize("diff.inline.revertChange.label","Revert this change"),void 0,!0,(()=>__awaiter$10(this,void 0,void 0,(function*(){const e=new Range$2(i.originalStartLineNumber,1,i.originalEndLineNumber,i.originalModel.getLineMaxColumn(i.originalEndLineNumber)),t=i.originalModel.getValueInRange(e);if(0===i.modifiedEndLineNumber){const e=n.getModel().getLineMaxColumn(i.modifiedStartLineNumber);n.executeEdits("diffEditor",[{range:new Range$2(i.modifiedStartLineNumber,e,i.modifiedStartLineNumber,e),text:a+t}])}else{const e=n.getModel().getLineMaxColumn(i.modifiedEndLineNumber);n.executeEdits("diffEditor",[{range:new Range$2(i.modifiedStartLineNumber,1,i.modifiedEndLineNumber,e),text:t}])}})))));const h=(e,t)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:e,y:t}),getActions:()=>(d&&(d.label=c?localize("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",i.originalStartLineNumber+u):localize("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",i.originalStartLineNumber+u)),l),autoSelectFirstItem:!0})};this._register(addStandardDisposableListener(this._diffActions,"mousedown",(e=>{const{top:t,height:n}=getDomNodePagePosition(this._diffActions),i=Math.floor(s/3);e.preventDefault(),h(e.posx,t+n+i)}))),this._register(n.onMouseMove((e=>{if(8===e.target.type||5===e.target.type){e.target.detail.viewZoneId===this._viewZoneId?(this.visibility=!0,u=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,s)):this.visibility=!1}else this.visibility=!1}))),this._register(n.onMouseDown((e=>{if(e.event.rightButton&&(8===e.target.type||5===e.target.type)){e.target.detail.viewZoneId===this._viewZoneId&&(e.event.preventDefault(),u=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,s),h(e.event.posx,e.event.posy+s))}})))}get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}_updateLightBulbPosition(e,t,n){const{top:i}=getDomNodePagePosition(e),o=t-i,r=Math.floor(o/n),s=r*n;if(this._diffActions.style.top=`${s}px`,this.diff.viewLineCounts){let e=0;for(let t=0;t<this.diff.viewLineCounts.length;t++)if(e+=this.diff.viewLineCounts[t],r<e)return t}return r}}const IClipboardService=createDecorator("clipboardService");Object.freeze({total(){},worked(){},done(){}});class Progress{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}Progress.None=Object.freeze({report(){}});const IEditorProgressService=createDecorator("editorProgressService");var __decorate$1s=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1o=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},_a$9;class VisualEditorState{constructor(e,t){this._contextMenuService=e,this._clipboardService=t,this._zones=[],this._inlineDiffMargins=[],this._zonesMap={},this._decorations=[]}getForeignViewZones(e){return e.filter((e=>!this._zonesMap[String(e.id)]))}clean(e){this._zones.length>0&&e.changeViewZones((e=>{for(const t of this._zones)e.removeZone(t)})),this._zones=[],this._zonesMap={},this._decorations=e.deltaDecorations(this._decorations,[])}apply(e,t,n,i){const o=i?StableEditorScrollState.capture(e):null;e.changeViewZones((t=>{var i;for(const e of this._zones)t.removeZone(e);for(const e of this._inlineDiffMargins)e.dispose();this._zones=[],this._zonesMap={},this._inlineDiffMargins=[];for(let o=0,r=n.zones.length;o<r;o++){const r=n.zones[o];r.suppressMouseDown=!0;const s=t.addZone(r);this._zones.push(s),this._zonesMap[String(s)]=!0,n.zones[o].diff&&r.marginDomNode&&(r.suppressMouseDown=!1,0!==(null===(i=n.zones[o].diff)||void 0===i?void 0:i.originalModel.getValueLength())&&this._inlineDiffMargins.push(new InlineDiffMargin(s,r.marginDomNode,e,n.zones[o].diff,this._contextMenuService,this._clipboardService)))}})),o&&o.restore(e),this._decorations=e.deltaDecorations(this._decorations,n.decorations),t&&t.setZones(n.overviewZones)}}let DIFF_EDITOR_ID=0;const diffInsertIcon=registerIcon("diff-insert",Codicon.add,localize("diffInsertIcon","Line decoration for inserts in the diff editor.")),diffRemoveIcon=registerIcon("diff-remove",Codicon.remove,localize("diffRemoveIcon","Line decoration for removals in the diff editor.")),ttPolicy$3=null===(_a$9=window.trustedTypes)||void 0===_a$9?void 0:_a$9.createPolicy("diffEditorWidget",{createHTML:e=>e});let DiffEditorWidget=class e extends Disposable{constructor(t,n,i,o,r,s,a,l,c,d,u,h){super(),this._editorProgressService=h,this._onDidDispose=this._register(new Emitter$1),this.onDidDispose=this._onDidDispose.event,this._onDidUpdateDiff=this._register(new Emitter$1),this.onDidUpdateDiff=this._onDidUpdateDiff.event,this._onDidContentSizeChange=this._register(new Emitter$1),this._lastOriginalWarning=null,this._lastModifiedWarning=null,this._editorWorkerService=r,this._codeEditorService=l,this._contextKeyService=this._register(s.createScoped(t)),this._instantiationService=a.createChild(new ServiceCollection([IContextKeyService,this._contextKeyService])),this._contextKeyService.createKey("isInDiffEditor",!0),this._themeService=c,this._notificationService=d,this._id=++DIFF_EDITOR_ID,this._state=0,this._updatingDiffProgress=null,this._domElement=t,n=n||{},this._options=validateDiffEditorOptions(n,{enableSplitViewResizing:!0,renderSideBySide:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit"}),void 0!==n.isInEmbeddedEditor?this._contextKeyService.createKey("isInEmbeddedDiffEditor",n.isInEmbeddedEditor):this._contextKeyService.createKey("isInEmbeddedDiffEditor",!1),this._updateDecorationsRunner=this._register(new RunOnceScheduler((()=>this._updateDecorations()),0)),this._containerDomElement=document.createElement("div"),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide),this._containerDomElement.style.position="relative",this._containerDomElement.style.height="100%",this._domElement.appendChild(this._containerDomElement),this._overviewViewportDomElement=createFastDomNode(document.createElement("div")),this._overviewViewportDomElement.setClassName("diffViewport"),this._overviewViewportDomElement.setPosition("absolute"),this._overviewDomElement=document.createElement("div"),this._overviewDomElement.className="diffOverview",this._overviewDomElement.style.position="absolute",this._overviewDomElement.appendChild(this._overviewViewportDomElement.domNode),this._register(addStandardDisposableListener(this._overviewDomElement,"mousedown",(e=>{this._modifiedEditor.delegateVerticalScrollbarMouseDown(e)}))),this._options.renderOverviewRuler&&this._containerDomElement.appendChild(this._overviewDomElement),this._originalDomNode=document.createElement("div"),this._originalDomNode.className="editor original",this._originalDomNode.style.position="absolute",this._originalDomNode.style.height="100%",this._containerDomElement.appendChild(this._originalDomNode),this._modifiedDomNode=document.createElement("div"),this._modifiedDomNode.className="editor modified",this._modifiedDomNode.style.position="absolute",this._modifiedDomNode.style.height="100%",this._containerDomElement.appendChild(this._modifiedDomNode),this._beginUpdateDecorationsTimeout=-1,this._currentlyChangingViewZones=!1,this._diffComputationToken=0,this._originalEditorState=new VisualEditorState(u,o),this._modifiedEditorState=new VisualEditorState(u,o),this._isVisible=!0,this._isHandlingScrollEvent=!1,this._elementSizeObserver=this._register(new ElementSizeObserver(this._containerDomElement,n.dimension)),this._register(this._elementSizeObserver.onDidChange((()=>this._onDidContainerSizeChanged()))),n.automaticLayout&&this._elementSizeObserver.startObserving(),this._diffComputationResult=null,this._originalEditor=this._createLeftHandSideEditor(n,i.originalEditor||{}),this._modifiedEditor=this._createRightHandSideEditor(n,i.modifiedEditor||{}),this._originalOverviewRuler=null,this._modifiedOverviewRuler=null,this._reviewPane=a.createInstance(DiffReview,this),this._containerDomElement.appendChild(this._reviewPane.domNode.domNode),this._containerDomElement.appendChild(this._reviewPane.shadow.domNode),this._containerDomElement.appendChild(this._reviewPane.actionBarContainer.domNode),this._options.renderSideBySide?this._setStrategy(new DiffEditorWidgetSideBySide(this._createDataSource(),this._options.enableSplitViewResizing)):this._setStrategy(new DiffEditorWidgetInline(this._createDataSource(),this._options.enableSplitViewResizing)),this._register(c.onDidColorThemeChange((t=>{this._strategy&&this._strategy.applyColors(t)&&this._updateDecorationsRunner.schedule(),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide)})));const g=EditorExtensionsRegistry.getDiffEditorContributions();for(const e of g)try{this._register(a.createInstance(e.ctor,this))}catch(p){onUnexpectedError(p)}this._codeEditorService.addDiffEditor(this)}_setState(e){this._state!==e&&(this._state=e,this._updatingDiffProgress&&(this._updatingDiffProgress.done(),this._updatingDiffProgress=null),1===this._state&&(this._updatingDiffProgress=this._editorProgressService.show(!0,1e3)))}diffReviewNext(){this._reviewPane.next()}diffReviewPrev(){this._reviewPane.prev()}static _getClassName(e,t){let n="monaco-diff-editor monaco-editor-background ";return t&&(n+="side-by-side "),n+=getThemeTypeSelector(e.type),n}_recreateOverviewRulers(){this._options.renderOverviewRuler&&(this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this._originalEditor.hasModel()&&(this._originalOverviewRuler=this._originalEditor.createOverviewRuler("original diffOverviewRuler"),this._overviewDomElement.appendChild(this._originalOverviewRuler.getDomNode())),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()),this._modifiedEditor.hasModel()&&(this._modifiedOverviewRuler=this._modifiedEditor.createOverviewRuler("modified diffOverviewRuler"),this._overviewDomElement.appendChild(this._modifiedOverviewRuler.getDomNode())),this._layoutOverviewRulers())}_createLeftHandSideEditor(t,n){const i=this._createInnerEditor(this._instantiationService,this._originalDomNode,this._adjustOptionsForLeftHandSide(t),n);this._register(i.onDidScrollChange((e=>{this._isHandlingScrollEvent||(e.scrollTopChanged||e.scrollLeftChanged||e.scrollHeightChanged)&&(this._isHandlingScrollEvent=!0,this._modifiedEditor.setScrollPosition({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())}))),this._register(i.onDidChangeViewZones((()=>{this._onViewZonesChanged()}))),this._register(i.onDidChangeConfiguration((e=>{i.getModel()&&(e.hasChanged(44)&&this._updateDecorationsRunner.schedule(),e.hasChanged(132)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))}))),this._register(i.onDidChangeHiddenAreas((()=>{this._updateDecorationsRunner.cancel(),this._updateDecorations()}))),this._register(i.onDidChangeModelContent((()=>{this._isVisible&&this._beginUpdateDecorationsSoon()})));const o=this._contextKeyService.createKey("isInDiffLeftEditor",i.hasWidgetFocus());return this._register(i.onDidFocusEditorWidget((()=>o.set(!0)))),this._register(i.onDidBlurEditorWidget((()=>o.set(!1)))),this._register(i.onDidContentSizeChange((t=>{const n=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+e.ONE_OVERVIEW_WIDTH,i=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:i,contentWidth:n,contentHeightChanged:t.contentHeightChanged,contentWidthChanged:t.contentWidthChanged})}))),i}_createRightHandSideEditor(t,n){const i=this._createInnerEditor(this._instantiationService,this._modifiedDomNode,this._adjustOptionsForRightHandSide(t),n);this._register(i.onDidScrollChange((e=>{this._isHandlingScrollEvent||(e.scrollTopChanged||e.scrollLeftChanged||e.scrollHeightChanged)&&(this._isHandlingScrollEvent=!0,this._originalEditor.setScrollPosition({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())}))),this._register(i.onDidChangeViewZones((()=>{this._onViewZonesChanged()}))),this._register(i.onDidChangeConfiguration((e=>{i.getModel()&&(e.hasChanged(44)&&this._updateDecorationsRunner.schedule(),e.hasChanged(132)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))}))),this._register(i.onDidChangeHiddenAreas((()=>{this._updateDecorationsRunner.cancel(),this._updateDecorations()}))),this._register(i.onDidChangeModelContent((()=>{this._isVisible&&this._beginUpdateDecorationsSoon()}))),this._register(i.onDidChangeModelOptions((e=>{e.tabSize&&this._updateDecorationsRunner.schedule()})));const o=this._contextKeyService.createKey("isInDiffRightEditor",i.hasWidgetFocus());return this._register(i.onDidFocusEditorWidget((()=>o.set(!0)))),this._register(i.onDidBlurEditorWidget((()=>o.set(!1)))),this._register(i.onDidContentSizeChange((t=>{const n=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+e.ONE_OVERVIEW_WIDTH,i=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:i,contentWidth:n,contentHeightChanged:t.contentHeightChanged,contentWidthChanged:t.contentWidthChanged})}))),i}_createInnerEditor(e,t,n,i){return e.createInstance(CodeEditorWidget,t,n,i)}dispose(){this._codeEditorService.removeDiffEditor(this),-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._cleanViewZonesAndDecorations(),this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()),this._overviewDomElement.removeChild(this._overviewViewportDomElement.domNode),this._options.renderOverviewRuler&&this._containerDomElement.removeChild(this._overviewDomElement),this._containerDomElement.removeChild(this._originalDomNode),this._originalEditor.dispose(),this._containerDomElement.removeChild(this._modifiedDomNode),this._modifiedEditor.dispose(),this._strategy.dispose(),this._containerDomElement.removeChild(this._reviewPane.domNode.domNode),this._containerDomElement.removeChild(this._reviewPane.shadow.domNode),this._containerDomElement.removeChild(this._reviewPane.actionBarContainer.domNode),this._reviewPane.dispose(),this._domElement.removeChild(this._containerDomElement),this._onDidDispose.fire(),super.dispose()}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return EditorType.IDiffEditor}getLineChanges(){return this._diffComputationResult?this._diffComputationResult.changes:null}getOriginalEditor(){return this._originalEditor}getModifiedEditor(){return this._modifiedEditor}updateOptions(t){const n=validateDiffEditorOptions(t,this._options),i=changedDiffEditorOptions(this._options,n);this._options=n;const o=i.ignoreTrimWhitespace||i.renderIndicators,r=this._isVisible&&(i.maxComputationTime||i.maxFileSize);o?this._beginUpdateDecorations():r&&this._beginUpdateDecorationsSoon(),this._modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(t)),this._originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(t)),this._strategy.setEnableSplitViewResizing(this._options.enableSplitViewResizing),i.renderSideBySide&&(this._options.renderSideBySide?this._setStrategy(new DiffEditorWidgetSideBySide(this._createDataSource(),this._options.enableSplitViewResizing)):this._setStrategy(new DiffEditorWidgetInline(this._createDataSource(),this._options.enableSplitViewResizing)),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide)),i.renderOverviewRuler&&(this._options.renderOverviewRuler?this._containerDomElement.appendChild(this._overviewDomElement):this._containerDomElement.removeChild(this._overviewDomElement))}getModel(){return{original:this._originalEditor.getModel(),modified:this._modifiedEditor.getModel()}}setModel(e){if(e&&(!e.original||!e.modified))throw new Error(e.original?"DiffEditorWidget.setModel: Modified model is null":"DiffEditorWidget.setModel: Original model is null");this._cleanViewZonesAndDecorations(),this._originalEditor.setModel(e?e.original:null),this._modifiedEditor.setModel(e?e.modified:null),this._updateDecorationsRunner.cancel(),e&&(this._originalEditor.setScrollTop(0),this._modifiedEditor.setScrollTop(0)),this._diffComputationResult=null,this._diffComputationToken++,this._setState(0),e&&(this._recreateOverviewRulers(),this._beginUpdateDecorations()),this._layoutOverviewViewport()}getContainerDomNode(){return this._domElement}getVisibleColumnFromPosition(e){return this._modifiedEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._modifiedEditor.getPosition()}setPosition(e,t="api"){this._modifiedEditor.setPosition(e,t)}revealLine(e,t=0){this._modifiedEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._modifiedEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._modifiedEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._modifiedEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._modifiedEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._modifiedEditor.revealPositionNearTop(e,t)}getSelection(){return this._modifiedEditor.getSelection()}getSelections(){return this._modifiedEditor.getSelections()}setSelection(e,t="api"){this._modifiedEditor.setSelection(e,t)}setSelections(e,t="api"){this._modifiedEditor.setSelections(e,t)}revealLines(e,t,n=0){this._modifiedEditor.revealLines(e,t,n)}revealLinesInCenter(e,t,n=0){this._modifiedEditor.revealLinesInCenter(e,t,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._modifiedEditor.revealLinesInCenterIfOutsideViewport(e,t,n)}revealLinesNearTop(e,t,n=0){this._modifiedEditor.revealLinesNearTop(e,t,n)}revealRange(e,t=0,n=!1,i=!0){this._modifiedEditor.revealRange(e,t,n,i)}revealRangeInCenter(e,t=0){this._modifiedEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._modifiedEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._modifiedEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._modifiedEditor.getSupportedActions()}saveViewState(){return{original:this._originalEditor.saveViewState(),modified:this._modifiedEditor.saveViewState()}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._originalEditor.restoreViewState(t.original),this._modifiedEditor.restoreViewState(t.modified)}}layout(e){this._elementSizeObserver.observe(e)}focus(){this._modifiedEditor.focus()}hasTextFocus(){return this._originalEditor.hasTextFocus()||this._modifiedEditor.hasTextFocus()}trigger(e,t,n){this._modifiedEditor.trigger(e,t,n)}changeDecorations(e){return this._modifiedEditor.changeDecorations(e)}_onDidContainerSizeChanged(){this._doLayout()}_getReviewHeight(){return this._reviewPane.isVisible()?this._elementSizeObserver.getHeight():0}_layoutOverviewRulers(){if(!this._options.renderOverviewRuler)return;if(!this._originalOverviewRuler||!this._modifiedOverviewRuler)return;const t=this._elementSizeObserver.getHeight(),n=this._getReviewHeight(),i=e.ENTIRE_DIFF_OVERVIEW_WIDTH-2*e.ONE_OVERVIEW_WIDTH;this._modifiedEditor.getLayoutInfo()&&(this._originalOverviewRuler.setLayout({top:0,width:e.ONE_OVERVIEW_WIDTH,right:i+e.ONE_OVERVIEW_WIDTH,height:t-n}),this._modifiedOverviewRuler.setLayout({top:0,right:0,width:e.ONE_OVERVIEW_WIDTH,height:t-n}))}_onViewZonesChanged(){this._currentlyChangingViewZones||this._updateDecorationsRunner.schedule()}_beginUpdateDecorationsSoon(){-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._beginUpdateDecorationsTimeout=window.setTimeout((()=>this._beginUpdateDecorations()),e.UPDATE_DIFF_DECORATIONS_DELAY)}static _equals(e,t){return!e&&!t||!(!e||!t)&&e.toString()===t.toString()}_beginUpdateDecorations(){this._beginUpdateDecorationsTimeout=-1;const t=this._originalEditor.getModel(),n=this._modifiedEditor.getModel();if(!t||!n)return;this._diffComputationToken++;const i=this._diffComputationToken,o=1024*this._options.maxFileSize*1024,r=e=>{const t=e.getValueLength();return 0===o||t<=o};r(t)&&r(n)?(this._setState(1),this._editorWorkerService.computeDiff(t.uri,n.uri,this._options.ignoreTrimWhitespace,this._options.maxComputationTime).then((e=>{i===this._diffComputationToken&&t===this._originalEditor.getModel()&&n===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=e,this._updateDecorationsRunner.schedule(),this._onDidUpdateDiff.fire())}),(e=>{i===this._diffComputationToken&&t===this._originalEditor.getModel()&&n===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=null,this._updateDecorationsRunner.schedule())}))):e._equals(t.uri,this._lastOriginalWarning)&&e._equals(n.uri,this._lastModifiedWarning)||(this._lastOriginalWarning=t.uri,this._lastModifiedWarning=n.uri,this._notificationService.warn(localize("diff.tooLarge","Cannot compare files because one file is too large.")))}_cleanViewZonesAndDecorations(){this._originalEditorState.clean(this._originalEditor),this._modifiedEditorState.clean(this._modifiedEditor)}_updateDecorations(){if(!this._originalEditor.getModel()||!this._modifiedEditor.getModel())return;const e=this._diffComputationResult?this._diffComputationResult.changes:[],t=this._originalEditorState.getForeignViewZones(this._originalEditor.getWhitespaces()),n=this._modifiedEditorState.getForeignViewZones(this._modifiedEditor.getWhitespaces()),i=this._strategy.getEditorsDiffDecorations(e,this._options.ignoreTrimWhitespace,this._options.renderIndicators,t,n);try{this._currentlyChangingViewZones=!0,this._originalEditorState.apply(this._originalEditor,this._originalOverviewRuler,i.original,!1),this._modifiedEditorState.apply(this._modifiedEditor,this._modifiedOverviewRuler,i.modified,!0)}finally{this._currentlyChangingViewZones=!1}}_adjustOptionsForSubEditor(e){const t=Object.assign({},e);return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._options.diffCodeLens,t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,t}_adjustOptionsForLeftHandSide(e){const t=this._adjustOptionsForSubEditor(e);return this._options.renderSideBySide?t.wordWrapOverride1=this._options.diffWordWrap:(t.wordWrapOverride1="off",t.wordWrapOverride2="off"),e.originalAriaLabel&&(t.ariaLabel=e.originalAriaLabel),t.readOnly=!this._options.originalEditable,t.extraEditorClassName="original-in-monaco-diff-editor",Object.assign(Object.assign({},t),{dimension:{height:0,width:0}})}_adjustOptionsForRightHandSide(t){const n=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(n.ariaLabel=t.modifiedAriaLabel),n.wordWrapOverride1=this._options.diffWordWrap,n.revealHorizontalRightPadding=EditorOptions.revealHorizontalRightPadding.defaultValue+e.ENTIRE_DIFF_OVERVIEW_WIDTH,n.scrollbar.verticalHasArrows=!1,n.extraEditorClassName="modified-in-monaco-diff-editor",Object.assign(Object.assign({},n),{dimension:{height:0,width:0}})}doLayout(){this._elementSizeObserver.observe(),this._doLayout()}_doLayout(){const t=this._elementSizeObserver.getWidth(),n=this._elementSizeObserver.getHeight(),i=this._getReviewHeight(),o=this._strategy.layout();this._originalDomNode.style.width=o+"px",this._originalDomNode.style.left="0px",this._modifiedDomNode.style.width=t-o+"px",this._modifiedDomNode.style.left=o+"px",this._overviewDomElement.style.top="0px",this._overviewDomElement.style.height=n-i+"px",this._overviewDomElement.style.width=e.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewDomElement.style.left=t-e.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewViewportDomElement.setWidth(e.ENTIRE_DIFF_OVERVIEW_WIDTH),this._overviewViewportDomElement.setHeight(30),this._originalEditor.layout({width:o,height:n-i}),this._modifiedEditor.layout({width:t-o-(this._options.renderOverviewRuler?e.ENTIRE_DIFF_OVERVIEW_WIDTH:0),height:n-i}),(this._originalOverviewRuler||this._modifiedOverviewRuler)&&this._layoutOverviewRulers(),this._reviewPane.layout(n-i,t,i),this._layoutOverviewViewport()}_layoutOverviewViewport(){const e=this._computeOverviewViewport();e?(this._overviewViewportDomElement.setTop(e.top),this._overviewViewportDomElement.setHeight(e.height)):(this._overviewViewportDomElement.setTop(0),this._overviewViewportDomElement.setHeight(0))}_computeOverviewViewport(){const e=this._modifiedEditor.getLayoutInfo();if(!e)return null;const t=this._modifiedEditor.getScrollTop(),n=this._modifiedEditor.getScrollHeight(),i=Math.max(0,e.height),o=Math.max(0,i-0),r=n>0?o/n:0;return{height:Math.max(0,Math.floor(e.height*r)),top:Math.floor(t*r)}}_createDataSource(){return{getWidth:()=>this._elementSizeObserver.getWidth(),getHeight:()=>this._elementSizeObserver.getHeight()-this._getReviewHeight(),getOptions:()=>({renderOverviewRuler:this._options.renderOverviewRuler}),getContainerDomNode:()=>this._containerDomElement,relayoutEditors:()=>{this._doLayout()},getOriginalEditor:()=>this._originalEditor,getModifiedEditor:()=>this._modifiedEditor}}_setStrategy(e){this._strategy&&this._strategy.dispose(),this._strategy=e,e.applyColors(this._themeService.getColorTheme()),this._diffComputationResult&&this._updateDecorations(),this._doLayout()}_getLineChangeAtOrBeforeLineNumber(e,t){const n=this._diffComputationResult?this._diffComputationResult.changes:[];if(0===n.length||e<t(n[0]))return null;let i=0,o=n.length-1;for(;i<o;){const r=Math.floor((i+o)/2),s=t(n[r]),a=r+1<=o?t(n[r+1]):1073741824;e<s?o=r-1:e>=a?i=r+1:(i=r,o=r)}return n[i]}_getEquivalentLineForOriginalLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,(e=>e.originalStartLineNumber));if(!t)return e;const n=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),i=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,r=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,s=e-n;return s<=o?i+Math.min(s,r):i+r-o+s}_getEquivalentLineForModifiedLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,(e=>e.modifiedStartLineNumber));if(!t)return e;const n=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),i=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,r=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,s=e-i;return s<=r?n+Math.min(s,o):n+o-r+s}getDiffLineInformationForOriginal(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForOriginalLineNumber(e)}:null}getDiffLineInformationForModified(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForModifiedLineNumber(e)}:null}};DiffEditorWidget.ONE_OVERVIEW_WIDTH=15,DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH=30,DiffEditorWidget.UPDATE_DIFF_DECORATIONS_DELAY=200,DiffEditorWidget=__decorate$1s([__param$1o(3,IClipboardService),__param$1o(4,IEditorWorkerService),__param$1o(5,IContextKeyService),__param$1o(6,IInstantiationService),__param$1o(7,ICodeEditorService),__param$1o(8,IThemeService),__param$1o(9,INotificationService),__param$1o(10,IContextMenuService),__param$1o(11,IEditorProgressService)],DiffEditorWidget);class DiffEditorWidgetStyle extends Disposable{constructor(e){super(),this._dataSource=e,this._insertColor=null,this._removeColor=null}applyColors(e){const t=e.getColor(diffOverviewRulerInserted)||(e.getColor(diffInserted)||defaultInsertColor).transparent(2),n=e.getColor(diffOverviewRulerRemoved)||(e.getColor(diffRemoved)||defaultRemoveColor).transparent(2),i=!t.equals(this._insertColor)||!n.equals(this._removeColor);return this._insertColor=t,this._removeColor=n,i}getEditorsDiffDecorations(e,t,n,i,o){o=o.sort(((e,t)=>e.afterLineNumber-t.afterLineNumber)),i=i.sort(((e,t)=>e.afterLineNumber-t.afterLineNumber));const r=this._getViewZones(e,i,o,n),s=this._getOriginalEditorDecorations(r,e,t,n),a=this._getModifiedEditorDecorations(r,e,t,n);return{original:{decorations:s.decorations,overviewZones:s.overviewZones,zones:r.original},modified:{decorations:a.decorations,overviewZones:a.overviewZones,zones:r.modified}}}}class ForeignViewZonesIterator{constructor(e){this._source=e,this._index=-1,this.current=null,this.advance()}advance(){this._index++,this._index<this._source.length?this.current=this._source[this._index]:this.current=null}}class ViewZonesComputer{constructor(e,t,n,i,o){this._lineChanges=e,this._originalForeignVZ=t,this._modifiedForeignVZ=n,this._originalEditor=i,this._modifiedEditor=o}static _getViewLineCount(e,t,n){const i=e.getModel(),o=e._getViewModel();if(i&&o){const e=getViewRange(i,o,t,n);return e.endLineNumber-e.startLineNumber+1}return n-t+1}getViewZones(){const e=this._originalEditor.getOption(59),t=this._modifiedEditor.getOption(59),n=-1!==this._originalEditor.getOption(132).wrappingColumn,i=-1!==this._modifiedEditor.getOption(132).wrappingColumn,o=n||i,r=this._originalEditor.getModel(),s=this._originalEditor._getViewModel().coordinatesConverter,a=this._modifiedEditor._getViewModel().coordinatesConverter,l=[],c=[];let d=0,u=0,h=0,g=0,p=0,f=0;const m=(e,t)=>e.afterLineNumber-t.afterLineNumber,v=(e,t)=>{if(null===t.domNode&&e.length>0){const n=e[e.length-1];if(n.afterLineNumber===t.afterLineNumber&&null===n.domNode)return void(n.heightInLines+=t.heightInLines)}e.push(t)},_=new ForeignViewZonesIterator(this._modifiedForeignVZ),C=new ForeignViewZonesIterator(this._originalForeignVZ);let b=1,y=1;for(let S=0,w=this._lineChanges.length;S<=w;S++){const n=S<w?this._lineChanges[S]:null;null!==n?(h=n.originalStartLineNumber+(n.originalEndLineNumber>0?-1:0),g=n.modifiedStartLineNumber+(n.modifiedEndLineNumber>0?-1:0),u=n.originalEndLineNumber>0?ViewZonesComputer._getViewLineCount(this._originalEditor,n.originalStartLineNumber,n.originalEndLineNumber):0,d=n.modifiedEndLineNumber>0?ViewZonesComputer._getViewLineCount(this._modifiedEditor,n.modifiedStartLineNumber,n.modifiedEndLineNumber):0,p=Math.max(n.originalStartLineNumber,n.originalEndLineNumber),f=Math.max(n.modifiedStartLineNumber,n.modifiedEndLineNumber)):(h+=1e7+u,g+=1e7+d,p=h,f=g);let i=[],E=[];if(o){let e;e=n?n.originalEndLineNumber>0?n.originalStartLineNumber-b:n.modifiedStartLineNumber-y:r.getLineCount()-b+1;for(let t=0;t<e;t++){const e=b+t,n=y+t,o=s.getModelLineViewLineCount(e),r=a.getModelLineViewLineCount(n);o<r?i.push({afterLineNumber:e,heightInLines:r-o,domNode:null,marginDomNode:null}):o>r&&E.push({afterLineNumber:n,heightInLines:o-r,domNode:null,marginDomNode:null})}n&&(b=(n.originalEndLineNumber>0?n.originalEndLineNumber:n.originalStartLineNumber)+1,y=(n.modifiedEndLineNumber>0?n.modifiedEndLineNumber:n.modifiedStartLineNumber)+1)}for(;_.current&&_.current.afterLineNumber<=f;){let e;e=_.current.afterLineNumber<=g?h-g+_.current.afterLineNumber:p;let o=null;n&&n.modifiedStartLineNumber<=_.current.afterLineNumber&&_.current.afterLineNumber<=n.modifiedEndLineNumber&&(o=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),i.push({afterLineNumber:e,heightInLines:_.current.height/t,domNode:null,marginDomNode:o}),_.advance()}for(;C.current&&C.current.afterLineNumber<=p;){let t;t=C.current.afterLineNumber<=h?g-h+C.current.afterLineNumber:f,E.push({afterLineNumber:t,heightInLines:C.current.height/e,domNode:null}),C.advance()}if(null!==n&&isChangeOrInsert(n)){const e=this._produceOriginalFromDiff(n,u,d);e&&i.push(e)}if(null!==n&&isChangeOrDelete(n)){const e=this._produceModifiedFromDiff(n,u,d);e&&E.push(e)}let x=0,T=0;for(i=i.sort(m),E=E.sort(m);x<i.length&&T<E.length;){const e=i[x],t=E[T],n=e.afterLineNumber-h,o=t.afterLineNumber-g;n<o?(v(l,e),x++):o<n?(v(c,t),T++):e.shouldNotShrink?(v(l,e),x++):t.shouldNotShrink?(v(c,t),T++):e.heightInLines>=t.heightInLines?(e.heightInLines-=t.heightInLines,T++):(t.heightInLines-=e.heightInLines,x++)}for(;x<i.length;)v(l,i[x]),x++;for(;T<E.length;)v(c,E[T]),T++}return{original:ViewZonesComputer._ensureDomNodes(l),modified:ViewZonesComputer._ensureDomNodes(c)}}static _ensureDomNodes(e){return e.map((e=>(e.domNode||(e.domNode=createFakeLinesDiv()),e)))}}function createDecoration(e,t,n,i,o){return{range:new Range$2(e,t,n,i),options:o}}const DECORATIONS={charDelete:ModelDecorationOptions.register({description:"diff-editor-char-delete",className:"char-delete"}),charDeleteWholeLine:ModelDecorationOptions.register({description:"diff-editor-char-delete-whole-line",className:"char-delete",isWholeLine:!0}),charInsert:ModelDecorationOptions.register({description:"diff-editor-char-insert",className:"char-insert"}),charInsertWholeLine:ModelDecorationOptions.register({description:"diff-editor-char-insert-whole-line",className:"char-insert",isWholeLine:!0}),lineInsert:ModelDecorationOptions.register({description:"diff-editor-line-insert",className:"line-insert",marginClassName:"gutter-insert",isWholeLine:!0}),lineInsertWithSign:ModelDecorationOptions.register({description:"diff-editor-line-insert-with-sign",className:"line-insert",linesDecorationsClassName:"insert-sign "+ThemeIcon.asClassName(diffInsertIcon),marginClassName:"gutter-insert",isWholeLine:!0}),lineDelete:ModelDecorationOptions.register({description:"diff-editor-line-delete",className:"line-delete",marginClassName:"gutter-delete",isWholeLine:!0}),lineDeleteWithSign:ModelDecorationOptions.register({description:"diff-editor-line-delete-with-sign",className:"line-delete",linesDecorationsClassName:"delete-sign "+ThemeIcon.asClassName(diffRemoveIcon),marginClassName:"gutter-delete",isWholeLine:!0}),lineDeleteMargin:ModelDecorationOptions.register({description:"diff-editor-line-delete-margin",marginClassName:"gutter-delete"})};class DiffEditorWidgetSideBySide extends DiffEditorWidgetStyle{constructor(e,t){super(e),this._disableSash=!1===t,this._sashRatio=null,this._sashPosition=null,this._startSashPosition=null,this._sash=this._register(new Sash(this._dataSource.getContainerDomNode(),this,{orientation:0})),this._disableSash&&(this._sash.state=0),this._sash.onDidStart((()=>this._onSashDragStart())),this._sash.onDidChange((e=>this._onSashDrag(e))),this._sash.onDidEnd((()=>this._onSashDragEnd())),this._sash.onDidReset((()=>this._onSashReset()))}setEnableSplitViewResizing(e){const t=!1===e;this._disableSash!==t&&(this._disableSash=t,this._sash.state=this._disableSash?0:3)}layout(e=this._sashRatio){const t=this._dataSource.getWidth()-(this._dataSource.getOptions().renderOverviewRuler?DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH:0);let n=Math.floor((e||.5)*t);const i=Math.floor(.5*t);return n=this._disableSash?i:n||i,t>2*DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH?(n<DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH&&(n=DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH),n>t-DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH&&(n=t-DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH)):n=i,this._sashPosition!==n&&(this._sashPosition=n),this._sash.layout(),this._sashPosition}_onSashDragStart(){this._startSashPosition=this._sashPosition}_onSashDrag(e){const t=this._dataSource.getWidth()-(this._dataSource.getOptions().renderOverviewRuler?DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH:0),n=this.layout((this._startSashPosition+(e.currentX-e.startX))/t);this._sashRatio=n/t,this._dataSource.relayoutEditors()}_onSashDragEnd(){this._sash.layout()}_onSashReset(){this._sashRatio=.5,this._dataSource.relayoutEditors(),this._sash.layout()}getVerticalSashTop(e){return 0}getVerticalSashLeft(e){return this._sashPosition}getVerticalSashHeight(e){return this._dataSource.getHeight()}_getViewZones(e,t,n){const i=this._dataSource.getOriginalEditor(),o=this._dataSource.getModifiedEditor();return new SideBySideViewZonesComputer(e,t,n,i,o).getViewZones()}_getOriginalEditorDecorations(e,t,n,i){const o=this._dataSource.getOriginalEditor(),r=String(this._removeColor),s={decorations:[],overviewZones:[]},a=o.getModel(),l=o._getViewModel();for(const c of t)if(isChangeOrDelete(c)){s.decorations.push({range:new Range$2(c.originalStartLineNumber,1,c.originalEndLineNumber,1073741824),options:i?DECORATIONS.lineDeleteWithSign:DECORATIONS.lineDelete}),isChangeOrInsert(c)&&c.charChanges||s.decorations.push(createDecoration(c.originalStartLineNumber,1,c.originalEndLineNumber,1073741824,DECORATIONS.charDeleteWholeLine));const e=getViewRange(a,l,c.originalStartLineNumber,c.originalEndLineNumber);if(s.overviewZones.push(new OverviewRulerZone(e.startLineNumber,e.endLineNumber,0,r)),c.charChanges)for(const t of c.charChanges)if(isChangeOrDelete(t))if(n)for(let e=t.originalStartLineNumber;e<=t.originalEndLineNumber;e++){let n,i;n=e===t.originalStartLineNumber?t.originalStartColumn:a.getLineFirstNonWhitespaceColumn(e),i=e===t.originalEndLineNumber?t.originalEndColumn:a.getLineLastNonWhitespaceColumn(e),s.decorations.push(createDecoration(e,n,e,i,DECORATIONS.charDelete))}else s.decorations.push(createDecoration(t.originalStartLineNumber,t.originalStartColumn,t.originalEndLineNumber,t.originalEndColumn,DECORATIONS.charDelete))}return s}_getModifiedEditorDecorations(e,t,n,i){const o=this._dataSource.getModifiedEditor(),r=String(this._insertColor),s={decorations:[],overviewZones:[]},a=o.getModel(),l=o._getViewModel();for(const c of t)if(isChangeOrInsert(c)){s.decorations.push({range:new Range$2(c.modifiedStartLineNumber,1,c.modifiedEndLineNumber,1073741824),options:i?DECORATIONS.lineInsertWithSign:DECORATIONS.lineInsert}),isChangeOrDelete(c)&&c.charChanges||s.decorations.push(createDecoration(c.modifiedStartLineNumber,1,c.modifiedEndLineNumber,1073741824,DECORATIONS.charInsertWholeLine));const e=getViewRange(a,l,c.modifiedStartLineNumber,c.modifiedEndLineNumber);if(s.overviewZones.push(new OverviewRulerZone(e.startLineNumber,e.endLineNumber,0,r)),c.charChanges)for(const t of c.charChanges)if(isChangeOrInsert(t))if(n)for(let e=t.modifiedStartLineNumber;e<=t.modifiedEndLineNumber;e++){let n,i;n=e===t.modifiedStartLineNumber?t.modifiedStartColumn:a.getLineFirstNonWhitespaceColumn(e),i=e===t.modifiedEndLineNumber?t.modifiedEndColumn:a.getLineLastNonWhitespaceColumn(e),s.decorations.push(createDecoration(e,n,e,i,DECORATIONS.charInsert))}else s.decorations.push(createDecoration(t.modifiedStartLineNumber,t.modifiedStartColumn,t.modifiedEndLineNumber,t.modifiedEndColumn,DECORATIONS.charInsert))}return s}}DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH=100;class SideBySideViewZonesComputer extends ViewZonesComputer{constructor(e,t,n,i,o){super(e,t,n,i,o)}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){return null}_produceOriginalFromDiff(e,t,n){return n>t?{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:n-t,domNode:null}:null}_produceModifiedFromDiff(e,t,n){return t>n?{afterLineNumber:Math.max(e.modifiedStartLineNumber,e.modifiedEndLineNumber),heightInLines:t-n,domNode:null}:null}}class DiffEditorWidgetInline extends DiffEditorWidgetStyle{constructor(e,t){super(e),this._decorationsLeft=e.getOriginalEditor().getLayoutInfo().decorationsLeft,this._register(e.getOriginalEditor().onDidLayoutChange((t=>{this._decorationsLeft!==t.decorationsLeft&&(this._decorationsLeft=t.decorationsLeft,e.relayoutEditors())})))}setEnableSplitViewResizing(e){}_getViewZones(e,t,n,i){const o=this._dataSource.getOriginalEditor(),r=this._dataSource.getModifiedEditor();return new InlineViewZonesComputer(e,t,n,o,r,i).getViewZones()}_getOriginalEditorDecorations(e,t,n,i){const o=String(this._removeColor),r={decorations:[],overviewZones:[]},s=this._dataSource.getOriginalEditor(),a=s.getModel(),l=s._getViewModel();let c=0;for(const d of t)if(isChangeOrDelete(d)){for(r.decorations.push({range:new Range$2(d.originalStartLineNumber,1,d.originalEndLineNumber,1073741824),options:DECORATIONS.lineDeleteMargin});c<e.modified.length;){const t=e.modified[c];if(t.diff&&t.diff.originalStartLineNumber>=d.originalStartLineNumber)break;c++}let t=0;if(c<e.modified.length){const n=e.modified[c];n.diff&&n.diff.originalStartLineNumber===d.originalStartLineNumber&&n.diff.originalEndLineNumber===d.originalEndLineNumber&&n.diff.modifiedStartLineNumber===d.modifiedStartLineNumber&&n.diff.modifiedEndLineNumber===d.modifiedEndLineNumber&&(t=n.heightInLines)}const n=getViewRange(a,l,d.originalStartLineNumber,d.originalEndLineNumber);r.overviewZones.push(new OverviewRulerZone(n.startLineNumber,n.endLineNumber,t,o))}return r}_getModifiedEditorDecorations(e,t,n,i){const o=this._dataSource.getModifiedEditor(),r=String(this._insertColor),s={decorations:[],overviewZones:[]},a=o.getModel(),l=o._getViewModel();for(const c of t)if(isChangeOrInsert(c)){s.decorations.push({range:new Range$2(c.modifiedStartLineNumber,1,c.modifiedEndLineNumber,1073741824),options:i?DECORATIONS.lineInsertWithSign:DECORATIONS.lineInsert});const e=getViewRange(a,l,c.modifiedStartLineNumber,c.modifiedEndLineNumber);if(s.overviewZones.push(new OverviewRulerZone(e.startLineNumber,e.endLineNumber,0,r)),c.charChanges){for(const t of c.charChanges)if(isChangeOrInsert(t))if(n)for(let e=t.modifiedStartLineNumber;e<=t.modifiedEndLineNumber;e++){let n,i;n=e===t.modifiedStartLineNumber?t.modifiedStartColumn:a.getLineFirstNonWhitespaceColumn(e),i=e===t.modifiedEndLineNumber?t.modifiedEndColumn:a.getLineLastNonWhitespaceColumn(e),s.decorations.push(createDecoration(e,n,e,i,DECORATIONS.charInsert))}else s.decorations.push(createDecoration(t.modifiedStartLineNumber,t.modifiedStartColumn,t.modifiedEndLineNumber,t.modifiedEndColumn,DECORATIONS.charInsert))}else s.decorations.push(createDecoration(c.modifiedStartLineNumber,1,c.modifiedEndLineNumber,1073741824,DECORATIONS.charInsertWholeLine))}return s}layout(){return Math.max(5,this._decorationsLeft)}}class InlineViewZonesComputer extends ViewZonesComputer{constructor(e,t,n,i,o,r){super(e,t,n,i,o),this._originalModel=i.getModel(),this._renderIndicators=r,this._pendingLineChange=[],this._pendingViewZones=[],this._lineBreaksComputer=this._modifiedEditor._getViewModel().createLineBreaksComputer()}getViewZones(){const e=super.getViewZones();return this._finalize(e),e}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){const e=document.createElement("div");return e.className="inline-added-margin-view-zone",e}_produceOriginalFromDiff(e,t,n){const i=document.createElement("div");return i.className="inline-added-margin-view-zone",{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:n,domNode:document.createElement("div"),marginDomNode:i}}_produceModifiedFromDiff(e,t,n){const i=document.createElement("div");i.className=`view-lines line-delete ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`;const o=document.createElement("div");o.className="inline-deleted-margin-view-zone";const r={shouldNotShrink:!0,afterLineNumber:0===e.modifiedEndLineNumber?e.modifiedStartLineNumber:e.modifiedStartLineNumber-1,heightInLines:t,minWidthInPx:0,domNode:i,marginDomNode:o,diff:{originalStartLineNumber:e.originalStartLineNumber,originalEndLineNumber:e.originalEndLineNumber,modifiedStartLineNumber:e.modifiedStartLineNumber,modifiedEndLineNumber:e.modifiedEndLineNumber,originalModel:this._originalModel,viewLineCounts:null}};for(let s=e.originalStartLineNumber;s<=e.originalEndLineNumber;s++)this._lineBreaksComputer.addRequest(this._originalModel.getLineContent(s),null,null);return this._pendingLineChange.push(e),this._pendingViewZones.push(r),r}_finalize(e){const t=this._modifiedEditor.getOptions(),n=this._modifiedEditor.getModel().getOptions().tabSize,i=t.get(44),o=t.get(29),r=i.typicalHalfwidthCharacterWidth,s=t.get(93),a=this._originalModel.mightContainNonBasicASCII(),l=this._originalModel.mightContainRTL(),c=t.get(59),d=t.get(131).decorationsWidth,u=t.get(105),h=t.get(88),g=t.get(83),p=t.get(45),f=this._lineBreaksComputer.finalize();let m=0;for(let v=0;v<this._pendingLineChange.length;v++){const t=this._pendingLineChange[v],_=this._pendingViewZones[v],C=_.domNode;applyFontInfo(C,i);const b=_.marginDomNode;applyFontInfo(b,i);const y=[];if(t.charChanges)for(const e of t.charChanges)isChangeOrDelete(e)&&y.push(new InlineDecoration(new Range$2(e.originalStartLineNumber,e.originalStartColumn,e.originalEndLineNumber,e.originalEndColumn),"char-delete",0));const S=y.length>0,w=createStringBuilder(1e4);let E=0,x=0,T=null;for(let r=t.originalStartLineNumber;r<=t.originalEndLineNumber;r++){const s=r-t.originalStartLineNumber,v=this._originalModel.getLineTokens(r),C=v.getLineContent(),I=f[m++],k=LineDecoration.filter(y,r,1,C.length+1);if(I){let t=0;for(const e of I.breakOffsets){const r=v.sliceAndInflate(t,e,0),s=C.substring(t,e);E=Math.max(E,this._renderOriginalLine(x++,s,r,LineDecoration.extractWrapped(k,t,e),S,a,l,i,o,c,d,u,h,g,p,n,w,b)),t=e}for(T||(T=[]);T.length<s;)T[T.length]=1;T[s]=I.breakOffsets.length,_.heightInLines+=I.breakOffsets.length-1;const f=document.createElement("div");f.className="gutter-delete",e.original.push({afterLineNumber:r,afterColumn:0,heightInLines:I.breakOffsets.length-1,domNode:createFakeLinesDiv(),marginDomNode:f})}else E=Math.max(E,this._renderOriginalLine(x++,C,v,k,S,a,l,i,o,c,d,u,h,g,p,n,w,b))}E+=s;const I=w.build(),k=ttPolicy$3?ttPolicy$3.createHTML(I):I;if(C.innerHTML=k,_.minWidthInPx=E*r,T){const e=t.originalEndLineNumber-t.originalStartLineNumber;for(;T.length<=e;)T[T.length]=1}_.diff.viewLineCounts=T}e.original.sort(((e,t)=>e.afterLineNumber-t.afterLineNumber))}_renderOriginalLine(e,t,n,i,o,r,s,a,l,c,d,u,h,g,p,f,m,v){m.appendASCIIString('<div class="view-line'),o||m.appendASCIIString(" char-delete"),m.appendASCIIString('" style="top:'),m.appendASCIIString(String(e*c)),m.appendASCIIString('px;width:1000000px;">');const _=ViewLineRenderingData.isBasicASCII(t,r),C=ViewLineRenderingData.containsRTL(t,_,s),b=renderViewLine(new RenderLineInput(a.isMonospace&&!l,a.canUseHalfwidthRightwardsArrow,t,!1,_,C,0,n,i,f,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,u,h,g,p!==EditorFontLigatures.OFF,null),m);if(m.appendASCIIString("</div>"),this._renderIndicators){const t=document.createElement("div");t.className=`delete-sign ${ThemeIcon.asClassName(diffRemoveIcon)}`,t.setAttribute("style",`position:absolute;top:${e*c}px;width:${d}px;height:${c}px;right:0;`),v.appendChild(t)}return b.characterMapping.getAbsoluteOffset(b.characterMapping.length)}}function validateDiffWordWrap(e,t){return stringSet(e,t,["off","on","inherit"])}function isChangeOrInsert(e){return e.modifiedEndLineNumber>0}function isChangeOrDelete(e){return e.originalEndLineNumber>0}function createFakeLinesDiv(){const e=document.createElement("div");return e.className="diagonal-fill",e}function getViewRange(e,t,n,i){const o=e.getLineCount();return n=Math.min(o,Math.max(1,n)),i=Math.min(o,Math.max(1,i)),t.coordinatesConverter.convertModelRangeToViewRange(new Range$2(n,e.getLineMinColumn(n),i,e.getLineMaxColumn(i)))}function validateDiffEditorOptions(e,t){return{enableSplitViewResizing:boolean(e.enableSplitViewResizing,t.enableSplitViewResizing),renderSideBySide:boolean(e.renderSideBySide,t.renderSideBySide),maxComputationTime:clampedInt(e.maxComputationTime,t.maxComputationTime,0,1073741824),maxFileSize:clampedInt(e.maxFileSize,t.maxFileSize,0,1073741824),ignoreTrimWhitespace:boolean(e.ignoreTrimWhitespace,t.ignoreTrimWhitespace),renderIndicators:boolean(e.renderIndicators,t.renderIndicators),originalEditable:boolean(e.originalEditable,t.originalEditable),diffCodeLens:boolean(e.diffCodeLens,t.diffCodeLens),renderOverviewRuler:boolean(e.renderOverviewRuler,t.renderOverviewRuler),diffWordWrap:validateDiffWordWrap(e.diffWordWrap,t.diffWordWrap)}}function changedDiffEditorOptions(e,t){return{enableSplitViewResizing:e.enableSplitViewResizing!==t.enableSplitViewResizing,renderSideBySide:e.renderSideBySide!==t.renderSideBySide,maxComputationTime:e.maxComputationTime!==t.maxComputationTime,maxFileSize:e.maxFileSize!==t.maxFileSize,ignoreTrimWhitespace:e.ignoreTrimWhitespace!==t.ignoreTrimWhitespace,renderIndicators:e.renderIndicators!==t.renderIndicators,originalEditable:e.originalEditable!==t.originalEditable,diffCodeLens:e.diffCodeLens!==t.diffCodeLens,renderOverviewRuler:e.renderOverviewRuler!==t.renderOverviewRuler,diffWordWrap:e.diffWordWrap!==t.diffWordWrap}}registerThemingParticipant(((e,t)=>{const n=e.getColor(diffInserted);n&&t.addRule(`.monaco-editor .char-insert, .monaco-diff-editor .char-insert { background-color: ${n}; }`);const i=e.getColor(diffInsertedLine)||n;i&&t.addRule(`.monaco-editor .line-insert, .monaco-diff-editor .line-insert { background-color: ${i}; }`);const o=e.getColor(diffInsertedLineGutter)||i;o&&(t.addRule(`.monaco-editor .inline-added-margin-view-zone { background-color: ${o}; }`),t.addRule(`.monaco-editor .gutter-insert, .monaco-diff-editor .gutter-insert { background-color: ${o}; }`));const r=e.getColor(diffRemoved);r&&t.addRule(`.monaco-editor .char-delete, .monaco-diff-editor .char-delete { background-color: ${r}; }`);const s=e.getColor(diffRemovedLine)||r;s&&t.addRule(`.monaco-editor .line-delete, .monaco-diff-editor .line-delete { background-color: ${s}; }`);const a=e.getColor(diffRemovedLineGutter)||s;a&&(t.addRule(`.monaco-editor .inline-deleted-margin-view-zone { background-color: ${a}; }`),t.addRule(`.monaco-editor .gutter-delete, .monaco-diff-editor .gutter-delete { background-color: ${a}; }`));const l=e.getColor(diffInsertedOutline);l&&t.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px ${"hc"===e.type?"dashed":"solid"} ${l}; }`);const c=e.getColor(diffRemovedOutline);c&&t.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px ${"hc"===e.type?"dashed":"solid"} ${c}; }`);const d=e.getColor(scrollbarShadow);d&&t.addRule(`.monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px ${d}; }`);const u=e.getColor(diffBorder);u&&t.addRule(`.monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid ${u}; }`);const h=e.getColor(scrollbarSliderBackground);h&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport {\n\t\t\t\tbackground: ${h};\n\t\t\t}\n\t\t`);const g=e.getColor(scrollbarSliderHoverBackground);g&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:hover {\n\t\t\t\tbackground: ${g};\n\t\t\t}\n\t\t`);const p=e.getColor(scrollbarSliderActiveBackground);p&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:active {\n\t\t\t\tbackground: ${p};\n\t\t\t}\n\t\t`);const f=e.getColor(diffDiagonalFill);t.addRule(`\n\t.monaco-editor .diagonal-fill {\n\t\tbackground-image: linear-gradient(\n\t\t\t-45deg,\n\t\t\t${f} 12.5%,\n\t\t\t#0000 12.5%, #0000 50%,\n\t\t\t${f} 50%, ${f} 62.5%,\n\t\t\t#0000 62.5%, #0000 100%\n\t\t);\n\t\tbackground-size: 8px 8px;\n\t}\n\t`)}));const defaultOptions$3={followsCaret:!0,ignoreCharChanges:!0,alwaysRevealFirst:!0};class DiffNavigator extends Disposable{constructor(e,t={}){super(),this._onDidUpdate=this._register(new Emitter$1),this._editor=e,this._options=mixin(t,defaultOptions$3,!1),this.disposed=!1,this.nextIdx=-1,this.ranges=[],this.ignoreSelectionChange=!1,this.revealFirst=Boolean(this._options.alwaysRevealFirst),this._register(this._editor.onDidDispose((()=>this.dispose()))),this._register(this._editor.onDidUpdateDiff((()=>this._onDiffUpdated()))),this._options.followsCaret&&this._register(this._editor.getModifiedEditor().onDidChangeCursorPosition((e=>{this.ignoreSelectionChange||(this.nextIdx=-1)}))),this._options.alwaysRevealFirst&&this._register(this._editor.getModifiedEditor().onDidChangeModel((e=>{this.revealFirst=!0}))),this._init()}_init(){this._editor.getLineChanges()}_onDiffUpdated(){this._init(),this._compute(this._editor.getLineChanges()),this.revealFirst&&null!==this._editor.getLineChanges()&&(this.revealFirst=!1,this.nextIdx=-1,this.next(1))}_compute(e){this.ranges=[],e&&e.forEach((e=>{!this._options.ignoreCharChanges&&e.charChanges?e.charChanges.forEach((e=>{this.ranges.push({rhs:!0,range:new Range$2(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)})})):0===e.modifiedEndLineNumber?this.ranges.push({rhs:!0,range:new Range$2(e.modifiedStartLineNumber,1,e.modifiedStartLineNumber+1,1)}):this.ranges.push({rhs:!0,range:new Range$2(e.modifiedStartLineNumber,1,e.modifiedEndLineNumber+1,1)})})),this.ranges.sort(((e,t)=>Range$2.compareRangesUsingStarts(e.range,t.range))),this._onDidUpdate.fire(this)}_initIdx(e){let t=!1;const n=this._editor.getPosition();if(n){for(let i=0,o=this.ranges.length;i<o&&!t;i++){const o=this.ranges[i].range;n.isBeforeOrEqual(o.getStartPosition())&&(this.nextIdx=i+(e?0:-1),t=!0)}t||(this.nextIdx=e?0:this.ranges.length-1),this.nextIdx<0&&(this.nextIdx=this.ranges.length-1)}else this.nextIdx=0}_move(e,t){if(ok(!this.disposed,"Illegal State - diff navigator has been disposed"),!this.canNavigate())return;-1===this.nextIdx?this._initIdx(e):e?(this.nextIdx+=1,this.nextIdx>=this.ranges.length&&(this.nextIdx=0)):(this.nextIdx-=1,this.nextIdx<0&&(this.nextIdx=this.ranges.length-1));const n=this.ranges[this.nextIdx];this.ignoreSelectionChange=!0;try{const e=n.range.getStartPosition();this._editor.setPosition(e),this._editor.revealRangeInCenter(n.range,t)}finally{this.ignoreSelectionChange=!1}}canNavigate(){return this.ranges&&this.ranges.length>0}next(e=0){this._move(!0,e)}previous(e=0){this._move(!1,e)}dispose(){super.dispose(),this.ranges=[],this.disposed=!0}}var _a$8,_b$1;class StringIterator{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(e){return e.charCodeAt(0)-this._value.charCodeAt(this._pos)}value(){return this._value[this._pos]}}class ConfigKeysIterator{constructor(e=!0){this._caseSensitive=e}reset(e){return this._value=e,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++){if(46===this._value.charCodeAt(this._to)){if(!e)break;this._from++}else e=!1}return this}cmp(e){return this._caseSensitive?compareSubstring(e,this._value,0,e.length,this._from,this._to):compareSubstringIgnoreCase(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class PathIterator{constructor(e=!0,t=!0){this._splitOnBackslash=e,this._caseSensitive=t}reset(e){this._from=0,this._to=0,this._value=e,this._valueLen=e.length;for(let t=e.length-1;t>=0;t--,this._valueLen--){const e=this._value.charCodeAt(t);if(!(47===e||this._splitOnBackslash&&92===e))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let e=!0;for(;this._to<this._valueLen;this._to++){const t=this._value.charCodeAt(this._to);if(47===t||this._splitOnBackslash&&92===t){if(!e)break;this._from++}else e=!1}return this}cmp(e){return this._caseSensitive?compareSubstring(e,this._value,0,e.length,this._from,this._to):compareSubstringIgnoreCase(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class UriIterator{constructor(e){this._ignorePathCasing=e,this._states=[],this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new PathIterator(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5),this._stateIdx=0,this}next(){return 3===this._states[this._stateIdx]&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return 3===this._states[this._stateIdx]&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(1===this._states[this._stateIdx])return compareIgnoreCase(e,this._value.scheme);if(2===this._states[this._stateIdx])return compareIgnoreCase(e,this._value.authority);if(3===this._states[this._stateIdx])return this._pathIterator.cmp(e);if(4===this._states[this._stateIdx])return compare(e,this._value.query);if(5===this._states[this._stateIdx])return compare(e,this._value.fragment);throw new Error}value(){if(1===this._states[this._stateIdx])return this._value.scheme;if(2===this._states[this._stateIdx])return this._value.authority;if(3===this._states[this._stateIdx])return this._pathIterator.value();if(4===this._states[this._stateIdx])return this._value.query;if(5===this._states[this._stateIdx])return this._value.fragment;throw new Error}}class TernarySearchTreeNode{constructor(){this.height=1}rotateLeft(){const e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){const e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){var e,t;return null!==(t=null===(e=this.left)||void 0===e?void 0:e.height)&&void 0!==t?t:0}get heightRight(){var e,t;return null!==(t=null===(e=this.right)||void 0===e?void 0:e.height)&&void 0!==t?t:0}}class TernarySearchTree{constructor(e){this._iter=e}static forUris(e=(()=>!1)){return new TernarySearchTree(new UriIterator(e))}static forStrings(){return new TernarySearchTree(new StringIterator)}static forConfigKeys(){return new TernarySearchTree(new ConfigKeysIterator)}clear(){this._root=void 0}set(e,t){const n=this._iter.reset(e);let i;this._root||(this._root=new TernarySearchTreeNode,this._root.segment=n.value());const o=[];for(i=this._root;;){const e=n.cmp(i.segment);if(e>0)i.left||(i.left=new TernarySearchTreeNode,i.left.segment=n.value()),o.push([-1,i]),i=i.left;else if(e<0)i.right||(i.right=new TernarySearchTreeNode,i.right.segment=n.value()),o.push([1,i]),i=i.right;else{if(!n.hasNext())break;n.next(),i.mid||(i.mid=new TernarySearchTreeNode,i.mid.segment=n.value()),o.push([0,i]),i=i.mid}}const r=i.value;i.value=t,i.key=e;for(let s=o.length-1;s>=0;s--){const e=o[s][1];e.updateHeight();const t=e.balanceFactor();if(t<-1||t>1){const t=o[s][0],n=o[s+1][0];if(1===t&&1===n)o[s][1]=e.rotateLeft();else if(-1===t&&-1===n)o[s][1]=e.rotateRight();else if(1===t&&-1===n)e.right=o[s+1][1]=o[s+1][1].rotateRight(),o[s][1]=e.rotateLeft();else{if(-1!==t||1!==n)throw new Error;e.left=o[s+1][1]=o[s+1][1].rotateLeft(),o[s][1]=e.rotateRight()}if(s>0)switch(o[s-1][0]){case-1:o[s-1][1].left=o[s][1];break;case 1:o[s-1][1].right=o[s][1];break;case 0:o[s-1][1].mid=o[s][1]}else this._root=o[0][1]}}return r}get(e){var t;return null===(t=this._getNode(e))||void 0===t?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let n=this._root;for(;n;){const e=t.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!t.hasNext())break;t.next(),n=n.mid}}return n}has(e){const t=this._getNode(e);return!(void 0===(null==t?void 0:t.value)&&void 0===(null==t?void 0:t.mid))}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var n;const i=this._iter.reset(e),o=[];let r=this._root;for(;r;){const e=i.cmp(r.segment);if(e>0)o.push([-1,r]),r=r.left;else if(e<0)o.push([1,r]),r=r.right;else{if(!i.hasNext())break;i.next(),o.push([0,r]),r=r.mid}}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const e=this._min(r.right),{key:t,value:n,segment:i}=e;this._delete(e.key,!1),r.key=t,r.value=n,r.segment=i}else{const e=null!==(n=r.left)&&void 0!==n?n:r.right;if(o.length>0){const[t,n]=o[o.length-1];switch(t){case-1:n.left=e;break;case 0:n.mid=e;break;case 1:n.right=e}}else this._root=e}for(let e=o.length-1;e>=0;e--){const t=o[e][1];t.updateHeight();const n=t.balanceFactor();if(n>1?(t.right.balanceFactor()>=0||(t.right=t.right.rotateRight()),o[e][1]=t.rotateLeft()):n<-1&&(t.left.balanceFactor()<=0||(t.left=t.left.rotateLeft()),o[e][1]=t.rotateRight()),e>0)switch(o[e-1][0]){case-1:o[e-1][1].left=o[e][1];break;case 1:o[e-1][1].right=o[e][1];break;case 0:o[e-1][1].mid=o[e][1]}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let n,i=this._root;for(;i;){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())break;t.next(),n=i.value||n,i=i.mid}}return i&&i.value||n}findSuperstr(e){const t=this._iter.reset(e);let n=this._root;for(;n;){const e=t.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!t.hasNext())return n.mid?this._entries(n.mid):void 0;t.next(),n=n.mid}}}forEach(e){for(const[t,n]of this)e(n,t)}*[Symbol.iterator](){yield*this._entries(this._root)}*_entries(e){e&&(e.left&&(yield*this._entries(e.left)),e.value&&(yield[e.key,e.value]),e.mid&&(yield*this._entries(e.mid)),e.right&&(yield*this._entries(e.right)))}}class ResourceMapEntry{constructor(e,t){this.uri=e,this.value=t}}class ResourceMap{constructor(e,t){this[_a$8]="ResourceMap",e instanceof ResourceMap?(this.map=new Map(e.map),this.toKey=null!=t?t:ResourceMap.defaultToKey):(this.map=new Map,this.toKey=null!=e?e:ResourceMap.defaultToKey)}set(e,t){return this.map.set(this.toKey(e),new ResourceMapEntry(e,t)),this}get(e){var t;return null===(t=this.map.get(this.toKey(e)))||void 0===t?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){void 0!==t&&(e=e.bind(t));for(let[n,i]of this.map)e(i.value,i.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(_a$8=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}}ResourceMap.defaultToKey=e=>e.toString();class LinkedMap{constructor(){this[_b$1]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return null===(e=this._head)||void 0===e?void 0:e.value}get last(){var e;return null===(e=this._tail)||void 0===e?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const n=this._map.get(e);if(n)return 0!==t&&this.touch(n,t),n.value}set(e,t,n=0){let i=this._map.get(e);if(i)i.value=t,0!==n&&this.touch(i,n);else{switch(i={key:e,value:t,next:void 0,previous:void 0},n){case 0:case 2:default:this.addItemLast(i);break;case 1:this.addItemFirst(i)}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const n=this._state;let i=this._head;for(;i;){if(t?e.bind(t)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){const e=this,t=this._state;let n=this._head;const i={[Symbol.iterator]:()=>i,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const e={value:n.key,done:!1};return n=n.next,e}return{value:void 0,done:!0}}};return i}values(){const e=this,t=this._state;let n=this._head;const i={[Symbol.iterator]:()=>i,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const e={value:n.value,done:!1};return n=n.next,e}return{value:void 0,done:!0}}};return i}entries(){const e=this,t=this._state;let n=this._head;const i={[Symbol.iterator]:()=>i,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const e={value:[n.key,n.value],done:!1};return n=n.next,e}return{value:void 0,done:!0}}};return i}[(_b$1=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(1===t||2===t)if(1===t){if(e===this._head)return;const t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(2===t){if(e===this._tail)return;const t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach(((t,n)=>{e.push([n,t])})),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}class LRUCache extends LinkedMap{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}function or(...e){return function(t,n){for(let i=0,o=e.length;i<o;i++){const o=e[i](t,n);if(o)return o}return null}}_matchesPrefix.bind(void 0,!1);const matchesPrefix=_matchesPrefix.bind(void 0,!0);function _matchesPrefix(e,t,n){if(!n||n.length<t.length)return null;let i;return i=e?startsWithIgnoreCase(n,t):0===n.indexOf(t),i?t.length>0?[{start:0,end:t.length}]:[]:null}function matchesContiguousSubString(e,t){const n=t.toLowerCase().indexOf(e.toLowerCase());return-1===n?null:[{start:n,end:n+e.length}]}function matchesSubString(e,t){return _matchesSubString(e.toLowerCase(),t.toLowerCase(),0,0)}function _matchesSubString(e,t,n,i){if(n===e.length)return[];if(i===t.length)return null;if(e[n]===t[i]){let o=null;return(o=_matchesSubString(e,t,n+1,i+1))?join({start:i,end:i+1},o):null}return _matchesSubString(e,t,n,i+1)}function isLower(e){return 97<=e&&e<=122}function isUpper(e){return 65<=e&&e<=90}function isNumber(e){return 48<=e&&e<=57}function isWhitespace(e){return 32===e||9===e||10===e||13===e}const wordSeparators=new Set;function isAlphanumeric(e){return isLower(e)||isUpper(e)||isNumber(e)}function join(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function nextAnchor(e,t){for(let n=t;n<e.length;n++){const t=e.charCodeAt(n);if(isUpper(t)||isNumber(t)||n>0&&!isAlphanumeric(e.charCodeAt(n-1)))return n}return e.length}function _matchesCamelCase(e,t,n,i){if(n===e.length)return[];if(i===t.length)return null;if(e[n]!==t[i].toLowerCase())return null;{let o=null,r=i+1;for(o=_matchesCamelCase(e,t,n+1,i+1);!o&&(r=nextAnchor(t,r))<t.length;)o=_matchesCamelCase(e,t,n+1,r),r++;return null===o?null:join({start:i,end:i+1},o)}}function analyzeCamelCaseWord(e){let t=0,n=0,i=0,o=0,r=0;for(let s=0;s<e.length;s++)r=e.charCodeAt(s),isUpper(r)&&t++,isLower(r)&&n++,isAlphanumeric(r)&&i++,isNumber(r)&&o++;return{upperPercent:t/e.length,lowerPercent:n/e.length,alphaPercent:i/e.length,numericPercent:o/e.length}}function isUpperCaseWord(e){const{upperPercent:t,lowerPercent:n}=e;return 0===n&&t>.6}function isCamelCaseWord(e){const{upperPercent:t,lowerPercent:n,alphaPercent:i,numericPercent:o}=e;return n>.2&&t<.8&&i>.6&&o<.2}function isCamelCasePattern(e){let t=0,n=0,i=0,o=0;for(let r=0;r<e.length;r++)i=e.charCodeAt(r),isUpper(i)&&t++,isLower(i)&&n++,isWhitespace(i)&&o++;return 0!==t&&0!==n||0!==o?t<=5:e.length<=30}function matchesCamelCase(e,t){if(!t)return null;if(0===(t=t.trim()).length)return null;if(!isCamelCasePattern(e))return null;if(t.length>60)return null;const n=analyzeCamelCaseWord(t);if(!isCamelCaseWord(n)){if(!isUpperCaseWord(n))return null;t=t.toLowerCase()}let i=null,o=0;for(e=e.toLowerCase();o<t.length&&null===(i=_matchesCamelCase(e,t,0,o));)o=nextAnchor(t,o+1);return i}"()[]{}<>`'\"-/;:,.?!".split("").forEach((e=>wordSeparators.add(e.charCodeAt(0))));const fuzzyContiguousFilter=or(matchesPrefix,matchesCamelCase,matchesContiguousSubString),fuzzySeparateFilter=or(matchesPrefix,matchesCamelCase,matchesSubString),fuzzyRegExpCache=new LRUCache(1e4);function matchesFuzzy(e,t,n=!1){if("string"!=typeof e||"string"!=typeof t)return null;let i=fuzzyRegExpCache.get(e);i||(i=new RegExp(convertSimple2RegExpPattern(e),"i"),fuzzyRegExpCache.set(e,i));const o=i.exec(t);return o?[{start:o.index,end:o.index+o[0].length}]:n?fuzzySeparateFilter(e,t):fuzzyContiguousFilter(e,t)}function anyScore(e,t,n,i,o,r){const s=Math.min(13,e.length);for(;n<s;n++){const s=fuzzyScore(e,t,n,i,o,r,!1);if(s)return s}return[0,r]}function createMatches(e){if(void 0===e)return[];const t=[],n=e[1];for(let i=e.length-1;i>1;i--){const o=e[i]+n,r=t[t.length-1];r&&r.end===o?r.end=o+1:t.push({start:o,end:o+1})}return t}const _maxLen=128;function initTable(){const e=[],t=[];for(let n=0;n<=_maxLen;n++)t[n]=0;for(let n=0;n<=_maxLen;n++)e.push(t.slice(0));return e}function initArr(e){const t=[];for(let n=0;n<=e;n++)t[n]=0;return t}const _minWordMatchPos=initArr(2*_maxLen),_maxWordMatchPos=initArr(2*_maxLen),_diag=initTable(),_table=initTable(),_arrows=initTable();function isSeparatorAtPos(e,t){if(t<0||t>=e.length)return!1;const n=e.codePointAt(t);switch(n){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 40:case 91:return!0;case void 0:return!1;default:return!!isEmojiImprecise(n)}}function isWhitespaceAtPos(e,t){if(t<0||t>=e.length)return!1;switch(e.charCodeAt(t)){case 32:case 9:return!0;default:return!1}}function isUpperCaseAtPos(e,t,n){return t[e]!==n[e]}function isPatternInWord(e,t,n,i,o,r,s=!1){for(;t<n&&o<r;)e[t]===i[o]&&(s&&(_minWordMatchPos[t]=o),t+=1),o+=1;return t===n}var FuzzyScore,FuzzyScore2;function fuzzyScore(e,t,n,i,o,r,s){const a=e.length>_maxLen?_maxLen:e.length,l=i.length>_maxLen?_maxLen:i.length;if(n>=a||r>=l||a-n>l-r)return;if(!isPatternInWord(t,n,a,o,r,l,!0))return;_fillInMaxWordMatchPos(a,l,n,r,t,o);let c=1,d=1,u=n,h=r;const g=[!1];for(c=1,u=n;u<a;c++,u++){const s=_minWordMatchPos[u],p=_maxWordMatchPos[u],f=u+1<a?_maxWordMatchPos[u+1]:l;for(d=s-r+1,h=s;h<f;d++,h++){let a=Number.MIN_SAFE_INTEGER,f=!1;h<=p&&(a=_doScore(e,t,u,n,i,o,h,l,r,0===_diag[c-1][d-1],g));let m=0;a!==Number.MAX_SAFE_INTEGER&&(f=!0,m=a+_table[c-1][d-1]);const v=h>s,_=v?_table[c][d-1]+(_diag[c][d-1]>0?-5:0):0,C=h>s+1&&_diag[c][d-1]>0,b=C?_table[c][d-2]+(_diag[c][d-2]>0?-5:0):0;if(C&&(!v||b>=_)&&(!f||b>=m))_table[c][d]=b,_arrows[c][d]=3,_diag[c][d]=0;else if(v&&(!f||_>=m))_table[c][d]=_,_arrows[c][d]=2,_diag[c][d]=0;else{if(!f)throw new Error("not possible");_table[c][d]=m,_arrows[c][d]=1,_diag[c][d]=_diag[c-1][d-1]+1}}}if(!g[0]&&!s)return;c--,d--;const p=[_table[c][d],r];let f=0,m=0;for(;c>=1;){let e=d;do{const t=_arrows[c][e];if(3===t)e-=2;else{if(2!==t)break;e-=1}}while(e>=1);f>1&&t[n+c-1]===o[r+d-1]&&!isUpperCaseAtPos(e+r-1,i,o)&&f+1>_diag[c][e]&&(e=d),e===d?f++:f=1,m||(m=e),c--,d=e-1,p.push(d)}l===a&&(p[0]+=2);const v=m-a;return p[0]-=v,p}function _fillInMaxWordMatchPos(e,t,n,i,o,r){let s=e-1,a=t-1;for(;s>=n&&a>=i;)o[s]===r[a]&&(_maxWordMatchPos[s]=a,s--),a--}function _doScore(e,t,n,i,o,r,s,a,l,c,d){if(t[n]!==r[s])return Number.MIN_SAFE_INTEGER;let u=1,h=!1;return s===n-i?u=e[n]===o[s]?7:5:!isUpperCaseAtPos(s,o,r)||0!==s&&isUpperCaseAtPos(s-1,o,r)?!isSeparatorAtPos(r,s)||0!==s&&isSeparatorAtPos(r,s-1)?(isSeparatorAtPos(r,s-1)||isWhitespaceAtPos(r,s-1))&&(u=5,h=!0):u=5:(u=e[n]===o[s]?7:5,h=!0),u>1&&n===i&&(d[0]=!0),h||(h=isUpperCaseAtPos(s,o,r)||isSeparatorAtPos(r,s-1)||isWhitespaceAtPos(r,s-1)),n===i?s>l&&(u-=h?3:5):u+=c?h?2:0:h?0:1,s+1===a&&(u-=h?3:5),u}function fuzzyScoreGracefulAggressive(e,t,n,i,o,r,s){return fuzzyScoreWithPermutations(e,t,n,i,o,r,!0,s)}function fuzzyScoreWithPermutations(e,t,n,i,o,r,s,a){let l=fuzzyScore(e,t,n,i,o,r,a);if(l&&!s)return l;if(e.length>=3){const t=Math.min(7,e.length-1);for(let s=n+1;s<t;s++){const t=nextTypoPermutation(e,s);if(t){const e=fuzzyScore(t,t.toLowerCase(),n,i,o,r,a);e&&(e[0]-=3,(!l||e[0]>l[0])&&(l=e))}}}return l}function nextTypoPermutation(e,t){if(t+1>=e.length)return;const n=e[t],i=e[t+1];return n!==i?e.slice(0,t)+i+n+e.slice(t+2):void 0}FuzzyScore2=FuzzyScore||(FuzzyScore={}),FuzzyScore2.Default=[-100,0],FuzzyScore2.isDefault=function(e){return!e||2===e.length&&-100===e[0]&&0===e[1]};const iconStartMarker="$(",iconsRegex=new RegExp(`\\$\\(${CSSIcon.iconNameExpression}(?:${CSSIcon.iconModifierExpression})?\\)`,"g"),iconNameCharacterRegexp=new RegExp(CSSIcon.iconNameCharacter),escapeIconsRegex=new RegExp(`(\\\\)?${iconsRegex.source}`,"g");function escapeIcons(e){return e.replace(escapeIconsRegex,((e,t)=>t?e:`\\${e}`))}const markdownEscapedIconsRegex=new RegExp(`\\\\${iconsRegex.source}`,"g");function markdownEscapeEscapedIcons(e){return e.replace(markdownEscapedIconsRegex,(e=>`\\${e}`))}const stripIconsRegex=new RegExp(`(\\s)?(\\\\)?${iconsRegex.source}(\\s)?`,"g");function stripIcons(e){return-1===e.indexOf(iconStartMarker)?e:e.replace(stripIconsRegex,((e,t,n,i)=>n?e:t||i||""))}function parseLabelWithIcons(e){const t=e.indexOf(iconStartMarker);return-1===t?{text:e}:doParseLabelWithIcons(e,t)}function doParseLabelWithIcons(e,t){const n=[];let i="";function o(e){if(e){i+=e;for(const t of e)n.push(c)}}let r,s,a=-1,l="",c=0,d=t;const u=e.length;for(o(e.substr(0,t));d<u;){if(r=e[d],s=e[d+1],r===iconStartMarker[0]&&s===iconStartMarker[1])a=d,o(l),l=iconStartMarker,d++;else if(")"===r&&-1!==a){c+=d-a+1,a=-1,l=""}else-1!==a?iconNameCharacterRegexp.test(r)?l+=r:(o(l),a=-1,l=""):o(r);d++}return o(l),{text:i,iconOffsets:n}}function matchesFuzzyIconAware(e,t,n=!1){const{text:i,iconOffsets:o}=t;if(!o||0===o.length)return matchesFuzzy(e,i,n);const r=ltrim(i," "),s=i.length-r.length,a=matchesFuzzy(e,r,n);if(a)for(const l of a){const e=o[l.start+s]+s;l.start+=e,l.end+=e}return a}class MarkdownString{constructor(e="",t=!1){var n,i,o;if(this.value=e,"string"!=typeof this.value)throw illegalArgument("value");"boolean"==typeof t?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=null!==(n=t.isTrusted)&&void 0!==n?n:void 0,this.supportThemeIcons=null!==(i=t.supportThemeIcons)&&void 0!==i&&i,this.supportHtml=null!==(o=t.supportHtml)&&void 0!==o&&o)}appendText(e,t=0){return this.value+=escapeMarkdownSyntaxTokens(this.supportThemeIcons?escapeIcons(e):e).replace(/([ \t]+)/g,((e,t)=>" ".repeat(t.length))).replace(/\>/gm,"\\>").replace(/\n/g,1===t?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+="\n",this.value+=t,this.value+="\n```\n",this}}function isEmptyMarkdownString(e){return isMarkdownString(e)?!e.value:!Array.isArray(e)||e.every(isEmptyMarkdownString)}function isMarkdownString(e){return e instanceof MarkdownString||!(!e||"object"!=typeof e)&&!("string"!=typeof e.value||"boolean"!=typeof e.isTrusted&&void 0!==e.isTrusted||"boolean"!=typeof e.supportThemeIcons&&void 0!==e.supportThemeIcons)}function escapeMarkdownSyntaxTokens(e){return e.replace(/[\\`*_{}[\]()#+\-!]/g,"\\$&")}function removeMarkdownEscapes(e){return e?e.replace(/\\([\\`*_{}[\]()#+\-.!])/g,"$1"):e}function parseHrefAndDimensions(e){const t=[],n=e.split("|").map((e=>e.trim()));e=n[0];const i=n[1];if(i){const e=/height=(\d+)/.exec(i),n=/width=(\d+)/.exec(i),o=e?e[1]:"",r=n?n[1]:"",s=isFinite(parseInt(r)),a=isFinite(parseInt(o));s&&t.push(`width="${r}"`),a&&t.push(`height="${o}"`)}return{href:e,dimensions:t}}var anchorSelect="",__decorate$1r=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1n=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$$=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const SelectionAnchorSet=new RawContextKey("selectionAnchorSet",!1);let SelectionAnchorController=class e{constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=SelectionAnchorSet.bindTo(t),this.modelChangeListener=e.onDidChangeModel((()=>this.selectionAnchorSetContextKey.reset()))}static get(t){return t.getContribution(e.ID)}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition(),t=this.decorationId?[this.decorationId]:[],n=this.editor.deltaDecorations(t,[{range:Selection$1.fromPositions(e,e),options:{description:"selection-anchor",stickiness:1,hoverMessage:(new MarkdownString).appendText(localize("selectionAnchor","Selection Anchor")),className:"selection-anchor"}}]);this.decorationId=n[0],this.selectionAnchorSetContextKey.set(!!this.decorationId),alert(localize("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(Selection$1.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){this.decorationId&&(this.editor.deltaDecorations([this.decorationId],[]),this.decorationId=void 0,this.selectionAnchorSetContextKey.set(!1))}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};SelectionAnchorController.ID="editor.contrib.selectionAnchorController",SelectionAnchorController=__decorate$1r([__param$1n(1,IContextKeyService)],SelectionAnchorController);class SetSelectionAnchor extends EditorAction{constructor(){super({id:"editor.action.setSelectionAnchor",label:localize("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2080),weight:100}})}run(e,t){var n;return __awaiter$$(this,void 0,void 0,(function*(){null===(n=SelectionAnchorController.get(t))||void 0===n||n.setSelectionAnchor()}))}}class GoToSelectionAnchor extends EditorAction{constructor(){super({id:"editor.action.goToSelectionAnchor",label:localize("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:SelectionAnchorSet})}run(e,t){var n;return __awaiter$$(this,void 0,void 0,(function*(){null===(n=SelectionAnchorController.get(t))||void 0===n||n.goToSelectionAnchor()}))}}class SelectFromAnchorToCursor extends EditorAction{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:localize("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:SelectionAnchorSet,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2089),weight:100}})}run(e,t){var n;return __awaiter$$(this,void 0,void 0,(function*(){null===(n=SelectionAnchorController.get(t))||void 0===n||n.selectFromAnchorToCursor()}))}}class CancelSelectionAnchor extends EditorAction{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:localize("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:SelectionAnchorSet,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:9,weight:100}})}run(e,t){var n;return __awaiter$$(this,void 0,void 0,(function*(){null===(n=SelectionAnchorController.get(t))||void 0===n||n.cancelSelectionAnchor()}))}}registerEditorContribution(SelectionAnchorController.ID,SelectionAnchorController),registerEditorAction(SetSelectionAnchor),registerEditorAction(GoToSelectionAnchor),registerEditorAction(SelectFromAnchorToCursor),registerEditorAction(CancelSelectionAnchor);var bracketMatching="";const overviewRulerBracketMatchForeground=registerColor("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hc:"#A0A0A0"},localize("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class JumpToBracketAction extends EditorAction{constructor(){super({id:"editor.action.jumpToBracket",label:localize("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3160,weight:100}})}run(e,t){var n;null===(n=BracketMatchingController.get(t))||void 0===n||n.jumpToBracket()}}class SelectToBracketAction extends EditorAction{constructor(){super({id:"editor.action.selectToBracket",label:localize("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,description:{description:"Select to Bracket",args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,n){var i;let o=!0;n&&!1===n.selectBrackets&&(o=!1),null===(i=BracketMatchingController.get(t))||void 0===i||i.selectToBracket(o)}}class BracketsData{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}}class BracketMatchingController extends Disposable{constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=[],this._updateBracketsSoon=this._register(new RunOnceScheduler((()=>this._updateBrackets()),50)),this._matchBrackets=this._editor.getOption(64),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition((e=>{"never"!==this._matchBrackets&&this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModelContent((e=>{this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModel((e=>{this._lastBracketsData=[],this._decorations=[],this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModelLanguageConfiguration((e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeConfiguration((e=>{e.hasChanged(64)&&(this._matchBrackets=this._editor.getOption(64),this._decorations=this._editor.deltaDecorations(this._decorations,[]),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())}))),this._register(e.onDidBlurEditorWidget((()=>{this._updateBracketsSoon.schedule()}))),this._register(e.onDidFocusEditorWidget((()=>{this._updateBracketsSoon.schedule()})))}static get(e){return e.getContribution(BracketMatchingController.ID)}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map((t=>{const n=t.getStartPosition(),i=e.bracketPairs.matchBracket(n);let o=null;if(i)i[0].containsPosition(n)?o=i[1].getStartPosition():i[1].containsPosition(n)&&(o=i[0].getStartPosition());else{const t=e.bracketPairs.findEnclosingBrackets(n);if(t)o=t[0].getStartPosition();else{const t=e.bracketPairs.findNextBracket(n);t&&t.range&&(o=t.range.getStartPosition())}}return o?new Selection$1(o.lineNumber,o.column,o.lineNumber,o.column):new Selection$1(n.lineNumber,n.column,n.lineNumber,n.column)}));this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=[];this._editor.getSelections().forEach((i=>{const o=i.getStartPosition();let r=t.bracketPairs.matchBracket(o);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(o),!r)){const e=t.bracketPairs.findNextBracket(o);e&&e.range&&(r=t.bracketPairs.matchBracket(e.range.getStartPosition()))}let s=null,a=null;if(r){r.sort(Range$2.compareRangesUsingStarts);const[t,n]=r;if(s=e?t.getStartPosition():t.getEndPosition(),a=e?n.getEndPosition():n.getStartPosition(),n.containsPosition(o)){const e=s;s=a,a=e}}s&&a&&n.push(new Selection$1(s.lineNumber,s.column,a.lineNumber,a.column))})),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}_updateBrackets(){if("never"===this._matchBrackets)return;this._recomputeBrackets();let e=[],t=0;for(const n of this._lastBracketsData){let i=n.brackets;i&&(e[t++]={range:i[0],options:n.options},e[t++]={range:i[1],options:n.options})}this._decorations=this._editor.deltaDecorations(this._decorations,e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus())return this._lastBracketsData=[],void(this._lastVersionId=0);const e=this._editor.getSelections();if(e.length>100)return this._lastBracketsData=[],void(this._lastVersionId=0);const t=this._editor.getModel(),n=t.getVersionId();let i=[];this._lastVersionId===n&&(i=this._lastBracketsData);let o=[],r=0;for(let d=0,u=e.length;d<u;d++){let t=e[d];t.isEmpty()&&(o[r++]=t.getStartPosition())}o.length>1&&o.sort(Position$1.compare);let s=[],a=0,l=0,c=i.length;for(let d=0,u=o.length;d<u;d++){let e=o[d];for(;l<c&&i[l].position.isBefore(e);)l++;if(l<c&&i[l].position.equals(e))s[a++]=i[l];else{let n=t.bracketPairs.matchBracket(e,20),i=BracketMatchingController._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;n||"always"!==this._matchBrackets||(n=t.bracketPairs.findEnclosingBrackets(e,20),i=BracketMatchingController._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),s[a++]=new BracketsData(e,n,i)}}this._lastBracketsData=s,this._lastVersionId=n}}BracketMatchingController.ID="editor.contrib.bracketMatchingController",BracketMatchingController._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=ModelDecorationOptions.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:themeColorFromId(overviewRulerBracketMatchForeground),position:OverviewRulerLane$1.Center}}),BracketMatchingController._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=ModelDecorationOptions.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"}),registerEditorContribution(BracketMatchingController.ID,BracketMatchingController),registerEditorAction(SelectToBracketAction),registerEditorAction(JumpToBracketAction),registerThemingParticipant(((e,t)=>{const n=e.getColor(editorBracketMatchBackground);n&&t.addRule(`.monaco-editor .bracket-match { background-color: ${n}; }`);const i=e.getColor(editorBracketMatchBorder);i&&t.addRule(`.monaco-editor .bracket-match { border: 1px solid ${i}; }`)})),MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:localize({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class MoveCaretCommand{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const n=this._selection.startLineNumber,i=this._selection.startColumn,o=this._selection.endColumn;if((!this._isMovingLeft||1!==i)&&(this._isMovingLeft||o!==e.getLineMaxColumn(n)))if(this._isMovingLeft){const r=new Range$2(n,i-1,n,i),s=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new Range$2(n,o,n,o),s)}else{const r=new Range$2(n,o,n,o+1),s=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new Range$2(n,i,n,i),s)}}computeCursorState(e,t){return this._isMovingLeft?new Selection$1(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Selection$1(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class MoveCaretAction extends EditorAction{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const n=[],i=t.getSelections();for(const o of i)n.push(new MoveCaretCommand(o,this.left));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class MoveCaretLeftAction extends MoveCaretAction{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:localize("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:EditorContextKeys.writable})}}class MoveCaretRightAction extends MoveCaretAction{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:localize("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:EditorContextKeys.writable})}}registerEditorAction(MoveCaretLeftAction),registerEditorAction(MoveCaretRightAction);class TransposeLettersAction extends EditorAction{constructor(){super({id:"editor.action.transposeLetters",label:localize("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let n=t.getModel(),i=[],o=t.getSelections();for(let r of o){if(!r.isEmpty())continue;let e=r.startLineNumber,t=r.startColumn,o=n.getLineMaxColumn(e);if(1===e&&(1===t||2===t&&2===o))continue;let s=t===o?r.getPosition():MoveOperations.rightPosition(n,r.getPosition().lineNumber,r.getPosition().column),a=MoveOperations.leftPosition(n,s),l=MoveOperations.leftPosition(n,a),c=n.getValueInRange(Range$2.fromPositions(l,a)),d=n.getValueInRange(Range$2.fromPositions(a,s)),u=Range$2.fromPositions(l,s);i.push(new ReplaceCommand(u,d+c))}i.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop())}}registerEditorAction(TransposeLettersAction);var __awaiter$_=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const CLIPBOARD_CONTEXT_MENU_GROUP="9_cutcopypaste",supportsCut=isNative||document.queryCommandSupported("cut"),supportsCopy=isNative||document.queryCommandSupported("copy"),supportsPaste=void 0!==navigator.clipboard&&!isFirefox||document.queryCommandSupported("paste");function registerCommand$1(e){return e.register(),e}const CutAction=supportsCut?registerCommand$1(new MultiCommand({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:isNative?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:MenuId.MenubarEditMenu,group:"2_ccp",title:localize({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:MenuId.EditorContext,group:CLIPBOARD_CONTEXT_MENU_GROUP,title:localize("actions.clipboard.cutLabel","Cut"),when:EditorContextKeys.writable,order:1},{menuId:MenuId.CommandPalette,group:"",title:localize("actions.clipboard.cutLabel","Cut"),order:1},{menuId:MenuId.SimpleEditorContext,group:CLIPBOARD_CONTEXT_MENU_GROUP,title:localize("actions.clipboard.cutLabel","Cut"),when:EditorContextKeys.writable,order:1}]})):void 0,CopyAction=supportsCopy?registerCommand$1(new MultiCommand({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:isNative?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:MenuId.MenubarEditMenu,group:"2_ccp",title:localize({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:MenuId.EditorContext,group:CLIPBOARD_CONTEXT_MENU_GROUP,title:localize("actions.clipboard.copyLabel","Copy"),order:2},{menuId:MenuId.CommandPalette,group:"",title:localize("actions.clipboard.copyLabel","Copy"),order:1},{menuId:MenuId.SimpleEditorContext,group:CLIPBOARD_CONTEXT_MENU_GROUP,title:localize("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;MenuRegistry.appendMenuItem(MenuId.MenubarEditMenu,{submenu:MenuId.MenubarCopy,title:{value:localize("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3}),MenuRegistry.appendMenuItem(MenuId.EditorContext,{submenu:MenuId.EditorContextCopy,title:{value:localize("copy as","Copy As"),original:"Copy As"},group:CLIPBOARD_CONTEXT_MENU_GROUP,order:3});const PasteAction=supportsPaste?registerCommand$1(new MultiCommand({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:isNative?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:MenuId.MenubarEditMenu,group:"2_ccp",title:localize({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:MenuId.EditorContext,group:CLIPBOARD_CONTEXT_MENU_GROUP,title:localize("actions.clipboard.pasteLabel","Paste"),when:EditorContextKeys.writable,order:4},{menuId:MenuId.CommandPalette,group:"",title:localize("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:MenuId.SimpleEditorContext,group:CLIPBOARD_CONTEXT_MENU_GROUP,title:localize("actions.clipboard.pasteLabel","Paste"),when:EditorContextKeys.writable,order:4}]})):void 0;class ExecCommandCopyWithSyntaxHighlightingAction extends EditorAction{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:localize("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,weight:100}})}run(e,t){if(!t.hasModel())return;!t.getOption(32)&&t.getSelection().isEmpty()||(CopyOptions.forceCopyWithSyntaxHighlighting=!0,t.focus(),document.execCommand("copy"),CopyOptions.forceCopyWithSyntaxHighlighting=!1)}}function registerExecCommandImpl(e,t){e&&(e.addImplementation(1e4,"code-editor",((e,n)=>{const i=e.get(ICodeEditorService).getFocusedCodeEditor();if(i&&i.hasTextFocus()){const e=i.getOption(32),n=i.getSelection();return n&&n.isEmpty()&&!e||document.execCommand(t),!0}return!1})),e.addImplementation(0,"generic-dom",((e,n)=>(document.execCommand(t),!0))))}registerExecCommandImpl(CutAction,"cut"),registerExecCommandImpl(CopyAction,"copy"),PasteAction&&(PasteAction.addImplementation(1e4,"code-editor",((e,t)=>{const n=e.get(ICodeEditorService),i=e.get(IClipboardService),o=n.getFocusedCodeEditor();if(o&&o.hasTextFocus()){return!(!document.execCommand("paste")&&isWeb)||__awaiter$_(void 0,void 0,void 0,(function*(){const e=yield i.readText();if(""!==e){const t=InMemoryClipboardMetadataManager.INSTANCE.get(e);let n=!1,i=null,r=null;t&&(n=o.getOption(32)&&!!t.isFromEmptySelection,i=void 0!==t.multicursorText?t.multicursorText:null,r=t.mode),o.trigger("keyboard","paste",{text:e,pasteOnNewLine:n,multicursorText:i,mode:r})}}))}return!1})),PasteAction.addImplementation(0,"generic-dom",((e,t)=>(document.execCommand("paste"),!0)))),supportsCopy&®isterEditorAction(ExecCommandCopyWithSyntaxHighlightingAction);const IBulkEditService=createDecorator("IWorkspaceEditService");function isWorkspaceFileEdit(e){return isObject(e)&&(Boolean(e.newUri)||Boolean(e.oldUri))}function isWorkspaceTextEdit(e){return isObject(e)&&URI.isUri(e.resource)&&isObject(e.edit)}class ResourceEdit{constructor(e){this.metadata=e}static convert(e){return e.edits.map((e=>{if(isWorkspaceTextEdit(e))return new ResourceTextEdit(e.resource,e.edit,e.modelVersionId,e.metadata);if(isWorkspaceFileEdit(e))return new ResourceFileEdit(e.oldUri,e.newUri,e.options,e.metadata);throw new Error("Unsupported edit")}))}}class ResourceTextEdit extends ResourceEdit{constructor(e,t,n,i){super(i),this.resource=e,this.textEdit=t,this.versionId=n}}class ResourceFileEdit extends ResourceEdit{constructor(e,t,n,i){super(i),this.oldResource=e,this.newResource=t,this.options=n}}const IEditorCancellationTokens=createDecorator("IEditorCancelService"),ctxCancellableOperation=new RawContextKey("cancellableOperation",!1,localize("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));registerSingleton(IEditorCancellationTokens,class{constructor(){this._tokens=new WeakMap}add(e,t){let n,i=this._tokens.get(e);return i||(i=e.invokeWithinContext((e=>({key:ctxCancellableOperation.bindTo(e.get(IContextKeyService)),tokens:new LinkedList}))),this._tokens.set(e,i)),i.key.set(!0),n=i.tokens.push(t),()=>{n&&(n(),i.key.set(!i.tokens.isEmpty()),n=void 0)}}cancel(e){const t=this._tokens.get(e);if(!t)return;const n=t.tokens.pop();n&&(n.cancel(),t.key.set(!t.tokens.isEmpty()))}},!0);class EditorKeybindingCancellationTokenSource extends CancellationTokenSource$1{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext((t=>t.get(IEditorCancellationTokens).add(e,this)))}dispose(){this._unregister(),super.dispose()}}registerEditorCommand(new class extends EditorCommand{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:ctxCancellableOperation})}runEditorCommand(e,t){e.get(IEditorCancellationTokens).cancel(t)}});class EditorState$1{constructor(e,t){if(this.flags=t,0!=(1&this.flags)){const t=e.getModel();this.modelVersionId=t?format("{0}#{1}",t.uri.toString(),t.getVersionId()):null}else this.modelVersionId=null;0!=(4&this.flags)?this.position=e.getPosition():this.position=null,0!=(2&this.flags)?this.selection=e.getSelection():this.selection=null,0!=(8&this.flags)?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof EditorState$1))return!1;const t=e;return this.modelVersionId===t.modelVersionId&&(this.scrollLeft===t.scrollLeft&&this.scrollTop===t.scrollTop&&(!(!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position))&&!(!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))))}validate(e){return this._equals(new EditorState$1(e,this.flags))}}class EditorStateCancellationTokenSource extends EditorKeybindingCancellationTokenSource{constructor(e,t,n,i){super(e,i),this._listener=new DisposableStore,4&t&&this._listener.add(e.onDidChangeCursorPosition((e=>{n&&Range$2.containsPosition(n,e.position)||this.cancel()}))),2&t&&this._listener.add(e.onDidChangeCursorSelection((e=>{n&&Range$2.containsRange(n,e.selection)||this.cancel()}))),8&t&&this._listener.add(e.onDidScrollChange((e=>this.cancel()))),1&t&&(this._listener.add(e.onDidChangeModel((e=>this.cancel()))),this._listener.add(e.onDidChangeModelContent((e=>this.cancel()))))}dispose(){this._listener.dispose(),super.dispose()}}class TextModelCancellationTokenSource extends CancellationTokenSource$1{constructor(e,t){super(t),this._listener=e.onDidChangeContent((()=>this.cancel()))}dispose(){this._listener.dispose(),super.dispose()}}class CodeActionKind{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||""===this.value||e.value.startsWith(this.value+CodeActionKind.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new CodeActionKind(this.value+CodeActionKind.sep+e)}}function mayIncludeActionsOfKind(e,t){return!(e.include&&!e.include.intersects(t))&&((!e.excludes||!e.excludes.some((n=>excludesAction(t,n,e.include))))&&!(!e.includeSourceActions&&CodeActionKind.Source.contains(t)))}function filtersAction(e,t){const n=t.kind?new CodeActionKind(t.kind):void 0;return!!(!e.include||n&&e.include.contains(n))&&(!(e.excludes&&n&&e.excludes.some((t=>excludesAction(n,t,e.include))))&&(!(!e.includeSourceActions&&n&&CodeActionKind.Source.contains(n))&&!(e.onlyIncludePreferredActions&&!t.isPreferred)))}function excludesAction(e,t,n){return!!t.contains(e)&&(!n||!t.contains(n))}CodeActionKind.sep=".",CodeActionKind.None=new CodeActionKind("@@none@@"),CodeActionKind.Empty=new CodeActionKind(""),CodeActionKind.QuickFix=new CodeActionKind("quickfix"),CodeActionKind.Refactor=new CodeActionKind("refactor"),CodeActionKind.Source=new CodeActionKind("source"),CodeActionKind.SourceOrganizeImports=CodeActionKind.Source.append("organizeImports"),CodeActionKind.SourceFixAll=CodeActionKind.Source.append("fixAll");class CodeActionCommandArgs{constructor(e,t,n){this.kind=e,this.apply=t,this.preferred=n}static fromUser(e,t){return e&&"object"==typeof e?new CodeActionCommandArgs(CodeActionCommandArgs.getKindFromUser(e,t.kind),CodeActionCommandArgs.getApplyFromUser(e,t.apply),CodeActionCommandArgs.getPreferredUser(e)):new CodeActionCommandArgs(t.kind,t.apply,!1)}static getApplyFromUser(e,t){switch("string"==typeof e.apply?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return"string"==typeof e.kind?new CodeActionKind(e.kind):t}static getPreferredUser(e){return"boolean"==typeof e.preferred&&e.preferred}}var __awaiter$Z=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const codeActionCommandId="editor.action.codeAction",refactorCommandId="editor.action.refactor",sourceActionCommandId="editor.action.sourceAction",organizeImportsCommandId="editor.action.organizeImports",fixAllCommandId="editor.action.fixAll";class CodeActionItem{constructor(e,t){this.action=e,this.provider=t}resolve(e){var t;return __awaiter$Z(this,void 0,void 0,(function*(){if((null===(t=this.provider)||void 0===t?void 0:t.resolveCodeAction)&&!this.action.edit){let t;try{t=yield this.provider.resolveCodeAction(this.action,e)}catch(n){onUnexpectedExternalError(n)}t&&(this.action.edit=t.edit)}return this}))}}class ManagedCodeActionSet extends Disposable{constructor(e,t,n){super(),this.documentation=t,this._register(n),this.allActions=[...e].sort(ManagedCodeActionSet.codeActionsComparator),this.validActions=this.allActions.filter((({action:e})=>!e.disabled))}static codeActionsComparator({action:e},{action:t}){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:isNonEmptyArray(e.diagnostics)?isNonEmptyArray(t.diagnostics)?e.diagnostics[0].message.localeCompare(t.diagnostics[0].message):-1:isNonEmptyArray(t.diagnostics)?1:0}get hasAutoFix(){return this.validActions.some((({action:e})=>!!e.kind&&CodeActionKind.QuickFix.contains(new CodeActionKind(e.kind))&&!!e.isPreferred))}}const emptyCodeActionsResponse={actions:[],documentation:void 0};function getCodeActions(e,t,n,i,o,r){var s;const a=i.filter||{},l={only:null===(s=a.include)||void 0===s?void 0:s.value,trigger:i.type},c=new TextModelCancellationTokenSource(t,r),d=getCodeActionProviders(e,t,a),u=new DisposableStore,h=d.map((e=>__awaiter$Z(this,void 0,void 0,(function*(){try{o.report(e);const i=yield e.provideCodeActions(t,n,l,c.token);if(i&&u.add(i),c.token.isCancellationRequested)return emptyCodeActionsResponse;const r=((null==i?void 0:i.actions)||[]).filter((e=>e&&filtersAction(a,e))),s=getDocumentation(e,r,a.include);return{actions:r.map((t=>new CodeActionItem(t,e))),documentation:s}}catch(i){if(isCancellationError(i))throw i;return onUnexpectedExternalError(i),emptyCodeActionsResponse}})))),g=e.onDidChange((()=>{equals$1(e.all(t),d)||c.cancel()}));return Promise.all(h).then((e=>{const t=flatten(e.map((e=>e.actions))),n=coalesce(e.map((e=>e.documentation)));return new ManagedCodeActionSet(t,n,u)})).finally((()=>{g.dispose(),c.dispose()}))}function getCodeActionProviders(e,t,n){return e.all(t).filter((e=>!e.providedCodeActionKinds||e.providedCodeActionKinds.some((e=>mayIncludeActionsOfKind(n,new CodeActionKind(e))))))}function getDocumentation(e,t,n){if(!e.documentation)return;const i=e.documentation.map((e=>({kind:new CodeActionKind(e.kind),command:e.command})));if(n){let e;for(const t of i)t.kind.contains(n)&&(e?e.kind.contains(t.kind)&&(e=t):e=t);if(e)return null==e?void 0:e.command}for(const o of t)if(o.kind)for(const e of i)if(e.kind.contains(new CodeActionKind(o.kind)))return e.command}CommandsRegistry.registerCommand("_executeCodeActionProvider",(function(e,t,n,i,o){return __awaiter$Z(this,void 0,void 0,(function*(){if(!(t instanceof URI))throw illegalArgument();const{codeActionProvider:r}=e.get(ILanguageFeaturesService),s=e.get(IModelService).getModel(t);if(!s)throw illegalArgument();const a=Selection$1.isISelection(n)?Selection$1.liftSelection(n):Range$2.isIRange(n)?s.validateRange(n):void 0;if(!a)throw illegalArgument();const l="string"==typeof i?new CodeActionKind(i):void 0,c=yield getCodeActions(r,s,a,{type:1,filter:{includeSourceActions:!0,include:l}},Progress.None,CancellationToken.None),d=[],u=Math.min(c.validActions.length,"number"==typeof o?o:0);for(let e=0;e<u;e++)d.push(c.validActions[e].resolve(CancellationToken.None));try{return yield Promise.all(d),c.validActions.map((e=>e.action))}finally{setTimeout((()=>c.dispose()),100)}}))}));var messageController="",__decorate$1q=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1m=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let MessageController=class e{constructor(t,n){this._messageWidget=new MutableDisposable,this._messageListeners=new DisposableStore,this._editor=t,this._visible=e.MESSAGE_VISIBLE.bindTo(n),this._editorListener=this._editor.onDidAttemptReadOnlyEdit((()=>this._onDidAttemptReadOnlyEdit()))}static get(t){return t.getContribution(e.ID)}dispose(){this._editorListener.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){let n;alert(e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._messageWidget.value=new MessageWidget$1(this._editor,t,e),this._messageListeners.add(this._editor.onDidBlurEditorText((()=>this.closeMessage()))),this._messageListeners.add(this._editor.onDidChangeCursorPosition((()=>this.closeMessage()))),this._messageListeners.add(this._editor.onDidDispose((()=>this.closeMessage()))),this._messageListeners.add(this._editor.onDidChangeModel((()=>this.closeMessage()))),this._messageListeners.add(new TimeoutTimer((()=>this.closeMessage()),3e3)),this._messageListeners.add(this._editor.onMouseMove((e=>{e.target.position&&(n?n.containsPosition(e.target.position)||this.closeMessage():n=new Range$2(t.lineNumber-3,1,e.target.position.lineNumber+3,1))})))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(MessageWidget$1.fadeOut(this._messageWidget.value))}_onDidAttemptReadOnlyEdit(){this._editor.hasModel()&&this.showMessage(localize("editor.readonly","Cannot edit in read-only editor"),this._editor.getPosition())}};MessageController.ID="editor.contrib.messageController",MessageController.MESSAGE_VISIBLE=new RawContextKey("messageVisible",!1,localize("messageVisible","Whether the editor is currently showing an inline message")),MessageController=__decorate$1q([__param$1m(1,IContextKeyService)],MessageController);const MessageCommand=EditorCommand.bindToContribution(MessageController.get);registerEditorCommand(new MessageCommand({id:"leaveEditorMessage",precondition:MessageController.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));class MessageWidget$1{constructor(e,{lineNumber:t,column:n},i){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n-1},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage");const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const r=document.createElement("div");r.classList.add("message"),r.textContent=i,this._domNode.appendChild(r);const s=document.createElement("div");s.classList.add("anchor","below"),this._domNode.appendChild(s),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}static fadeOut(e){let t;const n=()=>{e.dispose(),clearTimeout(t),e.getDomNode().removeEventListener("animationend",n)};return t=setTimeout(n,110),e.getDomNode().addEventListener("animationend",n),e.getDomNode().classList.add("fadeOut"),{dispose:n}}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2]}}afterRender(e){this._domNode.classList.toggle("below",2===e)}}registerEditorContribution(MessageController.ID,MessageController);const IKeybindingService=createDecorator("keybindingService");var __decorate$1p=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1l=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$Y=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class CodeActionAction extends Action{constructor(e,t){super(e.command?e.command.id:e.title,stripNewlines(e.title),void 0,!e.disabled,t),this.action=e}}function stripNewlines(e){return e.replace(/\r\n|\r|\n/g," ")}let CodeActionMenu=class extends Disposable{constructor(e,t,n,i,o){super(),this._editor=e,this._delegate=t,this._contextMenuService=n,this._languageFeaturesService=o,this._visible=!1,this._showingActions=this._register(new MutableDisposable),this._keybindingResolver=new CodeActionKeybindingResolver({getKeybindings:()=>i.getKeybindings()})}get isVisible(){return this._visible}show(e,t,n,i){return __awaiter$Y(this,void 0,void 0,(function*(){const o=i.includeDisabledActions?t.allActions:t.validActions;if(!o.length)return void(this._visible=!1);if(!this._editor.getDomNode())throw this._visible=!1,canceled();this._visible=!0,this._showingActions.value=t;const r=this.getMenuActions(e,o,t.documentation),s=Position$1.isIPosition(n)?this._toCoords(n):n||{x:0,y:0},a=this._keybindingResolver.getResolver(),l=this._editor.getOption(115);this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>s,getActions:()=>r,onHide:()=>{this._visible=!1,this._editor.focus()},autoSelectFirstItem:!0,getKeyBinding:e=>e instanceof CodeActionAction?a(e.action):void 0})}))}getMenuActions(e,t,n){var i,o;const r=e=>new CodeActionAction(e.action,(()=>this._delegate.onSelectCodeAction(e))),s=t.map(r),a=[...n],l=this._editor.getModel();if(l&&s.length)for(const c of this._languageFeaturesService.codeActionProvider.all(l))c._getAdditionalMenuItems&&a.push(...c._getAdditionalMenuItems({trigger:e.type,only:null===(o=null===(i=e.filter)||void 0===i?void 0:i.include)||void 0===o?void 0:o.value},t.map((e=>e.action))));return a.length&&s.push(new Separator,...a.map((e=>r(new CodeActionItem({title:e.title,command:e},void 0))))),s}_toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),n=getDomNodePagePosition(this._editor.getDomNode());return{x:n.left+t.left,y:n.top+t.top+t.height}}};CodeActionMenu=__decorate$1p([__param$1l(2,IContextMenuService),__param$1l(3,IKeybindingService),__param$1l(4,ILanguageFeaturesService)],CodeActionMenu);class CodeActionKeybindingResolver{constructor(e){this._keybindingProvider=e}getResolver(){const e=new Lazy((()=>this._keybindingProvider.getKeybindings().filter((e=>CodeActionKeybindingResolver.codeActionCommands.indexOf(e.command)>=0)).filter((e=>e.resolvedKeybinding)).map((e=>{let t=e.commandArgs;return e.command===organizeImportsCommandId?t={kind:CodeActionKind.SourceOrganizeImports.value}:e.command===fixAllCommandId&&(t={kind:CodeActionKind.SourceFixAll.value}),Object.assign({resolvedKeybinding:e.resolvedKeybinding},CodeActionCommandArgs.fromUser(t,{kind:CodeActionKind.None,apply:"never"}))}))));return t=>{if(t.kind){const n=this.bestKeybindingForCodeAction(t,e.getValue());return null==n?void 0:n.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const n=new CodeActionKind(e.kind);return t.filter((e=>e.kind.contains(n))).filter((t=>!t.preferred||e.isPreferred)).reduceRight(((e,t)=>e?e.kind.contains(t.kind)?t:e:t),void 0)}}CodeActionKeybindingResolver.codeActionCommands=[refactorCommandId,codeActionCommandId,sourceActionCommandId,organizeImportsCommandId,fixAllCommandId];var lightBulbWidget="",__decorate$1o=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1k=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},LightBulbState;!function(e){e.Hidden={type:0};e.Showing=class{constructor(e,t,n,i){this.actions=e,this.trigger=t,this.editorPosition=n,this.widgetPosition=i,this.type=1}}}(LightBulbState||(LightBulbState={}));let LightBulbWidget=class e extends Disposable{constructor(e,t,n,i){super(),this._editor=e,this._quickFixActionId=t,this._preferredFixActionId=n,this._keybindingService=i,this._onClick=this._register(new Emitter$1),this.onClick=this._onClick.event,this._state=LightBulbState.Hidden,this._domNode=document.createElement("div"),this._domNode.className=Codicon.lightBulb.classNames,this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent((e=>{const t=this._editor.getModel();(1!==this.state.type||!t||this.state.editorPosition.lineNumber>=t.getLineCount())&&this.hide()}))),Gesture.ignoreTarget(this._domNode),this._register(addStandardDisposableGenericMouseDownListener(this._domNode,(e=>{if(1!==this.state.type)return;this._editor.focus(),e.preventDefault();const{top:t,height:n}=getDomNodePagePosition(this._domNode),i=this._editor.getOption(59);let o=Math.floor(i/3);null!==this.state.widgetPosition.position&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(o+=i),this._onClick.fire({x:e.posx,y:t+n+o,actions:this.state.actions,trigger:this.state.trigger})}))),this._register(addDisposableListener(this._domNode,"mouseenter",(e=>{if(1!=(1&e.buttons))return;this.hide();const t=new GlobalMouseMoveMonitor;t.startMonitoring(e.target,e.buttons,standardMouseMoveMerger,(()=>{}),(()=>{t.dispose()}))}))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(57)&&!this._editor.getOption(57).enabled&&this.hide()}))),this._updateLightBulbTitleAndIcon(),this._register(this._keybindingService.onDidUpdateKeybindings(this._updateLightBulbTitleAndIcon,this))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return 1===this._state.type?this._state.widgetPosition:null}update(t,n,i){if(t.validActions.length<=0)return this.hide();const o=this._editor.getOptions();if(!o.get(57).enabled)return this.hide();const r=this._editor.getModel();if(!r)return this.hide();const{lineNumber:s,column:a}=r.validatePosition(i),l=r.getOptions().tabSize,c=o.get(44),d=computeIndentLevel(r.getLineContent(s),l),u=e=>e>2&&this._editor.getTopForLineNumber(e)===this._editor.getTopForLineNumber(e-1);let h=s;if(!(c.spaceWidth*d>22))if(s>1&&!u(s-1))h-=1;else if(u(s+1)){if(a*c.spaceWidth<22)return this.hide()}else h+=1;this.state=new LightBulbState.Showing(t,n,i,{position:{lineNumber:h,column:1},preference:e._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state=LightBulbState.Hidden,this._editor.layoutContentWidget(this)}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(1===this.state.type&&this.state.actions.hasAutoFix){this._domNode.classList.remove(...Codicon.lightBulb.classNamesArray),this._domNode.classList.add(...Codicon.lightbulbAutofix.classNamesArray);const e=this._keybindingService.lookupKeybinding(this._preferredFixActionId);if(e)return void(this.title=localize("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",e.getLabel()))}this._domNode.classList.remove(...Codicon.lightbulbAutofix.classNamesArray),this._domNode.classList.add(...Codicon.lightBulb.classNamesArray);const e=this._keybindingService.lookupKeybinding(this._quickFixActionId);this.title=e?localize("codeActionWithKb","Show Code Actions ({0})",e.getLabel()):localize("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};LightBulbWidget._posPref=[0],LightBulbWidget=__decorate$1o([__param$1k(3,IKeybindingService)],LightBulbWidget),registerThemingParticipant(((e,t)=>{var n;const i=null===(n=e.getColor(editorBackground))||void 0===n?void 0:n.transparent(.7),o=e.getColor(editorLightBulbForeground);o&&t.addRule(`\n\t\t.monaco-editor .contentWidgets ${Codicon.lightBulb.cssSelector} {\n\t\t\tcolor: ${o};\n\t\t\tbackground-color: ${i};\n\t\t}`);const r=e.getColor(editorLightBulbAutoFixForeground);r&&t.addRule(`\n\t\t.monaco-editor .contentWidgets ${Codicon.lightbulbAutofix.cssSelector} {\n\t\t\tcolor: ${r};\n\t\t\tbackground-color: ${i};\n\t\t}`)}));var __decorate$1n=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1j=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$X=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},__classPrivateFieldSet$1=globalThis&&globalThis.__classPrivateFieldSet||function(e,t,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(e,n):o?o.value=n:t.set(e,n),n},__classPrivateFieldGet$1=globalThis&&globalThis.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},_CodeActionUi_disposed;let CodeActionUi=class extends Disposable{constructor(e,t,n,i,o){super(),this._editor=e,this.delegate=i,this._activeCodeActions=this._register(new MutableDisposable),_CodeActionUi_disposed.set(this,!1),this._codeActionWidget=new Lazy((()=>this._register(o.createInstance(CodeActionMenu,this._editor,{onSelectCodeAction:e=>__awaiter$X(this,void 0,void 0,(function*(){this.delegate.applyCodeAction(e,!0)}))})))),this._lightBulbWidget=new Lazy((()=>{const e=this._register(o.createInstance(LightBulbWidget,this._editor,t,n));return this._register(e.onClick((e=>this.showCodeActionList(e.trigger,e.actions,e,{includeDisabledActions:!1})))),e}))}dispose(){__classPrivateFieldSet$1(this,_CodeActionUi_disposed,!0,"f"),super.dispose()}update(e){var t,n,i,o,r;return __awaiter$X(this,void 0,void 0,(function*(){if(1!==e.type)return void(null===(t=this._lightBulbWidget.rawValue)||void 0===t||t.hide());let s;try{s=yield e.actions}catch(e2){return void onUnexpectedError(e2)}if(!__classPrivateFieldGet$1(this,_CodeActionUi_disposed,"f"))if(this._lightBulbWidget.getValue().update(s,e.trigger,e.position),1===e.trigger.type){if(null===(n=e.trigger.filter)||void 0===n?void 0:n.include){const t=this.tryGetValidActionToApply(e.trigger,s);if(t){try{this._lightBulbWidget.getValue().hide(),yield this.delegate.applyCodeAction(t,!1)}finally{s.dispose()}return}if(e.trigger.context){const t=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,s);if(t&&t.action.disabled)return null===(i=MessageController.get(this._editor))||void 0===i||i.showMessage(t.action.disabled,e.trigger.context.position),void s.dispose()}}const t=!!(null===(o=e.trigger.filter)||void 0===o?void 0:o.include);if(e.trigger.context&&(!s.allActions.length||!t&&!s.validActions.length))return null===(r=MessageController.get(this._editor))||void 0===r||r.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=s,void s.dispose();this._activeCodeActions.value=s,this._codeActionWidget.getValue().show(e.trigger,s,e.position,{includeDisabledActions:t})}else this._codeActionWidget.getValue().isVisible?s.dispose():this._activeCodeActions.value=s}))}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length)return"first"===e.autoApply&&0===t.validActions.length||"ifSingle"===e.autoApply&&1===t.allActions.length?t.allActions.find((({action:e})=>e.disabled)):void 0}tryGetValidActionToApply(e,t){if(t.validActions.length)return"first"===e.autoApply&&t.validActions.length>0||"ifSingle"===e.autoApply&&1===t.validActions.length?t.validActions[0]:void 0}showCodeActionList(e,t,n,i){return __awaiter$X(this,void 0,void 0,(function*(){this._codeActionWidget.getValue().show(e,t,n,i)}))}};var MarkerSeverity$2,MarkerSeverity2,IMarkerData;_CodeActionUi_disposed=new WeakMap,CodeActionUi=__decorate$1n([__param$1j(4,IInstantiationService)],CodeActionUi),MarkerSeverity2=MarkerSeverity$2||(MarkerSeverity$2={}),MarkerSeverity2[MarkerSeverity2.Hint=1]="Hint",MarkerSeverity2[MarkerSeverity2.Info=2]="Info",MarkerSeverity2[MarkerSeverity2.Warning=4]="Warning",MarkerSeverity2[MarkerSeverity2.Error=8]="Error",function(e){e.compare=function(e,t){return t-e};const t=Object.create(null);t[e.Error]=localize("sev.error","Error"),t[e.Warning]=localize("sev.warning","Warning"),t[e.Info]=localize("sev.info","Info"),e.toString=function(e){return t[e]||""},e.fromSeverity=function(t){switch(t){case Severity$2.Error:return e.Error;case Severity$2.Warning:return e.Warning;case Severity$2.Info:return e.Info;case Severity$2.Ignore:return e.Hint}},e.toSeverity=function(t){switch(t){case e.Error:return Severity$2.Error;case e.Warning:return Severity$2.Warning;case e.Info:return Severity$2.Info;case e.Hint:return Severity$2.Ignore}}}(MarkerSeverity$2||(MarkerSeverity$2={})),function(e){const t="";function n(e,n){let i=[t];return e.source?i.push(e.source.replace("¦","\\¦")):i.push(t),e.code?"string"==typeof e.code?i.push(e.code.replace("¦","\\¦")):i.push(e.code.value.replace("¦","\\¦")):i.push(t),void 0!==e.severity&&null!==e.severity?i.push(MarkerSeverity$2.toString(e.severity)):i.push(t),e.message&&n?i.push(e.message.replace("¦","\\¦")):i.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?i.push(e.startLineNumber.toString()):i.push(t),void 0!==e.startColumn&&null!==e.startColumn?i.push(e.startColumn.toString()):i.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?i.push(e.endLineNumber.toString()):i.push(t),void 0!==e.endColumn&&null!==e.endColumn?i.push(e.endColumn.toString()):i.push(t),i.push(t),i.join("¦")}e.makeKey=function(e){return n(e,!0)},e.makeKeyOptionalMessage=n}(IMarkerData||(IMarkerData={}));const IMarkerService=createDecorator("markerService");var __classPrivateFieldGet=globalThis&&globalThis.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},__classPrivateFieldSet=globalThis&&globalThis.__classPrivateFieldSet||function(e,t,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(e,n):o?o.value=n:t.set(e,n),n},_CodeActionModel_isDisposed;const SUPPORTED_CODE_ACTIONS=new RawContextKey("supportedCodeAction","");class CodeActionOracle extends Disposable{constructor(e,t,n,i=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=i,this._autoTriggerTimer=this._register(new TimeoutTimer),this._register(this._markerService.onMarkerChanged((e=>this._onMarkerChanges(e)))),this._register(this._editor.onDidChangeCursorPosition((()=>this._onCursorChange())))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);return this._createEventAndSignalChange(e,t)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some((e=>isEqual(e,t.uri)))&&this._autoTriggerTimer.cancelAndSet((()=>{this.trigger({type:2})}),this._delay)}_onCursorChange(){this._autoTriggerTimer.cancelAndSet((()=>{this.trigger({type:2})}),this._delay)}_getRangeOfMarker(e){const t=this._editor.getModel();if(t)for(const n of this._markerService.read({resource:t.uri})){const i=t.validateRange(n);if(Range$2.intersectRanges(i,e))return Range$2.lift(i)}}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=this._editor.getSelection();if(n.isEmpty()&&2===e.type){const{lineNumber:e,column:i}=n.getPosition(),o=t.getLineContent(e);if(0===o.length)return;if(1===i){if(/\s/.test(o[0]))return}else if(i===t.getLineMaxColumn(e)){if(/\s/.test(o[o.length-1]))return}else if(/\s/.test(o[i-2])&&/\s/.test(o[i-1]))return}return n}_createEventAndSignalChange(e,t){const n=this._editor.getModel();if(!t||!n)return void this._signalChange(void 0);const i=this._getRangeOfMarker(t),o=i?i.getStartPosition():t.getStartPosition(),r={trigger:e,selection:t,position:o};return this._signalChange(r),r}}var CodeActionsState;!function(e){e.Empty={type:0};e.Triggered=class{constructor(e,t,n,i){this.trigger=e,this.rangeOrSelection=t,this.position=n,this._cancellablePromise=i,this.type=1,this.actions=i.catch((e=>{if(isCancellationError(e))return emptyCodeActionSet;throw e}))}cancel(){this._cancellablePromise.cancel()}}}(CodeActionsState||(CodeActionsState={}));const emptyCodeActionSet={allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1};class CodeActionModel extends Disposable{constructor(e,t,n,i,o){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=o,this._codeActionOracle=this._register(new MutableDisposable),this._state=CodeActionsState.Empty,this._onDidChangeState=this._register(new Emitter$1),this.onDidChangeState=this._onDidChangeState.event,_CodeActionModel_isDisposed.set(this,!1),this._supportedCodeActions=SUPPORTED_CODE_ACTIONS.bindTo(i),this._register(this._editor.onDidChangeModel((()=>this._update()))),this._register(this._editor.onDidChangeModelLanguage((()=>this._update()))),this._register(this._registry.onDidChange((()=>this._update()))),this._update()}dispose(){__classPrivateFieldGet(this,_CodeActionModel_isDisposed,"f")||(__classPrivateFieldSet(this,_CodeActionModel_isDisposed,!0,"f"),super.dispose(),this.setState(CodeActionsState.Empty,!0))}_update(){if(__classPrivateFieldGet(this,_CodeActionModel_isDisposed,"f"))return;this._codeActionOracle.value=void 0,this.setState(CodeActionsState.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(81)){const t=[];for(const n of this._registry.all(e))Array.isArray(n.providedCodeActionKinds)&&t.push(...n.providedCodeActionKinds);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new CodeActionOracle(this._editor,this._markerService,(t=>{var n;if(!t)return void this.setState(CodeActionsState.Empty);const i=createCancelablePromise((n=>getCodeActions(this._registry,e,t.selection,t.trigger,Progress.None,n)));1===t.trigger.type&&(null===(n=this._progressService)||void 0===n||n.showWhile(i,250)),this.setState(new CodeActionsState.Triggered(t.trigger,t.selection,t.position,i))}),void 0),this._codeActionOracle.value.trigger({type:2})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value&&this._codeActionOracle.value.trigger(e)}setState(e,t){e!==this._state&&(1===this._state.type&&this._state.cancel(),this._state=e,t||__classPrivateFieldGet(this,_CodeActionModel_isDisposed,"f")||this._onDidChangeState.fire(e))}}_CodeActionModel_isDisposed=new WeakMap;var __decorate$1m=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1i=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$W=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};function contextKeyForSupportedActions(e){return ContextKeyExpr.regex(SUPPORTED_CODE_ACTIONS.keys()[0],new RegExp("(\\s|^)"+escapeRegExpCharacters(e.value)+"\\b"))}const argsSchema={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:localize("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:localize("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[localize("args.schema.apply.first","Always apply the first returned code action."),localize("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),localize("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:localize("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};let QuickFixController=class e extends Disposable{constructor(e,t,n,i,o,r){super(),this._instantiationService=o,this._editor=e,this._model=this._register(new CodeActionModel(this._editor,r.codeActionProvider,t,n,i)),this._register(this._model.onDidChangeState((e=>this.update(e)))),this._ui=new Lazy((()=>this._register(new CodeActionUi(e,QuickFixAction.Id,AutoFixAction.Id,{applyCodeAction:(e,t)=>__awaiter$W(this,void 0,void 0,(function*(){try{yield this._applyCodeAction(e)}finally{t&&this._trigger({type:2,filter:{}})}}))},this._instantiationService))))}static get(t){return t.getContribution(e.ID)}update(e){this._ui.getValue().update(e)}showCodeActions(e,t,n){return this._ui.getValue().showCodeActionList(e,t,n,{includeDisabledActions:!1})}manualTriggerAtCurrentPosition(e,t,n){var i;if(!this._editor.hasModel())return;null===(i=MessageController.get(this._editor))||void 0===i||i.closeMessage();const o=this._editor.getPosition();this._trigger({type:1,filter:t,autoApply:n,context:{notAvailableMessage:e,position:o}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e){return this._instantiationService.invokeFunction(applyCodeAction,e,this._editor)}};function applyCodeAction(e,t,n){return __awaiter$W(this,void 0,void 0,(function*(){const i=e.get(IBulkEditService),o=e.get(ICommandService),r=e.get(ITelemetryService),s=e.get(INotificationService);if(r.publicLog2("codeAction.applyCodeAction",{codeActionTitle:t.action.title,codeActionKind:t.action.kind,codeActionIsPreferred:!!t.action.isPreferred}),yield t.resolve(CancellationToken.None),t.action.edit&&(yield i.apply(ResourceEdit.convert(t.action.edit),{editor:n,label:t.action.title})),t.action.command)try{yield o.executeCommand(t.action.command.id,...t.action.command.arguments||[])}catch(a){const e=asMessage(a);s.error("string"==typeof e?e:localize("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}))}function asMessage(e){return"string"==typeof e?e:e instanceof Error&&"string"==typeof e.message?e.message:void 0}function triggerCodeActionsForEditorSelection(e,t,n,i){if(e.hasModel()){const o=QuickFixController.get(e);o&&o.manualTriggerAtCurrentPosition(t,n,i)}}QuickFixController.ID="editor.contrib.quickFixController",QuickFixController=__decorate$1m([__param$1i(1,IMarkerService),__param$1i(2,IContextKeyService),__param$1i(3,IEditorProgressService),__param$1i(4,IInstantiationService),__param$1i(5,ILanguageFeaturesService)],QuickFixController);class QuickFixAction extends EditorAction{constructor(){super({id:QuickFixAction.Id,label:localize("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.hasCodeActionsProvider),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:2132,weight:100}})}run(e,t){return triggerCodeActionsForEditorSelection(t,localize("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0)}}QuickFixAction.Id="editor.action.quickFix";class CodeActionCommand extends EditorCommand{constructor(){super({id:codeActionCommandId,precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:argsSchema}]}})}runEditorCommand(e,t,n){const i=CodeActionCommandArgs.fromUser(n,{kind:CodeActionKind.Empty,apply:"ifSingle"});return triggerCodeActionsForEditorSelection(t,"string"==typeof(null==n?void 0:n.kind)?i.preferred?localize("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",n.kind):localize("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",n.kind):i.preferred?localize("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):localize("editor.action.codeAction.noneMessage","No code actions available"),{include:i.kind,includeSourceActions:!0,onlyIncludePreferredActions:i.preferred},i.apply)}}class RefactorAction extends EditorAction{constructor(){super({id:refactorCommandId,label:localize("refactor.label","Refactor..."),alias:"Refactor...",precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.hasCodeActionsProvider),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:ContextKeyExpr.and(EditorContextKeys.writable,contextKeyForSupportedActions(CodeActionKind.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:argsSchema}]}})}run(e,t,n){const i=CodeActionCommandArgs.fromUser(n,{kind:CodeActionKind.Refactor,apply:"never"});return triggerCodeActionsForEditorSelection(t,"string"==typeof(null==n?void 0:n.kind)?i.preferred?localize("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",n.kind):localize("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",n.kind):i.preferred?localize("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):localize("editor.action.refactor.noneMessage","No refactorings available"),{include:CodeActionKind.Refactor.contains(i.kind)?i.kind:CodeActionKind.None,onlyIncludePreferredActions:i.preferred},i.apply)}}class SourceAction extends EditorAction{constructor(){super({id:sourceActionCommandId,label:localize("source.label","Source Action..."),alias:"Source Action...",precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:ContextKeyExpr.and(EditorContextKeys.writable,contextKeyForSupportedActions(CodeActionKind.Source))},description:{description:"Source Action...",args:[{name:"args",schema:argsSchema}]}})}run(e,t,n){const i=CodeActionCommandArgs.fromUser(n,{kind:CodeActionKind.Source,apply:"never"});return triggerCodeActionsForEditorSelection(t,"string"==typeof(null==n?void 0:n.kind)?i.preferred?localize("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",n.kind):localize("editor.action.source.noneMessage.kind","No source actions for '{0}' available",n.kind):i.preferred?localize("editor.action.source.noneMessage.preferred","No preferred source actions available"):localize("editor.action.source.noneMessage","No source actions available"),{include:CodeActionKind.Source.contains(i.kind)?i.kind:CodeActionKind.None,includeSourceActions:!0,onlyIncludePreferredActions:i.preferred},i.apply)}}class OrganizeImportsAction extends EditorAction{constructor(){super({id:organizeImportsCommandId,label:localize("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:ContextKeyExpr.and(EditorContextKeys.writable,contextKeyForSupportedActions(CodeActionKind.SourceOrganizeImports)),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:1581,weight:100}})}run(e,t){return triggerCodeActionsForEditorSelection(t,localize("editor.action.organize.noneMessage","No organize imports action available"),{include:CodeActionKind.SourceOrganizeImports,includeSourceActions:!0},"ifSingle")}}class FixAllAction extends EditorAction{constructor(){super({id:fixAllCommandId,label:localize("fixAll.label","Fix All"),alias:"Fix All",precondition:ContextKeyExpr.and(EditorContextKeys.writable,contextKeyForSupportedActions(CodeActionKind.SourceFixAll))})}run(e,t){return triggerCodeActionsForEditorSelection(t,localize("fixAll.noneMessage","No fix all action available"),{include:CodeActionKind.SourceFixAll,includeSourceActions:!0},"ifSingle")}}class AutoFixAction extends EditorAction{constructor(){super({id:AutoFixAction.Id,label:localize("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:ContextKeyExpr.and(EditorContextKeys.writable,contextKeyForSupportedActions(CodeActionKind.QuickFix)),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:1620,mac:{primary:2644},weight:100}})}run(e,t){return triggerCodeActionsForEditorSelection(t,localize("editor.action.autoFix.noneMessage","No auto fixes available"),{include:CodeActionKind.QuickFix,onlyIncludePreferredActions:!0},"ifSingle")}}function hash(e){return doHash(e,0)}function doHash(e,t){switch(typeof e){case"object":return null===e?numberHash(349,t):Array.isArray(e)?arrayHash(e,t):objectHash(e,t);case"string":return stringHash(e,t);case"boolean":return booleanHash(e,t);case"number":return numberHash(e,t);case"undefined":return numberHash(937,t);default:return numberHash(617,t)}}function numberHash(e,t){return(t<<5)-t+e|0}function booleanHash(e,t){return numberHash(e?433:863,t)}function stringHash(e,t){t=numberHash(149417,t);for(let n=0,i=e.length;n<i;n++)t=numberHash(e.charCodeAt(n),t);return t}function arrayHash(e,t){return t=numberHash(104579,t),e.reduce(((e,t)=>doHash(t,e)),t)}function objectHash(e,t){return t=numberHash(181387,t),Object.keys(e).sort().reduce(((t,n)=>(t=stringHash(n,t),doHash(e[n],t))),t)}function leftRotate(e,t,n=32){const i=n-t;return(e<<t|(~((1<<i)-1)&e)>>>i)>>>0}function fill(e,t=0,n=e.byteLength,i=0){for(let o=0;o<n;o++)e[t+o]=i}function leftPad(e,t,n="0"){for(;e.length<t;)e=n+e;return e}function toHexString(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join(""):leftPad((e>>>0).toString(16),t/4)}AutoFixAction.Id="editor.action.autoFix",registerEditorContribution(QuickFixController.ID,QuickFixController),registerEditorAction(QuickFixAction),registerEditorAction(RefactorAction),registerEditorAction(SourceAction),registerEditorAction(OrganizeImportsAction),registerEditorAction(AutoFixAction),registerEditorAction(FixAllAction),registerEditorCommand(new CodeActionCommand);class StringSHA1{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(0===t)return;const n=this._buff;let i,o,r=this._buffLen,s=this._leftoverHighSurrogate;for(0!==s?(i=s,o=-1,s=0):(i=e.charCodeAt(0),o=0);;){let a=i;if(isHighSurrogate(i)){if(!(o+1<t)){s=i;break}{const t=e.charCodeAt(o+1);isLowSurrogate(t)?(o++,a=computeCodePoint(i,t)):a=65533}}else isLowSurrogate(i)&&(a=65533);if(r=this._push(n,r,a),o++,!(o<t))break;i=e.charCodeAt(o)}this._buffLen=r,this._leftoverHighSurrogate=s}_push(e,t,n){return n<128?e[t++]=n:n<2048?(e[t++]=192|(1984&n)>>>6,e[t++]=128|(63&n)>>>0):n<65536?(e[t++]=224|(61440&n)>>>12,e[t++]=128|(4032&n)>>>6,e[t++]=128|(63&n)>>>0):(e[t++]=240|(1835008&n)>>>18,e[t++]=128|(258048&n)>>>12,e[t++]=128|(4032&n)>>>6,e[t++]=128|(63&n)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),toHexString(this._h0)+toHexString(this._h1)+toHexString(this._h2)+toHexString(this._h3)+toHexString(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,fill(this._buff,this._buffLen),this._buffLen>56&&(this._step(),fill(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=StringSHA1._bigBlock32,t=this._buffDV;for(let d=0;d<64;d+=4)e.setUint32(d,t.getUint32(d,!1),!1);for(let d=64;d<320;d+=4)e.setUint32(d,leftRotate(e.getUint32(d-12,!1)^e.getUint32(d-32,!1)^e.getUint32(d-56,!1)^e.getUint32(d-64,!1),1),!1);let n,i,o,r=this._h0,s=this._h1,a=this._h2,l=this._h3,c=this._h4;for(let d=0;d<80;d++)d<20?(n=s&a|~s&l,i=1518500249):d<40?(n=s^a^l,i=1859775393):d<60?(n=s&a|s&l|a&l,i=2400959708):(n=s^a^l,i=3395469782),o=leftRotate(r,5)+n+c+i+e.getUint32(4*d,!1)&4294967295,c=l,l=a,a=leftRotate(s,30),s=r,r=o;this._h0=this._h0+r&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+l&4294967295,this._h4=this._h4+c&4294967295}}StringSHA1._bigBlock32=new DataView(new ArrayBuffer(320));var __awaiter$V=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class CodeLensModel{constructor(){this.lenses=[],this._disposables=new DisposableStore}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const n of e.lenses)this.lenses.push({symbol:n,provider:t})}}function getCodeLensModel(e,t,n){return __awaiter$V(this,void 0,void 0,(function*(){const i=e.ordered(t),o=new Map,r=new CodeLensModel,s=i.map(((e,i)=>__awaiter$V(this,void 0,void 0,(function*(){o.set(e,i);try{const i=yield Promise.resolve(e.provideCodeLenses(t,n));i&&r.add(i,e)}catch(s){onUnexpectedExternalError(s)}}))));return yield Promise.all(s),r.lenses=r.lenses.sort(((e,t)=>e.symbol.range.startLineNumber<t.symbol.range.startLineNumber?-1:e.symbol.range.startLineNumber>t.symbol.range.startLineNumber?1:o.get(e.provider)<o.get(t.provider)?-1:o.get(e.provider)>o.get(t.provider)?1:e.symbol.range.startColumn<t.symbol.range.startColumn?-1:e.symbol.range.startColumn>t.symbol.range.startColumn?1:0)),r}))}CommandsRegistry.registerCommand("_executeCodeLensProvider",(function(e,...t){let[n,i]=t;assertType(URI.isUri(n)),assertType("number"==typeof i||!i);const{codeLensProvider:o}=e.get(ILanguageFeaturesService),r=e.get(IModelService).getModel(n);if(!r)throw illegalArgument();const s=[],a=new DisposableStore;return getCodeLensModel(o,r,CancellationToken.None).then((e=>{a.add(e);let t=[];for(const n of e.lenses)null==i||Boolean(n.symbol.command)?s.push(n.symbol):i-- >0&&n.provider.resolveCodeLens&&t.push(Promise.resolve(n.provider.resolveCodeLens(r,n.symbol,CancellationToken.None)).then((e=>s.push(e||n.symbol))));return Promise.all(t)})).then((()=>s)).finally((()=>{setTimeout((()=>a.dispose()),100)}))}));var __awaiter$U=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},StorageState,StorageState2;StorageState2=StorageState||(StorageState={}),StorageState2[StorageState2.None=0]="None",StorageState2[StorageState2.Initialized=1]="Initialized",StorageState2[StorageState2.Closed=2]="Closed";class Storage extends Disposable{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new Emitter$1),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=StorageState.None,this.cache=new Map,this.flushDelayer=new ThrottledDelayer(Storage.DEFAULT_FLUSH_DELAY),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal((e=>this.onDidChangeItemsExternal(e))))}onDidChangeItemsExternal(e){var t,n;null===(t=e.changed)||void 0===t||t.forEach(((e,t)=>this.accept(t,e))),null===(n=e.deleted)||void 0===n||n.forEach((e=>this.accept(e,void 0)))}accept(e,t){if(this.state===StorageState.Closed)return;let n=!1;if(isUndefinedOrNull(t))n=this.cache.delete(e);else{this.cache.get(e)!==t&&(this.cache.set(e,t),n=!0)}n&&this._onDidChangeStorage.fire(e)}get(e,t){const n=this.cache.get(e);return isUndefinedOrNull(n)?t:n}getBoolean(e,t){const n=this.get(e);return isUndefinedOrNull(n)?t:"true"===n}getNumber(e,t){const n=this.get(e);return isUndefinedOrNull(n)?t:parseInt(n,10)}set(e,t){return __awaiter$U(this,void 0,void 0,(function*(){if(this.state===StorageState.Closed)return;if(isUndefinedOrNull(t))return this.delete(e);const n=String(t);return this.cache.get(e)!==n?(this.cache.set(e,n),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire(e),this.doFlush()):void 0}))}delete(e){return __awaiter$U(this,void 0,void 0,(function*(){if(this.state===StorageState.Closed)return;return this.cache.delete(e)?(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire(e),this.doFlush()):void 0}))}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return __awaiter$U(this,void 0,void 0,(function*(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally((()=>{var e;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)null===(e=this.whenFlushedCallbacks.pop())||void 0===e||e()}))}))}doFlush(e){return __awaiter$U(this,void 0,void 0,(function*(){return this.flushDelayer.trigger((()=>this.flushPending()),e)}))}dispose(){this.flushDelayer.dispose(),super.dispose()}}Storage.DEFAULT_FLUSH_DELAY=100;class InMemoryStorageDatabase{constructor(){this.onDidChangeItemsExternal=Event$1.None,this.items=new Map}updateItems(e){return __awaiter$U(this,void 0,void 0,(function*(){e.insert&&e.insert.forEach(((e,t)=>this.items.set(t,e))),e.delete&&e.delete.forEach((e=>this.items.delete(e)))}))}}const TARGET_KEY="__$__targetStorageMarker",IStorageService=createDecorator("storageService");var WillSaveStateReason,WillSaveStateReason2;WillSaveStateReason2=WillSaveStateReason||(WillSaveStateReason={}),WillSaveStateReason2[WillSaveStateReason2.NONE=0]="NONE",WillSaveStateReason2[WillSaveStateReason2.SHUTDOWN=1]="SHUTDOWN";class AbstractStorageService extends Disposable{constructor(e={flushInterval:AbstractStorageService.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new PauseableEmitter),this._onDidChangeTarget=this._register(new PauseableEmitter),this._onWillSaveState=this._register(new Emitter$1),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._globalKeyTargets=void 0}emitDidChangeValue(e,t){t===TARGET_KEY?(0===e?this._globalKeyTargets=void 0:1===e&&(this._workspaceKeyTargets=void 0),this._onDidChangeTarget.fire({scope:e})):this._onDidChangeValue.fire({scope:e,key:t,target:this.getKeyTargets(e)[t]})}get(e,t,n){var i;return null===(i=this.getStorage(t))||void 0===i?void 0:i.get(e,n)}getBoolean(e,t,n){var i;return null===(i=this.getStorage(t))||void 0===i?void 0:i.getBoolean(e,n)}getNumber(e,t,n){var i;return null===(i=this.getStorage(t))||void 0===i?void 0:i.getNumber(e,n)}store(e,t,n,i){isUndefinedOrNull(t)?this.remove(e,n):this.withPausedEmitters((()=>{var o;this.updateKeyTarget(e,n,i),null===(o=this.getStorage(n))||void 0===o||o.set(e,t)}))}remove(e,t){this.withPausedEmitters((()=>{var n;this.updateKeyTarget(e,t,void 0),null===(n=this.getStorage(t))||void 0===n||n.delete(e)}))}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,n){var i,o;const r=this.getKeyTargets(t);"number"==typeof n?r[e]!==n&&(r[e]=n,null===(i=this.getStorage(t))||void 0===i||i.set(TARGET_KEY,JSON.stringify(r))):"number"==typeof r[e]&&(delete r[e],null===(o=this.getStorage(t))||void 0===o||o.set(TARGET_KEY,JSON.stringify(r)))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get globalKeyTargets(){return this._globalKeyTargets||(this._globalKeyTargets=this.loadKeyTargets(0)),this._globalKeyTargets}getKeyTargets(e){return 0===e?this.globalKeyTargets:this.workspaceKeyTargets}loadKeyTargets(e){const t=this.get(TARGET_KEY,e);if(t)try{return JSON.parse(t)}catch(n){}return Object.create(null)}}AbstractStorageService.DEFAULT_FLUSH_INTERVAL=6e4;class InMemoryStorageService extends AbstractStorageService{constructor(){super(),this.globalStorage=this._register(new Storage(new InMemoryStorageDatabase)),this.workspaceStorage=this._register(new Storage(new InMemoryStorageDatabase)),this._register(this.workspaceStorage.onDidChangeStorage((e=>this.emitDidChangeValue(1,e)))),this._register(this.globalStorage.onDidChangeStorage((e=>this.emitDidChangeValue(0,e))))}getStorage(e){return 0===e?this.globalStorage:this.workspaceStorage}}var __decorate$1l=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1h=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const ICodeLensCache=createDecorator("ICodeLensCache");class CacheItem{constructor(e,t){this.lineCount=e,this.data=t}}let CodeLensCache=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new LRUCache(20,.75);runWhenIdle((()=>e.remove("codelens/cache",1)));const t="codelens/cache2",n=e.get(t,1,"{}");this._deserialize(n),once$1(e.onWillSaveState)((n=>{n.reason===WillSaveStateReason.SHUTDOWN&&e.store(t,this._serialize(),1,1)}))}put(e,t){const n=t.lenses.map((e=>{var t;return{range:e.symbol.range,command:e.symbol.command&&{id:"",title:null===(t=e.symbol.command)||void 0===t?void 0:t.title}}})),i=new CodeLensModel;i.add({lenses:n,dispose:()=>{}},this._fakeProvider);const o=new CacheItem(e.getLineCount(),i);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,n]of this._cache){const i=new Set;for(const e of n.data.lenses)i.add(e.symbol.range.startLineNumber);e[t]={lineCount:n.lineCount,lines:[...i.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const e in t){const n=t[e],i=[];for(const e of n.lines)i.push({range:new Range$2(e,1,e,11)});const o=new CodeLensModel;o.add({lenses:i,dispose(){}},this._fakeProvider),this._cache.set(e,new CacheItem(n.lineCount,o))}}catch(t){}}};CodeLensCache=__decorate$1l([__param$1h(0,IStorageService)],CodeLensCache),registerSingleton(ICodeLensCache,CodeLensCache);const labelWithIconsRegex=new RegExp(`(\\\\)?\\$\\((${CSSIcon.iconNameExpression}(?:${CSSIcon.iconModifierExpression})?)\\)`,"g");function renderLabelWithIcons(e){const t=new Array;let n,i=0,o=0;for(;null!==(n=labelWithIconsRegex.exec(e));){o=n.index||0,t.push(e.substring(i,o)),i=(n.index||0)+n[0].length;const[,r,s]=n;t.push(r?`$(${s})`:renderIcon({id:s}))}return i<e.length&&t.push(e.substring(i)),t}function renderIcon(e){const t=$$c("span");return t.classList.add(...CSSIcon.asClassNameArray(e)),t}var codelensWidget="";class CodeLensViewZone{constructor(e,t,n){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=n,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){void 0===this._lastHeight?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return 0!==this._lastHeight&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class CodeLensContentWidget{constructor(e,t,n){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id="codelens.widget-"+CodeLensContentWidget._idPool++,this.updatePosition(n),this._domNode=document.createElement("span"),this._domNode.className=`codelens-decoration ${t}`}withCommands(e,t){this._commands.clear();let n=[],i=!1;for(let o=0;o<e.length;o++){const t=e[o];if(t&&(i=!0,t.command)){const i=renderLabelWithIcons(t.command.title.trim());t.command.id?(n.push($$c("a",{id:String(o),title:t.command.tooltip},...i)),this._commands.set(String(o),t.command)):n.push($$c("span",{title:t.command.tooltip},...i)),o+1<e.length&&n.push($$c("span",void 0," | "))}}i?(reset(this._domNode,...n),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):reset(this._domNode,$$c("span",void 0,"no commands"))}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){const t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}}CodeLensContentWidget._idPool=0;class CodeLensHelper{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){let t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let n=0,i=t.length;n<i;n++)this._addDecorationsCallbacks[n](t[n])}}class CodeLensWidget{constructor(e,t,n,i,o,r,s){let a;this._isDisposed=!1,this._editor=t,this._className=n,this._data=e,this._decorationIds=[];let l=[];this._data.forEach(((e,t)=>{e.symbol.command&&l.push(e.symbol),i.addDecoration({range:e.symbol.range,options:ModelDecorationOptions.EMPTY},(e=>this._decorationIds[t]=e)),a=a?Range$2.plusRange(a,e.symbol.range):Range$2.lift(e.symbol.range)})),this._viewZone=new CodeLensViewZone(a.startLineNumber-1,r,s),this._viewZoneId=o.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new CodeLensContentWidget(this._editor,this._className,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t&&t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some(((e,t)=>{const n=this._editor.getModel().getDecorationRange(e),i=this._data[t].symbol;return!(!n||Range$2.isEmpty(i.range)!==n.isEmpty())}))}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach(((e,n)=>{t.addDecoration({range:e.symbol.range,options:ModelDecorationOptions.EMPTY},(e=>this._decorationIds[n]=e))}))}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t<this._decorationIds.length;t++){const n=e.getDecorationRange(this._decorationIds[t]);n&&(this._data[t].symbol.range=n)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){const n=e[t];if(n){const{symbol:e}=this._data[t];e.command=n.command||e.command}}}getCommand(e){var t;return null===(t=this._contentWidget)||void 0===t?void 0:t.getCommand(e)}getLineNumber(){const e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){const t=this._editor.getModel().getDecorationRange(this._decorationIds[0]);t&&(this._viewZone.afterLineNumber=t.startLineNumber-1,e.layoutZone(this._viewZoneId),this._contentWidget&&(this._contentWidget.updatePosition(t.startLineNumber),this._editor.layoutContentWidget(this._contentWidget)))}}}const NO_KEY_MODS={ctrlCmd:!1,alt:!1};var QuickInputHideReason,QuickInputHideReason2,ItemActivation,ItemActivation2;QuickInputHideReason2=QuickInputHideReason||(QuickInputHideReason={}),QuickInputHideReason2[QuickInputHideReason2.Blur=1]="Blur",QuickInputHideReason2[QuickInputHideReason2.Gesture=2]="Gesture",QuickInputHideReason2[QuickInputHideReason2.Other=3]="Other",ItemActivation2=ItemActivation||(ItemActivation={}),ItemActivation2[ItemActivation2.NONE=0]="NONE",ItemActivation2[ItemActivation2.FIRST=1]="FIRST",ItemActivation2[ItemActivation2.SECOND=2]="SECOND",ItemActivation2[ItemActivation2.LAST=3]="LAST";const IQuickInputService=createDecorator("quickInputService");function clamp(e,t,n){return Math.min(Math.max(e,t),n)}class MovingAverage{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class SlidingWindowAverage{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}var __decorate$1k=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1g=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const ILanguageFeatureDebounceService=createDecorator("ILanguageFeatureDebounceService");var IdentityHash;!function(e){const t=new WeakMap;let n=0;e.of=function(e){let i=t.get(e);return void 0===i&&(i=++n,t.set(e,i)),i}}(IdentityHash||(IdentityHash={}));class FeatureDebounceInformation{constructor(e,t,n,i,o,r){this._logService=e,this._name=t,this._registry=n,this._default=i,this._min=o,this._max=r,this._cache=new LRUCache(50,.7)}_key(e){return e.id+this._registry.all(e).reduce(((e,t)=>doHash(IdentityHash.of(t),e)),0)}get(e){const t=this._key(e),n=this._cache.get(t);return n?clamp(n.value,this._min,this._max):this.default()}update(e,t){const n=this._key(e);let i=this._cache.get(n);i||(i=new SlidingWindowAverage(6),this._cache.set(n,i));const o=clamp(i.update(t),this._min,this._max);return this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new MovingAverage;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){return clamp(0|this._overall()||this._default,this._min,this._max)}}let LanguageFeatureDebounceService=class{constructor(e){this._logService=e,this._data=new Map}for(e,t,n){var i,o,r;const s=null!==(i=null==n?void 0:n.min)&&void 0!==i?i:50,a=null!==(o=null==n?void 0:n.max)&&void 0!==o?o:Math.pow(s,2),l=null!==(r=null==n?void 0:n.key)&&void 0!==r?r:void 0,c=`${IdentityHash.of(e)},${s}${l?","+l:""}`;let d=this._data.get(c);return d||(d=new FeatureDebounceInformation(this._logService,t,e,0|this._overallAverage()||1.5*s,s,a),this._data.set(c,d)),d}_overallAverage(){let e=new MovingAverage;for(let t of this._data.values())e.update(t.default());return e.value}};LanguageFeatureDebounceService=__decorate$1k([__param$1g(0,ILogService)],LanguageFeatureDebounceService),registerSingleton(ILanguageFeatureDebounceService,LanguageFeatureDebounceService,!0);var __decorate$1j=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1f=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$T=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};let CodeLensContribution=class{constructor(e,t,n,i,o,r){this._editor=e,this._languageFeaturesService=t,this._commandService=i,this._notificationService=o,this._codeLensCache=r,this._disposables=new DisposableStore,this._localToDispose=new DisposableStore,this._lenses=[],this._oldCodeLensModels=new DisposableStore,this._provideCodeLensDebounce=n.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=n.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new RunOnceScheduler((()=>this._resolveCodeLensesInViewport()),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel((()=>this._onModelChange()))),this._disposables.add(this._editor.onDidChangeModelLanguage((()=>this._onModelChange()))),this._disposables.add(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(44)||e.hasChanged(16)||e.hasChanged(15))&&this._updateLensStyle(),e.hasChanged(14)&&this._onModelChange()}))),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._styleClassName="_"+hash(this._editor.getId()).toString(16),this._styleElement=createStyleSheet(isInShadowDOM(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),null===(e=this._currentCodeLensModel)||void 0===e||e.dispose(),this._styleElement.remove()}_getLayoutInfo(){let e,t=this._editor.getOption(16);return!t||t<5?(t=.9*this._editor.getOption(46)|0,e=this._editor.getOption(59)):e=t*Math.max(1.3,this._editor.getOption(59)/this._editor.getOption(46))|0,{codeLensHeight:e,fontSize:t}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),n=this._editor.getOption(15),i=this._editor.getOption(44),o=`--codelens-font-family${this._styleClassName}`,r=`--codelens-font-features${this._styleClassName}`;let s=`\n\t\t.monaco-editor .codelens-decoration.${this._styleClassName} { line-height: ${e}px; font-size: ${t}px; padding-right: ${Math.round(.5*t)}px; font-feature-settings: var(${r}) }\n\t\t.monaco-editor .codelens-decoration.${this._styleClassName} span.codicon { line-height: ${e}px; font-size: ${t}px; }\n\t\t`;n&&(s+=`.monaco-editor .codelens-decoration.${this._styleClassName} { font-family: var(${o}), ${EDITOR_FONT_DEFAULTS.fontFamily}}`),this._styleElement.textContent=s,this._editor.getContainerDomNode().style.setProperty(o,null!=n?n:"inherit"),this._editor.getContainerDomNode().style.setProperty(r,i.fontFeatureSettings),this._editor.changeViewZones((t=>{for(let n of this._lenses)n.updateHeight(e,t)}))}_localDispose(){var e,t,n;null===(e=this._getCodeLensModelPromise)||void 0===e||e.cancel(),this._getCodeLensModelPromise=void 0,null===(t=this._resolveCodeLensesPromise)||void 0===t||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),null===(n=this._currentCodeLensModel)||void 0===n||n.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e)return;if(!this._editor.getOption(14))return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e))return void(t&&this._localToDispose.add(disposableTimeout((()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())}),3e4)));for(const i of this._languageFeaturesService.codeLensProvider.all(e))if("function"==typeof i.onDidChange){let e=i.onDidChange((()=>n.schedule()));this._localToDispose.add(e)}const n=new RunOnceScheduler((()=>{var t;const i=Date.now();null===(t=this._getCodeLensModelPromise)||void 0===t||t.cancel(),this._getCodeLensModelPromise=createCancelablePromise((t=>getCodeLensModel(this._languageFeaturesService.codeLensProvider,e,t))),this._getCodeLensModelPromise.then((t=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=t,this._codeLensCache.put(e,t);const o=this._provideCodeLensDebounce.update(e,Date.now()-i);n.delay=o,this._renderCodeLensSymbols(t),this._resolveCodeLensesInViewportSoon()}),onUnexpectedError)}),this._provideCodeLensDebounce.get(e));this._localToDispose.add(n),this._localToDispose.add(toDisposable((()=>this._resolveCodeLensesScheduler.cancel()))),this._localToDispose.add(this._editor.onDidChangeModelContent((()=>{this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{let n=[],i=-1;this._lenses.forEach((e=>{e.isValid()&&i!==e.getLineNumber()?(e.update(t),i=e.getLineNumber()):n.push(e)}));let o=new CodeLensHelper;n.forEach((e=>{e.dispose(o,t),this._lenses.splice(this._lenses.indexOf(e),1)})),o.commit(e)}))})),n.schedule()}))),this._localToDispose.add(this._editor.onDidFocusEditorWidget((()=>{n.schedule()}))),this._localToDispose.add(this._editor.onDidScrollChange((e=>{e.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()}))),this._localToDispose.add(this._editor.onDidLayoutChange((()=>{this._resolveCodeLensesInViewportSoon()}))),this._localToDispose.add(toDisposable((()=>{if(this._editor.getModel()){const e=StableEditorScrollState.capture(this._editor);this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{this._disposeAllLenses(e,t)}))})),e.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)}))),this._localToDispose.add(this._editor.onMouseDown((e=>{if(9!==e.target.type)return;let t=e.target.element;if("SPAN"===(null==t?void 0:t.tagName)&&(t=t.parentElement),"A"===(null==t?void 0:t.tagName))for(const n of this._lenses){let e=n.getCommand(t);if(e){this._commandService.executeCommand(e.id,...e.arguments||[]).catch((e=>this._notificationService.error(e)));break}}}))),n.schedule()}_disposeAllLenses(e,t){const n=new CodeLensHelper;for(const i of this._lenses)i.dispose(n,t);e&&n.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;let t,n=this._editor.getModel().getLineCount(),i=[];for(let s of e.lenses){let e=s.symbol.range.startLineNumber;e<1||e>n||(t&&t[t.length-1].symbol.range.startLineNumber===e?t.push(s):(t=[s],i.push(t)))}const o=StableEditorScrollState.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{const n=new CodeLensHelper;let o=0,s=0;for(;s<i.length&&o<this._lenses.length;){let e=i[s][0].symbol.range.startLineNumber,a=this._lenses[o].getLineNumber();a<e?(this._lenses[o].dispose(n,t),this._lenses.splice(o,1)):a===e?(this._lenses[o].updateCodeLensSymbols(i[s],n),s++,o++):(this._lenses.splice(o,0,new CodeLensWidget(i[s],this._editor,this._styleClassName,n,t,r.codeLensHeight,(()=>this._resolveCodeLensesInViewportSoon()))),o++,s++)}for(;o<this._lenses.length;)this._lenses[o].dispose(n,t),this._lenses.splice(o,1);for(;s<i.length;)this._lenses.push(new CodeLensWidget(i[s],this._editor,this._styleClassName,n,t,r.codeLensHeight,(()=>this._resolveCodeLensesInViewportSoon()))),s++;n.commit(e)}))})),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;null===(e=this._resolveCodeLensesPromise)||void 0===e||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const n=[],i=[];if(this._lenses.forEach((e=>{const o=e.computeIfNecessary(t);o&&(n.push(o),i.push(e))})),0===n.length)return;const o=Date.now(),r=createCancelablePromise((e=>{const o=n.map(((n,o)=>{const r=new Array(n.length),s=n.map(((n,i)=>n.symbol.command||"function"!=typeof n.provider.resolveCodeLens?(r[i]=n.symbol,Promise.resolve(void 0)):Promise.resolve(n.provider.resolveCodeLens(t,n.symbol,e)).then((e=>{r[i]=e}),onUnexpectedExternalError)));return Promise.all(s).then((()=>{e.isCancellationRequested||i[o].isDisposed()||i[o].updateCommands(r)}))}));return Promise.all(o)}));this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then((()=>{const e=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=e,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)}),(e=>{onUnexpectedError(e),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)}))}getModel(){return this._currentCodeLensModel}};function getColors(e,t,n){const i=[],o=e.ordered(t).reverse().map((e=>Promise.resolve(e.provideDocumentColors(t,n)).then((t=>{if(Array.isArray(t))for(let n of t)i.push({colorInfo:n,provider:e})}))));return Promise.all(o).then((()=>i))}function getColorPresentations(e,t,n,i){return Promise.resolve(n.provideColorPresentations(e,t,i))}CodeLensContribution.ID="css.editor.codeLens",CodeLensContribution=__decorate$1j([__param$1f(1,ILanguageFeaturesService),__param$1f(2,ILanguageFeatureDebounceService),__param$1f(3,ICommandService),__param$1f(4,INotificationService),__param$1f(5,ICodeLensCache)],CodeLensContribution),registerEditorContribution(CodeLensContribution.ID,CodeLensContribution),registerEditorAction(class extends EditorAction{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:EditorContextKeys.hasCodeLensProvider,label:localize("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return __awaiter$T(this,void 0,void 0,(function*(){if(!t.hasModel())return;const n=e.get(IQuickInputService),i=e.get(ICommandService),o=e.get(INotificationService),r=t.getSelection().positionLineNumber,s=t.getContribution(CodeLensContribution.ID);if(!s)return;const a=s.getModel();if(!a)return;const l=[];for(const e of a.lenses)e.symbol.command&&e.symbol.range.startLineNumber===r&&l.push({label:e.symbol.command.title,command:e.symbol.command});if(0===l.length)return;const c=yield n.pick(l,{canPickMany:!1});if(c){if(a.isDisposed)return yield i.executeCommand(this.id);try{yield i.executeCommand(c.command.id,...c.command.arguments||[])}catch(d){o.error(d)}}}))}}),CommandsRegistry.registerCommand("_executeDocumentColorProvider",(function(e,...t){const[n]=t;if(!(n instanceof URI))throw illegalArgument();const{colorProvider:i}=e.get(ILanguageFeaturesService),o=e.get(IModelService).getModel(n);if(!o)throw illegalArgument();const r=[],s=i.ordered(o).reverse().map((e=>Promise.resolve(e.provideDocumentColors(o,CancellationToken.None)).then((e=>{if(Array.isArray(e))for(let t of e)r.push({range:t.range,color:[t.color.red,t.color.green,t.color.blue,t.color.alpha]})}))));return Promise.all(s).then((()=>r))})),CommandsRegistry.registerCommand("_executeColorPresentationProvider",(function(e,...t){const[n,i]=t,{uri:o,range:r}=i;if(!(o instanceof URI&&Array.isArray(n)&&4===n.length&&Range$2.isIRange(r)))throw illegalArgument();const[s,a,l,c]=n,{colorProvider:d}=e.get(ILanguageFeaturesService),u=e.get(IModelService).getModel(o);if(!u)throw illegalArgument();const h={range:r,color:{red:s,green:a,blue:l,alpha:c}},g=[],p=d.ordered(u).reverse().map((e=>Promise.resolve(e.provideColorPresentations(u,h,CancellationToken.None)).then((e=>{Array.isArray(e)&&g.push(...e)}))));return Promise.all(p).then((()=>g))}));var __decorate$1i=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1e=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$S=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const ColorDecorationInjectedTextMarker=Object.create({}),MAX_DECORATORS=500;let ColorDetector=class e extends Disposable{constructor(t,n,i,o){super(),this._editor=t,this._configurationService=n,this._languageFeaturesService=i,this._localToDispose=this._register(new DisposableStore),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=new Set,this._ruleFactory=new DynamicCssRules(this._editor),this._colorDecorationClassRefs=this._register(new DisposableStore),this._debounceInformation=o.for(i.colorProvider,"Document Colors",{min:e.RECOMPUTE_TIME}),this._register(t.onDidChangeModel((()=>{this._isEnabled=this.isEnabled(),this.onModelChanged()}))),this._register(t.onDidChangeModelLanguage((()=>this.onModelChanged()))),this._register(i.colorProvider.onDidChange((()=>this.onModelChanged()))),this._register(t.onDidChangeConfiguration((()=>{let e=this._isEnabled;this._isEnabled=this.isEnabled(),e!==this._isEnabled&&(this._isEnabled?this.onModelChanged():this.removeAllDecorations())}))),this._timeoutTimer=null,this._computePromise=null,this._isEnabled=this.isEnabled(),this.onModelChanged()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),n=this._configurationService.getValue(t);if(n&&"object"==typeof n){const e=n.colorDecorators;if(e&&void 0!==e.enable&&!e.enable)return e.enable}return this._editor.getOption(17)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}onModelChanged(){if(this.stop(),!this._isEnabled)return;const e=this._editor.getModel();e&&this._languageFeaturesService.colorProvider.has(e)&&(this._localToDispose.add(this._editor.onDidChangeModelContent((()=>{this._timeoutTimer||(this._timeoutTimer=new TimeoutTimer,this._timeoutTimer.cancelAndSet((()=>{this._timeoutTimer=null,this.beginCompute()}),this._debounceInformation.get(e)))}))),this.beginCompute())}beginCompute(){this._computePromise=createCancelablePromise((e=>__awaiter$S(this,void 0,void 0,(function*(){const t=this._editor.getModel();if(!t)return Promise.resolve([]);const n=new StopWatch(!1),i=yield getColors(this._languageFeaturesService.colorProvider,t,e);return this._debounceInformation.update(t,n.elapsed()),i})))),this._computePromise.then((e=>{this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}),onUnexpectedError)}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map((e=>({range:{startLineNumber:e.colorInfo.range.startLineNumber,startColumn:e.colorInfo.range.startColumn,endLineNumber:e.colorInfo.range.endLineNumber,endColumn:e.colorInfo.range.endColumn},options:ModelDecorationOptions.EMPTY})));this._decorationsIds=this._editor.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach(((t,n)=>this._colorDatas.set(t,e[n])))}updateColorDecorators(e){this._colorDecorationClassRefs.clear();let t=[];for(let n=0;n<e.length&&t.length<MAX_DECORATORS;n++){const{red:i,green:o,blue:r,alpha:s}=e[n].colorInfo.color,a=new RGBA(Math.round(255*i),Math.round(255*o),Math.round(255*r),s);let l=`rgba(${a.r}, ${a.g}, ${a.b}, ${a.a})`;const c=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:l}));t.push({range:{startLineNumber:e[n].colorInfo.range.startLineNumber,startColumn:e[n].colorInfo.range.startColumn,endLineNumber:e[n].colorInfo.range.endLineNumber,endColumn:e[n].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:noBreakWhitespace,inlineClassName:`${c.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:ColorDecorationInjectedTextMarker}}})}this._colorDecoratorIds=new Set(this._editor.deltaDecorations([...this._colorDecoratorIds],t))}removeAllDecorations(){this._decorationsIds=this._editor.deltaDecorations(this._decorationsIds,[]),this._colorDecoratorIds=new Set(this._editor.deltaDecorations([...this._colorDecoratorIds],[])),this._colorDecorationClassRefs.clear()}getColorData(e){const t=this._editor.getModel();if(!t)return null;const n=t.getDecorationsInRange(Range$2.fromPositions(e,e)).filter((e=>this._colorDatas.has(e.id)));return 0===n.length?null:this._colorDatas.get(n[0].id)}isColorDecorationId(e){return this._colorDecoratorIds.has(e)}};ColorDetector.ID="editor.contrib.colorDetector",ColorDetector.RECOMPUTE_TIME=1e3,ColorDetector=__decorate$1i([__param$1e(1,IConfigurationService),__param$1e(2,ILanguageFeaturesService),__param$1e(3,ILanguageFeatureDebounceService)],ColorDetector),registerEditorContribution(ColorDetector.ID,ColorDetector);class ColorPickerModel{constructor(e,t,n){this.presentationIndex=n,this._onColorFlushed=new Emitter$1,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new Emitter$1,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new Emitter$1,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){for(let n=0;n<this.colorPresentations.length;n++)if(t.toLowerCase()===this.colorPresentations[n].label){this.presentationIndex=n,this._onDidChangePresentation.fire(this.presentation);break}}flushColor(){this._onColorFlushed.fire(this._color)}}var colorPicker="";const $$b=$$c;class ColorPickerHeader extends Disposable{constructor(e,t,n){super(),this.model=t,this.domNode=$$b(".colorpicker-header"),append$1(e,this.domNode),this.pickedColorNode=append$1(this.domNode,$$b(".picked-color"));const i=localize("clickToToggleColorOptions","Click to toggle color options (rgb/hsl/hex)");this.pickedColorNode.setAttribute("title",i);const o=append$1(this.domNode,$$b(".original-color"));o.style.backgroundColor=Color.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=n.getColorTheme().getColor(editorHoverBackground)||Color.white,this._register(registerThemingParticipant(((e,t)=>{this.backgroundColor=e.getColor(editorHoverBackground)||Color.white}))),this._register(addDisposableListener(this.pickedColorNode,EventType$1.CLICK,(()=>this.model.selectNextColorPresentation()))),this._register(addDisposableListener(o,EventType$1.CLICK,(()=>{this.model.color=this.model.originalColor,this.model.flushColor()}))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this.pickedColorNode.style.backgroundColor=Color.Format.CSS.format(t.color)||"",this.pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){this.pickedColorNode.style.backgroundColor=Color.Format.CSS.format(e)||"",this.pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this.pickedColorNode.textContent=this.model.presentation?this.model.presentation.label:"",this.pickedColorNode.prepend($$b(".codicon.codicon-color-mode"))}}class ColorPickerBody extends Disposable{constructor(e,t,n){super(),this.model=t,this.pixelRatio=n,this.domNode=$$b(".colorpicker-body"),append$1(e,this.domNode),this.saturationBox=new SaturationBox(this.domNode,this.model,this.pixelRatio),this._register(this.saturationBox),this._register(this.saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this.saturationBox.onColorFlushed(this.flushColor,this)),this.opacityStrip=new OpacityStrip(this.domNode,this.model),this._register(this.opacityStrip),this._register(this.opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this.opacityStrip.onColorFlushed(this.flushColor,this)),this.hueStrip=new HueStrip(this.domNode,this.model),this._register(this.hueStrip),this._register(this.hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this.hueStrip.onColorFlushed(this.flushColor,this))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const n=this.model.color.hsva;this.model.color=new Color(new HSVA(n.h,e,t,n.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new Color(new HSVA(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,n=360*(1-e);this.model.color=new Color(new HSVA(360===n?0:n,t.s,t.v,t.a))}layout(){this.saturationBox.layout(),this.opacityStrip.layout(),this.hueStrip.layout()}}class SaturationBox extends Disposable{constructor(e,t,n){super(),this.model=t,this.pixelRatio=n,this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new Emitter$1,this.onColorFlushed=this._onColorFlushed.event,this.domNode=$$b(".saturation-wrap"),append$1(e,this.domNode),this.canvas=document.createElement("canvas"),this.canvas.className="saturation-box",append$1(this.domNode,this.canvas),this.selection=$$b(".saturation-selection"),append$1(this.domNode,this.selection),this.layout(),this._register(addDisposableGenericMouseDownListener(this.domNode,(e=>this.onMouseDown(e)))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}onMouseDown(e){this.monitor=this._register(new GlobalMouseMoveMonitor);const t=getDomNodePagePosition(this.domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.buttons,standardMouseMoveMerger,(e=>this.onDidChangePosition(e.posx-t.left,e.posy-t.top)),(()=>null));const n=addDisposableGenericMouseUpListener(document,(()=>{this._onColorFlushed.fire(),n.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)}),!0)}onDidChangePosition(e,t){const n=Math.max(0,Math.min(1,e/this.width)),i=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(n,i),this._onDidChange.fire({s:n,v:i})}layout(){this.width=this.domNode.offsetWidth,this.height=this.domNode.offsetHeight,this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new Color(new HSVA(e.h,1,1,1)),n=this.canvas.getContext("2d"),i=n.createLinearGradient(0,0,this.canvas.width,0);i.addColorStop(0,"rgba(255, 255, 255, 1)"),i.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),i.addColorStop(1,"rgba(255, 255, 255, 0)");const o=n.createLinearGradient(0,0,0,this.canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),n.rect(0,0,this.canvas.width,this.canvas.height),n.fillStyle=Color.Format.CSS.format(t),n.fill(),n.fillStyle=i,n.fill(),n.fillStyle=o,n.fill()}paintSelection(e,t){this.selection.style.left=e*this.width+"px",this.selection.style.top=this.height-t*this.height+"px"}onDidChangeColor(){this.monitor&&this.monitor.isMonitoring()||this.paint()}}class Strip extends Disposable{constructor(e,t){super(),this.model=t,this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new Emitter$1,this.onColorFlushed=this._onColorFlushed.event,this.domNode=append$1(e,$$b(".strip")),this.overlay=append$1(this.domNode,$$b(".overlay")),this.slider=append$1(this.domNode,$$b(".slider")),this.slider.style.top="0px",this._register(addDisposableGenericMouseDownListener(this.domNode,(e=>this.onMouseDown(e)))),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onMouseDown(e){const t=this._register(new GlobalMouseMoveMonitor),n=getDomNodePagePosition(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.buttons,standardMouseMoveMerger,(e=>this.onDidChangeTop(e.posy-n.top)),(()=>null));const i=addDisposableGenericMouseUpListener(document,(()=>{this._onColorFlushed.fire(),i.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")}),!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=(1-e)*this.height+"px"}}class OpacityStrip extends Strip{constructor(e,t){super(e,t),this.domNode.classList.add("opacity-strip"),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){const{r:t,g:n,b:i}=e.rgba,o=new Color(new RGBA(t,n,i,1)),r=new Color(new RGBA(t,n,i,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class HueStrip extends Strip{constructor(e,t){super(e,t),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class ColorPickerWidget extends Widget{constructor(e,t,n,i){super(),this.model=t,this.pixelRatio=n,this._register(PixelRatio.onDidChange((()=>this.layout())));const o=$$b(".colorpicker-widget");e.appendChild(o);const r=new ColorPickerHeader(o,this.model,i);this.body=new ColorPickerBody(o,this.model,this.pixelRatio),this._register(r),this._register(this.body)}layout(){this.body.layout()}}var __decorate$1h=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1d=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$R=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class ColorHover{constructor(e,t,n,i){this.owner=e,this.range=t,this.model=n,this.provider=i,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let ColorHoverParticipant=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=1}computeSync(e,t){return[]}computeAsync(e,t,n){return AsyncIterableObject.fromPromise(this._computeAsync(e,t,n))}_computeAsync(e,t,n){return __awaiter$R(this,void 0,void 0,(function*(){if(!this._editor.hasModel())return[];const e=ColorDetector.get(this._editor);if(!e)return[];for(const n of t){if(!e.isColorDecorationId(n.id))continue;const t=e.getColorData(n.range.getStartPosition());if(t){return[yield this._createColorHover(this._editor.getModel(),t.colorInfo,t.provider)]}}return[]}))}_createColorHover(e,t,n){return __awaiter$R(this,void 0,void 0,(function*(){const i=e.getValueInRange(t.range),{red:o,green:r,blue:s,alpha:a}=t.color,l=new RGBA(Math.round(255*o),Math.round(255*r),Math.round(255*s),a),c=new Color(l),d=yield getColorPresentations(e,t,n,CancellationToken.None),u=new ColorPickerModel(c,[],0);return u.colorPresentations=d||[],u.guessColorPresentation(c,i),new ColorHover(this,Range$2.lift(t.range),u,n)}))}renderHoverParts(e,t){if(0===t.length||!this._editor.hasModel())return Disposable.None;const n=new DisposableStore,i=t[0],o=this._editor.getModel(),r=i.model,s=n.add(new ColorPickerWidget(e.fragment,r,this._editor.getOption(129),this._themeService));e.setColorPicker(s);let a=new Range$2(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn);const l=()=>{let t,n;if(r.presentation.textEdit){t=[r.presentation.textEdit],n=new Range$2(r.presentation.textEdit.range.startLineNumber,r.presentation.textEdit.range.startColumn,r.presentation.textEdit.range.endLineNumber,r.presentation.textEdit.range.endColumn);const e=this._editor.getModel()._setTrackedRange(null,n,3);this._editor.pushUndoStop(),this._editor.executeEdits("colorpicker",t),n=this._editor.getModel()._getTrackedRange(e)||n}else t=[{range:a,text:r.presentation.label,forceMoveMarkers:!1}],n=a.setEndPosition(a.endLineNumber,a.startColumn+r.presentation.label.length),this._editor.pushUndoStop(),this._editor.executeEdits("colorpicker",t);r.presentation.additionalTextEdits&&(t=[...r.presentation.additionalTextEdits],this._editor.executeEdits("colorpicker",t),e.hide()),this._editor.pushUndoStop(),a=n},c=e=>getColorPresentations(o,{range:a,color:{red:e.rgba.r/255,green:e.rgba.g/255,blue:e.rgba.b/255,alpha:e.rgba.a}},i.provider,CancellationToken.None).then((e=>{r.colorPresentations=e||[]}));return n.add(r.onColorFlushed((e=>{c(e).then(l)}))),n.add(r.onDidChangeColor(c)),n}};ColorHoverParticipant=__decorate$1h([__param$1d(1,IThemeService)],ColorHoverParticipant);var goToDefinitionAtPosition="";function hasModifier(e,t){return!!e[t]}class ClickLinkMouseEvent{constructor(e,t){this.target=e.target,this.hasTriggerModifier=hasModifier(e.event,t.triggerModifier),this.hasSideBySideModifier=hasModifier(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class ClickLinkKeyboardEvent{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=hasModifier(e,t.triggerModifier)}}class ClickLinkOptions{constructor(e,t,n,i){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=n,this.triggerSideBySideModifier=i}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function createOptions(e){return"altKey"===e?isMacintosh?new ClickLinkOptions(57,"metaKey",6,"altKey"):new ClickLinkOptions(5,"ctrlKey",6,"altKey"):isMacintosh?new ClickLinkOptions(6,"altKey",57,"metaKey"):new ClickLinkOptions(6,"altKey",5,"ctrlKey")}class ClickLinkGesture extends Disposable{constructor(e){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new Emitter$1),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new Emitter$1),this.onExecute=this._onExecute.event,this._onCancel=this._register(new Emitter$1),this.onCancel=this._onCancel.event,this._editor=e,this._opts=createOptions(this._editor.getOption(70)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration((e=>{if(e.hasChanged(70)){const e=createOptions(this._editor.getOption(70));if(this._opts.equals(e))return;this._opts=e,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}}))),this._register(this._editor.onMouseMove((e=>this._onEditorMouseMove(new ClickLinkMouseEvent(e,this._opts))))),this._register(this._editor.onMouseDown((e=>this._onEditorMouseDown(new ClickLinkMouseEvent(e,this._opts))))),this._register(this._editor.onMouseUp((e=>this._onEditorMouseUp(new ClickLinkMouseEvent(e,this._opts))))),this._register(this._editor.onKeyDown((e=>this._onEditorKeyDown(new ClickLinkKeyboardEvent(e,this._opts))))),this._register(this._editor.onKeyUp((e=>this._onEditorKeyUp(new ClickLinkKeyboardEvent(e,this._opts))))),this._register(this._editor.onMouseDrag((()=>this._resetHandler()))),this._register(this._editor.onDidChangeCursorSelection((e=>this._onDidChangeCursorSelection(e)))),this._register(this._editor.onDidChangeModel((e=>this._resetHandler()))),this._register(this._editor.onDidChangeModelContent((()=>this._resetHandler()))),this._register(this._editor.onDidScrollChange((e=>{(e.scrollTopChanged||e.scrollLeftChanged)&&this._resetHandler()})))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=e.target.position?e.target.position.lineNumber:0}_onEditorMouseUp(e){const t=e.target.position?e.target.position.lineNumber:0;this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var peekViewWidget="",__decorate$1g=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1c=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let EmbeddedCodeEditorWidget=class extends CodeEditorWidget{constructor(e,t,n,i,o,r,s,a,l,c,d,u){super(e,Object.assign(Object.assign({},n.getRawOptions()),{overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()}),{},i,o,r,s,a,l,c,d,u),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration((e=>this._onParentConfigurationChanged(e))))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){mixin(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};EmbeddedCodeEditorWidget=__decorate$1g([__param$1c(3,IInstantiationService),__param$1c(4,ICodeEditorService),__param$1c(5,ICommandService),__param$1c(6,IContextKeyService),__param$1c(7,IThemeService),__param$1c(8,INotificationService),__param$1c(9,IAccessibilityService),__param$1c(10,ILanguageConfigurationService),__param$1c(11,ILanguageFeaturesService)],EmbeddedCodeEditorWidget);class IdGenerator{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const defaultGenerator=new IdGenerator("id#");var zoneWidget="";const defaultColor=new Color(new RGBA(0,122,204)),defaultOptions$2={showArrow:!0,showFrame:!0,className:"",frameColor:defaultColor,arrowColor:defaultColor,keepEditorSelection:!1},WIDGET_ID="vs.editor.contrib.zoneWidget";class ViewZoneDelegate{constructor(e,t,n,i,o,r){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=n,this.heightInLines=i,this._onDomNodeTop=o,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class OverlayWidgetDelegate{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class Arrow{constructor(e){this._editor=e,this._ruleName=Arrow._IdGenerator.nextId(),this._decorations=[],this._color=null,this._height=-1}dispose(){this.hide(),removeCSSRulesContainingSelector(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){removeCSSRulesContainingSelector(this._ruleName),createCSSRule(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){1===e.column&&(e={lineNumber:e.lineNumber,column:2}),this._decorations=this._editor.deltaDecorations(this._decorations,[{range:Range$2.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._editor.deltaDecorations(this._decorations,[])}}Arrow._IdGenerator=new IdGenerator(".arrow-decoration-");class ZoneWidget{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._positionMarkerId=[],this._viewZone=null,this._disposables=new DisposableStore,this.container=null,this._isShowing=!1,this.editor=e,this.options=deepClone(t),mixin(this.options,defaultOptions$2,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange((e=>{const t=this._getWidth(e);this.domNode.style.width=t+"px",this.domNode.style.left=this._getLeft(e)+"px",this._onWidth(t)})))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null})),this.editor.deltaDecorations(this._positionMarkerId,[]),this._positionMarkerId=[],this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new Arrow(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){let e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){let e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){if(this.domNode.style.height=`${e}px`,this.container){let t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const n=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(n))}this._resizeSash&&this._resizeSash.layout()}get position(){const[e]=this._positionMarkerId;if(!e)return;const t=this.editor.getModel();if(!t)return;const n=t.getDecorationRange(e);return n?n.getStartPosition():void 0}show(e,t){const n=Range$2.isIRange(e)?Range$2.lift(e):Range$2.fromPositions(e);this._isShowing=!0,this._showImpl(n,t),this._isShowing=!1,this._positionMarkerId=this.editor.deltaDecorations(this._positionMarkerId,[{range:n,options:ModelDecorationOptions.EMPTY}])}hide(){this._viewZone&&(this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id)})),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow&&this._arrow.hide()}_decoratingElementsHeight(){let e=this.editor.getOption(59),t=0;if(this.options.showArrow){t+=2*Math.round(e/3)}if(this.options.showFrame){t+=2*Math.round(e/9)}return t}_showImpl(e,t){const n=e.getStartPosition(),i=this.editor.getLayoutInfo(),o=this._getWidth(i);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(i)+"px";const r=document.createElement("div");r.style.overflow="hidden";const s=this.editor.getOption(59),a=Math.max(12,this.editor.getLayoutInfo().height/s*.8);t=Math.min(t,a);let l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(s/3),this._arrow.height=l,this._arrow.show(n)),this.options.showFrame&&(c=Math.round(s/9)),this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new ViewZoneDelegate(r,n.lineNumber,n.column,t,(e=>this._onViewZoneTop(e)),(e=>this._onViewZoneHeight(e))),this._viewZone.id=e.addZone(this._viewZone),this._overlayWidget=new OverlayWidgetDelegate(WIDGET_ID+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)})),this.container&&this.options.showFrame){const e=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=e+"px",this.container.style.borderBottomWidth=e+"px"}let d=t*s-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=d+"px",this.container.style.overflow="hidden"),this._doLayout(d,o),this.options.keepEditorSelection||this.editor.setSelection(e);const u=this.editor.getModel();if(u){const t=e.endLineNumber+1;t<=u.getLineCount()?this.revealLine(t,!1):this.revealLine(u.getLineCount(),!0)}}revealLine(e,t){t?this.editor.revealLineInCenter(e,0):this.editor.revealLine(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones((t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))}))}_initSash(){if(this._resizeSash)return;let e;this._resizeSash=this._disposables.add(new Sash(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0),this._disposables.add(this._resizeSash.onDidStart((t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})}))),this._disposables.add(this._resizeSash.onDidEnd((()=>{e=void 0}))),this._disposables.add(this._resizeSash.onDidChange((t=>{if(e){let n=(t.currentY-e.startY)/this.editor.getOption(59),i=n<0?Math.ceil(n):Math.floor(n),o=e.heightInLines+i;o>5&&o<35&&this._relayout(o)}})))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(null===this.domNode.style.height?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var dropdown="";class BaseDropdown extends ActionRunner{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new Emitter$1),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=append$1(e,$$c(".monaco-dropdown")),this._label=append$1(this._element,$$c(".dropdown-label"));let n=t.labelRenderer;n||(n=e=>(e.textContent=t.label||"",null));for(const o of[EventType$1.CLICK,EventType$1.MOUSE_DOWN,EventType.Tap])this._register(addDisposableListener(this.element,o,(e=>EventHelper.stop(e,!0))));for(const o of[EventType$1.MOUSE_DOWN,EventType.Tap])this._register(addDisposableListener(this._label,o,(e=>{e instanceof MouseEvent&&e.detail>1||(this.visible?this.hide():this.show())})));this._register(addDisposableListener(this._label,EventType$1.KEY_UP,(e=>{const t=new StandardKeyboardEvent(e);(t.equals(3)||t.equals(10))&&(EventHelper.stop(e,!0),this.visible?this.hide():this.show())})));const i=n(this._label);i&&this._register(i),this._register(Gesture.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class DropdownMenu extends BaseDropdown{constructor(e,t){super(e,t),this._actions=[],this._contextMenuProvider=t.contextMenuProvider,this.actions=t.actions||[],this.actionProvider=t.actionProvider,this.menuClassName=t.menuClassName||"",this.menuAsChild=!!t.menuAsChild}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this.actionProvider?this.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:e=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this.menuClassName,onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this.menuAsChild?this.element:void 0})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class DropdownMenuActionViewItem extends BaseActionViewItem{constructor(e,t,n,i=Object.create(null)){super(null,e,i),this.actionItem=null,this._onDidChangeVisibility=this._register(new Emitter$1),this.menuActionsOrProvider=t,this.contextMenuProvider=n,this.options=i,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=Array.isArray(this.menuActionsOrProvider),n={contextMenuProvider:this.contextMenuProvider,labelRenderer:e=>{this.element=append$1(e,$$c("a.action-label"));let t=[];return"string"==typeof this.options.classNames?t=this.options.classNames.split(/\s+/g).filter((e=>!!e)):this.options.classNames&&(t=this.options.classNames),t.find((e=>"icon"===e))||t.push("codicon"),this.element.classList.add(...t),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",null},menuAsChild:this.options.menuAsChild,actions:t?this.menuActionsOrProvider:void 0,actionProvider:t?void 0:this.menuActionsOrProvider};if(this.dropdownMenu=this._register(new DropdownMenu(e,n)),this._register(this.dropdownMenu.onDidChangeVisibility((e=>{var t;null===(t=this.element)||void 0===t||t.setAttribute("aria-expanded",`${e}`),this._onDidChangeVisibility.fire(e)}))),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const e=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return e.options.anchorAlignmentProvider()}})}this.updateEnabled()}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}updateEnabled(){var e,t;const n=!this.getAction().enabled;null===(e=this.actionItem)||void 0===e||e.classList.toggle("disabled",n),null===(t=this.element)||void 0===t||t.classList.toggle("disabled",n)}}class ModifierLabelProvider{constructor(e,t,n=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=n}toLabel(e,t,n){if(0===t.length)return null;const i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o],s=n(r);if(null===s)return null;i[o]=_simpleAsString(r,s,this.modifierLabels[e])}return i.join(" ")}}const UILabelProvider=new ModifierLabelProvider({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:localize({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:localize({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:localize({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:localize({key:"windowsKey",comment:["This is the short form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:localize({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:localize({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:localize({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:localize({key:"superKey",comment:["This is the short form for the Super key on the keyboard"]},"Super"),separator:"+"}),AriaLabelProvider=new ModifierLabelProvider({ctrlKey:localize({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:localize({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:localize({key:"optKey.long",comment:["This is the long form for the Alt/Option key on the keyboard"]},"Option"),metaKey:localize({key:"cmdKey.long",comment:["This is the long form for the Command key on the keyboard"]},"Command"),separator:"+"},{ctrlKey:localize({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:localize({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:localize({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:localize({key:"windowsKey.long",comment:["This is the long form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:localize({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:localize({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:localize({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:localize({key:"superKey.long",comment:["This is the long form for the Super key on the keyboard"]},"Super"),separator:"+"}),ElectronAcceleratorLabelProvider=new ModifierLabelProvider({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"});function _simpleAsString(e,t,n){if(null===t)return"";const i=[];return e.ctrlKey&&i.push(n.ctrlKey),e.shiftKey&&i.push(n.shiftKey),e.altKey&&i.push(n.altKey),e.metaKey&&i.push(n.metaKey),""!==t&&i.push(t),i.join(n.separator)}new ModifierLabelProvider({ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"cmd",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"win",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"meta",separator:"+"});var menuEntryActionViewItem="",__decorate$1f=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1b=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$Q=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};function createAndFillInActionBarActions(e,t,n,i,o,r,s){const a=e.getActions(t);return fillInActions(a,n,!1,"string"==typeof i?e=>e===i:i,o,r,s),asDisposable(a)}function asDisposable(e){const t=new DisposableStore;for(const[,n]of e)for(const e of n)t.add(e);return t}function fillInActions(e,t,n,i=(e=>"navigation"===e),o=Number.MAX_SAFE_INTEGER,r=(()=>!1),s=!1){let a,l;Array.isArray(t)?(a=t,l=t):(a=t.primary,l=t.secondary);const c=new Set;for(const[d,u]of e){let e;i(d)?(e=a,e.length>0&&s&&e.push(new Separator)):(e=l,e.length>0&&e.push(new Separator));for(let t of u){n&&(t=t instanceof MenuItemAction&&t.alt?t.alt:t);const i=e.push(t);t instanceof SubmenuAction&&c.add({group:d,action:t,index:i-1})}}for(const{group:d,action:u,index:h}of c){const e=i(d)?a:l,t=u.actions;(t.length<=1||e.length+t.length-2<=o)&&r(u,d,e.length)&&e.splice(h,1,...t)}if(a!==l&&a.length>o){const e=a.splice(o,a.length-o);l.unshift(...e,new Separator)}}let MenuEntryActionViewItem=class extends ActionViewItem{constructor(e,t,n,i,o){super(void 0,e,{icon:!(!e.class&&!e.item.icon),label:!e.class&&!e.item.icon,draggable:null==t?void 0:t.draggable}),this._keybindingService=n,this._notificationService=i,this._contextKeyService=o,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new MutableDisposable),this._altKey=ModifierKeyEmitter.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return __awaiter$Q(this,void 0,void 0,(function*(){e.preventDefault(),e.stopPropagation();try{yield this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}}))}render(e){super.render(e),e.classList.add("menu-entry"),this._updateItemClass(this._menuItemAction.item);let t=!1,n=this._altKey.keyStatus.altKey||(isWindows||isLinux)&&this._altKey.keyStatus.shiftKey;const i=()=>{const e=t&&n;e!==this._wantsAltCommand&&(this._wantsAltCommand=e,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._menuItemAction.alt&&this._register(this._altKey.event((e=>{n=e.altKey||(isWindows||isLinux)&&e.shiftKey,i()}))),this._register(addDisposableListener(e,"mouseleave",(e=>{t=!1,i()}))),this._register(addDisposableListener(e,"mouseenter",(e=>{t=!0,i()})))}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}updateTooltip(){if(this.label){const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),n=this._commandAction.tooltip||this._commandAction.label;let i=t?localize("titleAndKb","{0} ({1})",n,t):n;if(!this._wantsAltCommand&&this._menuItemAction.alt){const e=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,t=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),n=t&&t.getLabel(),o=n?localize("titleAndKb","{0} ({1})",e,n):e;i+=`\n[${UILabelProvider.modifierLabels[OS].altKey}] ${o}`}this.label.title=i}}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){var t;this._itemClassDispose.value=void 0;const{element:n,label:i}=this;if(!n||!i)return;const o=this._commandAction.checked&&(null===(t=e.toggled)||void 0===t?void 0:t.icon)?e.toggled.icon:e.icon;if(o)if(ThemeIcon.isThemeIcon(o)){const e=ThemeIcon.asClassNameArray(o);i.classList.add(...e),this._itemClassDispose.value=toDisposable((()=>{i.classList.remove(...e)}))}else o.light&&i.style.setProperty("--menu-entry-icon-light",asCSSUrl(o.light)),o.dark&&i.style.setProperty("--menu-entry-icon-dark",asCSSUrl(o.dark)),i.classList.add("icon"),this._itemClassDispose.value=toDisposable((()=>{i.classList.remove("icon"),i.style.removeProperty("--menu-entry-icon-light"),i.style.removeProperty("--menu-entry-icon-dark")}))}};MenuEntryActionViewItem=__decorate$1f([__param$1b(2,IKeybindingService),__param$1b(3,INotificationService),__param$1b(4,IContextKeyService)],MenuEntryActionViewItem);let SubmenuEntryActionViewItem=class extends DropdownMenuActionViewItem{constructor(e,t,n){var i,o;const r=Object.assign({},null!=t?t:Object.create(null),{menuAsChild:null!==(i=null==t?void 0:t.menuAsChild)&&void 0!==i&&i,classNames:null!==(o=null==t?void 0:t.classNames)&&void 0!==o?o:ThemeIcon.isThemeIcon(e.item.icon)?ThemeIcon.asClassName(e.item.icon):void 0});super(e,{getActions:()=>e.actions},n,r)}render(e){if(super.render(e),this.element){e.classList.add("menu-entry");const{icon:t}=this._action.item;t&&!ThemeIcon.isThemeIcon(t)&&(this.element.classList.add("icon"),t.light&&this.element.style.setProperty("--menu-entry-icon-light",asCSSUrl(t.light)),t.dark&&this.element.style.setProperty("--menu-entry-icon-dark",asCSSUrl(t.dark)))}}};SubmenuEntryActionViewItem=__decorate$1f([__param$1b(2,IContextMenuService)],SubmenuEntryActionViewItem);let DropdownWithDefaultActionViewItem=class extends BaseActionViewItem{constructor(e,t,n,i,o,r,s,a){var l,c,d;let u;super(null,e),this._keybindingService=n,this._notificationService=i,this._contextMenuService=o,this._menuService=r,this._instaService=s,this._storageService=a,this._container=null,this._storageKey=`${e.item.submenu._debugName}_lastActionId`;let h=a.get(this._storageKey,1);h&&(u=e.actions.find((e=>h===e.id))),u||(u=e.actions[0]),this._defaultAction=this._instaService.createInstance(MenuEntryActionViewItem,u,void 0);const g=Object.assign({},null!=t?t:Object.create(null),{menuAsChild:null===(l=null==t?void 0:t.menuAsChild)||void 0===l||l,classNames:null!==(c=null==t?void 0:t.classNames)&&void 0!==c?c:["codicon","codicon-chevron-down"],actionRunner:null!==(d=null==t?void 0:t.actionRunner)&&void 0!==d?d:new ActionRunner});this._dropdown=new DropdownMenuActionViewItem(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun((e=>{e.action instanceof MenuItemAction&&this.update(e.action)}))}update(e){this._storageService.store(this._storageKey,e.id,1,0),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(MenuEntryActionViewItem,e,void 0),this._defaultAction.actionRunner=new class extends ActionRunner{runAction(e,t){return __awaiter$Q(this,void 0,void 0,(function*(){yield e.run(void 0)}))}},this._container&&this._defaultAction.render(prepend$1(this._container,$$c(".action-container")))}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=$$c(".action-container");this._defaultAction.render(append$1(this._container,t)),this._register(addDisposableListener(t,EventType$1.KEY_DOWN,(e=>{const t=new StandardKeyboardEvent(e);t.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),t.stopPropagation())})));const n=$$c(".dropdown-action-container");this._dropdown.render(append$1(this._container,n)),this._register(addDisposableListener(n,EventType$1.KEY_DOWN,(e=>{var t;const n=new StandardKeyboardEvent(e);n.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),null===(t=this._defaultAction.element)||void 0===t||t.focus(),n.stopPropagation())})))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};function createActionViewItem(e,t,n){return t instanceof MenuItemAction?e.createInstance(MenuEntryActionViewItem,t,void 0):t instanceof SubmenuItemAction?t.item.rememberDefaultAction?e.createInstance(DropdownWithDefaultActionViewItem,t,n):e.createInstance(SubmenuEntryActionViewItem,t,n):void 0}DropdownWithDefaultActionViewItem=__decorate$1f([__param$1b(2,IKeybindingService),__param$1b(3,INotificationService),__param$1b(4,IContextMenuService),__param$1b(5,IMenuService),__param$1b(6,IInstantiationService),__param$1b(7,IStorageService)],DropdownWithDefaultActionViewItem);var __decorate$1e=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1a=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const IPeekViewService=createDecorator("IPeekViewService");var PeekContext,PeekContext2;registerSingleton(IPeekViewService,class{constructor(){this._widgets=new Map}addExclusiveWidget(e,t){const n=this._widgets.get(e);n&&(n.listener.dispose(),n.widget.dispose());this._widgets.set(e,{widget:t,listener:t.onDidClose((()=>{const n=this._widgets.get(e);n&&n.widget===t&&(n.listener.dispose(),this._widgets.delete(e))}))})}}),PeekContext2=PeekContext||(PeekContext={}),PeekContext2.inPeekEditor=new RawContextKey("inReferenceSearchEditor",!0,localize("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),PeekContext2.notInPeekEditor=PeekContext2.inPeekEditor.toNegated();let PeekContextController=class{constructor(e,t){e instanceof EmbeddedCodeEditorWidget&&PeekContext.inPeekEditor.bindTo(t)}dispose(){}};function getOuterEditor(e){let t=e.get(ICodeEditorService).getFocusedCodeEditor();return t instanceof EmbeddedCodeEditorWidget?t.getParentEditor():t}PeekContextController.ID="editor.contrib.referenceController",PeekContextController=__decorate$1e([__param$1a(1,IContextKeyService)],PeekContextController),registerEditorContribution(PeekContextController.ID,PeekContextController);const defaultOptions$1={headerBackgroundColor:Color.white,primaryHeadingColor:Color.fromHex("#333333"),secondaryHeadingColor:Color.fromHex("#6c6c6cb3")};let PeekViewWidget=class extends ZoneWidget{constructor(e,t,n){super(e,t),this.instantiationService=n,this._onDidClose=new Emitter$1,this.onDidClose=this._onDidClose.event,mixin(this.options,defaultOptions$1,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){let t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();let e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=$$c(".head"),this._bodyElement=$$c(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){const n=$$c(".peekview-title");this.options.supportOnTitleClick&&(n.classList.add("clickable"),addStandardDisposableListener(n,"click",(e=>this._onTitleClick(e)))),append$1(this._headElement,n),this._fillTitleIcon(n),this._primaryHeading=$$c("span.filename"),this._secondaryHeading=$$c("span.dirname"),this._metaHeading=$$c("span.meta"),append$1(n,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=$$c(".peekview-actions");append$1(this._headElement,i);const o=this._getActionBarOptions();this._actionbarWidget=new ActionBar(i,o),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Action("peekview.close",localize("label.close","Close"),Codicon.close.classNames,!0,(()=>(this.dispose(),Promise.resolve()))),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:createActionViewItem.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:clearNode(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,show(this._metaHeading)):hide(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0)return void this.dispose();const n=Math.ceil(1.2*this.editor.getOption(59)),i=Math.round(e-(n+2));this._doLayoutHead(n,t),this._doLayoutBody(i,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};PeekViewWidget=__decorate$1e([__param$1a(2,IInstantiationService)],PeekViewWidget);const peekViewTitleBackground=registerColor("peekViewTitle.background",{dark:transparent(editorInfoForeground,.1),light:transparent(editorInfoForeground,.1),hc:null},localize("peekViewTitleBackground","Background color of the peek view title area.")),peekViewTitleForeground=registerColor("peekViewTitleLabel.foreground",{dark:Color.white,light:Color.black,hc:Color.white},localize("peekViewTitleForeground","Color of the peek view title.")),peekViewTitleInfoForeground=registerColor("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hc:"#FFFFFF99"},localize("peekViewTitleInfoForeground","Color of the peek view title info.")),peekViewBorder=registerColor("peekView.border",{dark:editorInfoForeground,light:editorInfoForeground,hc:contrastBorder},localize("peekViewBorder","Color of the peek view borders and arrow.")),peekViewResultsBackground=registerColor("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hc:Color.black},localize("peekViewResultsBackground","Background color of the peek view result list."));registerColor("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hc:Color.white},localize("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list.")),registerColor("peekViewResult.fileForeground",{dark:Color.white,light:"#1E1E1E",hc:Color.white},localize("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list.")),registerColor("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hc:null},localize("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list.")),registerColor("peekViewResult.selectionForeground",{dark:Color.white,light:"#6C6C6C",hc:Color.white},localize("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const peekViewEditorBackground=registerColor("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hc:Color.black},localize("peekViewEditorBackground","Background color of the peek view editor."));function isCodeEditor(e){return!(!e||"function"!=typeof e.getEditorType)&&e.getEditorType()===EditorType.ICodeEditor}registerColor("peekViewEditorGutter.background",{dark:peekViewEditorBackground,light:peekViewEditorBackground,hc:peekViewEditorBackground},localize("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor.")),registerColor("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hc:null},localize("peekViewResultsMatchHighlight","Match highlight color in the peek view result list.")),registerColor("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hc:null},localize("peekViewEditorMatchHighlight","Match highlight color in the peek view editor.")),registerColor("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hc:activeContrastBorder},localize("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var list="",Range$1;class CombinedSpliceable{constructor(e){this.spliceables=e}splice(e,t,n){this.spliceables.forEach((i=>i.splice(e,t,n)))}}class ListError extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function groupIntersect(e,t){const n=[];for(let i of t){if(e.start>=i.range.end)continue;if(e.end<i.range.start)break;const t=Range$1.intersect(e,i.range);Range$1.isEmpty(t)||n.push({range:t,size:i.size})}return n}function shift({start:e,end:t},n){return{start:e+n,end:t+n}}function consolidate(e){const t=[];let n=null;for(let i of e){const e=i.range.start,o=i.range.end,r=i.size;n&&r===n.size?n.range.end=o:(n={range:{start:e,end:o},size:r},t.push(n))}return t}function concat(...e){return consolidate(e.reduce(((e,t)=>e.concat(t)),[]))}!function(e){function t(e,t){if(e.start>=t.end||t.start>=e.end)return{start:0,end:0};const n=Math.max(e.start,t.start),i=Math.min(e.end,t.end);return i-n<=0?{start:0,end:0}:{start:n,end:i}}function n(e){return e.end-e.start<=0}e.intersect=t,e.isEmpty=n,e.intersects=function(e,i){return!n(t(e,i))},e.relativeComplement=function(e,t){const i=[],o={start:e.start,end:Math.min(t.start,e.end)},r={start:Math.max(t.end,e.start),end:e.end};return n(o)||i.push(o),n(r)||i.push(r),i}}(Range$1||(Range$1={}));class RangeMap{constructor(){this.groups=[],this._size=0}splice(e,t,n=[]){const i=n.length-t,o=groupIntersect({start:0,end:e},this.groups),r=groupIntersect({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map((e=>({range:shift(e.range,i),size:e.size}))),s=n.map(((t,n)=>({range:{start:e+n,end:e+n+1},size:t.size})));this.groups=concat(o,s,r),this._size=this.groups.reduce(((e,t)=>e+t.size*(t.range.end-t.range.start)),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;let t=0,n=0;for(let i of this.groups){const o=i.range.end-i.range.start,r=n+o*i.size;if(e<r)return t+Math.floor((e-n)/i.size);t+=o,n=r}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let t=0,n=0;for(let i of this.groups){const o=i.range.end-i.range.start,r=n+o;if(e<r)return t+(e-n)*i.size;t+=o*i.size,n=r}return-1}}function removeFromParent(e){try{e.parentElement&&e.parentElement.removeChild(e)}catch(e2){}}class RowCache{constructor(e){this.renderers=e,this.cache=new Map}alloc(e){let t=this.getTemplateCache(e).pop();if(!t){const n=$$c(".monaco-list-row");t={domNode:n,templateId:e,templateData:this.getRenderer(e).renderTemplate(n)}}return t}release(e){e&&this.releaseRow(e)}releaseRow(e){const{domNode:t,templateId:n}=e;t&&(t.classList.remove("scrolling"),removeFromParent(t));this.getTemplateCache(n).push(e)}getTemplateCache(e){let t=this.cache.get(e);return t||(t=[],this.cache.set(e,t)),t}dispose(){this.cache.forEach(((e,t)=>{for(const n of e){this.getRenderer(t).disposeTemplate(n.templateData),n.templateData=null}})),this.cache.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var __decorate$1d=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};const DefaultOptions$1={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements:e=>[e],getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class ElementsDragAndDropData{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class ExternalElementsDragAndDropData{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class NativeDragAndDropData{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;t<e.files.length;t++){const n=e.files.item(t);n&&(n.size||n.type)&&this.files.push(n)}}}getData(){return{types:this.types,files:this.files}}}function equalsDragFeedback(e,t){return Array.isArray(e)&&Array.isArray(t)?equals$1(e,t):e===t}class ListViewAccessibilityProvider{constructor(e){(null==e?void 0:e.getSetSize)?this.getSetSize=e.getSetSize.bind(e):this.getSetSize=(e,t,n)=>n,(null==e?void 0:e.getPosInSet)?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(e,t)=>t+1,(null==e?void 0:e.getRole)?this.getRole=e.getRole.bind(e):this.getRole=e=>"listitem",(null==e?void 0:e.isChecked)?this.isChecked=e.isChecked.bind(e):this.isChecked=e=>{}}}class ListView{constructor(e,t,n,i=DefaultOptions$1){if(this.virtualDelegate=t,this.domId="list_id_"+ ++ListView.InstanceCount,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Delayer(50),this.splicing=!1,this.dragOverAnimationStopDisposable=Disposable.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=Disposable.None,this.onDragLeaveTimeout=Disposable.None,this.disposables=new DisposableStore,this._onDidChangeContentHeight=new Emitter$1,this._horizontalScrolling=!1,i.horizontalScrolling&&i.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new RangeMap;for(const o of n)this.renderers.set(o.templateId,o);this.cache=this.disposables.add(new RowCache(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support","boolean"!=typeof i.mouseSupport||i.mouseSupport),this._horizontalScrolling=getOrDefault(i,(e=>e.horizontalScrolling),DefaultOptions$1.horizontalScrolling),this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.additionalScrollHeight=void 0===i.additionalScrollHeight?0:i.additionalScrollHeight,this.accessibilityProvider=new ListViewAccessibilityProvider(i.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows";getOrDefault(i,(e=>e.transformOptimization),DefaultOptions$1.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)"),this.disposables.add(Gesture.addTarget(this.rowsContainer)),this.scrollable=new Scrollable({forceIntegerValues:!0,smoothScrollDuration:getOrDefault(i,(e=>e.smoothScrolling),!1)?125:0,scheduleAtNextAnimationFrame:e=>scheduleAtNextAnimationFrame(e)}),this.scrollableElement=this.disposables.add(new SmoothScrollableElement(this.rowsContainer,{alwaysConsumeMouseWheel:getOrDefault(i,(e=>e.alwaysConsumeMouseWheel),DefaultOptions$1.alwaysConsumeMouseWheel),horizontal:1,vertical:getOrDefault(i,(e=>e.verticalScrollMode),DefaultOptions$1.verticalScrollMode),useShadows:getOrDefault(i,(e=>e.useShadows),DefaultOptions$1.useShadows),mouseWheelScrollSensitivity:i.mouseWheelScrollSensitivity,fastScrollSensitivity:i.fastScrollSensitivity},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(addDisposableListener(this.rowsContainer,EventType.Change,(e=>this.onTouchChange(e)))),this.disposables.add(addDisposableListener(this.scrollableElement.getDomNode(),"scroll",(e=>e.target.scrollTop=0))),this.disposables.add(addDisposableListener(this.domNode,"dragover",(e=>this.onDragOver(this.toDragEvent(e))))),this.disposables.add(addDisposableListener(this.domNode,"drop",(e=>this.onDrop(this.toDragEvent(e))))),this.disposables.add(addDisposableListener(this.domNode,"dragleave",(e=>this.onDragLeave(this.toDragEvent(e))))),this.disposables.add(addDisposableListener(this.domNode,"dragend",(e=>this.onDragEnd(e)))),this.setRowLineHeight=getOrDefault(i,(e=>e.setRowLineHeight),DefaultOptions$1.setRowLineHeight),this.setRowHeight=getOrDefault(i,(e=>e.setRowHeight),DefaultOptions$1.setRowHeight),this.supportDynamicHeights=getOrDefault(i,(e=>e.supportDynamicHeights),DefaultOptions$1.supportDynamicHeights),this.dnd=getOrDefault(i,(e=>e.dnd),DefaultOptions$1.dnd),this.layout()}get contentHeight(){return this.rangeMap.size}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const e of this.items)this.measureItemWidth(e);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:getContentWidth(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}updateOptions(e){void 0!==e.additionalScrollHeight&&(this.additionalScrollHeight=e.additionalScrollHeight,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),void 0!==e.smoothScrolling&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),void 0!==e.horizontalScrolling&&(this.horizontalScrolling=e.horizontalScrolling),void 0!==e.mouseWheelScrollSensitivity&&this.scrollableElement.updateOptions({mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),void 0!==e.fastScrollSensitivity&&this.scrollableElement.updateOptions({fastScrollSensitivity:e.fastScrollSensitivity})}splice(e,t,n=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,n)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,n=[]){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},r=Range$1.intersect(i,o),s=new Map;for(let b=r.end-1;b>=r.start;b--){const e=this.items[b];if(e.dragStartDisposable.dispose(),e.row){let t=s.get(e.templateId);t||(t=[],s.set(e.templateId,t));const n=this.renderers.get(e.templateId);n&&n.disposeElement&&n.disposeElement(e.element,b,e.row.templateData,e.size),t.push(e.row)}e.row=null}const a={start:e+t,end:this.items.length},l=Range$1.intersect(a,i),c=Range$1.relativeComplement(a,i),d=n.map((e=>({id:String(this.itemId++),element:e,templateId:this.virtualDelegate.getTemplateId(e),size:this.virtualDelegate.getHeight(e),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(e),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:Disposable.None,checkedDisposable:Disposable.None})));let u;0===e&&t>=this.items.length?(this.rangeMap=new RangeMap,this.rangeMap.splice(0,0,d),u=this.items,this.items=d):(this.rangeMap.splice(e,t,d),u=this.items.splice(e,t,...d));const h=n.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=shift(l,h),f=Range$1.intersect(g,p);for(let b=f.start;b<f.end;b++)this.updateItemInDOM(this.items[b],b);const m=Range$1.relativeComplement(p,g);for(const b of m)for(let e=b.start;e<b.end;e++)this.removeItemFromDOM(e);const v=c.map((e=>shift(e,h))),_=[{start:e,end:e+n.length},...v].map((e=>Range$1.intersect(g,e))),C=this.getNextToLastElement(_);for(const b of _)for(let e=b.start;e<b.end;e++){const t=this.items[e],n=s.get(t.templateId),i=null==n?void 0:n.pop();this.insertItemInDOM(e,C,i)}for(const b of s.values())for(const e of b)this.cache.release(e);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),u.map((e=>e.element))}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=scheduleAtNextAnimationFrame((()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null})))}eventuallyUpdateScrollWidth(){this.horizontalScrolling?this.scrollableElementWidthDelayer.trigger((()=>this.updateScrollWidth())):this.scrollableElementWidthDelayer.cancel()}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)void 0!==t.width&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:0===e?0:e+10})}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}element(e){return this.items[e].element}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){let n={height:"number"==typeof e?e:getContentHeight(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,n.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(n),void 0!==t&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:"number"==typeof t?t:getContentWidth(this.domNode)})}render(e,t,n,i,o,r=!1){const s=this.getRenderRange(t,n),a=Range$1.relativeComplement(s,e),l=Range$1.relativeComplement(e,s),c=this.getNextToLastElement(a);if(r){const t=Range$1.intersect(e,s);for(let e=t.start;e<t.end;e++)this.updateItemInDOM(this.items[e],e)}for(const d of a)for(let e=d.start;e<d.end;e++)this.insertItemInDOM(e,c);for(const d of l)for(let e=d.start;e<d.end;e++)this.removeItemFromDOM(e);void 0!==i&&(this.rowsContainer.style.left=`-${i}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&void 0!==o&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=n}insertItemInDOM(e,t,n){const i=this.items[e];i.row||(i.row=null!=n?n:this.cache.alloc(i.templateId));const o=this.accessibilityProvider.getRole(i.element)||"listitem";i.row.domNode.setAttribute("role",o);const r=this.accessibilityProvider.isChecked(i.element);if("boolean"==typeof r)i.row.domNode.setAttribute("aria-checked",String(!!r));else if(r){const e=e=>i.row.domNode.setAttribute("aria-checked",String(!!e));e(r.value),i.checkedDisposable=r.onDidChange(e)}i.row.domNode.parentElement||(t?this.rowsContainer.insertBefore(i.row.domNode,t):this.rowsContainer.appendChild(i.row.domNode)),this.updateItemInDOM(i,e);const s=this.renderers.get(i.templateId);if(!s)throw new Error(`No renderer found for template id ${i.templateId}`);s&&s.renderElement(i.element,e,i.row.templateData,i.size);const a=this.dnd.getDragURI(i.element);i.dragStartDisposable.dispose(),i.row.domNode.draggable=!!a,a&&(i.dragStartDisposable=addDisposableListener(i.row.domNode,"dragstart",(e=>this.onDragStart(i.element,a,e)))),this.horizontalScrolling&&(this.measureItemWidth(i),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width=isFirefox?"-moz-fit-content":"fit-content",e.width=getContentWidth(e.row.domNode);const t=window.getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2==0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const n=this.renderers.get(t.templateId);n&&n.disposeElement&&n.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.additionalScrollHeight}get onMouseClick(){return Event$1.map(this.disposables.add(new DomEmitter(this.domNode,"click")).event,(e=>this.toMouseEvent(e)))}get onMouseDblClick(){return Event$1.map(this.disposables.add(new DomEmitter(this.domNode,"dblclick")).event,(e=>this.toMouseEvent(e)))}get onMouseMiddleClick(){return Event$1.filter(Event$1.map(this.disposables.add(new DomEmitter(this.domNode,"auxclick")).event,(e=>this.toMouseEvent(e))),(e=>1===e.browserEvent.button))}get onMouseDown(){return Event$1.map(this.disposables.add(new DomEmitter(this.domNode,"mousedown")).event,(e=>this.toMouseEvent(e)))}get onContextMenu(){return Event$1.any(Event$1.map(this.disposables.add(new DomEmitter(this.domNode,"contextmenu")).event,(e=>this.toMouseEvent(e))),Event$1.map(this.disposables.add(new DomEmitter(this.domNode,EventType.Contextmenu)).event,(e=>this.toGestureEvent(e))))}get onTouchStart(){return Event$1.map(this.disposables.add(new DomEmitter(this.domNode,"touchstart")).event,(e=>this.toTouchEvent(e)))}get onTap(){return Event$1.map(this.disposables.add(new DomEmitter(this.rowsContainer,EventType.Tap)).event,(e=>this.toGestureEvent(e)))}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:n&&n.element}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:n&&n.element}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),n=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:n&&n.element}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:n&&n.element}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,n){if(!n.dataTransfer)return;const i=this.dnd.getDragElements(e);if(n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setData(DataTransfers.TEXT,t),n.dataTransfer.setDragImage){let e;this.dnd.getDragLabel&&(e=this.dnd.getDragLabel(i,n)),void 0===e&&(e=String(i.length));const t=$$c(".monaco-drag-image");t.textContent=e,document.body.appendChild(t),n.dataTransfer.setDragImage(t,-10,-10),setTimeout((()=>document.body.removeChild(t)),0)}this.currentDragData=new ElementsDragAndDropData(i),StaticDND.CurrentDragAndDropData=new ExternalElementsDragAndDropData(i),this.dnd.onDragStart&&this.dnd.onDragStart(this.currentDragData,n)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),StaticDND.CurrentDragAndDropData&&"vscode-ui"===StaticDND.CurrentDragAndDropData.getData())return!1;if(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer)return!1;if(!this.currentDragData)if(StaticDND.CurrentDragAndDropData)this.currentDragData=StaticDND.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new NativeDragAndDropData}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop="boolean"==typeof t?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;let n;if(e.browserEvent.dataTransfer.dropEffect="boolean"!=typeof t&&0===t.effect?"copy":"move",n="boolean"!=typeof t&&t.feedback?t.feedback:void 0===e.index?[-1]:[e.index],n=distinct(n).filter((e=>e>=-1&&e<this.length)).sort(((e,t)=>e-t)),n=-1===n[0]?[-1]:n,equalsDragFeedback(this.currentDragFeedback,n))return!0;if(this.currentDragFeedback=n,this.currentDragFeedbackDisposable.dispose(),-1===n[0])this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=toDisposable((()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")}));else{for(const e of n){const t=this.items[e];t.dropTarget=!0,t.row&&t.row.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=toDisposable((()=>{for(const e of n){const t=this.items[e];t.dropTarget=!1,t.row&&t.row.domNode.classList.remove("drop-target")}}))}return!0}onDragLeave(e){var t,n;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=disposableTimeout((()=>this.clearDragOverFeedback()),100),this.currentDragData&&(null===(n=(t=this.dnd).onDragLeave)||void 0===n||n.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0,StaticDND.CurrentDragAndDropData=void 0,t&&e.browserEvent.dataTransfer&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0,StaticDND.CurrentDragAndDropData=void 0,this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=Disposable.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const e=getTopLeftOffset(this.domNode).top;this.dragOverAnimationDisposable=animate(this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=disposableTimeout((()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}),1e3),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(void 0===this.dragOverMouseY)return;const t=this.dragOverMouseY-e,n=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>n&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-n))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let n=e;for(;n instanceof HTMLElement&&n!==this.rowsContainer&&t.contains(n);){const e=n.getAttribute("data-index");if(e){const t=Number(e);if(!isNaN(t))return t}n=n.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,n){const i=this.getRenderRange(e,t);let o,r;e===this.elementTop(i.start)?(o=i.start,r=0):i.end-i.start>1&&(o=i.start+1,r=this.elementTop(o)-e);let s=0;for(;;){const a=this.getRenderRange(e,t);let l=!1;for(let e=a.start;e<a.end;e++){const t=this.probeDynamicHeight(e);0!==t&&this.rangeMap.splice(e,1,[this.items[e]]),s+=t,l=l||0!==t}if(!l){0!==s&&this.eventuallyUpdateScrollDimensions();const t=Range$1.relativeComplement(i,a);for(const e of t)for(let t=e.start;t<e.end;t++)this.items[t].row&&this.removeItemFromDOM(t);const l=Range$1.relativeComplement(a,i);for(const e of l)for(let t=e.start;t<e.end;t++){const e=t+1,n=e<this.items.length?this.items[e].row:null,i=n?n.domNode:null;this.insertItemInDOM(t,i)}for(let e=a.start;e<a.end;e++)this.items[e].row&&this.updateItemInDOM(this.items[e],e);if("number"==typeof o){const t=this.scrollable.getFutureScrollPosition().scrollTop-e,i=this.elementTop(o)-r+t;this.setScrollTop(i,n)}return void this._onDidChangeContentHeight.fire(this.contentHeight)}}}probeDynamicHeight(e){const t=this.items[e];if(this.virtualDelegate.getDynamicHeight){const e=this.virtualDelegate.getDynamicHeight(t.element);if(null!==e){const n=t.size;return t.size=e,t.lastDynamicHeightWidth=this.renderWidth,e-n}}if(!t.hasDynamicHeight||t.lastDynamicHeightWidth===this.renderWidth)return 0;if(this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(t.element))return 0;const n=t.size;if(!this.setRowHeight&&t.row){let e=t.row.domNode.offsetHeight;return t.size=e,t.lastDynamicHeightWidth=this.renderWidth,e-n}const i=this.cache.alloc(t.templateId);i.domNode.style.height="",this.rowsContainer.appendChild(i.domNode);const o=this.renderers.get(t.templateId);return o&&(o.renderElement(t.element,e,i.templateData,void 0),o.disposeElement&&o.disposeElement(t.element,e,i.templateData,void 0)),t.size=i.domNode.offsetHeight,this.virtualDelegate.setDynamicHeight&&this.virtualDelegate.setDynamicHeight(t.element,t.size),t.lastDynamicHeightWidth=this.renderWidth,this.rowsContainer.removeChild(i.domNode),this.cache.release(i),t.size-n}getNextToLastElement(e){const t=e[e.length-1];if(!t)return null;const n=this.items[t.end];return n&&n.row?n.row.domNode:null}getElementDomId(e){return`${this.domId}_${e}`}dispose(){if(this.items){for(const e of this.items)if(e.row){const t=this.renderers.get(e.row.templateId);t&&(t.disposeElement&&t.disposeElement(e.element,-1,e.row.templateData,void 0),t.disposeTemplate(e.row.templateData))}this.items=[]}this.domNode&&this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),dispose(this.disposables)}}ListView.InstanceCount=0,__decorate$1d([memoize],ListView.prototype,"onMouseClick",null),__decorate$1d([memoize],ListView.prototype,"onMouseDblClick",null),__decorate$1d([memoize],ListView.prototype,"onMouseMiddleClick",null),__decorate$1d([memoize],ListView.prototype,"onMouseDown",null),__decorate$1d([memoize],ListView.prototype,"onContextMenu",null),__decorate$1d([memoize],ListView.prototype,"onTouchStart",null),__decorate$1d([memoize],ListView.prototype,"onTap",null);var __decorate$1c=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__awaiter$P=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},TypeLabelControllerState,TypeLabelControllerState2;class TraitRenderer{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,n){const i=this.renderedElements.findIndex((e=>e.templateData===n));if(i>=0){const e=this.renderedElements[i];this.trait.unrender(n),e.index=t}else{const e={index:t,templateData:n};this.renderedElements.push(e)}this.trait.renderIndex(t,n)}splice(e,t,n){const i=[];for(const o of this.renderedElements)o.index<e?i.push(o):o.index>=e+t&&i.push({index:o.index+n-t,templateData:o.templateData});this.renderedElements=i}renderIndexes(e){for(const{index:t,templateData:n}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,n)}disposeTemplate(e){const t=this.renderedElements.findIndex((t=>t.templateData===e));t<0||this.renderedElements.splice(t,1)}}class Trait$1{constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new Emitter$1,this.onChange=this._onChange.event}get name(){return this._trait}get renderer(){return new TraitRenderer(this)}splice(e,t,n){var i;t=Math.max(0,Math.min(t,this.length-e));const o=n.length-t,r=e+t,s=[...this.sortedIndexes.filter((t=>t<e)),...n.map(((t,n)=>t?n+e:-1)).filter((e=>-1!==e)),...this.sortedIndexes.filter((e=>e>=r)).map((e=>e+o))],a=this.length+o;if(this.sortedIndexes.length>0&&0===s.length&&a>0){const t=null!==(i=this.sortedIndexes.find((t=>t>=e)))&&void 0!==i?i:a-1;s.push(Math.min(t,a-1))}this.renderer.splice(e,t,n.length),this._set(s,s),this.length=a}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(numericSort),t)}_set(e,t,n){const i=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=disjunction(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:n}),i}get(){return this.indexes}contains(e){return binarySearch(this.sortedIndexes,e,numericSort)>=0}dispose(){dispose(this._onChange)}}__decorate$1c([memoize],Trait$1.prototype,"renderer",null);class SelectionTrait extends Trait$1{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class TraitSpliceable{constructor(e,t,n){this.trait=e,this.view=t,this.identityProvider=n}splice(e,t,n){if(!this.identityProvider)return this.trait.splice(e,t,n.map((()=>!1)));const i=this.trait.get().map((e=>this.identityProvider.getId(this.view.element(e)).toString())),o=n.map((e=>i.indexOf(this.identityProvider.getId(e).toString())>-1));this.trait.splice(e,t,o)}}function isInputElement(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function isMonacoEditor(e){return!!e.classList.contains("monaco-editor")||!e.classList.contains("monaco-list")&&(!!e.parentElement&&isMonacoEditor(e.parentElement))}class KeyboardController{constructor(e,t,n){this.list=e,this.view=t,this.disposables=new DisposableStore,this.multipleSelectionDisposables=new DisposableStore,this.onKeyDown.filter((e=>3===e.keyCode)).on(this.onEnter,this,this.disposables),this.onKeyDown.filter((e=>16===e.keyCode)).on(this.onUpArrow,this,this.disposables),this.onKeyDown.filter((e=>18===e.keyCode)).on(this.onDownArrow,this,this.disposables),this.onKeyDown.filter((e=>11===e.keyCode)).on(this.onPageUpArrow,this,this.disposables),this.onKeyDown.filter((e=>12===e.keyCode)).on(this.onPageDownArrow,this,this.disposables),this.onKeyDown.filter((e=>9===e.keyCode)).on(this.onEscape,this,this.disposables),!1!==n.multipleSelectionSupport&&this.onKeyDown.filter((e=>(isMacintosh?e.metaKey:e.ctrlKey)&&31===e.keyCode)).on(this.onCtrlA,this,this.multipleSelectionDisposables)}get onKeyDown(){return Event$1.chain(this.disposables.add(new DomEmitter(this.view.domNode,"keydown")).event).filter((e=>!isInputElement(e.target))).map((e=>new StandardKeyboardEvent(e)))}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionDisposables.clear(),e.multipleSelectionSupport&&this.onKeyDown.filter((e=>(isMacintosh?e.metaKey:e.ctrlKey)&&31===e.keyCode)).on(this.onCtrlA,this,this.multipleSelectionDisposables))}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(range(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}__decorate$1c([memoize],KeyboardController.prototype,"onKeyDown",null),TypeLabelControllerState2=TypeLabelControllerState||(TypeLabelControllerState={}),TypeLabelControllerState2[TypeLabelControllerState2.Idle=0]="Idle",TypeLabelControllerState2[TypeLabelControllerState2.Typing=1]="Typing";const DefaultKeyboardNavigationDelegate=new class{mightProducePrintableCharacter(e){return!(e.ctrlKey||e.metaKey||e.altKey)&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30||e.keyCode>=93&&e.keyCode<=102||e.keyCode>=80&&e.keyCode<=90)}};class TypeLabelController{constructor(e,t,n,i){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=n,this.delegate=i,this.enabled=!1,this.state=TypeLabelControllerState.Idle,this.automaticKeyboardNavigation=!0,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new DisposableStore,this.disposables=new DisposableStore,this.updateOptions(e.options)}updateOptions(e){void 0===e.enableKeyboardNavigation||!!e.enableKeyboardNavigation?this.enable():this.disable(),void 0!==e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation)}enable(){if(this.enabled)return;const e=Event$1.chain(this.enabledDisposables.add(new DomEmitter(this.view.domNode,"keydown")).event).filter((e=>!isInputElement(e.target))).filter((()=>this.automaticKeyboardNavigation||this.triggered)).map((e=>new StandardKeyboardEvent(e))).filter((e=>this.delegate.mightProducePrintableCharacter(e))).forEach((e=>e.preventDefault())).map((e=>e.browserEvent.key)).event,t=Event$1.debounce(e,(()=>null),800);Event$1.reduce(Event$1.any(e,t),((e,t)=>null===t?null:(e||"")+t))(this.onInput,this,this.enabledDisposables),t(this.onClear,this,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const n=null===(e=this.list.options.accessibilityProvider)||void 0===e?void 0:e.getAriaLabel(this.list.element(t[0]));n&&alert(n)}this.previouslyFocused=-1}onInput(e){if(!e)return this.state=TypeLabelControllerState.Idle,void(this.triggered=!1);const t=this.list.getFocus(),n=t.length>0?t[0]:0,i=this.state===TypeLabelControllerState.Idle?1:0;this.state=TypeLabelControllerState.Typing;for(let o=0;o<this.list.length;o++){const t=(n+o+i)%this.list.length,r=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(t)),s=r&&r.toString();if(void 0===s||matchesPrefix(e,s))return this.previouslyFocused=n,this.list.setFocus([t]),void this.list.reveal(t)}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class DOMFocusController{constructor(e,t){this.list=e,this.view=t,this.disposables=new DisposableStore;Event$1.chain(this.disposables.add(new DomEmitter(t.domNode,"keydown")).event).filter((e=>!isInputElement(e.target))).map((e=>new StandardKeyboardEvent(e))).filter((e=>!(2!==e.keyCode||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey))).on(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(0===t.length)return;const n=this.view.domElement(t[0]);if(!n)return;const i=n.querySelector("[tabIndex]");if(!(i&&i instanceof HTMLElement&&-1!==i.tabIndex))return;const o=window.getComputedStyle(i);"hidden"!==o.visibility&&"none"!==o.display&&(e.preventDefault(),e.stopPropagation(),i.focus())}dispose(){this.disposables.dispose()}}function isSelectionSingleChangeEvent(e){return isMacintosh?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function isSelectionRangeChangeEvent(e){return e.browserEvent.shiftKey}function isMouseRightClick(e){return e instanceof MouseEvent&&2===e.button}const DefaultMultipleSelectionController={isSelectionSingleChangeEvent:isSelectionSingleChangeEvent,isSelectionRangeChangeEvent:isSelectionRangeChangeEvent};class MouseController{constructor(e){this.list=e,this.disposables=new DisposableStore,this._onPointer=new Emitter$1,this.onPointer=this._onPointer.event,!1!==e.options.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||DefaultMultipleSelectionController),this.mouseSupport=void 0===e.options.mouseSupport||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(Gesture.addTarget(e.getHTMLElement()))),Event$1.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||DefaultMultipleSelectionController))}isSelectionSingleChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionSingleChangeEvent(e)}isSelectionRangeChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionRangeChangeEvent(e)}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){isMonacoEditor(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(isMonacoEditor(e.browserEvent.target))return;const t=void 0===e.index?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport)return;if(isInputElement(e.browserEvent.target)||isMonacoEditor(e.browserEvent.target))return;const t=e.index;return void 0===t?(this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),void this.list.setAnchor(void 0)):this.isSelectionRangeChangeEvent(e)||this.isSelectionChangeEvent(e)?this.changeSelection(e):(this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),isMouseRightClick(e.browserEvent)||this.list.setSelection([t],e.browserEvent),void this._onPointer.fire(e))}onDoubleClick(e){if(isInputElement(e.browserEvent.target)||isMonacoEditor(e.browserEvent.target))return;if(this.isSelectionChangeEvent(e))return;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let n=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(void 0===n){const e=this.list.getFocus()[0];n=null!=e?e:t,this.list.setAnchor(n)}const i=range(Math.min(n,t),Math.max(n,t)+1),o=this.list.getSelection(),r=getContiguousRangeContaining(disjunction(o,[n]),n);if(0===r.length)return;const s=disjunction(i,relativeComplement(o,r));this.list.setSelection(s,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const n=this.list.getSelection(),i=n.filter((e=>e!==t));this.list.setFocus([t]),this.list.setAnchor(t),n.length===i.length?this.list.setSelection([...i,t],e.browserEvent):this.list.setSelection(i,e.browserEvent)}}dispose(){this.disposables.dispose()}}class DefaultStyleController{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,n=[];e.listBackground&&e.listBackground.isOpaque()&&n.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(n.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),n.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&n.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(n.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),n.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&n.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&n.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&n.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }\n\t\t\t`),e.listFocusAndSelectionForeground&&n.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }\n\t\t\t`),e.listInactiveFocusForeground&&(n.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),n.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&n.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(n.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),n.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(n.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),n.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&n.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&n.push(`.monaco-list${t}:not(.drop-target) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&n.push(`.monaco-list${t} .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`),e.listSelectionOutline&&n.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listFocusOutline&&n.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t\t.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t`),e.listInactiveFocusOutline&&n.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&n.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&n.push(`\n\t\t\t\t.monaco-list${t}.drop-target,\n\t\t\t\t.monaco-list${t} .monaco-list-rows.drop-target,\n\t\t\t\t.monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }\n\t\t\t`),e.listFilterWidgetBackground&&n.push(`.monaco-list-type-filter { background-color: ${e.listFilterWidgetBackground} }`),e.listFilterWidgetOutline&&n.push(`.monaco-list-type-filter { border: 1px solid ${e.listFilterWidgetOutline}; }`),e.listFilterWidgetNoMatchesOutline&&n.push(`.monaco-list-type-filter.no-matches { border: 1px solid ${e.listFilterWidgetNoMatchesOutline}; }`),e.listMatchesShadow&&n.push(`.monaco-list-type-filter { box-shadow: 1px 1px 1px ${e.listMatchesShadow}; }`),e.tableColumnsBorder&&n.push(`\n\t\t\t\t.monaco-table:hover > .monaco-split-view2,\n\t\t\t\t.monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: ${e.tableColumnsBorder};\n\t\t\t}`),e.tableOddRowsBackgroundColor&&n.push(`\n\t\t\t\t.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {\n\t\t\t\t\tbackground-color: ${e.tableOddRowsBackgroundColor};\n\t\t\t\t}\n\t\t\t`),this.styleElement.textContent=n.join("\n")}}const defaultStyles$1={listFocusBackground:Color.fromHex("#7FB0D0"),listActiveSelectionBackground:Color.fromHex("#0E639C"),listActiveSelectionForeground:Color.fromHex("#FFFFFF"),listActiveSelectionIconForeground:Color.fromHex("#FFFFFF"),listFocusAndSelectionBackground:Color.fromHex("#094771"),listFocusAndSelectionForeground:Color.fromHex("#FFFFFF"),listInactiveSelectionBackground:Color.fromHex("#3F3F46"),listInactiveSelectionIconForeground:Color.fromHex("#FFFFFF"),listHoverBackground:Color.fromHex("#2A2D2E"),listDropBackground:Color.fromHex("#383B3D"),treeIndentGuidesStroke:Color.fromHex("#a9a9a9"),tableColumnsBorder:Color.fromHex("#cccccc").transparent(.2),tableOddRowsBackgroundColor:Color.fromHex("#cccccc").transparent(.04)},DefaultOptions={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){}}};function getContiguousRangeContaining(e,t){const n=e.indexOf(t);if(-1===n)return[];const i=[];let o=n-1;for(;o>=0&&e[o]===t-(n-o);)i.push(e[o--]);for(i.reverse(),o=n;o<e.length&&e[o]===t+(o-n);)i.push(e[o++]);return i}function disjunction(e,t){const n=[];let i=0,o=0;for(;i<e.length||o<t.length;)if(i>=e.length)n.push(t[o++]);else if(o>=t.length)n.push(e[i++]);else{if(e[i]===t[o]){n.push(e[i]),i++,o++;continue}e[i]<t[o]?n.push(e[i++]):n.push(t[o++])}return n}function relativeComplement(e,t){const n=[];let i=0,o=0;for(;i<e.length||o<t.length;)if(i>=e.length)n.push(t[o++]);else if(o>=t.length)n.push(e[i++]);else{if(e[i]===t[o]){i++,o++;continue}e[i]<t[o]?n.push(e[i++]):o++}return n}const numericSort=(e,t)=>e-t;class PipelineRenderer{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map((t=>t.renderTemplate(e)))}renderElement(e,t,n,i){let o=0;for(const r of this.renderers)r.renderElement(e,t,n[o++],i)}disposeElement(e,t,n,i){let o=0;for(const r of this.renderers)r.disposeElement&&r.disposeElement(e,t,n[o],i),o+=1}disposeTemplate(e){let t=0;for(const n of this.renderers)n.disposeTemplate(e[t++])}}class AccessibiltyRenderer{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,n){const i=this.accessibilityProvider.getAriaLabel(e);i?n.setAttribute("aria-label",i):n.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);"number"==typeof o?n.setAttribute("aria-level",`${o}`):n.removeAttribute("aria-level")}disposeTemplate(e){}}class ListViewDragAndDrop{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(e,t)}onDragOver(e,t,n,i){return this.dnd.onDragOver(e,t,n,i)}onDragLeave(e,t,n,i){var o,r;null===(r=(o=this.dnd).onDragLeave)||void 0===r||r.call(o,e,t,n,i)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}drop(e,t,n,i){this.dnd.drop(e,t,n,i)}}class List{constructor(e,t,n,i,o=DefaultOptions){var r;this.user=e,this._options=o,this.focus=new Trait$1("focused"),this.anchor=new Trait$1("anchor"),this.eventBufferer=new EventBufferer,this._ariaLabel="",this.disposables=new DisposableStore,this._onDidDispose=new Emitter$1,this.onDidDispose=this._onDidDispose.event;const s=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?null===(r=this._options.accessibilityProvider)||void 0===r?void 0:r.getWidgetRole():"list";this.selection=new SelectionTrait("listbox"!==s),mixin(o,defaultStyles$1,!1);const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(a.push(new AccessibiltyRenderer(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant&&this.accessibilityProvider.onDidChangeActiveDescendant(this.onDidChangeActiveDescendant,this,this.disposables)),i=i.map((e=>new PipelineRenderer(e.templateId,[...a,e])));const l=Object.assign(Object.assign({},o),{dnd:o.dnd&&new ListViewDragAndDrop(this,o.dnd)});if(this.view=new ListView(t,n,i,l),this.view.domNode.setAttribute("role",s),o.styleController)this.styleController=o.styleController(this.view.domId);else{const e=createStyleSheet(this.view.domNode);this.styleController=new DefaultStyleController(e,this.view.domId)}if(this.spliceable=new CombinedSpliceable([new TraitSpliceable(this.focus,this.view,o.identityProvider),new TraitSpliceable(this.selection,this.view,o.identityProvider),new TraitSpliceable(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new DOMFocusController(this,this.view)),("boolean"!=typeof o.keyboardSupport||o.keyboardSupport)&&(this.keyboardController=new KeyboardController(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const e=o.keyboardNavigationDelegate||DefaultKeyboardNavigationDelegate;this.typeLabelController=new TypeLabelController(this,this.view,o.keyboardNavigationLabelProvider,e),this.disposables.add(this.typeLabelController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),!1!==this._options.multipleSelectionSupport&&this.view.domNode.setAttribute("aria-multiselectable","true")}get onDidChangeFocus(){return Event$1.map(this.eventBufferer.wrapEvent(this.focus.onChange),(e=>this.toListEvent(e)))}get onDidChangeSelection(){return Event$1.map(this.eventBufferer.wrapEvent(this.selection.onChange),(e=>this.toListEvent(e)))}get domId(){return this.view.domId}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=Event$1.chain(this.disposables.add(new DomEmitter(this.view.domNode,"keydown")).event).map((e=>new StandardKeyboardEvent(e))).filter((t=>e=58===t.keyCode||t.shiftKey&&68===t.keyCode)).map(stopEvent).filter((()=>!1)).event,n=Event$1.chain(this.disposables.add(new DomEmitter(this.view.domNode,"keyup")).event).forEach((()=>e=!1)).map((e=>new StandardKeyboardEvent(e))).filter((e=>58===e.keyCode||e.shiftKey&&68===e.keyCode)).map(stopEvent).map((({browserEvent:e})=>{const t=this.getFocus(),n=t.length?t[0]:void 0;return{index:n,element:void 0!==n?this.view.element(n):void 0,anchor:void 0!==n?this.view.domElement(n):this.view.domNode,browserEvent:e}})).event,i=Event$1.chain(this.view.onContextMenu).filter((t=>!e)).map((({element:e,index:t,browserEvent:n})=>({element:e,index:t,anchor:{x:n.pageX+1,y:n.pageY},browserEvent:n}))).event;return Event$1.any(t,n,i)}get onKeyDown(){return this.disposables.add(new DomEmitter(this.view.domNode,"keydown")).event}get onDidFocus(){return Event$1.signal(this.disposables.add(new DomEmitter(this.view.domNode,"focus",!0)).event)}createMouseController(e){return new MouseController(this)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e),this.typeLabelController&&this.typeLabelController.updateOptions(this._options),void 0!==this._options.multipleSelectionController&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),null===(t=this.keyboardController)||void 0===t||t.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,n=[]){if(e<0||e>this.view.length)throw new ListError(this.user,`Invalid start index: ${e}`);if(t<0)throw new ListError(this.user,`Invalid delete count: ${t}`);0===t&&0===n.length||this.eventBufferer.bufferEvents((()=>this.spliceable.splice(e,t,n)))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const n of e)if(n<0||n>=this.length)throw new ListError(this.user,`Invalid index ${n}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map((e=>this.view.element(e)))}setAnchor(e){if(void 0!==e){if(e<0||e>=this.length)throw new ListError(this.user,`Invalid index ${e}`);this.anchor.set([e])}else this.anchor.set([])}getAnchor(){return firstOrDefault(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return void 0===e?void 0:this.element(e)}setFocus(e,t){for(const n of e)if(n<0||n>=this.length)throw new ListError(this.user,`Invalid index ${n}`);this.focus.set(e,t)}focusNext(e=1,t=!1,n,i){if(0===this.length)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,i);r>-1&&this.setFocus([r],n)}focusPrevious(e=1,t=!1,n,i){if(0===this.length)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,i);r>-1&&this.setFocus([r],n)}focusNextPage(e,t){return __awaiter$P(this,void 0,void 0,(function*(){let n=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);n=0===n?0:n-1;const i=this.view.element(n),o=this.getFocusedElements()[0];if(o!==i){const i=this.findPreviousIndex(n,!1,t);i>-1&&o!==this.view.element(i)?this.setFocus([i],e):this.setFocus([n],e)}else{const i=this.view.getScrollTop();this.view.setScrollTop(i+this.view.renderHeight-this.view.elementHeight(n)),this.view.getScrollTop()!==i&&(this.setFocus([]),yield timeout(0),yield this.focusNextPage(e,t))}}))}focusPreviousPage(e,t){return __awaiter$P(this,void 0,void 0,(function*(){let n;const i=this.view.getScrollTop();n=0===i?this.view.indexAt(i):this.view.indexAfter(i-1);const o=this.view.element(n),r=this.getFocusedElements()[0];if(r!==o){const i=this.findNextIndex(n,!1,t);i>-1&&r!==this.view.element(i)?this.setFocus([i],e):this.setFocus([n],e)}else{const n=i;this.view.setScrollTop(i-this.view.renderHeight),this.view.getScrollTop()!==n&&(this.setFocus([]),yield timeout(0),yield this.focusPreviousPage(e,t))}}))}focusLast(e,t){if(0===this.length)return;const n=this.findPreviousIndex(this.length-1,!1,t);n>-1&&this.setFocus([n],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,n){if(0===this.length)return;const i=this.findNextIndex(e,!1,n);i>-1&&this.setFocus([i],t)}findNextIndex(e,t=!1,n){for(let i=0;i<this.length;i++){if(e>=this.length&&!t)return-1;if(e%=this.length,!n||n(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,n){for(let i=0;i<this.length;i++){if(e<0&&!t)return-1;if(e=(this.length+e%this.length)%this.length,!n||n(this.element(e)))return e;e--}return-1}getFocus(){return this.focus.get()}getFocusedElements(){return this.getFocus().map((e=>this.view.element(e)))}reveal(e,t){if(e<0||e>=this.length)throw new ListError(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),i=this.view.elementTop(e),o=this.view.elementHeight(e);if(isNumber$1(t)){const e=o-this.view.renderHeight;this.view.setScrollTop(e*clamp(t,0,1)+i)}else{const e=i+o,t=n+this.view.renderHeight;i<n&&e>=t||(i<n||e>=t&&o>=this.view.renderHeight?this.view.setScrollTop(i):e>=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getRelativeTop(e){if(e<0||e>=this.length)throw new ListError(this.user,`Invalid index ${e}`);const t=this.view.getScrollTop(),n=this.view.elementTop(e),i=this.view.elementHeight(e);if(n<t||n+i>t+this.view.renderHeight)return null;const o=i-this.view.renderHeight;return Math.abs((t-n)/o)}getHTMLElement(){return this.view.domNode}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map((e=>this.view.element(e))),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let n;(null===(e=this.accessibilityProvider)||void 0===e?void 0:e.getActiveDescendantId)&&(n=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",n||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",0===e.length),this.view.domNode.classList.toggle("selection-single",1===e.length),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}__decorate$1c([memoize],List.prototype,"onDidChangeFocus",null),__decorate$1c([memoize],List.prototype,"onDidChangeSelection",null),__decorate$1c([memoize],List.prototype,"onContextMenu",null),__decorate$1c([memoize],List.prototype,"onKeyDown",null),__decorate$1c([memoize],List.prototype,"onDidFocus",null);class PagedRenderer{constructor(e,t){this.renderer=e,this.modelProvider=t}get templateId(){return this.renderer.templateId}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:Disposable.None}}renderElement(e,t,n,i){if(n.disposable&&n.disposable.dispose(),!n.data)return;const o=this.modelProvider();if(o.isResolved(e))return this.renderer.renderElement(o.get(e),e,n.data,i);const r=new CancellationTokenSource$1,s=o.resolve(e,r.token);n.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,n.data),s.then((t=>this.renderer.renderElement(t,e,n.data,i)))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class PagedAccessibilityProvider{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function fromPagedListOptions(e,t){return Object.assign(Object.assign({},t),{accessibilityProvider:t.accessibilityProvider&&new PagedAccessibilityProvider(e,t.accessibilityProvider)})}class PagedList{constructor(e,t,n,i,o={}){const r=()=>this.model,s=i.map((e=>new PagedRenderer(e,r)));this.list=new List(e,t,n,s,fromPagedListOptions(r,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return Event$1.map(this.list.onMouseDblClick,(({element:e,index:t,browserEvent:n})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:n})))}get onPointer(){return Event$1.map(this.list.onPointer,(({element:e,index:t,browserEvent:n})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:n})))}get onDidChangeSelection(){return Event$1.map(this.list.onDidChangeSelection,(({elements:e,indexes:t,browserEvent:n})=>({elements:e.map((e=>this._model.get(e))),indexes:t,browserEvent:n})))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,range(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map((e=>this.model.get(e)))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var splitview="";const defaultStyles={separatorBorder:Color.transparent};class ViewItem{constructor(e,t,n,i){this.container=e,this.view=t,this.disposable=i,this._cachedVisibleSize=void 0,"number"==typeof n?(this._size=n,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=n.cachedVisibleSize)}set size(e){this._size=e}get size(){return this._size}get visible(){return void 0===this._cachedVisibleSize}setVisible(e,t){e!==this.visible&&(e?(this.size=clamp(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof t?t:this.size,this.size=0),this.container.classList.toggle("visible",e),this.view.setVisible&&this.view.setVisible(e))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){return this.disposable.dispose(),this.view}}class VerticalViewItem extends ViewItem{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class HorizontalViewItem extends ViewItem{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var State,State2,Sizing,Sizing2;State2=State||(State={}),State2[State2.Idle=0]="Idle",State2[State2.Busy=1]="Busy",Sizing2=Sizing||(Sizing={}),Sizing2.Distribute={type:"distribute"},Sizing2.Split=function(e){return{type:"split",index:e}},Sizing2.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}};class SplitView extends Disposable{constructor(e,t={}){var n,i,o,r,s;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=State.Idle,this._onDidSashChange=this._register(new Emitter$1),this._onDidSashReset=this._register(new Emitter$1),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=null!==(n=t.orientation)&&void 0!==n?n:0,this.inverseAltBehavior=null!==(i=t.inverseAltBehavior)&&void 0!==i&&i,this.proportionalLayout=null===(o=t.proportionalLayout)||void 0===o||o,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(0===this.orientation?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=append$1(this.el,$$c(".sash-container")),this.viewContainer=$$c(".split-view-container"),this.scrollable=new Scrollable({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:scheduleAtNextAnimationFrame}),this.scrollableElement=this._register(new SmoothScrollableElement(this.viewContainer,{vertical:0===this.orientation?null!==(r=t.scrollbarVisibility)&&void 0!==r?r:1:2,horizontal:1===this.orientation?null!==(s=t.scrollbarVisibility)&&void 0!==s?s:1:2},this.scrollable)),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll((e=>{this.viewContainer.scrollTop=e.scrollTop,this.viewContainer.scrollLeft=e.scrollLeft}))),append$1(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||defaultStyles),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach(((e,t)=>{const n=isUndefined(e.visible)||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},i=e.view;this.doAddView(i,n,t,!0)})),this.contentSize=this.viewItems.reduce(((e,t)=>e+t.size),0),this.saveProportions())}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,n=this.viewItems.length,i){this.doAddView(e,t,n,i)}layout(e,t){const n=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions)for(let i=0;i<this.viewItems.length;i++){const t=this.viewItems[i];t.size=clamp(Math.round(this.proportions[i]*e),t.minimumSize,t.maximumSize)}else{const t=range(this.viewItems.length),i=t.filter((e=>1===this.viewItems[e].priority)),o=t.filter((e=>2===this.viewItems[e].priority));this.resize(this.viewItems.length-1,e-n,void 0,i,o)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map((e=>e.size/this.contentSize)))}onSashStart({sash:e,start:t,alt:n}){for(const s of this.viewItems)s.enabled=!1;const i=this.sashItems.findIndex((t=>t.sash===e)),o=combinedDisposable(addDisposableListener(document.body,"keydown",(e=>r(this.sashDragState.current,e.altKey))),addDisposableListener(document.body,"keyup",(()=>r(this.sashDragState.current,!1)))),r=(e,t)=>{const n=this.viewItems.map((e=>e.size));let r,s,a=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(t=!t),t){if(i===this.sashItems.length-1){const e=this.viewItems[i];a=(e.minimumSize-e.size)/2,l=(e.maximumSize-e.size)/2}else{const e=this.viewItems[i+1];a=(e.size-e.maximumSize)/2,l=(e.size-e.minimumSize)/2}}if(!t){const e=range(i,-1),t=range(i+1,this.viewItems.length),o=e.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-n[t])),0),a=e.reduce(((e,t)=>e+(this.viewItems[t].viewMaximumSize-n[t])),0),l=0===t.length?Number.POSITIVE_INFINITY:t.reduce(((e,t)=>e+(n[t]-this.viewItems[t].minimumSize)),0),c=0===t.length?Number.NEGATIVE_INFINITY:t.reduce(((e,t)=>e+(n[t]-this.viewItems[t].viewMaximumSize)),0),d=Math.max(o,c),u=Math.min(l,a),h=this.findFirstSnapIndex(e),g=this.findFirstSnapIndex(t);if("number"==typeof h){const e=this.viewItems[h],t=Math.floor(e.viewMinimumSize/2);r={index:h,limitDelta:e.visible?d-t:d+t,size:e.size}}if("number"==typeof g){const e=this.viewItems[g],t=Math.floor(e.viewMinimumSize/2);s={index:g,limitDelta:e.visible?u+t:u-t,size:e.size}}}this.sashDragState={start:e,current:e,index:i,sizes:n,minDelta:a,maxDelta:l,alt:t,snapBefore:r,snapAfter:s,disposable:o}};r(t,n)}onSashChange({current:e}){const{index:t,start:n,sizes:i,alt:o,minDelta:r,maxDelta:s,snapBefore:a,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;const c=e-n,d=this.resize(t,c,i,void 0,void 0,r,s,a,l);if(o){const e=t===this.sashItems.length-1,n=this.viewItems.map((e=>e.size)),i=e?t:t+1,o=this.viewItems[i],r=o.size-o.maximumSize,s=o.size-o.minimumSize,a=e?t-1:t+1;this.resize(a,-d,n,void 0,void 0,r,s)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const n=this.viewItems.indexOf(e);n<0||n>=this.viewItems.length||(t=clamp(t="number"==typeof t?t:e.size,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&n>0?(this.resize(n-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([n],void 0)))}resizeView(e,t){if(this.state!==State.Idle)throw new Error("Cant modify splitview");if(this.state=State.Busy,e<0||e>=this.viewItems.length)return;const n=range(this.viewItems.length).filter((t=>t!==e)),i=[...n.filter((e=>1===this.viewItems[e].priority)),e],o=n.filter((e=>2===this.viewItems[e].priority)),r=this.viewItems[e];t=clamp(t=Math.round(t),r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(i,o),this.state=State.Idle}distributeViewSizes(){const e=[];let t=0;for(const s of this.viewItems)s.maximumSize-s.minimumSize>0&&(e.push(s),t+=s.size);const n=Math.floor(t/e.length);for(const s of e)s.size=clamp(n,s.minimumSize,s.maximumSize);const i=range(this.viewItems.length),o=i.filter((e=>1===this.viewItems[e].priority)),r=i.filter((e=>2===this.viewItems[e].priority));this.relayout(o,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,n=this.viewItems.length,i){if(this.state!==State.Idle)throw new Error("Cant modify splitview");this.state=State.Busy;const o=$$c(".split-view-view");n===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(n));const r=combinedDisposable(e.onDidChange((e=>this.onViewChange(a,e))),toDisposable((()=>this.viewContainer.removeChild(o))));let s;s="number"==typeof t?t:"split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize;const a=0===this.orientation?new VerticalViewItem(o,e,s,r):new HorizontalViewItem(o,e,s,r);if(this.viewItems.splice(n,0,a),this.viewItems.length>1){let e={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash};const t=0===this.orientation?new Sash(this.sashContainer,{getHorizontalSashTop:e=>this.getSashPosition(e),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},e),{orientation:1})):new Sash(this.sashContainer,{getVerticalSashLeft:e=>this.getSashPosition(e),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},e),{orientation:0})),i=0===this.orientation?e=>({sash:t,start:e.startY,current:e.currentY,alt:e.altKey}):e=>({sash:t,start:e.startX,current:e.currentX,alt:e.altKey}),o=combinedDisposable(Event$1.map(t.onDidStart,i)(this.onSashStart,this),Event$1.map(t.onDidChange,i)(this.onSashChange,this),Event$1.map(t.onDidEnd,(()=>this.sashItems.findIndex((e=>e.sash===t))))(this.onSashEnd,this),t.onDidReset((()=>{const e=this.sashItems.findIndex((e=>e.sash===t)),n=range(e,-1),i=range(e+1,this.viewItems.length),o=this.findFirstSnapIndex(n),r=this.findFirstSnapIndex(i);("number"!=typeof o||this.viewItems[o].visible)&&("number"!=typeof r||this.viewItems[r].visible)&&this._onDidSashReset.fire(e)})),t),r={sash:t,disposable:o};this.sashItems.splice(n-1,0,r)}let l;o.appendChild(e.element),"number"!=typeof t&&"split"===t.type&&(l=[t.index]),i||this.relayout([n],l),this.state=State.Idle,i||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes()}relayout(e,t){const n=this.viewItems.reduce(((e,t)=>e+t.size),0);this.resize(this.viewItems.length-1,this.size-n,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,n=this.viewItems.map((e=>e.size)),i,o,r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,a,l){if(e<0||e>=this.viewItems.length)return 0;const c=range(e,-1),d=range(e+1,this.viewItems.length);if(o)for(const S of o)pushToStart(c,S),pushToStart(d,S);if(i)for(const S of i)pushToEnd(c,S),pushToEnd(d,S);const u=c.map((e=>this.viewItems[e])),h=c.map((e=>n[e])),g=d.map((e=>this.viewItems[e])),p=d.map((e=>n[e])),f=c.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-n[t])),0),m=c.reduce(((e,t)=>e+(this.viewItems[t].maximumSize-n[t])),0),v=0===d.length?Number.POSITIVE_INFINITY:d.reduce(((e,t)=>e+(n[t]-this.viewItems[t].minimumSize)),0),_=0===d.length?Number.NEGATIVE_INFINITY:d.reduce(((e,t)=>e+(n[t]-this.viewItems[t].maximumSize)),0),C=Math.max(f,_,r),b=Math.min(v,m,s);let y=!1;if(a){const e=this.viewItems[a.index],n=t>=a.limitDelta;y=n!==e.visible,e.setVisible(n,a.size)}if(!y&&l){const e=this.viewItems[l.index],n=t<l.limitDelta;y=n!==e.visible,e.setVisible(n,l.size)}if(y)return this.resize(e,t,n,i,o,r,s);for(let S=0,w=t=clamp(t,C,b);S<u.length;S++){const e=u[S],t=clamp(h[S]+w,e.minimumSize,e.maximumSize);w-=t-h[S],e.size=t}for(let S=0,w=t;S<g.length;S++){const e=g[S],t=clamp(p[S]-w,e.minimumSize,e.maximumSize);w+=t-p[S],e.size=t}return t}distributeEmptySpace(e){const t=this.viewItems.reduce(((e,t)=>e+t.size),0);let n=this.size-t;const i=range(this.viewItems.length-1,-1),o=i.filter((e=>1===this.viewItems[e].priority)),r=i.filter((e=>2===this.viewItems[e].priority));for(const s of r)pushToStart(i,s);for(const s of o)pushToEnd(i,s);"number"==typeof e&&pushToEnd(i,e);for(let s=0;0!==n&&s<i.length;s++){const e=this.viewItems[i[s]],t=clamp(e.size+n,e.minimumSize,e.maximumSize);n-=t-e.size,e.size=t}}layoutViews(){this.contentSize=this.viewItems.reduce(((e,t)=>e+t.size),0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach((e=>e.sash.layout())),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){0===this.orientation?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this.contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this.contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map((t=>e=t.size-t.minimumSize>0||e));e=!1;const n=this.viewItems.map((t=>e=t.maximumSize-t.size>0||e)),i=[...this.viewItems].reverse();e=!1;const o=i.map((t=>e=t.size-t.minimumSize>0||e)).reverse();e=!1;const r=i.map((t=>e=t.maximumSize-t.size>0||e)).reverse();let s=0;for(let a=0;a<this.sashItems.length;a++){const{sash:e}=this.sashItems[a];s+=this.viewItems[a].size;const i=!(t[a]&&r[a+1]),l=!(n[a]&&o[a+1]);if(i&&l){const n=range(a,-1),i=range(a+1,this.viewItems.length),r=this.findFirstSnapIndex(n),l=this.findFirstSnapIndex(i),c="number"==typeof r&&!this.viewItems[r].visible,d="number"==typeof l&&!this.viewItems[l].visible;c&&o[a]&&(s>0||this.startSnappingEnabled)?e.state=1:d&&t[a]&&(s<this.contentSize||this.endSnappingEnabled)?e.state=2:e.state=0}else e.state=i&&!l?1:!i&&l?2:3}}getSashPosition(e){let t=0;for(let n=0;n<this.sashItems.length;n++)if(t+=this.viewItems[n].size,this.sashItems[n].sash===e)return t;return 0}findFirstSnapIndex(e){for(const t of e){const e=this.viewItems[t];if(e.visible&&e.snap)return t}for(const t of e){const e=this.viewItems[t];if(e.visible&&e.maximumSize-e.minimumSize>0)return;if(!e.visible&&e.snap)return t}}dispose(){super.dispose(),dispose(this.viewItems),this.viewItems=[],this.sashItems.forEach((e=>e.disposable.dispose())),this.sashItems=[]}}var table="",TreeMouseEventTarget,TreeMouseEventTarget2;class TableListRenderer{constructor(e,t,n){this.columns=e,this.getColumnSize=n,this.templateId=TableListRenderer.TemplateId,this.renderedTemplates=new Set;const i=new Map(t.map((e=>[e.templateId,e])));this.renderers=[];for(const o of e){const e=i.get(o.templateId);if(!e)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(e)}}renderTemplate(e){const t=append$1(e,$$c(".monaco-table-tr")),n=[],i=[];for(let r=0;r<this.columns.length;r++){const e=this.renderers[r],o=append$1(t,$$c(".monaco-table-td",{"data-col-index":r}));o.style.width=`${this.getColumnSize(r)}px`,n.push(o),i.push(e.renderTemplate(o))}const o={container:e,cellContainers:n,cellTemplateData:i};return this.renderedTemplates.add(o),o}renderElement(e,t,n,i){for(let o=0;o<this.columns.length;o++){const r=this.columns[o].project(e);this.renderers[o].renderElement(r,t,n.cellTemplateData[o],i)}}disposeElement(e,t,n,i){for(let o=0;o<this.columns.length;o++){const r=this.renderers[o];if(r.disposeElement){const s=this.columns[o].project(e);r.disposeElement(s,t,n.cellTemplateData[o],i)}}}disposeTemplate(e){for(let t=0;t<this.columns.length;t++){this.renderers[t].disposeTemplate(e.cellTemplateData[t])}clearNode(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(const{cellContainers:n}of this.renderedTemplates)n[e].style.width=`${t}px`}}function asListVirtualDelegate(e){return{getHeight:t=>e.getHeight(t),getTemplateId:()=>TableListRenderer.TemplateId}}TableListRenderer.TemplateId="row";class ColumnHeader{constructor(e,t){this.column=e,this.index=t,this._onDidLayout=new Emitter$1,this.onDidLayout=this._onDidLayout.event,this.element=$$c(".monaco-table-th",{"data-col-index":t,title:e.tooltip},e.label)}get minimumSize(){var e;return null!==(e=this.column.minimumWidth)&&void 0!==e?e:120}get maximumSize(){var e;return null!==(e=this.column.maximumWidth)&&void 0!==e?e:Number.POSITIVE_INFINITY}get onDidChange(){var e;return null!==(e=this.column.onDidChangeWidthConstraints)&&void 0!==e?e:Event$1.None}layout(e){this._onDidLayout.fire([this.index,e])}}class Table{constructor(e,t,n,i,o,r){this.virtualDelegate=n,this.domId="table_id_"+ ++Table.InstanceCount,this.disposables=new DisposableStore,this.cachedWidth=0,this.cachedHeight=0,this.domNode=append$1(t,$$c(`.monaco-table.${this.domId}`));const s=i.map(((e,t)=>new ColumnHeader(e,t))),a={size:s.reduce(((e,t)=>e+t.column.weight),0),views:s.map((e=>({size:e.column.weight,view:e})))};this.splitview=this.disposables.add(new SplitView(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:a})),this.splitview.el.style.height=`${n.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${n.headerRowHeight}px`;const l=new TableListRenderer(i,o,(e=>this.splitview.getViewSize(e)));this.list=this.disposables.add(new List(e,this.domNode,asListVirtualDelegate(n),[l],r)),Event$1.any(...s.map((e=>e.onDidLayout)))((([e,t])=>l.layoutColumn(e,t)),null,this.disposables),this.splitview.onDidSashReset((e=>{const t=i.reduce(((e,t)=>e+t.weight),0),n=i[e].weight/t*this.cachedWidth;this.splitview.resizeView(e,n)}),null,this.disposables),this.styleElement=createStyleSheet(this.domNode),this.style({})}get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}updateOptions(e){this.list.updateOptions(e)}splice(e,t,n=[]){this.list.splice(e,t,n)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\ttop: ${this.virtualDelegate.headerRowHeight+1}px;\n\t\t\theight: calc(100% - ${this.virtualDelegate.headerRowHeight}px);\n\t\t}`),this.styleElement.textContent=t.join("\n"),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}Table.InstanceCount=0,TreeMouseEventTarget2=TreeMouseEventTarget||(TreeMouseEventTarget={}),TreeMouseEventTarget2[TreeMouseEventTarget2.Unknown=0]="Unknown",TreeMouseEventTarget2[TreeMouseEventTarget2.Twistie=1]="Twistie",TreeMouseEventTarget2[TreeMouseEventTarget2.Element=2]="Element";class TreeError extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class WeakMapper{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}class DiffChange{constructor(e,t,n,i){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=i}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class StringDiffSequence{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let n=0,i=e.length;n<i;n++)t[n]=e.charCodeAt(n);return t}}function stringDiff(e,t,n){return new LcsDiff(new StringDiffSequence(e),new StringDiffSequence(t)).ComputeDiff(n).changes}class Debug{static Assert(e,t){if(!e)throw new Error(t)}}class MyArray{static Copy(e,t,n,i,o){for(let r=0;r<o;r++)n[i+r]=e[t+r]}static Copy2(e,t,n,i,o){for(let r=0;r<o;r++)n[i+r]=e[t+r]}}class DiffChangeHelper{constructor(){this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new DiffChange(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class LcsDiff{constructor(e,t,n=null){this.ContinueProcessingPredicate=n,this._originalSequence=e,this._modifiedSequence=t;const[i,o,r]=LcsDiff._getElements(e),[s,a,l]=LcsDiff._getElements(t);this._hasStrings=r&&l,this._originalStringElements=i,this._originalElementsOrHash=o,this._modifiedStringElements=s,this._modifiedElementsOrHash=a,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&"string"==typeof e[0]}static _getElements(e){const t=e.getElements();if(LcsDiff._isStringArray(t)){const e=new Int32Array(t.length);for(let n=0,i=t.length;n<i;n++)e[n]=stringHash(t[n],0);return[t,e,!0]}return t instanceof Int32Array?[[],t,!1]:[[],new Int32Array(t),!1]}ElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._modifiedElementsOrHash[t]&&(!this._hasStrings||this._originalStringElements[e]===this._modifiedStringElements[t])}ElementsAreStrictEqual(e,t){if(!this.ElementsAreEqual(e,t))return!1;return LcsDiff._getStrictElement(this._originalSequence,e)===LcsDiff._getStrictElement(this._modifiedSequence,t)}static _getStrictElement(e,t){return"function"==typeof e.getStrictElement?e.getStrictElement(t):null}OriginalElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._originalElementsOrHash[t]&&(!this._hasStrings||this._originalStringElements[e]===this._originalStringElements[t])}ModifiedElementsAreEqual(e,t){return this._modifiedElementsOrHash[e]===this._modifiedElementsOrHash[t]&&(!this._hasStrings||this._modifiedStringElements[e]===this._modifiedStringElements[t])}ComputeDiff(e){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,e)}_ComputeDiff(e,t,n,i,o){const r=[!1];let s=this.ComputeDiffRecursive(e,t,n,i,r);return o&&(s=this.PrettifyChanges(s)),{quitEarly:r[0],changes:s}}ComputeDiffRecursive(e,t,n,i,o){for(o[0]=!1;e<=t&&n<=i&&this.ElementsAreEqual(e,n);)e++,n++;for(;t>=e&&i>=n&&this.ElementsAreEqual(t,i);)t--,i--;if(e>t||n>i){let o;return n<=i?(Debug.Assert(e===t+1,"originalStart should only be one more than originalEnd"),o=[new DiffChange(e,0,n,i-n+1)]):e<=t?(Debug.Assert(n===i+1,"modifiedStart should only be one more than modifiedEnd"),o=[new DiffChange(e,t-e+1,n,0)]):(Debug.Assert(e===t+1,"originalStart should only be one more than originalEnd"),Debug.Assert(n===i+1,"modifiedStart should only be one more than modifiedEnd"),o=[]),o}const r=[0],s=[0],a=this.ComputeRecursionPoint(e,t,n,i,r,s,o),l=r[0],c=s[0];if(null!==a)return a;if(!o[0]){const r=this.ComputeDiffRecursive(e,l,n,c,o);let s=[];return s=o[0]?[new DiffChange(l+1,t-(l+1)+1,c+1,i-(c+1)+1)]:this.ComputeDiffRecursive(l+1,t,c+1,i,o),this.ConcatenateChanges(r,s)}return[new DiffChange(e,t-e+1,n,i-n+1)]}WALKTRACE(e,t,n,i,o,r,s,a,l,c,d,u,h,g,p,f,m,v){let _=null,C=null,b=new DiffChangeHelper,y=t,S=n,w=h[0]-f[0]-i,E=-1073741824,x=this.m_forwardHistory.length-1;do{const t=w+e;t===y||t<S&&l[t-1]<l[t+1]?(g=(d=l[t+1])-w-i,d<E&&b.MarkNextChange(),E=d,b.AddModifiedElement(d+1,g),w=t+1-e):(g=(d=l[t-1]+1)-w-i,d<E&&b.MarkNextChange(),E=d-1,b.AddOriginalElement(d,g+1),w=t-1-e),x>=0&&(e=(l=this.m_forwardHistory[x])[0],y=1,S=l.length-1)}while(--x>=-1);if(_=b.getReverseChanges(),v[0]){let e=h[0]+1,t=f[0]+1;if(null!==_&&_.length>0){const n=_[_.length-1];e=Math.max(e,n.getOriginalEnd()),t=Math.max(t,n.getModifiedEnd())}C=[new DiffChange(e,u-e+1,t,p-t+1)]}else{b=new DiffChangeHelper,y=r,S=s,w=h[0]-f[0]-a,E=1073741824,x=m?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=w+o;e===y||e<S&&c[e-1]>=c[e+1]?(g=(d=c[e+1]-1)-w-a,d>E&&b.MarkNextChange(),E=d+1,b.AddOriginalElement(d+1,g+1),w=e+1-o):(g=(d=c[e-1])-w-a,d>E&&b.MarkNextChange(),E=d,b.AddModifiedElement(d+1,g+1),w=e-1-o),x>=0&&(o=(c=this.m_reverseHistory[x])[0],y=1,S=c.length-1)}while(--x>=-1);C=b.getChanges()}return this.ConcatenateChanges(_,C)}ComputeRecursionPoint(e,t,n,i,o,r,s){let a=0,l=0,c=0,d=0,u=0,h=0;e--,n--,o[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(i-n),p=g+1,f=new Int32Array(p),m=new Int32Array(p),v=i-n,_=t-e,C=e-n,b=t-i,y=(_-v)%2==0;f[v]=e,m[_]=t,s[0]=!1;for(let S=1;S<=g/2+1;S++){let g=0,w=0;c=this.ClipDiagonalBound(v-S,S,v,p),d=this.ClipDiagonalBound(v+S,S,v,p);for(let e=c;e<=d;e+=2){a=e===c||e<d&&f[e-1]<f[e+1]?f[e+1]:f[e-1]+1,l=a-(e-v)-C;const n=a;for(;a<t&&l<i&&this.ElementsAreEqual(a+1,l+1);)a++,l++;if(f[e]=a,a+l>g+w&&(g=a,w=l),!y&&Math.abs(e-_)<=S-1&&a>=m[e])return o[0]=a,r[0]=l,n<=m[e]&&S<=1448?this.WALKTRACE(v,c,d,C,_,u,h,b,f,m,a,t,o,l,i,r,y,s):null}const E=(g-e+(w-n)-S)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(g,E))return s[0]=!0,o[0]=g,r[0]=w,E>0&&S<=1448?this.WALKTRACE(v,c,d,C,_,u,h,b,f,m,a,t,o,l,i,r,y,s):(e++,n++,[new DiffChange(e,t-e+1,n,i-n+1)]);u=this.ClipDiagonalBound(_-S,S,_,p),h=this.ClipDiagonalBound(_+S,S,_,p);for(let p=u;p<=h;p+=2){a=p===u||p<h&&m[p-1]>=m[p+1]?m[p+1]-1:m[p-1],l=a-(p-_)-b;const g=a;for(;a>e&&l>n&&this.ElementsAreEqual(a,l);)a--,l--;if(m[p]=a,y&&Math.abs(p-v)<=S&&a<=f[p])return o[0]=a,r[0]=l,g>=f[p]&&S<=1448?this.WALKTRACE(v,c,d,C,_,u,h,b,f,m,a,t,o,l,i,r,y,s):null}if(S<=1447){let e=new Int32Array(d-c+2);e[0]=v-c+1,MyArray.Copy2(f,c,e,1,d-c+1),this.m_forwardHistory.push(e),e=new Int32Array(h-u+2),e[0]=_-u+1,MyArray.Copy2(m,u,e,1,h-u+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(v,c,d,C,_,u,h,b,f,m,a,t,o,l,i,r,y,s)}PrettifyChanges(e){for(let t=0;t<e.length;t++){const n=e[t],i=t<e.length-1?e[t+1].originalStart:this._originalElementsOrHash.length,o=t<e.length-1?e[t+1].modifiedStart:this._modifiedElementsOrHash.length,r=n.originalLength>0,s=n.modifiedLength>0;for(;n.originalStart+n.originalLength<i&&n.modifiedStart+n.modifiedLength<o&&(!r||this.OriginalElementsAreEqual(n.originalStart,n.originalStart+n.originalLength))&&(!s||this.ModifiedElementsAreEqual(n.modifiedStart,n.modifiedStart+n.modifiedLength));){const e=this.ElementsAreStrictEqual(n.originalStart,n.modifiedStart);if(this.ElementsAreStrictEqual(n.originalStart+n.originalLength,n.modifiedStart+n.modifiedLength)&&!e)break;n.originalStart++,n.modifiedStart++}let a=[null];t<e.length-1&&this.ChangesOverlap(e[t],e[t+1],a)&&(e[t]=a[0],e.splice(t+1,1),t--)}for(let t=e.length-1;t>=0;t--){const n=e[t];let i=0,o=0;if(t>0){const n=e[t-1];i=n.originalStart+n.originalLength,o=n.modifiedStart+n.modifiedLength}const r=n.originalLength>0,s=n.modifiedLength>0;let a=0,l=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength);for(let e=1;;e++){const t=n.originalStart-e,c=n.modifiedStart-e;if(t<i||c<o)break;if(r&&!this.OriginalElementsAreEqual(t,t+n.originalLength))break;if(s&&!this.ModifiedElementsAreEqual(c,c+n.modifiedLength))break;const d=(t===i&&c===o?5:0)+this._boundaryScore(t,n.originalLength,c,n.modifiedLength);d>l&&(l=d,a=e)}n.originalStart-=a,n.modifiedStart-=a;const c=[null];t>0&&this.ChangesOverlap(e[t-1],e[t],c)&&(e[t-1]=c[0],e.splice(t,1),t++)}if(this._hasStrings)for(let t=1,n=e.length;t<n;t++){const n=e[t-1],i=e[t],o=i.originalStart-n.originalStart-n.originalLength,r=n.originalStart,s=i.originalStart+i.originalLength,a=s-r,l=n.modifiedStart,c=i.modifiedStart+i.modifiedLength,d=c-l;if(o<5&&a<20&&d<20){const e=this._findBetterContiguousSequence(r,a,l,d,o);if(e){const[t,r]=e;t===n.originalStart+n.originalLength&&r===n.modifiedStart+n.modifiedLength||(n.originalLength=t-n.originalStart,n.modifiedLength=r-n.modifiedStart,i.originalStart=t+o,i.modifiedStart=r+o,i.originalLength=s-i.originalStart,i.modifiedLength=c-i.modifiedStart)}}}return e}_findBetterContiguousSequence(e,t,n,i,o){if(t<o||i<o)return null;const r=e+t-o+1,s=n+i-o+1;let a=0,l=0,c=0;for(let d=e;d<r;d++)for(let e=n;e<s;e++){const t=this._contiguousSequenceScore(d,e,o);t>0&&t>a&&(a=t,l=d,c=e)}return a>0?[l,c]:null}_contiguousSequenceScore(e,t,n){let i=0;for(let o=0;o<n;o++){if(!this.ElementsAreEqual(e+o,t+o))return 0;i+=this._originalStringElements[e+o].length}return i}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1}_boundaryScore(e,t,n,i){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(n,i)?1:0)}ConcatenateChanges(e,t){let n=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){const i=new Array(e.length+t.length-1);return MyArray.Copy(e,0,i,0,e.length-1),i[e.length-1]=n[0],MyArray.Copy(t,1,i,e.length,t.length-1),i}{const n=new Array(e.length+t.length);return MyArray.Copy(e,0,n,0,e.length),MyArray.Copy(t,0,n,e.length,t.length),n}}ChangesOverlap(e,t,n){if(Debug.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),Debug.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const i=e.originalStart;let o=e.originalLength;const r=e.modifiedStart;let s=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(s=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new DiffChange(i,o,r,s),!0}return n[0]=null,!1}ClipDiagonalBound(e,t,n,i){if(e>=0&&e<i)return e;const o=t%2==0;if(e<0){return o===(n%2==0)?0:1}return o===((i-n-1)%2==0)?i-1:i-2}}function isFilterResult(e){return"object"==typeof e&&"visibility"in e&&"data"in e}function getVisibleState(e){switch(e){case!0:return 1;case!1:return 0;default:return e}}function isCollapsibleStateUpdate(e){return"boolean"==typeof e.collapsible}class IndexTreeModel{constructor(e,t,n,i={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new EventBufferer,this._onDidChangeCollapseState=new Emitter$1,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new Emitter$1,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new Emitter$1,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Delayer(MicrotaskDelay),this.collapseByDefault=void 0!==i.collapseByDefault&&i.collapseByDefault,this.filter=i.filter,this.autoExpandSingleChildren=void 0!==i.autoExpandSingleChildren&&i.autoExpandSingleChildren,this.root={parent:void 0,element:n,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,n=Iterable.empty(),i={}){if(0===e.length)throw new TreeError(this.user,"Invalid tree location");i.diffIdentityProvider?this.spliceSmart(i.diffIdentityProvider,e,t,n,i):this.spliceSimple(e,t,n,i)}spliceSmart(e,t,n,i,o,r){var s;void 0===i&&(i=Iterable.empty()),void 0===r&&(r=null!==(s=o.diffDepth)&&void 0!==s?s:0);const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,n,i,o);const l=[...i],c=t[t.length-1],d=new LcsDiff({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,c),...l,...a.children.slice(c+n)].map((t=>e.getId(t.element).toString()))}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,n,l,o);const u=t.slice(0,-1),h=(t,n,i)=>{if(r>0)for(let s=0;s<i;s++)t--,n--,this.spliceSmart(e,[...u,t,0],Number.MAX_SAFE_INTEGER,l[n].children,o,r-1)};let g=Math.min(a.children.length,c+n),p=l.length;for(const f of d.changes.sort(((e,t)=>t.originalStart-e.originalStart)))h(g,p,g-(f.originalStart+f.originalLength)),g=f.originalStart,p=f.modifiedStart-c,this.spliceSimple([...u,g],f.originalLength,Iterable.slice(l,p,p+f.modifiedLength),o);h(g,p,g)}spliceSimple(e,t,n=Iterable.empty(),{onDidCreateNode:i,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:s,listIndex:a,revealed:l,visible:c}=this.getParentNodeWithListIndex(e),d=[],u=Iterable.map(n,(e=>this.createTreeNode(e,s,s.visible?1:0,l,d,i))),h=e[e.length-1],g=s.children.length>0;let p=0;for(let S=h;S>=0&&S<s.children.length;S--){const e=s.children[S];if(e.visible){p=e.visibleChildIndex;break}}const f=[];let m=0,v=0;for(const S of u)f.push(S),v+=S.renderNodeCount,S.visible&&(S.visibleChildIndex=p+m++);const _=splice$1(s.children,h,t,f);r?s.lastDiffIds?splice$1(s.lastDiffIds,h,t,f.map((e=>r.getId(e.element).toString()))):s.lastDiffIds=s.children.map((e=>r.getId(e.element).toString())):s.lastDiffIds=void 0;let C=0;for(const S of _)S.visible&&C++;if(0!==C)for(let S=h+f.length;S<s.children.length;S++){const e=s.children[S];e.visible&&(e.visibleChildIndex-=C)}if(s.visibleChildrenCount+=m-C,l&&c){const e=_.reduce(((e,t)=>e+(t.visible?t.renderNodeCount:0)),0);this._updateAncestorsRenderNodeCount(s,v-e),this.list.splice(a,e,d)}if(_.length>0&&o){const e=t=>{o(t),t.children.forEach(e)};_.forEach(e)}this._onDidSplice.fire({insertedNodes:f,deletedNodes:_});const b=s.children.length>0;g!==b&&this.setCollapsible(e.slice(0,-1),b);let y=s;for(;y;){if(2===y.visibility){this.refilterDelayer.trigger((()=>this.refilter()));break}y=y.parent}}rerender(e){if(0===e.length)throw new TreeError(this.user,"Invalid tree location");const{node:t,listIndex:n,revealed:i}=this.getTreeNodeWithListIndex(e);t.visible&&i&&this.list.splice(n,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:n,revealed:i}=this.getTreeNodeWithListIndex(e);return n&&i?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const n=this.getTreeNode(e);void 0===t&&(t=!n.collapsible);const i={collapsible:t};return this.eventBufferer.bufferEvents((()=>this._setCollapseState(e,i)))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,n){const i=this.getTreeNode(e);void 0===t&&(t=!i.collapsed);const o={collapsed:t,recursive:n||!1};return this.eventBufferer.bufferEvents((()=>this._setCollapseState(e,o)))}_setCollapseState(e,t){const{node:n,listIndex:i,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(n,i,o,t);if(n!==this.root&&this.autoExpandSingleChildren&&r&&!isCollapsibleStateUpdate(t)&&n.collapsible&&!n.collapsed&&!t.recursive){let i=-1;for(let e=0;e<n.children.length;e++){if(n.children[e].visible){if(i>-1){i=-1;break}i=e}}i>-1&&this._setCollapseState([...e,i],t)}return r}_setListNodeCollapseState(e,t,n,i){const o=this._setNodeCollapseState(e,i,!1);if(!n||!e.visible||!o)return o;const r=e.renderNodeCount,s=this.updateNodeAfterCollapseChange(e),a=r-(-1===t?0:1);return this.list.splice(t+1,a,s.slice(1)),o}_setNodeCollapseState(e,t,n){let i;if(e===this.root?i=!1:(isCollapsibleStateUpdate(t)?(i=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(i=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):i=!1,i&&this._onDidChangeCollapseState.fire({node:e,deep:n})),!isCollapsibleStateUpdate(t)&&t.recursive)for(const o of e.children)i=this._setNodeCollapseState(o,t,!0)||i;return i}expandTo(e){this.eventBufferer.bufferEvents((()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})}))}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,n,i,o,r){const s={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:"boolean"==typeof e.collapsible?e.collapsible:void 0!==e.collapsed,collapsed:void 0===e.collapsed?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},a=this._filterNode(s,n);s.visibility=a,i&&o.push(s);const l=e.children||Iterable.empty(),c=i&&0!==a&&!s.collapsed,d=Iterable.map(l,(e=>this.createTreeNode(e,s,a,c,o,r)));let u=0,h=1;for(const g of d)s.children.push(g),h+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=u++);return s.collapsible=s.collapsible||s.children.length>0,s.visibleChildrenCount=u,s.visible=2===a?u>0:1===a,s.visible?s.collapsed||(s.renderNodeCount=h):(s.renderNodeCount=0,i&&o.pop()),r&&r(s),s}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterCollapseChange(e,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterCollapseChange(e,t){if(!1===e.visible)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const n of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(n,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,n=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,n),this._updateAncestorsRenderNodeCount(e.parent,n.length-t),n}_updateNodeAfterFilterChange(e,t,n,i=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),0===o)return e.visible=!1,e.renderNodeCount=0,!1;i&&n.push(e)}const r=n.length;e.renderNodeCount=e===this.root?0:1;let s=!1;if(e.collapsed&&0===o)e.visibleChildrenCount=0;else{let t=0;for(const r of e.children)s=this._updateNodeAfterFilterChange(r,o,n,i&&!e.collapsed)||s,r.visible&&(r.visibleChildIndex=t++);e.visibleChildrenCount=t}return e!==this.root&&(e.visible=2===o?s:1===o,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=n.length-r):(e.renderNodeCount=0,i&&n.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(0!==t)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const n=this.filter?this.filter.filter(e.element,t):1;return"boolean"==typeof n?(e.filterData=void 0,n?1:0):isFilterResult(n)?(e.filterData=n.data,getVisibleState(n.visibility)):(e.filterData=void 0,getVisibleState(n))}hasTreeNode(e,t=this.root){if(!e||0===e.length)return!0;const[n,...i]=e;return!(n<0||n>t.children.length)&&this.hasTreeNode(i,t.children[n])}getTreeNode(e,t=this.root){if(!e||0===e.length)return t;const[n,...i]=e;if(n<0||n>t.children.length)throw new TreeError(this.user,"Invalid tree location");return this.getTreeNode(i,t.children[n])}getTreeNodeWithListIndex(e){if(0===e.length)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:n,revealed:i,visible:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new TreeError(this.user,"Invalid tree location");const s=t.children[r];return{node:s,listIndex:n,revealed:i,visible:o&&s.visible}}getParentNodeWithListIndex(e,t=this.root,n=0,i=!0,o=!0){const[r,...s]=e;if(r<0||r>t.children.length)throw new TreeError(this.user,"Invalid tree location");for(let a=0;a<r;a++)n+=t.children[a].renderNodeCount;return i=i&&!t.collapsed,o=o&&t.visible,0===s.length?{parentNode:t,listIndex:n,revealed:i,visible:o}:this.getParentNodeWithListIndex(s,t.children[r],n+1,i,o)}getNode(e=[]){return this.getTreeNode(e)}getNodeLocation(e){const t=[];let n=e;for(;n.parent;)t.push(n.parent.children.indexOf(n)),n=n.parent;return t.reverse()}getParentNodeLocation(e){return 0===e.length?void 0:1===e.length?[]:tail2(e)[0]}getFirstElementChild(e){const t=this.getTreeNode(e);if(0!==t.children.length)return t.children[0].element}}var tree="",RenderIndentGuides,RenderIndentGuides2;class TreeElementsDragAndDropData extends ElementsDragAndDropData{constructor(e){super(e.elements.map((e=>e.element))),this.data=e}}function asTreeDragAndDropData(e){return e instanceof ElementsDragAndDropData?new TreeElementsDragAndDropData(e):e}class TreeNodeListDragAndDrop{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=Disposable.None}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map((e=>e.element)),t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(asTreeDragAndDropData(e),t)}onDragOver(e,t,n,i,o=!0){const r=this.dnd.onDragOver(asTreeDragAndDropData(e),t&&t.element,n,i),s=this.autoExpandNode!==t;if(s&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),void 0===t)return r;if(s&&"boolean"!=typeof r&&r.autoExpand&&(this.autoExpandDisposable=disposableTimeout((()=>{const e=this.modelProvider(),n=e.getNodeLocation(t);e.isCollapsed(n)&&e.setCollapsed(n,!1),this.autoExpandNode=void 0}),500)),"boolean"==typeof r||!r.accept||void 0===r.bubble||r.feedback){if(!o){return{accept:"boolean"==typeof r?r:r.accept,effect:"boolean"==typeof r?void 0:r.effect,feedback:[n]}}return r}if(1===r.bubble){const n=this.modelProvider(),o=n.getNodeLocation(t),r=n.getParentNodeLocation(o),s=n.getNode(r),a=r&&n.getListIndex(r);return this.onDragOver(e,s,a,i,!1)}const a=this.modelProvider(),l=a.getNodeLocation(t),c=a.getListIndex(l),d=a.getListRenderCount(l);return Object.assign(Object.assign({},r),{feedback:range(c,c+d)})}drop(e,t,n,i){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(asTreeDragAndDropData(e),t&&t.element,n,i)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function asListOptions(e,t){return t&&Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId:e=>t.identityProvider.getId(e.element)},dnd:t.dnd&&new TreeNodeListDragAndDrop(e,t.dnd),multipleSelectionController:t.multipleSelectionController&&{isSelectionSingleChangeEvent:e=>t.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element})),isSelectionRangeChangeEvent:e=>t.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},accessibilityProvider:t.accessibilityProvider&&Object.assign(Object.assign({},t.accessibilityProvider),{getSetSize(t){const n=e(),i=n.getNodeLocation(t),o=n.getParentNodeLocation(i);return n.getNode(o).visibleChildrenCount},getPosInSet:e=>e.visibleChildIndex+1,isChecked:t.accessibilityProvider&&t.accessibilityProvider.isChecked?e=>t.accessibilityProvider.isChecked(e.element):void 0,getRole:t.accessibilityProvider&&t.accessibilityProvider.getRole?e=>t.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel:e=>t.accessibilityProvider.getAriaLabel(e.element),getWidgetAriaLabel:()=>t.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:t.accessibilityProvider&&t.accessibilityProvider.getWidgetRole?()=>t.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:t.accessibilityProvider&&t.accessibilityProvider.getAriaLevel?e=>t.accessibilityProvider.getAriaLevel(e.element):e=>e.depth,getActiveDescendantId:t.accessibilityProvider.getActiveDescendantId&&(e=>t.accessibilityProvider.getActiveDescendantId(e.element))}),keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:e=>t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}),enableKeyboardNavigation:t.simpleKeyboardNavigation})}class ComposedTreeDelegate{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight&&this.delegate.setDynamicHeight(e.element,t)}}RenderIndentGuides2=RenderIndentGuides||(RenderIndentGuides={}),RenderIndentGuides2.None="none",RenderIndentGuides2.OnHover="onHover",RenderIndentGuides2.Always="always";class EventCollection{constructor(e,t=[]){this._elements=t,this.onDidChange=Event$1.forEach(e,(e=>this._elements=e))}get elements(){return this._elements}}class TreeRenderer{constructor(e,t,n,i,o={}){this.renderer=e,this.modelProvider=t,this.activeNodes=i,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=TreeRenderer.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.renderedIndentGuides=new SetMap,this.activeIndentNodes=new Set,this.indentGuidesDisposable=Disposable.None,this.disposables=new DisposableStore,this.templateId=e.templateId,this.updateOptions(o),Event$1.map(n,(e=>e.node))(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState&&e.onDidChangeTwistieState(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(void 0!==e.indent&&(this.indent=clamp(e.indent,0,40)),void 0!==e.renderIndentGuides){const t=e.renderIndentGuides!==RenderIndentGuides.None;if(t!==this.shouldRenderIndentGuides&&(this.shouldRenderIndentGuides=t,this.indentGuidesDisposable.dispose(),t)){const e=new DisposableStore;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}void 0!==e.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=append$1(e,$$c(".monaco-tl-row")),n=append$1(t,$$c(".monaco-tl-indent")),i=append$1(t,$$c(".monaco-tl-twistie")),o=append$1(t,$$c(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:n,twistie:i,indentGuidesDisposable:Disposable.None,templateData:r}}renderElement(e,t,n,i){"number"==typeof i&&(this.renderedNodes.set(e,{templateData:n,height:i}),this.renderedElements.set(e.element,e));const o=TreeRenderer.DefaultIndent+(e.depth-1)*this.indent;n.twistie.style.paddingLeft=`${o}px`,n.indent.style.width=o+this.indent-16+"px",this.renderTwistie(e,n),"number"==typeof i&&this.renderIndentGuides(e,n),this.renderer.renderElement(e,t,n.templateData,i)}disposeElement(e,t,n,i){n.indentGuidesDisposable.dispose(),this.renderer.disposeElement&&this.renderer.disposeElement(e,t,n.templateData,i),"number"==typeof i&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this.renderTwistie(e,t.templateData),this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderIndentGuides(e,t.templateData))}renderTwistie(e,t){t.twistie.classList.remove(...Codicon.treeItemExpanded.classNamesArray);let n=!1;this.renderer.renderTwistie&&(n=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(n||t.twistie.classList.add(...Codicon.treeItemExpanded.classNamesArray),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded")}renderIndentGuides(e,t){if(clearNode(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const n=new DisposableStore,i=this.modelProvider();let o=e;for(;;){const e=i.getNodeLocation(o),r=i.getParentNodeLocation(e);if(!r)break;const s=i.getNode(r),a=$$c(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(s)&&a.classList.add("active"),0===t.indent.childElementCount?t.indent.appendChild(a):t.indent.insertBefore(a,t.indent.firstElementChild),this.renderedIndentGuides.add(s,a),n.add(toDisposable((()=>this.renderedIndentGuides.delete(s,a)))),o=s}t.indentGuidesDisposable=n}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,n=this.modelProvider();e.forEach((e=>{const i=n.getNodeLocation(e);try{const o=n.getParentNodeLocation(i);e.collapsible&&e.children.length>0&&!e.collapsed?t.add(e):o&&t.add(n.getNode(o))}catch(o){}})),this.activeIndentNodes.forEach((e=>{t.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.remove("active")))})),t.forEach((e=>{this.activeIndentNodes.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.add("active")))})),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),dispose(this.disposables)}}TreeRenderer.DefaultIndent=8;class TypeFilter{constructor(e,t,n){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=n,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new DisposableStore,e.onWillRefilter(this.reset,this,this.disposables)}get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set pattern(e){this._pattern=e,this._lowercasePattern=e.toLowerCase()}filter(e,t){if(this._filter){const n=this._filter.filter(e,t);if(this.tree.options.simpleKeyboardNavigation)return n;let i;if(i="boolean"==typeof n?n?1:0:isFilterResult(n)?getVisibleState(n.visibility):n,0===i)return!1}if(this._totalCount++,this.tree.options.simpleKeyboardNavigation||!this._pattern)return this._matchCount++,{data:FuzzyScore.Default,visibility:!0};const n=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),i=Array.isArray(n)?n:[n];for(const o of i){const e=o&&o.toString();if(void 0===e)return{data:FuzzyScore.Default,visibility:!0};const t=fuzzyScore(this._pattern,this._lowercasePattern,0,e,e.toLowerCase(),0,!0);if(t)return this._matchCount++,1===i.length?{data:t,visibility:!0}:{data:{label:e,score:t},visibility:!0}}return this.tree.options.filterOnType?2:{data:FuzzyScore.Default,visibility:!0}}reset(){this._totalCount=0,this._matchCount=0}dispose(){dispose(this.disposables)}}class TypeFilterController{constructor(e,t,n,i,o){this.tree=e,this.view=n,this.filter=i,this.keyboardNavigationDelegate=o,this._enabled=!1,this._pattern="",this._empty=!1,this._onDidChangeEmptyState=new Emitter$1,this.positionClassName="ne",this.automaticKeyboardNavigation=!0,this.triggered=!1,this._onDidChangePattern=new Emitter$1,this.enabledDisposables=new DisposableStore,this.disposables=new DisposableStore,this.domNode=$$c(`.monaco-list-type-filter.${this.positionClassName}`),this.domNode.draggable=!0,this.disposables.add(addDisposableListener(this.domNode,"dragstart",(()=>this.onDragStart()))),this.messageDomNode=append$1(n.getHTMLElement(),$$c(".monaco-list-type-filter-message")),this.labelDomNode=append$1(this.domNode,$$c("span.label"));const r=append$1(this.domNode,$$c(".controls"));this._filterOnType=!!e.options.filterOnType,this.filterOnTypeDomNode=append$1(r,$$c("input.filter")),this.filterOnTypeDomNode.type="checkbox",this.filterOnTypeDomNode.checked=this._filterOnType,this.filterOnTypeDomNode.tabIndex=-1,this.updateFilterOnTypeTitleAndIcon(),this.disposables.add(addDisposableListener(this.filterOnTypeDomNode,"input",(()=>this.onDidChangeFilterOnType()))),this.clearDomNode=append$1(r,$$c("button.clear"+Codicon.treeFilterClear.cssSelector)),this.clearDomNode.tabIndex=-1,this.clearDomNode.title=localize("clear","Clear"),this.keyboardNavigationEventFilter=e.options.keyboardNavigationEventFilter,t.onDidSplice(this.onDidSpliceModel,this,this.disposables),this.updateOptions(e.options)}get enabled(){return this._enabled}get pattern(){return this._pattern}get filterOnType(){return this._filterOnType}updateOptions(e){e.simpleKeyboardNavigation?this.disable():this.enable(),void 0!==e.filterOnType&&(this._filterOnType=!!e.filterOnType,this.filterOnTypeDomNode.checked=this._filterOnType,this.updateFilterOnTypeTitleAndIcon()),void 0!==e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation),this.tree.refilter(),this.render(),this.automaticKeyboardNavigation||this.onEventOrInput("")}enable(){if(this._enabled)return;const e=this.enabledDisposables.add(new DomEmitter(this.view.getHTMLElement(),"keydown")),t=Event$1.chain(e.event).filter((e=>!isInputElement(e.target)||e.target===this.filterOnTypeDomNode)).filter((e=>"Dead"!==e.key&&!/^Media/.test(e.key))).map((e=>new StandardKeyboardEvent(e))).filter(this.keyboardNavigationEventFilter||(()=>!0)).filter((()=>this.automaticKeyboardNavigation||this.triggered)).filter((e=>this.keyboardNavigationDelegate.mightProducePrintableCharacter(e)&&!(18===e.keyCode||16===e.keyCode||15===e.keyCode||17===e.keyCode)||(this.pattern.length>0||this.triggered)&&(9===e.keyCode||1===e.keyCode)&&!e.altKey&&!e.ctrlKey&&!e.metaKey||1===e.keyCode&&(isMacintosh?e.altKey&&!e.metaKey:e.ctrlKey)&&!e.shiftKey)).forEach((e=>{e.stopPropagation(),e.preventDefault()})).event,n=this.enabledDisposables.add(new DomEmitter(this.clearDomNode,"click"));Event$1.chain(Event$1.any(t,n.event)).event(this.onEventOrInput,this,this.enabledDisposables),this.filter.pattern="",this.tree.refilter(),this.render(),this._enabled=!0,this.triggered=!1}disable(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.clear(),this.tree.refilter(),this.render(),this._enabled=!1,this.triggered=!1)}onEventOrInput(e){"string"==typeof e?this.onInput(e):e instanceof MouseEvent||9===e.keyCode||1===e.keyCode&&(isMacintosh?e.altKey:e.ctrlKey)?this.onInput(""):1===e.keyCode?this.onInput(0===this.pattern.length?"":this.pattern.substr(0,this.pattern.length-1)):this.onInput(this.pattern+e.browserEvent.key)}onInput(e){const t=this.view.getHTMLElement();e&&!this.domNode.parentElement?t.append(this.domNode):!e&&this.domNode.parentElement&&(this.domNode.remove(),this.tree.domFocus()),this._pattern=e,this._onDidChangePattern.fire(e),this.filter.pattern=e,this.tree.refilter(),e&&this.tree.focusNext(0,!0,void 0,(e=>!FuzzyScore.isDefault(e.filterData)));const n=this.tree.getFocus();if(n.length>0){const e=n[0];null===this.tree.getRelativeTop(e)&&this.tree.reveal(e,.5)}this.render(),e||(this.triggered=!1)}onDragStart(){const e=this.view.getHTMLElement(),{left:t}=getDomNodePagePosition(e),n=e.clientWidth,i=n/2,o=this.domNode.clientWidth,r=new DisposableStore;let s=this.positionClassName;const a=()=>{switch(s){case"nw":this.domNode.style.top="4px",this.domNode.style.left="4px";break;case"ne":this.domNode.style.top="4px",this.domNode.style.left=n-o-6+"px"}},l=()=>{this.positionClassName=s,this.domNode.className=`monaco-list-type-filter ${this.positionClassName}`,this.domNode.style.top="",this.domNode.style.left="",dispose(r)};a(),this.domNode.classList.remove(s),this.domNode.classList.add("dragging"),r.add(toDisposable((()=>this.domNode.classList.remove("dragging")))),r.add(addDisposableListener(document,"dragover",(e=>(e=>{e.preventDefault();const n=e.clientX-t;e.dataTransfer&&(e.dataTransfer.dropEffect="none"),s=n<i?"nw":"ne",a()})(e)))),r.add(addDisposableListener(this.domNode,"dragend",(()=>l()))),StaticDND.CurrentDragAndDropData=new DragAndDropData("vscode-ui"),r.add(toDisposable((()=>StaticDND.CurrentDragAndDropData=void 0)))}onDidSpliceModel(){this._enabled&&0!==this.pattern.length&&(this.tree.refilter(),this.render())}onDidChangeFilterOnType(){this.tree.updateOptions({filterOnType:this.filterOnTypeDomNode.checked}),this.tree.refilter(),this.tree.domFocus(),this.render(),this.updateFilterOnTypeTitleAndIcon()}updateFilterOnTypeTitleAndIcon(){this.filterOnType?(this.filterOnTypeDomNode.classList.remove(...Codicon.treeFilterOnTypeOff.classNamesArray),this.filterOnTypeDomNode.classList.add(...Codicon.treeFilterOnTypeOn.classNamesArray),this.filterOnTypeDomNode.title=localize("disable filter on type","Disable Filter on Type")):(this.filterOnTypeDomNode.classList.remove(...Codicon.treeFilterOnTypeOn.classNamesArray),this.filterOnTypeDomNode.classList.add(...Codicon.treeFilterOnTypeOff.classNamesArray),this.filterOnTypeDomNode.title=localize("enable filter on type","Enable Filter on Type"))}render(){const e=this.filter.totalCount>0&&0===this.filter.matchCount;this.pattern&&this.tree.options.filterOnType&&e?(this.messageDomNode.textContent=localize("empty","No elements found"),this._empty=!0):(this.messageDomNode.innerText="",this._empty=!1),this.domNode.classList.toggle("no-matches",e),this.domNode.title=localize("found","Matched {0} out of {1} elements",this.filter.matchCount,this.filter.totalCount),this.labelDomNode.textContent=this.pattern.length>16?"…"+this.pattern.substr(this.pattern.length-16):this.pattern,this._onDidChangeEmptyState.fire(this._empty)}shouldAllowFocus(e){return!(this.enabled&&this.pattern&&!this.filterOnType)||(this.filter.totalCount>0&&this.filter.matchCount<=1||!FuzzyScore.isDefault(e.filterData))}dispose(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.dispose(),this._enabled=!1,this.triggered=!1),this._onDidChangePattern.dispose(),dispose(this.disposables)}}function asTreeMouseEvent$1(e){let t=TreeMouseEventTarget.Unknown;return hasParentWithClass(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=TreeMouseEventTarget.Twistie:hasParentWithClass(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")&&(t=TreeMouseEventTarget.Element),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function dfs$1(e,t){t(e),e.children.forEach((e=>dfs$1(e,t)))}class Trait{constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event}get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}set(e,t){!(null==t?void 0:t.__forceEvent)&&equals$1(this.nodes,e)||this._set(e,!1,t)}_set(e,t,n){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const e=this;this._onDidChange.fire({get elements(){return e.get()},browserEvent:n})}}get(){return this.elements||(this.elements=this.nodes.map((e=>e.element))),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const e=this.createNodeSet(),n=t=>e.delete(t);return t.forEach((e=>dfs$1(e,n))),void this.set([...e.values()])}const n=new Set,i=e=>n.add(this.identityProvider.getId(e.element).toString());t.forEach((e=>dfs$1(e,i)));const o=new Map,r=e=>o.set(this.identityProvider.getId(e.element).toString(),e);e.forEach((e=>dfs$1(e,r)));const s=[];for(const a of this.nodes){const e=this.identityProvider.getId(a.element).toString();if(n.has(e)){const t=o.get(e);t&&s.push(t)}else s.push(a)}if(this.nodes.length>0&&0===s.length){const e=this.getFirstViewElementWithTrait();e&&s.push(e)}this._set(s,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class TreeNodeListMouseController extends MouseController{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(isInputElement(e.browserEvent.target)||isMonacoEditor(e.browserEvent.target))return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const n=e.browserEvent.target,i=n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let o=!1;if(o="function"==typeof this.tree.expandOnlyOnTwistieClick?this.tree.expandOnlyOnTwistieClick(t.element):!!this.tree.expandOnlyOnTwistieClick,o&&!i&&2!==e.browserEvent.detail)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&2===e.browserEvent.detail)return super.onViewPointer(e);if(t.collapsible){const n=this.tree.model,r=n.getNodeLocation(t),s=e.browserEvent.altKey;if(this.tree.setFocus([r]),n.setCollapsed(r,void 0,s),o&&i)return}super.onViewPointer(e)}onDoubleClick(e){!e.browserEvent.target.classList.contains("monaco-tl-twistie")&&this.tree.expandOnDoubleClick&&super.onDoubleClick(e)}}class TreeNodeList extends List{constructor(e,t,n,i,o,r,s,a){super(e,t,n,i,a),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=s}createMouseController(e){return new TreeNodeListMouseController(this,e.tree)}splice(e,t,n=[]){if(super.splice(e,t,n),0===n.length)return;const i=[],o=[];let r;n.forEach(((t,n)=>{this.focusTrait.has(t)&&i.push(e+n),this.selectionTrait.has(t)&&o.push(e+n),this.anchorTrait.has(t)&&(r=e+n)})),i.length>0&&super.setFocus(distinct([...super.getFocus(),...i])),o.length>0&&super.setSelection(distinct([...super.getSelection(),...o])),"number"==typeof r&&super.setAnchor(r)}setFocus(e,t,n=!1){super.setFocus(e,t),n||this.focusTrait.set(e.map((e=>this.element(e))),t)}setSelection(e,t,n=!1){super.setSelection(e,t),n||this.selectionTrait.set(e.map((e=>this.element(e))),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(void 0===e?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class AbstractTree{constructor(e,t,n,i,o={}){this._user=e,this._options=o,this.eventBufferer=new EventBufferer,this.disposables=new DisposableStore,this._onWillRefilter=new Emitter$1,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new Emitter$1;const r=new ComposedTreeDelegate(n),s=new Relay,a=new Relay,l=new EventCollection(a.event);this.renderers=i.map((e=>new TreeRenderer(e,(()=>this.model),s.event,l,o)));for(let u of this.renderers)this.disposables.add(u);let c;o.keyboardNavigationLabelProvider&&(c=new TypeFilter(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:c}),this.disposables.add(c)),this.focus=new Trait((()=>this.view.getFocusedElements()[0]),o.identityProvider),this.selection=new Trait((()=>this.view.getSelectedElements()[0]),o.identityProvider),this.anchor=new Trait((()=>this.view.getAnchorElement()),o.identityProvider),this.view=new TreeNodeList(e,t,r,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},asListOptions((()=>this.model),o)),{tree:this})),this.model=this.createModel(e,this.view,o),s.input=this.model.onDidChangeCollapseState;const d=Event$1.forEach(this.model.onDidSplice,(e=>{this.eventBufferer.bufferEvents((()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)}))}));if(d((()=>null),null,this.disposables),a.input=Event$1.chain(Event$1.any(d,this.focus.onDidChange,this.selection.onDidChange)).debounce((()=>null),0).map((()=>{const e=new Set;for(const t of this.focus.getNodes())e.add(t);for(const t of this.selection.getNodes())e.add(t);return[...e.values()]})).event,!1!==o.keyboardSupport){const e=Event$1.chain(this.view.onKeyDown).filter((e=>!isInputElement(e.target))).map((e=>new StandardKeyboardEvent(e)));e.filter((e=>15===e.keyCode)).on(this.onLeftArrow,this,this.disposables),e.filter((e=>17===e.keyCode)).on(this.onRightArrow,this,this.disposables),e.filter((e=>10===e.keyCode)).on(this.onSpace,this,this.disposables)}if(o.keyboardNavigationLabelProvider){const e=o.keyboardNavigationDelegate||DefaultKeyboardNavigationDelegate;this.typeFilterController=new TypeFilterController(this,this.model,this.view,c,e),this.focusNavigationFilter=e=>this.typeFilterController.shouldAllowFocus(e),this.disposables.add(this.typeFilterController)}this.styleElement=createStyleSheet(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===RenderIndentGuides.Always)}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return Event$1.map(this.view.onMouseDblClick,asTreeMouseEvent$1)}get onPointer(){return Event$1.map(this.view.onPointer,asTreeMouseEvent$1)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return Event$1.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get expandOnDoubleClick(){return void 0===this._options.expandOnDoubleClick||this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return void 0===this._options.expandOnlyOnTwistieClick||this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}updateOptions(e={}){this._options=Object.assign(Object.assign({},this._options),e);for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(Object.assign(Object.assign({},this._options),{enableKeyboardNavigation:this._options.simpleKeyboardNavigation})),this.typeFilterController&&this.typeFilterController.updateOptions(this._options),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===RenderIndentGuides.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}domFocus(){this.view.domFocus()}layout(e,t){this.view.layout(e,t)}style(e){const t=`.${this.view.domId}`,n=[];e.treeIndentGuidesStroke&&(n.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeIndentGuidesStroke.transparent(.4)}; }`),n.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=n.join("\n"),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const n=e.map((e=>this.model.getNode(e)));this.selection.set(n,t);const i=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setSelection(i,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const n=e.map((e=>this.model.getNode(e)));this.focus.set(n,t);const i=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setFocus(i,t,!0)}focusNext(e=1,t=!1,n,i=this.focusNavigationFilter){this.view.focusNext(e,t,n,i)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const n=this.model.getListIndex(e);-1!==n&&this.view.reveal(n,t)}getRelativeTop(e){const t=this.model.getListIndex(e);return-1===t?null:this.view.getRelativeTop(t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const n=t[0],i=this.model.getNodeLocation(n);if(!this.model.setCollapsed(i,!0)){const e=this.model.getParentNodeLocation(i);if(!e)return;const t=this.model.getListIndex(e);this.view.reveal(t),this.view.setFocus([t])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const n=t[0],i=this.model.getNodeLocation(n);if(!this.model.setCollapsed(i,!1)){if(!n.children.some((e=>e.visible)))return;const[e]=this.view.getFocus(),t=e+1;this.view.reveal(t),this.view.setFocus([t])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const n=t[0],i=this.model.getNodeLocation(n),o=e.browserEvent.altKey;this.model.setCollapsed(i,void 0,o)}dispose(){dispose(this.disposables),this.view.dispose()}}class ObjectTreeModel{constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new IndexTreeModel(e,t,null,n),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,n.sorter&&(this.sorter={compare:(e,t)=>n.sorter.compare(e.element,t.element)}),this.identityProvider=n.identityProvider}setChildren(e,t=Iterable.empty(),n={}){const i=this.getElementLocation(e);this._setChildren(i,this.preserveCollapseState(t),n)}_setChildren(e,t=Iterable.empty(),n){const i=new Set,o=new Set;this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},n),{onDidCreateNode:e=>{var t;if(null===e.element)return;const r=e;if(i.add(r.element),this.nodes.set(r.element,r),this.identityProvider){const e=this.identityProvider.getId(r.element).toString();o.add(e),this.nodesByIdentity.set(e,r)}null===(t=n.onDidCreateNode)||void 0===t||t.call(n,r)},onDidDeleteNode:e=>{var t;if(null===e.element)return;const r=e;if(i.has(r.element)||this.nodes.delete(r.element),this.identityProvider){const e=this.identityProvider.getId(r.element).toString();o.has(e)||this.nodesByIdentity.delete(e)}null===(t=n.onDidDeleteNode)||void 0===t||t.call(n,r)}}))}preserveCollapseState(e=Iterable.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),Iterable.map(e,(e=>{let t=this.nodes.get(e.element);if(!t&&this.identityProvider){const n=this.identityProvider.getId(e.element).toString();t=this.nodesByIdentity.get(n)}if(!t)return Object.assign(Object.assign({},e),{children:this.preserveCollapseState(e.children)});const n="boolean"==typeof e.collapsible?e.collapsible:t.collapsible,i=void 0!==e.collapsed?e.collapsed:t.collapsed;return Object.assign(Object.assign({},e),{collapsible:n,collapsed:i,children:this.preserveCollapseState(e.children)})}))}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const n=this.getElementLocation(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const i=this.getElementLocation(e);return this.model.setCollapsed(i,t,n)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(null===e)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new TreeError(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(null===e)throw new TreeError(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new TreeError(this.user,`Tree element not found: ${e}`);const n=this.model.getNodeLocation(t),i=this.model.getParentNodeLocation(n);return this.model.getNode(i).element}getElementLocation(e){if(null===e)return[];const t=this.nodes.get(e);if(!t)throw new TreeError(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function noCompress(e){return{element:{elements:[e.element],incompressible:e.incompressible||!1},children:Iterable.map(Iterable.from(e.children),noCompress),collapsible:e.collapsible,collapsed:e.collapsed}}function compress(e){const t=[e.element],n=e.incompressible||!1;let i,o;for(;[o,i]=Iterable.consume(Iterable.from(e.children),2),1===o.length&&!o[0].incompressible;)e=o[0],t.push(e.element);return{element:{elements:t,incompressible:n},children:Iterable.map(Iterable.concat(o,i),compress),collapsible:e.collapsible,collapsed:e.collapsed}}function _decompress(e,t=0){let n;return n=t<e.element.elements.length-1?[_decompress(e,t+1)]:Iterable.map(Iterable.from(e.children),(e=>_decompress(e,0))),0===t&&e.element.incompressible?{element:e.element.elements[t],children:n,incompressible:!0,collapsible:e.collapsible,collapsed:e.collapsed}:{element:e.element.elements[t],children:n,collapsible:e.collapsible,collapsed:e.collapsed}}function decompress(e){return _decompress(e,0)}function splice(e,t,n){return e.element===t?Object.assign(Object.assign({},e),{children:n}):Object.assign(Object.assign({},e),{children:Iterable.map(Iterable.from(e.children),(e=>splice(e,t,n)))})}const wrapIdentityProvider=e=>({getId:t=>t.elements.map((t=>e.getId(t).toString())).join("\0")});class CompressedObjectTreeModel{constructor(e,t,n={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new ObjectTreeModel(e,t,n),this.enabled=void 0===n.compressionEnabled||n.compressionEnabled,this.identityProvider=n.identityProvider}get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}setChildren(e,t=Iterable.empty(),n){const i=n.diffIdentityProvider&&wrapIdentityProvider(n.diffIdentityProvider);if(null===e){const e=Iterable.map(t,this.enabled?compress:noCompress);return void this._setChildren(null,e,{diffIdentityProvider:i,diffDepth:Infinity})}const o=this.nodes.get(e);if(!o)throw new Error("Unknown compressed tree node");const r=this.model.getNode(o),s=this.model.getParentNodeLocation(o),a=this.model.getNode(s),l=splice(decompress(r),e,t),c=(this.enabled?compress:noCompress)(l),d=a.children.map((e=>e===r?c:e));this._setChildren(a.element,d,{diffIdentityProvider:i,diffDepth:r.depth-a.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const t=this.model.getNode().children,n=Iterable.map(t,decompress),i=Iterable.map(n,e?compress:noCompress);this._setChildren(null,i,{diffIdentityProvider:this.identityProvider,diffDepth:Infinity})}_setChildren(e,t,n){const i=new Set;this.model.setChildren(e,t,Object.assign(Object.assign({},n),{onDidCreateNode:e=>{for(const t of e.element.elements)i.add(t),this.nodes.set(t,e.element)},onDidDeleteNode:e=>{for(const t of e.element.elements)i.has(t)||this.nodes.delete(t)}}))}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(void 0===e)return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return null===t?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),n=this.model.getParentNodeLocation(t);return null===n?null:n.elements[n.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const n=this.getCompressedNode(e);return this.model.setCollapsible(n,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,n){const i=this.getCompressedNode(e);return this.model.setCollapsed(i,t,n)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(null===e)return null;const t=this.nodes.get(e);if(!t)throw new TreeError(this.user,`Tree element not found: ${e}`);return t}}const DefaultElementMapper=e=>e[e.length-1];class CompressedTreeNodeWrapper{constructor(e,t){this.unwrapper=e,this.node=t}get element(){return null===this.node.element?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map((e=>new CompressedTreeNodeWrapper(this.unwrapper,e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}function mapList(e,t){return{splice(n,i,o){t.splice(n,i,o.map((t=>e.map(t))))},updateElementHeight(e,n){t.updateElementHeight(e,n)}}}function mapOptions(e,t){return Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId:n=>t.identityProvider.getId(e(n))},sorter:t.sorter&&{compare:(e,n)=>t.sorter.compare(e.elements[0],n.elements[0])},filter:t.filter&&{filter:(n,i)=>t.filter.filter(e(n),i)}})}class CompressibleObjectTreeModel{constructor(e,t,n={}){this.rootRef=null,this.elementMapper=n.elementMapper||DefaultElementMapper;const i=e=>this.elementMapper(e.elements);this.nodeMapper=new WeakMapper((e=>new CompressedTreeNodeWrapper(i,e))),this.model=new CompressedObjectTreeModel(e,mapList(this.nodeMapper,t),mapOptions(i,n))}get onDidSplice(){return Event$1.map(this.model.onDidSplice,(({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map((e=>this.nodeMapper.map(e))),deletedNodes:t.map((e=>this.nodeMapper.map(e)))})))}get onDidChangeCollapseState(){return Event$1.map(this.model.onDidChangeCollapseState,(({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t})))}get onDidChangeRenderNodeCount(){return Event$1.map(this.model.onDidChangeRenderNodeCount,(e=>this.nodeMapper.map(e)))}setChildren(e,t=Iterable.empty(),n={}){this.model.setChildren(e,t,n)}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return null==t?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,n){return this.model.setCollapsed(e,t,n)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var __decorate$1b=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};class ObjectTree extends AbstractTree{constructor(e,t,n,i,o={}){super(e,t,n,i,o),this.user=e}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}setChildren(e,t=Iterable.empty(),n){this.model.setChildren(e,t,n)}rerender(e){void 0!==e?this.model.rerender(e):this.view.rerender()}hasElement(e){return this.model.has(e)}createModel(e,t,n){return new ObjectTreeModel(e,t,n)}}class CompressibleRenderer{constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,n,i){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);1===o.element.elements.length?(n.compressedTreeNode=void 0,this.renderer.renderElement(e,t,n.data,i)):(n.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,n.data,i))}disposeElement(e,t,n,i){n.compressedTreeNode?this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(n.compressedTreeNode,t,n.data,i):this.renderer.disposeElement&&this.renderer.disposeElement(e,t,n.data,i)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return!!this.renderer.renderTwistie&&this.renderer.renderTwistie(e,t)}}function asObjectTreeOptions$1(e,t){return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(n){let i;try{i=e().getCompressedTreeNode(n)}catch(o){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(n)}return 1===i.element.elements.length?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(n):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(i.element.elements)}}})}__decorate$1b([memoize],CompressibleRenderer.prototype,"compressedTreeNodeProvider",null);class CompressibleObjectTree extends ObjectTree{constructor(e,t,n,i,o={}){const r=()=>this;super(e,t,n,i.map((e=>new CompressibleRenderer(r,e))),asObjectTreeOptions$1(r,o))}setChildren(e,t=Iterable.empty(),n){this.model.setChildren(e,t,n)}createModel(e,t,n){return new CompressibleObjectTreeModel(e,t,n)}updateOptions(e={}){super.updateOptions(e),void 0!==e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var __awaiter$O=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};function createAsyncDataTreeNode(e){return Object.assign(Object.assign({},e),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function isAncestor(e,t){return!!t.parent&&(t.parent===e||isAncestor(e,t.parent))}function intersects(e,t){return e===t||isAncestor(e,t)||isAncestor(t,e)}class AsyncDataTreeNodeWrapper{constructor(e){this.node=e}get element(){return this.node.element.element}get children(){return this.node.children.map((e=>new AsyncDataTreeNodeWrapper(e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}class AsyncDataTreeRenderer{constructor(e,t,n){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,i){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,i)}renderTwistie(e,t){return e.slow?(t.classList.add(...Codicon.treeItemLoading.classNamesArray),!0):(t.classList.remove(...Codicon.treeItemLoading.classNamesArray),!1)}disposeElement(e,t,n,i){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,n.templateData,i)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function asTreeEvent(e){return{browserEvent:e.browserEvent,elements:e.elements.map((e=>e.element))}}function asTreeMouseEvent(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class AsyncDataTreeElementsDragAndDropData extends ElementsDragAndDropData{constructor(e){super(e.elements.map((e=>e.element))),this.data=e}}function asAsyncDataTreeDragAndDropData(e){return e instanceof ElementsDragAndDropData?new AsyncDataTreeElementsDragAndDropData(e):e}class AsyncDataTreeNodeListDragAndDrop{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map((e=>e.element)),t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(asAsyncDataTreeDragAndDropData(e),t)}onDragOver(e,t,n,i,o=!0){return this.dnd.onDragOver(asAsyncDataTreeDragAndDropData(e),t&&t.element,n,i)}drop(e,t,n,i){this.dnd.drop(asAsyncDataTreeDragAndDropData(e),t&&t.element,n,i)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function asObjectTreeOptions(e){return e&&Object.assign(Object.assign({},e),{collapseByDefault:!0,identityProvider:e.identityProvider&&{getId:t=>e.identityProvider.getId(t.element)},dnd:e.dnd&&new AsyncDataTreeNodeListDragAndDrop(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent:t=>e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element})),isSelectionRangeChangeEvent:t=>e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",isChecked:e.accessibilityProvider.isChecked?t=>{var n;return!!(null===(n=e.accessibilityProvider)||void 0===n?void 0:n.isChecked(t.element))}:void 0,getAriaLabel:t=>e.accessibilityProvider.getAriaLabel(t.element),getWidgetAriaLabel:()=>e.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider.getAriaLevel&&(t=>e.accessibilityProvider.getAriaLevel(t.element)),getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),filter:e.filter&&{filter:(t,n)=>e.filter.filter(t.element,n)},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}),sorter:void 0,expandOnlyOnTwistieClick:void 0===e.expandOnlyOnTwistieClick?void 0:"function"!=typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),additionalScrollHeight:e.additionalScrollHeight})}function dfs(e,t){t(e),e.children.forEach((e=>dfs(e,t)))}class AsyncDataTree{constructor(e,t,n,i,o,r={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new Emitter$1,this._onDidChangeNodeSlowState=new Emitter$1,this.nodeMapper=new WeakMapper((e=>new AsyncDataTreeNodeWrapper(e))),this.disposables=new DisposableStore,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=void 0!==r.autoExpandSingleChildren&&r.autoExpandSingleChildren,this.sorter=r.sorter,this.collapseByDefault=r.collapseByDefault,this.tree=this.createTree(e,t,n,i,r),this.root=createAsyncDataTreeNode({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}get onDidChangeFocus(){return Event$1.map(this.tree.onDidChangeFocus,asTreeEvent)}get onDidChangeSelection(){return Event$1.map(this.tree.onDidChangeSelection,asTreeEvent)}get onMouseDblClick(){return Event$1.map(this.tree.onMouseDblClick,asTreeMouseEvent)}get onPointer(){return Event$1.map(this.tree.onPointer,asTreeMouseEvent)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidDispose(){return this.tree.onDidDispose}createTree(e,t,n,i,o){const r=new ComposedTreeDelegate(n),s=i.map((e=>new AsyncDataTreeRenderer(e,this.nodeMapper,this._onDidChangeNodeSlowState.event))),a=asObjectTreeOptions(o)||{};return new ObjectTree(e,t,r,s,a)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return __awaiter$O(this,void 0,void 0,(function*(){this.refreshPromises.forEach((e=>e.cancel())),this.refreshPromises.clear(),this.root.element=e;const n=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,n),n&&(this.tree.setFocus(n.focus),this.tree.setSelection(n.selection)),t&&"number"==typeof t.scrollTop&&(this.scrollTop=t.scrollTop)}))}_updateChildren(e=this.root.element,t=!0,n=!1,i,o){return __awaiter$O(this,void 0,void 0,(function*(){if(void 0===this.root.element)throw new TreeError(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield Event$1.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(yield this.refreshAndRenderNode(r,t,i,o),n)try{this.tree.rerender(r)}catch(s){}}))}rerender(e){if(void 0===e||e===this.root.element)return void this.tree.rerender();const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),n=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(n)}collapse(e,t=!1){const n=this.getDataNode(e);return this.tree.collapse(n===this.root?null:n,t)}expand(e,t=!1){return __awaiter$O(this,void 0,void 0,(function*(){if(void 0===this.root.element)throw new TreeError(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield Event$1.toPromise(this._onDidRender.event));const n=this.getDataNode(e);if(this.tree.hasElement(n)&&!this.tree.isCollapsible(n))return!1;if(n.refreshPromise&&(yield this.root.refreshPromise,yield Event$1.toPromise(this._onDidRender.event)),n!==this.root&&!n.refreshPromise&&!this.tree.isCollapsed(n))return!1;const i=this.tree.expand(n===this.root?null:n,t);return n.refreshPromise&&(yield this.root.refreshPromise,yield Event$1.toPromise(this._onDidRender.event)),i}))}setSelection(e,t){const n=e.map((e=>this.getDataNode(e)));this.tree.setSelection(n,t)}getSelection(){return this.tree.getSelection().map((e=>e.element))}setFocus(e,t){const n=e.map((e=>this.getDataNode(e)));this.tree.setFocus(n,t)}getFocus(){return this.tree.getFocus().map((e=>e.element))}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),n=this.tree.getFirstElementChild(t===this.root?null:t);return n&&n.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new TreeError(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,n,i){return __awaiter$O(this,void 0,void 0,(function*(){yield this.refreshNode(e,t,n),this.render(e,n,i)}))}refreshNode(e,t,n){return __awaiter$O(this,void 0,void 0,(function*(){let i;return this.subTreeRefreshPromises.forEach(((o,r)=>{!i&&intersects(r,e)&&(i=o.then((()=>this.refreshNode(e,t,n))))})),i||this.doRefreshSubTree(e,t,n)}))}doRefreshSubTree(e,t,n){return __awaiter$O(this,void 0,void 0,(function*(){let i;e.refreshPromise=new Promise((e=>i=e)),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally((()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)}));try{const o=yield this.doRefreshNode(e,t,n);e.stale=!1,yield Promises.settled(o.map((e=>this.doRefreshSubTree(e,t,n))))}finally{i()}}))}doRefreshNode(e,t,n){return __awaiter$O(this,void 0,void 0,(function*(){let i;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){const t=this.doGetChildren(e);if(isIterable(t))i=Promise.resolve(t);else{const n=timeout(800);n.then((()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)}),(e=>null)),i=t.finally((()=>n.cancel()))}}else i=Promise.resolve(Iterable.empty());try{const o=yield i;return this.setChildren(e,o,t,n)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),isCancellationError(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}))}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const n=this.dataSource.getChildren(e.element);return isIterable(n)?this.processChildren(n):(t=createCancelablePromise((()=>__awaiter$O(this,void 0,void 0,(function*(){return this.processChildren(yield n)})))),this.refreshPromises.set(e,t),t.finally((()=>{this.refreshPromises.delete(e)})))}_onDidChangeCollapseState({node:e,deep:t}){null!==e.element&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(onUnexpectedError))}setChildren(e,t,n,i){const o=[...t];if(0===e.children.length&&0===o.length)return[];const r=new Map,s=new Map;for(const c of e.children)if(r.set(c.element,c),this.identityProvider){const e=this.tree.isCollapsed(c);s.set(c.id,{node:c,collapsed:e})}const a=[],l=o.map((t=>{const o=!!this.dataSource.hasChildren(t);if(!this.identityProvider){const n=createAsyncDataTreeNode({element:t,parent:e,hasChildren:o});return o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(n.collapsedByDefault=!1,a.push(n)),n}const l=this.identityProvider.getId(t).toString(),c=s.get(l);if(c){const e=c.node;return r.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=o,n?c.collapsed?(e.children.forEach((e=>dfs(e,(e=>this.nodes.delete(e.element))))),e.children.splice(0,e.children.length),e.stale=!0):a.push(e):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(e.collapsedByDefault=!1,a.push(e)),e}const d=createAsyncDataTreeNode({element:t,parent:e,id:l,hasChildren:o});return i&&i.viewState.focus&&i.viewState.focus.indexOf(l)>-1&&i.focus.push(d),i&&i.viewState.selection&&i.viewState.selection.indexOf(l)>-1&&i.selection.push(d),i&&i.viewState.expanded&&i.viewState.expanded.indexOf(l)>-1?a.push(d):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(d.collapsedByDefault=!1,a.push(d)),d}));for(const c of r.values())dfs(c,(e=>this.nodes.delete(e.element)));for(const c of l)this.nodes.set(c.element,c);return e.children.splice(0,e.children.length,...l),e!==this.root&&this.autoExpandSingleChildren&&1===l.length&&0===a.length&&(l[0].collapsedByDefault=!1,a.push(l[0])),a}render(e,t,n){const i=e.children.map((e=>this.asTreeElement(e,t))),o=n&&Object.assign(Object.assign({},n),{diffIdentityProvider:n.diffIdentityProvider&&{getId:e=>n.diffIdentityProvider.getId(e.element)}});this.tree.setChildren(e===this.root?null:e,i,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let n;return n=!(t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1)&&e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?Iterable.map(e.children,(e=>this.asTreeElement(e,t))):[],collapsible:e.hasChildren,collapsed:n}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose()}}class CompressibleAsyncDataTreeNodeWrapper{constructor(e){this.node=e}get element(){return{elements:this.node.element.elements.map((e=>e.element)),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map((e=>new CompressibleAsyncDataTreeNodeWrapper(e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}class CompressibleAsyncDataTreeRenderer{constructor(e,t,n,i){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=n,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,n,i){this.renderer.renderElement(this.nodeMapper.map(e),t,n.templateData,i)}renderCompressedElements(e,t,n,i){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,n.templateData,i)}renderTwistie(e,t){return e.slow?(t.classList.add(...Codicon.treeItemLoading.classNamesArray),!0):(t.classList.remove(...Codicon.treeItemLoading.classNamesArray),!1)}disposeElement(e,t,n,i){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,n.templateData,i)}disposeCompressedElements(e,t,n,i){this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(this.compressibleNodeMapperProvider().map(e),t,n.templateData,i)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=dispose(this.disposables)}}function asCompressibleObjectTreeOptions(e){const t=e&&asObjectTreeOptions(e);return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map((e=>e.element)))})})}class CompressibleAsyncDataTree extends AsyncDataTree{constructor(e,t,n,i,o,r,s={}){super(e,t,n,o,r,s),this.compressionDelegate=i,this.compressibleNodeMapper=new WeakMapper((e=>new CompressibleAsyncDataTreeNodeWrapper(e))),this.filter=s.filter}createTree(e,t,n,i,o){const r=new ComposedTreeDelegate(n),s=i.map((e=>new CompressibleAsyncDataTreeRenderer(e,this.nodeMapper,(()=>this.compressibleNodeMapper),this._onDidChangeNodeSlowState.event))),a=asCompressibleObjectTreeOptions(o)||{};return new CompressibleObjectTree(e,t,r,s,a)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const n=e=>this.identityProvider.getId(e).toString(),i=e=>{const t=new Set;for(const i of e){const e=this.tree.getCompressedTreeNode(i===this.root?null:i);if(e.element)for(const i of e.element.elements)t.add(n(i.element))}return t},o=i(this.tree.getSelection()),r=i(this.tree.getFocus());super.render(e,t);const s=this.getSelection();let a=!1;const l=this.getFocus();let c=!1;const d=e=>{const t=e.element;if(t)for(let i=0;i<t.elements.length;i++){const e=n(t.elements[i].element),d=t.elements[t.elements.length-1].element;o.has(e)&&-1===s.indexOf(d)&&(s.push(d),a=!0),r.has(e)&&-1===l.indexOf(d)&&(l.push(d),c=!0)}e.children.forEach(d)};d(this.tree.getCompressedTreeNode(e===this.root?null:e)),a&&this.setSelection(s),c&&this.setFocus(l)}processChildren(e){return this.filter&&(e=Iterable.filter(e,(e=>{const t=getVisibility(this.filter.filter(e,1));if(2===t)throw new Error("Recursive tree visibility not supported in async data compressed trees");return 1===t}))),super.processChildren(e)}}function getVisibility(e){return"boolean"==typeof e?e?1:0:isFilterResult(e)?getVisibleState(e.visibility):getVisibleState(e)}class DataTree extends AbstractTree{constructor(e,t,n,i,o,r={}){super(e,t,n,i,r),this.user=e,this.dataSource=o,this.identityProvider=r.identityProvider}createModel(e,t,n){return new ObjectTreeModel(e,t,n)}}new RawContextKey("isMac",isMacintosh,localize("isMac","Whether the operating system is macOS")),new RawContextKey("isLinux",isLinux,localize("isLinux","Whether the operating system is Linux"));const IsWindowsContext=new RawContextKey("isWindows",isWindows,localize("isWindows","Whether the operating system is Windows"));new RawContextKey("isWeb",isWeb,localize("isWeb","Whether the platform is a web browser")),new RawContextKey("isMacNative",isMacintosh&&!isWeb,localize("isMacNative","Whether the operating system is macOS on a non-browser platform")),new RawContextKey("isIOS",isIOS,localize("isIOS","Whether the operating system is iOS")),new RawContextKey("isDevelopment",!1,!0);const InputFocusedContextKey="inputFocus";function computeStyles(e,t){const n=Object.create(null);for(let i in t){const o=t[i];o&&(n[i]=resolveColorValue(o,e))}return n}function attachStyler(e,t,n){function i(){const i=computeStyles(e.getColorTheme(),t);"function"==typeof n?n(i):n.style(i)}return i(),e.onDidColorThemeChange(i)}function attachBadgeStyler(e,t,n){return attachStyler(t,{badgeBackground:(null==n?void 0:n.badgeBackground)||badgeBackground,badgeForeground:(null==n?void 0:n.badgeForeground)||badgeForeground,badgeBorder:contrastBorder},e)}function attachListStyler(e,t,n){return attachStyler(t,Object.assign(Object.assign({},defaultListStyles),n||{}),e)}new RawContextKey(InputFocusedContextKey,!1,localize("inputFocus","Whether keyboard focus is inside an input box"));const defaultListStyles={listFocusBackground:listFocusBackground,listFocusForeground:listFocusForeground,listFocusOutline:listFocusOutline,listActiveSelectionBackground:listActiveSelectionBackground,listActiveSelectionForeground:listActiveSelectionForeground,listActiveSelectionIconForeground:listActiveSelectionIconForeground,listFocusAndSelectionBackground:listActiveSelectionBackground,listFocusAndSelectionForeground:listActiveSelectionForeground,listInactiveSelectionBackground:listInactiveSelectionBackground,listInactiveSelectionIconForeground:listInactiveSelectionIconForeground,listInactiveSelectionForeground:listInactiveSelectionForeground,listInactiveFocusBackground:listInactiveFocusBackground,listInactiveFocusOutline:listInactiveFocusOutline,listHoverBackground:listHoverBackground,listHoverForeground:listHoverForeground,listDropBackground:listDropBackground,listSelectionOutline:activeContrastBorder,listHoverOutline:activeContrastBorder,listFilterWidgetBackground:listFilterWidgetBackground,listFilterWidgetOutline:listFilterWidgetOutline,listFilterWidgetNoMatchesOutline:listFilterWidgetNoMatchesOutline,listMatchesShadow:widgetShadow,treeIndentGuidesStroke:treeIndentGuidesStroke,tableColumnsBorder:tableColumnsBorder,tableOddRowsBackgroundColor:tableOddRowsBackgroundColor},defaultMenuStyles={shadowColor:widgetShadow,borderColor:menuBorder,foregroundColor:menuForeground,backgroundColor:menuBackground,selectionForegroundColor:menuSelectionForeground,selectionBackgroundColor:menuSelectionBackground,selectionBorderColor:menuSelectionBorder,separatorColor:menuSeparatorBackground,scrollbarShadow:scrollbarShadow,scrollbarSliderBackground:scrollbarSliderBackground,scrollbarSliderHoverBackground:scrollbarSliderHoverBackground,scrollbarSliderActiveBackground:scrollbarSliderActiveBackground};function attachMenuStyler(e,t,n){return attachStyler(t,Object.assign(Object.assign({},defaultMenuStyles),n),e)}var __decorate$1a=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$19=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const IListService=createDecorator("listService");let ListService=class{constructor(e){this._themeService=e,this.disposables=new DisposableStore,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}get lastFocusedList(){return this._lastFocusedWidget}setLastFocusedList(e){var t,n;e!==this._lastFocusedWidget&&(null===(t=this._lastFocusedWidget)||void 0===t||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,null===(n=this._lastFocusedWidget)||void 0===n||n.getHTMLElement().classList.add("last-focused"))}register(e,t){if(!this._hasCreatedStyleController){this._hasCreatedStyleController=!0;const e=new DefaultStyleController(createStyleSheet(),"");this.disposables.add(attachListStyler(e,this._themeService))}if(this.lists.some((t=>t.widget===e)))throw new Error("Cannot register the same widget multiple times");const n={widget:e,extraContextKeys:t};return this.lists.push(n),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),combinedDisposable(e.onDidFocus((()=>this.setLastFocusedList(e))),toDisposable((()=>this.lists.splice(this.lists.indexOf(n),1))),e.onDidDispose((()=>{this.lists=this.lists.filter((e=>e!==n)),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)})))}dispose(){this.disposables.dispose()}};ListService=__decorate$1a([__param$19(0,IThemeService)],ListService);const RawWorkbenchListFocusContextKey=new RawContextKey("listFocus",!0),WorkbenchListSupportsMultiSelectContextKey=new RawContextKey("listSupportsMultiselect",!0),WorkbenchListFocusContextKey=ContextKeyExpr.and(RawWorkbenchListFocusContextKey,ContextKeyExpr.not(InputFocusedContextKey)),WorkbenchListHasSelectionOrFocus=new RawContextKey("listHasSelectionOrFocus",!1),WorkbenchListDoubleSelection=new RawContextKey("listDoubleSelection",!1),WorkbenchListMultiSelection=new RawContextKey("listMultiSelection",!1),WorkbenchListSelectionNavigation=new RawContextKey("listSelectionNavigation",!1),WorkbenchTreeElementCanCollapse=new RawContextKey("treeElementCanCollapse",!1),WorkbenchTreeElementHasParent=new RawContextKey("treeElementHasParent",!1),WorkbenchTreeElementCanExpand=new RawContextKey("treeElementCanExpand",!1),WorkbenchTreeElementHasChild=new RawContextKey("treeElementHasChild",!1),WorkbenchListAutomaticKeyboardNavigationKey="listAutomaticKeyboardNavigation";function createScopedContextKeyService(e,t){const n=e.createScoped(t.getHTMLElement());return RawWorkbenchListFocusContextKey.bindTo(n),n}const multiSelectModifierSettingKey="workbench.list.multiSelectModifier",openModeSettingKey="workbench.list.openMode",horizontalScrollingKey="workbench.list.horizontalScrolling",keyboardNavigationSettingKey="workbench.list.keyboardNavigation",automaticKeyboardNavigationSettingKey="workbench.list.automaticKeyboardNavigation",treeIndentKey="workbench.tree.indent",treeRenderIndentGuidesKey="workbench.tree.renderIndentGuides",listSmoothScrolling="workbench.list.smoothScrolling",mouseWheelScrollSensitivityKey="workbench.list.mouseWheelScrollSensitivity",fastScrollSensitivityKey="workbench.list.fastScrollSensitivity",treeExpandMode="workbench.tree.expandMode";function useAltAsMultipleSelectionModifier(e){return"alt"===e.getValue(multiSelectModifierSettingKey)}class MultipleSelectionController extends Disposable{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(multiSelectModifierSettingKey)&&(this.useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(this.configurationService))})))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:isSelectionSingleChangeEvent(e)}isSelectionRangeChangeEvent(e){return isSelectionRangeChangeEvent(e)}}function toWorkbenchListOptions(e,t,n){var i;const o=new DisposableStore;return[Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter:e=>n.mightProducePrintableCharacter(e)},smoothScrolling:Boolean(t.getValue(listSmoothScrolling)),mouseWheelScrollSensitivity:t.getValue(mouseWheelScrollSensitivityKey),fastScrollSensitivity:t.getValue(fastScrollSensitivityKey),multipleSelectionController:null!==(i=e.multipleSelectionController)&&void 0!==i?i:o.add(new MultipleSelectionController(t))}),o]}let WorkbenchList=class extends List{constructor(e,t,n,i,o,r,s,a,l,c){const d=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(l.getValue(horizontalScrollingKey)),[u,h]=toWorkbenchListOptions(o,l,c);super(e,t,n,i,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},computeStyles(a.getColorTheme(),defaultListStyles)),u),{horizontalScrolling:d})),this.disposables.add(h),this.contextKeyService=createScopedContextKeyService(r,this),this.themeService=a,this.listSupportsMultiSelect=WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport);WorkbenchListSelectionNavigation.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this.listHasSelectionOrFocus=WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService),this.listDoubleSelection=WorkbenchListDoubleSelection.bindTo(this.contextKeyService),this.listMultiSelection=WorkbenchListMultiSelection.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(l),this.disposables.add(this.contextKeyService),this.disposables.add(s.register(this)),o.overrideStyles&&this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(l.onDidChangeConfiguration((e=>{e.affectsConfiguration(multiSelectModifierSettingKey)&&(this._useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(l));let t={};if(e.affectsConfiguration(horizontalScrollingKey)&&void 0===this.horizontalScrolling){const e=Boolean(l.getValue(horizontalScrollingKey));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(listSmoothScrolling)){const e=Boolean(l.getValue(listSmoothScrolling));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(mouseWheelScrollSensitivityKey)){const e=l.getValue(mouseWheelScrollSensitivityKey);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(fastScrollSensitivityKey)){const e=l.getValue(fastScrollSensitivityKey);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new ListResourceNavigator(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;null===(t=this._styler)||void 0===t||t.dispose(),this._styler=attachListStyler(this,this.themeService,e)}dispose(){var e;null===(e=this._styler)||void 0===e||e.dispose(),super.dispose()}};WorkbenchList=__decorate$1a([__param$19(5,IContextKeyService),__param$19(6,IListService),__param$19(7,IThemeService),__param$19(8,IConfigurationService),__param$19(9,IKeybindingService)],WorkbenchList);let WorkbenchPagedList=class extends PagedList{constructor(e,t,n,i,o,r,s,a,l,c){const d=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(l.getValue(horizontalScrollingKey)),[u,h]=toWorkbenchListOptions(o,l,c);super(e,t,n,i,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},computeStyles(a.getColorTheme(),defaultListStyles)),u),{horizontalScrolling:d})),this.disposables=new DisposableStore,this.disposables.add(h),this.contextKeyService=createScopedContextKeyService(r,this),this.themeService=a,this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport);WorkbenchListSelectionNavigation.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this._useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(l),this.disposables.add(this.contextKeyService),this.disposables.add(s.register(this)),o.overrideStyles&&this.updateStyles(o.overrideStyles),o.overrideStyles&&this.disposables.add(attachListStyler(this,a,o.overrideStyles)),this.disposables.add(l.onDidChangeConfiguration((e=>{e.affectsConfiguration(multiSelectModifierSettingKey)&&(this._useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(l));let t={};if(e.affectsConfiguration(horizontalScrollingKey)&&void 0===this.horizontalScrolling){const e=Boolean(l.getValue(horizontalScrollingKey));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(listSmoothScrolling)){const e=Boolean(l.getValue(listSmoothScrolling));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(mouseWheelScrollSensitivityKey)){const e=l.getValue(mouseWheelScrollSensitivityKey);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(fastScrollSensitivityKey)){const e=l.getValue(fastScrollSensitivityKey);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new ListResourceNavigator(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;null===(t=this._styler)||void 0===t||t.dispose(),this._styler=attachListStyler(this,this.themeService,e)}dispose(){var e;null===(e=this._styler)||void 0===e||e.dispose(),this.disposables.dispose(),super.dispose()}};WorkbenchPagedList=__decorate$1a([__param$19(5,IContextKeyService),__param$19(6,IListService),__param$19(7,IThemeService),__param$19(8,IConfigurationService),__param$19(9,IKeybindingService)],WorkbenchPagedList);let WorkbenchTable=class extends Table{constructor(e,t,n,i,o,r,s,a,l,c,d){const u=void 0!==r.horizontalScrolling?r.horizontalScrolling:Boolean(c.getValue(horizontalScrollingKey)),[h,g]=toWorkbenchListOptions(r,c,d);super(e,t,n,i,o,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},computeStyles(l.getColorTheme(),defaultListStyles)),h),{horizontalScrolling:u})),this.disposables.add(g),this.contextKeyService=createScopedContextKeyService(s,this),this.themeService=l,this.listSupportsMultiSelect=WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==r.multipleSelectionSupport);WorkbenchListSelectionNavigation.bindTo(this.contextKeyService).set(Boolean(r.selectionNavigation)),this.listHasSelectionOrFocus=WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService),this.listDoubleSelection=WorkbenchListDoubleSelection.bindTo(this.contextKeyService),this.listMultiSelection=WorkbenchListMultiSelection.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(c),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),r.overrideStyles&&this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(c.onDidChangeConfiguration((e=>{e.affectsConfiguration(multiSelectModifierSettingKey)&&(this._useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(c));let t={};if(e.affectsConfiguration(horizontalScrollingKey)&&void 0===this.horizontalScrolling){const e=Boolean(c.getValue(horizontalScrollingKey));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(listSmoothScrolling)){const e=Boolean(c.getValue(listSmoothScrolling));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(mouseWheelScrollSensitivityKey)){const e=c.getValue(mouseWheelScrollSensitivityKey);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(fastScrollSensitivityKey)){const e=c.getValue(fastScrollSensitivityKey);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new TableResourceNavigator(this,Object.assign({configurationService:c},r)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;null===(t=this._styler)||void 0===t||t.dispose(),this._styler=attachListStyler(this,this.themeService,e)}dispose(){var e;null===(e=this._styler)||void 0===e||e.dispose(),this.disposables.dispose(),super.dispose()}};WorkbenchTable=__decorate$1a([__param$19(6,IContextKeyService),__param$19(7,IListService),__param$19(8,IThemeService),__param$19(9,IConfigurationService),__param$19(10,IKeybindingService)],WorkbenchTable);class ResourceNavigator extends Disposable{constructor(e,t){var n;super(),this.widget=e,this._onDidOpen=this._register(new Emitter$1),this.onDidOpen=this._onDidOpen.event,this._register(Event$1.filter(this.widget.onDidChangeSelection,(e=>e.browserEvent instanceof KeyboardEvent))((e=>this.onSelectionFromKeyboard(e)))),this._register(this.widget.onPointer((e=>this.onPointer(e.element,e.browserEvent)))),this._register(this.widget.onMouseDblClick((e=>this.onMouseDblClick(e.element,e.browserEvent)))),"boolean"!=typeof(null==t?void 0:t.openOnSingleClick)&&(null==t?void 0:t.configurationService)?(this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue(openModeSettingKey)),this._register(null==t?void 0:t.configurationService.onDidChangeConfiguration((()=>{this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue(openModeSettingKey))})))):this.openOnSingleClick=null===(n=null==t?void 0:t.openOnSingleClick)||void 0===n||n}onSelectionFromKeyboard(e){if(1!==e.elements.length)return;const t=e.browserEvent,n="boolean"!=typeof t.preserveFocus||t.preserveFocus,i="boolean"==typeof t.pinned?t.pinned:!n;this._open(this.getSelectedElement(),n,i,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick)return;if(2===t.detail)return;const n=1===t.button,i=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!0,n,i,t)}onMouseDblClick(e,t){if(!t)return;const n=t.target;if(n.classList.contains("monaco-tl-twistie")||n.classList.contains("monaco-icon-label")&&n.classList.contains("folder-icon")&&t.offsetX<16)return;const i=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!1,!0,i,t)}_open(e,t,n,i,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:n,revealIfVisible:!0},sideBySide:i,element:e,browserEvent:o})}}class ListResourceNavigator extends ResourceNavigator{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class TableResourceNavigator extends ResourceNavigator{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class TreeResourceNavigator extends ResourceNavigator{constructor(e,t){super(e,t)}getSelectedElement(){var e;return null!==(e=this.widget.getSelection()[0])&&void 0!==e?e:void 0}}function createKeyboardNavigationEventFilter(e,t){let n=!1;return i=>{if(i.toKeybinding().isModifierKey())return!1;if(n)return n=!1,!1;const o=t.softDispatch(i,e);return o&&o.enterChord?(n=!0,!1):(n=!1,!0)}}let WorkbenchObjectTree=class extends ObjectTree{constructor(e,t,n,i,o,r,s,a,l,c,d){const{options:u,getAutomaticKeyboardNavigation:h,disposable:g}=workbenchTreeDataPreamble(t,o,r,l,c,d);super(e,t,n,i,u),this.disposables.add(g),this.internals=new WorkbenchTreeInternals(this,o,h,o.overrideStyles,r,s,a,l,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};WorkbenchObjectTree=__decorate$1a([__param$19(5,IContextKeyService),__param$19(6,IListService),__param$19(7,IThemeService),__param$19(8,IConfigurationService),__param$19(9,IKeybindingService),__param$19(10,IAccessibilityService)],WorkbenchObjectTree);let WorkbenchCompressibleObjectTree=class extends CompressibleObjectTree{constructor(e,t,n,i,o,r,s,a,l,c,d){const{options:u,getAutomaticKeyboardNavigation:h,disposable:g}=workbenchTreeDataPreamble(t,o,r,l,c,d);super(e,t,n,i,u),this.disposables.add(g),this.internals=new WorkbenchTreeInternals(this,o,h,o.overrideStyles,r,s,a,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};WorkbenchCompressibleObjectTree=__decorate$1a([__param$19(5,IContextKeyService),__param$19(6,IListService),__param$19(7,IThemeService),__param$19(8,IConfigurationService),__param$19(9,IKeybindingService),__param$19(10,IAccessibilityService)],WorkbenchCompressibleObjectTree);let WorkbenchDataTree=class extends DataTree{constructor(e,t,n,i,o,r,s,a,l,c,d,u){const{options:h,getAutomaticKeyboardNavigation:g,disposable:p}=workbenchTreeDataPreamble(t,r,s,c,d,u);super(e,t,n,i,o,h),this.disposables.add(p),this.internals=new WorkbenchTreeInternals(this,r,g,r.overrideStyles,s,a,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};WorkbenchDataTree=__decorate$1a([__param$19(6,IContextKeyService),__param$19(7,IListService),__param$19(8,IThemeService),__param$19(9,IConfigurationService),__param$19(10,IKeybindingService),__param$19(11,IAccessibilityService)],WorkbenchDataTree);let WorkbenchAsyncDataTree=class extends AsyncDataTree{constructor(e,t,n,i,o,r,s,a,l,c,d,u){const{options:h,getAutomaticKeyboardNavigation:g,disposable:p}=workbenchTreeDataPreamble(t,r,s,c,d,u);super(e,t,n,i,o,h),this.disposables.add(p),this.internals=new WorkbenchTreeInternals(this,r,g,r.overrideStyles,s,a,l,c,u),this.disposables.add(this.internals)}get onDidOpen(){return this.internals.onDidOpen}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};WorkbenchAsyncDataTree=__decorate$1a([__param$19(6,IContextKeyService),__param$19(7,IListService),__param$19(8,IThemeService),__param$19(9,IConfigurationService),__param$19(10,IKeybindingService),__param$19(11,IAccessibilityService)],WorkbenchAsyncDataTree);let WorkbenchCompressibleAsyncDataTree=class extends CompressibleAsyncDataTree{constructor(e,t,n,i,o,r,s,a,l,c,d,u,h){const{options:g,getAutomaticKeyboardNavigation:p,disposable:f}=workbenchTreeDataPreamble(t,s,a,d,u,h);super(e,t,n,i,o,r,g),this.disposables.add(f),this.internals=new WorkbenchTreeInternals(this,s,p,s.overrideStyles,a,l,c,d,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};function workbenchTreeDataPreamble(e,t,n,i,o,r){var s;const a=()=>{let e=Boolean(n.getContextKeyValue(WorkbenchListAutomaticKeyboardNavigationKey));return e&&(e=Boolean(i.getValue(automaticKeyboardNavigationSettingKey))),e},l=r.isScreenReaderOptimized(),c=t.simpleKeyboardNavigation||l?"simple":i.getValue(keyboardNavigationSettingKey),d=void 0!==t.horizontalScrolling?t.horizontalScrolling:Boolean(i.getValue(horizontalScrollingKey)),[u,h]=toWorkbenchListOptions(t,i,o),g=t.additionalScrollHeight;return{getAutomaticKeyboardNavigation:a,disposable:h,options:Object.assign(Object.assign({keyboardSupport:!1},u),{indent:"number"==typeof i.getValue(treeIndentKey)?i.getValue(treeIndentKey):void 0,renderIndentGuides:i.getValue(treeRenderIndentGuidesKey),smoothScrolling:Boolean(i.getValue(listSmoothScrolling)),automaticKeyboardNavigation:a(),simpleKeyboardNavigation:"simple"===c,filterOnType:"filter"===c,horizontalScrolling:d,keyboardNavigationEventFilter:createKeyboardNavigationEventFilter(e,o),additionalScrollHeight:g,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:null!==(s=t.expandOnlyOnTwistieClick)&&void 0!==s?s:"doubleClick"===i.getValue(treeExpandMode)})}}WorkbenchCompressibleAsyncDataTree=__decorate$1a([__param$19(7,IContextKeyService),__param$19(8,IListService),__param$19(9,IThemeService),__param$19(10,IConfigurationService),__param$19(11,IKeybindingService),__param$19(12,IAccessibilityService)],WorkbenchCompressibleAsyncDataTree);let WorkbenchTreeInternals=class{constructor(e,t,n,i,o,r,s,a,l){this.tree=e,this.themeService=s,this.disposables=[],this.contextKeyService=createScopedContextKeyService(o,e),this.listSupportsMultiSelect=WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==t.multipleSelectionSupport);WorkbenchListSelectionNavigation.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),this.hasSelectionOrFocus=WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService),this.hasDoubleSelection=WorkbenchListDoubleSelection.bindTo(this.contextKeyService),this.hasMultiSelection=WorkbenchListMultiSelection.bindTo(this.contextKeyService),this.treeElementCanCollapse=WorkbenchTreeElementCanCollapse.bindTo(this.contextKeyService),this.treeElementHasParent=WorkbenchTreeElementHasParent.bindTo(this.contextKeyService),this.treeElementCanExpand=WorkbenchTreeElementCanExpand.bindTo(this.contextKeyService),this.treeElementHasChild=WorkbenchTreeElementHasChild.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(a);const c=new Set;c.add(WorkbenchListAutomaticKeyboardNavigationKey);const d=()=>{const t=l.isScreenReaderOptimized()?"simple":a.getValue(keyboardNavigationSettingKey);e.updateOptions({simpleKeyboardNavigation:"simple"===t,filterOnType:"filter"===t})};this.updateStyleOverrides(i);const u=()=>{const t=e.getFocus()[0];if(!t)return;const n=e.getNode(t);this.treeElementCanCollapse.set(n.collapsible&&!n.collapsed),this.treeElementHasParent.set(!!e.getParentElement(t)),this.treeElementCanExpand.set(n.collapsible&&n.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(t))};this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection((()=>{const t=e.getSelection(),n=e.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.hasSelectionOrFocus.set(t.length>0||n.length>0),this.hasMultiSelection.set(t.length>1),this.hasDoubleSelection.set(2===t.length)}))})),e.onDidChangeFocus((()=>{const t=e.getSelection(),n=e.getFocus();this.hasSelectionOrFocus.set(t.length>0||n.length>0),u()})),e.onDidChangeCollapseState(u),e.onDidChangeModel(u),a.onDidChangeConfiguration((i=>{let o={};if(i.affectsConfiguration(multiSelectModifierSettingKey)&&(this._useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(a)),i.affectsConfiguration(treeIndentKey)){const e=a.getValue(treeIndentKey);o=Object.assign(Object.assign({},o),{indent:e})}if(i.affectsConfiguration(treeRenderIndentGuidesKey)){const e=a.getValue(treeRenderIndentGuidesKey);o=Object.assign(Object.assign({},o),{renderIndentGuides:e})}if(i.affectsConfiguration(listSmoothScrolling)){const e=Boolean(a.getValue(listSmoothScrolling));o=Object.assign(Object.assign({},o),{smoothScrolling:e})}if(i.affectsConfiguration(keyboardNavigationSettingKey)&&d(),i.affectsConfiguration(automaticKeyboardNavigationSettingKey)&&(o=Object.assign(Object.assign({},o),{automaticKeyboardNavigation:n()})),i.affectsConfiguration(horizontalScrollingKey)&&void 0===t.horizontalScrolling){const e=Boolean(a.getValue(horizontalScrollingKey));o=Object.assign(Object.assign({},o),{horizontalScrolling:e})}if(i.affectsConfiguration(treeExpandMode)&&void 0===t.expandOnlyOnTwistieClick&&(o=Object.assign(Object.assign({},o),{expandOnlyOnTwistieClick:"doubleClick"===a.getValue(treeExpandMode)})),i.affectsConfiguration(mouseWheelScrollSensitivityKey)){const e=a.getValue(mouseWheelScrollSensitivityKey);o=Object.assign(Object.assign({},o),{mouseWheelScrollSensitivity:e})}if(i.affectsConfiguration(fastScrollSensitivityKey)){const e=a.getValue(fastScrollSensitivityKey);o=Object.assign(Object.assign({},o),{fastScrollSensitivity:e})}Object.keys(o).length>0&&e.updateOptions(o)})),this.contextKeyService.onDidChangeContext((t=>{t.affectsSome(c)&&e.updateOptions({automaticKeyboardNavigation:n()})})),l.onDidChangeScreenReaderOptimized((()=>d()))),this.navigator=new TreeResourceNavigator(e,Object.assign({configurationService:a},t)),this.disposables.push(this.navigator)}get onDidOpen(){return this.navigator.onDidOpen}updateOptions(e){void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){dispose(this.styler),this.styler=e?attachListStyler(this.tree,this.themeService,e):Disposable.None}dispose(){this.disposables=dispose(this.disposables),dispose(this.styler),this.styler=void 0}};WorkbenchTreeInternals=__decorate$1a([__param$19(4,IContextKeyService),__param$19(5,IListService),__param$19(6,IThemeService),__param$19(7,IConfigurationService),__param$19(8,IAccessibilityService)],WorkbenchTreeInternals);const configurationRegistry$1=Registry.as(Extensions$3.Configuration);configurationRegistry$1.registerConfiguration({id:"workbench",order:7,title:localize("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[multiSelectModifierSettingKey]:{type:"string",enum:["ctrlCmd","alt"],enumDescriptions:[localize("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),localize("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:localize({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[openModeSettingKey]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:localize({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[horizontalScrollingKey]:{type:"boolean",default:!1,description:localize("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[treeIndentKey]:{type:"number",default:8,minimum:4,maximum:40,description:localize("tree indent setting","Controls tree indentation in pixels.")},[treeRenderIndentGuidesKey]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:localize("render tree indent guides","Controls whether the tree should render indent guides.")},[listSmoothScrolling]:{type:"boolean",default:!1,description:localize("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[mouseWheelScrollSensitivityKey]:{type:"number",default:1,description:localize("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[fastScrollSensitivityKey]:{type:"number",default:5,description:localize("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[keyboardNavigationSettingKey]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[localize("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),localize("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),localize("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:localize("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.")},[automaticKeyboardNavigationSettingKey]:{type:"boolean",default:!0,markdownDescription:localize("automatic keyboard navigation setting","Controls whether keyboard navigation in lists and trees is automatically triggered simply by typing. If set to `false`, keyboard navigation is only triggered when executing the `list.toggleKeyboardNavigation` command, for which you can assign a keyboard shortcut.")},[treeExpandMode]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:localize("expand mode","Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")}}});var __awaiter$N=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class OneReference{constructor(e,t,n,i){this.isProviderFirst=e,this.parent=t,this.link=n,this._rangeCallback=i,this.id=defaultGenerator.nextId()}get uri(){return this.link.uri}get range(){var e,t;return null!==(t=null!==(e=this._range)&&void 0!==e?e:this.link.targetSelectionRange)&&void 0!==t?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=null===(e=this.parent.getPreview(this))||void 0===e?void 0:e.preview(this.range);return t?localize({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"symbol in {0} on line {1} at column {2}, {3}",basename(this.uri),this.range.startLineNumber,this.range.startColumn,t.value):localize("aria.oneReference","symbol in {0} on line {1} at column {2}",basename(this.uri),this.range.startLineNumber,this.range.startColumn)}}class FilePreview{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const n=this._modelReference.object.textEditorModel;if(!n)return;const{startLineNumber:i,startColumn:o,endLineNumber:r,endColumn:s}=e,a=n.getWordUntilPosition({lineNumber:i,column:o-t}),l=new Range$2(i,a.startColumn,i,o),c=new Range$2(r,s,r,1073741824),d=n.getValueInRange(l).replace(/^\s+/,""),u=n.getValueInRange(e);return{value:d+u+n.getValueInRange(c).replace(/\s+$/,""),highlight:{start:d.length,end:d.length+u.length}}}}class FileReferences{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new ResourceMap}dispose(){dispose(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return 1===e?localize("aria.fileReferences.1","1 symbol in {0}, full path {1}",basename(this.uri),this.uri.fsPath):localize("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,basename(this.uri),this.uri.fsPath)}resolve(e){return __awaiter$N(this,void 0,void 0,(function*(){if(0!==this._previews.size)return this;for(let n of this.children)if(!this._previews.has(n.uri))try{const t=yield e.createModelReference(n.uri);this._previews.set(n.uri,new FilePreview(t))}catch(t){onUnexpectedError(t)}return this}))}}class ReferencesModel{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new Emitter$1,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[n]=e;let i;e.sort(ReferencesModel._compareReferences);for(let o of e)if(i&&extUri.isEqual(i.uri,o.uri,!0)||(i=new FileReferences(this,o.uri),this.groups.push(i)),0===i.children.length||0!==ReferencesModel._compareReferences(o,i.children[i.children.length-1])){const e=new OneReference(n===o,i,o,(e=>this._onDidChangeReferenceRange.fire(e)));this.references.push(e),i.children.push(e)}}dispose(){dispose(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new ReferencesModel(this._links,this._title)}get title(){return this._title}get isEmpty(){return 0===this.groups.length}get ariaMessage(){return this.isEmpty?localize("aria.result.0","No results found"):1===this.references.length?localize("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):1===this.groups.length?localize("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):localize("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){let{parent:n}=e,i=n.children.indexOf(e),o=n.children.length,r=n.parent.groups.length;return 1===r||t&&i+1<o||!t&&i>0?(i=t?(i+1)%o:(i+o-1)%o,n.children[i]):(i=n.parent.groups.indexOf(n),t?(i=(i+1)%r,n.parent.groups[i].children[0]):(i=(i+r-1)%r,n.parent.groups[i].children[n.parent.groups[i].children.length-1]))}nearestReference(e,t){const n=this.references.map(((n,i)=>({idx:i,prefixLen:commonPrefixLength(n.uri.toString(),e.toString()),offsetDist:100*Math.abs(n.range.startLineNumber-t.lineNumber)+Math.abs(n.range.startColumn-t.column)}))).sort(((e,t)=>e.prefixLen>t.prefixLen?-1:e.prefixLen<t.prefixLen?1:e.offsetDist<t.offsetDist?-1:e.offsetDist>t.offsetDist?1:0))[0];if(n)return this.references[n.idx]}referenceAt(e,t){for(const n of this.references)if(n.uri.toString()===e.toString()&&Range$2.containsPosition(n.range,t))return n}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return extUri.compare(e.uri,t.uri)||Range$2.compareRangesUsingStarts(e.range,t.range)}}var referencesWidget="",countBadge="";const defaultOpts$3={badgeBackground:Color.fromHex("#4D4D4D"),badgeForeground:Color.fromHex("#FFFFFF")};class CountBadge{constructor(e,t){this.count=0,this.options=t||Object.create(null),mixin(this.options,defaultOpts$3,!1),this.badgeBackground=this.options.badgeBackground,this.badgeForeground=this.options.badgeForeground,this.badgeBorder=this.options.badgeBorder,this.element=append$1(e,$$c(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){this.element.textContent=format(this.countFormat,this.count),this.element.title=format(this.titleFormat,this.count),this.applyStyles()}style(e){this.badgeBackground=e.badgeBackground,this.badgeForeground=e.badgeForeground,this.badgeBorder=e.badgeBorder,this.applyStyles()}applyStyles(){if(this.element){const e=this.badgeBackground?this.badgeBackground.toString():"",t=this.badgeForeground?this.badgeForeground.toString():"",n=this.badgeBorder?this.badgeBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.element.style.borderWidth=n?"1px":"",this.element.style.borderStyle=n?"solid":"",this.element.style.borderColor=n}}}class HighlightedLabel{constructor(e,t){var n;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=null!==(n=null==t?void 0:t.supportIcons)&&void 0!==n&&n,this.domNode=append$1(e,$$c("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],n="",i){e||(e=""),i&&(e=HighlightedLabel.escapeNewLines(e,t)),this.didEverRender&&this.text===e&&this.title===n&&equals(this.highlights,t)||(this.text=e,this.title=n,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const n of this.highlights){if(n.end===n.start)continue;if(t<n.start){const i=this.text.substring(t,n.start);e.push($$c("span",void 0,...this.supportIcons?renderLabelWithIcons(i):[i])),t=n.end}const i=this.text.substring(n.start,n.end),o=$$c("span.highlight",void 0,...this.supportIcons?renderLabelWithIcons(i):[i]);n.extraClasses&&o.classList.add(...n.extraClasses),e.push(o),t=n.end}if(t<this.text.length){const n=this.text.substring(t);e.push($$c("span",void 0,...this.supportIcons?renderLabelWithIcons(n):[n]))}reset(this.domNode,...e),this.title?this.domNode.title=this.title:this.domNode.removeAttribute("title"),this.didEverRender=!0}static escapeNewLines(e,t){let n=0,i=0;return e.replace(/\r\n|\r|\n/g,((e,o)=>{i="\r\n"===e?-1:0,o+=n;for(const n of t)n.end<=o||(n.start>=o&&(n.start+=i),n.end>=o&&(n.end+=i));return n+=i,"⏎"}))}}var __awaiter$M=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};function setupNativeHover(e,t){isString$1(t)?e.title=stripIcons(t):(null==t?void 0:t.markdownNotSupportedFallback)?e.title=t.markdownNotSupportedFallback:e.removeAttribute("title")}class UpdatableHoverWidget{constructor(e,t,n){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=n}update(e,t){var n;return __awaiter$M(this,void 0,void 0,(function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let i;if(void 0===e||isString$1(e)||e instanceof HTMLElement)i=e;else if(isFunction(e.markdown)){this._hoverWidget||this.show(localize("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new CancellationTokenSource$1;const n=this._cancellationTokenSource.token;if(i=yield e.markdown(n),void 0===i&&(i=e.markdownNotSupportedFallback),this.isDisposed||n.isCancellationRequested)return}else i=null!==(n=e.markdown)&&void 0!==n?n:e.markdownNotSupportedFallback;this.show(i,t)}))}show(e,t){const n=this._hoverWidget;if(this.hasContent(e)){const i={content:e,target:this.target,showPointer:"element"===this.hoverDelegate.placement,hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!n};this._hoverWidget=this.hoverDelegate.showHover(i,t)}null==n||n.dispose()}hasContent(e){return!!e&&(!isMarkdownString(e)||!!e.value)}get isDisposed(){var e;return null===(e=this._hoverWidget)||void 0===e?void 0:e.isDisposed}dispose(){var e,t;null===(e=this._hoverWidget)||void 0===e||e.dispose(),null===(t=this._cancellationTokenSource)||void 0===t||t.dispose(!0),this._cancellationTokenSource=void 0}}function setupCustomHover(e,t,n){let i,o;const r=(t,n)=>{var r;t&&(null==o||o.dispose(),o=void 0),n&&(null==i||i.dispose(),i=void 0),null===(r=e.onDidHideHover)||void 0===r||r.call(e)},s=(i,r,s)=>new TimeoutTimer((()=>__awaiter$M(this,void 0,void 0,(function*(){o&&!o.isDisposed||(o=new UpdatableHoverWidget(e,s||t,i>0),yield o.update(n,r))}))),i),a=addDisposableListener(t,EventType$1.MOUSE_OVER,(()=>{if(i)return;const n=new DisposableStore;n.add(addDisposableListener(t,EventType$1.MOUSE_LEAVE,(e=>r(!1,e.fromElement===t)),!0));n.add(addDisposableListener(t,EventType$1.MOUSE_DOWN,(()=>r(!0,!0)),!0));const o={targetElements:[t],dispose:()=>{}};if(void 0===e.placement||"mouse"===e.placement){const e=e=>o.x=e.x+10;n.add(addDisposableListener(t,EventType$1.MOUSE_MOVE,e,!0))}n.add(s(e.delay,!1,o)),i=n}),!0);return{show:e=>{r(!1,!0),s(0,e)},hide:()=>{r(!0,!0)},update:e=>__awaiter$M(this,void 0,void 0,(function*(){n=e,yield null==o?void 0:o.update(n)})),dispose:()=>{a.dispose(),r(!0,!0)}}}var iconlabel="";class FastLabelNode{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class IconLabel extends Disposable{constructor(e,t){super(),this.customHovers=new Map,this.domNode=this._register(new FastLabelNode(append$1(e,$$c(".monaco-icon-label")))),this.labelContainer=append$1(this.domNode.element,$$c(".monaco-icon-label-container"));const n=append$1(this.labelContainer,$$c("span.monaco-icon-name-container"));this.descriptionContainer=this._register(new FastLabelNode(append$1(this.labelContainer,$$c("span.monaco-icon-description-container")))),(null==t?void 0:t.supportHighlights)||(null==t?void 0:t.supportIcons)?this.nameNode=new LabelWithHighlights(n,!!t.supportIcons):this.nameNode=new Label(n),(null==t?void 0:t.supportDescriptionHighlights)?this.descriptionNodeFactory=()=>new HighlightedLabel(append$1(this.descriptionContainer.element,$$c("span.label-description")),{supportIcons:!!t.supportIcons}):this.descriptionNodeFactory=()=>this._register(new FastLabelNode(append$1(this.descriptionContainer.element,$$c("span.label-description")))),this.hoverDelegate=null==t?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,n){const i=["monaco-icon-label"];n&&(n.extraClasses&&i.push(...n.extraClasses),n.italic&&i.push("italic"),n.strikethrough&&i.push("strikethrough")),this.domNode.className=i.join(" "),this.setupHover((null==n?void 0:n.descriptionTitle)?this.labelContainer:this.element,null==n?void 0:n.title),this.nameNode.setLabel(e,n),(t||this.descriptionNode)&&(this.descriptionNode||(this.descriptionNode=this.descriptionNodeFactory()),this.descriptionNode instanceof HighlightedLabel?(this.descriptionNode.set(t||"",n?n.descriptionMatches:void 0),this.setupHover(this.descriptionNode.element,null==n?void 0:n.descriptionTitle)):(this.descriptionNode.textContent=t||"",this.setupHover(this.descriptionNode.element,(null==n?void 0:n.descriptionTitle)||""),this.descriptionNode.empty=!t))}setupHover(e,t){const n=this.customHovers.get(e);if(n&&(n.dispose(),this.customHovers.delete(e)),t)if(this.hoverDelegate){const n=setupCustomHover(this.hoverDelegate,e,t);n&&this.customHovers.set(e,n)}else setupNativeHover(e,t);else e.removeAttribute("title")}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}}class Label{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!equals(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=append$1(this.container,$$c("a.label-name",{id:null==t?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let n=0;n<e.length;n++){const i=e[n],o=(null==t?void 0:t.domId)&&`${null==t?void 0:t.domId}_${n}`;append$1(this.container,$$c("a.label-name",{id:o,"data-icon-label-count":e.length,"data-icon-label-index":n,role:"treeitem"},i)),n<e.length-1&&append$1(this.container,$$c("span.label-separator",void 0,(null==t?void 0:t.separator)||"/"))}}}}function splitMatches(e,t,n){if(!n)return;let i=0;return e.map((e=>{const o={start:i,end:i+e.length},r=n.map((e=>Range$1.intersect(o,e))).filter((e=>!Range$1.isEmpty(e))).map((({start:e,end:t})=>({start:e-i,end:t-i})));return i=o.end+t.length,r}))}class LabelWithHighlights{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!equals(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new HighlightedLabel(append$1(this.container,$$c("a.label-name",{id:null==t?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,null==t?void 0:t.matches,void 0,null==t?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const n=(null==t?void 0:t.separator)||"/",i=splitMatches(e,n,null==t?void 0:t.matches);for(let o=0;o<e.length;o++){const r=e[o],s=i?i[o]:void 0,a=$$c("a.label-name",{id:(null==t?void 0:t.domId)&&`${null==t?void 0:t.domId}_${o}`,"data-icon-label-count":e.length,"data-icon-label-index":o,role:"treeitem"});new HighlightedLabel(append$1(this.container,a),{supportIcons:this.supportIcons}).set(r,s,void 0,null==t?void 0:t.labelEscapeNewLines),o<e.length-1&&append$1(a,$$c("span.label-separator",void 0,n))}}}}function getBaseLabel(e){if(!e)return;"string"==typeof e&&(e=URI.file(e));const t=basename(e)||(e.scheme===Schemas.file?e.fsPath:e.path);return isWindows&&isRootOrDriveLetter(t)?normalizeDriveLetter(t):t}function normalizeDriveLetter(e,t){return hasDriveLetter(e,t)?e.charAt(0).toUpperCase()+e.slice(1):e}const ILabelService=createDecorator("labelService");var __decorate$19=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$18=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let DataSource=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof ReferencesModel||e instanceof FileReferences}getChildren(e){if(e instanceof ReferencesModel)return e.groups;if(e instanceof FileReferences)return e.resolve(this._resolverService).then((e=>e.children));throw new Error("bad tree")}};DataSource=__decorate$19([__param$18(0,ITextModelService)],DataSource);class Delegate{getHeight(){return 23}getTemplateId(e){return e instanceof FileReferences?FileReferencesRenderer.id:OneReferenceRenderer.id}}let StringRepresentationProvider=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof OneReference){const n=null===(t=e.parent.getPreview(e))||void 0===t?void 0:t.preview(e.range);if(n)return n.value}return basename(e.uri)}};StringRepresentationProvider=__decorate$19([__param$18(0,IKeybindingService)],StringRepresentationProvider);class IdentityProvider{getId(e){return e instanceof OneReference?e.id:e.uri}}let FileReferencesTemplate=class extends Disposable{constructor(e,t,n){super(),this._uriLabel=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new IconLabel(i,{supportHighlights:!0})),this.badge=new CountBadge(append$1(i,$$c(".count"))),this._register(attachBadgeStyler(this.badge,n)),e.appendChild(i)}set(e,t){let n=dirname(e.uri);this.file.setLabel(getBaseLabel(e.uri),this._uriLabel.getUriLabel(n,{relative:!0}),{title:this._uriLabel.getUriLabel(e.uri),matches:t});const i=e.children.length;this.badge.setCount(i),i>1?this.badge.setTitleFormat(localize("referencesCount","{0} references",i)):this.badge.setTitleFormat(localize("referenceCount","{0} reference",i))}};FileReferencesTemplate=__decorate$19([__param$18(1,ILabelService),__param$18(2,IThemeService)],FileReferencesTemplate);let FileReferencesRenderer=class e{constructor(t){this._instantiationService=t,this.templateId=e.id}renderTemplate(e){return this._instantiationService.createInstance(FileReferencesTemplate,e)}renderElement(e,t,n){n.set(e.element,createMatches(e.filterData))}disposeTemplate(e){e.dispose()}};FileReferencesRenderer.id="FileReferencesRenderer",FileReferencesRenderer=__decorate$19([__param$18(0,IInstantiationService)],FileReferencesRenderer);class OneReferenceTemplate{constructor(e){this.label=new HighlightedLabel(e)}set(e,t){var n;const i=null===(n=e.parent.getPreview(e))||void 0===n?void 0:n.preview(e.range);if(i&&i.value){const{value:e,highlight:n}=i;t&&!FuzzyScore.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(e,createMatches(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(e,[n]))}else this.label.set(`${basename(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`)}}class OneReferenceRenderer{constructor(){this.templateId=OneReferenceRenderer.id}renderTemplate(e){return new OneReferenceTemplate(e)}renderElement(e,t,n){n.set(e.element,e.filterData)}disposeTemplate(){}}OneReferenceRenderer.id="OneReferenceRenderer";class AccessibilityProvider{getWidgetAriaLabel(){return localize("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var __decorate$18=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$17=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$L=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class DecorationsManager{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new DisposableStore,this._callOnModelChange=new DisposableStore,this._callOnDispose.add(this._editor.onDidChangeModel((()=>this._onModelChanged()))),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e)for(let t of this._model.references)if(t.uri.toString()===e.uri.toString())return void this._addDecorations(t.parent)}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations((()=>this._onDecorationChanged())));const t=[],n=[];for(let o=0,r=e.children.length;o<r;o++){let i=e.children[o];this._decorationIgnoreSet.has(i.id)||i.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:i.range,options:DecorationsManager.DecorationOptions}),n.push(o))}const i=this._editor.deltaDecorations([],t);for(let o=0;o<i.length;o++)this._decorations.set(i[o],e.children[n[o]])}_onDecorationChanged(){const e=[],t=this._editor.getModel();if(t){for(let[n,i]of this._decorations){const o=t.getDecorationRange(n);if(!o)continue;let r=!1;if(!Range$2.equalsRange(o,i.range)){if(Range$2.spansMultipleLines(o))r=!0;else{i.range.endColumn-i.range.startColumn!==o.endColumn-o.startColumn&&(r=!0)}r?(this._decorationIgnoreSet.add(i.id),e.push(n)):i.range=o}}for(let t=0,n=e.length;t<n;t++)this._decorations.delete(e[t]);this._editor.deltaDecorations(e,[])}}removeDecorations(){this._editor.deltaDecorations([...this._decorations.keys()],[]),this._decorations.clear()}}DecorationsManager.DecorationOptions=ModelDecorationOptions.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});class LayoutData{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,n;try{const i=JSON.parse(e);t=i.ratio,n=i.heightInLines}catch(i){}return{ratio:t||.7,heightInLines:n||18}}}class ReferencesTree extends WorkbenchAsyncDataTree{}let ReferenceWidget=class extends PeekViewWidget{constructor(e,t,n,i,o,r,s,a,l,c,d,u){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},r),this._defaultTreeKeyboardSupport=t,this.layoutData=n,this._textModelResolverService=o,this._instantiationService=r,this._peekViewService=s,this._uriLabel=a,this._undoRedoService=l,this._keybindingService=c,this._languageService=d,this._languageConfigurationService=u,this._disposeOnNewModel=new DisposableStore,this._callOnDispose=new DisposableStore,this._onDidSelectReference=new Emitter$1,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new Dimension(0,0),this._applyTheme(i.getColorTheme()),this._callOnDispose.add(i.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}dispose(){this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),dispose(this._preview),dispose(this._previewNotAvailableMessage),dispose(this._tree),dispose(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(peekViewBorder)||Color.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(peekViewTitleBackground)||Color.transparent,primaryHeadingColor:e.getColor(peekViewTitleForeground),secondaryHeadingColor:e.getColor(peekViewTitleInfoForeground)})}show(e){this.editor.revealRangeInCenterIfOutsideViewport(e,0),super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=append$1(e,$$c("div.messages")),hide(this._messageContainer),this._splitView=new SplitView(e,{orientation:1}),this._previewContainer=append$1(e,$$c("div.preview.inline"));this._preview=this._instantiationService.createInstance(EmbeddedCodeEditorWidget,this._previewContainer,{scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!1},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}},this.editor),hide(this._previewContainer),this._previewNotAvailableMessage=new TextModel(localize("missingPreviewMessage","no preview available"),PLAINTEXT_LANGUAGE_ID,TextModel.DEFAULT_CREATION_OPTIONS,null,this._undoRedoService,this._languageService,this._languageConfigurationService),this._treeContainer=append$1(e,$$c("div.ref-tree.inline"));const t={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new AccessibilityProvider,keyboardNavigationLabelProvider:this._instantiationService.createInstance(StringRepresentationProvider),identityProvider:new IdentityProvider,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:peekViewResultsBackground}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(addStandardDisposableListener(this._treeContainer,"keydown",(e=>{e.equals(9)&&(this._keybindingService.dispatchEvent(e,e.target),e.stopPropagation())}),!0)),this._tree=this._instantiationService.createInstance(ReferencesTree,"ReferencesWidget",this._treeContainer,new Delegate,[this._instantiationService.createInstance(FileReferencesRenderer),this._instantiationService.createInstance(OneReferenceRenderer)],this._instantiationService.createInstance(DataSource),t),this._splitView.addView({onDidChange:Event$1.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:e=>{this._preview.layout({height:this._dim.height,width:e})}},Sizing.Distribute),this._splitView.addView({onDidChange:Event$1.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:e=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${e}px`,this._tree.layout(this._dim.height,e)}},Sizing.Distribute),this._disposables.add(this._splitView.onDidSashChange((()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)}),void 0));let n=(e,t)=>{e instanceof OneReference&&("show"===t&&this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:t,source:"tree"}))};this._tree.onDidOpen((e=>{e.sideBySide?n(e.element,"side"):e.editorOptions.pinned?n(e.element,"goto"):n(e.element,"show")})),hide(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Dimension(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then((()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))}))}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=localize("noResults","No results"),show(this._messageContainer),Promise.resolve(void 0)):(hide(this._messageContainer),this._decorationsManager=new DecorationsManager(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange((e=>this._tree.rerender(e)))),this._disposeOnNewModel.add(this._preview.onMouseDown((e=>{const{event:t,target:n}=e;if(2!==t.detail)return;const i=this._getFocusedReference();i&&this._onDidSelectReference.fire({element:{uri:i.uri,range:n.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})}))),this.container.classList.add("results-loaded"),show(this._treeContainer),show(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(1===this._model.groups.length?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();return e instanceof OneReference?e:e instanceof FileReferences&&e.children.length>0?e.children[0]:void 0}revealReference(e){return __awaiter$L(this,void 0,void 0,(function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}))}_revealReference(e,t){return __awaiter$L(this,void 0,void 0,(function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Schemas.inMemory?this.setTitle(basenameOrAuthority(e.uri),this._uriLabel.getUriLabel(dirname(e.uri))):this.setTitle(localize("peekView.alternateTitle","References"));const n=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent||(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent)),this._tree.reveal(e);const i=yield n;if(!this._model)return void i.dispose();dispose(this._previewModelReference);const o=i.object;if(o){const t=this._preview.getModel()===o.textEditorModel?0:1,n=Range$2.lift(e.range).collapseToStart();this._previewModelReference=i,this._preview.setModel(o.textEditorModel),this._preview.setSelection(n),this._preview.revealRangeInCenter(n,t)}else this._preview.setModel(this._previewNotAvailableMessage),i.dispose()}))}};ReferenceWidget=__decorate$18([__param$17(3,IThemeService),__param$17(4,ITextModelService),__param$17(5,IInstantiationService),__param$17(6,IPeekViewService),__param$17(7,ILabelService),__param$17(8,IUndoRedoService),__param$17(9,IKeybindingService),__param$17(10,ILanguageService),__param$17(11,ILanguageConfigurationService)],ReferenceWidget);var __decorate$17=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$16=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$K=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const ctxReferenceSearchVisible=new RawContextKey("referenceSearchVisible",!1,localize("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let ReferencesController=class e{constructor(e,t,n,i,o,r,s,a){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=i,this._notificationService=o,this._instantiationService=r,this._storageService=s,this._configurationService=a,this._disposables=new DisposableStore,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=ctxReferenceSearchVisible.bindTo(n)}static get(t){return t.getContribution(e.ID)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),null===(e=this._widget)||void 0===e||e.dispose(),null===(t=this._model)||void 0===t||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,n){let i;if(this._widget&&(i=this._widget.position),this.closeWidget(),i&&e.containsPosition(i))return;this._peekMode=n,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage((()=>{this.closeWidget()}))),this._disposables.add(this._editor.onDidChangeModel((()=>{this._ignoreModelChangeEvent||this.closeWidget()})));const o="peekViewLayout",r=LayoutData.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(ReferenceWidget,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(localize("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose((()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()}))),this._disposables.add(this._widget.onDidSelectReference((e=>{let{element:t,kind:i}=e;if(t)switch(i){case"open":"editor"===e.source&&this._configurationService.getValue("editor.stablePeek")||this.openReference(t,!1,!1);break;case"side":this.openReference(t,!0,!1);break;case"goto":n?this._gotoReference(t):this.openReference(t,!1,!0)}})));const s=++this._requestIdPool;t.then((t=>{var n;if(s===this._requestIdPool&&this._widget)return null===(n=this._model)||void 0===n||n.dispose(),this._model=t,this._widget.setModel(this._model).then((()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(localize("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));let t=this._editor.getModel().uri,n=new Position$1(e.startLineNumber,e.startColumn),i=this._model.nearestReference(t,n);if(i)return this._widget.setSelection(i).then((()=>{this._widget&&"editor"===this._editor.getOption(77)&&this._widget.focusOnPreviewEditor()}))}}));t.dispose()}),(e=>{this._notificationService.error(e)}))}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return __awaiter$K(this,void 0,void 0,(function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const n=this._model.nearestReference(this._editor.getModel().uri,t);if(!n)return;const i=this._model.nextOrPreviousReference(n,e),o=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(i),yield this._gotoReference(i),o?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()}))}revealReference(e){return __awaiter$K(this,void 0,void 0,(function*(){this._editor.hasModel()&&this._model&&this._widget&&(yield this._widget.revealReference(e))}))}closeWidget(e=!0){var t,n;null===(t=this._widget)||void 0===t||t.dispose(),null===(n=this._model)||void 0===n||n.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(t){this._widget&&this._widget.hide(),this._ignoreModelChangeEvent=!0;const n=Range$2.lift(t.range).collapseToStart();return this._editorService.openCodeEditor({resource:t.uri,options:{selection:n,selectionSource:"code.jump"}},this._editor).then((t=>{var i;if(this._ignoreModelChangeEvent=!1,t&&this._widget)if(this._editor===t)this._widget.show(n),this._widget.focusOnReferenceTree();else{const o=e.get(t),r=this._model.clone();this.closeWidget(),t.focus(),null==o||o.toggleWidget(n,createCancelablePromise((e=>Promise.resolve(r))),null!==(i=this._peekMode)&&void 0!==i&&i)}else this.closeWidget()}),(e=>{this._ignoreModelChangeEvent=!1,onUnexpectedError(e)}))}openReference(e,t,n){t||this.closeWidget();const{uri:i,range:o}=e;this._editorService.openCodeEditor({resource:i,options:{selection:o,selectionSource:"code.jump",pinned:n}},this._editor,t)}};function withController(e,t){const n=getOuterEditor(e);if(!n)return;const i=ReferencesController.get(n);i&&t(i)}ReferencesController.ID="editor.contrib.referencesController",ReferencesController=__decorate$17([__param$16(2,IContextKeyService),__param$16(3,ICodeEditorService),__param$16(4,INotificationService),__param$16(5,IInstantiationService),__param$16(6,IStorageService),__param$16(7,IConfigurationService)],ReferencesController),KeybindingsRegistry.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:KeyChord(2089,60),when:ContextKeyExpr.or(ctxReferenceSearchVisible,PeekContext.inPeekEditor),handler(e){withController(e,(e=>{e.changeFocusBetweenPreviewAndReferences()}))}}),KeybindingsRegistry.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:ContextKeyExpr.or(ctxReferenceSearchVisible,PeekContext.inPeekEditor),handler(e){withController(e,(e=>{e.goToNextOrPreviousReference(!0)}))}}),KeybindingsRegistry.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:ContextKeyExpr.or(ctxReferenceSearchVisible,PeekContext.inPeekEditor),handler(e){withController(e,(e=>{e.goToNextOrPreviousReference(!1)}))}}),CommandsRegistry.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference"),CommandsRegistry.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference"),CommandsRegistry.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch"),CommandsRegistry.registerCommand("closeReferenceSearch",(e=>withController(e,(e=>e.closeWidget())))),KeybindingsRegistry.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:ContextKeyExpr.and(PeekContext.inPeekEditor,ContextKeyExpr.not("config.editor.stablePeek"))}),KeybindingsRegistry.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:ContextKeyExpr.and(ctxReferenceSearchVisible,ContextKeyExpr.not("config.editor.stablePeek"))}),KeybindingsRegistry.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:ContextKeyExpr.and(ctxReferenceSearchVisible,WorkbenchListFocusContextKey,WorkbenchTreeElementCanCollapse.negate(),WorkbenchTreeElementCanExpand.negate()),handler(e){var t;const n=null===(t=e.get(IListService).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(n)&&n[0]instanceof OneReference&&withController(e,(e=>e.revealReference(n[0])))}}),KeybindingsRegistry.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:ContextKeyExpr.and(ctxReferenceSearchVisible,WorkbenchListFocusContextKey,WorkbenchTreeElementCanCollapse.negate(),WorkbenchTreeElementCanExpand.negate()),handler(e){var t;const n=null===(t=e.get(IListService).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(n)&&n[0]instanceof OneReference&&withController(e,(e=>e.openReference(n[0],!0,!0)))}}),CommandsRegistry.registerCommand("openReference",(e=>{var t;const n=null===(t=e.get(IListService).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(n)&&n[0]instanceof OneReference&&withController(e,(e=>e.openReference(n[0],!1,!0)))}));var __decorate$16=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$15=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const ctxHasSymbols=new RawContextKey("hasSymbols",!1,localize("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),ISymbolNavigationService=createDecorator("ISymbolNavigationService");let SymbolNavigationService=class{constructor(e,t,n,i){this._editorService=t,this._notificationService=n,this._keybindingService=i,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=ctxHasSymbols.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),null===(e=this._currentState)||void 0===e||e.dispose(),null===(t=this._currentMessage)||void 0===t||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1)return void this.reset();this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const n=new EditorState(this._editorService),i=n.onDidChange((e=>{if(this._ignoreEditorChange)return;const n=this._editorService.getActiveCodeEditor();if(!n)return;const i=n.getModel(),o=n.getPosition();if(!i||!o)return;let r=!1,s=!1;for(const a of t.references)if(isEqual(a.uri,i.uri))r=!0,s=s||Range$2.containsPosition(a.range,o);else if(r)break;r&&s||this.reset()}));this._currentState=combinedDisposable(n,i)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:Range$2.collapseToStart(t.range),selectionRevealType:3}},e).finally((()=>{this._ignoreEditorChange=!1}))}_showMessage(){var e;null===(e=this._currentMessage)||void 0===e||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),n=t?localize("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):localize("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(n)}};SymbolNavigationService=__decorate$16([__param$15(0,IContextKeyService),__param$15(1,ICodeEditorService),__param$15(2,INotificationService),__param$15(3,IKeybindingService)],SymbolNavigationService),registerSingleton(ISymbolNavigationService,SymbolNavigationService,!0),registerEditorCommand(new class extends EditorCommand{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:ctxHasSymbols,kbOpts:{weight:100,primary:70}})}runEditorCommand(e,t){return e.get(ISymbolNavigationService).revealNext(t)}}),KeybindingsRegistry.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:ctxHasSymbols,primary:9,handler(e){e.get(ISymbolNavigationService).reset()}});let EditorState=class{constructor(e){this._listener=new Map,this._disposables=new DisposableStore,this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),dispose(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,combinedDisposable(e.onDidChangeCursorPosition((t=>this._onDidChange.fire({editor:e}))),e.onDidChangeModelContent((t=>this._onDidChange.fire({editor:e})))))}_onDidRemoveEditor(e){var t;null===(t=this._listener.get(e))||void 0===t||t.dispose(),this._listener.delete(e)}};EditorState=__decorate$16([__param$15(0,ICodeEditorService)],EditorState);var __awaiter$J=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};function getLocationLinks(e,t,n,i){const o=n.ordered(e).map((n=>Promise.resolve(i(n,e,t)).then(void 0,(e=>{onUnexpectedExternalError(e)}))));return Promise.all(o).then((e=>{const t=[];for(let n of e)Array.isArray(n)?t.push(...n):n&&t.push(n);return t}))}function getDefinitionsAtPosition(e,t,n,i){return getLocationLinks(t,n,e,((e,t,n)=>e.provideDefinition(t,n,i)))}function getDeclarationsAtPosition(e,t,n,i){return getLocationLinks(t,n,e,((e,t,n)=>e.provideDeclaration(t,n,i)))}function getImplementationsAtPosition(e,t,n,i){return getLocationLinks(t,n,e,((e,t,n)=>e.provideImplementation(t,n,i)))}function getTypeDefinitionsAtPosition(e,t,n,i){return getLocationLinks(t,n,e,((e,t,n)=>e.provideTypeDefinition(t,n,i)))}function getReferencesAtPosition(e,t,n,i,o){return getLocationLinks(t,n,e,((e,t,n)=>__awaiter$J(this,void 0,void 0,(function*(){const r=yield e.provideReferences(t,n,{includeDeclaration:!0},o);if(!i||!r||2!==r.length)return r;const s=yield e.provideReferences(t,n,{includeDeclaration:!1},o);return s&&1===s.length?s:r}))))}function _sortedAndDeduped(e){return __awaiter$J(this,void 0,void 0,(function*(){const t=yield e(),n=new ReferencesModel(t,""),i=n.references.map((e=>e.link));return n.dispose(),i}))}registerModelAndPositionCommand("_executeDefinitionProvider",((e,t,n)=>{const i=getDefinitionsAtPosition(e.get(ILanguageFeaturesService).definitionProvider,t,n,CancellationToken.None);return _sortedAndDeduped((()=>i))})),registerModelAndPositionCommand("_executeTypeDefinitionProvider",((e,t,n)=>{const i=getTypeDefinitionsAtPosition(e.get(ILanguageFeaturesService).typeDefinitionProvider,t,n,CancellationToken.None);return _sortedAndDeduped((()=>i))})),registerModelAndPositionCommand("_executeDeclarationProvider",((e,t,n)=>{const i=getDeclarationsAtPosition(e.get(ILanguageFeaturesService).declarationProvider,t,n,CancellationToken.None);return _sortedAndDeduped((()=>i))})),registerModelAndPositionCommand("_executeReferenceProvider",((e,t,n)=>{const i=getReferencesAtPosition(e.get(ILanguageFeaturesService).referenceProvider,t,n,!1,CancellationToken.None);return _sortedAndDeduped((()=>i))})),registerModelAndPositionCommand("_executeImplementationProvider",((e,t,n)=>{const i=getImplementationsAtPosition(e.get(ILanguageFeaturesService).implementationProvider,t,n,CancellationToken.None);return _sortedAndDeduped((()=>i))}));var __awaiter$I=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},_a$7,_b,_c,_d,_e,_f,_g,_h;MenuRegistry.appendMenuItem(MenuId.EditorContext,{submenu:MenuId.EditorContextPeek,title:localize("peek.submenu","Peek"),group:"navigation",order:100});const _goToActionIds=new Set;function registerGoToAction(e){const t=new e;return registerInstantiatedEditorAction(t),_goToActionIds.add(t.id),t}class SymbolNavigationAnchor{constructor(e,t){this.model=e,this.position=t}static is(e){return!(!e||"object"!=typeof e)&&(e instanceof SymbolNavigationAnchor||!(!Position$1.isIPosition(e.position)||!e.model))}}class SymbolNavigationAction extends EditorAction{constructor(e,t){super(t),this.configuration=e}run(e,t,n){if(!t.hasModel())return Promise.resolve(void 0);const i=e.get(INotificationService),o=e.get(ICodeEditorService),r=e.get(IEditorProgressService),s=e.get(ISymbolNavigationService),a=e.get(ILanguageFeaturesService),l=t.getModel(),c=t.getPosition(),d=SymbolNavigationAnchor.is(n)?n:new SymbolNavigationAnchor(l,c),u=new EditorStateCancellationTokenSource(t,5),h=raceCancellation(this._getLocationModel(a,d.model,d.position,u.token),u.token).then((e=>__awaiter$I(this,void 0,void 0,(function*(){var n;if(!e||u.token.isCancellationRequested)return;let i;if(alert(e.ariaMessage),e.referenceAt(l.uri,c)){const e=this._getAlternativeCommand(t);e!==this.id&&_goToActionIds.has(e)&&(i=t.getAction(e))}const r=e.references.length;if(0===r){if(!this.configuration.muteMessage){const e=l.getWordAtPosition(c);null===(n=MessageController.get(t))||void 0===n||n.showMessage(this._getNoResultFoundMessage(e),c)}}else{if(1!==r||!i)return this._onResult(o,s,t,e);i.run()}}))),(e=>{i.error(e)})).finally((()=>{u.dispose()}));return r.showWhile(h,250),h}_onResult(e,t,n,i){return __awaiter$I(this,void 0,void 0,(function*(){const o=this._getGoToPreference(n);if(n instanceof EmbeddedCodeEditorWidget||!(this.configuration.openInPeek||"peek"===o&&i.references.length>1)){const r=i.firstReference(),s=i.references.length>1&&"gotoAndPeek"===o,a=yield this._openReference(n,e,r,this.configuration.openToSide,!s);s&&a?this._openInPeek(a,i):i.dispose(),"goto"===o&&t.put(r)}else this._openInPeek(n,i)}))}_openReference(e,t,n,i,o){return __awaiter$I(this,void 0,void 0,(function*(){let r;if(isLocationLink(n)&&(r=n.targetSelectionRange),r||(r=n.range),!r)return;const s=yield t.openCodeEditor({resource:n.uri,options:{selection:Range$2.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,i);if(s){if(o){const e=s.getModel(),t=s.deltaDecorations([],[{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout((()=>{s.getModel()===e&&s.deltaDecorations(t,[])}),350)}return s}}))}_openInPeek(e,t){const n=ReferencesController.get(e);n&&e.hasModel()?n.toggleWidget(e.getSelection(),createCancelablePromise((e=>Promise.resolve(t))),this.configuration.openInPeek):t.dispose()}}class DefinitionAction extends SymbolNavigationAction{_getLocationModel(e,t,n,i){return __awaiter$I(this,void 0,void 0,(function*(){return new ReferencesModel(yield getDefinitionsAtPosition(e.definitionProvider,t,n,i),localize("def.title","Definitions"))}))}_getNoResultFoundMessage(e){return e&&e.word?localize("noResultWord","No definition found for '{0}'",e.word):localize("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(51).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(51).multipleDefinitions}}const goToDefinitionKb=isWeb&&!isStandalone?2118:70;registerGoToAction((_a$7=class e extends DefinitionAction{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.id,label:localize("actions.goToDecl.label","Go to Definition"),alias:"Go to Definition",precondition:ContextKeyExpr.and(EditorContextKeys.hasDefinitionProvider,EditorContextKeys.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:goToDefinitionKb,weight:100},contextMenuOpts:{group:"navigation",order:1.1}}),CommandsRegistry.registerCommandAlias("editor.action.goToDeclaration",e.id)}},_a$7.id="editor.action.revealDefinition",_a$7)),registerGoToAction((_b=class e extends DefinitionAction{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:e.id,label:localize("actions.goToDeclToSide.label","Open Definition to the Side"),alias:"Open Definition to the Side",precondition:ContextKeyExpr.and(EditorContextKeys.hasDefinitionProvider,EditorContextKeys.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,goToDefinitionKb),weight:100}}),CommandsRegistry.registerCommandAlias("editor.action.openDeclarationToTheSide",e.id)}},_b.id="editor.action.revealDefinitionAside",_b)),registerGoToAction((_c=class e extends DefinitionAction{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.id,label:localize("actions.previewDecl.label","Peek Definition"),alias:"Peek Definition",precondition:ContextKeyExpr.and(EditorContextKeys.hasDefinitionProvider,PeekContext.notInPeekEditor,EditorContextKeys.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:582,linux:{primary:3140},weight:100},contextMenuOpts:{menuId:MenuId.EditorContextPeek,group:"peek",order:2}}),CommandsRegistry.registerCommandAlias("editor.action.previewDeclaration",e.id)}},_c.id="editor.action.peekDefinition",_c));class DeclarationAction extends SymbolNavigationAction{_getLocationModel(e,t,n,i){return __awaiter$I(this,void 0,void 0,(function*(){return new ReferencesModel(yield getDeclarationsAtPosition(e.declarationProvider,t,n,i),localize("decl.title","Declarations"))}))}_getNoResultFoundMessage(e){return e&&e.word?localize("decl.noResultWord","No declaration found for '{0}'",e.word):localize("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(51).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(51).multipleDeclarations}}registerGoToAction((_d=class e extends DeclarationAction{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.id,label:localize("actions.goToDeclaration.label","Go to Declaration"),alias:"Go to Declaration",precondition:ContextKeyExpr.and(EditorContextKeys.hasDeclarationProvider,EditorContextKeys.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{group:"navigation",order:1.3}})}_getNoResultFoundMessage(e){return e&&e.word?localize("decl.noResultWord","No declaration found for '{0}'",e.word):localize("decl.generic.noResults","No declaration found")}},_d.id="editor.action.revealDeclaration",_d)),registerGoToAction(class extends DeclarationAction{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",label:localize("actions.peekDecl.label","Peek Declaration"),alias:"Peek Declaration",precondition:ContextKeyExpr.and(EditorContextKeys.hasDeclarationProvider,PeekContext.notInPeekEditor,EditorContextKeys.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:MenuId.EditorContextPeek,group:"peek",order:3}})}});class TypeDefinitionAction extends SymbolNavigationAction{_getLocationModel(e,t,n,i){return __awaiter$I(this,void 0,void 0,(function*(){return new ReferencesModel(yield getTypeDefinitionsAtPosition(e.typeDefinitionProvider,t,n,i),localize("typedef.title","Type Definitions"))}))}_getNoResultFoundMessage(e){return e&&e.word?localize("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):localize("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(51).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(51).multipleTypeDefinitions}}registerGoToAction((_e=class e extends TypeDefinitionAction{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.ID,label:localize("actions.goToTypeDefinition.label","Go to Type Definition"),alias:"Go to Type Definition",precondition:ContextKeyExpr.and(EditorContextKeys.hasTypeDefinitionProvider,EditorContextKeys.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:0,weight:100},contextMenuOpts:{group:"navigation",order:1.4}})}},_e.ID="editor.action.goToTypeDefinition",_e)),registerGoToAction((_f=class e extends TypeDefinitionAction{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.ID,label:localize("actions.peekTypeDefinition.label","Peek Type Definition"),alias:"Peek Type Definition",precondition:ContextKeyExpr.and(EditorContextKeys.hasTypeDefinitionProvider,PeekContext.notInPeekEditor,EditorContextKeys.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:MenuId.EditorContextPeek,group:"peek",order:4}})}},_f.ID="editor.action.peekTypeDefinition",_f));class ImplementationAction extends SymbolNavigationAction{_getLocationModel(e,t,n,i){return __awaiter$I(this,void 0,void 0,(function*(){return new ReferencesModel(yield getImplementationsAtPosition(e.implementationProvider,t,n,i),localize("impl.title","Implementations"))}))}_getNoResultFoundMessage(e){return e&&e.word?localize("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):localize("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(51).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(51).multipleImplementations}}registerGoToAction((_g=class e extends ImplementationAction{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.ID,label:localize("actions.goToImplementation.label","Go to Implementations"),alias:"Go to Implementations",precondition:ContextKeyExpr.and(EditorContextKeys.hasImplementationProvider,EditorContextKeys.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:2118,weight:100},contextMenuOpts:{group:"navigation",order:1.45}})}},_g.ID="editor.action.goToImplementation",_g)),registerGoToAction((_h=class e extends ImplementationAction{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.ID,label:localize("actions.peekImplementation.label","Peek Implementations"),alias:"Peek Implementations",precondition:ContextKeyExpr.and(EditorContextKeys.hasImplementationProvider,PeekContext.notInPeekEditor,EditorContextKeys.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3142,weight:100},contextMenuOpts:{menuId:MenuId.EditorContextPeek,group:"peek",order:5}})}},_h.ID="editor.action.peekImplementation",_h));class ReferencesAction extends SymbolNavigationAction{_getNoResultFoundMessage(e){return e?localize("references.no","No references found for '{0}'",e.word):localize("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(51).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(51).multipleReferences}}registerGoToAction(class extends ReferencesAction{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",label:localize("goToReferences.label","Go to References"),alias:"Go to References",precondition:ContextKeyExpr.and(EditorContextKeys.hasReferenceProvider,PeekContext.notInPeekEditor,EditorContextKeys.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:1094,weight:100},contextMenuOpts:{group:"navigation",order:1.45}})}_getLocationModel(e,t,n,i){return __awaiter$I(this,void 0,void 0,(function*(){return new ReferencesModel(yield getReferencesAtPosition(e.referenceProvider,t,n,!0,i),localize("ref.title","References"))}))}}),registerGoToAction(class extends ReferencesAction{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",label:localize("references.action.label","Peek References"),alias:"Peek References",precondition:ContextKeyExpr.and(EditorContextKeys.hasReferenceProvider,PeekContext.notInPeekEditor,EditorContextKeys.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:MenuId.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,n,i){return __awaiter$I(this,void 0,void 0,(function*(){return new ReferencesModel(yield getReferencesAtPosition(e.referenceProvider,t,n,!1,i),localize("ref.title","References"))}))}});class GenericGoToLocationAction extends SymbolNavigationAction{constructor(e,t,n){super(e,{id:"editor.action.goToLocation",label:localize("label.generic","Go to Any Symbol"),alias:"Go to Any Symbol",precondition:ContextKeyExpr.and(PeekContext.notInPeekEditor,EditorContextKeys.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=n}_getLocationModel(e,t,n,i){return __awaiter$I(this,void 0,void 0,(function*(){return new ReferencesModel(this._references,localize("generic.title","Locations"))}))}_getNoResultFoundMessage(e){return e&&localize("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return null!==(t=this._gotoMultipleBehaviour)&&void 0!==t?t:e.getOption(51).multipleReferences}_getAlternativeCommand(){return""}}CommandsRegistry.registerCommand({id:"editor.action.goToLocations",description:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:URI},{name:"position",description:"The position at which to start",constraint:Position$1.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:(e,t,n,i,o,r,s)=>__awaiter$I(void 0,void 0,void 0,(function*(){assertType(URI.isUri(t)),assertType(Position$1.isIPosition(n)),assertType(Array.isArray(i)),assertType(void 0===o||"string"==typeof o),assertType(void 0===s||"boolean"==typeof s);const a=e.get(ICodeEditorService),l=yield a.openCodeEditor({resource:t},a.getFocusedCodeEditor());if(isCodeEditor(l))return l.setPosition(n),l.revealPositionInCenterIfOutsideViewport(n,0),l.invokeWithinContext((e=>{const t=new class extends GenericGoToLocationAction{_getNoResultFoundMessage(e){return r||super._getNoResultFoundMessage(e)}}({muteMessage:!Boolean(r),openInPeek:Boolean(s),openToSide:!1},i,o);e.get(IInstantiationService).invokeFunction(t.run.bind(t),l)}))}))}),CommandsRegistry.registerCommand({id:"editor.action.peekLocations",description:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:URI},{name:"position",description:"The position at which to start",constraint:Position$1.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:(e,t,n,i,o)=>__awaiter$I(void 0,void 0,void 0,(function*(){e.get(ICommandService).executeCommand("editor.action.goToLocations",t,n,i,o,void 0,!0)}))}),CommandsRegistry.registerCommand({id:"editor.action.findReferences",handler:(e,t,n)=>{assertType(URI.isUri(t)),assertType(Position$1.isIPosition(n));const i=e.get(ILanguageFeaturesService),o=e.get(ICodeEditorService);return o.openCodeEditor({resource:t},o.getFocusedCodeEditor()).then((e=>{if(!isCodeEditor(e)||!e.hasModel())return;const t=ReferencesController.get(e);if(!t)return;const o=createCancelablePromise((t=>getReferencesAtPosition(i.referenceProvider,e.getModel(),Position$1.lift(n),!1,t).then((e=>new ReferencesModel(e,localize("ref.title","References")))))),r=new Range$2(n.lineNumber,n.column,n.lineNumber,n.column);return Promise.resolve(t.toggleWidget(r,o,!1))}))}}),CommandsRegistry.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations"),MenuRegistry.appendMenuItems([{id:MenuId.MenubarGoMenu,item:{command:{id:"editor.action.revealDefinition",title:localize({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},group:"4_symbol_nav",order:2}},{id:MenuId.MenubarGoMenu,item:{command:{id:"editor.action.revealDeclaration",title:localize({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},group:"4_symbol_nav",order:3}},{id:MenuId.MenubarGoMenu,item:{command:{id:"editor.action.goToTypeDefinition",title:localize({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},group:"4_symbol_nav",order:3}},{id:MenuId.MenubarGoMenu,item:{command:{id:"editor.action.goToImplementation",title:localize({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},group:"4_symbol_nav",order:4}},{id:MenuId.MenubarGoMenu,item:{command:{id:"editor.action.goToReferences",title:localize({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},group:"4_symbol_nav",order:5}}]);var __decorate$15=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$14=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let GotoDefinitionAtPositionEditorContribution=class e{constructor(e,t,n,i){this.textModelResolverService=t,this.languageService=n,this.languageFeaturesService=i,this.toUnhook=new DisposableStore,this.toUnhookForKeyboard=new DisposableStore,this.linkDecorations=[],this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e;let o=new ClickLinkGesture(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown((([e,t])=>{this.startFindDefinitionFromMouse(e,withNullAsUndefined(t))}))),this.toUnhook.add(o.onExecute((e=>{this.isEnabled(e)&&this.gotoDefinition(e.target.position,e.hasSideBySideModifier).then((()=>{this.removeLinkDecorations()}),(e=>{this.removeLinkDecorations(),onUnexpectedError(e)}))}))),this.toUnhook.add(o.onCancel((()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null})))}static get(t){return t.getContribution(e.ID)}startFindDefinitionFromCursor(e){return this.startFindDefinition(e).then((()=>{this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition((()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()}))),this.toUnhookForKeyboard.add(this.editor.onKeyDown((e=>{e&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())})))}))}startFindDefinitionFromMouse(e,t){if(9===e.target.type&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t))return this.currentWordAtPosition=null,void this.removeLinkDecorations();const n=e.target.position;this.startFindDefinition(n)}startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();const n=e?null===(t=this.editor.getModel())||void 0===t?void 0:t.getWordAtPosition(e):null;if(!n)return this.currentWordAtPosition=null,this.removeLinkDecorations(),Promise.resolve(0);if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===n.startColumn&&this.currentWordAtPosition.endColumn===n.endColumn&&this.currentWordAtPosition.word===n.word)return Promise.resolve(0);this.currentWordAtPosition=n;let i=new EditorState$1(this.editor,15);return this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=createCancelablePromise((t=>this.findDefinition(e,t))),this.previousPromise.then((t=>{if(t&&t.length&&i.validate(this.editor))if(t.length>1)this.addDecoration(new Range$2(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn),(new MarkdownString).appendText(localize("multipleResults","Click to show {0} definitions.",t.length)));else{let i=t[0];if(!i.uri)return;this.textModelResolverService.createModelReference(i.uri).then((t=>{if(!t.object||!t.object.textEditorModel)return void t.dispose();const{object:{textEditorModel:o}}=t,{startLineNumber:r}=i.range;if(r<1||r>o.getLineCount())return void t.dispose();const s=this.getPreviewValue(o,r,i);let a;a=i.originSelectionRange?Range$2.lift(i.originSelectionRange):new Range$2(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn);const l=this.languageService.guessLanguageIdByFilepathOrFirstLine(o.uri);this.addDecoration(a,(new MarkdownString).appendCodeblock(l||"",s)),t.dispose()}))}else this.removeLinkDecorations()})).then(void 0,onUnexpectedError)}getPreviewValue(t,n,i){let o=i.targetSelectionRange?i.range:this.getPreviewRangeBasedOnBrackets(t,n);o.endLineNumber-o.startLineNumber>=e.MAX_SOURCE_PREVIEW_LINES&&(o=this.getPreviewRangeBasedOnIndentation(t,n));return this.stripIndentationFromPreviewRange(t,n,o)}stripIndentationFromPreviewRange(e,t,n){let i=e.getLineFirstNonWhitespaceColumn(t);for(let o=t+1;o<n.endLineNumber;o++){const t=e.getLineFirstNonWhitespaceColumn(o);i=Math.min(i,t)}return e.getValueInRange(n).replace(new RegExp(`^\\s{${i-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(t,n){const i=t.getLineFirstNonWhitespaceColumn(n),o=Math.min(t.getLineCount(),n+e.MAX_SOURCE_PREVIEW_LINES);let r=n+1;for(;r<o;r++){if(i===t.getLineFirstNonWhitespaceColumn(r))break}return new Range$2(n,1,r+1,1)}getPreviewRangeBasedOnBrackets(t,n){const i=Math.min(t.getLineCount(),n+e.MAX_SOURCE_PREVIEW_LINES),o=[];let r=!0,s=t.bracketPairs.findNextBracket(new Position$1(n,1));for(;null!==s;){if(0===o.length)o.push(s);else{const e=o[o.length-1];if(e.open[0]===s.open[0]&&e.isOpen&&!s.isOpen?o.pop():o.push(s),0===o.length){if(!r)return new Range$2(n,1,s.range.endLineNumber+1,1);r=!1}}const e=t.getLineMaxColumn(n);let a=s.range.endLineNumber,l=s.range.endColumn;if(e===s.range.endColumn&&(a++,l=1),a>i)return new Range$2(n,1,i+1,1);s=t.bracketPairs.findNextBracket(new Position$1(a,l))}return new Range$2(n,1,i+1,1)}addDecoration(e,t){const n={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations=this.editor.deltaDecorations(this.linkDecorations,[n])}removeLinkDecorations(){this.linkDecorations.length>0&&(this.linkDecorations=this.editor.deltaDecorations(this.linkDecorations,[]))}isEnabled(e,t){return this.editor.hasModel()&&e.isNoneOrSingleMouseDown&&6===e.target.type&&(e.hasTriggerModifier||!!t&&t.keyCodeIsTriggerKey)&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){const n=this.editor.getModel();return n?getDefinitionsAtPosition(this.languageFeaturesService.definitionProvider,n,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext((e=>{const n=!t&&this.editor.getOption(78)&&!this.isInPeekEditor(e);return new DefinitionAction({openToSide:t,openInPeek:n,muteMessage:!0},{alias:"",label:"",id:"",precondition:void 0}).run(e,this.editor)}))}isInPeekEditor(e){const t=e.get(IContextKeyService);return PeekContext.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose()}};GotoDefinitionAtPositionEditorContribution.ID="editor.contrib.gotodefinitionatposition",GotoDefinitionAtPositionEditorContribution.MAX_SOURCE_PREVIEW_LINES=8,GotoDefinitionAtPositionEditorContribution=__decorate$15([__param$14(1,ITextModelService),__param$14(2,ILanguageService),__param$14(3,ILanguageFeaturesService)],GotoDefinitionAtPositionEditorContribution),registerEditorContribution(GotoDefinitionAtPositionEditorContribution.ID,GotoDefinitionAtPositionEditorContribution),registerThemingParticipant(((e,t)=>{const n=e.getColor(editorActiveLinkForeground);n&&t.addRule(`.monaco-editor .goto-definition-link { color: ${n} !important; }`)}));var hover="";const $$a=$$c;class HoverWidget extends Disposable{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new DomScrollableElement(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class HoverAction extends Disposable{constructor(e,t,n){super(),this.actionContainer=append$1(e,$$a("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=append$1(this.actionContainer,$$a("a.action")),this.action.setAttribute("role","button"),t.iconClass&&append$1(this.action,$$a(`span.icon.${t.iconClass}`));append$1(this.action,$$a("span")).textContent=n?`${t.label} (${n})`:t.label,this._register(addDisposableListener(this.actionContainer,EventType$1.CLICK,(e=>{e.stopPropagation(),e.preventDefault(),t.run(this.actionContainer)}))),this._register(addDisposableListener(this.actionContainer,EventType$1.KEY_UP,(e=>{new StandardKeyboardEvent(e).equals(3)&&(e.stopPropagation(),e.preventDefault(),t.run(this.actionContainer))}))),this.setEnabled(!0)}static render(e,t,n){return new HoverAction(e,t,n)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}var __awaiter$H=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},__asyncValues$1=globalThis&&globalThis.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise((function(i,o){(function(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)})(i,o,(t=e[n](t)).done,t.value)}))}}};class HoverResult{constructor(e,t,n){this.value=e,this.isComplete=t,this.hasLoadingMessage=n}}class HoverOperation extends Disposable{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new Emitter$1),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new RunOnceScheduler((()=>this._triggerAsyncComputation()),0)),this._secondWaitScheduler=this._register(new RunOnceScheduler((()=>this._triggerSyncComputation()),0)),this._loadingMessageScheduler=this._register(new RunOnceScheduler((()=>this._triggerLoadingMessage()),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(53).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=createCancelableAsyncIterable((e=>this._computer.computeAsync(e))),(()=>{__awaiter$H(this,void 0,void 0,(function*(){var e,t;try{try{for(var n,i=__asyncValues$1(this._asyncIterable);!(n=yield i.next()).done;){const e=n.value;e&&(this._result.push(e),this._fireResult())}}catch(o){e={error:o}}finally{try{n&&!n.done&&(t=i.return)&&(yield t.call(i))}finally{if(e)throw e.error}}this._asyncIterableDone=!0,3!==this._state&&4!==this._state||this._setState(0)}catch(e2){onUnexpectedError(e2)}}))})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){3===this._state&&this._setState(4)}_fireResult(){if(1===this._state||2===this._state)return;const e=0===this._state,t=4===this._state;this._onResult.fire(new HoverResult(this._result.slice(0),e,t))}start(e){if(0===e)0===this._state&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation()}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(0,!1)}}class HoverRangeAnchor{constructor(e,t){this.priority=e,this.range=t,this.type=1}equals(e){return 1===e.type&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return 1===e.type&&t.lineNumber===this.range.startLineNumber}}class HoverForeignElementAnchor{constructor(e,t,n){this.priority=e,this.owner=t,this.range=n,this.type=2}equals(e){return 2===e.type&&this.owner===e.owner}canAdoptVisibleHover(e,t){return 2===e.type&&this.owner===e.owner}}const HoverParticipantRegistry=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class Scanner{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return 95===e||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let e,t=this.pos,n=0,i=this.value.charCodeAt(t);if(e=Scanner._table[i],"number"==typeof e)return this.pos+=1,{type:e,pos:t,len:1};if(Scanner.isDigitCharacter(i)){e=8;do{n+=1,i=this.value.charCodeAt(t+n)}while(Scanner.isDigitCharacter(i));return this.pos+=n,{type:e,pos:t,len:n}}if(Scanner.isVariableCharacter(i)){e=9;do{i=this.value.charCodeAt(t+ ++n)}while(Scanner.isVariableCharacter(i)||Scanner.isDigitCharacter(i));return this.pos+=n,{type:e,pos:t,len:n}}e=10;do{n+=1,i=this.value.charCodeAt(t+n)}while(!isNaN(i)&&void 0===Scanner._table[i]&&!Scanner.isDigitCharacter(i)&&!Scanner.isVariableCharacter(i));return this.pos+=n,{type:e,pos:t,len:n}}}Scanner._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class Marker{constructor(){this._children=[]}appendChild(e){return e instanceof Text&&this._children[this._children.length-1]instanceof Text?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:n}=e,i=n.children.indexOf(e),o=n.children.slice(0);o.splice(i,1,...t),n._children=o,function e(t,n){for(const i of t)i.parent=n,e(i.children,i)}(t,n)}get children(){return this._children}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof TextmateSnippet)return e;e=e.parent}}toString(){return this.children.reduce(((e,t)=>e+t.toString()),"")}len(){return 0}}class Text extends Marker{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Text(this.value)}}class TransformableMarker extends Marker{}class Placeholder extends TransformableMarker{constructor(e){super(),this.index=e}static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}get isFinalTabstop(){return 0===this.index}get choice(){return 1===this._children.length&&this._children[0]instanceof Choice?this._children[0]:void 0}clone(){let e=new Placeholder(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map((e=>e.clone())),e}}class Choice extends Marker{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Text&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let e=new Choice;return this.options.forEach(e.appendChild,e),e}}class Transform extends Marker{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let n=!1,i=e.replace(this.regexp,(function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))}));return!n&&this._children.some((e=>e instanceof FormatString&&Boolean(e.elseValue)))&&(i=this._replace([])),i}_replace(e){let t="";for(const n of this._children)if(n instanceof FormatString){let i=e[n.index]||"";i=n.resolve(i),t+=i}else t+=n.toString();return t}toString(){return""}clone(){let e=new Transform;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map((e=>e.clone())),e}}class FormatString extends Marker{constructor(e,t,n,i){super(),this.index=e,this.shorthandName=t,this.ifValue=n,this.elseValue=i}resolve(e){return"upcase"===this.shorthandName?e?e.toLocaleUpperCase():"":"downcase"===this.shorthandName?e?e.toLocaleLowerCase():"":"capitalize"===this.shorthandName?e?e[0].toLocaleUpperCase()+e.substr(1):"":"pascalcase"===this.shorthandName?e?this._toPascalCase(e):"":"camelcase"===this.shorthandName?e?this._toCamelCase(e):"":Boolean(e)&&"string"==typeof this.ifValue?this.ifValue:Boolean(e)||"string"!=typeof this.elseValue?e||"":this.elseValue}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase())).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(((e,t)=>0===t?e.toLowerCase():e.charAt(0).toUpperCase()+e.substr(1).toLowerCase())).join(""):e}clone(){return new FormatString(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class Variable extends TransformableMarker{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),void 0!==t&&(this._children=[new Text(t)],!0)}clone(){const e=new Variable(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map((e=>e.clone())),e}}function walk(e,t){const n=[...e];for(;n.length>0;){const e=n.shift();if(!t(e))break;n.unshift(...e.children)}}class TextmateSnippet extends Marker{get placeholderInfo(){if(!this._placeholders){let e,t=[];this.walk((function(n){return n instanceof Placeholder&&(t.push(n),e=!e||e.index<n.index?n:e),!0})),this._placeholders={all:t,last:e}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,n=!1;return this.walk((i=>i===e?(n=!0,!1):(t+=i.len(),!0))),n?t:-1}fullLen(e){let t=0;return walk([e],(e=>(t+=e.len(),!0))),t}enclosingPlaceholders(e){let t=[],{parent:n}=e;for(;n;)n instanceof Placeholder&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk((t=>(t instanceof Variable&&t.resolve(e)&&(this._placeholders=void 0),!0))),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){let e=new TextmateSnippet;return this._children=this.children.map((e=>e.clone())),e}walk(e){walk(this.children,e)}}class SnippetParser{constructor(){this._scanner=new Scanner,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,n){this._scanner.text(e),this._token=this._scanner.next();const i=new TextmateSnippet;for(;this._parse(i););const o=new Map,r=[];let s=0;i.walk((e=>(e instanceof Placeholder&&(s+=1,e.isFinalTabstop?o.set(0,void 0):!o.has(e.index)&&e.children.length>0?o.set(e.index,e.children):r.push(e)),!0)));for(const a of r){const e=o.get(a.index);if(e){const t=new Placeholder(a.index);t.transform=a.transform;for(const n of e)t.appendChild(n.clone());i.replace(a,[t])}}return n||(n=s>0&&t),!o.has(0)&&n&&i.appendChild(new Placeholder(0)),i}_accept(e,t){if(void 0===e||this._token.type===e){let e=!t||this._scanner.tokenText(this._token);return this._token=this._scanner.next(),e}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(14===this._token.type)return!1;if(5===this._token.type){const e=this._scanner.next();if(0!==e.type&&4!==e.type&&5!==e.type)return!1}this._token=this._scanner.next()}const n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),n}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return!!(t=this._accept(5,!0))&&(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new Text(t)),!0)}_parseTabstopOrVariableName(e){let t;const n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Placeholder(Number(t)):new Variable(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);const i=new Placeholder(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(i),!0;if(!this._parse(i))return e.appendChild(new Text("${"+t+":")),i.children.forEach(e.appendChild,e),!0}else{if(!(i.index>0&&this._accept(7)))return this._accept(6)?this._parseTransform(i)?(e.appendChild(i),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(i),!0):this._backTo(n);{const t=new Choice;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(i.appendChild(t),this._accept(4)))return e.appendChild(i),!0}return this._backTo(n),!1}}}}_parseChoiceElement(e){const t=this._token,n=[];for(;2!==this._token.type&&7!==this._token.type;){let e;if(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0),!e)return this._backTo(t),!1;n.push(e)}return 0===n.length?(this._backTo(t),!1):(e.appendChild(new Text(n.join(""))),!0)}_parseComplexVariable(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);const i=new Variable(t);if(!this._accept(1))return this._accept(6)?this._parseTransform(i)?(e.appendChild(i),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(i),!0):this._backTo(n);for(;;){if(this._accept(4))return e.appendChild(i),!0;if(!this._parse(i))return e.appendChild(new Text("${"+t+":")),i.children.forEach(e.appendChild,e),!0}}_parseTransform(e){let t=new Transform,n="",i="";for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(6,!0)||e,n+=e;else{if(14===this._token.type)return!1;n+=this._accept(void 0,!0)}}for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new Text(e));else if(!this._parseFormatString(t)&&!this._parseAnything(t))return!1}for(;!this._accept(4);){if(14===this._token.type)return!1;i+=this._accept(void 0,!0)}try{t.regexp=new RegExp(n,i)}catch(e2){return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);let i=this._accept(8,!0);if(!i)return this._backTo(t),!1;if(!n)return e.appendChild(new FormatString(Number(i))),!0;if(this._accept(4))return e.appendChild(new FormatString(Number(i))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){let n=this._accept(9,!0);return n&&this._accept(4)?(e.appendChild(new FormatString(Number(i),n)),!0):(this._backTo(t),!1)}if(this._accept(11)){let t=this._until(4);if(t)return e.appendChild(new FormatString(Number(i),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new FormatString(Number(i),void 0,void 0,t)),!0}else if(this._accept(13)){let t=this._until(1);if(t){let n=this._until(4);if(n)return e.appendChild(new FormatString(Number(i),void 0,t,n)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new FormatString(Number(i),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return 14!==this._token.type&&(e.appendChild(new Text(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}}var checkbox="";const defaultOpts$2={inputActiveOptionBorder:Color.fromHex("#007ACC00"),inputActiveOptionForeground:Color.fromHex("#FFFFFF"),inputActiveOptionBackground:Color.fromHex("#0E639C50")};class Checkbox extends Widget{constructor(e){super(),this._onChange=this._register(new Emitter$1),this.onChange=this._onChange.event,this._onKeyDown=this._register(new Emitter$1),this.onKeyDown=this._onKeyDown.event,this._opts=Object.assign(Object.assign({},defaultOpts$2),e),this._checked=this._opts.isChecked;const t=["monaco-custom-checkbox"];this._opts.icon&&t.push(...CSSIcon.asClassNameArray(this._opts.icon)),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=this._opts.title,this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,(e=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),e.preventDefault())})),this.ignoreGesture(this.domNode),this.onkeydown(this.domNode,(e=>{if(10===e.keyCode||3===e.keyCode)return this.checked=!this._checked,this._onChange.fire(!0),void e.preventDefault();this._onKeyDown.fire(e)}))}get enabled(){return"true"!==this.domNode.getAttribute("aria-disabled")}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 22}style(e){e.inputActiveOptionBorder&&(this._opts.inputActiveOptionBorder=e.inputActiveOptionBorder),e.inputActiveOptionForeground&&(this._opts.inputActiveOptionForeground=e.inputActiveOptionForeground),e.inputActiveOptionBackground&&(this._opts.inputActiveOptionBackground=e.inputActiveOptionBackground),this.applyStyles()}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder?this._opts.inputActiveOptionBorder.toString():"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground?this._opts.inputActiveOptionForeground.toString():"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground?this._opts.inputActiveOptionBackground.toString():"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const NLS_CASE_SENSITIVE_CHECKBOX_LABEL=localize("caseDescription","Match Case"),NLS_WHOLE_WORD_CHECKBOX_LABEL=localize("wordsDescription","Match Whole Word"),NLS_REGEX_CHECKBOX_LABEL=localize("regexDescription","Use Regular Expression");class CaseSensitiveCheckbox extends Checkbox{constructor(e){super({icon:Codicon.caseSensitive,title:NLS_CASE_SENSITIVE_CHECKBOX_LABEL+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class WholeWordsCheckbox extends Checkbox{constructor(e){super({icon:Codicon.wholeWord,title:NLS_WHOLE_WORD_CHECKBOX_LABEL+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class RegexCheckbox extends Checkbox{constructor(e){super({icon:Codicon.regex,title:NLS_REGEX_CHECKBOX_LABEL+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}function renderText(e,t={}){const n=createElement(t);return n.textContent=e,n}function renderFormattedText(e,t={}){const n=createElement(t);return _renderFormattedText(n,parseFormattedText(e,!!t.renderCodeSegments),t.actionHandler,t.renderCodeSegments),n}function createElement(e){const t=e.inline?"span":"div",n=document.createElement(t);return e.className&&(n.className=e.className),n}class StringStream{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function _renderFormattedText(e,t,n,i){let o;if(2===t.type)o=document.createTextNode(t.content||"");else if(3===t.type)o=document.createElement("b");else if(4===t.type)o=document.createElement("i");else if(7===t.type&&i)o=document.createElement("code");else if(5===t.type&&n){const e=document.createElement("a");n.disposables.add(addStandardDisposableListener(e,"click",(e=>{n.callback(String(t.index),e)}))),o=e}else 8===t.type?o=document.createElement("br"):1===t.type&&(o=e);o&&e!==o&&e.appendChild(o),o&&Array.isArray(t.children)&&t.children.forEach((e=>{_renderFormattedText(o,e,n,i)}))}function parseFormattedText(e,t){const n={type:1,children:[]};let i=0,o=n;const r=[],s=new StringStream(e);for(;!s.eos();){let e=s.next();const n="\\"===e&&0!==formatTagType(s.peek(),t);if(n&&(e=s.next()),!n&&isFormatTag(e,t)&&e===s.peek()){s.advance(),2===o.type&&(o=r.pop());const n=formatTagType(e,t);if(o.type===n||5===o.type&&6===n)o=r.pop();else{const e={type:n,children:[]};5===n&&(e.index=i,i++),o.children.push(e),r.push(o),o=e}}else if("\n"===e)2===o.type&&(o=r.pop()),o.children.push({type:8});else if(2!==o.type){const t={type:2,content:e};o.children.push(t),r.push(o),o=t}else o.content+=e}return 2===o.type&&(o=r.pop()),n}function isFormatTag(e,t){return 0!==formatTagType(e,t)}function formatTagType(e,t){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return t?7:0;default:return 0}}class ArrayNavigator{constructor(e,t=0,n=e.length,i=t-1){this.items=e,this.start=t,this.end=n,this.index=i}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class HistoryNavigator{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._currentPosition()!==this._elements.length-1?this._navigator.next():null}previous(){return 0!==this._currentPosition()?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new ArrayNavigator(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach((t=>e.push(t))),e}}var inputBox="";const $$9=$$c,defaultOpts$1={inputBackground:Color.fromHex("#3C3C3C"),inputForeground:Color.fromHex("#CCCCCC"),inputValidationInfoBorder:Color.fromHex("#55AAFF"),inputValidationInfoBackground:Color.fromHex("#063B49"),inputValidationWarningBorder:Color.fromHex("#B89500"),inputValidationWarningBackground:Color.fromHex("#352A05"),inputValidationErrorBorder:Color.fromHex("#BE1100"),inputValidationErrorBackground:Color.fromHex("#5A1D1D")};class InputBox extends Widget{constructor(e,t,n){var i;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new Emitter$1),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new Emitter$1),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=n||Object.create(null),mixin(this.options,defaultOpts$1,!1),this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=null!==(i=this.options.tooltip)&&void 0!==i?i:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.inputBackground=this.options.inputBackground,this.inputForeground=this.options.inputForeground,this.inputBorder=this.options.inputBorder,this.inputValidationInfoBorder=this.options.inputValidationInfoBorder,this.inputValidationInfoBackground=this.options.inputValidationInfoBackground,this.inputValidationInfoForeground=this.options.inputValidationInfoForeground,this.inputValidationWarningBorder=this.options.inputValidationWarningBorder,this.inputValidationWarningBackground=this.options.inputValidationWarningBackground,this.inputValidationWarningForeground=this.options.inputValidationWarningForeground,this.inputValidationErrorBorder=this.options.inputValidationErrorBorder,this.inputValidationErrorBackground=this.options.inputValidationErrorBackground,this.inputValidationErrorForeground=this.options.inputValidationErrorForeground,this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=append$1(e,$$9(".monaco-inputbox.idle"));let o=this.options.flexibleHeight?"textarea":"input",r=append$1(this.element,$$9(".ibwrapper"));if(this.input=append$1(r,$$9(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,(()=>this.element.classList.add("synthetic-focus"))),this.onblur(this.input,(()=>this.element.classList.remove("synthetic-focus"))),this.options.flexibleHeight){this.maxHeight="number"==typeof this.options.flexibleMaxHeight?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=append$1(r,$$9("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new ScrollableElement(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),append$1(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll((e=>this.input.scrollTop=e.scrollTop)));const t=this._register(new DomEmitter(document,"selectionchange")),n=Event$1.filter(t.event,(()=>{const e=document.getSelection();return(null==e?void 0:e.anchorNode)===r}));this._register(n(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,(()=>this.onValueChange())),this.onblur(this.input,(()=>this.onBlur())),this.onfocus(this.input,(()=>this.onFocus())),this.ignoreGesture(this.input),setTimeout((()=>this.updateMirror()),0),this.options.actions&&(this.actionbar=this._register(new ActionBar(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}setAriaLabel(e){this.ariaLabel=e,e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label")}getAriaLabel(){return this.ariaLabel}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return"number"==typeof this.cachedHeight?this.cachedHeight:getTotalHeight(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}get width(){return getTotalWidth(this.input)}set width(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){let t=0;if(this.mirror){t=(parseFloat(this.mirror.style.paddingLeft||"")||0)+(parseFloat(this.mirror.style.paddingRight||"")||0)}this.input.style.width=e-t+"px"}else this.input.style.width=e+"px";this.mirror&&(this.mirror.style.width=e+"px")}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if("number"!=typeof this.cachedContentHeight||"number"!=typeof this.cachedHeight||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,n=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:n})}showMessage(e,t){this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const n=this.stylesForType(this.message.type);this.element.style.border=n.border?`1px solid ${n.border}`:"",(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),null==e?void 0:e.type}stylesForType(e){switch(e){case 1:return{border:this.inputValidationInfoBorder,background:this.inputValidationInfoBackground,foreground:this.inputValidationInfoForeground};case 2:return{border:this.inputValidationWarningBorder,background:this.inputValidationWarningBackground,foreground:this.inputValidationWarningForeground};default:return{border:this.inputValidationErrorBorder,background:this.inputValidationErrorBackground,foreground:this.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e,t,n=()=>e.style.width=getTotalWidth(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:t=>{if(!this.message)return null;e=append$1(t,$$9(".monaco-inputbox-container")),n();const i={inline:!0,className:"monaco-inputbox-message"},o=this.message.formatContent?renderFormattedText(this.message.content,i):renderText(this.message.content,i);o.classList.add(this.classForType(this.message.type));const r=this.stylesForType(this.message.type);return o.style.backgroundColor=r.background?r.background.toString():"",o.style.color=r.foreground?r.foreground.toString():"",o.style.border=r.border?`1px solid ${r.border}`:"",append$1(e,o),null},onHide:()=>{this.state="closed"},layout:n}),t=3===this.message.type?localize("alertErrorMessage","Error: {0}",this.message.content):2===this.message.type?localize("alertWarningMessage","Warning: {0}",this.message.content):localize("alertInfoMessage","Info: {0}",this.message.content),alert(t),this.state="open"}_hideMessage(){this.contextViewProvider&&("open"===this.state&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),"open"===this.state&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,t=10===e.charCodeAt(e.length-1)?" ":"";(e+t).replace(/\u000c/g,"")?this.mirror.textContent=e+t:this.mirror.innerText=" ",this.layout()}style(e){this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){const e=this.inputBackground?this.inputBackground.toString():"",t=this.inputForeground?this.inputForeground.toString():"",n=this.inputBorder?this.inputBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.input.style.backgroundColor="inherit",this.input.style.color=t,this.element.style.borderWidth=n?"1px":"",this.element.style.borderStyle=n?"solid":"",this.element.style.borderColor=n}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=getTotalHeight(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,n=t.selectionStart,i=t.selectionEnd,o=t.value;null!==n&&null!==i&&(this.value=o.substr(0,n)+e+o.substr(i),t.setSelectionRange(n+1,n+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar&&this.actionbar.dispose(),super.dispose()}}class HistoryInputBox extends InputBox{constructor(e,t,n){const i=localize({key:"history.inputbox.hint",comment:["Text will be prefixed with ⇅ plus a single space, then used as a hint where input field keeps history"]},"for history"),o=` or ⇅ ${i}`,r=` (⇅ ${i})`;super(e,t,n),this.history=new HistoryNavigator(n.history,100);const s=()=>{if(n.showHistoryHint&&n.showHistoryHint()&&!this.placeholder.endsWith(o)&&!this.placeholder.endsWith(r)&&this.history.getHistory().length){const e=this.placeholder.endsWith(")")?o:r,t=this.placeholder+e;n.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=t:this.setPlaceHolder(t)}};this.observer=new MutationObserver(((e,t)=>{e.forEach((e=>{e.target.textContent||s()}))})),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,(()=>s())),this.onblur(this.input,(()=>{const e=e=>{if(this.placeholder.endsWith(e)){const t=this.placeholder.slice(0,this.placeholder.length-e.length);return n.showPlaceholderOnFocus?this.placeholder=t:this.setPlaceHolder(t),!0}return!1};e(r)||e(o)}))}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(){this.value&&this.value!==this.getCurrentValue()&&this.history.add(this.value)}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),e&&(this.value=e,status(this.value))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,status(this.value))}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()||this.history.last()}}var findInput="";const NLS_DEFAULT_LABEL$1=localize("defaultLabel","input");class FindInput extends Widget{constructor(e,t,n,i){super(),this._showOptionButtons=n,this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this._onDidOptionChange=this._register(new Emitter$1),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new Emitter$1),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new Emitter$1),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new Emitter$1),this._onKeyUp=this._register(new Emitter$1),this._onCaseSensitiveKeyDown=this._register(new Emitter$1),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new Emitter$1),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.contextViewProvider=t,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||NLS_DEFAULT_LABEL$1,this.inputActiveOptionBorder=i.inputActiveOptionBorder,this.inputActiveOptionForeground=i.inputActiveOptionForeground,this.inputActiveOptionBackground=i.inputActiveOptionBackground,this.inputBackground=i.inputBackground,this.inputForeground=i.inputForeground,this.inputBorder=i.inputBorder,this.inputValidationInfoBorder=i.inputValidationInfoBorder,this.inputValidationInfoBackground=i.inputValidationInfoBackground,this.inputValidationInfoForeground=i.inputValidationInfoForeground,this.inputValidationWarningBorder=i.inputValidationWarningBorder,this.inputValidationWarningBackground=i.inputValidationWarningBackground,this.inputValidationWarningForeground=i.inputValidationWarningForeground,this.inputValidationErrorBorder=i.inputValidationErrorBorder,this.inputValidationErrorBackground=i.inputValidationErrorBackground,this.inputValidationErrorForeground=i.inputValidationErrorForeground;const o=i.appendCaseSensitiveLabel||"",r=i.appendWholeWordsLabel||"",s=i.appendRegexLabel||"",a=i.history||[],l=!!i.flexibleHeight,c=!!i.flexibleWidth,d=i.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new HistoryInputBox(this.domNode,this.contextViewProvider,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:a,showHistoryHint:i.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:d})),this.regex=this._register(new RegexCheckbox({appendTitle:s,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.regex.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.regex.onKeyDown((e=>{this._onRegexKeyDown.fire(e)}))),this.wholeWords=this._register(new WholeWordsCheckbox({appendTitle:r,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.wholeWords.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this.caseSensitive=this._register(new CaseSensitiveCheckbox({appendTitle:o,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.caseSensitive.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.caseSensitive.onKeyDown((e=>{this._onCaseSensitiveKeyDown.fire(e)}))),this._showOptionButtons&&(this.inputBox.paddingRight=this.caseSensitive.width()+this.wholeWords.width()+this.regex.width());let u=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,(e=>{if(e.equals(15)||e.equals(17)||e.equals(9)){let t=u.indexOf(document.activeElement);if(t>=0){let n=-1;e.equals(17)?n=(t+1)%u.length:e.equals(15)&&(n=0===t?u.length-1:t-1),e.equals(9)?(u[t].blur(),this.inputBox.focus()):n>=0&&u[n].focus(),EventHelper.stop(e,!0)}}})),this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this._showOptionButtons?"block":"none",this.controls.appendChild(this.caseSensitive.domNode),this.controls.appendChild(this.wholeWords.domNode),this.controls.appendChild(this.regex.domNode),this.domNode.appendChild(this.controls),e&&e.appendChild(this.domNode),this._register(addDisposableListener(this.inputBox.inputElement,"compositionstart",(e=>{this.imeSessionInProgress=!0}))),this._register(addDisposableListener(this.inputBox.inputElement,"compositionend",(e=>{this.imeSessionInProgress=!1,this._onInput.fire()}))),this.onkeydown(this.inputBox.inputElement,(e=>this._onKeyDown.fire(e))),this.onkeyup(this.inputBox.inputElement,(e=>this._onKeyUp.fire(e))),this.oninput(this.inputBox.inputElement,(e=>this._onInput.fire())),this.onmousedown(this.inputBox.inputElement,(e=>this._onMouseDown.fire(e)))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.regex.enable(),this.wholeWords.enable(),this.caseSensitive.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.regex.disable(),this.wholeWords.disable(),this.caseSensitive.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}style(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionForeground=e.inputActiveOptionForeground,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){if(this.domNode){const e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground};this.regex.style(e),this.wholeWords.style(e),this.caseSensitive.style(e);const t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive.checked}setCaseSensitive(e){this.caseSensitive.checked=e}getWholeWords(){return this.wholeWords.checked}setWholeWords(e){this.wholeWords.checked=e}getRegex(){return this.regex.checked}setRegex(e){this.regex.checked=e,this.validate()}focusOnCaseSensitive(){this.caseSensitive.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}clearMessage(){this.inputBox.hideMessage()}}const NLS_DEFAULT_LABEL=localize("defaultLabel","input"),NLS_PRESERVE_CASE_LABEL=localize("label.preserveCaseCheckbox","Preserve Case");class PreserveCaseCheckbox extends Checkbox{constructor(e){super({icon:Codicon.preserveCase,title:NLS_PRESERVE_CASE_LABEL+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class ReplaceInput extends Widget{constructor(e,t,n,i){super(),this._showOptionButtons=n,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new Emitter$1),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new Emitter$1),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new Emitter$1),this._onInput=this._register(new Emitter$1),this._onKeyUp=this._register(new Emitter$1),this._onPreserveCaseKeyDown=this._register(new Emitter$1),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||NLS_DEFAULT_LABEL,this.inputActiveOptionBorder=i.inputActiveOptionBorder,this.inputActiveOptionForeground=i.inputActiveOptionForeground,this.inputActiveOptionBackground=i.inputActiveOptionBackground,this.inputBackground=i.inputBackground,this.inputForeground=i.inputForeground,this.inputBorder=i.inputBorder,this.inputValidationInfoBorder=i.inputValidationInfoBorder,this.inputValidationInfoBackground=i.inputValidationInfoBackground,this.inputValidationInfoForeground=i.inputValidationInfoForeground,this.inputValidationWarningBorder=i.inputValidationWarningBorder,this.inputValidationWarningBackground=i.inputValidationWarningBackground,this.inputValidationWarningForeground=i.inputValidationWarningForeground,this.inputValidationErrorBorder=i.inputValidationErrorBorder,this.inputValidationErrorBackground=i.inputValidationErrorBackground,this.inputValidationErrorForeground=i.inputValidationErrorForeground;const o=i.appendPreserveCaseLabel||"",r=i.history||[],s=!!i.flexibleHeight,a=!!i.flexibleWidth,l=i.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new HistoryInputBox(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:r,showHistoryHint:i.showHistoryHint,flexibleHeight:s,flexibleWidth:a,flexibleMaxHeight:l})),this.preserveCase=this._register(new PreserveCaseCheckbox({appendTitle:o,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.preserveCase.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.preserveCase.onKeyDown((e=>{this._onPreserveCaseKeyDown.fire(e)}))),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;let c=[this.preserveCase.domNode];this.onkeydown(this.domNode,(e=>{if(e.equals(15)||e.equals(17)||e.equals(9)){let t=c.indexOf(document.activeElement);if(t>=0){let n=-1;e.equals(17)?n=(t+1)%c.length:e.equals(15)&&(n=0===t?c.length-1:t-1),e.equals(9)?(c[t].blur(),this.inputBox.focus()):n>=0&&c[n].focus(),EventHelper.stop(e,!0)}}}));let d=document.createElement("div");d.className="controls",d.style.display=this._showOptionButtons?"block":"none",d.appendChild(this.preserveCase.domNode),this.domNode.appendChild(d),e&&e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,(e=>this._onKeyDown.fire(e))),this.onkeyup(this.inputBox.inputElement,(e=>this._onKeyUp.fire(e))),this.oninput(this.inputBox.inputElement,(e=>this._onInput.fire())),this.onmousedown(this.inputBox.inputElement,(e=>this._onMouseDown.fire(e)))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}style(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionForeground=e.inputActiveOptionForeground,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){if(this.domNode){const e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground};this.preserveCase.style(e);const t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){this.inputBox&&this.inputBox.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.inputBox.width=e,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var __decorate$14=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$13=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const historyNavigationVisible=new RawContextKey("suggestWidgetVisible",!1,localize("suggestWidgetVisible","Whether suggestion are visible")),HistoryNavigationWidgetContext="historyNavigationWidget",HistoryNavigationForwardsEnablementContext="historyNavigationForwardsEnabled",HistoryNavigationBackwardsEnablementContext="historyNavigationBackwardsEnabled";function bindContextScopedWidget(e,t,n){new RawContextKey(n,t).bindTo(e)}function createWidgetScopedContextKeyService(e,t){return e.createScoped(t.target)}function getContextScopedWidget(e,t){return e.getContext(document.activeElement).getValue(t)}function createAndBindHistoryNavigationWidgetScopedContextKeyService(e,t){const n=createWidgetScopedContextKeyService(e,t);bindContextScopedWidget(n,t,HistoryNavigationWidgetContext);return{scopedContextKeyService:n,historyNavigationForwardsEnablement:new RawContextKey(HistoryNavigationForwardsEnablementContext,!0).bindTo(n),historyNavigationBackwardsEnablement:new RawContextKey(HistoryNavigationBackwardsEnablementContext,!0).bindTo(n)}}let ContextScopedFindInput=class extends FindInput{constructor(e,t,n,i,o=!1){super(e,t,o,n),this._register(createAndBindHistoryNavigationWidgetScopedContextKeyService(i,{target:this.inputBox.element,historyNavigator:this.inputBox}).scopedContextKeyService)}};ContextScopedFindInput=__decorate$14([__param$13(3,IContextKeyService)],ContextScopedFindInput);let ContextScopedReplaceInput=class extends ReplaceInput{constructor(e,t,n,i,o=!1){super(e,t,o,n),this._register(createAndBindHistoryNavigationWidgetScopedContextKeyService(i,{target:this.inputBox.element,historyNavigator:this.inputBox}).scopedContextKeyService)}};ContextScopedReplaceInput=__decorate$14([__param$13(3,IContextKeyService)],ContextScopedReplaceInput),KeybindingsRegistry.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:ContextKeyExpr.and(ContextKeyExpr.has(HistoryNavigationWidgetContext),ContextKeyExpr.equals(HistoryNavigationBackwardsEnablementContext,!0),historyNavigationVisible.isEqualTo(!1)),primary:16,secondary:[528],handler:e=>{const t=getContextScopedWidget(e.get(IContextKeyService),HistoryNavigationWidgetContext);if(t){t.historyNavigator.showPreviousValue()}}}),KeybindingsRegistry.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:ContextKeyExpr.and(ContextKeyExpr.has(HistoryNavigationWidgetContext),ContextKeyExpr.equals(HistoryNavigationForwardsEnablementContext,!0),historyNavigationVisible.isEqualTo(!1)),primary:18,secondary:[530],handler:e=>{const t=getContextScopedWidget(e.get(IContextKeyService),HistoryNavigationWidgetContext);if(t){t.historyNavigator.showNextValue()}}});var __awaiter$G=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const Context$2={Visible:historyNavigationVisible,DetailsVisible:new RawContextKey("suggestWidgetDetailsVisible",!1,localize("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new RawContextKey("suggestWidgetMultipleSuggestions",!1,localize("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new RawContextKey("suggestionMakesTextEdit",!0,localize("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new RawContextKey("acceptSuggestionOnEnter",!0,localize("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new RawContextKey("suggestionHasInsertAndReplaceRange",!1,localize("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new RawContextKey("suggestionInsertMode",void 0,{type:"string",description:localize("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new RawContextKey("suggestionCanResolve",!1,localize("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},suggestWidgetStatusbarMenu=new MenuId("suggestWidgetStatusBar");class CompletionItem{constructor(e,t,n,i){this.position=e,this.completion=t,this.container=n,this.provider=i,this.isInvalid=!1,this.score=FuzzyScore.Default,this.distance=0,this.textLabel="string"==typeof t.label?t.label:t.label.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),Range$2.isIRange(t.range)?(this.editStart=new Position$1(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new Position$1(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new Position$1(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||Range$2.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new Position$1(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new Position$1(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new Position$1(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||Range$2.spansMultipleLines(t.range.insert)||Range$2.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),"function"!=typeof i.resolveCompletionItem&&(this._resolveCache=Promise.resolve(),this._isResolved=!0)}get isResolved(){return!!this._isResolved}resolve(e){return __awaiter$G(this,void 0,void 0,(function*(){if(!this._resolveCache){const t=e.onCancellationRequested((()=>{this._resolveCache=void 0,this._isResolved=!1}));this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then((e=>{Object.assign(this.completion,e),this._isResolved=!0,t.dispose()}),(e=>{isCancellationError(e)&&(this._resolveCache=void 0,this._isResolved=!1)}))}return this._resolveCache}))}}class CompletionOptions{constructor(e=2,t=new Set,n=new Set,i=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=n,this.showDeprecated=i}}let _snippetSuggestSupport;function getSnippetSuggestSupport(){return _snippetSuggestSupport}CompletionOptions.default=new CompletionOptions;class CompletionItemModel{constructor(e,t,n,i){this.items=e,this.needsClipboard=t,this.durations=n,this.disposable=i}}function provideSuggestionItems(e,t,n,i=CompletionOptions.default,o={triggerKind:0},r=CancellationToken.None){return __awaiter$G(this,void 0,void 0,(function*(){const s=new StopWatch(!0);n=n.clone();const a=t.getWordAtPosition(n),l=a?new Range$2(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn):Range$2.fromPositions(n),c={replace:l,insert:l.setEndPosition(n.lineNumber,n.column)},d=[],u=new DisposableStore,h=[];let g=!1;const p=(e,t,o)=>{var r,s,a;let l=!1;if(!t)return l;for(let u of t.suggestions)if(!i.kindFilter.has(u.kind)){if(!i.showDeprecated&&(null===(r=null==u?void 0:u.tags)||void 0===r?void 0:r.includes(1)))continue;u.range||(u.range=c),u.sortText||(u.sortText="string"==typeof u.label?u.label:u.label.label),!g&&u.insertTextRules&&4&u.insertTextRules&&(g=SnippetParser.guessNeedsClipboard(u.insertText)),d.push(new CompletionItem(n,u,t,e)),l=!0}return isDisposable(t)&&u.add(t),h.push({providerName:null!==(s=e._debugDisplayName)&&void 0!==s?s:"unknown_provider",elapsedProvider:null!==(a=t.duration)&&void 0!==a?a:-1,elapsedOverall:o.elapsed()}),l},f=(()=>__awaiter$G(this,void 0,void 0,(function*(){})))();for(let m of e.orderedGroups(t)){let e=!1;if(yield Promise.all(m.map((s=>__awaiter$G(this,void 0,void 0,(function*(){if(!(i.providerFilter.size>0)||i.providerFilter.has(s))try{const i=new StopWatch(!0),a=yield s.provideCompletionItems(t,n,o,r);e=p(s,a,i)||e}catch(a){onUnexpectedExternalError(a)}}))))),e||r.isCancellationRequested)break}return yield f,r.isCancellationRequested?(u.dispose(),Promise.reject(canceled())):new CompletionItemModel(d.sort(getSuggestionComparator(i.snippetSortOrder)),g,{entries:h,elapsed:s.elapsed()},u)}))}function defaultComparator(e,t){if(e.sortTextLow&&t.sortTextLow){if(e.sortTextLow<t.sortTextLow)return-1;if(e.sortTextLow>t.sortTextLow)return 1}return e.completion.label<t.completion.label?-1:e.completion.label>t.completion.label?1:e.completion.kind-t.completion.kind}function snippetUpComparator(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return-1;if(27===t.completion.kind)return 1}return defaultComparator(e,t)}function snippetDownComparator(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return 1;if(27===t.completion.kind)return-1}return defaultComparator(e,t)}const _snippetComparators=new Map;function getSuggestionComparator(e){return _snippetComparators.get(e)}let _onlyOnceProvider;_snippetComparators.set(0,snippetUpComparator),_snippetComparators.set(2,snippetDownComparator),_snippetComparators.set(1,defaultComparator),CommandsRegistry.registerCommand("_executeCompletionItemProvider",((e,...t)=>__awaiter$G(void 0,void 0,void 0,(function*(){const[n,i,o,r]=t;assertType(URI.isUri(n)),assertType(Position$1.isIPosition(i)),assertType("string"==typeof o||!o),assertType("number"==typeof r||!r);const{completionProvider:s}=e.get(ILanguageFeaturesService),a=yield e.get(ITextModelService).createModelReference(n);try{const e={incomplete:!1,suggestions:[]},t=[],n=yield provideSuggestionItems(s,a.object.textEditorModel,Position$1.lift(i),void 0,{triggerCharacter:o,triggerKind:o?1:0});for(const i of n.items)t.length<(null!=r?r:0)&&t.push(i.resolve(CancellationToken.None)),e.incomplete=e.incomplete||i.container.incomplete,e.suggestions.push(i.completion);try{return yield Promise.all(t),e}finally{setTimeout((()=>n.disposable.dispose()),100)}}finally{a.dispose()}}))));let _onlyOnceSuggestions=[];function showSimpleSuggestions(e,t,n){const{completionProvider:i}=e.get(ILanguageFeaturesService);_onlyOnceProvider||(_onlyOnceProvider=new class{provideCompletionItems(){let e={suggestions:_onlyOnceSuggestions.slice(0)};return _onlyOnceSuggestions.length=0,e}},i.register("*",_onlyOnceProvider)),setTimeout((()=>{var e;_onlyOnceSuggestions.push(...n),null===(e=t.getContribution("editor.contrib.suggestController"))||void 0===e||e.triggerSuggest((new Set).add(_onlyOnceProvider))}),0)}var __decorate$13=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$12=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const $$8=$$c;let ContentHoverController=class e extends Disposable{constructor(e,t,n){super(),this._editor=e,this._instantiationService=t,this._keybindingService=n,this._widget=this._register(this._instantiationService.createInstance(ContentHoverWidget,this._editor)),this._decorationsChangerListener=this._register(new EditorDecorationsChangerListener(this._editor)),this._messages=[],this._messagesAreComplete=!1,this._participants=[];for(const i of HoverParticipantRegistry.getAll())this._participants.push(this._instantiationService.createInstance(i,this._editor));this._participants.sort(((e,t)=>e.hoverOrdinal-t.hoverOrdinal)),this._computer=new ContentHoverComputer(this._editor,this._participants),this._hoverOperation=this._register(new HoverOperation(this._editor,this._computer)),this._register(this._hoverOperation.onResult((e=>{this._withResult(e.value,e.isComplete,e.hasLoadingMessage)}))),this._register(this._decorationsChangerListener.onDidChangeModelDecorations((()=>this._onModelDecorationsChanged()))),this._register(addStandardDisposableListener(this._widget.getDomNode(),"keydown",(e=>{e.equals(9)&&this.hide()}))),this._register(TokenizationRegistry.onDidChange((()=>{this._widget.position&&this._computer.anchor&&this._messages.length>0&&(this._widget.clear(),this._renderMessages(this._computer.anchor,this._messages))})))}_onModelDecorationsChanged(){this._widget.position&&(this._hoverOperation.cancel(),this._widget.isColorPickerVisible||this._hoverOperation.start(0))}maybeShowAt(e){const t=[];for(const i of this._participants)if(i.suggestHoverAnchor){const n=i.suggestHoverAnchor(e);n&&t.push(n)}const n=e.target;if(6===n.type&&t.push(new HoverRangeAnchor(0,n.range)),7===n.type){const e=this._editor.getOption(44).typicalHalfwidthCharacterWidth/2;!n.detail.isAfterLines&&"number"==typeof n.detail.horizontalDistanceToText&&n.detail.horizontalDistanceToText<e&&t.push(new HoverRangeAnchor(0,n.range))}return 0!==t.length&&(t.sort(((e,t)=>t.priority-e.priority)),this._startShowingAt(t[0],0,!1),!0)}startShowingAtRange(e,t,n){this._startShowingAt(new HoverRangeAnchor(0,e),t,n)}_startShowingAt(e,t,n){if(!this._computer.anchor||!this._computer.anchor.equals(e)){if(this._hoverOperation.cancel(),this._widget.position)if(this._computer.anchor&&e.canAdoptVisibleHover(this._computer.anchor,this._widget.position)){const t=this._messages.filter((t=>t.isValidForHoverAnchor(e)));if(0===t.length)this.hide();else{if(t.length===this._messages.length&&this._messagesAreComplete)return;this._renderMessages(e,t)}}else this.hide();this._computer.anchor=e,this._computer.shouldFocus=n,this._hoverOperation.start(t)}}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._widget.hide()}isColorPickerVisible(){return this._widget.isColorPickerVisible}_addLoadingMessage(e){if(this._computer.anchor)for(const t of this._participants)if(t.createLoadingMessage){const n=t.createLoadingMessage(this._computer.anchor);if(n)return e.slice(0).concat([n])}return e}_withResult(e,t,n){this._messages=n?this._addLoadingMessage(e):e,this._messagesAreComplete=t,this._computer.anchor&&this._messages.length>0?this._renderMessages(this._computer.anchor,this._messages):t&&this.hide()}_renderMessages(t,n){let i=1073741824,o=n[0].range,r=null;for(const e of n)i=Math.min(i,e.range.startColumn),o=Range$2.plusRange(o,e.range),e.forceShowAtRange&&(r=e.range);const s=new DisposableStore,a=s.add(new EditorHoverStatusBar(this._keybindingService)),l=document.createDocumentFragment();let c=null;const d={fragment:l,statusBar:a,setColorPicker:e=>c=e,onContentsChanged:()=>this._widget.onContentsChanged(),hide:()=>this.hide()};for(const e of this._participants){const t=n.filter((t=>t.owner===e));t.length>0&&s.add(e.renderHoverParts(d,t))}if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const t=this._decorationsChangerListener.deltaDecorations([],[{range:o,options:e._DECORATION_OPTIONS}]);s.add(toDisposable((()=>{this._decorationsChangerListener.deltaDecorations(t,[])})))}this._widget.showAt(l,new ContentHoverVisibleData(c,r?r.getStartPosition():new Position$1(t.range.startLineNumber,i),r||o,this._editor.getOption(53).above,this._computer.shouldFocus,s))}else s.dispose()}};ContentHoverController._DECORATION_OPTIONS=ModelDecorationOptions.register({description:"content-hover-highlight",className:"hoverHighlight"}),ContentHoverController=__decorate$13([__param$12(1,IInstantiationService),__param$12(2,IKeybindingService)],ContentHoverController);class EditorDecorationsChangerListener extends Disposable{constructor(e){super(),this._editor=e,this._onDidChangeModelDecorations=this._register(new Emitter$1),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._isChangingDecorations=!1,this._register(this._editor.onDidChangeModelDecorations((e=>{this._isChangingDecorations||this._onDidChangeModelDecorations.fire(e)})))}deltaDecorations(e,t){try{return this._isChangingDecorations=!0,this._editor.deltaDecorations(e,t)}finally{this._isChangingDecorations=!1}}}class ContentHoverVisibleData{constructor(e,t,n,i,o,r){this.colorPicker=e,this.showAtPosition=t,this.showAtRange=n,this.preferAbove=i,this.stoleFocus=o,this.disposables=r}}let ContentHoverWidget=class e extends Disposable{constructor(e,t){super(),this._editor=e,this._contextKeyService=t,this.allowEditorOverflow=!0,this._hoverVisibleKey=EditorContextKeys.hoverVisible.bindTo(this._contextKeyService),this._hover=this._register(new HoverWidget),this._visibleData=null,this._register(this._editor.onDidLayoutChange((()=>this._layout()))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(44)&&this._updateFont()}))),this._setVisibleData(null),this._layout(),this._editor.addContentWidget(this)}get position(){var e,t;return null!==(t=null===(e=this._visibleData)||void 0===e?void 0:e.showAtPosition)&&void 0!==t?t:null}get isColorPickerVisible(){var e;return Boolean(null===(e=this._visibleData)||void 0===e?void 0:e.colorPicker)}dispose(){this._editor.removeContentWidget(this),this._visibleData&&this._visibleData.disposables.dispose(),super.dispose()}getId(){return e.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){if(!this._visibleData)return null;let e=this._visibleData.preferAbove;return!e&&this._contextKeyService.getContextKeyValue(Context$2.Visible.key)&&(e=!0),{position:this._visibleData.showAtPosition,range:this._visibleData.showAtRange,preference:e?[1,2]:[2,1]}}_setVisibleData(e){this._visibleData&&this._visibleData.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!this._visibleData),this._hover.containerDomNode.classList.toggle("hidden",!this._visibleData)}_layout(){const e=Math.max(this._editor.getLayoutInfo().height/4,250),{fontSize:t,lineHeight:n}=this._editor.getOption(44);this._hover.contentsDomNode.style.fontSize=`${t}px`,this._hover.contentsDomNode.style.lineHeight=""+n/t,this._hover.contentsDomNode.style.maxHeight=`${e}px`,this._hover.contentsDomNode.style.maxWidth=`${Math.max(.66*this._editor.getLayoutInfo().width,500)}px`}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach((e=>this._editor.applyFontInfo(e)))}showAt(e,t){this._setVisibleData(t),this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._hover.contentsDomNode.style.paddingBottom="",this._updateFont(),this._editor.layoutContentWidget(this),this.onContentsChanged(),this._editor.render(),this._editor.layoutContentWidget(this),this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),t.colorPicker&&t.colorPicker.layout()}hide(){if(this._visibleData){const e=this._visibleData.stoleFocus;this._setVisibleData(null),this._editor.layoutContentWidget(this),e&&this._editor.focus()}}onContentsChanged(){this._hover.onContentsChanged();const e=this._hover.scrollbar.getScrollDimensions();if(e.scrollWidth>e.width){const e=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;this._hover.contentsDomNode.style.paddingBottom!==e&&(this._hover.contentsDomNode.style.paddingBottom=e,this._editor.layoutContentWidget(this),this._hover.onContentsChanged())}}clear(){this._hover.contentsDomNode.textContent=""}};ContentHoverWidget.ID="editor.contrib.contentHoverWidget",ContentHoverWidget=__decorate$13([__param$12(1,IContextKeyService)],ContentHoverWidget);let EditorHoverStatusBar=class extends Disposable{constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=$$8("div.hover-row.status-bar"),this.actionsElement=append$1(this.hoverElement,$$8("div.actions"))}get hasContent(){return this._hasContent}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;return this._hasContent=!0,this._register(HoverAction.render(this.actionsElement,e,n))}append(e){const t=append$1(this.actionsElement,e);return this._hasContent=!0,t}};EditorHoverStatusBar=__decorate$13([__param$12(0,IKeybindingService)],EditorHoverStatusBar);class ContentHoverComputer{constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1}get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}static _getLineDecorations(e,t){if(1!==t.type)return[];const n=e.getModel(),i=t.range.startLineNumber,o=n.getLineMaxColumn(i);return e.getLineDecorations(i).filter((e=>{if(e.options.isWholeLine)return!0;const n=e.range.startLineNumber===i?e.range.startColumn:1,r=e.range.endLineNumber===i?e.range.endColumn:o;if(e.options.showIfCollapsed){if(n>t.range.startColumn+1||t.range.endColumn-1>r)return!1}else if(n>t.range.startColumn||t.range.endColumn>r)return!1;return!0}))}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return AsyncIterableObject.EMPTY;const n=ContentHoverComputer._getLineDecorations(this._editor,t);return AsyncIterableObject.merge(this._participants.map((i=>i.computeAsync?i.computeAsync(t,n,e):AsyncIterableObject.EMPTY)))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=ContentHoverComputer._getLineDecorations(this._editor,this._anchor);let t=[];for(const n of this._participants)t=t.concat(n.computeSync(this._anchor,e));return coalesce(t)}}
- /*! @license DOMPurify 2.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.1/LICENSE */function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var hasOwnProperty$1=Object.hasOwnProperty,setPrototypeOf=Object.setPrototypeOf,isFrozen=Object.isFrozen,getPrototypeOf=Object.getPrototypeOf,getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,freeze=Object.freeze,seal=Object.seal,create$1=Object.create,_ref="undefined"!=typeof Reflect&&Reflect,apply=_ref.apply,construct=_ref.construct;apply||(apply=function(e,t,n){return e.apply(t,n)}),freeze||(freeze=function(e){return e}),seal||(seal=function(e){return e}),construct||(construct=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(_toConsumableArray(t))))});var arrayForEach=unapply(Array.prototype.forEach),arrayPop=unapply(Array.prototype.pop),arrayPush=unapply(Array.prototype.push),stringToLowerCase=unapply(String.prototype.toLowerCase),stringMatch=unapply(String.prototype.match),stringReplace=unapply(String.prototype.replace),stringIndexOf=unapply(String.prototype.indexOf),stringTrim=unapply(String.prototype.trim),regExpTest=unapply(RegExp.prototype.test),typeErrorCreate=unconstruct(TypeError);function unapply(e){return function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return apply(e,t,i)}}function unconstruct(e){return function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return construct(e,n)}}function addToSet(e,t){setPrototypeOf&&setPrototypeOf(e,null);for(var n=t.length;n--;){var i=t[n];if("string"==typeof i){var o=stringToLowerCase(i);o!==i&&(isFrozen(t)||(t[n]=o),i=o)}e[i]=!0}return e}function clone(e){var t=create$1(null),n=void 0;for(n in e)apply(hasOwnProperty$1,e,[n])&&(t[n]=e[n]);return t}function lookupGetter(e,t){for(;null!==e;){var n=getOwnPropertyDescriptor(e,t);if(n){if(n.get)return unapply(n.get);if("function"==typeof n.value)return unapply(n.value)}e=getPrototypeOf(e)}return function(e){return null}}var html=freeze(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),svg=freeze(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),svgFilters=freeze(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),svgDisallowed=freeze(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),mathMl=freeze(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),mathMlDisallowed=freeze(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),text=freeze(["#text"]),html$1=freeze(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),svg$1=freeze(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mathMl$1=freeze(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xml=freeze(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MUSTACHE_EXPR=seal(/\{\{[\s\S]*|[\s\S]*\}\}/gm),ERB_EXPR=seal(/<%[\s\S]*|[\s\S]*%>/gm),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _toConsumableArray$1(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var getGlobal=function(){return"undefined"==typeof window?null:window},_createTrustedTypesPolicy=function(e,t){if("object"!==(void 0===e?"undefined":_typeof(e))||"function"!=typeof e.createPolicy)return null;var n=null,i="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(i)&&(n=t.currentScript.getAttribute(i));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function(e){return e}})}catch(r){return null}};function createDOMPurify(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:getGlobal(),t=function(e){return createDOMPurify(e)};if(t.version="2.3.1",t.removed=[],!e||!e.document||9!==e.document.nodeType)return t.isSupported=!1,t;var n=e.document,i=e.document,o=e.DocumentFragment,r=e.HTMLTemplateElement,s=e.Node,a=e.Element,l=e.NodeFilter,c=e.NamedNodeMap,d=void 0===c?e.NamedNodeMap||e.MozNamedAttrMap:c,u=e.Text,h=e.Comment,g=e.DOMParser,p=e.trustedTypes,f=a.prototype,m=lookupGetter(f,"cloneNode"),v=lookupGetter(f,"nextSibling"),_=lookupGetter(f,"childNodes"),C=lookupGetter(f,"parentNode");if("function"==typeof r){var b=i.createElement("template");b.content&&b.content.ownerDocument&&(i=b.content.ownerDocument)}var y=_createTrustedTypesPolicy(p,n),S=y&&ee?y.createHTML(""):"",w=i,E=w.implementation,x=w.createNodeIterator,T=w.createDocumentFragment,I=w.getElementsByTagName,k=n.importNode,L={};try{L=clone(i).documentMode?i.documentMode:{}}catch(Re){}var D={};t.isSupported="function"==typeof C&&E&&void 0!==E.createHTMLDocument&&9!==L;var N=MUSTACHE_EXPR,O=ERB_EXPR,A=DATA_ATTR,P=ARIA_ATTR,R=IS_SCRIPT_OR_DATA,M=ATTR_WHITESPACE,$=IS_ALLOWED_URI,F=null,B=addToSet({},[].concat(_toConsumableArray$1(html),_toConsumableArray$1(svg),_toConsumableArray$1(svgFilters),_toConsumableArray$1(mathMl),_toConsumableArray$1(text))),V=null,W=addToSet({},[].concat(_toConsumableArray$1(html$1),_toConsumableArray$1(svg$1),_toConsumableArray$1(mathMl$1),_toConsumableArray$1(xml))),H=null,z=null,K=!0,j=!0,U=!1,G=!1,q=!1,Y=!1,X=!1,Z=!1,Q=!1,J=!0,ee=!1,te=!0,ne=!0,ie=!1,oe={},re=null,se=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ae=null,le=addToSet({},["audio","video","img","source","image","track"]),ce=null,de=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ue="http://www.w3.org/1998/Math/MathML",he="http://www.w3.org/2000/svg",ge="http://www.w3.org/1999/xhtml",pe=ge,fe=!1,me=null,ve=i.createElement("form"),_e=function(e){me&&me===e||(e&&"object"===(void 0===e?"undefined":_typeof(e))||(e={}),e=clone(e),F="ALLOWED_TAGS"in e?addToSet({},e.ALLOWED_TAGS):B,V="ALLOWED_ATTR"in e?addToSet({},e.ALLOWED_ATTR):W,ce="ADD_URI_SAFE_ATTR"in e?addToSet(clone(de),e.ADD_URI_SAFE_ATTR):de,ae="ADD_DATA_URI_TAGS"in e?addToSet(clone(le),e.ADD_DATA_URI_TAGS):le,re="FORBID_CONTENTS"in e?addToSet({},e.FORBID_CONTENTS):se,H="FORBID_TAGS"in e?addToSet({},e.FORBID_TAGS):{},z="FORBID_ATTR"in e?addToSet({},e.FORBID_ATTR):{},oe="USE_PROFILES"in e&&e.USE_PROFILES,K=!1!==e.ALLOW_ARIA_ATTR,j=!1!==e.ALLOW_DATA_ATTR,U=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=e.SAFE_FOR_TEMPLATES||!1,q=e.WHOLE_DOCUMENT||!1,Z=e.RETURN_DOM||!1,Q=e.RETURN_DOM_FRAGMENT||!1,J=!1!==e.RETURN_DOM_IMPORT,ee=e.RETURN_TRUSTED_TYPE||!1,X=e.FORCE_BODY||!1,te=!1!==e.SANITIZE_DOM,ne=!1!==e.KEEP_CONTENT,ie=e.IN_PLACE||!1,$=e.ALLOWED_URI_REGEXP||$,pe=e.NAMESPACE||ge,G&&(j=!1),Q&&(Z=!0),oe&&(F=addToSet({},[].concat(_toConsumableArray$1(text))),V=[],!0===oe.html&&(addToSet(F,html),addToSet(V,html$1)),!0===oe.svg&&(addToSet(F,svg),addToSet(V,svg$1),addToSet(V,xml)),!0===oe.svgFilters&&(addToSet(F,svgFilters),addToSet(V,svg$1),addToSet(V,xml)),!0===oe.mathMl&&(addToSet(F,mathMl),addToSet(V,mathMl$1),addToSet(V,xml))),e.ADD_TAGS&&(F===B&&(F=clone(F)),addToSet(F,e.ADD_TAGS)),e.ADD_ATTR&&(V===W&&(V=clone(V)),addToSet(V,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&addToSet(ce,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(re===se&&(re=clone(re)),addToSet(re,e.FORBID_CONTENTS)),ne&&(F["#text"]=!0),q&&addToSet(F,["html","head","body"]),F.table&&(addToSet(F,["tbody"]),delete H.tbody),freeze&&freeze(e),me=e)},Ce=addToSet({},["mi","mo","mn","ms","mtext"]),be=addToSet({},["foreignobject","desc","title","annotation-xml"]),ye=addToSet({},svg);addToSet(ye,svgFilters),addToSet(ye,svgDisallowed);var Se=addToSet({},mathMl);addToSet(Se,mathMlDisallowed);var we=function(e){var t=C(e);t&&t.tagName||(t={namespaceURI:ge,tagName:"template"});var n=stringToLowerCase(e.tagName),i=stringToLowerCase(t.tagName);if(e.namespaceURI===he)return t.namespaceURI===ge?"svg"===n:t.namespaceURI===ue?"svg"===n&&("annotation-xml"===i||Ce[i]):Boolean(ye[n]);if(e.namespaceURI===ue)return t.namespaceURI===ge?"math"===n:t.namespaceURI===he?"math"===n&&be[i]:Boolean(Se[n]);if(e.namespaceURI===ge){if(t.namespaceURI===he&&!be[i])return!1;if(t.namespaceURI===ue&&!Ce[i])return!1;var o=addToSet({},["title","style","font","a","script"]);return!Se[n]&&(o[n]||!ye[n])}return!1},Ee=function(e){arrayPush(t.removed,{element:e});try{e.parentNode.removeChild(e)}catch(Re){try{e.outerHTML=S}catch(n){e.remove()}}},xe=function(e,n){try{arrayPush(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch(Re){arrayPush(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),"is"===e&&!V[e])if(Z||Q)try{Ee(n)}catch(Re){}else try{n.setAttribute(e,"")}catch(Re){}},Te=function(e){var t=void 0,n=void 0;if(X)e="<remove></remove>"+e;else{var o=stringMatch(e,/^[\r\n\t ]+/);n=o&&o[0]}var r=y?y.createHTML(e):e;if(pe===ge)try{t=(new g).parseFromString(r,"text/html")}catch(Re){}if(!t||!t.documentElement){t=E.createDocument(pe,"template",null);try{t.documentElement.innerHTML=fe?"":r}catch(Re){}}var s=t.body||t.documentElement;return e&&n&&s.insertBefore(i.createTextNode(n),s.childNodes[0]||null),pe===ge?I.call(t,q?"html":"body")[0]:q?t.documentElement:s},Ie=function(e){return x.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},ke=function(e){return!(e instanceof u||e instanceof h)&&!("string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof d&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},Le=function(e){return"object"===(void 0===s?"undefined":_typeof(s))?e instanceof s:e&&"object"===(void 0===e?"undefined":_typeof(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},De=function(e,n,i){D[e]&&arrayForEach(D[e],(function(e){e.call(t,n,i,me)}))},Ne=function(e){var n=void 0;if(De("beforeSanitizeElements",e,null),ke(e))return Ee(e),!0;if(stringMatch(e.nodeName,/[\u0080-\uFFFF]/))return Ee(e),!0;var i=stringToLowerCase(e.nodeName);if(De("uponSanitizeElement",e,{tagName:i,allowedTags:F}),!Le(e.firstElementChild)&&(!Le(e.content)||!Le(e.content.firstElementChild))&®ExpTest(/<[/\w]/g,e.innerHTML)&®ExpTest(/<[/\w]/g,e.textContent))return Ee(e),!0;if("select"===i&®ExpTest(/<template/i,e.innerHTML))return Ee(e),!0;if(!F[i]||H[i]){if(ne&&!re[i]){var o=C(e)||e.parentNode,r=_(e)||e.childNodes;if(r&&o)for(var s=r.length-1;s>=0;--s)o.insertBefore(m(r[s],!0),v(e))}return Ee(e),!0}return e instanceof a&&!we(e)?(Ee(e),!0):"noscript"!==i&&"noembed"!==i||!regExpTest(/<\/no(script|embed)/i,e.innerHTML)?(G&&3===e.nodeType&&(n=e.textContent,n=stringReplace(n,N," "),n=stringReplace(n,O," "),e.textContent!==n&&(arrayPush(t.removed,{element:e.cloneNode()}),e.textContent=n)),De("afterSanitizeElements",e,null),!1):(Ee(e),!0)},Oe=function(e,t,n){if(te&&("id"===t||"name"===t)&&(n in i||n in ve))return!1;if(j&&!z[t]&®ExpTest(A,t));else if(K&®ExpTest(P,t));else{if(!V[t]||z[t])return!1;if(ce[t]);else if(regExpTest($,stringReplace(n,M,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==stringIndexOf(n,"data:")||!ae[e]){if(U&&!regExpTest(R,stringReplace(n,M,"")));else if(n)return!1}else;}return!0},Ae=function(e){var n=void 0,i=void 0,o=void 0,r=void 0;De("beforeSanitizeAttributes",e,null);var s=e.attributes;if(s){var a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:V};for(r=s.length;r--;){var l=n=s[r],c=l.name,d=l.namespaceURI;if(i=stringTrim(n.value),o=stringToLowerCase(c),a.attrName=o,a.attrValue=i,a.keepAttr=!0,a.forceKeepAttr=void 0,De("uponSanitizeAttribute",e,a),i=a.attrValue,!a.forceKeepAttr&&(xe(c,e),a.keepAttr))if(regExpTest(/\/>/i,i))xe(c,e);else{G&&(i=stringReplace(i,N," "),i=stringReplace(i,O," "));var u=e.nodeName.toLowerCase();if(Oe(u,o,i))try{d?e.setAttributeNS(d,c,i):e.setAttribute(c,i),arrayPop(t.removed)}catch(Re){}}}De("afterSanitizeAttributes",e,null)}},Pe=function e(t){var n=void 0,i=Ie(t);for(De("beforeSanitizeShadowDOM",t,null);n=i.nextNode();)De("uponSanitizeShadowNode",n,null),Ne(n)||(n.content instanceof o&&e(n.content),Ae(n));De("afterSanitizeShadowDOM",t,null)};return t.sanitize=function(i,r){var a=void 0,l=void 0,c=void 0,d=void 0,u=void 0;if((fe=!i)&&(i="\x3c!--\x3e"),"string"!=typeof i&&!Le(i)){if("function"!=typeof i.toString)throw typeErrorCreate("toString is not a function");if("string"!=typeof(i=i.toString()))throw typeErrorCreate("dirty is not a string, aborting")}if(!t.isSupported){if("object"===_typeof(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof i)return e.toStaticHTML(i);if(Le(i))return e.toStaticHTML(i.outerHTML)}return i}if(Y||_e(r),t.removed=[],"string"==typeof i&&(ie=!1),ie);else if(i instanceof s)1===(l=(a=Te("\x3c!----\x3e")).ownerDocument.importNode(i,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?a=l:a.appendChild(l);else{if(!Z&&!G&&!q&&-1===i.indexOf("<"))return y&&ee?y.createHTML(i):i;if(!(a=Te(i)))return Z?null:S}a&&X&&Ee(a.firstChild);for(var h=Ie(ie?i:a);c=h.nextNode();)3===c.nodeType&&c===d||Ne(c)||(c.content instanceof o&&Pe(c.content),Ae(c),d=c);if(d=null,ie)return i;if(Z){if(Q)for(u=T.call(a.ownerDocument);a.firstChild;)u.appendChild(a.firstChild);else u=a;return J&&(u=k.call(n,u,!0)),u}var g=q?a.outerHTML:a.innerHTML;return G&&(g=stringReplace(g,N," "),g=stringReplace(g,O," ")),y&&ee?y.createHTML(g):g},t.setConfig=function(e){_e(e),Y=!0},t.clearConfig=function(){me=null,Y=!1},t.isValidAttribute=function(e,t,n){me||_e({});var i=stringToLowerCase(e),o=stringToLowerCase(t);return Oe(i,o,n)},t.addHook=function(e,t){"function"==typeof t&&(D[e]=D[e]||[],arrayPush(D[e],t))},t.removeHook=function(e){D[e]&&arrayPop(D[e])},t.removeHooks=function(e){D[e]&&(D[e]=[])},t.removeAllHooks=function(){D={}},t}var purify=createDOMPurify();purify.version,purify.isSupported;const sanitize$1=purify.sanitize;purify.setConfig,purify.clearConfig,purify.isValidAttribute;const addHook=purify.addHook,removeHook=purify.removeHook;purify.removeHooks,purify.removeAllHooks;let __marked_exports={};!function(){function e(e,t){t(__marked_exports)}var t,n;e.amd=!0,t=this,n=function(e){function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function i(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};var r=/[&<>"']/,s=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,c={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(e){return c[e]};function u(e,t){if(t){if(r.test(e))return e.replace(s,d)}else if(a.test(e))return e.replace(l,d);return e}var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function g(e){return e.replace(h,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var p=/(^|[^\[])\^/g;function f(e,t){e=e.source||e,t=t||"";var n={replace:function(t,i){return i=(i=i.source||i).replace(p,"$1"),e=e.replace(t,i),n},getRegex:function(){return new RegExp(e,t)}};return n}var m=/[^\w:]/g,v=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function _(e,t,n){if(e){var i;try{i=decodeURIComponent(g(n)).replace(m,"").toLowerCase()}catch(e2){return null}if(0===i.indexOf("javascript:")||0===i.indexOf("vbscript:")||0===i.indexOf("data:"))return null}t&&!v.test(n)&&(n=function(e,t){C[" "+e]||(b.test(e)?C[" "+e]=e+"/":C[" "+e]=T(e,"/",!0));var n=-1===(e=C[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(y,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(S,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e2){return null}return n}var C={},b=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,S=/^([^:]+:\/*[^/]*)[\s\S]*$/,w={exec:function(){}};function E(e){for(var t,n,i=1;i<arguments.length;i++)for(n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function x(e,t){var n=e.replace(/\|/g,(function(e,t,n){for(var i=!1,o=t;--o>=0&&"\\"===n[o];)i=!i;return i?"|":" |"})).split(/ \|/),i=0;if(n[0].trim()||n.shift(),n[n.length-1].trim()||n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function T(e,t,n){var i=e.length;if(0===i)return"";for(var o=0;o<i;){var r=e.charAt(i-o-1);if(r!==t||n){if(r===t||!n)break;o++}else o++}return e.substr(0,i-o)}function I(e){e&&e.sanitize&&e.silent}function k(e,t){if(t<1)return"";for(var n="";t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function L(e,t,n,i){var o=t.href,r=t.title?u(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){i.state.inLink=!0;var a={type:"link",raw:n,href:o,title:r,text:s,tokens:i.inlineTokens(s,[])};return i.state.inLink=!1,a}return{type:"image",raw:n,href:o,title:r,text:u(s)}}var D=function(){function t(t){this.options=t||e.defaults}var n=t.prototype;return n.space=function(e){var t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}},n.code=function(e){var t=this.rules.block.code.exec(e);if(t){var n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:T(n,"\n")}}},n.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],i=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var i=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=i.length?e.slice(i.length):e})).join("\n")}(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim():t[2],text:i}}},n.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var n=t[2].trim();if(/#$/.test(n)){var i=T(n,"#");this.options.pedantic?n=i.trim():i&&!/ $/.test(i)||(n=i.trim())}var o={type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:[]};return this.lexer.inline(o.text,o.tokens),o}},n.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}},n.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var n=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(n,[]),text:n}}},n.list=function(e){var t=this.rules.block.list.exec(e);if(t){var n,o,r,s,a,l,c,d,u,h,g,p,f=t[1].trim(),m=f.length>1,v={type:"list",raw:"",ordered:m,start:m?+f.slice(0,-1):"",loose:!1,items:[]};f=m?"\\d{1,9}\\"+f.slice(-1):"\\"+f,this.options.pedantic&&(f=m?f:"[*+-]");for(var _=new RegExp("^( {0,3}"+f+")((?: [^\\n]*)?(?:\\n|$))");e&&(p=!1,t=_.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),d=t[2].split("\n",1)[0],u=e.split("\n",1)[0],this.options.pedantic?(s=2,g=d.trimLeft()):(s=(s=t[2].search(/[^ ]/))>4?1:s,g=d.slice(s),s+=t[1].length),l=!1,!d&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),p=!0),!p)for(var C=new RegExp("^ {0,"+Math.min(3,s-1)+"}(?:[*+-]|\\d{1,9}[.)])");e&&(d=h=e.split("\n",1)[0],this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!C.test(d));){if(d.search(/[^ ]/)>=s||!d.trim())g+="\n"+d.slice(s);else{if(l)break;g+="\n"+d}l||d.trim()||(l=!0),n+=h+"\n",e=e.substring(h.length+1)}v.loose||(c?v.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(g))&&(r="[ ] "!==o[0],g=g.replace(/^\[[ xX]\] +/,"")),v.items.push({type:"list_item",raw:n,task:!!o,checked:r,loose:!1,text:g}),v.raw+=n}v.items[v.items.length-1].raw=n.trimRight(),v.items[v.items.length-1].text=g.trimRight(),v.raw=v.raw.trimRight();var b=v.items.length;for(a=0;a<b;a++){this.lexer.state.top=!1,v.items[a].tokens=this.lexer.blockTokens(v.items[a].text,[]);var y=v.items[a].tokens.filter((function(e){return"space"===e.type})),S=y.every((function(e){for(var t,n=0,o=i(e.raw.split(""));!(t=o()).done;)if("\n"===t.value&&(n+=1),n>1)return!0;return!1}));!v.loose&&y.length&&S&&(v.loose=!0,v.items[a].loose=!0)}return v}},n.html=function(e){var t=this.rules.block.html.exec(e);if(t){var n={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(n.type="paragraph",n.text=this.options.sanitizer?this.options.sanitizer(t[0]):u(t[0]),n.tokens=[],this.lexer.inline(n.text,n.tokens)),n}},n.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},n.table=function(e){var t=this.rules.block.table.exec(e);if(t){var n={type:"table",header:x(t[1]).map((function(e){return{text:e}})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=t[0];var i,o,r,s,a=n.align.length;for(i=0;i<a;i++)/^ *-+: *$/.test(n.align[i])?n.align[i]="right":/^ *:-+: *$/.test(n.align[i])?n.align[i]="center":/^ *:-+ *$/.test(n.align[i])?n.align[i]="left":n.align[i]=null;for(a=n.rows.length,i=0;i<a;i++)n.rows[i]=x(n.rows[i],n.header.length).map((function(e){return{text:e}}));for(a=n.header.length,o=0;o<a;o++)n.header[o].tokens=[],this.lexer.inlineTokens(n.header[o].text,n.header[o].tokens);for(a=n.rows.length,o=0;o<a;o++)for(s=n.rows[o],r=0;r<s.length;r++)s[r].tokens=[],this.lexer.inlineTokens(s[r].text,s[r].tokens);return n}}},n.lheading=function(e){var t=this.rules.block.lheading.exec(e);if(t){var n={type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:[]};return this.lexer.inline(n.text,n.tokens),n}},n.paragraph=function(e){var t=this.rules.block.paragraph.exec(e);if(t){var n={type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1],tokens:[]};return this.lexer.inline(n.text,n.tokens),n}},n.text=function(e){var t=this.rules.block.text.exec(e);if(t){var n={type:"text",raw:t[0],text:t[0],tokens:[]};return this.lexer.inline(n.text,n.tokens),n}},n.escape=function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:u(t[1])}},n.tag=function(e){var t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):u(t[0]):t[0]}},n.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;var i=T(n.slice(0,-1),"\\");if((n.length-i.length)%2==0)return}else{var o=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=e.length,i=0,o=0;o<n;o++)if("\\"===e[o])o++;else if(e[o]===t[0])i++;else if(e[o]===t[1]&&--i<0)return o;return-1}(t[2],"()");if(o>-1){var r=(0===t[0].indexOf("!")?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,r).trim(),t[3]=""}}var s=t[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);l&&(s=l[1],a=l[3])}else a=t[3]?t[3].slice(1,-1):"";return s=s.trim(),/^</.test(s)&&(s=this.options.pedantic&&!/>$/.test(n)?s.slice(1):s.slice(1,-1)),L(t,{href:s?s.replace(this.rules.inline._escapes,"$1"):s,title:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0],this.lexer)}},n.reflink=function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=t[i.toLowerCase()])||!i.href){var o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return L(n,i,n[0],this.lexer)}},n.emStrong=function(e,t,n){void 0===n&&(n="");var i=this.rules.inline.emStrong.lDelim.exec(e);if(i&&(!i[3]||!n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var o=i[1]||i[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){var r,s,a=i[0].length-1,l=a,c=0,d="*"===i[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+a);null!=(i=d.exec(t));)if(r=i[1]||i[2]||i[3]||i[4]||i[5]||i[6])if(s=r.length,i[3]||i[4])l+=s;else if(!((i[5]||i[6])&&a%3)||(a+s)%3){if(!((l-=s)>0)){if(s=Math.min(s,s+l+c),Math.min(a,s)%2){var u=e.slice(1,a+i.index+s);return{type:"em",raw:e.slice(0,a+i.index+s+1),text:u,tokens:this.lexer.inlineTokens(u,[])}}var h=e.slice(2,a+i.index+s-1);return{type:"strong",raw:e.slice(0,a+i.index+s+1),text:h,tokens:this.lexer.inlineTokens(h,[])}}}else c+=s}}},n.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(/\n/g," "),i=/[^ ]/.test(n),o=/^ /.test(n)&&/ $/.test(n);return i&&o&&(n=n.substring(1,n.length-1)),n=u(n,!0),{type:"codespan",raw:t[0],text:n}}},n.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},n.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}},n.autolink=function(e,t){var n,i,o=this.rules.inline.autolink.exec(e);if(o)return i="@"===o[2]?"mailto:"+(n=u(this.options.mangle?t(o[1]):o[1])):n=u(o[1]),{type:"link",raw:o[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}},n.url=function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var i,o;if("@"===n[2])o="mailto:"+(i=u(this.options.mangle?t(n[0]):n[0]));else{var r;do{r=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(r!==n[0]);i=u(n[0]),o="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}},n.inlineText=function(e,t){var n,i=this.rules.inline.text.exec(e);if(i)return n=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):u(i[0]):i[0]:u(this.options.smartypants?t(i[0]):i[0]),{type:"text",raw:i[0],text:n}},t}(),N={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:w,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};N.def=f(N.def).replace("label",N._label).replace("title",N._title).getRegex(),N.bullet=/(?:[*+-]|\d{1,9}[.)])/,N.listItemStart=f(/^( *)(bull) */).replace("bull",N.bullet).getRegex(),N.list=f(N.list).replace(/bull/g,N.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+N.def.source+")").getRegex(),N._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",N._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,N.html=f(N.html,"i").replace("comment",N._comment).replace("tag",N._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),N.paragraph=f(N._paragraph).replace("hr",N.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",N._tag).getRegex(),N.blockquote=f(N.blockquote).replace("paragraph",N.paragraph).getRegex(),N.normal=E({},N),N.gfm=E({},N.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),N.gfm.table=f(N.gfm.table).replace("hr",N.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",N._tag).getRegex(),N.gfm.paragraph=f(N._paragraph).replace("hr",N.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",N.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",N._tag).getRegex(),N.pedantic=E({},N.normal,{html:f("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",N._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:w,paragraph:f(N.normal._paragraph).replace("hr",N.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",N.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var O={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:w,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:w,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function A(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function P(e){var t,n,i="",o=e.length;for(t=0;t<o;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}O._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",O.punctuation=f(O.punctuation).replace(/punctuation/g,O._punctuation).getRegex(),O.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,O.escapedEmSt=/\\\*|\\_/g,O._comment=f(N._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),O.emStrong.lDelim=f(O.emStrong.lDelim).replace(/punct/g,O._punctuation).getRegex(),O.emStrong.rDelimAst=f(O.emStrong.rDelimAst,"g").replace(/punct/g,O._punctuation).getRegex(),O.emStrong.rDelimUnd=f(O.emStrong.rDelimUnd,"g").replace(/punct/g,O._punctuation).getRegex(),O._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,O._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,O._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,O.autolink=f(O.autolink).replace("scheme",O._scheme).replace("email",O._email).getRegex(),O._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,O.tag=f(O.tag).replace("comment",O._comment).replace("attribute",O._attribute).getRegex(),O._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,O._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,O._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,O.link=f(O.link).replace("label",O._label).replace("href",O._href).replace("title",O._title).getRegex(),O.reflink=f(O.reflink).replace("label",O._label).replace("ref",N._label).getRegex(),O.nolink=f(O.nolink).replace("ref",N._label).getRegex(),O.reflinkSearch=f(O.reflinkSearch,"g").replace("reflink",O.reflink).replace("nolink",O.nolink).getRegex(),O.normal=E({},O),O.pedantic=E({},O.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:f(/^!?\[(label)\]\((.*?)\)/).replace("label",O._label).getRegex(),reflink:f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",O._label).getRegex()}),O.gfm=E({},O.normal,{escape:f(O.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),O.gfm.url=f(O.gfm.url,"i").replace("email",O.gfm._extended_email).getRegex(),O.breaks=E({},O.gfm,{br:f(O.br).replace("{2,}","*").getRegex(),text:f(O.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var R=function(){function n(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||e.defaults,this.options.tokenizer=this.options.tokenizer||new D,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var n={block:N.normal,inline:O.normal};this.options.pedantic?(n.block=N.pedantic,n.inline=O.pedantic):this.options.gfm&&(n.block=N.gfm,this.options.breaks?n.inline=O.breaks:n.inline=O.gfm),this.tokenizer.rules=n}n.lex=function(e,t){return new n(t).lex(e)},n.lexInline=function(e,t){return new n(t).inlineTokens(e)};var i,o,r,s=n.prototype;return s.lex=function(e){var t;for(e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens},s.blockTokens=function(e,t){var n,i,o,r,s=this;for(void 0===t&&(t=[]),this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((function(i){return!!(n=i.call({lexer:s},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)}))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),!(i=t[t.length-1])||"paragraph"!==i.type&&"text"!==i.type?t.push(n):(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),!(i=t[t.length-1])||"paragraph"!==i.type&&"text"!==i.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(i.raw+="\n"+n.raw,i.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else if(o=e,this.options.extensions&&this.options.extensions.startBlock&&function(){var t=Infinity,n=e.slice(1),i=void 0;s.options.extensions.startBlock.forEach((function(e){"number"==typeof(i=e.call({lexer:this},n))&&i>=0&&(t=Math.min(t,i))})),t<Infinity&&t>=0&&(o=e.substring(0,t+1))}(),this.state.top&&(n=this.tokenizer.paragraph(o)))i=t[t.length-1],r&&"paragraph"===i.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n),r=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),(i=t[t.length-1])&&"text"===i.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n);else if(e){var a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(a)}return this.state.top=!0,t},s.inline=function(e,t){this.inlineQueue.push({src:e,tokens:t})},s.inlineTokens=function(e,t){var n,i,o,r=this;void 0===t&&(t=[]);var s,a,l,c=e;if(this.tokens.links){var d=Object.keys(this.tokens.links);if(d.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(c));)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,s.index)+"["+k("a",s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,s.index)+"["+k("a",s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.escapedEmSt.exec(c));)c=c.slice(0,s.index)+"++"+c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(a||(l=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((function(i){return!!(n=i.call({lexer:r},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)}))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),(i=t[t.length-1])&&"text"===n.type&&"text"===i.type?(i.raw+=n.raw,i.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),(i=t[t.length-1])&&"text"===n.type&&"text"===i.type?(i.raw+=n.raw,i.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,l))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,P))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,P))){if(o=e,this.options.extensions&&this.options.extensions.startInline&&function(){var t=Infinity,n=e.slice(1),i=void 0;r.options.extensions.startInline.forEach((function(e){"number"==typeof(i=e.call({lexer:this},n))&&i>=0&&(t=Math.min(t,i))})),t<Infinity&&t>=0&&(o=e.substring(0,t+1))}(),n=this.tokenizer.inlineText(o,A))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(l=n.raw.slice(-1)),a=!0,(i=t[t.length-1])&&"text"===i.type?(i.raw+=n.raw,i.text+=n.text):t.push(n);else if(e){var u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(u)}}else e=e.substring(n.raw.length),t.push(n);return t},i=n,r=[{key:"rules",get:function(){return{block:N,inline:O}}}],(o=null)&&t(i.prototype,o),r&&t(i,r),Object.defineProperty(i,"prototype",{writable:!1}),n}(),M=function(){function t(t){this.options=t||e.defaults}var n=t.prototype;return n.code=function(e,t,n){var i=(t||"").match(/\S*/)[0];if(this.options.highlight){var o=this.options.highlight(e,i);null!=o&&o!==e&&(n=!0,e=o)}return e=e.replace(/\n$/,"")+"\n",i?'<pre><code class="'+this.options.langPrefix+u(i,!0)+'">'+(n?e:u(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:u(e,!0))+"</code></pre>\n"},n.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},n.html=function(e){return e},n.heading=function(e,t,n,i){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+i.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},n.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},n.list=function(e,t,n){var i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+i+">\n"},n.listitem=function(e){return"<li>"+e+"</li>\n"},n.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},n.paragraph=function(e){return"<p>"+e+"</p>\n"},n.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},n.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},n.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},n.strong=function(e){return"<strong>"+e+"</strong>"},n.em=function(e){return"<em>"+e+"</em>"},n.codespan=function(e){return"<code>"+e+"</code>"},n.br=function(){return this.options.xhtml?"<br/>":"<br>"},n.del=function(e){return"<del>"+e+"</del>"},n.link=function(e,t,n){if(null===(e=_(this.options.sanitize,this.options.baseUrl,e)))return n;var i='<a href="'+u(e)+'"';return t&&(i+=' title="'+t+'"'),i+=">"+n+"</a>"},n.image=function(e,t,n){if(null===(e=_(this.options.sanitize,this.options.baseUrl,e)))return n;var i='<img src="'+e+'" alt="'+n+'"';return t&&(i+=' title="'+t+'"'),i+=this.options.xhtml?"/>":">"},n.text=function(e){return e},t}(),$=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,n){return""+n},t.image=function(e,t,n){return""+n},t.br=function(){return""},e}(),F=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var n=e,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[e];do{n=e+"-"+ ++i}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=i,this.seen[n]=0),n},t.slug=function(e,t){void 0===t&&(t={});var n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)},e}(),B=function(){function t(t){this.options=t||e.defaults,this.options.renderer=this.options.renderer||new M,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new $,this.slugger=new F}t.parse=function(e,n){return new t(n).parse(e)},t.parseInline=function(e,n){return new t(n).parseInline(e)};var n=t.prototype;return n.parse=function(e,t){void 0===t&&(t=!0);var n,i,o,r,s,a,l,c,d,u,h,p,f,m,v,_,C,b,y,S="",w=e.length;for(n=0;n<w;n++)if(u=e[n],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[u.type])||!1===(y=this.options.extensions.renderers[u.type].call({parser:this},u))&&["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type))switch(u.type){case"space":continue;case"hr":S+=this.renderer.hr();continue;case"heading":S+=this.renderer.heading(this.parseInline(u.tokens),u.depth,g(this.parseInline(u.tokens,this.textRenderer)),this.slugger);continue;case"code":S+=this.renderer.code(u.text,u.lang,u.escaped);continue;case"table":for(c="",l="",r=u.header.length,i=0;i<r;i++)l+=this.renderer.tablecell(this.parseInline(u.header[i].tokens),{header:!0,align:u.align[i]});for(c+=this.renderer.tablerow(l),d="",r=u.rows.length,i=0;i<r;i++){for(l="",s=(a=u.rows[i]).length,o=0;o<s;o++)l+=this.renderer.tablecell(this.parseInline(a[o].tokens),{header:!1,align:u.align[o]});d+=this.renderer.tablerow(l)}S+=this.renderer.table(c,d);continue;case"blockquote":d=this.parse(u.tokens),S+=this.renderer.blockquote(d);continue;case"list":for(h=u.ordered,p=u.start,f=u.loose,r=u.items.length,d="",i=0;i<r;i++)_=(v=u.items[i]).checked,C=v.task,m="",v.task&&(b=this.renderer.checkbox(_),f?v.tokens.length>0&&"paragraph"===v.tokens[0].type?(v.tokens[0].text=b+" "+v.tokens[0].text,v.tokens[0].tokens&&v.tokens[0].tokens.length>0&&"text"===v.tokens[0].tokens[0].type&&(v.tokens[0].tokens[0].text=b+" "+v.tokens[0].tokens[0].text)):v.tokens.unshift({type:"text",text:b}):m+=b),m+=this.parse(v.tokens,f),d+=this.renderer.listitem(m,C,_);S+=this.renderer.list(d,h,p);continue;case"html":S+=this.renderer.html(u.text);continue;case"paragraph":S+=this.renderer.paragraph(this.parseInline(u.tokens));continue;case"text":for(d=u.tokens?this.parseInline(u.tokens):u.text;n+1<w&&"text"===e[n+1].type;)d+="\n"+((u=e[++n]).tokens?this.parseInline(u.tokens):u.text);S+=t?this.renderer.paragraph(d):d;continue;default:var E='Token with "'+u.type+'" type was not found.';if(this.options.silent)return;throw new Error(E)}else S+=y||"";return S},n.parseInline=function(e,t){t=t||this.renderer;var n,i,o,r="",s=e.length;for(n=0;n<s;n++)if(i=e[n],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type])||!1===(o=this.options.extensions.renderers[i.type].call({parser:this},i))&&["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type))switch(i.type){case"escape":case"text":r+=t.text(i.text);break;case"html":r+=t.html(i.text);break;case"link":r+=t.link(i.href,i.title,this.parseInline(i.tokens,t));break;case"image":r+=t.image(i.href,i.title,i.text);break;case"strong":r+=t.strong(this.parseInline(i.tokens,t));break;case"em":r+=t.em(this.parseInline(i.tokens,t));break;case"codespan":r+=t.codespan(i.text);break;case"br":r+=t.br();break;case"del":r+=t.del(this.parseInline(i.tokens,t));break;default:var a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return;throw new Error(a)}else r+=o||"";return r},t}();function V(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),I(t=E({},V.defaults,t||{})),n){var i,o=t.highlight;try{i=R.lex(e,t)}catch(e2){return n(e2)}var r=function(e){var r;if(!e)try{t.walkTokens&&V.walkTokens(i,t.walkTokens),r=B.parse(i,t)}catch(e2){e=e2}return t.highlight=o,e?n(e):n(null,r)};if(!o||o.length<3)return r();if(delete t.highlight,!i.length)return r();var s=0;return V.walkTokens(i,(function(e){"code"===e.type&&(s++,setTimeout((function(){o(e.text,e.lang,(function(t,n){if(t)return r(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),0==--s&&r()}))}),0))})),void(0===s&&r())}try{var a=R.lex(e,t);return t.walkTokens&&V.walkTokens(a,t.walkTokens),B.parse(a,t)}catch(e2){if(e2.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+u(e2.message+"",!0)+"</pre>";throw e2}}V.options=V.setOptions=function(t){var n;return E(V.defaults,t),n=V.defaults,e.defaults=n,V},V.getDefaults=o,V.defaults=e.defaults,V.use=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i,o=E.apply(void 0,[{}].concat(t)),r=V.defaults.extensions||{renderers:{},childTokens:{}};t.forEach((function(e){if(e.extensions&&(i=!0,e.extensions.forEach((function(e){if(!e.name)throw new Error("extension name required");if(e.renderer){var t=r.renderers?r.renderers[e.name]:null;r.renderers[e.name]=t?function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var r=e.renderer.apply(this,i);return!1===r&&(r=t.apply(this,i)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");r[e.level]?r[e.level].unshift(e.tokenizer):r[e.level]=[e.tokenizer],e.start&&("block"===e.level?r.startBlock?r.startBlock.push(e.start):r.startBlock=[e.start]:"inline"===e.level&&(r.startInline?r.startInline.push(e.start):r.startInline=[e.start]))}e.childTokens&&(r.childTokens[e.name]=e.childTokens)}))),e.renderer&&function(){var t=V.defaults.renderer||new M,n=function(n){var i=t[n];t[n]=function(){for(var o=arguments.length,r=new Array(o),s=0;s<o;s++)r[s]=arguments[s];var a=e.renderer[n].apply(t,r);return!1===a&&(a=i.apply(t,r)),a}};for(var i in e.renderer)n(i);o.renderer=t}(),e.tokenizer&&function(){var t=V.defaults.tokenizer||new D,n=function(n){var i=t[n];t[n]=function(){for(var o=arguments.length,r=new Array(o),s=0;s<o;s++)r[s]=arguments[s];var a=e.tokenizer[n].apply(t,r);return!1===a&&(a=i.apply(t,r)),a}};for(var i in e.tokenizer)n(i);o.tokenizer=t}(),e.walkTokens){var t=V.defaults.walkTokens;o.walkTokens=function(n){e.walkTokens.call(this,n),t&&t.call(this,n)}}i&&(o.extensions=r),V.setOptions(o)}))},V.walkTokens=function(e,t){for(var n,o=function(){var e=n.value;switch(t.call(V,e),e.type){case"table":for(var o,r=i(e.header);!(o=r()).done;){var s=o.value;V.walkTokens(s.tokens,t)}for(var a,l=i(e.rows);!(a=l()).done;)for(var c,d=i(a.value);!(c=d()).done;){var u=c.value;V.walkTokens(u.tokens,t)}break;case"list":V.walkTokens(e.items,t);break;default:V.defaults.extensions&&V.defaults.extensions.childTokens&&V.defaults.extensions.childTokens[e.type]?V.defaults.extensions.childTokens[e.type].forEach((function(n){V.walkTokens(e[n],t)})):e.tokens&&V.walkTokens(e.tokens,t)}},r=i(e);!(n=r()).done;)o()},V.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");I(t=E({},V.defaults,t||{}));try{var n=R.lexInline(e,t);return t.walkTokens&&V.walkTokens(n,t.walkTokens),B.parseInline(n,t)}catch(e2){if(e2.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+u(e2.message+"",!0)+"</pre>";throw e2}},V.Parser=B,V.parser=B.parse,V.Renderer=M,V.TextRenderer=$,V.Lexer=R,V.lexer=R.lex,V.Tokenizer=D,V.Slugger=F,V.parse=V;var W=V.options,H=V.setOptions,z=V.use,K=V.walkTokens,j=V.parseInline,U=V,G=B.parse,q=R.lex;e.Lexer=R,e.Parser=B,e.Renderer=M,e.Slugger=F,e.TextRenderer=$,e.Tokenizer=D,e.getDefaults=o,e.lexer=q,e.marked=V,e.options=W,e.parse=U,e.parseInline=j,e.parser=G,e.setOptions=H,e.use=z,e.walkTokens=K,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?n(exports):e.amd?e(0,n):n((t="undefined"!=typeof globalThis?globalThis:t||self).marked={})}();var marked=__marked_exports||exports;function parse$1(e){let t=JSON.parse(e);return t=revive(t),t}function revive(e,t=0){if(!e||t>200)return e;if("object"==typeof e){switch(e.$mid){case 1:return URI.revive(e);case 2:return new RegExp(e.source,e.flags);case 14:return new Date(e.source)}if(e instanceof VSBuffer||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let n=0;n<e.length;++n)e[n]=revive(e[n],t+1);else for(const n in e)Object.hasOwnProperty.call(e,n)&&(e[n]=revive(e[n],t+1))}return e}function renderMarkdown(e,t={},n={}){var i;const o=new DisposableStore;let r=!1;const s=o.add(new CancellationTokenSource$1),a=createElement(t),l=function(t){let n;try{n=parse$1(decodeURIComponent(t))}catch(e2){}return n?(n=cloneAndChange(n,(t=>e.uris&&e.uris[t]?URI.revive(e.uris[t]):void 0)),encodeURIComponent(JSON.stringify(n))):t},c=function(t,n){const i=e.uris&&e.uris[t];let o=URI.revive(i);return n?t.startsWith(Schemas.data+":")?t:(o||(o=URI.parse(t)),FileAccess.asBrowserUri(o).toString(!0)):o?URI.parse(t).toString()===o.toString()?t:(o.query&&(o=o.with({query:l(o.query)})),o.toString()):t};let d;const u=new Promise((e=>d=e)),h=new marked.Renderer;if(h.image=(e,t,n)=>{let i=[],o=[];return e&&(({href:e,dimensions:i}=parseHrefAndDimensions(e)),o.push(`src="${e}"`)),n&&o.push(`alt="${n}"`),t&&o.push(`title="${t}"`),i.length&&(o=o.concat(i)),"<img "+o.join(" ")+">"},h.link=(t,n,i)=>"string"!=typeof t?"":(t===i&&(i=removeMarkdownEscapes(i)),t=c(t,!1),e.baseUri&&(t=resolveWithBaseUri(URI.from(e.baseUri),t)),n="string"==typeof n?removeMarkdownEscapes(n):"",!(t=removeMarkdownEscapes(t))||/^data:|javascript:/i.test(t)||/^command:/i.test(t)&&!e.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(t)?i:`<a data-href="${t=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}" title="${n||t}">${i}</a>`),h.paragraph=e=>`<p>${e}</p>`,t.codeBlockRenderer&&(h.code=(e,n)=>{const i=t.codeBlockRenderer(null!=n?n:"",e),o=defaultGenerator.nextId();return raceCancellation(Promise.all([i,u]),s.token).then((e=>{var n;if(!r&&e){const i=a.querySelector(`div[data-code="${o}"]`);i&&reset(i,e[0]),null===(n=t.asyncRenderCallback)||void 0===n||n.call(t)}})).catch((()=>{})),`<div class="code" data-code="${o}">${escape(e)}</div>`}),t.actionHandler){const n=t.actionHandler.disposables.add(new DomEmitter(a,"click")),i=t.actionHandler.disposables.add(new DomEmitter(a,"auxclick"));t.actionHandler.disposables.add(Event$1.any(n.event,i.event)((n=>{const i=new StandardMouseEvent(n);if(!i.leftButton&&!i.middleButton)return;let o=i.target;if("A"===o.tagName||(o=o.parentElement,o&&"A"===o.tagName))try{let n=o.dataset.href;n&&(e.baseUri&&(n=resolveWithBaseUri(URI.from(e.baseUri),n)),t.actionHandler.callback(n,i))}catch(r){onUnexpectedError(r)}finally{i.preventDefault()}})))}e.supportHtml||(n.sanitizer=t=>(e.isTrusted?t.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?t:"",n.sanitize=!0,n.silent=!0),n.renderer=h;let g=null!==(i=e.value)&&void 0!==i?i:"";g.length>1e5&&(g=`${g.substr(0,1e5)}…`),e.supportThemeIcons&&(g=markdownEscapeEscapedIcons(g));let p=marked.parse(g,n);if(e.supportThemeIcons){p=renderLabelWithIcons(p).map((e=>"string"==typeof e?e:e.outerHTML)).join("")}const f=(new DOMParser).parseFromString(sanitizeRenderedMarkdown(e,p),"text/html");if(f.body.querySelectorAll("img").forEach((t=>{const n=t.getAttribute("src");if(n){let o=n;try{e.baseUri&&(o=resolveWithBaseUri(URI.from(e.baseUri),o))}catch(i){}t.src=c(o,!0)}})),a.innerHTML=sanitizeRenderedMarkdown(e,f.body.innerHTML),d(),t.asyncRenderCallback)for(const m of a.getElementsByTagName("img")){const e=o.add(addDisposableListener(m,"load",(()=>{e.dispose(),t.asyncRenderCallback()})))}return{element:a,dispose:()=>{r=!0,s.cancel(),o.dispose()}}}function resolveWithBaseUri(e,t){return/^\w[\w\d+.-]*:/.test(t)?t:e.path.endsWith("/")?resolvePath(e,t).toString():resolvePath(dirname(e),t).toString()}function sanitizeRenderedMarkdown(e,t){const{config:n,allowedSchemes:i}=getSanitizerOptions(e);addHook("uponSanitizeAttribute",((e,t)=>{if("style"!==t.attrName&&"class"!==t.attrName);else{if("SPAN"===e.tagName){if("style"===t.attrName)return void(t.keepAttr=/^(color\:#[0-9a-fA-F]+;)?(background-color\:#[0-9a-fA-F]+;)?$/.test(t.attrValue));if("class"===t.attrName)return void(t.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(t.attrValue))}t.keepAttr=!1}}));const o=document.createElement("a");addHook("afterSanitizeAttributes",(e=>{for(const t of["href","src"])e.hasAttribute(t)&&(o.href=e.getAttribute(t),i.includes(o.protocol.replace(/:$/,""))||e.removeAttribute(t))}));try{return sanitize$1(t,Object.assign(Object.assign({},n),{RETURN_TRUSTED_TYPE:!0}))}finally{removeHook("uponSanitizeAttribute"),removeHook("afterSanitizeAttributes")}}function getSanitizerOptions(e){const t=[Schemas.http,Schemas.https,Schemas.mailto,Schemas.data,Schemas.file,Schemas.vscodeFileResource,Schemas.vscodeRemote,Schemas.vscodeRemoteResource];return e.isTrusted&&t.push(Schemas.command),{config:{ALLOWED_TAGS:["ul","li","p","b","i","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"],ALLOWED_ATTR:["href","data-href","target","title","src","alt","class","style","data-code","width","height","align"],ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:t}}var __awaiter$F=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const IOpenerService=createDecorator("openerService"),NullOpenerService=Object.freeze({_serviceBrand:void 0,registerOpener:()=>Disposable.None,registerValidator:()=>Disposable.None,registerExternalUriResolver:()=>Disposable.None,setDefaultExternalOpener(){},registerExternalOpener:()=>Disposable.None,open(){return __awaiter$F(this,void 0,void 0,(function*(){return!1}))},resolveExternalUri(e){return __awaiter$F(this,void 0,void 0,(function*(){return{resolved:e,dispose(){}}}))}});function matchesScheme(e,t){return URI.isUri(e)?equalsIgnoreCase(e.scheme,t):startsWithIgnoreCase(e,t+":")}function matchesSomeScheme(e,...t){return t.some((t=>matchesScheme(e,t)))}function extractSelection(e){let t;const n=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(e.fragment);return n&&(t={startLineNumber:parseInt(n[1]),startColumn:n[2]?parseInt(n[2]):1,endLineNumber:n[4]?parseInt(n[4]):void 0,endColumn:n[4]?n[5]?parseInt(n[5]):1:void 0},e=e.with({fragment:""})),{selection:t,uri:e}}var __decorate$12=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$11=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$E=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},_a$6;let MarkdownRenderer=class e{constructor(e,t,n){this._options=e,this._languageService=t,this._openerService=n,this._onDidRenderAsync=new Emitter$1,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,n){if(!e){return{element:document.createElement("span"),dispose:()=>{}}}const i=new DisposableStore;return{element:i.add(renderMarkdown(e,Object.assign(Object.assign({},this._getRenderOptions(e,i)),t),n)).element,dispose:()=>i.dispose()}}_getRenderOptions(t,n){return{codeBlockRenderer:(t,n)=>__awaiter$E(this,void 0,void 0,(function*(){var i,o,r;let s;t?s=this._languageService.getLanguageIdByLanguageName(t):this._options.editor&&(s=null===(i=this._options.editor.getModel())||void 0===i?void 0:i.getLanguageId()),s||(s=PLAINTEXT_LANGUAGE_ID);const a=yield tokenizeToString(this._languageService,n,s),l=document.createElement("span");if(l.innerHTML=null!==(r=null===(o=e._ttpTokenizer)||void 0===o?void 0:o.createHTML(a))&&void 0!==r?r:a,this._options.editor){applyFontInfo(l,this._options.editor.getOption(44))}else this._options.codeBlockFontFamily&&(l.style.fontFamily=this._options.codeBlockFontFamily);return l})),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:e=>this._openerService.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:t.isTrusted}).catch(onUnexpectedError),disposables:n}}}};MarkdownRenderer._ttpTokenizer=null===(_a$6=window.trustedTypes)||void 0===_a$6?void 0:_a$6.createPolicy("tokenizeToString",{createHTML:e=>e}),MarkdownRenderer=__decorate$12([__param$11(1,ILanguageService),__param$11(2,IOpenerService)],MarkdownRenderer);const $$7=$$c;class MarginHoverWidget extends Disposable{constructor(e,t,n=NullOpenerService){super(),this._renderDisposeables=this._register(new DisposableStore),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new HoverWidget),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new MarkdownRenderer({editor:this._editor},t,n)),this._computer=new MarginHoverComputer(this._editor),this._hoverOperation=this._register(new HoverOperation(this._editor,this._computer)),this._register(this._hoverOperation.onResult((e=>{this._withResult(e.value)}))),this._register(this._editor.onDidChangeModelDecorations((()=>this._onModelDecorationsChanged()))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(44)&&this._updateFont()}))),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return MarginHoverWidget.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach((e=>this._editor.applyFontInfo(e)))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const n=document.createDocumentFragment();for(const i of t){const e=$$7("div.hover-row.markdown-hover"),t=append$1(e,$$7("div.hover-contents")),o=this._renderDisposeables.add(this._markdownRenderer.render(i.value));t.appendChild(o.element),n.appendChild(e)}this._updateContents(n),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),n=this._editor.getTopForLineNumber(e),i=this._editor.getScrollTop(),o=this._editor.getOption(59),r=n-i-(this._hover.containerDomNode.clientHeight-o)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(r),0)}px`}}MarginHoverWidget.ID="editor.contrib.modesGlyphHoverWidget";class MarginHoverComputer{constructor(e){this._editor=e,this._lineNumber=-1}get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}computeSync(){const e=e=>({value:e}),t=this._editor.getLineDecorations(this._lineNumber),n=[];if(!t)return n;for(const i of t){if(!i.options.glyphMarginClassName)continue;const t=i.options.glyphMarginHoverMessage;t&&!isEmptyMarkdownString(t)&&n.push(...asArray(t).map(e))}return n}}var __awaiter$D=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class HoverProviderResult{constructor(e,t,n){this.provider=e,this.hover=t,this.ordinal=n}}function executeProvider(e,t,n,i,o){return __awaiter$D(this,void 0,void 0,(function*(){try{const r=yield Promise.resolve(e.provideHover(n,i,o));if(r&&isValid(r))return new HoverProviderResult(e,r,t)}catch(r){onUnexpectedExternalError(r)}}))}function getHover(e,t,n,i){const o=e.ordered(t).map(((e,o)=>executeProvider(e,o,t,n,i)));return AsyncIterableObject.fromPromises(o).coalesce()}function getHoverPromise(e,t,n,i){return getHover(e,t,n,i).map((e=>e.hover)).toPromise()}function isValid(e){const t=void 0!==e.range,n=void 0!==e.contents&&e.contents&&e.contents.length>0;return t&&n}registerModelAndPositionCommand("_executeHoverProvider",((e,t,n)=>getHoverPromise(e.get(ILanguageFeaturesService).hoverProvider,t,n,CancellationToken.None)));var __decorate$11=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$10=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const $$6=$$c;class MarkdownHover{constructor(e,t,n,i){this.owner=e,this.range=t,this.contents=n,this.ordinal=i}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let MarkdownHoverParticipant=class{constructor(e,t,n,i,o){this._editor=e,this._languageService=t,this._openerService=n,this._configurationService=i,this._languageFeaturesService=o,this.hoverOrdinal=2}createLoadingMessage(e){return new MarkdownHover(this,e.range,[(new MarkdownString).appendText(localize("modesContentHover.loading","Loading..."))],2e3)}computeSync(e,t){if(!this._editor.hasModel()||1!==e.type)return[];const n=this._editor.getModel(),i=e.range.startLineNumber,o=n.getLineMaxColumn(i),r=[];let s=1e3;const a=n.getLineLength(i),l=n.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),c=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:l});"number"==typeof c&&a>=c&&r.push(new MarkdownHover(this,e.range,[{value:localize("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],s++));for(const d of t){const t=d.range.startLineNumber===i?d.range.startColumn:1,n=d.range.endLineNumber===i?d.range.endColumn:o,a=d.options.hoverMessage;if(!a||isEmptyMarkdownString(a))continue;const l=new Range$2(e.range.startLineNumber,t,e.range.startLineNumber,n);r.push(new MarkdownHover(this,l,asArray(a),s++))}return r}computeAsync(e,t,n){if(!this._editor.hasModel()||1!==e.type)return AsyncIterableObject.EMPTY;const i=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(i))return AsyncIterableObject.EMPTY;const o=new Position$1(e.range.startLineNumber,e.range.startColumn);return getHover(this._languageFeaturesService.hoverProvider,i,o,n).filter((e=>!isEmptyMarkdownString(e.hover.contents))).map((t=>{const n=t.hover.range?Range$2.lift(t.hover.range):e.range;return new MarkdownHover(this,n,t.hover.contents,t.ordinal)}))}renderHoverParts(e,t){return renderMarkdownHovers(e,t,this._editor,this._languageService,this._openerService)}};function renderMarkdownHovers(e,t,n,i,o){t.sort(((e,t)=>e.ordinal-t.ordinal));const r=new DisposableStore;for(const s of t)for(const t of s.contents){if(isEmptyMarkdownString(t))continue;const s=$$6("div.hover-row.markdown-hover"),a=append$1(s,$$6("div.hover-contents")),l=r.add(new MarkdownRenderer({editor:n},i,o));r.add(l.onDidRenderAsync((()=>{a.className="hover-contents code-hover-contents",e.onContentsChanged()})));const c=r.add(l.render(t));a.appendChild(c.element),e.fragment.appendChild(s)}return r}MarkdownHoverParticipant=__decorate$11([__param$10(1,ILanguageService),__param$10(2,IOpenerService),__param$10(3,IConfigurationService),__param$10(4,ILanguageFeaturesService)],MarkdownHoverParticipant);var __decorate$10=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$$=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};class MarkerCoordinate{constructor(e,t,n){this.marker=e,this.index=t,this.total=n}}let MarkerList=class{constructor(e,t,n){this._markerService=t,this._configService=n,this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event,this._dispoables=new DisposableStore,this._markers=[],this._nextIdx=-1,URI.isUri(e)?this._resourceFilter=t=>t.toString()===e.toString():e&&(this._resourceFilter=e);const i=this._configService.getValue("problems.sortOrder"),o=(e,t)=>{let n=compare(e.resource.toString(),t.resource.toString());return 0===n&&(n="position"===i?Range$2.compareRangesUsingStarts(e,t)||MarkerSeverity$2.compare(e.severity,t.severity):MarkerSeverity$2.compare(e.severity,t.severity)||Range$2.compareRangesUsingStarts(e,t)),n},r=()=>{this._markers=this._markerService.read({resource:URI.isUri(e)?e:void 0,severities:MarkerSeverity$2.Error|MarkerSeverity$2.Warning|MarkerSeverity$2.Info}),"function"==typeof e&&(this._markers=this._markers.filter((e=>this._resourceFilter(e.resource)))),this._markers.sort(o)};r(),this._dispoables.add(t.onMarkerChanged((e=>{this._resourceFilter&&!e.some((e=>this._resourceFilter(e)))||(r(),this._nextIdx=-1,this._onDidChange.fire())})))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e||!(!this._resourceFilter||!e)&&this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new MarkerCoordinate(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,n){let i=!1,o=this._markers.findIndex((t=>t.resource.toString()===e.uri.toString()));o<0&&(o=binarySearch(this._markers,{resource:e.uri},((e,t)=>compare(e.resource.toString(),t.resource.toString()))),o<0&&(o=~o));for(let r=o;r<this._markers.length;r++){let n=Range$2.lift(this._markers[r]);if(n.isEmpty()){const t=e.getWordAtPosition(n.getStartPosition());t&&(n=new Range$2(n.startLineNumber,t.startColumn,n.startLineNumber,t.endColumn))}if(t&&(n.containsPosition(t)||t.isBeforeOrEqual(n.getStartPosition()))){this._nextIdx=r,i=!0;break}if(this._markers[r].resource.toString()!==e.uri.toString())break}i||(this._nextIdx=n?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,t,n){if(0===this._markers.length)return!1;let i=this._nextIdx;return-1===this._nextIdx?this._initIdx(t,n,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),i!==this._nextIdx}find(e,t){let n=this._markers.findIndex((t=>t.resource.toString()===e.toString()));if(!(n<0))for(;n<this._markers.length;n++)if(Range$2.containsPosition(this._markers[n],t))return new MarkerCoordinate(this._markers[n],n+1,this._markers.length)}};MarkerList=__decorate$10([__param$$(1,IMarkerService),__param$$(2,IConfigurationService)],MarkerList);const IMarkerNavigationService=createDecorator("IMarkerNavigationService");let MarkerNavigationService=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new LinkedList}getMarkerList(e){for(let t of this._provider){const n=t.getMarkerList(e);if(n)return n}return new MarkerList(e,this._markerService,this._configService)}};MarkerNavigationService=__decorate$10([__param$$(0,IMarkerService),__param$$(1,IConfigurationService)],MarkerNavigationService),registerSingleton(IMarkerNavigationService,MarkerNavigationService,!0);var gotoErrorWidget="",SeverityIcon;(SeverityIcon||(SeverityIcon={})).className=function(e){switch(e){case Severity$2.Ignore:return"severity-ignore "+Codicon.info.classNames;case Severity$2.Info:return Codicon.info.classNames;case Severity$2.Warning:return Codicon.warning.classNames;case Severity$2.Error:return Codicon.error.classNames;default:return""}},registerThemingParticipant(((e,t)=>{const n=e.getColor(problemsErrorIconForeground);if(n){const e=Codicon.error.cssSelector;t.addRule(`\n\t\t\t.monaco-editor .zone-widget ${e},\n\t\t\t.markers-panel .marker-icon${e},\n\t\t\t.text-search-provider-messages .providerMessage ${e},\n\t\t\t.extensions-viewlet > .extensions ${e} {\n\t\t\t\tcolor: ${n};\n\t\t\t}\n\t\t`)}const i=e.getColor(problemsWarningIconForeground);if(i){const e=Codicon.warning.cssSelector;t.addRule(`\n\t\t\t.monaco-editor .zone-widget ${e},\n\t\t\t.markers-panel .marker-icon${e},\n\t\t\t.extensions-viewlet > .extensions ${e},\n\t\t\t.extension-editor ${e},\n\t\t\t.text-search-provider-messages .providerMessage ${e},\n\t\t\t.preferences-editor ${e} {\n\t\t\t\tcolor: ${i};\n\t\t\t}\n\t\t`)}const o=e.getColor(problemsInfoIconForeground);if(o){const e=Codicon.info.cssSelector;t.addRule(`\n\t\t\t.monaco-editor .zone-widget ${e},\n\t\t\t.markers-panel .marker-icon${e},\n\t\t\t.extensions-viewlet > .extensions ${e},\n\t\t\t.text-search-provider-messages .providerMessage ${e},\n\t\t\t.extension-editor ${e} {\n\t\t\t\tcolor: ${o};\n\t\t\t}\n\t\t`)}}));var __decorate$$=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$_=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};class MessageWidget{constructor(e,t,n,i,o){this._openerService=i,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new DisposableStore,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(addStandardDisposableListener(this._relatedBlock,"click",(e=>{e.preventDefault();const t=this._relatedDiagnostics.get(e.target);t&&n(t)}))),this._scrollable=new ScrollableElement(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll((e=>{r.style.left=`-${e.scrollLeft}px`,r.style.top=`-${e.scrollTop}px`}))),this._disposables.add(this._scrollable)}dispose(){dispose(this._disposables)}update(e){const{source:t,message:n,relatedInformation:i,code:o}=e;let r=((null==t?void 0:t.length)||0)+"()".length;o&&(r+="string"==typeof o?o.length:o.value.length);const s=splitLines(n);this._lines=s.length,this._longestLineLength=0;for(const u of s)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);clearNode(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let a=this._messageBlock;for(const u of s)a=document.createElement("div"),a.innerText=u,""===u&&(a.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(a);if(t||o){const e=document.createElement("span");if(e.classList.add("details"),a.appendChild(e),t){const n=document.createElement("span");n.innerText=t,n.classList.add("source"),e.appendChild(n)}if(o)if("string"==typeof o){const t=document.createElement("span");t.innerText=`(${o})`,t.classList.add("code"),e.appendChild(t)}else{this._codeLink=$$c("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=e=>{this._openerService.open(o.target,{allowCommands:!0}),e.preventDefault(),e.stopPropagation()};append$1(this._codeLink,$$c("span")).innerText=o.value,e.appendChild(this._codeLink)}}if(clearNode(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),isNonEmptyArray(i)){const e=this._relatedBlock.appendChild(document.createElement("div"));e.style.paddingTop=`${Math.floor(.66*this._editor.getOption(59))}px`,this._lines+=1;for(const t of i){let n=document.createElement("div"),i=document.createElement("a");i.classList.add("filename"),i.innerText=`${getBaseLabel(t.resource)}(${t.startLineNumber}, ${t.startColumn}): `,i.title=this._labelService.getUriLabel(t.resource),this._relatedDiagnostics.set(i,t);let o=document.createElement("span");o.innerText=t.message,n.appendChild(i),n.appendChild(o),this._lines+=1,e.appendChild(n)}}const l=this._editor.getOption(44),c=Math.ceil(l.typicalFullwidthCharacterWidth*this._longestLineLength*.75),d=l.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:d})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case MarkerSeverity$2.Error:t=localize("Error","Error");break;case MarkerSeverity$2.Warning:t=localize("Warning","Warning");break;case MarkerSeverity$2.Info:t=localize("Info","Info");break;case MarkerSeverity$2.Hint:t=localize("Hint","Hint")}let n=localize("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const i=this._editor.getModel();if(i&&e.startLineNumber<=i.getLineCount()&&e.startLineNumber>=1){n=`${i.getLineContent(e.startLineNumber)}, ${n}`}return n}}let MarkerNavigationWidget=class e extends PeekViewWidget{constructor(e,t,n,i,o,r,s){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=n,this._menuService=i,this._contextKeyService=r,this._labelService=s,this._callOnDispose=new DisposableStore,this._onDidSelectRelatedInformation=new Emitter$1,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=MarkerSeverity$2.Warning,this._backgroundColor=Color.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(editorMarkerNavigationBackground);let t=editorMarkerNavigationError,n=editorMarkerNavigationErrorHeader;this._severity===MarkerSeverity$2.Warning?(t=editorMarkerNavigationWarning,n=editorMarkerNavigationWarningHeader):this._severity===MarkerSeverity$2.Info&&(t=editorMarkerNavigationInfo,n=editorMarkerNavigationInfoHeader);const i=e.getColor(t),o=e.getColor(n);this.style({arrowColor:i,frameColor:i,headerBackgroundColor:o,primaryHeadingColor:e.getColor(peekViewTitleForeground),secondaryHeadingColor:e.getColor(peekViewTitleInfoForeground)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(t){super._fillHead(t),this._disposables.add(this._actionbarWidget.actionRunner.onBeforeRun((e=>this.editor.focus())));const n=[],i=this._menuService.createMenu(e.TitleMenu,this._contextKeyService);createAndFillInActionBarActions(i,void 0,n),this._actionbarWidget.push(n,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=append$1(e,$$c(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new MessageWidget(this._container,this.editor,(e=>this._onDidSelectRelatedInformation.fire(e)),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,n){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());let i=Range$2.lift(e);const o=this.editor.getPosition();let r=o&&i.containsPosition(o)?o:i.getStartPosition();super.show(r,this.computeRequiredHeight());const s=this.editor.getModel();if(s){const e=n>1?localize("problems","{0} of {1} problems",t,n):localize("change","{0} of {1} problem",t,n);this.setTitle(basename(s.uri),e)}this._icon.className=`codicon ${SeverityIcon.className(MarkerSeverity$2.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};MarkerNavigationWidget.TitleMenu=new MenuId("gotoErrorTitleMenu"),MarkerNavigationWidget=__decorate$$([__param$_(1,IThemeService),__param$_(2,IOpenerService),__param$_(3,IMenuService),__param$_(4,IInstantiationService),__param$_(5,IContextKeyService),__param$_(6,ILabelService)],MarkerNavigationWidget);let errorDefault=oneOf(editorErrorForeground,editorErrorBorder),warningDefault=oneOf(editorWarningForeground,editorWarningBorder),infoDefault=oneOf(editorInfoForeground,editorInfoBorder);const editorMarkerNavigationError=registerColor("editorMarkerNavigationError.background",{dark:errorDefault,light:errorDefault,hc:contrastBorder},localize("editorMarkerNavigationError","Editor marker navigation widget error color.")),editorMarkerNavigationErrorHeader=registerColor("editorMarkerNavigationError.headerBackground",{dark:transparent(editorMarkerNavigationError,.1),light:transparent(editorMarkerNavigationError,.1),hc:null},localize("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),editorMarkerNavigationWarning=registerColor("editorMarkerNavigationWarning.background",{dark:warningDefault,light:warningDefault,hc:contrastBorder},localize("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),editorMarkerNavigationWarningHeader=registerColor("editorMarkerNavigationWarning.headerBackground",{dark:transparent(editorMarkerNavigationWarning,.1),light:transparent(editorMarkerNavigationWarning,.1),hc:"#0C141F"},localize("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),editorMarkerNavigationInfo=registerColor("editorMarkerNavigationInfo.background",{dark:infoDefault,light:infoDefault,hc:contrastBorder},localize("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),editorMarkerNavigationInfoHeader=registerColor("editorMarkerNavigationInfo.headerBackground",{dark:transparent(editorMarkerNavigationInfo,.1),light:transparent(editorMarkerNavigationInfo,.1),hc:null},localize("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),editorMarkerNavigationBackground=registerColor("editorMarkerNavigation.background",{dark:editorBackground,light:editorBackground,hc:editorBackground},localize("editorMarkerNavigationBackground","Editor marker navigation widget background."));var __decorate$_=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$Z=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$C=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};let MarkerController=class e{constructor(e,t,n,i,o){this._markerNavigationService=t,this._contextKeyService=n,this._editorService=i,this._instantiationService=o,this._sessionDispoables=new DisposableStore,this._editor=e,this._widgetVisible=CONTEXT_MARKERS_NAVIGATION_VISIBLE.bindTo(this._contextKeyService)}static get(t){return t.getContribution(e.ID)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(MarkerNavigationWidget,this._editor),this._widget.onDidClose((()=>this.close()),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition((e=>{var t,n,i;(null===(t=this._model)||void 0===t?void 0:t.selected)&&Range$2.containsPosition(null===(n=this._model)||void 0===n?void 0:n.selected.marker,e.position)||null===(i=this._model)||void 0===i||i.resetIndex()}))),this._sessionDispoables.add(this._model.onDidChange((()=>{if(!this._widget||!this._widget.position||!this._model)return;const e=this._model.find(this._editor.getModel().uri,this._widget.position);e?this._widget.updateMarker(e.marker):this._widget.showStale()}))),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation((e=>{this._editorService.openCodeEditor({resource:e.resource,options:{pinned:!0,revealIfOpened:!0,selection:Range$2.lift(e).collapseToStart()}},this._editor),this.close(!1)}))),this._sessionDispoables.add(this._editor.onDidChangeModel((()=>this._cleanUp()))),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new Position$1(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(t,n){var i,o;return __awaiter$C(this,void 0,void 0,(function*(){if(this._editor.hasModel()){const r=this._getOrCreateModel(n?void 0:this._editor.getModel().uri);if(r.move(t,this._editor.getModel(),this._editor.getPosition()),!r.selected)return;if(r.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=yield this._editorService.openCodeEditor({resource:r.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:r.selected.marker}},this._editor);s&&(null===(i=e.get(s))||void 0===i||i.close(),null===(o=e.get(s))||void 0===o||o.nagivate(t,n))}else this._widget.showAtMarker(r.selected.marker,r.selected.index,r.selected.total)}}))}};MarkerController.ID="editor.contrib.markerController",MarkerController=__decorate$_([__param$Z(1,IMarkerNavigationService),__param$Z(2,IContextKeyService),__param$Z(3,ICodeEditorService),__param$Z(4,IInstantiationService)],MarkerController);class MarkerNavigationAction extends EditorAction{constructor(e,t,n){super(n),this._next=e,this._multiFile=t}run(e,t){var n;return __awaiter$C(this,void 0,void 0,(function*(){t.hasModel()&&(null===(n=MarkerController.get(t))||void 0===n||n.nagivate(this._next,this._multiFile))}))}}class NextMarkerAction extends MarkerNavigationAction{constructor(){super(!0,!1,{id:NextMarkerAction.ID,label:NextMarkerAction.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:578,weight:100},menuOpts:{menuId:MarkerNavigationWidget.TitleMenu,title:NextMarkerAction.LABEL,icon:registerIcon("marker-navigation-next",Codicon.arrowDown,localize("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}NextMarkerAction.ID="editor.action.marker.next",NextMarkerAction.LABEL=localize("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class PrevMarkerAction extends MarkerNavigationAction{constructor(){super(!1,!1,{id:PrevMarkerAction.ID,label:PrevMarkerAction.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:1602,weight:100},menuOpts:{menuId:MarkerNavigationWidget.TitleMenu,title:PrevMarkerAction.LABEL,icon:registerIcon("marker-navigation-previous",Codicon.arrowUp,localize("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}PrevMarkerAction.ID="editor.action.marker.prev",PrevMarkerAction.LABEL=localize("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class NextMarkerInFilesAction extends MarkerNavigationAction{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:localize("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:66,weight:100},menuOpts:{menuId:MenuId.MenubarGoMenu,title:localize({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class PrevMarkerInFilesAction extends MarkerNavigationAction{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:localize("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:1090,weight:100},menuOpts:{menuId:MenuId.MenubarGoMenu,title:localize({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}registerEditorContribution(MarkerController.ID,MarkerController),registerEditorAction(NextMarkerAction),registerEditorAction(PrevMarkerAction),registerEditorAction(NextMarkerInFilesAction),registerEditorAction(PrevMarkerInFilesAction);const CONTEXT_MARKERS_NAVIGATION_VISIBLE=new RawContextKey("markersNavigationVisible",!1),MarkerCommand=EditorCommand.bindToContribution(MarkerController.get);registerEditorCommand(new MarkerCommand({id:"closeMarkersNavigation",precondition:CONTEXT_MARKERS_NAVIGATION_VISIBLE,handler:e=>e.close(),kbOpts:{weight:150,kbExpr:EditorContextKeys.focus,primary:9,secondary:[1033]}}));var __decorate$Z=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$Y=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const $$5=$$c;class MarkerHover{constructor(e,t,n){this.owner=e,this.range=t,this.marker=n}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const markerCodeActionTrigger={type:1,filter:{include:CodeActionKind.QuickFix}};let MarkerHoverParticipant=class{constructor(e,t,n,i){this._editor=e,this._markerDecorationsService=t,this._openerService=n,this._languageFeaturesService=i,this.hoverOrdinal=5,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||1!==e.type)return[];const n=this._editor.getModel(),i=e.range.startLineNumber,o=n.getLineMaxColumn(i),r=[];for(const s of t){const t=s.range.startLineNumber===i?s.range.startColumn:1,a=s.range.endLineNumber===i?s.range.endColumn:o,l=this._markerDecorationsService.getMarker(n.uri,s);if(!l)continue;const c=new Range$2(e.range.startLineNumber,t,e.range.startLineNumber,a);r.push(new MarkerHover(this,c,l))}return r}renderHoverParts(e,t){if(!t.length)return Disposable.None;const n=new DisposableStore;t.forEach((t=>e.fragment.appendChild(this.renderMarkerHover(t,n))));const i=1===t.length?t[0]:t.sort(((e,t)=>MarkerSeverity$2.compare(e.marker.severity,t.marker.severity)))[0];return this.renderMarkerStatusbar(e,i,n),n}renderMarkerHover(e,t){const n=$$5("div.hover-row"),i=append$1(n,$$5("div.marker.hover-contents")),{source:o,message:r,code:s,relatedInformation:a}=e.marker;this._editor.applyFontInfo(i);const l=append$1(i,$$5("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=r,o||s)if(s&&"string"!=typeof s){const e=$$5("span");if(o){append$1(e,$$5("span")).innerText=o}const n=append$1(e,$$5("a.code-link"));n.setAttribute("href",s.target.toString()),t.add(addDisposableListener(n,"click",(e=>{this._openerService.open(s.target,{allowCommands:!0}),e.preventDefault(),e.stopPropagation()})));append$1(n,$$5("span")).innerText=s.value;const r=append$1(i,e);r.style.opacity="0.6",r.style.paddingLeft="6px"}else{const e=append$1(i,$$5("span"));e.style.opacity="0.6",e.style.paddingLeft="6px",e.innerText=o&&s?`${o}(${s})`:o||`(${s})`}if(isNonEmptyArray(a))for(const{message:c,resource:d,startLineNumber:u,startColumn:h}of a){const e=append$1(i,$$5("div"));e.style.marginTop="8px";const n=append$1(e,$$5("a"));n.innerText=`${basename(d)}(${u}, ${h}): `,n.style.cursor="pointer",t.add(addDisposableListener(n,"click",(e=>{e.stopPropagation(),e.preventDefault(),this._openerService&&this._openerService.open(d,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:u,startColumn:h}}}).catch(onUnexpectedError)})));const o=append$1(e,$$5("span"));o.innerText=c,this._editor.applyFontInfo(o)}return n}renderMarkerStatusbar(e,t,n){if(t.marker.severity!==MarkerSeverity$2.Error&&t.marker.severity!==MarkerSeverity$2.Warning&&t.marker.severity!==MarkerSeverity$2.Info||e.statusBar.addAction({label:localize("view problem","View Problem"),commandId:NextMarkerAction.ID,run:()=>{var n;e.hide(),null===(n=MarkerController.get(this._editor))||void 0===n||n.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(81)){const i=e.statusBar.append($$5("div"));this.recentMarkerCodeActionsInfo&&(IMarkerData.makeKey(this.recentMarkerCodeActionsInfo.marker)===IMarkerData.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(i.textContent=localize("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?Disposable.None:n.add(disposableTimeout((()=>i.textContent=localize("checkingForQuickFixes","Checking for quick fixes...")),200));i.textContent||(i.textContent=String.fromCharCode(160));const r=this.getCodeActions(t.marker);n.add(toDisposable((()=>r.cancel()))),r.then((r=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:r.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions)return r.dispose(),void(i.textContent=localize("noQuickFixes","No quick fixes available"));i.style.display="none";let s=!1;n.add(toDisposable((()=>{s||r.dispose()}))),e.statusBar.addAction({label:localize("quick fixes","Quick Fix..."),commandId:QuickFixAction.Id,run:t=>{s=!0;const n=QuickFixController.get(this._editor),i=getDomNodePagePosition(t);e.hide(),null==n||n.showCodeActions(markerCodeActionTrigger,r,{x:i.left+6,y:i.top+i.height+6})}})}),onUnexpectedError)}}getCodeActions(e){return createCancelablePromise((t=>getCodeActions(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new Range$2(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),markerCodeActionTrigger,Progress.None,t)))}};MarkerHoverParticipant=__decorate$Z([__param$Y(1,IMarkerDecorationsService),__param$Y(2,IOpenerService),__param$Y(3,ILanguageFeaturesService)],MarkerHoverParticipant),registerThemingParticipant(((e,t)=>{const n=e.getColor(textLinkForeground);n&&t.addRule(`.monaco-hover .hover-contents a.code-link span { color: ${n}; }`);const i=e.getColor(textLinkActiveForeground);i&&t.addRule(`.monaco-hover .hover-contents a.code-link span:hover { color: ${i}; }`)}));var __decorate$Y=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$X=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let ModesHoverController=class e{constructor(e,t,n,i,o){this._editor=e,this._instantiationService=t,this._openerService=n,this._languageService=i,this._toUnhook=new DisposableStore,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._hookEvents(),this._didChangeConfigurationHandler=this._editor.onDidChangeConfiguration((e=>{e.hasChanged(53)&&(this._unhookEvents(),this._hookEvents())}))}static get(t){return t.getContribution(e.ID)}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(53);this._isHoverEnabled=t.enabled,this._isHoverSticky=t.sticky,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown((e=>this._onEditorMouseDown(e)))),this._toUnhook.add(this._editor.onMouseUp((e=>this._onEditorMouseUp(e)))),this._toUnhook.add(this._editor.onMouseMove((e=>this._onEditorMouseMove(e)))),this._toUnhook.add(this._editor.onKeyDown((e=>this._onKeyDown(e))))):(this._toUnhook.add(this._editor.onMouseMove((e=>this._onEditorMouseMove(e)))),this._toUnhook.add(this._editor.onKeyDown((e=>this._onKeyDown(e))))),this._toUnhook.add(this._editor.onMouseLeave(e)),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange((e=>this._onEditorScrollChanged(e))))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){this._isMouseDown=!0;const t=e.target;9!==t.type||t.detail!==ContentHoverWidget.ID?12===t.type&&t.detail===MarginHoverWidget.ID||(12!==t.type&&(this._hoverClicked=!1),this._hideWidgets()):this._hoverClicked=!0}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseMove(e){var t,n,i,o,r;const s=e.target;if(this._isMouseDown&&this._hoverClicked)return;if(this._isHoverSticky&&9===s.type&&s.detail===ContentHoverWidget.ID)return;if(this._isHoverSticky&&!(null===(n=null===(t=e.event.browserEvent.view)||void 0===t?void 0:t.getSelection())||void 0===n?void 0:n.isCollapsed))return;if(!this._isHoverSticky&&9===s.type&&s.detail===ContentHoverWidget.ID&&(null===(i=this._contentWidget)||void 0===i?void 0:i.isColorPickerVisible()))return;if(this._isHoverSticky&&12===s.type&&s.detail===MarginHoverWidget.ID)return;if(!this._isHoverEnabled)return void this._hideWidgets();if(!this._getOrCreateContentWidget().maybeShowAt(e))return 2===s.type&&s.position?(null===(r=this._contentWidget)||void 0===r||r.hide(),this._glyphWidget||(this._glyphWidget=new MarginHoverWidget(this._editor,this._languageService,this._openerService)),void this._glyphWidget.startShowingAt(s.position.lineNumber)):void this._hideWidgets();null===(o=this._glyphWidget)||void 0===o||o.hide()}_onKeyDown(e){5!==e.keyCode&&6!==e.keyCode&&57!==e.keyCode&&4!==e.keyCode&&this._hideWidgets()}_hideWidgets(){var e,t,n;this._isMouseDown&&this._hoverClicked&&(null===(e=this._contentWidget)||void 0===e?void 0:e.isColorPickerVisible())||(this._hoverClicked=!1,null===(t=this._glyphWidget)||void 0===t||t.hide(),null===(n=this._contentWidget)||void 0===n||n.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(ContentHoverController,this._editor)),this._contentWidget}isColorPickerVisible(){var e;return(null===(e=this._contentWidget)||void 0===e?void 0:e.isColorPickerVisible())||!1}showContentHover(e,t,n){this._getOrCreateContentWidget().startShowingAtRange(e,t,n)}dispose(){var e,t;this._unhookEvents(),this._toUnhook.dispose(),this._didChangeConfigurationHandler.dispose(),null===(e=this._glyphWidget)||void 0===e||e.dispose(),null===(t=this._contentWidget)||void 0===t||t.dispose()}};ModesHoverController.ID="editor.contrib.hover",ModesHoverController=__decorate$Y([__param$X(1,IInstantiationService),__param$X(2,IOpenerService),__param$X(3,ILanguageService),__param$X(4,IContextKeyService)],ModesHoverController);class ShowHoverAction extends EditorAction{constructor(){super({id:"editor.action.showHover",label:localize({key:"showHover",comment:["Label for action that will trigger the showing of a hover in the editor.","This allows for users to show the hover without using the mouse."]},"Show Hover"),alias:"Show Hover",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2087),weight:100}})}run(e,t){if(!t.hasModel())return;let n=ModesHoverController.get(t);if(!n)return;const i=t.getPosition(),o=new Range$2(i.lineNumber,i.column,i.lineNumber,i.column),r=2===t.getOption(2);n.showContentHover(o,1,r)}}class ShowDefinitionPreviewHoverAction extends EditorAction{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:localize({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const n=ModesHoverController.get(t);if(!n)return;const i=t.getPosition();if(!i)return;const o=new Range$2(i.lineNumber,i.column,i.lineNumber,i.column),r=GotoDefinitionAtPositionEditorContribution.get(t);if(!r)return;r.startFindDefinitionFromCursor(i).then((()=>{n.showContentHover(o,1,!0)}))}}registerEditorContribution(ModesHoverController.ID,ModesHoverController),registerEditorAction(ShowHoverAction),registerEditorAction(ShowDefinitionPreviewHoverAction),HoverParticipantRegistry.register(MarkdownHoverParticipant),HoverParticipantRegistry.register(MarkerHoverParticipant),registerThemingParticipant(((e,t)=>{const n=e.getColor(editorHoverHighlight);n&&t.addRule(`.monaco-editor .hoverHighlight { background-color: ${n}; }`);const i=e.getColor(editorHoverBackground);i&&t.addRule(`.monaco-editor .monaco-hover { background-color: ${i}; }`);const o=e.getColor(editorHoverBorder);o&&(t.addRule(`.monaco-editor .monaco-hover { border: 1px solid ${o}; }`),t.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${o.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${o.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${o.transparent(.5)}; }`));const r=e.getColor(textLinkForeground);r&&t.addRule(`.monaco-editor .monaco-hover a { color: ${r}; }`);const s=e.getColor(textLinkActiveForeground);s&&t.addRule(`.monaco-editor .monaco-hover a:hover { color: ${s}; }`);const a=e.getColor(editorHoverForeground);a&&t.addRule(`.monaco-editor .monaco-hover { color: ${a}; }`);const l=e.getColor(editorHoverStatusBarBackground);l&&t.addRule(`.monaco-editor .monaco-hover .hover-row .actions { background-color: ${l}; }`);const c=e.getColor(textCodeBlockBackground);c&&t.addRule(`.monaco-editor .monaco-hover code { background-color: ${c}; }`)}));class ColorContribution extends Disposable{constructor(e){super(),this._editor=e,this._register(e.onMouseDown((e=>this.onMouseDown(e))))}dispose(){super.dispose()}onMouseDown(e){const t=e.target;if(6!==t.type)return;if(!t.detail.injectedText)return;if(t.detail.injectedText.options.attachedData!==ColorDecorationInjectedTextMarker)return;if(!t.range)return;const n=this._editor.getContribution(ModesHoverController.ID);if(n&&!n.isColorPickerVisible()){const e=new Range$2(t.range.startLineNumber,t.range.startColumn+1,t.range.endLineNumber,t.range.endColumn+1);n.showContentHover(e,1,!1)}}}ColorContribution.ID="editor.contrib.colorContribution",registerEditorContribution(ColorContribution.ID,ColorContribution),HoverParticipantRegistry.register(ColorHoverParticipant);class EditOperation{static insert(e,t){return{range:new Range$2(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}class BlockCommentCommand{constructor(e,t,n){this.languageConfigurationService=n,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,n){if(n<0)return!1;const i=t.length;if(n+i>e.length)return!1;for(let o=0;o<i;o++){const i=e.charCodeAt(n+o),r=t.charCodeAt(o);if(i!==r&&!(i>=65&&i<=90&&i+32===r||r>=65&&r<=90&&r+32===i))return!1}return!0}_createOperationsForBlockComment(e,t,n,i,o,r){const s=e.startLineNumber,a=e.startColumn,l=e.endLineNumber,c=e.endColumn,d=o.getLineContent(s),u=o.getLineContent(l);let h,g=d.lastIndexOf(t,a-1+t.length),p=u.indexOf(n,c-1-n.length);if(-1!==g&&-1!==p)if(s===l){d.substring(g+t.length,p).indexOf(n)>=0&&(g=-1,p=-1)}else{const e=d.substring(g+t.length),i=u.substring(0,p);(e.indexOf(n)>=0||i.indexOf(n)>=0)&&(g=-1,p=-1)}-1!==g&&-1!==p?(i&&g+t.length<d.length&&32===d.charCodeAt(g+t.length)&&(t+=" "),i&&p>0&&32===u.charCodeAt(p-1)&&(n=" "+n,p-=1),h=BlockCommentCommand._createRemoveBlockCommentOperations(new Range$2(s,g+t.length+1,l,p+1),t,n)):(h=BlockCommentCommand._createAddBlockCommentOperations(e,t,n,this._insertSpace),this._usedEndToken=1===h.length?n:null);for(const f of h)r.addTrackedEditOperation(f.range,f.text)}static _createRemoveBlockCommentOperations(e,t,n){let i=[];return Range$2.isEmpty(e)?i.push(EditOperation.delete(new Range$2(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+n.length))):(i.push(EditOperation.delete(new Range$2(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),i.push(EditOperation.delete(new Range$2(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+n.length)))),i}static _createAddBlockCommentOperations(e,t,n,i){let o=[];return Range$2.isEmpty(e)?o.push(EditOperation.replace(new Range$2(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+n)):(o.push(EditOperation.insert(new Position$1(e.startLineNumber,e.startColumn),t+(i?" ":""))),o.push(EditOperation.insert(new Position$1(e.endLineNumber,e.endColumn),(i?" ":"")+n))),o}getEditOperations(e,t){const n=this._selection.startLineNumber,i=this._selection.startColumn;e.tokenizeIfCheap(n);const o=e.getLanguageIdAtPosition(n,i),r=this.languageConfigurationService.getLanguageConfiguration(o).comments;r&&r.blockCommentStartToken&&r.blockCommentEndToken&&this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const n=t.getInverseEditOperations();if(2===n.length){const e=n[0],t=n[1];return new Selection$1(e.range.endLineNumber,e.range.endColumn,t.range.startLineNumber,t.range.startColumn)}{const e=n[0].range,t=this._usedEndToken?-this._usedEndToken.length-1:0;return new Selection$1(e.endLineNumber,e.endColumn+t,e.endLineNumber,e.endColumn+t)}}}class LineCommentCommand{constructor(e,t,n,i,o,r,s){this.languageConfigurationService=e,this._selection=t,this._tabSize=n,this._type=i,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=s||!1}static _gatherPreflightCommentStrings(e,t,n,i){e.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),r=i.getLanguageConfiguration(o).comments,s=r?r.lineCommentToken:null;if(!s)return null;let a=[];for(let l=0,c=n-t+1;l<c;l++)a[l]={ignore:!1,commentStr:s,commentStrOffset:0,commentStrLength:s.length};return a}static _analyzeLines(e,t,n,i,o,r,s,a){let l,c=!0;l=0===e||1!==e;for(let d=0,u=i.length;d<u;d++){const a=i[d],u=o+d;if(u===o&&s){a.ignore=!0;continue}const h=n.getLineContent(u),g=firstNonWhitespaceIndex(h);if(-1!==g){if(c=!1,a.ignore=!1,a.commentStrOffset=g,l&&!BlockCommentCommand._haystackHasNeedleAtOffset(h,a.commentStr,g)&&(0===e?l=!1:1===e||(a.ignore=!0)),l&&t){const e=g+a.commentStrLength;e<h.length&&32===h.charCodeAt(e)&&(a.commentStrLength+=1)}}else a.ignore=r,a.commentStrOffset=h.length}if(0===e&&c){l=!1;for(let e=0,t=i.length;e<t;e++)i[e].ignore=!1}return{supported:!0,shouldRemoveComments:l,lines:i}}static _gatherPreflightData(e,t,n,i,o,r,s,a){const l=LineCommentCommand._gatherPreflightCommentStrings(n,i,o,a);return null===l?{supported:!1}:LineCommentCommand._analyzeLines(e,t,n,l,i,r,s,a)}_executeLineComments(e,t,n,i){let o;n.shouldRemoveComments?o=LineCommentCommand._createRemoveLineCommentsOperations(n.lines,i.startLineNumber):(LineCommentCommand._normalizeInsertionPoint(e,n.lines,i.startLineNumber,this._tabSize),o=this._createAddLineCommentsOperations(n.lines,i.startLineNumber));const r=new Position$1(i.positionLineNumber,i.positionColumn);for(let s=0,a=o.length;s<a;s++)if(t.addEditOperation(o[s].range,o[s].text),Range$2.isEmpty(o[s].range)&&Range$2.getStartPosition(o[s].range).equals(r)){e.getLineContent(r.lineNumber).length+1===r.column&&(this._deltaColumn=(o[s].text||"").length)}this._selectionId=t.trackSelection(i)}_attemptRemoveBlockComment(e,t,n,i){let o=t.startLineNumber,r=t.endLineNumber,s=i.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn),a=e.getLineContent(o).lastIndexOf(n,s-1),l=e.getLineContent(r).indexOf(i,t.endColumn-1-n.length);return-1!==a&&-1===l&&(l=e.getLineContent(o).indexOf(i,a+n.length),r=o),-1===a&&-1!==l&&(a=e.getLineContent(r).lastIndexOf(n,l),o=r),!t.isEmpty()||-1!==a&&-1!==l||(a=e.getLineContent(o).indexOf(n),-1!==a&&(l=e.getLineContent(o).indexOf(i,a+n.length))),-1!==a&&32===e.getLineContent(o).charCodeAt(a+n.length)&&(n+=" "),-1!==l&&32===e.getLineContent(r).charCodeAt(l-1)&&(i=" "+i,l-=1),-1!==a&&-1!==l?BlockCommentCommand._createRemoveBlockCommentOperations(new Range$2(o,a+n.length+1,r,l+1),n,i):null}_executeBlockComment(e,t,n){e.tokenizeIfCheap(n.startLineNumber);let i=e.getLanguageIdAtPosition(n.startLineNumber,1),o=LanguageConfigurationRegistry.getComments(i);if(!o||!o.blockCommentStartToken||!o.blockCommentEndToken)return;const r=o.blockCommentStartToken,s=o.blockCommentEndToken;let a=this._attemptRemoveBlockComment(e,n,r,s);if(!a){if(n.isEmpty()){const t=e.getLineContent(n.startLineNumber);let i=firstNonWhitespaceIndex(t);-1===i&&(i=t.length),a=BlockCommentCommand._createAddBlockCommentOperations(new Range$2(n.startLineNumber,i+1,n.startLineNumber,t.length+1),r,s,this._insertSpace)}else a=BlockCommentCommand._createAddBlockCommentOperations(new Range$2(n.startLineNumber,e.getLineFirstNonWhitespaceColumn(n.startLineNumber),n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)),r,s,this._insertSpace);1===a.length&&(this._deltaColumn=r.length+1)}this._selectionId=t.trackSelection(n);for(const l of a)t.addEditOperation(l.range,l.text)}getEditOperations(e,t){let n=this._selection;if(this._moveEndPositionDown=!1,n.startLineNumber===n.endLineNumber&&this._ignoreFirstLine)return t.addEditOperation(new Range$2(n.startLineNumber,e.getLineMaxColumn(n.startLineNumber),n.startLineNumber+1,1),n.startLineNumber===e.getLineCount()?"":"\n"),void(this._selectionId=t.trackSelection(n));n.startLineNumber<n.endLineNumber&&1===n.endColumn&&(this._moveEndPositionDown=!0,n=n.setEndPosition(n.endLineNumber-1,e.getLineMaxColumn(n.endLineNumber-1)));const i=LineCommentCommand._gatherPreflightData(this._type,this._insertSpace,e,n.startLineNumber,n.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return i.supported?this._executeLineComments(e,t,i,n):this._executeBlockComment(e,t,n)}computeCursorState(e,t){let n=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(n=n.setEndPosition(n.endLineNumber+1,1)),new Selection$1(n.selectionStartLineNumber,n.selectionStartColumn+this._deltaColumn,n.positionLineNumber,n.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){let n=[];for(let i=0,o=e.length;i<o;i++){const o=e[i];o.ignore||n.push(EditOperation.delete(new Range$2(t+i,o.commentStrOffset+1,t+i,o.commentStrOffset+o.commentStrLength+1)))}return n}_createAddLineCommentsOperations(e,t){let n=[];const i=this._insertSpace?" ":"";for(let o=0,r=e.length;o<r;o++){const r=e[o];r.ignore||n.push(EditOperation.insert(new Position$1(t+o,r.commentStrOffset+1),r.commentStr+i))}return n}static nextVisibleColumn(e,t,n,i){return n?e+(t-e%t):e+i}static _normalizeInsertionPoint(e,t,n,i){let o,r,s=1073741824;for(let a=0,l=t.length;a<l;a++){if(t[a].ignore)continue;const o=e.getLineContent(n+a);let r=0;for(let e=0,n=t[a].commentStrOffset;r<s&&e<n;e++)r=LineCommentCommand.nextVisibleColumn(r,i,9===o.charCodeAt(e),1);r<s&&(s=r)}s=Math.floor(s/i)*i;for(let a=0,l=t.length;a<l;a++){if(t[a].ignore)continue;const l=e.getLineContent(n+a);let c=0;for(o=0,r=t[a].commentStrOffset;c<s&&o<r;o++)c=LineCommentCommand.nextVisibleColumn(c,i,9===l.charCodeAt(o),1);t[a].commentStrOffset=c>s?o-1:o}}}class CommentLineAction extends EditorAction{constructor(e,t){super(t),this._type=e}run(e,t){const n=e.get(ILanguageConfigurationService);if(!t.hasModel())return;const i=[],o=t.getModel().getOptions(),r=t.getOption(19),s=t.getSelections().map(((e,t)=>({selection:e,index:t,ignoreFirstLine:!1})));s.sort(((e,t)=>Range$2.compareRangesUsingStarts(e.selection,t.selection)));let a=s[0];for(let l=1;l<s.length;l++){const e=s[l];a.selection.endLineNumber===e.selection.startLineNumber&&(a.index<e.index?e.ignoreFirstLine=!0:(a.ignoreFirstLine=!0,a=e))}for(const l of s)i.push(new LineCommentCommand(n,l.selection,o.tabSize,this._type,r.insertSpace,r.ignoreEmptyLines,l.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class ToggleCommentLineAction extends CommentLineAction{constructor(){super(0,{id:"editor.action.commentLine",label:localize("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:2133,weight:100},menuOpts:{menuId:MenuId.MenubarEditMenu,group:"5_insert",title:localize({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class AddLineCommentAction extends CommentLineAction{constructor(){super(1,{id:"editor.action.addCommentLine",label:localize("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2081),weight:100}})}}class RemoveLineCommentAction extends CommentLineAction{constructor(){super(2,{id:"editor.action.removeCommentLine",label:localize("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2099),weight:100}})}}class BlockCommentAction extends EditorAction{constructor(){super({id:"editor.action.blockComment",label:localize("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:MenuId.MenubarEditMenu,group:"5_insert",title:localize({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){const n=e.get(ILanguageConfigurationService);if(!t.hasModel())return;const i=t.getOption(19),o=[],r=t.getSelections();for(const s of r)o.push(new BlockCommentCommand(s,i.insertSpace,n));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}registerEditorAction(ToggleCommentLineAction),registerEditorAction(AddLineCommentAction),registerEditorAction(RemoveLineCommentAction),registerEditorAction(BlockCommentAction);var __decorate$X=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$W=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let ContextMenuController=class e{constructor(e,t,n,i,o,r){this._contextMenuService=t,this._contextViewService=n,this._contextKeyService=i,this._keybindingService=o,this._menuService=r,this._toDispose=new DisposableStore,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu((e=>this._onContextMenu(e)))),this._toDispose.add(this._editor.onMouseWheel((e=>{if(this._contextMenuIsBeingShownCount>0){const t=this._contextViewService.getContextViewElement(),n=e.srcElement;n.shadowRoot&&getShadowRoot(t)===n.shadowRoot||this._contextViewService.hideContextView()}}))),this._toDispose.add(this._editor.onKeyDown((e=>{58===e.keyCode&&(e.preventDefault(),e.stopPropagation(),this.showContextMenu())})))}static get(t){return t.getContribution(e.ID)}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(20))return this._editor.focus(),void(e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position));if(12===e.target.type)return;if(6===e.target.type&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),6!==e.target.type&&7!==e.target.type&&1!==e.target.type)return;if(this._editor.focus(),e.target.position){let t=!1;for(const n of this._editor.getSelections())if(n.containsPosition(e.target.position)){t=!0;break}t||this._editor.setPosition(e.target.position)}let t=null;1!==e.target.type&&(t={x:e.event.posx-1,width:2,y:e.event.posy-1,height:2}),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(20))return;if(!this._editor.hasModel())return;if(!this._contextMenuService)return void this._editor.focus();const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?MenuId.SimpleEditorContext:MenuId.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const n=[],i=this._menuService.createMenu(t,this._contextKeyService),o=i.getActions({arg:e.uri});i.dispose();for(let r of o){const[,t]=r;let i=0;for(const o of t)if(o instanceof SubmenuItemAction){const t=this._getMenuActions(e,o.item.submenu);t.length>0&&(n.push(new SubmenuAction(o.id,o.label,t)),i++)}else n.push(o),i++;i&&n.push(new Separator)}return n.length&&n.pop(),n}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const n=this._editor.getOption(53);if(this._editor.updateOptions({hover:{enabled:!1}}),!t){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const e=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),n=getDomNodePagePosition(this._editor.getDomNode()),i=n.left+e.left,o=n.top+e.top+e.height;t={x:i,y:o}}const i=this._editor.getOption(115)&&!isIOS;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:i?this._editor.getDomNode():void 0,getAnchor:()=>t,getActions:()=>e,getActionViewItem:e=>{const t=this._keybindingFor(e);if(t)return new ActionViewItem(e,e,{label:!0,keybinding:t.getLabel(),isMenu:!0});const n=e;return"function"==typeof n.getActionViewItem?n.getActionViewItem():new ActionViewItem(e,e,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:e=>this._keybindingFor(e),onHide:e=>{this._contextMenuIsBeingShownCount--,this._editor.focus(),this._editor.updateOptions({hover:n})}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};ContextMenuController.ID="editor.contrib.contextmenu",ContextMenuController=__decorate$X([__param$W(1,IContextMenuService),__param$W(2,IContextViewService),__param$W(3,IContextKeyService),__param$W(4,IKeybindingService),__param$W(5,IMenuService)],ContextMenuController);class ShowContextMenu extends EditorAction{constructor(){super({id:"editor.action.showContextMenu",label:localize("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:1092,weight:100}})}run(e,t){var n;null===(n=ContextMenuController.get(t))||void 0===n||n.showContextMenu()}}registerEditorContribution(ContextMenuController.ID,ContextMenuController),registerEditorAction(ShowContextMenu);class CursorState{constructor(e){this.selections=e}equals(e){const t=this.selections.length;if(t!==e.selections.length)return!1;for(let n=0;n<t;n++)if(!this.selections[n].equalsSelection(e.selections[n]))return!1;return!0}}class StackElement{constructor(e,t,n){this.cursorState=e,this.scrollTop=t,this.scrollLeft=n}}class CursorUndoRedoController extends Disposable{constructor(e){super(),this._editor=e,this._isCursorUndoRedo=!1,this._undoStack=[],this._redoStack=[],this._register(e.onDidChangeModel((e=>{this._undoStack=[],this._redoStack=[]}))),this._register(e.onDidChangeModelContent((e=>{this._undoStack=[],this._redoStack=[]}))),this._register(e.onDidChangeCursorSelection((t=>{if(this._isCursorUndoRedo)return;if(!t.oldSelections)return;if(t.oldModelVersionId!==t.modelVersionId)return;const n=new CursorState(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(n)||(this._undoStack.push(new StackElement(n,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())})))}static get(e){return e.getContribution(CursorUndoRedoController.ID)}cursorUndo(){this._editor.hasModel()&&0!==this._undoStack.length&&(this._redoStack.push(new StackElement(new CursorState(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){this._editor.hasModel()&&0!==this._redoStack.length&&(this._undoStack.push(new StackElement(new CursorState(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}CursorUndoRedoController.ID="editor.contrib.cursorUndoRedoController";class CursorUndo extends EditorAction{constructor(){super({id:"cursorUndo",label:localize("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:2099,weight:100}})}run(e,t,n){var i;null===(i=CursorUndoRedoController.get(t))||void 0===i||i.cursorUndo()}}class CursorRedo extends EditorAction{constructor(){super({id:"cursorRedo",label:localize("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,n){var i;null===(i=CursorUndoRedoController.get(t))||void 0===i||i.cursorRedo()}}registerEditorContribution(CursorUndoRedoController.ID,CursorUndoRedoController),registerEditorAction(CursorUndo),registerEditorAction(CursorRedo);var dnd="";class DragAndDropCommand{constructor(e,t,n){this.selection=e,this.targetPosition=t,this.copy=n,this.targetSelection=null}getEditOperations(e,t){let n=e.getValueInRange(this.selection);this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new Range$2(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),n),!this.selection.containsPosition(this.targetPosition)||this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition))?this.copy?this.targetSelection=new Selection$1(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn):this.targetPosition.lineNumber>this.selection.endLineNumber?this.targetSelection=new Selection$1(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn):this.targetPosition.lineNumber<this.selection.endLineNumber?this.targetSelection=new Selection$1(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber+this.selection.endLineNumber-this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn):this.selection.endColumn<=this.targetPosition.column?this.targetSelection=new Selection$1(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,(this.selection.startLineNumber,this.selection.endLineNumber,this.targetPosition.column-this.selection.endColumn+this.selection.startColumn),this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column:this.selection.endColumn):this.targetSelection=new Selection$1(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column+this.selection.endColumn-this.selection.startColumn):this.targetSelection=this.selection}computeCursorState(e,t){return this.targetSelection}}function hasTriggerModifier(e){return isMacintosh?e.altKey:e.ctrlKey}class DragAndDropController extends Disposable{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown((e=>this._onEditorMouseDown(e)))),this._register(this._editor.onMouseUp((e=>this._onEditorMouseUp(e)))),this._register(this._editor.onMouseDrag((e=>this._onEditorMouseDrag(e)))),this._register(this._editor.onMouseDrop((e=>this._onEditorMouseDrop(e)))),this._register(this._editor.onMouseDropCanceled((()=>this._onEditorMouseDropCanceled()))),this._register(this._editor.onKeyDown((e=>this.onEditorKeyDown(e)))),this._register(this._editor.onKeyUp((e=>this.onEditorKeyUp(e)))),this._register(this._editor.onDidBlurEditorWidget((()=>this.onEditorBlur()))),this._register(this._editor.onDidBlurEditorText((()=>this.onEditorBlur()))),this._dndDecorationIds=[],this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){this._editor.getOption(31)&&!this._editor.getOption(18)&&(hasTriggerModifier(e)&&(this._modifierPressed=!0),this._mouseDown&&hasTriggerModifier(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){this._editor.getOption(31)&&!this._editor.getOption(18)&&(hasTriggerModifier(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===DragAndDropController.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){let t=e.target;if(null===this._dragSelection){let e=(this._editor.getSelections()||[]).filter((e=>t.position&&e.containsPosition(t.position)));if(1!==e.length)return;this._dragSelection=e[0]}hasTriggerModifier(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){let t=new Position$1(e.target.position.lineNumber,e.target.position.column);if(null===this._dragSelection){let n=null;if(e.event.shiftKey){let e=this._editor.getSelection();if(e){const{selectionStartLineNumber:i,selectionStartColumn:o}=e;n=[new Selection$1(i,o,t.lineNumber,t.column)]}}else n=(this._editor.getSelections()||[]).map((e=>e.containsPosition(t)?new Selection$1(t.lineNumber,t.column,t.lineNumber,t.column):e));this._editor.setSelections(n||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(hasTriggerModifier(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(DragAndDropController.ID,new DragAndDropCommand(this._dragSelection,t,hasTriggerModifier(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){let t=[{range:new Range$2(e.lineNumber,e.column,e.lineNumber,e.column),options:DragAndDropController._DECORATION_OPTIONS}];this._dndDecorationIds=this._editor.deltaDecorations(this._dndDecorationIds,t),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds=this._editor.deltaDecorations(this._dndDecorationIds,[])}_hitContent(e){return 6===e.type||7===e.type}_hitMargin(e){return 2===e.type||3===e.type||4===e.type}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}DragAndDropController.ID="editor.contrib.dragAndDrop",DragAndDropController.TRIGGER_KEY_VALUE=isMacintosh?6:5,DragAndDropController._DECORATION_OPTIONS=ModelDecorationOptions.register({description:"dnd-target",className:"dnd-target"}),registerEditorContribution(DragAndDropController.ID,DragAndDropController);class FindDecorations{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.deltaDecorations(this._allDecorations(),[]),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map((e=>this._editor.getModel().getDecorationRange(e))).filter((e=>!!e));if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getCurrentMatchesPosition(e){let t=this._editor.getModel().getDecorationsInRange(e);for(const n of t){const e=n.options;if(e===FindDecorations._FIND_MATCH_DECORATION||e===FindDecorations._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(n.id)}return 0}setCurrentFindMatch(e){let t=null,n=0;if(e)for(let i=0,o=this._decorations.length;i<o;i++){let o=this._editor.getModel().getDecorationRange(this._decorations[i]);if(e.equalsRange(o)){t=this._decorations[i],n=i+1;break}}return null===this._highlightedDecorationId&&null===t||this._editor.changeDecorations((e=>{if(null!==this._highlightedDecorationId&&(e.changeDecorationOptions(this._highlightedDecorationId,FindDecorations._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),null!==t&&(this._highlightedDecorationId=t,e.changeDecorationOptions(this._highlightedDecorationId,FindDecorations._CURRENT_FIND_MATCH_DECORATION)),null!==this._rangeHighlightDecorationId&&(e.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),null!==t){let n=this._editor.getModel().getDecorationRange(t);if(n.startLineNumber!==n.endLineNumber&&1===n.endColumn){let e=n.endLineNumber-1,t=this._editor.getModel().getLineMaxColumn(e);n=new Range$2(n.startLineNumber,n.startColumn,e,t)}this._rangeHighlightDecorationId=e.addDecoration(n,FindDecorations._RANGE_HIGHLIGHT_DECORATION)}})),n}set(e,t){this._editor.changeDecorations((n=>{let i=FindDecorations._FIND_MATCH_DECORATION,o=[];if(e.length>1e3){i=FindDecorations._FIND_MATCH_NO_OVERVIEW_DECORATION;const t=this._editor.getModel().getLineCount(),n=this._editor.getLayoutInfo().height/t,r=Math.max(2,Math.ceil(3/n));let s=e[0].range.startLineNumber,a=e[0].range.endLineNumber;for(let i=1,l=e.length;i<l;i++){const t=e[i].range;a+r>=t.startLineNumber?t.endLineNumber>a&&(a=t.endLineNumber):(o.push({range:new Range$2(s,1,a,1),options:FindDecorations._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),s=t.startLineNumber,a=t.endLineNumber)}o.push({range:new Range$2(s,1,a,1),options:FindDecorations._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}let r=new Array(e.length);for(let t=0,s=e.length;t<s;t++)r[t]={range:e[t].range,options:i};this._decorations=n.deltaDecorations(this._decorations,r),this._overviewRulerApproximateDecorations=n.deltaDecorations(this._overviewRulerApproximateDecorations,o),this._rangeHighlightDecorationId&&(n.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach((e=>n.removeDecoration(e))),this._findScopeDecorationIds=[]),(null==t?void 0:t.length)&&(this._findScopeDecorationIds=t.map((e=>n.addDecoration(e,FindDecorations._FIND_SCOPE_DECORATION))))}))}matchBeforePosition(e){if(0===this._decorations.length)return null;for(let t=this._decorations.length-1;t>=0;t--){let n=this._decorations[t],i=this._editor.getModel().getDecorationRange(n);if(i&&!(i.endLineNumber>e.lineNumber)){if(i.endLineNumber<e.lineNumber)return i;if(!(i.endColumn>e.column))return i}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(0===this._decorations.length)return null;for(let t=0,n=this._decorations.length;t<n;t++){let n=this._decorations[t],i=this._editor.getModel().getDecorationRange(n);if(i&&!(i.startLineNumber<e.lineNumber)){if(i.startLineNumber>e.lineNumber)return i;if(!(i.startColumn<e.column))return i}}return this._editor.getModel().getDecorationRange(this._decorations[0])}_allDecorations(){let e=[];return e=e.concat(this._decorations),e=e.concat(this._overviewRulerApproximateDecorations),this._findScopeDecorationIds.length&&e.push(...this._findScopeDecorationIds),this._rangeHighlightDecorationId&&e.push(this._rangeHighlightDecorationId),e}}FindDecorations._CURRENT_FIND_MATCH_DECORATION=ModelDecorationOptions.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",showIfCollapsed:!0,overviewRuler:{color:themeColorFromId(overviewRulerFindMatchForeground),position:OverviewRulerLane$1.Center},minimap:{color:themeColorFromId(minimapFindMatch),position:MinimapPosition$1.Inline}}),FindDecorations._FIND_MATCH_DECORATION=ModelDecorationOptions.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",showIfCollapsed:!0,overviewRuler:{color:themeColorFromId(overviewRulerFindMatchForeground),position:OverviewRulerLane$1.Center},minimap:{color:themeColorFromId(minimapFindMatch),position:MinimapPosition$1.Inline}}),FindDecorations._FIND_MATCH_NO_OVERVIEW_DECORATION=ModelDecorationOptions.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0}),FindDecorations._FIND_MATCH_ONLY_OVERVIEW_DECORATION=ModelDecorationOptions.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:themeColorFromId(overviewRulerFindMatchForeground),position:OverviewRulerLane$1.Center}}),FindDecorations._RANGE_HIGHLIGHT_DECORATION=ModelDecorationOptions.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0}),FindDecorations._FIND_SCOPE_DECORATION=ModelDecorationOptions.register({description:"find-scope",className:"findScope",isWholeLine:!0});class ReplaceAllCommand{constructor(e,t,n){this._editorSelection=e,this._ranges=t,this._replaceStrings=n,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){let e=[];for(let t=0;t<this._ranges.length;t++)e.push({range:this._ranges[t],text:this._replaceStrings[t]});e.sort(((e,t)=>Range$2.compareRangesUsingStarts(e.range,t.range)));let n=[],i=e[0];for(let t=1;t<e.length;t++)i.range.endLineNumber===e[t].range.startLineNumber&&i.range.endColumn===e[t].range.startColumn?(i.range=i.range.plusRange(e[t].range),i.text=i.text+e[t].text):(n.push(i),i=e[t]);n.push(i);for(const o of n)t.addEditOperation(o.range,o.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}}function buildReplaceStringWithCasePreserved(e,t){if(e&&""!==e[0]){const n=validateSpecificSpecialCharacter(e,t,"-"),i=validateSpecificSpecialCharacter(e,t,"_");return n&&!i?buildReplaceStringForSpecificSpecialCharacter(e,t,"-"):!n&&i?buildReplaceStringForSpecificSpecialCharacter(e,t,"_"):e[0].toUpperCase()===e[0]?t.toUpperCase():e[0].toLowerCase()===e[0]?t.toLowerCase():containsUppercaseCharacter(e[0][0])&&t.length>0?t[0].toUpperCase()+t.substr(1):e[0][0].toUpperCase()!==e[0][0]&&t.length>0?t[0].toLowerCase()+t.substr(1):t}return t}function validateSpecificSpecialCharacter(e,t,n){return-1!==e[0].indexOf(n)&&-1!==t.indexOf(n)&&e[0].split(n).length===t.split(n).length}function buildReplaceStringForSpecificSpecialCharacter(e,t,n){const i=t.split(n),o=e[0].split(n);let r="";return i.forEach(((e,t)=>{r+=buildReplaceStringWithCasePreserved([o[t]],e)+n})),r.slice(0,-1)}class StaticValueReplacePattern{constructor(e){this.staticValue=e,this.kind=0}}class DynamicPiecesReplacePattern{constructor(e){this.pieces=e,this.kind=1}}class ReplacePattern{constructor(e){e&&0!==e.length?1===e.length&&null!==e[0].staticValue?this._state=new StaticValueReplacePattern(e[0].staticValue):this._state=new DynamicPiecesReplacePattern(e):this._state=new StaticValueReplacePattern("")}static fromStaticValue(e){return new ReplacePattern([ReplacePiece.staticValue(e)])}get hasReplacementPatterns(){return 1===this._state.kind}buildReplaceString(e,t){if(0===this._state.kind)return t?buildReplaceStringWithCasePreserved(e,this._state.staticValue):this._state.staticValue;let n="";for(let i=0,o=this._state.pieces.length;i<o;i++){let t=this._state.pieces[i];if(null!==t.staticValue){n+=t.staticValue;continue}let o=ReplacePattern._substitute(t.matchIndex,e);if(null!==t.caseOps&&t.caseOps.length>0){let e=[],n=t.caseOps.length,i=0;for(let r=0,s=o.length;r<s;r++){if(i>=n){e.push(o.slice(r));break}switch(t.caseOps[i]){case"U":e.push(o[r].toUpperCase());break;case"u":e.push(o[r].toUpperCase()),i++;break;case"L":e.push(o[r].toLowerCase());break;case"l":e.push(o[r].toLowerCase()),i++;break;default:e.push(o[r])}}o=e.join("")}n+=o}return n}static _substitute(e,t){if(null===t)return"";if(0===e)return t[0];let n="";for(;e>0;){if(e<t.length){return(t[e]||"")+n}n=String(e%10)+n,e=Math.floor(e/10)}return"$"+n}}class ReplacePiece{constructor(e,t,n){this.staticValue=e,this.matchIndex=t,n&&0!==n.length?this.caseOps=n.slice(0):this.caseOps=null}static staticValue(e){return new ReplacePiece(e,-1,null)}static caseOps(e,t){return new ReplacePiece(null,e,t)}}class ReplacePieceBuilder{constructor(e){this._source=e,this._lastCharIndex=0,this._result=[],this._resultLen=0,this._currentStaticPiece=""}emitUnchanged(e){this._emitStatic(this._source.substring(this._lastCharIndex,e)),this._lastCharIndex=e}emitStatic(e,t){this._emitStatic(e),this._lastCharIndex=t}_emitStatic(e){0!==e.length&&(this._currentStaticPiece+=e)}emitMatchIndex(e,t,n){0!==this._currentStaticPiece.length&&(this._result[this._resultLen++]=ReplacePiece.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=ReplacePiece.caseOps(e,n),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),0!==this._currentStaticPiece.length&&(this._result[this._resultLen++]=ReplacePiece.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new ReplacePattern(this._result)}}function parseReplaceString(e){if(!e||0===e.length)return new ReplacePattern(null);let t=[],n=new ReplacePieceBuilder(e);for(let i=0,o=e.length;i<o;i++){let r=e.charCodeAt(i);if(92!==r){if(36===r){if(i++,i>=o)break;let r=e.charCodeAt(i);if(36===r){n.emitUnchanged(i-1),n.emitStatic("$",i+1);continue}if(48===r||38===r){n.emitUnchanged(i-1),n.emitMatchIndex(0,i+1,t),t.length=0;continue}if(49<=r&&r<=57){let s=r-48;if(i+1<o){let o=e.charCodeAt(i+1);if(48<=o&&o<=57){i++,s=10*s+(o-48),n.emitUnchanged(i-2),n.emitMatchIndex(s,i+1,t),t.length=0;continue}}n.emitUnchanged(i-1),n.emitMatchIndex(s,i+1,t),t.length=0;continue}}}else{if(i++,i>=o)break;let r=e.charCodeAt(i);switch(r){case 92:n.emitUnchanged(i-1),n.emitStatic("\\",i+1);break;case 110:n.emitUnchanged(i-1),n.emitStatic("\n",i+1);break;case 116:n.emitUnchanged(i-1),n.emitStatic("\t",i+1);break;case 117:case 85:case 108:case 76:n.emitUnchanged(i-1),n.emitStatic("",i+1),t.push(String.fromCharCode(r))}}}return n.finalize()}const CONTEXT_FIND_WIDGET_VISIBLE=new RawContextKey("findWidgetVisible",!1);CONTEXT_FIND_WIDGET_VISIBLE.toNegated();const CONTEXT_FIND_INPUT_FOCUSED=new RawContextKey("findInputFocussed",!1),CONTEXT_REPLACE_INPUT_FOCUSED=new RawContextKey("replaceInputFocussed",!1),ToggleCaseSensitiveKeybinding={primary:545,mac:{primary:2593}},ToggleWholeWordKeybinding={primary:565,mac:{primary:2613}},ToggleRegexKeybinding={primary:560,mac:{primary:2608}},ToggleSearchScopeKeybinding={primary:554,mac:{primary:2602}},TogglePreserveCaseKeybinding={primary:558,mac:{primary:2606}},FIND_IDS={StartFindAction:"actions.find",StartFindWithSelection:"actions.findWithSelection",StartFindWithArgs:"editor.actions.findWithArgs",NextMatchFindAction:"editor.action.nextMatchFindAction",PreviousMatchFindAction:"editor.action.previousMatchFindAction",NextSelectionMatchFindAction:"editor.action.nextSelectionMatchFindAction",PreviousSelectionMatchFindAction:"editor.action.previousSelectionMatchFindAction",StartFindReplaceAction:"editor.action.startFindReplaceAction",CloseFindWidgetCommand:"closeFindWidget",ToggleCaseSensitiveCommand:"toggleFindCaseSensitive",ToggleWholeWordCommand:"toggleFindWholeWord",ToggleRegexCommand:"toggleFindRegex",ToggleSearchScopeCommand:"toggleFindInSelection",TogglePreserveCaseCommand:"togglePreserveCase",ReplaceOneAction:"editor.action.replaceOne",ReplaceAllAction:"editor.action.replaceAll",SelectAllMatchesAction:"editor.action.selectAllMatches"},MATCHES_LIMIT=19999,RESEARCH_DELAY=240;class FindModelBoundToEditorModel{constructor(e,t){this._toDispose=new DisposableStore,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new TimeoutTimer,this._decorations=new FindDecorations(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new RunOnceScheduler((()=>this.research(!1)),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition((e=>{3!==e.reason&&5!==e.reason&&6!==e.reason||this._decorations.setStartPosition(this._editor.getPosition())}))),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent((e=>{this._ignoreModelContentChanged||(e.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())}))),this._toDispose.add(this._state.onFindReplaceStateChange((e=>this._onStateChanged(e)))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,dispose(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){if(!this._isDisposed&&this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)){this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet((()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)}),RESEARCH_DELAY)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)}}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let n=null;void 0!==t?null!==t&&(n=Array.isArray(t)?t:[t]):n=this._decorations.getFindScopes(),null!==n&&(n=n.map((e=>{if(e.startLineNumber!==e.endLineNumber){let t=e.endLineNumber;return 1===e.endColumn&&(t-=1),new Range$2(e.startLineNumber,1,t,this._editor.getModel().getLineMaxColumn(t))}return e})));let i=this._findMatches(n,!1,MATCHES_LIMIT);this._decorations.set(i,n);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(0===r&&i.length>0){const e=findFirstInSorted(i.map((e=>e.range)),(e=>Range$2.compareRangesUsingStarts(e,o)>=0));r=e>0?e-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(35).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){let e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){let t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){let t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0),{lineNumber:n,column:i}=e,o=this._editor.getModel();return t||1===i?(1===n?n=o.getLineCount():n--,i=o.getLineMaxColumn(n)):i--,new Position$1(n,i)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const t=this._decorations.matchAfterPosition(e);return void(t&&this._setCurrentFindMatch(t))}if(this._decorations.getCount()<MATCHES_LIMIT){let t=this._decorations.matchBeforePosition(e);return t&&t.isEmpty()&&t.getStartPosition().equals(e)&&(e=this._prevSearchPosition(e),t=this._decorations.matchBeforePosition(e)),void(t&&this._setCurrentFindMatch(t))}if(this._cannotFind())return;let n=this._decorations.getFindScope(),i=FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(),n);i.getEndPosition().isBefore(e)&&(e=i.getEndPosition()),e.isBefore(i.getStartPosition())&&(e=i.getEndPosition());let{lineNumber:o,column:r}=e,s=this._editor.getModel(),a=new Position$1(o,r),l=s.findPreviousMatch(this._state.searchString,a,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(117):null,!1);return l&&l.range.isEmpty()&&l.range.getStartPosition().equals(a)&&(a=this._prevSearchPosition(a),l=s.findPreviousMatch(this._state.searchString,a,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(117):null,!1)),l?t||i.containsRange(l.range)?void this._setCurrentFindMatch(l.range):this._moveToPrevMatch(l.range.getStartPosition(),!0):void 0}moveToPrevMatch(){this._moveToPrevMatch(this._editor.getSelection().getStartPosition())}_nextSearchPosition(e){let t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0),{lineNumber:n,column:i}=e,o=this._editor.getModel();return t||i===o.getLineMaxColumn(n)?(n===o.getLineCount()?n=1:n++,i=1):i++,new Position$1(n,i)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const t=this._decorations.matchBeforePosition(e);return void(t&&this._setCurrentFindMatch(t))}if(this._decorations.getCount()<MATCHES_LIMIT){let t=this._decorations.matchAfterPosition(e);return t&&t.isEmpty()&&t.getStartPosition().equals(e)&&(e=this._nextSearchPosition(e),t=this._decorations.matchAfterPosition(e)),void(t&&this._setCurrentFindMatch(t))}let t=this._getNextMatch(e,!1,!0);t&&this._setCurrentFindMatch(t.range)}_getNextMatch(e,t,n,i=!1){if(this._cannotFind())return null;let o=this._decorations.getFindScope(),r=FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(),o);r.getEndPosition().isBefore(e)&&(e=r.getStartPosition()),e.isBefore(r.getStartPosition())&&(e=r.getStartPosition());let{lineNumber:s,column:a}=e,l=this._editor.getModel(),c=new Position$1(s,a),d=l.findNextMatch(this._state.searchString,c,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(117):null,t);return n&&d&&d.range.isEmpty()&&d.range.getStartPosition().equals(c)&&(c=this._nextSearchPosition(c),d=l.findNextMatch(this._state.searchString,c,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(117):null,t)),d?i||r.containsRange(d.range)?d:this._getNextMatch(d.range.getEndPosition(),t,n,!0):null}moveToNextMatch(){this._moveToNextMatch(this._editor.getSelection().getEndPosition())}_getReplacePattern(){return this._state.isRegex?parseReplaceString(this._state.replaceString):ReplacePattern.fromStaticValue(this._state.replaceString)}replace(){if(!this._hasMatches())return;let e=this._getReplacePattern(),t=this._editor.getSelection(),n=this._getNextMatch(t.getStartPosition(),!0,!1);if(n)if(t.equalsRange(n.range)){let i=e.buildReplaceString(n.matches,this._state.preserveCase),o=new ReplaceCommand(t,i);this._executeEditorCommand("replace",o),this._decorations.setStartPosition(new Position$1(t.startLineNumber,t.startColumn+i.length)),this.research(!0)}else this._decorations.setStartPosition(this._editor.getPosition()),this._setCurrentFindMatch(n.range)}_findMatches(e,t,n){const i=(e||[null]).map((e=>FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(),e)));return this._editor.getModel().findMatches(this._state.searchString,i,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(117):null,t,n)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();null===e&&this._state.matchesCount>=MATCHES_LIMIT?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const e=new SearchParams(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(117):null).parseSearchRequest();if(!e)return;let t=e.regex;if(!t.multiline){let e="mu";t.ignoreCase&&(e+="i"),t.global&&(e+="g"),t=new RegExp(t.source,e)}const n=this._editor.getModel(),i=n.getValue(1),o=n.getFullModelRange(),r=this._getReplacePattern();let s;const a=this._state.preserveCase;s=r.hasReplacementPatterns||a?i.replace(t,(function(){return r.buildReplaceString(arguments,a)})):i.replace(t,r.buildReplaceString(null,a));let l=new ReplaceCommandThatPreservesSelection(o,s,this._editor.getSelection());this._executeEditorCommand("replaceAll",l)}_regularReplaceAll(e){const t=this._getReplacePattern();let n=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),i=[];for(let r=0,s=n.length;r<s;r++)i[r]=t.buildReplaceString(n[r].matches,this._state.preserveCase);let o=new ReplaceAllCommand(this._editor.getSelection(),n.map((e=>e.range)),i);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;let e=this._decorations.getFindScopes(),t=this._findMatches(e,!1,1073741824).map((e=>new Selection$1(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn))),n=this._editor.getSelection();for(let i=0,o=t.length;i<o;i++){if(t[i].equalsRange(n)){t=[n].concat(t.slice(0,i)).concat(t.slice(i+1));break}}this._editor.setSelections(t)}_executeEditorCommand(e,t){try{this._ignoreModelContentChanged=!0,this._editor.pushUndoStop(),this._editor.executeCommand(e,t),this._editor.pushUndoStop()}finally{this._ignoreModelContentChanged=!1}}}class FindOptionsWidget extends Widget{constructor(e,t,n,i){super(),this._hideSoon=this._register(new RunOnceScheduler((()=>this._hide()),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=n,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const o=i.getColorTheme().getColor(inputActiveOptionBorder),r=i.getColorTheme().getColor(inputActiveOptionForeground),s=i.getColorTheme().getColor(inputActiveOptionBackground);this.caseSensitive=this._register(new CaseSensitiveCheckbox({appendTitle:this._keybindingLabelFor(FIND_IDS.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,inputActiveOptionBorder:o,inputActiveOptionForeground:r,inputActiveOptionBackground:s})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange((()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)}))),this.wholeWords=this._register(new WholeWordsCheckbox({appendTitle:this._keybindingLabelFor(FIND_IDS.ToggleWholeWordCommand),isChecked:this._state.wholeWord,inputActiveOptionBorder:o,inputActiveOptionForeground:r,inputActiveOptionBackground:s})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange((()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)}))),this.regex=this._register(new RegexCheckbox({appendTitle:this._keybindingLabelFor(FIND_IDS.ToggleRegexCommand),isChecked:this._state.isRegex,inputActiveOptionBorder:o,inputActiveOptionForeground:r,inputActiveOptionBackground:s})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange((()=>{this._state.change({isRegex:this.regex.checked},!1)}))),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange((e=>{let t=!1;e.isRegex&&(this.regex.checked=this._state.isRegex,t=!0),e.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,t=!0),e.matchCase&&(this.caseSensitive.checked=this._state.matchCase,t=!0),!this._state.isRevealed&&t&&this._revealTemporarily()}))),this._register(addDisposableNonBubblingMouseOutListener(this._domNode,(e=>this._onMouseOut()))),this._register(addDisposableListener(this._domNode,"mouseover",(e=>this._onMouseOver()))),this._applyTheme(i.getColorTheme()),this._register(i.onDidColorThemeChange(this._applyTheme.bind(this)))}_keybindingLabelFor(e){let t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return FindOptionsWidget.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseOut(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}_applyTheme(e){let t={inputActiveOptionBorder:e.getColor(inputActiveOptionBorder),inputActiveOptionForeground:e.getColor(inputActiveOptionForeground),inputActiveOptionBackground:e.getColor(inputActiveOptionBackground)};this.caseSensitive.style(t),this.wholeWords.style(t),this.regex.style(t)}}function effectiveOptionValue(e,t){return 1===e||2!==e&&t}FindOptionsWidget.ID="editor.contrib.findOptionsWidget",registerThemingParticipant(((e,t)=>{const n=e.getColor(editorWidgetBackground);n&&t.addRule(`.monaco-editor .findOptionsWidget { background-color: ${n}; }`);const i=e.getColor(editorWidgetForeground);i&&t.addRule(`.monaco-editor .findOptionsWidget { color: ${i}; }`);const o=e.getColor(widgetShadow);o&&t.addRule(`.monaco-editor .findOptionsWidget { box-shadow: 0 0 8px 2px ${o}; }`);const r=e.getColor(contrastBorder);r&&t.addRule(`.monaco-editor .findOptionsWidget { border: 2px solid ${r}; }`)}));class FindReplaceState extends Disposable{constructor(){super(),this._onFindReplaceStateChange=this._register(new Emitter$1),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return effectiveOptionValue(this._isRegexOverride,this._isRegex)}get wholeWord(){return effectiveOptionValue(this._wholeWordOverride,this._wholeWord)}get matchCase(){return effectiveOptionValue(this._matchCaseOverride,this._matchCase)}get preserveCase(){return effectiveOptionValue(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}changeMatchInfo(e,t,n){let i={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1},o=!1;0===t&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,i.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,i.matchesCount=!0,o=!0),void 0!==n&&(Range$2.equalsRange(this._currentMatch,n)||(this._currentMatch=n,i.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(i)}change(e,t,n=!0){var i;let o={moveCursor:t,updateHistory:n,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1},r=!1;const s=this.isRegex,a=this.wholeWord,l=this.matchCase,c=this.preserveCase;void 0!==e.searchString&&this._searchString!==e.searchString&&(this._searchString=e.searchString,o.searchString=!0,r=!0),void 0!==e.replaceString&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,r=!0),void 0!==e.isRevealed&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,r=!0),void 0!==e.isReplaceRevealed&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,r=!0),void 0!==e.isRegex&&(this._isRegex=e.isRegex),void 0!==e.wholeWord&&(this._wholeWord=e.wholeWord),void 0!==e.matchCase&&(this._matchCase=e.matchCase),void 0!==e.preserveCase&&(this._preserveCase=e.preserveCase),void 0!==e.searchScope&&((null===(i=e.searchScope)||void 0===i?void 0:i.every((e=>{var t;return null===(t=this._searchScope)||void 0===t?void 0:t.some((t=>!Range$2.equalsRange(t,e)))})))||(this._searchScope=e.searchScope,o.searchScope=!0,r=!0)),void 0!==e.loop&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,r=!0),void 0!==e.isSearching&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,o.isSearching=!0,r=!0),void 0!==e.filters&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,o.filters=!0,r=!0),this._isRegexOverride=void 0!==e.isRegexOverride?e.isRegexOverride:0,this._wholeWordOverride=void 0!==e.wholeWordOverride?e.wholeWordOverride:0,this._matchCaseOverride=void 0!==e.matchCaseOverride?e.matchCaseOverride:0,this._preserveCaseOverride=void 0!==e.preserveCaseOverride?e.preserveCaseOverride:0,s!==this.isRegex&&(r=!0,o.isRegex=!0),a!==this.wholeWord&&(r=!0,o.wholeWord=!0),l!==this.matchCase&&(r=!0,o.matchCase=!0),c!==this.preserveCase&&(r=!0,o.preserveCase=!0),r&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||1!==this.matchesPosition}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition<this.matchesCount}canNavigateInLoop(){return this._loop||this.matchesCount>=MATCHES_LIMIT}}var findWidget="";function showHistoryKeybindingHint(e){var t,n;return"Up"===(null===(t=e.lookupKeybinding("history.showPrevious"))||void 0===t?void 0:t.getElectronAccelerator())&&"Down"===(null===(n=e.lookupKeybinding("history.showNext"))||void 0===n?void 0:n.getElectronAccelerator())}var __awaiter$B=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const findSelectionIcon=registerIcon("find-selection",Codicon.selection,localize("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),findCollapsedIcon=registerIcon("find-collapsed",Codicon.chevronRight,localize("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),findExpandedIcon=registerIcon("find-expanded",Codicon.chevronDown,localize("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),findReplaceIcon=registerIcon("find-replace",Codicon.replace,localize("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),findReplaceAllIcon=registerIcon("find-replace-all",Codicon.replaceAll,localize("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),findPreviousMatchIcon=registerIcon("find-previous-match",Codicon.arrowUp,localize("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),findNextMatchIcon=registerIcon("find-next-match",Codicon.arrowDown,localize("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),NLS_FIND_INPUT_LABEL=localize("label.find","Find"),NLS_FIND_INPUT_PLACEHOLDER=localize("placeholder.find","Find"),NLS_PREVIOUS_MATCH_BTN_LABEL=localize("label.previousMatchButton","Previous Match"),NLS_NEXT_MATCH_BTN_LABEL=localize("label.nextMatchButton","Next Match"),NLS_TOGGLE_SELECTION_FIND_TITLE=localize("label.toggleSelectionFind","Find in Selection"),NLS_CLOSE_BTN_LABEL=localize("label.closeButton","Close"),NLS_REPLACE_INPUT_LABEL=localize("label.replace","Replace"),NLS_REPLACE_INPUT_PLACEHOLDER=localize("placeholder.replace","Replace"),NLS_REPLACE_BTN_LABEL=localize("label.replaceButton","Replace"),NLS_REPLACE_ALL_BTN_LABEL=localize("label.replaceAllButton","Replace All"),NLS_TOGGLE_REPLACE_MODE_BTN_LABEL=localize("label.toggleReplaceButton","Toggle Replace"),NLS_MATCHES_COUNT_LIMIT_TITLE=localize("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",MATCHES_LIMIT),NLS_MATCHES_LOCATION=localize("label.matchesLocation","{0} of {1}"),NLS_NO_RESULTS=localize("label.noResults","No results"),FIND_WIDGET_INITIAL_WIDTH=419,PART_WIDTH=275,FIND_INPUT_AREA_WIDTH=PART_WIDTH-54;let MAX_MATCHES_COUNT_WIDTH=69;const FIND_INPUT_AREA_HEIGHT=33,ctrlEnterReplaceAllWarningPromptedKey="ctrlEnterReplaceAll.windows.donotask",ctrlKeyMod=isMacintosh?256:2048;class FindWidgetViewZone{constructor(e){this.afterLineNumber=e,this.heightInPx=FIND_INPUT_AREA_HEIGHT,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function stopPropagationForMultiLineUpwards(e,t,n){const i=!!t.match(/\n/);n&&i&&n.selectionStart>0&&e.stopPropagation()}function stopPropagationForMultiLineDownwards(e,t,n){const i=!!t.match(/\n/);n&&i&&n.selectionEnd<n.value.length&&e.stopPropagation()}class FindWidget extends Widget{constructor(e,t,n,i,o,r,s,a,l){super(),this._cachedHeight=null,this._revealTimeouts=[],this._codeEditor=e,this._controller=t,this._state=n,this._contextViewProvider=i,this._keybindingService=o,this._contextKeyService=r,this._storageService=a,this._notificationService=l,this._ctrlEnterReplaceAllWarningPrompted=!!a.getBoolean(ctrlEnterReplaceAllWarningPromptedKey,0),this._isVisible=!1,this._isReplaceVisible=!1,this._ignoreChangeEvent=!1,this._updateHistoryDelayer=new Delayer(500),this._register(toDisposable((()=>this._updateHistoryDelayer.cancel()))),this._register(this._state.onFindReplaceStateChange((e=>this._onStateChanged(e)))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration((e=>{if(e.hasChanged(81)&&(this._codeEditor.getOption(81)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),e.hasChanged(131)&&this._tryUpdateWidgetWidth(),e.hasChanged(2)&&this.updateAccessibilitySupport(),e.hasChanged(35)){const e=this._codeEditor.getOption(35).addExtraSpaceOnTop;e&&!this._viewZone&&(this._viewZone=new FindWidgetViewZone(0),this._showViewZone()),!e&&this._viewZone&&this._removeViewZone()}}))),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection((()=>{this._isVisible&&this._updateToggleSelectionFindButton()}))),this._register(this._codeEditor.onDidFocusEditorWidget((()=>__awaiter$B(this,void 0,void 0,(function*(){if(this._isVisible){let e=yield this._controller.getGlobalBufferTerm();e&&e!==this._state.searchString&&(this._state.change({searchString:e},!1),this._findInput.select())}}))))),this._findInputFocused=CONTEXT_FIND_INPUT_FOCUSED.bindTo(r),this._findFocusTracker=this._register(trackFocus(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus((()=>{this._findInputFocused.set(!0),this._updateSearchScope()}))),this._register(this._findFocusTracker.onDidBlur((()=>{this._findInputFocused.set(!1)}))),this._replaceInputFocused=CONTEXT_REPLACE_INPUT_FOCUSED.bindTo(r),this._replaceFocusTracker=this._register(trackFocus(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus((()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()}))),this._register(this._replaceFocusTracker.onDidBlur((()=>{this._replaceInputFocused.set(!1)}))),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(35).addExtraSpaceOnTop&&(this._viewZone=new FindWidgetViewZone(0)),this._applyTheme(s.getColorTheme()),this._register(s.onDidColorThemeChange(this._applyTheme.bind(this))),this._register(this._codeEditor.onDidChangeModel((()=>{this._isVisible&&(this._viewZoneId=void 0)}))),this._register(this._codeEditor.onDidScrollChange((e=>{e.scrollTopChanged?this._layoutViewZone():setTimeout((()=>{this._layoutViewZone()}),0)})))}getId(){return FindWidget.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?this._codeEditor.getOption(81)||this._isReplaceVisible||(this._isReplaceVisible=!0,this._replaceInput.width=getTotalWidth(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){let e=this._state.searchString.length>0&&0===this._state.matchesCount;this._domNode.classList.toggle("no-results",e),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,onUnexpectedError)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){let e;if(this._matchesCount.style.minWidth=MAX_MATCHES_COUNT_WIDTH+"px",this._state.matchesCount>=MATCHES_LIMIT?this._matchesCount.title=NLS_MATCHES_COUNT_LIMIT_TITLE:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild),this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=MATCHES_LIMIT&&(t+="+");let n=String(this._state.matchesPosition);"0"===n&&(n="?"),e=format(NLS_MATCHES_LOCATION,n,t)}else e=NLS_NO_RESULTS;this._matchesCount.appendChild(document.createTextNode(e)),alert(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),MAX_MATCHES_COUNT_WIDTH=Math.max(MAX_MATCHES_COUNT_WIDTH,this._matchesCount.clientWidth)}_getAriaLabel(e,t,n){if(e===NLS_NO_RESULTS)return""===n?localize("ariaSearchNoResultEmpty","{0} found",e):localize("ariaSearchNoResult","{0} found for '{1}'",e,n);if(t){const i=localize("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,n,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();if(o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1){return`${o.getLineContent(t.startLineNumber)}, ${i}`}return i}return localize("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,n)}_updateToggleSelectionFindButton(){let e=this._codeEditor.getSelection(),t=!!e&&(e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn),n=this._toggleSelectionFind.checked;this._isVisible&&(n||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);let e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);let n=!this._codeEditor.getOption(81);this._toggleReplaceBtn.setEnabled(this._isVisible&&n)}_reveal(){if(this._revealTimeouts.forEach((e=>{clearTimeout(e)})),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(35).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const t=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=t;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout((()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")}),0)),this._revealTimeouts.push(setTimeout((()=>{this._findInput.validate()}),200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(35).seedSearchStringFromSelection&&e){const n=this._codeEditor.getDomNode();if(n){const i=getDomNodePagePosition(n),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=i.left+(o?o.left:0),s=o?o.top:0;if(this._viewZone&&s<this._viewZone.heightInPx){e.endLineNumber>e.startLineNumber&&(t=!1);const n=getTopLeftOffset(this._domNode).left;r>n&&(t=!1);const o=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());i.left+(o?o.left:0)>n&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach((e=>{clearTimeout(e)})),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(35).addExtraSpaceOnTop)return void this._removeViewZone();if(!this._isVisible)return;const t=this._viewZone;void 0===this._viewZoneId&&t&&this._codeEditor.changeViewZones((n=>{t.heightInPx=this._getHeight(),this._viewZoneId=n.addZone(t),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+t.heightInPx)}))}_showViewZone(e=!0){if(!this._isVisible)return;if(!this._codeEditor.getOption(35).addExtraSpaceOnTop)return;void 0===this._viewZone&&(this._viewZone=new FindWidgetViewZone(0));const t=this._viewZone;this._codeEditor.changeViewZones((n=>{if(void 0!==this._viewZoneId){const i=this._getHeight();if(i===t.heightInPx)return;let o=i-t.heightInPx;return t.heightInPx=i,n.layoutZone(this._viewZoneId),void(e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o))}{let i=this._getHeight();if(i-=this._codeEditor.getOption(75).top,i<=0)return;t.heightInPx=i,this._viewZoneId=n.addZone(t),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+i)}}))}_removeViewZone(){this._codeEditor.changeViewZones((e=>{void 0!==this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))}))}_applyTheme(e){let t={inputActiveOptionBorder:e.getColor(inputActiveOptionBorder),inputActiveOptionBackground:e.getColor(inputActiveOptionBackground),inputActiveOptionForeground:e.getColor(inputActiveOptionForeground),inputBackground:e.getColor(inputBackground),inputForeground:e.getColor(inputForeground),inputBorder:e.getColor(inputBorder),inputValidationInfoBackground:e.getColor(inputValidationInfoBackground),inputValidationInfoForeground:e.getColor(inputValidationInfoForeground),inputValidationInfoBorder:e.getColor(inputValidationInfoBorder),inputValidationWarningBackground:e.getColor(inputValidationWarningBackground),inputValidationWarningForeground:e.getColor(inputValidationWarningForeground),inputValidationWarningBorder:e.getColor(inputValidationWarningBorder),inputValidationErrorBackground:e.getColor(inputValidationErrorBackground),inputValidationErrorForeground:e.getColor(inputValidationErrorForeground),inputValidationErrorBorder:e.getColor(inputValidationErrorBorder)};this._findInput.style(t),this._replaceInput.style(t),this._toggleSelectionFind.style(t)}_tryUpdateWidgetWidth(){if(!this._isVisible)return;if(!isInDOM(this._domNode))return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0)return void this._domNode.classList.add("hiddenEditor");this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const t=e.width,n=e.minimap.minimapWidth;let i=!1,o=!1,r=!1;if(this._resized){if(getTotalWidth(this._domNode)>FIND_WIDGET_INITIAL_WIDTH)return this._domNode.style.maxWidth=t-28-n-15+"px",void(this._replaceInput.width=getTotalWidth(this._findInput.domNode))}if(FIND_WIDGET_INITIAL_WIDTH+28+n>=t&&(o=!0),FIND_WIDGET_INITIAL_WIDTH+28+n-MAX_MATCHES_COUNT_WIDTH>=t&&(r=!0),FIND_WIDGET_INITIAL_WIDTH+28+n-MAX_MATCHES_COUNT_WIDTH>=t+50&&(i=!0),this._domNode.classList.toggle("collapsed-find-widget",i),this._domNode.classList.toggle("narrow-find-widget",r),this._domNode.classList.toggle("reduced-find-widget",o),r||i||(this._domNode.style.maxWidth=t-28-n-15+"px"),this._resized){this._findInput.inputBox.layout();let e=this._findInput.inputBox.element.clientWidth;e>0&&(this._replaceInput.width=e)}else this._isReplaceVisible&&(this._replaceInput.width=getTotalWidth(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return(null===this._cachedHeight||this._cachedHeight!==e)&&(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){let e=this._codeEditor.getSelections();e.map((e=>{1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1)));const t=this._state.currentMatch;return e.startLineNumber===e.endLineNumber||Range$2.equalsRange(e,t)?null:e})).filter((e=>!!e)),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){return e.equals(3|ctrlKeyMod)?(this._keybindingService.dispatchEvent(e,e.target)||this._findInput.inputBox.insertAtCursor("\n"),void e.preventDefault()):e.equals(2)?(this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?stopPropagationForMultiLineUpwards(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):e.equals(18)?stopPropagationForMultiLineDownwards(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):void 0}_onReplaceInputKeyDown(e){return e.equals(3|ctrlKeyMod)?(this._keybindingService.dispatchEvent(e,e.target)||(isWindows&&isNative&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(localize("ctrlEnter.keybindingChanged","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(ctrlEnterReplaceAllWarningPromptedKey,!0,0,0)),this._replaceInput.inputBox.insertAtCursor("\n")),void e.preventDefault()):e.equals(2)?(this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(1026)?(this._findInput.focus(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?stopPropagationForMultiLineUpwards(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):e.equals(18)?stopPropagationForMultiLineDownwards(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):void 0}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){let t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new ContextScopedFindInput(null,this._contextViewProvider,{width:FIND_INPUT_AREA_WIDTH,label:NLS_FIND_INPUT_LABEL,placeholder:NLS_FIND_INPUT_PLACEHOLDER,appendCaseSensitiveLabel:this._keybindingLabelFor(FIND_IDS.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(FIND_IDS.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(FIND_IDS.ToggleRegexCommand),validation:e=>{if(0===e.length||!this._findInput.getRegex())return null;try{return new RegExp(e,"gu"),null}catch(e2){return{content:e2.message}}},flexibleHeight:true,flexibleWidth:true,flexibleMaxHeight:118,showHistoryHint:()=>showHistoryKeybindingHint(this._keybindingService)},this._contextKeyService,!0)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown((e=>this._onFindInputKeyDown(e)))),this._register(this._findInput.inputBox.onDidChange((()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)}))),this._register(this._findInput.onDidOptionChange((()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)}))),this._register(this._findInput.onCaseSensitiveKeyDown((e=>{e.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),e.preventDefault())}))),this._register(this._findInput.onRegexKeyDown((e=>{e.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),e.preventDefault())}))),this._register(this._findInput.inputBox.onDidHeightChange((e=>{this._tryUpdateHeight()&&this._showViewZone()}))),isLinux&&this._register(this._findInput.onMouseDown((e=>this._onFindInputMouseDown(e)))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new SimpleButton({label:NLS_PREVIOUS_MATCH_BTN_LABEL+this._keybindingLabelFor(FIND_IDS.PreviousMatchFindAction),icon:findPreviousMatchIcon,onTrigger:()=>{this._codeEditor.getAction(FIND_IDS.PreviousMatchFindAction).run().then(void 0,onUnexpectedError)}})),this._nextBtn=this._register(new SimpleButton({label:NLS_NEXT_MATCH_BTN_LABEL+this._keybindingLabelFor(FIND_IDS.NextMatchFindAction),icon:findNextMatchIcon,onTrigger:()=>{this._codeEditor.getAction(FIND_IDS.NextMatchFindAction).run().then(void 0,onUnexpectedError)}}));let e=document.createElement("div");e.className="find-part",e.appendChild(this._findInput.domNode);const t=document.createElement("div");t.className="find-actions",e.appendChild(t),t.appendChild(this._matchesCount),t.appendChild(this._prevBtn.domNode),t.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new Checkbox({icon:findSelectionIcon,title:NLS_TOGGLE_SELECTION_FIND_TITLE+this._keybindingLabelFor(FIND_IDS.ToggleSearchScopeCommand),isChecked:!1})),this._register(this._toggleSelectionFind.onChange((()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let e=this._codeEditor.getSelections();e.map((e=>(1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1))),e.isEmpty()?null:e))).filter((e=>!!e)),e.length&&this._state.change({searchScope:e},!0)}}else this._state.change({searchScope:null},!0)}))),t.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new SimpleButton({label:NLS_CLOSE_BTN_LABEL+this._keybindingLabelFor(FIND_IDS.CloseFindWidgetCommand),icon:widgetClose,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:e=>{e.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),e.preventDefault())}})),t.appendChild(this._closeBtn.domNode),this._replaceInput=this._register(new ContextScopedReplaceInput(null,void 0,{label:NLS_REPLACE_INPUT_LABEL,placeholder:NLS_REPLACE_INPUT_PLACEHOLDER,appendPreserveCaseLabel:this._keybindingLabelFor(FIND_IDS.TogglePreserveCaseCommand),history:[],flexibleHeight:true,flexibleWidth:true,flexibleMaxHeight:118,showHistoryHint:()=>showHistoryKeybindingHint(this._keybindingService)},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown((e=>this._onReplaceInputKeyDown(e)))),this._register(this._replaceInput.inputBox.onDidChange((()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)}))),this._register(this._replaceInput.inputBox.onDidHeightChange((e=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()}))),this._register(this._replaceInput.onDidOptionChange((()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)}))),this._register(this._replaceInput.onPreserveCaseKeyDown((e=>{e.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),e.preventDefault())}))),this._replaceBtn=this._register(new SimpleButton({label:NLS_REPLACE_BTN_LABEL+this._keybindingLabelFor(FIND_IDS.ReplaceOneAction),icon:findReplaceIcon,onTrigger:()=>{this._controller.replace()},onKeyDown:e=>{e.equals(1026)&&(this._closeBtn.focus(),e.preventDefault())}})),this._replaceAllBtn=this._register(new SimpleButton({label:NLS_REPLACE_ALL_BTN_LABEL+this._keybindingLabelFor(FIND_IDS.ReplaceAllAction),icon:findReplaceAllIcon,onTrigger:()=>{this._controller.replaceAll()}}));let n=document.createElement("div");n.className="replace-part",n.appendChild(this._replaceInput.domNode);const i=document.createElement("div");i.className="replace-actions",n.appendChild(i),i.appendChild(this._replaceBtn.domNode),i.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new SimpleButton({label:NLS_TOGGLE_REPLACE_MODE_BTN_LABEL,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=getTotalWidth(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.style.width=`${FIND_WIDGET_INITIAL_WIDTH}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(e),this._domNode.appendChild(n),this._resizeSash=new Sash(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let o=FIND_WIDGET_INITIAL_WIDTH;this._register(this._resizeSash.onDidStart((()=>{o=getTotalWidth(this._domNode)}))),this._register(this._resizeSash.onDidChange((e=>{this._resized=!0;let t=o+e.startX-e.currentX;if(t<FIND_WIDGET_INITIAL_WIDTH)return;t>(parseFloat(getComputedStyle$1(this._domNode).maxWidth)||0)||(this._domNode.style.width=`${t}px`,this._isReplaceVisible&&(this._replaceInput.width=getTotalWidth(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())}))),this._register(this._resizeSash.onDidReset((()=>{const e=getTotalWidth(this._domNode);if(e<FIND_WIDGET_INITIAL_WIDTH)return;let t=FIND_WIDGET_INITIAL_WIDTH;if(!this._resized||e===FIND_WIDGET_INITIAL_WIDTH){const e=this._codeEditor.getLayoutInfo();t=e.width-28-e.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${t}px`,this._isReplaceVisible&&(this._replaceInput.width=getTotalWidth(this._findInput.domNode)),this._findInput.inputBox.layout()})))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(2!==e)}}FindWidget.ID="editor.contrib.findWidget";class SimpleButton extends Widget{constructor(e){super(),this._opts=e;let t="button";this._opts.className&&(t=t+" "+this._opts.className),this._opts.icon&&(t=t+" "+ThemeIcon.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.title=this._opts.label,this._domNode.tabIndex=0,this._domNode.className=t,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this.onclick(this._domNode,(e=>{this._opts.onTrigger(),e.preventDefault()})),this.onkeydown(this._domNode,(e=>{if(e.equals(10)||e.equals(3))return this._opts.onTrigger(),void e.preventDefault();this._opts.onKeyDown&&this._opts.onKeyDown(e)}))}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...ThemeIcon.asClassNameArray(findCollapsedIcon)),this._domNode.classList.add(...ThemeIcon.asClassNameArray(findExpandedIcon))):(this._domNode.classList.remove(...ThemeIcon.asClassNameArray(findExpandedIcon)),this._domNode.classList.add(...ThemeIcon.asClassNameArray(findCollapsedIcon)))}}registerThemingParticipant(((e,t)=>{const n=(e,n)=>{n&&t.addRule(`.monaco-editor ${e} { background-color: ${n}; }`)};n(".findMatch",e.getColor(editorFindMatchHighlight)),n(".currentFindMatch",e.getColor(editorFindMatch)),n(".findScope",e.getColor(editorFindRangeHighlight));n(".find-widget",e.getColor(editorWidgetBackground));const i=e.getColor(widgetShadow);i&&t.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${i}; }`);const o=e.getColor(editorFindMatchHighlightBorder);o&&t.addRule(`.monaco-editor .findMatch { border: 1px ${"hc"===e.type?"dotted":"solid"} ${o}; box-sizing: border-box; }`);const r=e.getColor(editorFindMatchBorder);r&&t.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${r}; padding: 1px; box-sizing: border-box; }`);const s=e.getColor(editorFindRangeHighlightBorder);s&&t.addRule(`.monaco-editor .findScope { border: 1px ${"hc"===e.type?"dashed":"solid"} ${s}; }`);const a=e.getColor(contrastBorder);a&&t.addRule(`.monaco-editor .find-widget { border: 1px solid ${a}; }`);const l=e.getColor(editorWidgetForeground);l&&t.addRule(`.monaco-editor .find-widget { color: ${l}; }`);const c=e.getColor(errorForeground);c&&t.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${c}; }`);const d=e.getColor(editorWidgetResizeBorder);if(d)t.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${d}; }`);else{const n=e.getColor(editorWidgetBorder);n&&t.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${n}; }`)}const u=e.getColor(toolbarHoverBackground);u&&t.addRule(`\n\t\t.monaco-editor .find-widget .button:not(.disabled):hover,\n\t\t.monaco-editor .find-widget .codicon-find-selection:hover {\n\t\t\tbackground-color: ${u} !important;\n\t\t}\n\t`);const h=e.getColor(focusBorder);h&&t.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${h}; }`)}));var __decorate$W=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$V=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$A=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const SEARCH_STRING_MAX_LENGTH=524288;function getSelectionSearchString(e,t="single",n=!1){if(!e.hasModel())return null;const i=e.getSelection();if("single"===t&&i.startLineNumber===i.endLineNumber||"multiple"===t)if(i.isEmpty()){const t=e.getConfiguredWordAtPosition(i.getStartPosition());if(t&&!1===n)return t.word}else if(e.getModel().getValueLengthInRange(i)<SEARCH_STRING_MAX_LENGTH)return e.getModel().getValueInRange(i);return null}let CommonFindController=class e extends Disposable{constructor(e,t,n,i){super(),this._editor=e,this._findWidgetVisible=CONTEXT_FIND_WIDGET_VISIBLE.bindTo(t),this._contextKeyService=t,this._storageService=n,this._clipboardService=i,this._updateHistoryDelayer=new Delayer(500),this._state=this._register(new FindReplaceState),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange((e=>this._onStateChanged(e)))),this._model=null,this._register(this._editor.onDidChangeModel((()=>{let e=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),e&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(35).loop})})))}get editor(){return this._editor}static get(t){return t.getContribution(e.ID)}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,0),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,0),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,0),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,0)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!CONTEXT_FIND_INPUT_FOCUSED.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e.map((e=>(1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._editor.getModel().getLineMaxColumn(e.endLineNumber-1))),e.isEmpty()?null:e))).filter((e=>!!e)),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=escapeRegExpCharacters(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return __awaiter$A(this,void 0,void 0,(function*(){if(this.disposeModel(),!this._editor.hasModel())return;let n=Object.assign(Object.assign({},t),{isRevealed:!0});if("single"===e.seedSearchStringFromSelection){let t=getSelectionSearchString(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);t&&(this._state.isRegex?n.searchString=escapeRegExpCharacters(t):n.searchString=t)}else if("multiple"===e.seedSearchStringFromSelection&&!e.updateSearchScope){let t=getSelectionSearchString(this._editor,e.seedSearchStringFromSelection);t&&(n.searchString=t)}if(!n.searchString&&e.seedSearchStringFromGlobalClipboard){let e=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;e&&(n.searchString=e)}if(e.forceRevealReplace||n.isReplaceRevealed?n.isReplaceRevealed=!0:this._findWidgetVisible.get()||(n.isReplaceRevealed=!1),e.updateSearchScope){let e=this._editor.getSelections();e.some((e=>!e.isEmpty()))&&(n.searchScope=e)}n.loop=e.loop,this._state.change(n,!1),this._model||(this._model=new FindModelBoundToEditorModel(this._editor,this._state))}))}start(e,t){return this._start(e,t)}moveToNextMatch(){return!!this._model&&(this._model.moveToNextMatch(),!0)}moveToPrevMatch(){return!!this._model&&(this._model.moveToPrevMatch(),!0)}replace(){return!!this._model&&(this._model.replace(),!0)}replaceAll(){return!!this._model&&(this._model.replaceAll(),!0)}selectAllMatches(){return!!this._model&&(this._model.selectAllMatches(),this._editor.focus(),!0)}getGlobalBufferTerm(){return __awaiter$A(this,void 0,void 0,(function*(){return this._editor.getOption(35).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}))}setGlobalBufferTerm(e){this._editor.getOption(35).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};CommonFindController.ID="editor.contrib.findController",CommonFindController=__decorate$W([__param$V(1,IContextKeyService),__param$V(2,IStorageService),__param$V(3,IClipboardService)],CommonFindController);let FindController=class extends CommonFindController{constructor(e,t,n,i,o,r,s,a){super(e,n,s,a),this._contextViewService=t,this._keybindingService=i,this._themeService=o,this._notificationService=r,this._widget=null,this._findOptionsWidget=null}_start(e,t){const n=Object.create(null,{_start:{get:()=>super._start}});return __awaiter$A(this,void 0,void 0,(function*(){this._widget||this._createFindWidget();const i=this._editor.getSelection();let o=!1;switch(this._editor.getOption(35).autoFindInSelection){case"always":o=!0;break;case"never":o=!1;break;case"multiline":o=!!i&&i.startLineNumber!==i.endLineNumber;break}e.updateSearchScope=e.updateSearchScope||o,yield n._start.call(this,e,t),this._widget&&(2===e.shouldFocus?this._widget.focusReplaceInput():1===e.shouldFocus&&this._widget.focusFindInput())}))}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new FindWidget(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new FindOptionsWidget(this._editor,this._state,this._keybindingService,this._themeService))}};FindController=__decorate$W([__param$V(1,IContextViewService),__param$V(2,IContextKeyService),__param$V(3,IKeybindingService),__param$V(4,IThemeService),__param$V(5,INotificationService),__param$V(6,IStorageService),__param$V(7,IClipboardService)],FindController);const StartFindAction=registerMultiEditorAction(new MultiEditorAction({id:FIND_IDS.StartFindAction,label:localize("startFindAction","Find"),alias:"Find",precondition:ContextKeyExpr.or(EditorContextKeys.focus,ContextKeyExpr.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:MenuId.MenubarEditMenu,group:"3_find",title:localize({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));StartFindAction.addImplementation(0,((e,t,n)=>{const i=CommonFindController.get(t);return!!i&&i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"never"!==t.getOption(35).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(35).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:t.getOption(35).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop})}));const findArgDescription={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},regex:{type:"boolean"},regexOverride:{type:"number",description:localize("actions.find.isRegexOverride",'Overrides "Use Regular Expression" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},wholeWord:{type:"boolean"},wholeWordOverride:{type:"number",description:localize("actions.find.wholeWordOverride",'Overrides "Match Whole Word" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},matchCase:{type:"boolean"},matchCaseOverride:{type:"number",description:localize("actions.find.matchCaseOverride",'Overrides "Math Case" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},preserveCase:{type:"boolean"},preserveCaseOverride:{type:"number",description:localize("actions.find.preserveCaseOverride",'Overrides "Preserve Case" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},findInSelection:{type:"boolean"}}}}]};class StartFindWithArgsAction extends EditorAction{constructor(){super({id:FIND_IDS.StartFindWithArgs,label:localize("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:findArgDescription})}run(e,t,n){return __awaiter$A(this,void 0,void 0,(function*(){const e=CommonFindController.get(t);if(e){const i=n?{searchString:n.searchString,replaceString:n.replaceString,isReplaceRevealed:void 0!==n.replaceString,isRegex:n.isRegex,wholeWord:n.matchWholeWord,matchCase:n.isCaseSensitive,preserveCase:n.preserveCase}:{};yield e.start({forceRevealReplace:!1,seedSearchStringFromSelection:0===e.getState().searchString.length&&"never"!==t.getOption(35).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(35).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(null==n?void 0:n.findInSelection)||!1,loop:t.getOption(35).loop},i),e.setGlobalBufferTerm(e.getState().searchString)}}))}}class StartFindWithSelectionAction extends EditorAction{constructor(){super({id:FIND_IDS.StartFindWithSelection,label:localize("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}run(e,t){return __awaiter$A(this,void 0,void 0,(function*(){const e=CommonFindController.get(t);e&&(yield e.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop}),e.setGlobalBufferTerm(e.getState().searchString))}))}}class MatchFindAction extends EditorAction{run(e,t){return __awaiter$A(this,void 0,void 0,(function*(){const e=CommonFindController.get(t);e&&!this._run(e)&&(yield e.start({forceRevealReplace:!1,seedSearchStringFromSelection:0===e.getState().searchString.length&&"never"!==t.getOption(35).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(35).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop}),this._run(e))}))}}class NextMatchFindAction extends MatchFindAction{constructor(){super({id:FIND_IDS.NextMatchFindAction,label:localize("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:EditorContextKeys.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:ContextKeyExpr.and(EditorContextKeys.focus,CONTEXT_FIND_INPUT_FOCUSED),primary:3,weight:100}]})}_run(e){return!!e.moveToNextMatch()&&(e.editor.pushUndoStop(),!0)}}class PreviousMatchFindAction extends MatchFindAction{constructor(){super({id:FIND_IDS.PreviousMatchFindAction,label:localize("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:EditorContextKeys.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:ContextKeyExpr.and(EditorContextKeys.focus,CONTEXT_FIND_INPUT_FOCUSED),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class SelectionMatchFindAction extends EditorAction{run(e,t){return __awaiter$A(this,void 0,void 0,(function*(){const e=CommonFindController.get(t);if(!e)return;const n="selection"===t.getOption(35).seedSearchStringFromSelection;let i=null;"never"!==t.getOption(35).seedSearchStringFromSelection&&(i=getSelectionSearchString(t,"single",n)),i&&e.setSearchString(i),this._run(e)||(yield e.start({forceRevealReplace:!1,seedSearchStringFromSelection:"never"!==t.getOption(35).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:n,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop}),this._run(e))}))}}class NextSelectionMatchFindAction extends SelectionMatchFindAction{constructor(){super({id:FIND_IDS.NextSelectionMatchFindAction,label:localize("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class PreviousSelectionMatchFindAction extends SelectionMatchFindAction{constructor(){super({id:FIND_IDS.PreviousSelectionMatchFindAction,label:localize("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const StartFindReplaceAction=registerMultiEditorAction(new MultiEditorAction({id:FIND_IDS.StartFindReplaceAction,label:localize("startReplace","Replace"),alias:"Replace",precondition:ContextKeyExpr.or(EditorContextKeys.focus,ContextKeyExpr.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:MenuId.MenubarEditMenu,group:"3_find",title:localize({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));StartFindReplaceAction.addImplementation(0,((e,t,n)=>{if(!t.hasModel()||t.getOption(81))return!1;const i=CommonFindController.get(t);if(!i)return!1;const o=t.getSelection(),r=i.isFindInputFocused(),s=!o.isEmpty()&&o.startLineNumber===o.endLineNumber&&"never"!==t.getOption(35).seedSearchStringFromSelection&&!r,a=r||s?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:s?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(35).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:"never"!==t.getOption(35).seedSearchStringFromSelection,shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop})})),registerEditorContribution(CommonFindController.ID,FindController),registerEditorAction(StartFindWithArgsAction),registerEditorAction(StartFindWithSelectionAction),registerEditorAction(NextMatchFindAction),registerEditorAction(PreviousMatchFindAction),registerEditorAction(NextSelectionMatchFindAction),registerEditorAction(PreviousSelectionMatchFindAction);const FindCommand=EditorCommand.bindToContribution(CommonFindController.get);registerEditorCommand(new FindCommand({id:FIND_IDS.CloseFindWidgetCommand,precondition:CONTEXT_FIND_WIDGET_VISIBLE,handler:e=>e.closeFindWidget(),kbOpts:{weight:105,kbExpr:ContextKeyExpr.and(EditorContextKeys.focus,ContextKeyExpr.not("isComposing")),primary:9,secondary:[1033]}})),registerEditorCommand(new FindCommand({id:FIND_IDS.ToggleCaseSensitiveCommand,precondition:void 0,handler:e=>e.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:EditorContextKeys.focus,primary:ToggleCaseSensitiveKeybinding.primary,mac:ToggleCaseSensitiveKeybinding.mac,win:ToggleCaseSensitiveKeybinding.win,linux:ToggleCaseSensitiveKeybinding.linux}})),registerEditorCommand(new FindCommand({id:FIND_IDS.ToggleWholeWordCommand,precondition:void 0,handler:e=>e.toggleWholeWords(),kbOpts:{weight:105,kbExpr:EditorContextKeys.focus,primary:ToggleWholeWordKeybinding.primary,mac:ToggleWholeWordKeybinding.mac,win:ToggleWholeWordKeybinding.win,linux:ToggleWholeWordKeybinding.linux}})),registerEditorCommand(new FindCommand({id:FIND_IDS.ToggleRegexCommand,precondition:void 0,handler:e=>e.toggleRegex(),kbOpts:{weight:105,kbExpr:EditorContextKeys.focus,primary:ToggleRegexKeybinding.primary,mac:ToggleRegexKeybinding.mac,win:ToggleRegexKeybinding.win,linux:ToggleRegexKeybinding.linux}})),registerEditorCommand(new FindCommand({id:FIND_IDS.ToggleSearchScopeCommand,precondition:void 0,handler:e=>e.toggleSearchScope(),kbOpts:{weight:105,kbExpr:EditorContextKeys.focus,primary:ToggleSearchScopeKeybinding.primary,mac:ToggleSearchScopeKeybinding.mac,win:ToggleSearchScopeKeybinding.win,linux:ToggleSearchScopeKeybinding.linux}})),registerEditorCommand(new FindCommand({id:FIND_IDS.TogglePreserveCaseCommand,precondition:void 0,handler:e=>e.togglePreserveCase(),kbOpts:{weight:105,kbExpr:EditorContextKeys.focus,primary:TogglePreserveCaseKeybinding.primary,mac:TogglePreserveCaseKeybinding.mac,win:TogglePreserveCaseKeybinding.win,linux:TogglePreserveCaseKeybinding.linux}})),registerEditorCommand(new FindCommand({id:FIND_IDS.ReplaceOneAction,precondition:CONTEXT_FIND_WIDGET_VISIBLE,handler:e=>e.replace(),kbOpts:{weight:105,kbExpr:EditorContextKeys.focus,primary:3094}})),registerEditorCommand(new FindCommand({id:FIND_IDS.ReplaceOneAction,precondition:CONTEXT_FIND_WIDGET_VISIBLE,handler:e=>e.replace(),kbOpts:{weight:105,kbExpr:ContextKeyExpr.and(EditorContextKeys.focus,CONTEXT_REPLACE_INPUT_FOCUSED),primary:3}})),registerEditorCommand(new FindCommand({id:FIND_IDS.ReplaceAllAction,precondition:CONTEXT_FIND_WIDGET_VISIBLE,handler:e=>e.replaceAll(),kbOpts:{weight:105,kbExpr:EditorContextKeys.focus,primary:2563}})),registerEditorCommand(new FindCommand({id:FIND_IDS.ReplaceAllAction,precondition:CONTEXT_FIND_WIDGET_VISIBLE,handler:e=>e.replaceAll(),kbOpts:{weight:105,kbExpr:ContextKeyExpr.and(EditorContextKeys.focus,CONTEXT_REPLACE_INPUT_FOCUSED),primary:void 0,mac:{primary:2051}}})),registerEditorCommand(new FindCommand({id:FIND_IDS.SelectAllMatchesAction,precondition:CONTEXT_FIND_WIDGET_VISIBLE,handler:e=>e.selectAllMatches(),kbOpts:{weight:105,kbExpr:EditorContextKeys.focus,primary:515}}));var folding="";const MAX_FOLDING_REGIONS=65535,MAX_LINE_NUMBER=16777215,MASK_INDENT=4278190080;class FoldingRegions{constructor(e,t,n){if(e.length!==t.length||e.length>MAX_FOLDING_REGIONS)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Uint32Array(Math.ceil(e.length/32)),this._types=n,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;let e=[],t=(t,n)=>{let i=e[e.length-1];return this.getStartLineNumber(i)<=t&&this.getEndLineNumber(i)>=n};for(let n=0,i=this._startIndexes.length;n<i;n++){let i=this._startIndexes[n],o=this._endIndexes[n];if(i>MAX_LINE_NUMBER||o>MAX_LINE_NUMBER)throw new Error("startLineNumber or endLineNumber must not exceed "+MAX_LINE_NUMBER);for(;e.length>0&&!t(i,o);)e.pop();let r=e.length>0?e[e.length-1]:-1;e.push(n),this._startIndexes[n]=i+((255&r)<<24),this._endIndexes[n]=o+((65280&r)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&MAX_LINE_NUMBER}getEndLineNumber(e){return this._endIndexes[e]&MAX_LINE_NUMBER}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){let t=e/32|0,n=e%32;return 0!=(this._collapseStates[t]&1<<n)}setCollapsed(e,t){let n=e/32|0,i=e%32,o=this._collapseStates[n];this._collapseStates[n]=t?o|1<<i:o&~(1<<i)}setCollapsedAllOfType(e,t){let n=!1;if(this._types)for(let i=0;i<this._types.length;i++)this._types[i]===e&&(this.setCollapsed(i,t),n=!0);return n}toRegion(e){return new FoldingRegion(this,e)}getParentIndex(e){this.ensureParentIndices();let t=((this._startIndexes[e]&MASK_INDENT)>>>24)+((this._endIndexes[e]&MASK_INDENT)>>>16);return t===MAX_FOLDING_REGIONS?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,n=this._startIndexes.length;if(0===n)return-1;for(;t<n;){let i=Math.floor((t+n)/2);e<this.getStartLineNumber(i)?n=i:t=i+1}return t-1}findRange(e){let t=this.findIndex(e);if(t>=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);-1!==t;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){let e=[];for(let t=0;t<this.length;t++)e[t]=`[${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}}class FoldingRegion{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class FoldingModel{constructor(e,t){this._updateEventEmitter=new Emitter$1,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new FoldingRegions(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[],this._isInitialized=!1}get regions(){return this._regions}get textModel(){return this._textModel}get isInitialized(){return this._isInitialized}toggleCollapseState(e){if(!e.length)return;e=e.sort(((e,t)=>e.regionIndex-t.regionIndex));const t={};this._decorationProvider.changeDecorations((n=>{let i=0,o=-1,r=-1;const s=e=>{for(;i<e;){const e=this._regions.getEndLineNumber(i),t=this._regions.isCollapsed(i);e<=o&&n.changeDecorationOptions(this._editorDecorationIds[i],this._decorationProvider.getDecorationOption(t,e<=r)),t&&e>r&&(r=e),i++}};for(let a of e){let e=a.regionIndex,n=this._editorDecorationIds[e];if(n&&!t[n]){t[n]=!0,s(e);let i=!this._regions.isCollapsed(e);this._regions.setCollapsed(e,i),o=Math.max(o,this._regions.getEndLineNumber(e))}}s(this._regions.length)})),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}update(e,t=[]){let n=[],i=-1,o=(o,r)=>{const s=e.getStartLineNumber(o),a=e.getEndLineNumber(o);r||(r=e.isCollapsed(o)),r&&((e,n)=>{for(let i of t)if(e<i&&i<=n)return!0;return!1})(s,a)&&(r=!1),e.setCollapsed(o,r);const l=this._textModel.getLineMaxColumn(s),c={startLineNumber:s,startColumn:Math.max(l-1,1),endLineNumber:s,endColumn:l};n.push({range:c,options:this._decorationProvider.getDecorationOption(r,a<=i)}),r&&a>i&&(i=a)},r=0,s=()=>{for(;r<this._regions.length;){let e=this._regions.isCollapsed(r);if(r++,e)return r-1}return-1},a=0,l=s();for(;-1!==l&&a<e.length;){let t=this._textModel.getDecorationRange(this._editorDecorationIds[l]);if(t){let n=t.startLineNumber;if(t.startColumn===Math.max(t.endColumn-1,1)&&this._textModel.getLineMaxColumn(n)===t.endColumn)for(;a<e.length;){let t=e.getStartLineNumber(a);if(!(n>=t))break;o(a,n===t),a++}}l=s()}for(;a<e.length;)o(a,!1),a++;this._editorDecorationIds=this._decorationProvider.deltaDecorations(this._editorDecorationIds,n),this._regions=e,this._isInitialized=!0,this._updateEventEmitter.fire({model:this})}getMemento(){let e=[];for(let t=0;t<this._regions.length;t++)if(this._regions.isCollapsed(t)){let n=this._textModel.getDecorationRange(this._editorDecorationIds[t]);if(n){let i=n.startLineNumber,o=n.endLineNumber+this._regions.getEndLineNumber(t)-this._regions.getStartLineNumber(t);e.push({startLineNumber:i,endLineNumber:o})}}if(e.length>0)return e}applyMemento(e){if(!Array.isArray(e))return;let t=[];for(let n of e){let e=this.getRegionAtLine(n.startLineNumber);e&&!e.isCollapsed&&t.push(e)}this.toggleCollapseState(t)}dispose(){this._decorationProvider.deltaDecorations(this._editorDecorationIds,[])}getAllRegionsAtLine(e,t){let n=[];if(this._regions){let i=this._regions.findRange(e),o=1;for(;i>=0;){let e=this._regions.toRegion(i);t&&!t(e,o)||n.push(e),o++,i=e.parentIndex}}return n}getRegionAtLine(e){if(this._regions){let t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){let n=[],i=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&2===t.length){const e=[];for(let r=i,s=this._regions.length;r<s;r++){let i=this._regions.toRegion(r);if(!(this._regions.getStartLineNumber(r)<o))break;for(;e.length>0&&!i.containedBy(e[e.length-1]);)e.pop();e.push(i),t(i,e.length)&&n.push(i)}}else for(let r=i,s=this._regions.length;r<s;r++){let e=this._regions.toRegion(r);if(!(this._regions.getStartLineNumber(r)<o))break;t&&!t(e)||n.push(e)}return n}}function toggleCollapseState(e,t,n){let i=[];for(let o of n){let n=e.getRegionAtLine(o);if(n){const o=!n.isCollapsed;if(i.push(n),t>1){let r=e.getRegionsInside(n,((e,n)=>e.isCollapsed!==o&&n<t));i.push(...r)}}}e.toggleCollapseState(i)}function setCollapseStateLevelsDown(e,t,n=Number.MAX_VALUE,i){let o=[];if(i&&i.length>0)for(let r of i){let i=e.getRegionAtLine(r);if(i&&(i.isCollapsed!==t&&o.push(i),n>1)){let r=e.getRegionsInside(i,((e,i)=>e.isCollapsed!==t&&i<n));o.push(...r)}}else{let i=e.getRegionsInside(null,((e,i)=>e.isCollapsed!==t&&i<n));o.push(...i)}e.toggleCollapseState(o)}function setCollapseStateLevelsUp(e,t,n,i){let o=[];for(let r of i){let i=e.getAllRegionsAtLine(r,((e,i)=>e.isCollapsed!==t&&i<=n));o.push(...i)}e.toggleCollapseState(o)}function setCollapseStateUp(e,t,n){let i=[];for(let o of n){let n=e.getAllRegionsAtLine(o,(e=>e.isCollapsed!==t));n.length>0&&i.push(n[0])}e.toggleCollapseState(i)}function setCollapseStateAtLevel(e,t,n,i){let o=e.getRegionsInside(null,((e,o)=>o===t&&e.isCollapsed!==n&&!i.some((t=>e.containsLine(t)))));e.toggleCollapseState(o)}function setCollapseStateForRest(e,t,n){let i=[];for(let r of n){const t=e.getAllRegionsAtLine(r,void 0);t.length>0&&i.push(t[0])}let o=e.getRegionsInside(null,(e=>i.every((t=>!t.containedBy(e)&&!e.containedBy(t)))&&e.isCollapsed!==t));e.toggleCollapseState(o)}function setCollapseStateForMatchingLines(e,t,n){let i=e.textModel,o=e.regions,r=[];for(let s=o.length-1;s>=0;s--)if(n!==o.isCollapsed(s)){let e=o.getStartLineNumber(s);t.test(i.getLineContent(e))&&r.push(o.toRegion(s))}e.toggleCollapseState(r)}function setCollapseStateForType(e,t,n){let i=e.regions,o=[];for(let r=i.length-1;r>=0;r--)n!==i.isCollapsed(r)&&t===i.getType(r)&&o.push(i.toRegion(r));e.toggleCollapseState(o)}function getParentFoldLine(e,t){let n=null,i=t.getRegionAtLine(e);if(null!==i&&(n=i.startLineNumber,e===n)){let e=i.parentIndex;n=-1!==e?t.regions.getStartLineNumber(e):null}return n}function getPreviousFoldLine(e,t){let n=t.getRegionAtLine(e);if(null!==n&&n.startLineNumber===e){if(e!==n.startLineNumber)return n.startLineNumber;{let e=n.parentIndex,i=0;for(-1!==e&&(i=t.regions.getStartLineNumber(n.parentIndex));null!==n;){if(!(n.regionIndex>0))return null;if(n=t.regions.toRegion(n.regionIndex-1),n.startLineNumber<=i)return null;if(n.parentIndex===e)return n.startLineNumber}}}else if(t.regions.length>0)for(n=t.regions.toRegion(t.regions.length-1);null!==n;){if(n.startLineNumber<e)return n.startLineNumber;n=n.regionIndex>0?t.regions.toRegion(n.regionIndex-1):null}return null}function getNextFoldLine(e,t){let n=t.getRegionAtLine(e);if(null!==n&&n.startLineNumber===e){let e=n.parentIndex,i=0;if(-1!==e)i=t.regions.getEndLineNumber(n.parentIndex);else{if(0===t.regions.length)return null;i=t.regions.getEndLineNumber(t.regions.length-1)}for(;null!==n;){if(!(n.regionIndex<t.regions.length))return null;if(n=t.regions.toRegion(n.regionIndex+1),n.startLineNumber>=i)return null;if(n.parentIndex===e)return n.startLineNumber}}else if(t.regions.length>0)for(n=t.regions.toRegion(0);null!==n;){if(n.startLineNumber>e)return n.startLineNumber;n=n.regionIndex<t.regions.length?t.regions.toRegion(n.regionIndex+1):null}return null}class HiddenRangeModel{constructor(e){this._updateEventEmitter=new Emitter$1,this._hasLineChanges=!1,this._foldingModel=e,this._foldingModelListener=e.onDidChange((e=>this.updateHiddenRanges())),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some((e=>e.range.endLineNumber!==e.range.startLineNumber||0!==countEOL(e.text)[0])))}updateHiddenRanges(){let e=!1,t=[],n=0,i=0,o=Number.MAX_VALUE,r=-1,s=this._foldingModel.regions;for(;n<s.length;n++){if(!s.isCollapsed(n))continue;let a=s.getStartLineNumber(n)+1,l=s.getEndLineNumber(n);o<=a&&l<=r||(!e&&i<this._hiddenRanges.length&&this._hiddenRanges[i].startLineNumber===a&&this._hiddenRanges[i].endLineNumber===l?(t.push(this._hiddenRanges[i]),i++):(e=!0,t.push(new Range$2(a,1,l,1))),o=a,r=l)}(this._hasLineChanges||e||i<this._hiddenRanges.length)&&this.applyHiddenRanges(t)}applyMemento(e){if(!Array.isArray(e)||0===e.length)return!1;let t=[];for(let n of e){if(!n.startLineNumber||!n.endLineNumber)return!1;t.push(new Range$2(n.startLineNumber+1,1,n.endLineNumber,1))}return this.applyHiddenRanges(t),!0}getMemento(){return this._hiddenRanges.map((e=>({startLineNumber:e.startLineNumber-1,endLineNumber:e.endLineNumber})))}applyHiddenRanges(e){this._hiddenRanges=e,this._hasLineChanges=!1,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return null!==findRange(this._hiddenRanges,e)}adjustSelections(e){let t=!1,n=this._foldingModel.textModel,i=null,o=e=>(i&&isInside(e,i)||(i=findRange(this._hiddenRanges,e)),i?i.startLineNumber-1:null);for(let r=0,s=e.length;r<s;r++){let i=e[r],s=o(i.startLineNumber);s&&(i=i.setStartPosition(s,n.getLineMaxColumn(s)),t=!0);let a=o(i.endLineNumber);a&&(i=i.setEndPosition(a,n.getLineMaxColumn(a)),t=!0),e[r]=i}return t}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function isInside(e,t){return e>=t.startLineNumber&&e<=t.endLineNumber}function findRange(e,t){let n=findFirstInSorted(e,(e=>t<e.startLineNumber))-1;return n>=0&&e[n].endLineNumber>=t?e[n]:null}const MAX_FOLDING_REGIONS_FOR_INDENT_DEFAULT=5e3,ID_INDENT_PROVIDER="indent";class IndentRangeProvider{constructor(e,t,n){this.editorModel=e,this.languageConfigurationService=t,this.maxFoldingRegions=n,this.id=ID_INDENT_PROVIDER}dispose(){}compute(e,t){let n=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=n&&!!n.offSide,o=n&&n.markers;return Promise.resolve(computeRanges(this.editorModel,i,o,this.maxFoldingRegions,t))}}class RangesCollector$1{constructor(e,t){this._notifyTooManyRegions=t,this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,n){if(e>MAX_LINE_NUMBER||t>MAX_LINE_NUMBER)return;let i=this._length;this._startIndexes[i]=e,this._endIndexes[i]=t,this._length++,n<1e3&&(this._indentOccurrences[n]=(this._indentOccurrences[n]||0)+1)}toIndentRanges(e){if(this._length<=this._foldingRangesLimit){let e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let n=this._length-1,i=0;n>=0;n--,i++)e[i]=this._startIndexes[n],t[i]=this._endIndexes[n];return new FoldingRegions(e,t)}{this._notifyTooManyRegions&&this._notifyTooManyRegions(this._foldingRangesLimit);let t=0,n=this._indentOccurrences.length;for(let e=0;e<this._indentOccurrences.length;e++){let i=this._indentOccurrences[e];if(i){if(i+t>this._foldingRangesLimit){n=e;break}t+=i}}const i=e.getOptions().tabSize;let o=new Uint32Array(this._foldingRangesLimit),r=new Uint32Array(this._foldingRangesLimit);for(let s=this._length-1,a=0;s>=0;s--){let l=this._startIndexes[s],c=computeIndentLevel(e.getLineContent(l),i);(c<n||c===n&&t++<this._foldingRangesLimit)&&(o[a]=l,r[a]=this._endIndexes[s],a++)}return new FoldingRegions(o,r)}}}function computeRanges(e,t,n,i,o){const r=e.getOptions().tabSize;let s,a=new RangesCollector$1(i=null!=i?i:MAX_FOLDING_REGIONS_FOR_INDENT_DEFAULT,o);n&&(s=new RegExp(`(${n.start.source})|(?:${n.end.source})`));let l=[],c=e.getLineCount()+1;l.push({indent:-1,endAbove:c,line:c});for(let d=e.getLineCount();d>0;d--){let n,i=e.getLineContent(d),o=computeIndentLevel(i,r),c=l[l.length-1];if(-1!==o){if(s&&(n=i.match(s))){if(!n[1]){l.push({indent:-2,endAbove:d,line:d});continue}{let e=l.length-1;for(;e>0&&-2!==l[e].indent;)e--;if(e>0){l.length=e+1,c=l[e],a.insertFirst(d,c.line,o),c.line=d,c.indent=o,c.endAbove=d;continue}}}if(c.indent>o){do{l.pop(),c=l[l.length-1]}while(c.indent>o);let e=c.endAbove-1;e-d>=1&&a.insertFirst(d,e,o)}c.indent===o?c.endAbove=d:l.push({indent:o,endAbove:d,line:d})}else t&&(c.endAbove=d)}return a.toIndentRanges(e)}const foldingContext={},ID_SYNTAX_PROVIDER="syntax";class SyntaxRangeProvider{constructor(e,t,n,i){this.editorModel=e,this.providers=t,this.limit=i,this.id=ID_SYNTAX_PROVIDER;for(const o of t)"function"==typeof o.onDidChange&&(this.disposables||(this.disposables=new DisposableStore),this.disposables.add(o.onDidChange(n)))}compute(e,t){return collectSyntaxRanges(this.providers,this.editorModel,e).then((e=>{if(e){return sanitizeRanges(e,this.limit,t)}return null}))}dispose(){var e;null===(e=this.disposables)||void 0===e||e.dispose()}}function collectSyntaxRanges(e,t,n){let i=null,o=e.map(((e,o)=>Promise.resolve(e.provideFoldingRanges(t,foldingContext,n)).then((e=>{if(!n.isCancellationRequested&&Array.isArray(e)){Array.isArray(i)||(i=[]);let n=t.getLineCount();for(let t of e)t.start>0&&t.end>t.start&&t.end<=n&&i.push({start:t.start,end:t.end,rank:o,kind:t.kind})}}),onUnexpectedExternalError)));return Promise.all(o).then((e=>i))}class RangesCollector{constructor(e,t){this._notifyTooManyRegions=t,this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,n,i){if(e>MAX_LINE_NUMBER||t>MAX_LINE_NUMBER)return;let o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=i,this._types[o]=n,this._length++,i<30&&(this._nestingLevelCounts[i]=(this._nestingLevelCounts[i]||0)+1)}toIndentRanges(){if(this._length<=this._foldingRangesLimit){let e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let n=0;n<this._length;n++)e[n]=this._startIndexes[n],t[n]=this._endIndexes[n];return new FoldingRegions(e,t,this._types)}{this._notifyTooManyRegions&&this._notifyTooManyRegions(this._foldingRangesLimit);let e=0,t=this._nestingLevelCounts.length;for(let r=0;r<this._nestingLevelCounts.length;r++){let n=this._nestingLevelCounts[r];if(n){if(n+e>this._foldingRangesLimit){t=r;break}e+=n}}let n=new Uint32Array(this._foldingRangesLimit),i=new Uint32Array(this._foldingRangesLimit),o=[];for(let r=0,s=0;r<this._length;r++){let a=this._nestingLevels[r];(a<t||a===t&&e++<this._foldingRangesLimit)&&(n[s]=this._startIndexes[r],i[s]=this._endIndexes[r],o[s]=this._types[r],s++)}return new FoldingRegions(n,i,o)}}}function sanitizeRanges(e,t,n){let i,o=e.sort(((e,t)=>{let n=e.start-t.start;return 0===n&&(n=e.rank-t.rank),n})),r=new RangesCollector(t,n),s=[];for(let a of o)if(i){if(a.start>i.start)if(a.end<=i.end)s.push(i),i=a,r.add(a.start,a.end,a.kind&&a.kind.value,s.length);else{if(a.start>i.end){do{i=s.pop()}while(i&&a.start>i.end);i&&s.push(i),i=a}r.add(a.start,a.end,a.kind&&a.kind.value,s.length)}}else i=a,r.add(a.start,a.end,a.kind&&a.kind.value,s.length);return r.toIndentRanges()}const ID_INIT_PROVIDER="init";class InitializingRangeProvider{constructor(e,t,n,i){if(this.editorModel=e,this.id=ID_INIT_PROVIDER,t.length){let o=t=>({range:{startLineNumber:t.startLineNumber,startColumn:0,endLineNumber:t.endLineNumber,endColumn:e.getLineLength(t.endLineNumber)},options:{description:"folding-initializing-range-provider",stickiness:1}});this.decorationIds=e.deltaDecorations([],t.map(o)),this.timeout=setTimeout(n,i)}}dispose(){this.decorationIds&&(this.editorModel.deltaDecorations(this.decorationIds,[]),this.decorationIds=void 0),"number"==typeof this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0)}compute(e){let t=[];if(this.decorationIds)for(let n of this.decorationIds){let e=this.editorModel.getDecorationRange(n);e&&t.push({start:e.startLineNumber,end:e.endLineNumber,rank:1})}return Promise.resolve(sanitizeRanges(t,Number.MAX_VALUE))}}const foldingExpandedIcon=registerIcon("folding-expanded",Codicon.chevronDown,localize("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),foldingCollapsedIcon=registerIcon("folding-collapsed",Codicon.chevronRight,localize("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin."));class FoldingDecorationProvider{constructor(e){this.editor=e,this.autoHideFoldingControls=!0,this.showFoldingHighlights=!0}getDecorationOption(e,t){return t?FoldingDecorationProvider.HIDDEN_RANGE_DECORATION:e?this.showFoldingHighlights?FoldingDecorationProvider.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:FoldingDecorationProvider.COLLAPSED_VISUAL_DECORATION:this.autoHideFoldingControls?FoldingDecorationProvider.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:FoldingDecorationProvider.EXPANDED_VISUAL_DECORATION}deltaDecorations(e,t){return this.editor.deltaDecorations(e,t)}changeDecorations(e){return this.editor.changeDecorations(e)}}FoldingDecorationProvider.COLLAPSED_VISUAL_DECORATION=ModelDecorationOptions.register({description:"folding-collapsed-visual-decoration",stickiness:1,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:ThemeIcon.asClassName(foldingCollapsedIcon)}),FoldingDecorationProvider.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=ModelDecorationOptions.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:1,afterContentClassName:"inline-folded",className:"folded-background",isWholeLine:!0,firstLineDecorationClassName:ThemeIcon.asClassName(foldingCollapsedIcon)}),FoldingDecorationProvider.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=ModelDecorationOptions.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:ThemeIcon.asClassName(foldingExpandedIcon)}),FoldingDecorationProvider.EXPANDED_VISUAL_DECORATION=ModelDecorationOptions.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+ThemeIcon.asClassName(foldingExpandedIcon)}),FoldingDecorationProvider.HIDDEN_RANGE_DECORATION=ModelDecorationOptions.register({description:"folding-hidden-range-decoration",stickiness:1});var __decorate$V=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$U=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const CONTEXT_FOLDING_ENABLED=new RawContextKey("foldingEnabled",!1);let FoldingController=class e extends Disposable{constructor(e,t,n,i,o,r){super(),this.contextKeyService=t,this.languageConfigurationService=n,this.languageFeaturesService=r,this._tooManyRegionsNotified=!1,this.localToDispose=this._register(new DisposableStore),this.editor=e;const s=this.editor.getOptions();this._isEnabled=s.get(37),this._useFoldingProviders="indentation"!==s.get(38),this._unfoldOnClickAfterEndOfLine=s.get(42),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=s.get(40),this._maxFoldingRegions=s.get(41),this.updateDebounceInfo=o.for(r.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingStateMemento=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new FoldingDecorationProvider(e),this.foldingDecorationProvider.autoHideFoldingControls="mouseover"===s.get(99),this.foldingDecorationProvider.showFoldingHighlights=s.get(39),this.foldingEnabled=CONTEXT_FOLDING_ENABLED.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._notifyTooManyRegions=e=>{this._tooManyRegionsNotified||(i.notify({severity:Severity$2.Warning,sticky:!0,message:localize("maximum fold ranges","The number of foldable regions is limited to a maximum of {0}. Increase configuration option ['Folding Maximum Regions'](command:workbench.action.openSettings?[\"editor.foldingMaximumRegions\"]) to enable more.",e)}),this._tooManyRegionsNotified=!0)},this._register(this.editor.onDidChangeModel((()=>this.onModelChanged()))),this._register(this.editor.onDidChangeConfiguration((e=>{if(e.hasChanged(37)&&(this._isEnabled=this.editor.getOptions().get(37),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),e.hasChanged(41)&&(this._maxFoldingRegions=this.editor.getOptions().get(41),this._tooManyRegionsNotified=!1,this.onModelChanged()),e.hasChanged(99)||e.hasChanged(39)){const e=this.editor.getOptions();this.foldingDecorationProvider.autoHideFoldingControls="mouseover"===e.get(99),this.foldingDecorationProvider.showFoldingHighlights=e.get(39),this.triggerFoldingModelChanged()}e.hasChanged(38)&&(this._useFoldingProviders="indentation"!==this.editor.getOptions().get(38),this.onFoldingStrategyChanged()),e.hasChanged(42)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(42)),e.hasChanged(40)&&(this._foldingImportsByDefault=this.editor.getOptions().get(40))}))),this.onModelChanged()}static get(t){return t.getContribution(e.ID)}saveViewState(){let e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){let t=this.foldingModel.isInitialized?this.foldingModel.getMemento():this.hiddenRangeModel.getMemento(),n=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:n,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){let t=this.editor.getModel();if(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)return;if(!e||e.lineCount!==t.getLineCount())return;if(this._currentModelHasFoldedImports=!!e.foldedImports,!e.collapsedRegions)return;e.provider!==ID_SYNTAX_PROVIDER&&e.provider!==ID_INIT_PROVIDER||(this.foldingStateMemento=e);const n=e.collapsedRegions;if(this.hiddenRangeModel.applyMemento(n)){const e=this.getFoldingModel();e&&e.then((e=>{if(e){this._restoringViewState=!0;try{e.applyMemento(n)}finally{this._restoringViewState=!1}}})).then(void 0,onUnexpectedError)}}onModelChanged(){this.localToDispose.clear();let e=this.editor.getModel();this._isEnabled&&e&&!e.isTooLargeForTokenization()&&(this._currentModelHasFoldedImports=!1,this.foldingModel=new FoldingModel(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new HiddenRangeModel(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange((e=>this.onHiddenRangesChanges(e)))),this.updateScheduler=new Delayer(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new RunOnceScheduler((()=>this.revealCursor()),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange((()=>this.onFoldingStrategyChanged()))),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration((()=>this.onFoldingStrategyChanged()))),this.localToDispose.add(this.editor.onDidChangeModelContent((e=>this.onDidChangeModelContent(e)))),this.localToDispose.add(this.editor.onDidChangeCursorPosition((()=>this.onCursorPositionChanged()))),this.localToDispose.add(this.editor.onMouseDown((e=>this.onEditorMouseDown(e)))),this.localToDispose.add(this.editor.onMouseUp((e=>this.onEditorMouseUp(e)))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler&&this.updateScheduler.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.foldingStateMemento=null,this.rangeProvider&&this.rangeProvider.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){this.rangeProvider&&this.rangeProvider.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;if(this.rangeProvider=new IndentRangeProvider(e,this.languageConfigurationService,this._maxFoldingRegions),this._useFoldingProviders&&this.foldingModel){let t=this.languageFeaturesService.foldingRangeProvider.ordered(this.foldingModel.textModel);if(0===t.length&&this.foldingStateMemento&&this.foldingStateMemento.collapsedRegions){return this.rangeProvider=new InitializingRangeProvider(e,this.foldingStateMemento.collapsedRegions,(()=>{this.foldingStateMemento=null,this.onFoldingStrategyChanged()}),3e4)}t.length>0&&(this.rangeProvider=new SyntaxRangeProvider(e,t,(()=>this.triggerFoldingModelChanged()),this._maxFoldingRegions))}return this.foldingStateMemento=null,this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;null===(t=this.hiddenRangeModel)||void 0===t||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger((()=>{const e=this.foldingModel;if(!e)return null;const t=new StopWatch(!0),n=this.getRangeProvider(e.textModel);let i=this.foldingRegionPromise=createCancelablePromise((e=>n.compute(e,this._notifyTooManyRegions)));return i.then((n=>{if(n&&i===this.foldingRegionPromise){let i;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const e=n.setCollapsedAllOfType(FoldingRangeKind.Imports.value,!0);e&&(i=StableEditorScrollState.capture(this.editor),this._currentModelHasFoldedImports=e)}let o=this.editor.getSelections(),r=o?o.map((e=>e.startLineNumber)):[];e.update(n,r),i&&i.restore(this.editor);const s=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=s)}return e}))})).then(void 0,(e=>(onUnexpectedError(e),null))))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){let e=this.editor.getSelections();e&&this.hiddenRangeModel.adjustSelections(e)&&this.editor.setSelections(e)}this.editor.setHiddenAreas(e)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then((e=>{if(e){let t=this.editor.getSelections();if(t&&t.length>0){let n=[];for(let i of t){let t=i.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(t)&&n.push(...e.getAllRegionsAtLine(t,(e=>e.isCollapsed&&t>e.startLineNumber)))}n.length&&(e.toggleCollapseState(n),this.reveal(t[0].getPosition()))}}})).then(void 0,onUnexpectedError)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range)return;if(!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let n=!1;switch(e.target.type){case 4:{const t=e.target.detail,i=e.target.element.offsetLeft;if(t.offsetX-i<5)return;n=!0;break}case 7:if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()){if(!e.target.detail.isAfterLines)break}return;case 6:if(this.hiddenRangeModel.hasRanges()){let e=this.editor.getModel();if(e&&t.startColumn===e.getLineMaxColumn(t.startLineNumber))break}return;default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:n}}onEditorMouseUp(e){const t=this.getFoldingModel();if(!t||!this.mouseDownInfo||!e.target)return;let n=this.mouseDownInfo.lineNumber,i=this.mouseDownInfo.iconClicked,o=e.target.range;if(o&&o.startLineNumber===n){if(i){if(4!==e.target.type)return}else{let e=this.editor.getModel();if(!e||o.startColumn!==e.getLineMaxColumn(n))return}t.then((t=>{if(t){let o=t.getRegionAtLine(n);if(o&&o.startLineNumber===n){let r=o.isCollapsed;if(i||r){let i=[];if(e.event.altKey){let e=e=>!e.containedBy(o)&&!o.containedBy(e),n=t.getRegionsInside(null,e);for(const t of n)t.isCollapsed&&i.push(t);0===i.length&&(i=n)}else{let n=e.event.middleButton||e.event.shiftKey;if(n)for(const e of t.getRegionsInside(o))e.isCollapsed===r&&i.push(e);!r&&n&&0!==i.length||i.push(o)}t.toggleCollapseState(i),this.reveal({lineNumber:n,column:1})}}}})).then(void 0,onUnexpectedError)}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};FoldingController.ID="editor.contrib.folding",FoldingController=__decorate$V([__param$U(1,IContextKeyService),__param$U(2,ILanguageConfigurationService),__param$U(3,INotificationService),__param$U(4,ILanguageFeatureDebounceService),__param$U(5,ILanguageFeaturesService)],FoldingController);class FoldingAction extends EditorAction{runEditorCommand(e,t,n){const i=e.get(ILanguageConfigurationService),o=FoldingController.get(t);if(!o)return;const r=o.getFoldingModel();return r?(this.reportTelemetry(e,t),r.then((e=>{if(e){this.invoke(o,e,t,n,i);const r=t.getSelection();r&&o.reveal(r.getStartPosition())}}))):void 0}getSelectedLines(e){let t=e.getSelections();return t?t.map((e=>e.startLineNumber)):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map((e=>e+1)):this.getSelectedLines(t)}run(e,t){}}function foldingArgumentsConstraint(e){if(!isUndefined(e)){if(!isObject(e))return!1;const t=e;if(!isUndefined(t.levels)&&!isNumber$1(t.levels))return!1;if(!isUndefined(t.direction)&&!isString$1(t.direction))return!1;if(!(isUndefined(t.selectionLines)||isArray(t.selectionLines)&&t.selectionLines.every(isNumber$1)))return!1}return!0}class UnfoldAction extends FoldingAction{constructor(){super({id:"editor.unfold",label:localize("unfoldAction.label","Unfold"),alias:"Unfold",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3161,mac:{primary:2649},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t* 'levels': Number of levels to unfold. If not set, defaults to 1.\n\t\t\t\t\t\t* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.\n\t\t\t\t\t\t* 'selectionLines': The start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used.\n\t\t\t\t\t\t",constraint:foldingArgumentsConstraint,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,n,i){let o=i&&i.levels||1,r=this.getLineNumbers(i,n);i&&"up"===i.direction?setCollapseStateLevelsUp(t,!1,o,r):setCollapseStateLevelsDown(t,!1,o,r)}}class UnFoldRecursivelyAction extends FoldingAction{constructor(){super({id:"editor.unfoldRecursively",label:localize("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2137),weight:100}})}invoke(e,t,n,i){setCollapseStateLevelsDown(t,!1,Number.MAX_VALUE,this.getSelectedLines(n))}}class FoldAction extends FoldingAction{constructor(){super({id:"editor.fold",label:localize("foldAction.label","Fold"),alias:"Fold",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3159,mac:{primary:2647},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t\t* 'levels': Number of levels to fold.\n\t\t\t\t\t\t\t* 'direction': If 'up', folds given number of levels up otherwise folds down.\n\t\t\t\t\t\t\t* 'selectionLines': The start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used.\n\t\t\t\t\t\t\tIf no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.\n\t\t\t\t\t\t",constraint:foldingArgumentsConstraint,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,n,i){let o=this.getLineNumbers(i,n);const r=i&&i.levels,s=i&&i.direction;"number"!=typeof r&&"string"!=typeof s?setCollapseStateUp(t,!0,o):"up"===s?setCollapseStateLevelsUp(t,!0,r||1,o):setCollapseStateLevelsDown(t,!0,r||1,o)}}class ToggleFoldAction extends FoldingAction{constructor(){super({id:"editor.toggleFold",label:localize("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2090),weight:100}})}invoke(e,t,n){toggleCollapseState(t,1,this.getSelectedLines(n))}}class FoldRecursivelyAction extends FoldingAction{constructor(){super({id:"editor.foldRecursively",label:localize("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2135),weight:100}})}invoke(e,t,n){let i=this.getSelectedLines(n);setCollapseStateLevelsDown(t,!0,Number.MAX_VALUE,i)}}class FoldAllBlockCommentsAction extends FoldingAction{constructor(){super({id:"editor.foldAllBlockComments",label:localize("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2133),weight:100}})}invoke(e,t,n,i,o){if(t.regions.hasTypes())setCollapseStateForType(t,FoldingRangeKind.Comment.value,!0);else{const e=n.getModel();if(!e)return;const i=o.getLanguageConfiguration(e.getLanguageId()).comments;if(i&&i.blockCommentStartToken){setCollapseStateForMatchingLines(t,new RegExp("^\\s*"+escapeRegExpCharacters(i.blockCommentStartToken)),!0)}}}}class FoldAllRegionsAction extends FoldingAction{constructor(){super({id:"editor.foldAllMarkerRegions",label:localize("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2077),weight:100}})}invoke(e,t,n,i,o){if(t.regions.hasTypes())setCollapseStateForType(t,FoldingRangeKind.Region.value,!0);else{const e=n.getModel();if(!e)return;const i=o.getLanguageConfiguration(e.getLanguageId()).foldingRules;if(i&&i.markers&&i.markers.start){setCollapseStateForMatchingLines(t,new RegExp(i.markers.start),!0)}}}}class UnfoldAllRegionsAction extends FoldingAction{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:localize("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2078),weight:100}})}invoke(e,t,n,i,o){if(t.regions.hasTypes())setCollapseStateForType(t,FoldingRangeKind.Region.value,!1);else{const e=n.getModel();if(!e)return;const i=o.getLanguageConfiguration(e.getLanguageId()).foldingRules;if(i&&i.markers&&i.markers.start){setCollapseStateForMatchingLines(t,new RegExp(i.markers.start),!1)}}}}class FoldAllRegionsExceptAction extends FoldingAction{constructor(){super({id:"editor.foldAllExcept",label:localize("foldAllExcept.label","Fold All Regions Except Selected"),alias:"Fold All Regions Except Selected",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2131),weight:100}})}invoke(e,t,n){setCollapseStateForRest(t,!0,this.getSelectedLines(n))}}class UnfoldAllRegionsExceptAction extends FoldingAction{constructor(){super({id:"editor.unfoldAllExcept",label:localize("unfoldAllExcept.label","Unfold All Regions Except Selected"),alias:"Unfold All Regions Except Selected",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2129),weight:100}})}invoke(e,t,n){setCollapseStateForRest(t,!1,this.getSelectedLines(n))}}class FoldAllAction extends FoldingAction{constructor(){super({id:"editor.foldAll",label:localize("foldAllAction.label","Fold All"),alias:"Fold All",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2069),weight:100}})}invoke(e,t,n){setCollapseStateLevelsDown(t,!0)}}class UnfoldAllAction extends FoldingAction{constructor(){super({id:"editor.unfoldAll",label:localize("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2088),weight:100}})}invoke(e,t,n){setCollapseStateLevelsDown(t,!1)}}class FoldLevelAction extends FoldingAction{getFoldingLevel(){return parseInt(this.id.substr(FoldLevelAction.ID_PREFIX.length))}invoke(e,t,n){setCollapseStateAtLevel(t,this.getFoldingLevel(),!0,this.getSelectedLines(n))}}FoldLevelAction.ID_PREFIX="editor.foldLevel",FoldLevelAction.ID=e=>FoldLevelAction.ID_PREFIX+e;class GotoParentFoldAction extends FoldingAction{constructor(){super({id:"editor.gotoParentFold",label:localize("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,weight:100}})}invoke(e,t,n){let i=this.getSelectedLines(n);if(i.length>0){let e=getParentFoldLine(i[0],t);null!==e&&n.setSelection({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1})}}}class GotoPreviousFoldAction extends FoldingAction{constructor(){super({id:"editor.gotoPreviousFold",label:localize("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,weight:100}})}invoke(e,t,n){let i=this.getSelectedLines(n);if(i.length>0){let e=getPreviousFoldLine(i[0],t);null!==e&&n.setSelection({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1})}}}class GotoNextFoldAction extends FoldingAction{constructor(){super({id:"editor.gotoNextFold",label:localize("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,weight:100}})}invoke(e,t,n){let i=this.getSelectedLines(n);if(i.length>0){let e=getNextFoldLine(i[0],t);null!==e&&n.setSelection({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1})}}}registerEditorContribution(FoldingController.ID,FoldingController),registerEditorAction(UnfoldAction),registerEditorAction(UnFoldRecursivelyAction),registerEditorAction(FoldAction),registerEditorAction(FoldRecursivelyAction),registerEditorAction(FoldAllAction),registerEditorAction(UnfoldAllAction),registerEditorAction(FoldAllBlockCommentsAction),registerEditorAction(FoldAllRegionsAction),registerEditorAction(UnfoldAllRegionsAction),registerEditorAction(FoldAllRegionsExceptAction),registerEditorAction(UnfoldAllRegionsExceptAction),registerEditorAction(ToggleFoldAction),registerEditorAction(GotoParentFoldAction),registerEditorAction(GotoPreviousFoldAction),registerEditorAction(GotoNextFoldAction);for(let C=1;C<=7;C++)registerInstantiatedEditorAction(new FoldLevelAction({id:FoldLevelAction.ID(C),label:localize("foldLevelAction.label","Fold Level {0}",C),alias:`Fold Level ${C}`,precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2048|21+C),weight:100}}));const foldBackgroundBackground=registerColor("editor.foldBackground",{light:transparent(editorSelectionBackground,.3),dark:transparent(editorSelectionBackground,.3),hc:null},localize("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0),editorFoldForeground=registerColor("editorGutter.foldingControlForeground",{dark:iconForeground,light:iconForeground,hc:iconForeground},localize("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));registerThemingParticipant(((e,t)=>{const n=e.getColor(foldBackgroundBackground);n&&t.addRule(`.monaco-editor .folded-background { background-color: ${n}; }`);const i=e.getColor(editorFoldForeground);i&&t.addRule(`\n\t\t.monaco-editor .cldr${ThemeIcon.asCSSSelector(foldingExpandedIcon)},\n\t\t.monaco-editor .cldr${ThemeIcon.asCSSSelector(foldingCollapsedIcon)} {\n\t\t\tcolor: ${i} !important;\n\t\t}\n\t\t`)}));class EditorFontZoomIn extends EditorAction{constructor(){super({id:"editor.action.fontZoomIn",label:localize("EditorFontZoomIn.label","Editor Font Zoom In"),alias:"Editor Font Zoom In",precondition:void 0})}run(e,t){EditorZoom.setZoomLevel(EditorZoom.getZoomLevel()+1)}}class EditorFontZoomOut extends EditorAction{constructor(){super({id:"editor.action.fontZoomOut",label:localize("EditorFontZoomOut.label","Editor Font Zoom Out"),alias:"Editor Font Zoom Out",precondition:void 0})}run(e,t){EditorZoom.setZoomLevel(EditorZoom.getZoomLevel()-1)}}class EditorFontZoomReset extends EditorAction{constructor(){super({id:"editor.action.fontZoomReset",label:localize("EditorFontZoomReset.label","Editor Font Zoom Reset"),alias:"Editor Font Zoom Reset",precondition:void 0})}run(e,t){EditorZoom.setZoomLevel(0)}}registerEditorAction(EditorFontZoomIn),registerEditorAction(EditorFontZoomOut),registerEditorAction(EditorFontZoomReset);class FormattingEdit{static _handleEolEdits(e,t){let n,i=[];for(let o of t)"number"==typeof o.eol&&(n=o.eol),o.range&&"string"==typeof o.text&&i.push(o);return"number"==typeof n&&e.hasModel()&&e.getModel().pushEOL(n),i}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const n=e.getModel(),i=n.validateRange(t.range);return n.getFullModelRange().equalsRange(i)}static execute(e,t,n){n&&e.pushUndoStop();const i=FormattingEdit._handleEolEdits(e,t);1===i.length&&FormattingEdit._isFullModelReplaceEdit(e,i[0])?e.executeEdits("formatEditsCommand",i.map((e=>EditOperation.replace(Range$2.lift(e.range),e.text)))):e.executeEdits("formatEditsCommand",i.map((e=>EditOperation.replaceMove(Range$2.lift(e.range),e.text)))),n&&e.pushUndoStop()}}class ExtensionIdentifier{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return"string"==typeof e?e.toLowerCase():e._lower}}var __awaiter$z=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};function alertFormattingEdits(e){if(!(e=e.filter((e=>e.range))).length)return;let{range:t}=e[0];for(let o=1;o<e.length;o++)t=Range$2.plusRange(t,e[o].range);const{startLineNumber:n,endLineNumber:i}=t;n===i?1===e.length?alert(localize("hint11","Made 1 formatting edit on line {0}",n)):alert(localize("hintn1","Made {0} formatting edits on line {1}",e.length,n)):1===e.length?alert(localize("hint1n","Made 1 formatting edit between lines {0} and {1}",n,i)):alert(localize("hintnn","Made {0} formatting edits between lines {1} and {2}",e.length,n,i))}function getRealAndSyntheticDocumentFormattersOrdered(e,t,n){const i=[],o=new Set,r=e.ordered(n);for(const a of r)i.push(a),a.extensionId&&o.add(ExtensionIdentifier.toKey(a.extensionId));const s=t.ordered(n);for(const a of s){if(a.extensionId){if(o.has(ExtensionIdentifier.toKey(a.extensionId)))continue;o.add(ExtensionIdentifier.toKey(a.extensionId))}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits:(e,t,n)=>a.provideDocumentRangeFormattingEdits(e,e.getFullModelRange(),t,n)})}return i}class FormattingConflicts{static setFormatterSelector(e){return{dispose:FormattingConflicts._selectors.unshift(e)}}static select(e,t,n){return __awaiter$z(this,void 0,void 0,(function*(){if(0===e.length)return;const i=Iterable.first(FormattingConflicts._selectors);return i?yield i(e,t,n):void 0}))}}function formatDocumentRangesWithSelectedProvider(e,t,n,i,o,r){return __awaiter$z(this,void 0,void 0,(function*(){const s=e.get(IInstantiationService),{documentRangeFormattingEditProvider:a}=e.get(ILanguageFeaturesService),l=isCodeEditor(t)?t.getModel():t,c=a.ordered(l),d=yield FormattingConflicts.select(c,l,i);d&&(o.report(d),yield s.invokeFunction(formatDocumentRangesWithProvider,d,t,n,r))}))}function formatDocumentRangesWithProvider(e,t,n,i,o){return __awaiter$z(this,void 0,void 0,(function*(){const r=e.get(IEditorWorkerService);let s,a;isCodeEditor(n)?(s=n.getModel(),a=new EditorStateCancellationTokenSource(n,5,void 0,o)):(s=n,a=new TextModelCancellationTokenSource(n,o));let l=[],c=0;for(let e of asArray(i).sort(Range$2.compareRangesUsingStarts))c>0&&Range$2.areIntersectingOrTouching(l[c-1],e)?l[c-1]=Range$2.fromPositions(l[c-1].getStartPosition(),e.getEndPosition()):c=l.push(e);const d=e=>__awaiter$z(this,void 0,void 0,(function*(){return(yield t.provideDocumentRangeFormattingEdits(s,e,s.getFormattingOptions(),a.token))||[]})),u=(e,t)=>{if(!e.length||!t.length)return!1;const n=e.reduce(((e,t)=>Range$2.plusRange(e,t.range)),e[0].range);if(!t.some((e=>Range$2.intersectRanges(n,e.range))))return!1;for(let i of e)for(let e of t)if(Range$2.intersectRanges(i.range,e.range))return!0;return!1},h=[],g=[];try{for(let e of l){if(a.token.isCancellationRequested)return!0;g.push(yield d(e))}for(let e=0;e<l.length;++e)for(let t=e+1;t<l.length;++t){if(a.token.isCancellationRequested)return!0;if(u(g[e],g[t])){const n=Range$2.plusRange(l[e],l[t]),i=yield d(n);l.splice(t,1),l.splice(e,1),l.push(n),g.splice(t,1),g.splice(e,1),g.push(i),e=0,t=0}}for(let e of g){if(a.token.isCancellationRequested)return!0;const t=yield r.computeMoreMinimalEdits(s.uri,e);t&&h.push(...t)}}finally{a.dispose()}if(0===h.length)return!1;if(isCodeEditor(n))FormattingEdit.execute(n,h,!0),alertFormattingEdits(h),n.revealPositionInCenterIfOutsideViewport(n.getPosition(),1);else{const[{range:e}]=h,t=new Selection$1(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn);s.pushEditOperations([t],h.map((e=>({text:e.text,range:Range$2.lift(e.range),forceMoveMarkers:!0}))),(e=>{for(const{range:n}of e)if(Range$2.areIntersectingOrTouching(n,t))return[new Selection$1(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn)];return null}))}return!0}))}function formatDocumentWithSelectedProvider(e,t,n,i,o){return __awaiter$z(this,void 0,void 0,(function*(){const r=e.get(IInstantiationService),s=e.get(ILanguageFeaturesService),a=isCodeEditor(t)?t.getModel():t,l=getRealAndSyntheticDocumentFormattersOrdered(s.documentFormattingEditProvider,s.documentRangeFormattingEditProvider,a),c=yield FormattingConflicts.select(l,a,n);c&&(i.report(c),yield r.invokeFunction(formatDocumentWithProvider,c,t,n,o))}))}function formatDocumentWithProvider(e,t,n,i,o){return __awaiter$z(this,void 0,void 0,(function*(){const r=e.get(IEditorWorkerService);let s,a,l;isCodeEditor(n)?(s=n.getModel(),a=new EditorStateCancellationTokenSource(n,5,void 0,o)):(s=n,a=new TextModelCancellationTokenSource(n,o));try{const e=yield t.provideDocumentFormattingEdits(s,s.getFormattingOptions(),a.token);if(l=yield r.computeMoreMinimalEdits(s.uri,e),a.token.isCancellationRequested)return!0}finally{a.dispose()}if(!l||0===l.length)return!1;if(isCodeEditor(n))FormattingEdit.execute(n,l,2!==i),2!==i&&(alertFormattingEdits(l),n.revealPositionInCenterIfOutsideViewport(n.getPosition(),1));else{const[{range:e}]=l,t=new Selection$1(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn);s.pushEditOperations([t],l.map((e=>({text:e.text,range:Range$2.lift(e.range),forceMoveMarkers:!0}))),(e=>{for(const{range:n}of e)if(Range$2.areIntersectingOrTouching(n,t))return[new Selection$1(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn)];return null}))}return!0}))}function getDocumentRangeFormattingEditsUntilResult(e,t,n,i,o,r){return __awaiter$z(this,void 0,void 0,(function*(){const s=t.documentRangeFormattingEditProvider.ordered(n);for(const t of s){let s=yield Promise.resolve(t.provideDocumentRangeFormattingEdits(n,i,o,r)).catch(onUnexpectedExternalError);if(isNonEmptyArray(s))return yield e.computeMoreMinimalEdits(n.uri,s)}}))}function getDocumentFormattingEditsUntilResult(e,t,n,i,o){return __awaiter$z(this,void 0,void 0,(function*(){const r=getRealAndSyntheticDocumentFormattersOrdered(t.documentFormattingEditProvider,t.documentRangeFormattingEditProvider,n);for(const t of r){let r=yield Promise.resolve(t.provideDocumentFormattingEdits(n,i,o)).catch(onUnexpectedExternalError);if(isNonEmptyArray(r))return yield e.computeMoreMinimalEdits(n.uri,r)}}))}function getOnTypeFormattingEdits(e,t,n,i,o,r,s){const a=t.onTypeFormattingEditProvider.ordered(n);return 0===a.length||a[0].autoFormatTriggerCharacters.indexOf(o)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(n,i,o,r,s)).catch(onUnexpectedExternalError).then((t=>e.computeMoreMinimalEdits(n.uri,t)))}FormattingConflicts._selectors=new LinkedList,CommandsRegistry.registerCommand("_executeFormatRangeProvider",(function(e,...t){return __awaiter$z(this,void 0,void 0,(function*(){const[n,i,o]=t;assertType(URI.isUri(n)),assertType(Range$2.isIRange(i));const r=e.get(ITextModelService),s=e.get(IEditorWorkerService),a=e.get(ILanguageFeaturesService),l=yield r.createModelReference(n);try{return getDocumentRangeFormattingEditsUntilResult(s,a,l.object.textEditorModel,Range$2.lift(i),o,CancellationToken.None)}finally{l.dispose()}}))})),CommandsRegistry.registerCommand("_executeFormatDocumentProvider",(function(e,...t){return __awaiter$z(this,void 0,void 0,(function*(){const[n,i]=t;assertType(URI.isUri(n));const o=e.get(ITextModelService),r=e.get(IEditorWorkerService),s=e.get(ILanguageFeaturesService),a=yield o.createModelReference(n);try{return getDocumentFormattingEditsUntilResult(r,s,a.object.textEditorModel,i,CancellationToken.None)}finally{a.dispose()}}))})),CommandsRegistry.registerCommand("_executeFormatOnTypeProvider",(function(e,...t){return __awaiter$z(this,void 0,void 0,(function*(){const[n,i,o,r]=t;assertType(URI.isUri(n)),assertType(Position$1.isIPosition(i)),assertType("string"==typeof o);const s=e.get(ITextModelService),a=e.get(IEditorWorkerService),l=e.get(ILanguageFeaturesService),c=yield s.createModelReference(n);try{return getOnTypeFormattingEdits(a,l,c.object.textEditorModel,Position$1.lift(i),o,r,CancellationToken.None)}finally{c.dispose()}}))}));var __decorate$U=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$T=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$y=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};let FormatOnType=class{constructor(e,t,n){this._editor=e,this._languageFeaturesService=t,this._workerService=n,this._disposables=new DisposableStore,this._sessionDisposables=new DisposableStore,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel((()=>this._update()))),this._disposables.add(e.onDidChangeModelLanguage((()=>this._update()))),this._disposables.add(e.onDidChangeConfiguration((e=>{e.hasChanged(49)&&this._update()})))}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(49))return;if(!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;let n=new CharacterSet;for(let i of t.autoFormatTriggerCharacters)n.add(i.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType((e=>{let t=e.charCodeAt(e.length-1);n.has(t)&&this._trigger(String.fromCharCode(t))})))}_trigger(e){if(!this._editor.hasModel())return;if(this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),n=this._editor.getPosition(),i=new CancellationTokenSource$1,o=this._editor.onDidChangeModelContent((e=>{if(e.isFlush)return i.cancel(),void o.dispose();for(let t=0,r=e.changes.length;t<r;t++){if(e.changes[t].range.endLineNumber<=n.lineNumber)return i.cancel(),void o.dispose()}}));getOnTypeFormattingEdits(this._workerService,this._languageFeaturesService,t,n,e,t.getFormattingOptions(),i.token).then((e=>{i.token.isCancellationRequested||isNonEmptyArray(e)&&(FormattingEdit.execute(this._editor,e,!0),alertFormattingEdits(e))})).finally((()=>{o.dispose()}))}};FormatOnType.ID="editor.contrib.autoFormat",FormatOnType=__decorate$U([__param$T(1,ILanguageFeaturesService),__param$T(2,IEditorWorkerService)],FormatOnType);let FormatOnPaste=class{constructor(e,t,n){this.editor=e,this._languageFeaturesService=t,this._instantiationService=n,this._callOnDispose=new DisposableStore,this._callOnModel=new DisposableStore,this._callOnDispose.add(e.onDidChangeConfiguration((()=>this._update()))),this._callOnDispose.add(e.onDidChangeModel((()=>this._update()))),this._callOnDispose.add(e.onDidChangeModelLanguage((()=>this._update()))),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(48)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste((({range:e})=>this._trigger(e))))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(formatDocumentRangesWithSelectedProvider,this.editor,e,2,Progress.None,CancellationToken.None).catch(onUnexpectedError))}};FormatOnPaste.ID="editor.contrib.formatOnPaste",FormatOnPaste=__decorate$U([__param$T(1,ILanguageFeaturesService),__param$T(2,IInstantiationService)],FormatOnPaste);class FormatDocumentAction extends EditorAction{constructor(){super({id:"editor.action.formatDocument",label:localize("formatDocument.label","Format Document"),alias:"Format Document",precondition:ContextKeyExpr.and(EditorContextKeys.notInCompositeEditor,EditorContextKeys.writable,EditorContextKeys.hasDocumentFormattingProvider),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,t){return __awaiter$y(this,void 0,void 0,(function*(){if(t.hasModel()){const n=e.get(IInstantiationService),i=e.get(IEditorProgressService);yield i.showWhile(n.invokeFunction(formatDocumentWithSelectedProvider,t,1,Progress.None,CancellationToken.None),250)}}))}}class FormatSelectionAction extends EditorAction{constructor(){super({id:"editor.action.formatSelection",label:localize("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2084),weight:100},contextMenuOpts:{when:EditorContextKeys.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,t){return __awaiter$y(this,void 0,void 0,(function*(){if(!t.hasModel())return;const n=e.get(IInstantiationService),i=t.getModel(),o=t.getSelections().map((e=>e.isEmpty()?new Range$2(e.startLineNumber,1,e.startLineNumber,i.getLineMaxColumn(e.startLineNumber)):e)),r=e.get(IEditorProgressService);yield r.showWhile(n.invokeFunction(formatDocumentRangesWithSelectedProvider,t,o,1,Progress.None,CancellationToken.None),250)}))}}registerEditorContribution(FormatOnType.ID,FormatOnType),registerEditorContribution(FormatOnPaste.ID,FormatOnPaste),registerEditorAction(FormatDocumentAction),registerEditorAction(FormatSelectionAction),CommandsRegistry.registerCommand("editor.action.format",(e=>__awaiter$y(void 0,void 0,void 0,(function*(){const t=e.get(ICodeEditorService).getFocusedCodeEditor();if(!t||!t.hasModel())return;const n=e.get(ICommandService);t.getSelection().isEmpty()?yield n.executeCommand("editor.action.formatDocument"):yield n.executeCommand("editor.action.formatSelection")}))));var __decorate$T=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$S=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$x=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class TreeElement{remove(){this.parent&&this.parent.children.delete(this.id)}static findId(e,t){let n;"string"==typeof e?n=`${t.id}/${e}`:(n=`${t.id}/${e.name}`,void 0!==t.children.get(n)&&(n=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let i=n;for(let o=0;void 0!==t.children.get(i);o++)i=`${n}_${o}`;return i}static empty(e){return 0===e.children.size}}class OutlineElement extends TreeElement{constructor(e,t,n){super(),this.id=e,this.parent=t,this.symbol=n,this.children=new Map}}class OutlineGroup extends TreeElement{constructor(e,t,n,i){super(),this.id=e,this.parent=t,this.label=n,this.order=i,this.children=new Map}}class OutlineModel extends TreeElement{constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}static create(e,t,n){const i=new CancellationTokenSource$1(n),o=new OutlineModel(t.uri),r=e.ordered(t),s=r.map(((e,n)=>{var r;let s=TreeElement.findId(`provider_${n}`,o),a=new OutlineGroup(s,o,null!==(r=e.displayName)&&void 0!==r?r:"Unknown Outline Provider",n);return Promise.resolve(e.provideDocumentSymbols(t,i.token)).then((e=>{for(const t of e||[])OutlineModel._makeOutlineElement(t,a);return a}),(e=>(onUnexpectedExternalError(e),a))).then((e=>{TreeElement.empty(e)?e.remove():o._groups.set(s,e)}))})),a=e.onDidChange((()=>{equals$1(e.ordered(t),r)||i.cancel()}));return Promise.all(s).then((()=>i.token.isCancellationRequested&&!n.isCancellationRequested?OutlineModel.create(e,t,n):o._compact())).finally((()=>{a.dispose()}))}static _makeOutlineElement(e,t){let n=TreeElement.findId(e,t),i=new OutlineElement(n,t,e);if(e.children)for(const o of e.children)OutlineModel._makeOutlineElement(o,i);t.children.set(i.id,i)}_compact(){let e=0;for(const[t,n]of this._groups)0===n.children.size?this._groups.delete(t):e+=1;if(1!==e)this.children=this._groups;else{let e=Iterable.first(this._groups.values());for(let[,t]of e.children)t.parent=this,this.children.set(t.id,t)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof OutlineElement?e.push(t.symbol):e.push(...Iterable.map(t.children.values(),(e=>e.symbol)));return e.sort(((e,t)=>Range$2.compareRangesUsingStarts(e.range,t.range)))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return OutlineModel._flattenDocumentSymbols(t,e,""),t.sort(((e,t)=>Position$1.compare(Range$2.getStartPosition(e.range),Range$2.getStartPosition(t.range))||Position$1.compare(Range$2.getEndPosition(t.range),Range$2.getEndPosition(e.range))))}static _flattenDocumentSymbols(e,t,n){for(const i of t)e.push({kind:i.kind,tags:i.tags,name:i.name,detail:i.detail,containerName:i.containerName||n,range:i.range,selectionRange:i.selectionRange,children:void 0}),i.children&&OutlineModel._flattenDocumentSymbols(e,i.children,i.name)}}const IOutlineModelService=createDecorator("IOutlineModelService");let OutlineModelService=class{constructor(e,t,n){this._languageFeaturesService=e,this._disposables=new DisposableStore,this._cache=new LRUCache(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(n.onModelRemoved((e=>{this._cache.delete(e.id)})))}dispose(){this._disposables.dispose()}getOrCreate(e,t){return __awaiter$x(this,void 0,void 0,(function*(){const n=this._languageFeaturesService.documentSymbolProvider,i=n.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!equals$1(o.provider,i)){let t=new CancellationTokenSource$1;o={versionId:e.getVersionId(),provider:i,promiseCnt:0,source:t,promise:OutlineModel.create(n,e,t.token),model:void 0},this._cache.set(e.id,o);const r=Date.now();o.promise.then((t=>{o.model=t,this._debounceInformation.update(e,Date.now()-r)})).catch((t=>{this._cache.delete(e.id)}))}if(o.model)return o.model;o.promiseCnt+=1;const r=t.onCancellationRequested((()=>{0==--o.promiseCnt&&(o.source.cancel(),this._cache.delete(e.id))}));try{return yield o.promise}finally{r.dispose()}}))}};OutlineModelService=__decorate$T([__param$S(0,ILanguageFeaturesService),__param$S(1,ILanguageFeatureDebounceService),__param$S(2,IModelService)],OutlineModelService),registerSingleton(IOutlineModelService,OutlineModelService,!0);var __awaiter$w=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};CommandsRegistry.registerCommand("_executeDocumentSymbolProvider",(function(e,...t){return __awaiter$w(this,void 0,void 0,(function*(){const[n]=t;assertType(URI.isUri(n));const i=e.get(IOutlineModelService),o=e.get(ITextModelService),r=yield o.createModelReference(n);try{return(yield i.getOrCreate(r.object.textEditorModel,CancellationToken.None)).getTopLevelSymbols()}finally{r.dispose()}}))}));const inlineSuggestCommitId="editor.action.inlineSuggest.commit";class GhostText{constructor(e,t,n=0){this.lineNumber=e,this.parts=t,this.additionalReservedLineCount=n}renderForScreenReader(e){if(0===this.parts.length)return"";const t=this.parts[this.parts.length-1];return applyEdits(e.substr(0,t.column-1),this.parts.map((e=>({range:{startLineNumber:1,endLineNumber:1,startColumn:e.column,endColumn:e.column},text:e.lines.join("\n")})))).substring(this.parts[0].column-1)}}class PositionOffsetTransformer{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;t<e.length;t++)"\n"===e.charAt(t)&&this.lineStartOffsetByLineIdx.push(t+1)}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}}function applyEdits(e,t){const n=new PositionOffsetTransformer(e),i=t.map((e=>{const t=Range$2.lift(e.range);return{startOffset:n.getOffset(t.getStartPosition()),endOffset:n.getOffset(t.getEndPosition()),text:e.text}}));i.sort(((e,t)=>t.startOffset-e.startOffset));for(const o of i)e=e.substring(0,o.startOffset)+o.text+e.substring(o.endOffset);return e}class GhostTextPart{constructor(e,t,n){this.column=e,this.lines=t,this.preview=n}}class BaseGhostTextWidgetModel extends Disposable{constructor(e){super(),this.editor=e,this._expanded=void 0,this.onDidChangeEmitter=new Emitter$1,this.onDidChange=this.onDidChangeEmitter.event,this._register(e.onDidChangeConfiguration((e=>{e.hasChanged(106)&&void 0===this._expanded&&this.onDidChangeEmitter.fire()})))}setExpanded(e){this._expanded=!0,this.onDidChangeEmitter.fire()}}function normalizedInlineCompletionsEquals(e,t){return e===t||!(!e||!t)&&(e.range.equalsRange(t.range)&&e.text===t.text&&e.command===t.command)}function inlineCompletionToGhostText(e,t,n,i,o=0){if(e.range.startLineNumber!==e.range.endLineNumber)return;const r=t.getLineContent(e.range.startLineNumber),s=getLeadingWhitespace(r).length;if(e.range.startColumn-1<=s){const t=getLeadingWhitespace(e.text).length,n=r.substring(e.range.startColumn-1,s),i=Range$2.fromPositions(e.range.getStartPosition().delta(0,n.length),e.range.getEndPosition()),o=e.text.startsWith(n)?e.text.substring(n.length):e.text.substring(t);e={range:i,text:o,command:e.command}}const a=t.getValueInRange(e.range),l=cachingDiff(a,e.text);if(!l)return;const c=e.range.startLineNumber,d=new Array;if("prefix"===n){const e=l.filter((e=>0===e.originalLength));if(e.length>1||1===e.length&&e[0].originalStart!==a.length)return}const u=e.text.length-o;for(const h of l){const t=e.range.startColumn+h.originalStart+h.originalLength;if("subwordSmart"===n&&i&&i.lineNumber===e.range.startLineNumber&&t<i.column)return;if(h.originalLength>0)return;if(0===h.modifiedLength)continue;const o=h.modifiedStart+h.modifiedLength,r=Math.max(h.modifiedStart,Math.min(o,u)),s=e.text.substring(h.modifiedStart,r),a=e.text.substring(r,Math.max(h.modifiedStart,o));if(s.length>0){const e=splitLines(s);d.push(new GhostTextPart(t,e,!1))}if(a.length>0){const e=splitLines(a);d.push(new GhostTextPart(t,e,!0))}}return new GhostText(c,d,0)}let lastRequest;function cachingDiff(e,t){if((null==lastRequest?void 0:lastRequest.originalValue)===e&&(null==lastRequest?void 0:lastRequest.newValue)===t)return null==lastRequest?void 0:lastRequest.changes;{const n=smartDiff(e,t);return lastRequest={originalValue:e,newValue:t,changes:n},n}}function smartDiff(e,t){if(e.length>5e3||t.length>5e3)return;function n(e){let t=0;for(let n=0,i=e.length;n<i;n++){const i=e.charCodeAt(n);i>t&&(t=i)}return t}const i=Math.max(n(e),n(t));function o(e){if(e<0)throw new Error("unexpected");return i+e+1}function r(e){let t=0,n=0;const i=new Int32Array(e.length);for(let r=0,s=e.length;r<s;r++){const s=100*n+t;"("===e[r]?(i[r]=o(2*s),t++):")"===e[r]?(i[r]=o(2*s+1),1===t&&n++,t=Math.max(t-1,0)):i[r]=e.charCodeAt(r)}return i}const s=r(e),a=r(t);return new LcsDiff({getElements:()=>s},{getElements:()=>a}).ComputeDiff(!1).changes}function fixBracketsInLine(e,t){const n=new DenseKeyProvider,i=new LanguageAgnosticBracketTokens(n,(e=>t.getLanguageConfiguration(e))),o=parseDocument(new TextBufferTokenizer(new StaticTokenizerSource([e]),i),[],void 0,!0);let r="";const s=e.getLineContent();return function e(t,n){if(2===t.kind)if(e(t.openingBracket,n),n=lengthAdd(n,t.openingBracket.length),t.child&&(e(t.child,n),n=lengthAdd(n,t.child.length)),t.closingBracket)e(t.closingBracket,n),n=lengthAdd(n,t.closingBracket.length);else{const e=i.getSingleLanguageBracketTokens(t.openingBracket.languageId).findClosingTokenText(t.openingBracket.bracketIds);r+=e}else if(3===t.kind);else if(0===t.kind||1===t.kind)r+=s.substring(lengthGetColumnCountIfZeroLineCount(n),lengthGetColumnCountIfZeroLineCount(lengthAdd(n,t.length)));else if(4===t.kind)for(const i of t.children)e(i,n),n=lengthAdd(n,i.length)}(o,lengthZero),r}class StaticTokenizerSource{constructor(e){this.lines=e}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}getLineTokens(e){return this.lines[e-1]}}var __decorate$S=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$R=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$v=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};let InlineCompletionsModel=class extends Disposable{constructor(e,t,n,i,o,r){super(),this.editor=e,this.cache=t,this.commandService=n,this.languageConfigurationService=i,this.languageFeaturesService=o,this.debounceService=r,this.onDidChangeEmitter=new Emitter$1,this.onDidChange=this.onDidChangeEmitter.event,this.completionSession=this._register(new MutableDisposable),this.active=!1,this.disposed=!1,this.debounceValue=this.debounceService.for(this.languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:200}),this._register(n.onDidExecuteCommand((t=>{new Set([CoreEditingCommands.Tab.id,CoreEditingCommands.DeleteLeft.id,CoreEditingCommands.DeleteRight.id,inlineSuggestCommitId,"acceptSelectedSuggestion"]).has(t.commandId)&&e.hasTextFocus()&&this.handleUserInput()}))),this._register(this.editor.onDidType((e=>{this.handleUserInput()}))),this._register(this.editor.onDidChangeCursorPosition((e=>{this.session&&!this.session.isValid&&this.hide()}))),this._register(toDisposable((()=>{this.disposed=!0}))),this._register(this.editor.onDidBlurEditorWidget((()=>{this.hide()})))}handleUserInput(){this.session&&!this.session.isValid&&this.hide(),setTimeout((()=>{this.disposed||this.startSessionIfTriggered()}),0)}get session(){return this.completionSession.value}get ghostText(){var e;return null===(e=this.session)||void 0===e?void 0:e.ghostText}get minReservedLineCount(){return this.session?this.session.minReservedLineCount:0}setExpanded(e){var t;null===(t=this.session)||void 0===t||t.setExpanded(e)}setActive(e){var t;this.active=e,e&&(null===(t=this.session)||void 0===t||t.scheduleAutomaticUpdate())}startSessionIfTriggered(){this.editor.getOption(55).enabled&&(this.session&&this.session.isValid||this.trigger(InlineCompletionTriggerKind$1.Automatic))}trigger(e){this.completionSession.value?e===InlineCompletionTriggerKind$1.Explicit&&this.completionSession.value.ensureUpdateWithExplicitContext():(this.completionSession.value=new InlineCompletionsSession(this.editor,this.editor.getPosition(),(()=>this.active),this.commandService,this.cache,e,this.languageConfigurationService,this.languageFeaturesService.inlineCompletionsProvider,this.debounceValue),this.completionSession.value.takeOwnership(this.completionSession.value.onDidChange((()=>{this.onDidChangeEmitter.fire()}))))}hide(){this.completionSession.clear(),this.onDidChangeEmitter.fire()}commitCurrentSuggestion(){var e;null===(e=this.session)||void 0===e||e.commitCurrentCompletion()}showNext(){var e;null===(e=this.session)||void 0===e||e.showNextInlineCompletion()}showPrevious(){var e;null===(e=this.session)||void 0===e||e.showPreviousInlineCompletion()}hasMultipleInlineCompletions(){var e;return __awaiter$v(this,void 0,void 0,(function*(){const t=yield null===(e=this.session)||void 0===e?void 0:e.hasMultipleInlineCompletions();return void 0!==t&&t}))}};InlineCompletionsModel=__decorate$S([__param$R(2,ICommandService),__param$R(3,ILanguageConfigurationService),__param$R(4,ILanguageFeaturesService),__param$R(5,ILanguageFeatureDebounceService)],InlineCompletionsModel);class InlineCompletionsSession extends BaseGhostTextWidgetModel{constructor(e,t,n,i,o,r,s,a,l){let c;super(e),this.triggerPosition=t,this.shouldUpdate=n,this.commandService=i,this.cache=o,this.initialTriggerKind=r,this.languageConfigurationService=s,this.registry=a,this.debounce=l,this.minReservedLineCount=0,this.updateOperation=this._register(new MutableDisposable),this.updateSoon=this._register(new RunOnceScheduler((()=>{let e=this.initialTriggerKind;return this.initialTriggerKind=InlineCompletionTriggerKind$1.Automatic,this.update(e)}),50)),this.currentlySelectedCompletionId=void 0,this._register(this.onDidChange((()=>{const e=this.currentCompletion;if(e&&e.sourceInlineCompletion!==c){c=e.sourceInlineCompletion;const t=e.sourceProvider;t.handleItemDidShow&&t.handleItemDidShow(e.sourceInlineCompletions,c)}}))),this._register(toDisposable((()=>{this.cache.clear()}))),this._register(this.editor.onDidChangeCursorPosition((e=>{this.cache.value&&this.onDidChangeEmitter.fire()}))),this._register(this.editor.onDidChangeModelContent((e=>{this.scheduleAutomaticUpdate()}))),this._register(this.registry.onDidChange((()=>{this.updateSoon.schedule(this.debounce.get(this.editor.getModel()))}))),this.scheduleAutomaticUpdate()}fixAndGetIndexOfCurrentSelection(){if(!this.currentlySelectedCompletionId||!this.cache.value)return 0;if(0===this.cache.value.completions.length)return 0;const e=this.cache.value.completions.findIndex((e=>e.semanticId===this.currentlySelectedCompletionId));return-1===e?(this.currentlySelectedCompletionId=void 0,0):e}get currentCachedCompletion(){if(this.cache.value)return this.cache.value.completions[this.fixAndGetIndexOfCurrentSelection()]}showNextInlineCompletion(){var e;return __awaiter$v(this,void 0,void 0,(function*(){yield this.ensureUpdateWithExplicitContext();const t=(null===(e=this.cache.value)||void 0===e?void 0:e.completions)||[];if(t.length>0){const e=(this.fixAndGetIndexOfCurrentSelection()+1)%t.length;this.currentlySelectedCompletionId=t[e].semanticId}else this.currentlySelectedCompletionId=void 0;this.onDidChangeEmitter.fire()}))}showPreviousInlineCompletion(){var e;return __awaiter$v(this,void 0,void 0,(function*(){yield this.ensureUpdateWithExplicitContext();const t=(null===(e=this.cache.value)||void 0===e?void 0:e.completions)||[];if(t.length>0){const e=(this.fixAndGetIndexOfCurrentSelection()+t.length-1)%t.length;this.currentlySelectedCompletionId=t[e].semanticId}else this.currentlySelectedCompletionId=void 0;this.onDidChangeEmitter.fire()}))}ensureUpdateWithExplicitContext(){var e;return __awaiter$v(this,void 0,void 0,(function*(){this.updateOperation.value?this.updateOperation.value.triggerKind===InlineCompletionTriggerKind$1.Explicit?yield this.updateOperation.value.promise:yield this.update(InlineCompletionTriggerKind$1.Explicit):(null===(e=this.cache.value)||void 0===e?void 0:e.triggerKind)!==InlineCompletionTriggerKind$1.Explicit&&(yield this.update(InlineCompletionTriggerKind$1.Explicit))}))}hasMultipleInlineCompletions(){var e;return __awaiter$v(this,void 0,void 0,(function*(){return yield this.ensureUpdateWithExplicitContext(),((null===(e=this.cache.value)||void 0===e?void 0:e.completions.length)||0)>1}))}get ghostText(){const e=this.currentCompletion,t=this.editor.getOptions().get(55).mode;return e?inlineCompletionToGhostText(e,this.editor.getModel(),t,this.editor.getPosition()):void 0}get currentCompletion(){const e=this.currentCachedCompletion;if(e)return e.toLiveInlineCompletion()}get isValid(){return this.editor.getPosition().lineNumber===this.triggerPosition.lineNumber}scheduleAutomaticUpdate(){this.updateOperation.clear(),this.updateSoon.schedule(this.debounce.get(this.editor.getModel()))}update(e){return __awaiter$v(this,void 0,void 0,(function*(){if(!this.shouldUpdate())return;const t=this.editor.getPosition(),n=new Date,i=createCancelablePromise((i=>__awaiter$v(this,void 0,void 0,(function*(){let o;try{o=yield provideInlineCompletions(this.registry,t,this.editor.getModel(),{triggerKind:e,selectedSuggestionInfo:void 0},i,this.languageConfigurationService);const r=new Date;this.debounce.update(this.editor.getModel(),r.getTime()-n.getTime())}catch(e2){return void onUnexpectedError(e2)}i.isCancellationRequested||(this.cache.setValue(this.editor,o,e),this.onDidChangeEmitter.fire())})))),o=new UpdateOperation(i,e);this.updateOperation.value=o,yield i,this.updateOperation.value===o&&this.updateOperation.clear()}))}takeOwnership(e){this._register(e)}commitCurrentCompletion(){if(!this.ghostText)return;const e=this.currentCompletion;e&&this.commit(e)}commit(e){const t=this.cache.clearAndLeak();this.editor.executeEdits("inlineSuggestion.accept",[EditOperation.replaceMove(e.range,e.text)]),e.command?this.commandService.executeCommand(e.command.id,...e.command.arguments||[]).finally((()=>{null==t||t.dispose()})).then(void 0,onUnexpectedExternalError):null==t||t.dispose(),this.onDidChangeEmitter.fire()}}class UpdateOperation{constructor(e,t){this.promise=e,this.triggerKind=t}dispose(){this.promise.cancel()}}class SynchronizedInlineCompletionsCache extends Disposable{constructor(e,t,n,i){super(),this.triggerKind=i;const o=e.deltaDecorations([],t.items.map((e=>({range:e.range,options:{description:"inline-completion-tracking-range"}}))));this._register(toDisposable((()=>{e.deltaDecorations(o,[])}))),this.completions=t.items.map(((e,t)=>new CachedInlineCompletion(e,o[t]))),this._register(e.onDidChangeModelContent((()=>{let t=!1;const i=e.getModel();for(const e of this.completions){const n=i.getDecorationRange(e.decorationId);n?e.synchronizedRange.equalsRange(n)||(t=!0,e.synchronizedRange=n):onUnexpectedError(new Error("Decoration has no range"))}t&&n()}))),this._register(t)}}class CachedInlineCompletion{constructor(e,t){this.inlineCompletion=e,this.decorationId=t,this.semanticId=JSON.stringify({text:this.inlineCompletion.text,startLine:this.inlineCompletion.range.startLineNumber,startColumn:this.inlineCompletion.range.startColumn,command:this.inlineCompletion.command}),this.synchronizedRange=e.range}toLiveInlineCompletion(){return{text:this.inlineCompletion.text,range:this.synchronizedRange,command:this.inlineCompletion.command,sourceProvider:this.inlineCompletion.sourceProvider,sourceInlineCompletions:this.inlineCompletion.sourceInlineCompletions,sourceInlineCompletion:this.inlineCompletion.sourceInlineCompletion}}}function getDefaultRange(e,t){const n=t.getWordAtPosition(e),i=t.getLineMaxColumn(e.lineNumber);return n?new Range$2(e.lineNumber,n.startColumn,e.lineNumber,i):Range$2.fromPositions(e,e.with(void 0,i))}function provideInlineCompletions(e,t,n,i,o=CancellationToken.None,r){return __awaiter$v(this,void 0,void 0,(function*(){const s=getDefaultRange(t,n),a=e.all(n),l=yield Promise.all(a.map((e=>__awaiter$v(this,void 0,void 0,(function*(){const r=yield Promise.resolve(e.provideInlineCompletions(n,t,i,o)).catch(onUnexpectedExternalError);return{completions:r,provider:e,dispose:()=>{r&&e.freeInlineCompletions(r)}}}))))),c=new Map;for(const e of l){const t=e.completions;if(t)for(const i of t.items){const o=i.range?Range$2.lift(i.range):s;if(o.startLineNumber!==o.endLineNumber)continue;const a=r&&i.completeBracketPairs?closeBrackets(i.text,o.getStartPosition(),n,r):i.text,l={text:a,range:o,command:i.command,sourceProvider:e.provider,sourceInlineCompletions:t,sourceInlineCompletion:i};c.set(JSON.stringify({text:a,range:i.range}),l)}}return{items:[...c.values()],dispose:()=>{for(const e of l)e.dispose()}}}))}function closeBrackets(e,t,n,i){const o=n.getLineContent(t.lineNumber).substring(0,t.column-1)+e,r=n.tokenizeLineWithEdit(t,o.length-(t.column-1),e),s=null==r?void 0:r.sliceAndInflate(t.column-1,o.length,0);if(!s)return e;return fixBracketsInLine(s,i)}function minimizeInlineCompletion(e,t){if(!t)return t;const n=e.getValueInRange(t.range),i=commonPrefixLength(n,t.text),o=e.getOffsetAt(t.range.getStartPosition())+i,r=e.getPositionAt(o),s=commonSuffixLength(n.substr(i),t.text),a=e.getPositionAt(Math.max(o,e.getOffsetAt(t.range.getEndPosition())-s));return{range:Range$2.fromPositions(r,a),text:t.text.substr(i,t.text.length-i-s)}}var snippetSession="";const IWorkspaceContextService=createDecorator("contextService");function isSingleFolderWorkspaceIdentifier(e){const t=e;return"string"==typeof(null==t?void 0:t.id)&&URI.isUri(t.uri)}function toWorkspaceIdentifier(e){return e.configuration?{id:e.id,configPath:e.configuration}:1===e.folders.length?{id:e.id,uri:e.folders[0].uri}:void 0}class WorkspaceFolder{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const WORKSPACE_EXTENSION="code-workspace";localize("codeWorkspace","Code Workspace");const _data=new Uint8Array(16),_hex=[];for(let C=0;C<256;C++)_hex.push(C.toString(16).padStart(2,"0"));let _fillRandomValues;function generateUuid(){_fillRandomValues(_data),_data[6]=15&_data[6]|64,_data[8]=63&_data[8]|128;let e=0,t="";return t+=_hex[_data[e++]],t+=_hex[_data[e++]],t+=_hex[_data[e++]],t+=_hex[_data[e++]],t+="-",t+=_hex[_data[e++]],t+=_hex[_data[e++]],t+="-",t+=_hex[_data[e++]],t+=_hex[_data[e++]],t+="-",t+=_hex[_data[e++]],t+=_hex[_data[e++]],t+="-",t+=_hex[_data[e++]],t+=_hex[_data[e++]],t+=_hex[_data[e++]],t+=_hex[_data[e++]],t+=_hex[_data[e++]],t+=_hex[_data[e++]],t}_fillRandomValues="object"==typeof crypto&&"function"==typeof crypto.getRandomValues?crypto.getRandomValues.bind(crypto):function(e){for(let t=0;t<e.length;t++)e[t]=Math.floor(256*Math.random());return e},Object.freeze({CURRENT_YEAR:!0,CURRENT_YEAR_SHORT:!0,CURRENT_MONTH:!0,CURRENT_DATE:!0,CURRENT_HOUR:!0,CURRENT_MINUTE:!0,CURRENT_SECOND:!0,CURRENT_DAY_NAME:!0,CURRENT_DAY_NAME_SHORT:!0,CURRENT_MONTH_NAME:!0,CURRENT_MONTH_NAME_SHORT:!0,CURRENT_SECONDS_UNIX:!0,SELECTION:!0,CLIPBOARD:!0,TM_SELECTED_TEXT:!0,TM_CURRENT_LINE:!0,TM_CURRENT_WORD:!0,TM_LINE_INDEX:!0,TM_LINE_NUMBER:!0,TM_FILENAME:!0,TM_FILENAME_BASE:!0,TM_DIRECTORY:!0,TM_FILEPATH:!0,RELATIVE_FILEPATH:!0,BLOCK_COMMENT_START:!0,BLOCK_COMMENT_END:!0,LINE_COMMENT:!0,WORKSPACE_NAME:!0,WORKSPACE_FOLDER:!0,RANDOM:!0,RANDOM_HEX:!0,UUID:!0});class CompositeSnippetVariableResolver{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){let n=t.resolve(e);if(void 0!==n)return n}}}class SelectionBasedVariableResolver{constructor(e,t,n,i){this._model=e,this._selection=t,this._selectionIdx=n,this._overtypingCapturer=i}resolve(e){const{name:t}=e;if("SELECTION"===t||"TM_SELECTED_TEXT"===t){let t=this._model.getValueInRange(this._selection)||void 0,n=this._selection.startLineNumber!==this._selection.endLineNumber;if(!t&&this._overtypingCapturer){const e=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);e&&(t=e.value,n=e.multiline)}if(t&&n&&e.snippet){const n=getLeadingWhitespace(this._model.getLineContent(this._selection.startLineNumber),0,this._selection.startColumn-1);let i=n;e.snippet.walk((t=>t!==e&&(t instanceof Text&&(i=getLeadingWhitespace(splitLines(t.value).pop())),!0)));const o=commonPrefixLength(i,n);t=t.replace(/(\r\n|\r|\n)(.*)/g,((e,t,n)=>`${t}${i.substr(o)}${n}`))}return t}if("TM_CURRENT_LINE"===t)return this._model.getLineContent(this._selection.positionLineNumber);if("TM_CURRENT_WORD"===t){const e=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return e&&e.word||void 0}return"TM_LINE_INDEX"===t?String(this._selection.positionLineNumber-1):"TM_LINE_NUMBER"===t?String(this._selection.positionLineNumber):void 0}}class ModelBasedVariableResolver{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if("TM_FILENAME"===t)return basename$1(this._model.uri.fsPath);if("TM_FILENAME_BASE"===t){const e=basename$1(this._model.uri.fsPath),t=e.lastIndexOf(".");return t<=0?e:e.slice(0,t)}return"TM_DIRECTORY"===t?"."===dirname$1(this._model.uri.fsPath)?"":this._labelService.getUriLabel(dirname(this._model.uri)):"TM_FILEPATH"===t?this._labelService.getUriLabel(this._model.uri):"RELATIVE_FILEPATH"===t?this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0}):void 0}}class ClipboardBasedVariableResolver{constructor(e,t,n,i){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=n,this._spread=i}resolve(e){if("CLIPBOARD"!==e.name)return;const t=this._readClipboardText();if(t){if(this._spread){const e=t.split(/\r\n|\n|\r/).filter((e=>!isFalsyOrWhitespace(e)));if(e.length===this._selectionCount)return e[this._selectionIdx]}return t}}}class CommentBasedVariableResolver{constructor(e,t){this._model=e,this._selection=t}resolve(e){const{name:t}=e,n=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),i=LanguageConfigurationRegistry.getComments(n);if(i)return"LINE_COMMENT"===t?i.lineCommentToken||void 0:"BLOCK_COMMENT_START"===t?i.blockCommentStartToken||void 0:"BLOCK_COMMENT_END"===t&&i.blockCommentEndToken||void 0}}class TimeBasedVariableResolver{constructor(){this._date=new Date}resolve(e){const{name:t}=e;return"CURRENT_YEAR"===t?String(this._date.getFullYear()):"CURRENT_YEAR_SHORT"===t?String(this._date.getFullYear()).slice(-2):"CURRENT_MONTH"===t?String(this._date.getMonth().valueOf()+1).padStart(2,"0"):"CURRENT_DATE"===t?String(this._date.getDate().valueOf()).padStart(2,"0"):"CURRENT_HOUR"===t?String(this._date.getHours().valueOf()).padStart(2,"0"):"CURRENT_MINUTE"===t?String(this._date.getMinutes().valueOf()).padStart(2,"0"):"CURRENT_SECOND"===t?String(this._date.getSeconds().valueOf()).padStart(2,"0"):"CURRENT_DAY_NAME"===t?TimeBasedVariableResolver.dayNames[this._date.getDay()]:"CURRENT_DAY_NAME_SHORT"===t?TimeBasedVariableResolver.dayNamesShort[this._date.getDay()]:"CURRENT_MONTH_NAME"===t?TimeBasedVariableResolver.monthNames[this._date.getMonth()]:"CURRENT_MONTH_NAME_SHORT"===t?TimeBasedVariableResolver.monthNamesShort[this._date.getMonth()]:"CURRENT_SECONDS_UNIX"===t?String(Math.floor(this._date.getTime()/1e3)):void 0}}TimeBasedVariableResolver.dayNames=[localize("Sunday","Sunday"),localize("Monday","Monday"),localize("Tuesday","Tuesday"),localize("Wednesday","Wednesday"),localize("Thursday","Thursday"),localize("Friday","Friday"),localize("Saturday","Saturday")],TimeBasedVariableResolver.dayNamesShort=[localize("SundayShort","Sun"),localize("MondayShort","Mon"),localize("TuesdayShort","Tue"),localize("WednesdayShort","Wed"),localize("ThursdayShort","Thu"),localize("FridayShort","Fri"),localize("SaturdayShort","Sat")],TimeBasedVariableResolver.monthNames=[localize("January","January"),localize("February","February"),localize("March","March"),localize("April","April"),localize("May","May"),localize("June","June"),localize("July","July"),localize("August","August"),localize("September","September"),localize("October","October"),localize("November","November"),localize("December","December")],TimeBasedVariableResolver.monthNamesShort=[localize("JanuaryShort","Jan"),localize("FebruaryShort","Feb"),localize("MarchShort","Mar"),localize("AprilShort","Apr"),localize("MayShort","May"),localize("JuneShort","Jun"),localize("JulyShort","Jul"),localize("AugustShort","Aug"),localize("SeptemberShort","Sep"),localize("OctoberShort","Oct"),localize("NovemberShort","Nov"),localize("DecemberShort","Dec")];class WorkspaceBasedVariableResolver{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=toWorkspaceIdentifier(this._workspaceService.getWorkspace());return t?"WORKSPACE_NAME"===e.name?this._resolveWorkspaceName(t):"WORKSPACE_FOLDER"===e.name?this._resoveWorkspacePath(t):void 0:void 0}_resolveWorkspaceName(e){if(isSingleFolderWorkspaceIdentifier(e))return basename$1(e.uri.path);let t=basename$1(e.configPath.path);return t.endsWith(WORKSPACE_EXTENSION)&&(t=t.substr(0,t.length-WORKSPACE_EXTENSION.length-1)),t}_resoveWorkspacePath(e){if(isSingleFolderWorkspaceIdentifier(e))return normalizeDriveLetter(e.uri.fsPath);let t=basename$1(e.configPath.path),n=e.configPath.fsPath;return n.endsWith(t)&&(n=n.substr(0,n.length-t.length-1)),n?normalizeDriveLetter(n):"/"}}class RandomBasedVariableResolver{resolve(e){const{name:t}=e;return"RANDOM"===t?Math.random().toString().slice(-6):"RANDOM_HEX"===t?Math.random().toString(16).slice(-6):"UUID"===t?generateUuid():void 0}}class OneSnippet{constructor(e,t,n,i){this._editor=e,this._snippet=t,this._offset=n,this._snippetLineLeadingWhitespace=i,this._nestingLevel=1,this._placeholderGroups=groupBy(t.placeholders,Placeholder.compareByIndex),this._placeholderGroupsIdx=-1}dispose(){this._placeholderDecorations&&this._editor.deltaDecorations([...this._placeholderDecorations.values()],[]),this._placeholderGroups.length=0}_initDecorations(){if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations((t=>{for(const n of this._snippet.placeholders){const i=this._snippet.offset(n),o=this._snippet.fullLen(n),r=Range$2.fromPositions(e.getPositionAt(this._offset+i),e.getPositionAt(this._offset+i+o)),s=n.isFinalTabstop?OneSnippet._decor.inactiveFinal:OneSnippet._decor.inactive,a=t.addDecoration(r,s);this._placeholderDecorations.set(n,a)}}))}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){let e=[];for(const t of this._placeholderGroups[this._placeholderGroupsIdx])if(t.transform){const n=this._placeholderDecorations.get(t),i=this._editor.getModel().getDecorationRange(n),o=this._editor.getModel().getValueInRange(i),r=t.transform.resolve(o).split(/\r\n|\r|\n/);for(let e=1;e<r.length;e++)r[e]=this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace+r[e]);e.push(EditOperation.replace(i,r.join(this._editor.getModel().getEOL())))}e.length>0&&this._editor.executeEdits("snippet.placeholderTransform",e)}let t=!1;!0===e&&this._placeholderGroupsIdx<this._placeholderGroups.length-1?(this._placeholderGroupsIdx+=1,t=!0):!1===e&&this._placeholderGroupsIdx>0&&(this._placeholderGroupsIdx-=1,t=!0);const n=this._editor.getModel().changeDecorations((e=>{const n=new Set,i=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx]){const r=this._placeholderDecorations.get(o),s=this._editor.getModel().getDecorationRange(r);i.push(new Selection$1(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(o),e.changeDecorationOptions(r,o.isFinalTabstop?OneSnippet._decor.activeFinal:OneSnippet._decor.active),n.add(o);for(const t of this._snippet.enclosingPlaceholders(o)){const i=this._placeholderDecorations.get(t);e.changeDecorationOptions(i,t.isFinalTabstop?OneSnippet._decor.activeFinal:OneSnippet._decor.active),n.add(t)}}for(const[t,o]of this._placeholderDecorations)n.has(t)||e.changeDecorationOptions(o,t.isFinalTabstop?OneSnippet._decor.inactiveFinal:OneSnippet._decor.inactive);return i}));return t?this.move(e):null!=n?n:[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Placeholder){const e=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(e).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||0===this._placeholderGroups.length}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let n;for(const i of t){if(i.isFinalTabstop)break;n||(n=[],e.set(i.index,n));const t=this._placeholderDecorations.get(i),o=this._editor.getModel().getDecorationRange(t);if(!o){e.delete(i.index);break}n.push(o)}}return e}get choice(){return this._placeholderGroups[this._placeholderGroupsIdx][0].choice}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations((n=>{for(const i of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift(),r=o._snippet.placeholderInfo.last.index;for(const e of o._snippet.placeholderInfo.all)e.isFinalTabstop?e.index=i.index+(r+1)/this._nestingLevel:e.index=i.index+e.index/this._nestingLevel;this._snippet.replace(i,o._snippet.children);const s=this._placeholderDecorations.get(i);n.removeDecoration(s),this._placeholderDecorations.delete(i);for(const e of o._snippet.placeholders){const i=o._snippet.offset(e),r=o._snippet.fullLen(e),s=Range$2.fromPositions(t.getPositionAt(o._offset+i),t.getPositionAt(o._offset+i+r)),a=n.addDecoration(s,OneSnippet._decor.inactive);this._placeholderDecorations.set(e,a)}}this._placeholderGroups=groupBy(this._snippet.placeholders,Placeholder.compareByIndex)}))}}OneSnippet._decor={active:ModelDecorationOptions.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:ModelDecorationOptions.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:ModelDecorationOptions.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:ModelDecorationOptions.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const _defaultOptions$1={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};class SnippetSession{constructor(e,t,n=_defaultOptions$1){this._templateMerges=[],this._snippets=[],this._editor=e,this._template=t,this._options=n}static adjustWhitespace(e,t,n,i,o){const r=getLeadingWhitespace(e.getLineContent(t.lineNumber),0,t.column-1);let s;return n.walk((t=>{if(!(t instanceof Text)||t.parent instanceof Choice)return!0;const o=t.value.split(/\r\n|\r|\n/);if(i){const i=n.offset(t);if(0===i)o[0]=e.normalizeIndentation(o[0]);else{s=null!=s?s:n.toString();let t=s.charCodeAt(i-1);10!==t&&13!==t||(o[0]=e.normalizeIndentation(r+o[0]))}for(let t=1;t<o.length;t++)o[t]=e.normalizeIndentation(r+o[t])}const a=o.join(e.getEOL());return a!==t.value&&(t.parent.replace(t,[new Text(a)]),s=void 0),!0})),r}static adjustSelection(e,t,n,i){if(0!==n||0!==i){const{positionLineNumber:o,positionColumn:r}=t,s=r-n,a=r+i,l=e.validateRange({startLineNumber:o,startColumn:s,endLineNumber:o,endColumn:a});t=Selection$1.createWithDirection(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn,t.getDirection())}return t}static createEditsAndSnippets(e,t,n,i,o,r,s,a){const l=[],c=[];if(!e.hasModel())return{edits:l,snippets:c};const d=e.getModel(),u=e.invokeWithinContext((e=>e.get(IWorkspaceContextService))),h=e.invokeWithinContext((e=>new ModelBasedVariableResolver(e.get(ILabelService),d))),g=()=>s;let p=0,f=d.getValueInRange(SnippetSession.adjustSelection(d,e.getSelection(),n,0)),m=d.getValueInRange(SnippetSession.adjustSelection(d,e.getSelection(),0,i)),v=d.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber);const _=e.getSelections().map(((e,t)=>({selection:e,idx:t}))).sort(((e,t)=>Range$2.compareRangesUsingStarts(e.selection,t.selection)));for(const{selection:C,idx:b}of _){let s=SnippetSession.adjustSelection(d,C,n,0),y=SnippetSession.adjustSelection(d,C,0,i);f!==d.getValueInRange(s)&&(s=C),m!==d.getValueInRange(y)&&(y=C);const S=C.setStartPosition(s.startLineNumber,s.startColumn).setEndPosition(y.endLineNumber,y.endColumn),w=(new SnippetParser).parse(t,!0,o),E=S.getStartPosition(),x=SnippetSession.adjustWhitespace(d,E,w,r||b>0&&v!==d.getLineFirstNonWhitespaceColumn(C.positionLineNumber),!0);w.resolveVariables(new CompositeSnippetVariableResolver([h,new ClipboardBasedVariableResolver(g,b,_.length,"spread"===e.getOption(71)),new SelectionBasedVariableResolver(d,C,b,a),new CommentBasedVariableResolver(d,C),new TimeBasedVariableResolver,new WorkspaceBasedVariableResolver(u),new RandomBasedVariableResolver]));const T=d.getOffsetAt(E)+p;p+=w.toString().length-d.getValueLengthInRange(S),l[b]=EditOperation.replace(S,w.toString()),l[b].identifier={major:b,minor:0},c[b]=new OneSnippet(e,w,T,x)}return{edits:l,snippets:c}}dispose(){dispose(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=SnippetSession.createEditsAndSnippets(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer);this._snippets=t,this._editor.executeEdits("snippet",e,(e=>this._snippets[0].hasPlaceholder?this._move(!0):e.filter((e=>!!e.identifier)).map((e=>Selection$1.fromPositions(e.range.getEndPosition()))))),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=_defaultOptions$1){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:n,snippets:i}=SnippetSession.createEditsAndSnippets(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer);this._editor.executeEdits("snippet",n,(e=>{for(const t of this._snippets)t.merge(i);return this._snippets[0].hasPlaceholder?this._move(void 0):e.filter((e=>!!e.identifier)).map((e=>Selection$1.fromPositions(e.range.getEndPosition())))}))}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const n of this._snippets){const i=n.move(e);t.push(...i)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get choice(){return this._snippets[0].choice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length<this._snippets.length)return!1;let t=new Map;for(const n of this._snippets){const i=n.computePossibleSelections();if(0===t.size)for(const[n,o]of i){o.sort(Range$2.compareRangesUsingStarts);for(const i of e)if(o[0].containsRange(i)){t.set(n,[]);break}}if(0===t.size)return!1;t.forEach(((e,t)=>{e.push(...i.get(t))}))}e.sort(Range$2.compareRangesUsingStarts);for(let[n,i]of t)if(i.length===e.length){i.sort(Range$2.compareRangesUsingStarts);for(let o=0;o<i.length;o++)i[o].containsRange(e[o])||t.delete(n)}else t.delete(n);return t.size>0}}var __decorate$R=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$Q=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const _defaultOptions={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let SnippetController2=class e{constructor(t,n,i,o){this._editor=t,this._instantiationService=n,this._logService=i,this._snippetListener=new DisposableStore,this._modelVersionId=-1,this._inSnippet=e.InSnippetMode.bindTo(o),this._hasNextTabstop=e.HasNextTabstop.bindTo(o),this._hasPrevTabstop=e.HasPrevTabstop.bindTo(o)}static get(t){return t.getContribution(e.ID)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),null===(e=this._session)||void 0===e||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,void 0===t?_defaultOptions:Object.assign(Object.assign({},_defaultOptions),t))}catch(e2){this.cancel(),this._logService.error(e2),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"<no_session>")}}_doInsert(e,t){this._editor.hasModel()&&(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session?this._session.merge(e,t):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new SnippetSession(this._editor,e,t),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent((e=>e.isFlush&&this.cancel()))),this._snippetListener.add(this._editor.onDidChangeModel((()=>this.cancel()))),this._snippetListener.add(this._editor.onDidChangeCursorSelection((()=>this._updateState()))))}_updateState(){if(this._session&&this._editor.hasModel()){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){if(!this._session||!this._editor.hasModel())return void(this._currentChoice=void 0);const{choice:e}=this._session;if(e){if(this._currentChoice!==e){this._currentChoice=e,this._editor.setSelections(this._editor.getSelections().map((e=>Selection$1.fromPositions(e.getStartPosition()))));const[t]=e.options;this._instantiationService.invokeFunction(showSimpleSuggestions,this._editor,e.options.map(((e,n)=>({kind:13,label:e.value,insertText:e.value,sortText:"a".repeat(n+1),range:Range$2.fromPositions(this._editor.getPosition(),this._editor.getPosition().delta(0,t.value.length))}))))}}else this._currentChoice=void 0}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),null===(t=this._session)||void 0===t||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){this._session&&this._session.prev(),this._updateState()}next(){this._session&&this._session.next(),this._updateState()}isInSnippet(){return Boolean(this._inSnippet.get())}};SnippetController2.ID="snippetController2",SnippetController2.InSnippetMode=new RawContextKey("inSnippetMode",!1,localize("inSnippetMode","Whether the editor in current in snippet mode")),SnippetController2.HasNextTabstop=new RawContextKey("hasNextTabstop",!1,localize("hasNextTabstop","Whether there is a next tab stop when in snippet mode")),SnippetController2.HasPrevTabstop=new RawContextKey("hasPrevTabstop",!1,localize("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode")),SnippetController2=__decorate$R([__param$Q(1,IInstantiationService),__param$Q(2,ILogService),__param$Q(3,IContextKeyService)],SnippetController2),registerEditorContribution(SnippetController2.ID,SnippetController2);const CommandCtor=EditorCommand.bindToContribution(SnippetController2.get);registerEditorCommand(new CommandCtor({id:"jumpToNextSnippetPlaceholder",precondition:ContextKeyExpr.and(SnippetController2.InSnippetMode,SnippetController2.HasNextTabstop),handler:e=>e.next(),kbOpts:{weight:130,kbExpr:EditorContextKeys.editorTextFocus,primary:2}})),registerEditorCommand(new CommandCtor({id:"jumpToPrevSnippetPlaceholder",precondition:ContextKeyExpr.and(SnippetController2.InSnippetMode,SnippetController2.HasPrevTabstop),handler:e=>e.prev(),kbOpts:{weight:130,kbExpr:EditorContextKeys.editorTextFocus,primary:1026}})),registerEditorCommand(new CommandCtor({id:"leaveSnippet",precondition:SnippetController2.InSnippetMode,handler:e=>e.cancel(!0),kbOpts:{weight:130,kbExpr:EditorContextKeys.editorTextFocus,primary:9,secondary:[1033]}})),registerEditorCommand(new CommandCtor({id:"acceptSnippet",precondition:SnippetController2.InSnippetMode,handler:e=>e.finish()}));var __decorate$Q=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$P=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};class Memory{constructor(e){this.name=e}select(e,t,n){if(0===n.length)return 0;let i=n[0].score[0];for(let o=0;o<n.length;o++){const{score:e,completion:t}=n[o];if(e[0]!==i)break;if(t.preselect)return o}return 0}}class NoMemory extends Memory{constructor(){super("first")}memorize(e,t,n){}toJSON(){}fromJSON(){}}class LRUMemory extends Memory{constructor(){super("recentlyUsed"),this._cache=new LRUCache(300,.66),this._seq=0}memorize(e,t,n){const i=`${e.getLanguageId()}/${n.textLabel}`;this._cache.set(i,{touch:this._seq++,type:n.completion.kind,insertText:n.completion.insertText})}select(e,t,n){if(0===n.length)return 0;const i=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(i))return super.select(e,t,n);let o=n[0].score[0],r=-1,s=-1,a=-1;for(let l=0;l<n.length&&n[l].score[0]===o;l++){const t=`${e.getLanguageId()}/${n[l].textLabel}`,i=this._cache.peek(t);if(i&&i.touch>a&&i.type===n[l].completion.kind&&i.insertText===n[l].completion.insertText&&(a=i.touch,s=l),n[l].completion.preselect&&-1===r)return l}return-1!==s?s:-1!==r?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();for(const[t,n]of e)n.touch=0,n.type="number"==typeof n.type?n.type:CompletionItemKinds.fromString(n.type),this._cache.set(t,n);this._seq=this._cache.size}}class PrefixMemory extends Memory{constructor(){super("recentlyUsedByPrefix"),this._trie=TernarySearchTree.forStrings(),this._seq=0}memorize(e,t,n){const{word:i}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${i}`;this._trie.set(o,{type:n.completion.kind,insertText:n.completion.insertText,touch:this._seq++})}select(e,t,n){let{word:i}=e.getWordUntilPosition(t);if(!i)return super.select(e,t,n);let o=`${e.getLanguageId()}/${i}`,r=this._trie.get(o);if(r||(r=this._trie.findSubstr(o)),r)for(let s=0;s<n.length;s++){let{kind:e,insertText:t}=n[s].completion;if(e===r.type&&t===r.insertText)return s}return super.select(e,t,n)}toJSON(){let e=[];return this._trie.forEach(((t,n)=>e.push([n,t]))),e.sort(((e,t)=>-(e[1].touch-t[1].touch))).forEach(((e,t)=>e[1].touch=t)),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,n]of e)n.type="number"==typeof n.type?n.type:CompletionItemKinds.fromString(n.type),this._trie.set(t,n)}}}let SuggestMemoryService=class e{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new DisposableStore,this._persistSoon=new RunOnceScheduler((()=>this._saveState()),500),this._disposables.add(e.onWillSaveState((e=>{e.reason===WillSaveStateReason.SHUTDOWN&&this._saveState()})))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,n){this._withStrategy(e,t).memorize(e,t,n),this._persistSoon.schedule()}select(e,t,n){return this._withStrategy(e,t).select(e,t,n)}_withStrategy(t,n){var i;const o=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:t.getLanguageIdAtPosition(n.lineNumber,n.column),resource:t.uri});if((null===(i=this._strategy)||void 0===i?void 0:i.name)!==o){this._saveState();const t=e._strategyCtors.get(o)||NoMemory;this._strategy=new t;try{const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,n=this._storageService.get(`${e._storagePrefix}/${o}`,t);n&&this._strategy.fromJSON(JSON.parse(n))}catch(e2){}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,n=JSON.stringify(this._strategy);this._storageService.store(`${e._storagePrefix}/${this._strategy.name}`,n,t,1)}}};SuggestMemoryService._strategyCtors=new Map([["recentlyUsedByPrefix",PrefixMemory],["recentlyUsed",LRUMemory],["first",NoMemory]]),SuggestMemoryService._storagePrefix="suggest/memories",SuggestMemoryService=__decorate$Q([__param$P(0,IStorageService),__param$P(1,IConfigurationService)],SuggestMemoryService);const ISuggestMemoryService=createDecorator("ISuggestMemories");registerSingleton(ISuggestMemoryService,SuggestMemoryService,!0);var __decorate$P=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$O=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let WordContextKey=class e{constructor(t,n){this._editor=t,this._enabled=!1,this._ckAtEnd=e.AtEnd.bindTo(n),this._configListener=this._editor.onDidChangeConfiguration((e=>e.hasChanged(111)&&this._update())),this._update()}dispose(){var e;this._configListener.dispose(),null===(e=this._selectionListener)||void 0===e||e.dispose(),this._ckAtEnd.reset()}_update(){const e="on"===this._editor.getOption(111);if(this._enabled!==e)if(this._enabled=e,this._enabled){const e=()=>{if(!this._editor.hasModel())return void this._ckAtEnd.set(!1);const e=this._editor.getModel(),t=this._editor.getSelection(),n=e.getWordAtPosition(t.getStartPosition());n?this._ckAtEnd.set(n.endColumn===t.getStartPosition().column):this._ckAtEnd.set(!1)};this._selectionListener=this._editor.onDidChangeCursorSelection(e),e()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};WordContextKey.AtEnd=new RawContextKey("atEndOfWord",!1),WordContextKey=__decorate$P([__param$O(1,IContextKeyService)],WordContextKey);var __decorate$O=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$N=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let SuggestAlternatives=class e{constructor(t,n){this._editor=t,this._index=0,this._ckOtherSuggestions=e.OtherSuggestions.bindTo(n)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),null===(e=this._listener)||void 0===e||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:t,index:n},i){if(0===t.items.length)return void this.reset();e._moveIndex(!0,t,n)!==n?(this._acceptNext=i,this._model=t,this._index=n,this._listener=this._editor.onDidChangeCursorPosition((()=>{this._ignore||this.reset()})),this._ckOtherSuggestions.set(!0)):this.reset()}static _moveIndex(e,t,n){let i=n;for(;i=(i+t.items.length+(e?1:-1))%t.items.length,i!==n&&t.items[i].completion.additionalTextEdits;);return i}next(){this._move(!0)}prev(){this._move(!1)}_move(t){if(this._model)try{this._ignore=!0,this._index=e._moveIndex(t,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};SuggestAlternatives.OtherSuggestions=new RawContextKey("hasOtherSuggestions",!1),SuggestAlternatives=__decorate$O([__param$N(1,IContextKeyService)],SuggestAlternatives);class CommitCharacterController{constructor(e,t,n){this._disposables=new DisposableStore,this._disposables.add(t.onDidShow((()=>this._onItem(t.getFocusedItem())))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType((i=>{if(this._active&&!t.isFrozen()){const t=i.charCodeAt(i.length-1);this._active.acceptCharacters.has(t)&&e.getOption(0)&&n(this._active.item)}})))}_onItem(e){if(!e||!isNonEmptyArray(e.item.completion.commitCharacters))return void this.reset();if(this._active&&this._active.item.item===e.item)return;const t=new CharacterSet;for(const n of e.item.completion.commitCharacters)n.length>0&&t.add(n.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}var __awaiter$u=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class BracketSelectionRangeProvider{provideSelectionRanges(e,t){return __awaiter$u(this,void 0,void 0,(function*(){const n=[];for(const i of t){const t=[];n.push(t);const o=new Map;yield new Promise((t=>BracketSelectionRangeProvider._bracketsRightYield(t,0,e,i,o))),yield new Promise((n=>BracketSelectionRangeProvider._bracketsLeftYield(n,0,e,i,o,t)))}return n}))}static _bracketsRightYield(e,t,n,i,o){const r=new Map,s=Date.now();for(;;){if(t>=BracketSelectionRangeProvider._maxRounds){e();break}if(!i){e();break}let a=n.bracketPairs.findNextBracket(i);if(!a){e();break}if(Date.now()-s>BracketSelectionRangeProvider._maxDuration){setTimeout((()=>BracketSelectionRangeProvider._bracketsRightYield(e,t+1,n,i,o)));break}const l=a.close[0];if(a.isOpen){let e=r.has(l)?r.get(l):0;r.set(l,e+1)}else{let e=r.has(l)?r.get(l):0;if(e-=1,r.set(l,Math.max(0,e)),e<0){let e=o.get(l);e||(e=new LinkedList,o.set(l,e)),e.push(a.range)}}i=a.range.getEndPosition()}}static _bracketsLeftYield(e,t,n,i,o,r){const s=new Map,a=Date.now();for(;;){if(t>=BracketSelectionRangeProvider._maxRounds&&0===o.size){e();break}if(!i){e();break}let l=n.bracketPairs.findPrevBracket(i);if(!l){e();break}if(Date.now()-a>BracketSelectionRangeProvider._maxDuration){setTimeout((()=>BracketSelectionRangeProvider._bracketsLeftYield(e,t+1,n,i,o,r)));break}const c=l.close[0];if(l.isOpen){let e=s.has(c)?s.get(c):0;if(e-=1,s.set(c,Math.max(0,e)),e<0){let e=o.get(c);if(e){let t=e.shift();0===e.size&&o.delete(c);const i=Range$2.fromPositions(l.range.getEndPosition(),t.getStartPosition()),s=Range$2.fromPositions(l.range.getStartPosition(),t.getEndPosition());r.push({range:i}),r.push({range:s}),BracketSelectionRangeProvider._addBracketLeading(n,s,r)}}}else{let e=s.has(c)?s.get(c):0;s.set(c,e+1)}i=l.range.getStartPosition()}}static _addBracketLeading(e,t,n){if(t.startLineNumber===t.endLineNumber)return;const i=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(i);0!==o&&o!==t.startColumn&&(n.push({range:Range$2.fromPositions(new Position$1(i,o),t.getEndPosition())}),n.push({range:Range$2.fromPositions(new Position$1(i,1),t.getEndPosition())}));const r=i-1;if(r>0){const i=e.getLineFirstNonWhitespaceColumn(r);i===t.startColumn&&i!==e.getLineLastNonWhitespaceColumn(r)&&(n.push({range:Range$2.fromPositions(new Position$1(r,i),t.getEndPosition())}),n.push({range:Range$2.fromPositions(new Position$1(r,1),t.getEndPosition())}))}}}BracketSelectionRangeProvider._maxDuration=30,BracketSelectionRangeProvider._maxRounds=2;var __awaiter$t=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class WordDistance{static create(e,t){return __awaiter$t(this,void 0,void 0,(function*(){if(!t.getOption(106).localityBonus)return WordDistance.None;if(!t.hasModel())return WordDistance.None;const n=t.getModel(),i=t.getPosition();if(!e.canComputeWordRanges(n.uri))return WordDistance.None;const[o]=yield(new BracketSelectionRangeProvider).provideSelectionRanges(n,[i]);if(0===o.length)return WordDistance.None;const r=yield e.computeWordRanges(n.uri,o[0].range);if(!r)return WordDistance.None;const s=n.getWordUntilPosition(i);return delete r[s.word],new class extends WordDistance{distance(e,n){if(!i.equals(t.getPosition()))return 0;if(17===n.kind)return 2<<20;let s="string"==typeof n.label?n.label:n.label.label,a=r[s];if(isFalsyOrEmpty(a))return 2<<20;let l=binarySearch(a,Range$2.fromPositions(e),Range$2.compareRangesUsingStarts),c=l>=0?a[l]:a[Math.max(0,~l-1)],d=o.length;for(const t of o){if(!Range$2.containsRange(t.range,c))break;d-=1}return d}}}))}}WordDistance.None=new class extends WordDistance{distance(){return 0}};class CompletionModel{constructor(e,t,n,i,o,r,s){this.clipboardText=s,this._snippetCompareFn=CompletionModel._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=i,this._options=o,this._refilterKind=1,this._lineContext=n,"top"===r?this._snippetCompareFn=CompletionModel._compareCompletionItemsSnippetsUp:"bottom"===r&&(this._snippetCompareFn=CompletionModel._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){this._lineContext.leadingLineContent===e.leadingLineContent&&this._lineContext.characterCountDelta===e.characterCountDelta||(this._refilterKind=this._lineContext.characterCountDelta<e.characterCountDelta&&this._filteredItems?2:1,this._lineContext=e)}get items(){return this._ensureCachedState(),this._filteredItems}get allProvider(){return this._ensureCachedState(),this._providerInfo.keys()}get incomplete(){this._ensureCachedState();const e=new Set;for(let[t,n]of this._providerInfo)n&&e.add(t);return e}adopt(e){let t=[];for(let n=0;n<this._items.length;)e.has(this._items[n].provider)?n++:(t.push(this._items[n]),this._items[n]=this._items[this._items.length-1],this._items.pop());return this._refilterKind=1,t}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){0!==this._refilterKind&&this._createCachedState()}_createCachedState(){this._providerInfo=new Map;const e=[],{leadingLineContent:t,characterCountDelta:n}=this._lineContext;let i="",o="";const r=1===this._refilterKind?this._items:this._filteredItems,s=[],a=!this._options.filterGraceful||r.length>2e3?fuzzyScore:fuzzyScoreGracefulAggressive;for(let l=0;l<r.length;l++){const c=r[l];if(c.isInvalid)continue;this._providerInfo.set(c.provider,Boolean(c.container.incomplete));const d=c.position.column-c.editStart.column,u=d+n-(c.position.column-this._column);if(i.length!==u&&(i=0===u?"":t.slice(-u),o=i.toLowerCase()),c.word=i,0===u)c.score=FuzzyScore.Default;else{let e=0;for(;e<d;){const t=i.charCodeAt(e);if(32!==t&&9!==t)break;e+=1}if(e>=u)c.score=FuzzyScore.Default;else if("string"==typeof c.completion.filterText){let t=a(i,o,e,c.completion.filterText,c.filterTextLow,0,!1);if(!t)continue;0===compareIgnoreCase(c.completion.filterText,c.textLabel)?c.score=t:(c.score=anyScore(i,o,e,c.textLabel,c.labelLow,0),c.score[0]=t[0])}else{let t=a(i,o,e,c.textLabel,c.labelLow,0,!1);if(!t)continue;c.score=t}}c.idx=l,c.distance=this._wordDistance.distance(c.position,c.completion),s.push(c),e.push(c.textLabel.length)}this._filteredItems=s.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?quickSelect(e.length-.85,e,((e,t)=>e-t)):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]<t.score[0]?1:e.distance<t.distance?-1:e.distance>t.distance?1:e.idx<t.idx?-1:e.idx>t.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return 1;if(27===t.completion.kind)return-1}return CompletionModel._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return-1;if(27===t.completion.kind)return 1}return CompletionModel._compareCompletionItems(e,t)}}var __decorate$N=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$M=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$s=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class LineContext{constructor(e,t,n,i){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.auto=n,this.shy=i}static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),n=e.getPosition();t.tokenizeIfCheap(n.lineNumber);const i=t.getWordAtPosition(n);return!!i&&(i.endColumn===n.column&&!!isNaN(Number(i.word)))}}function canShowQuickSuggest(e,t,n){if(!Boolean(t.getContextKeyValue("inlineSuggestionVisible")))return!0;const i=n.getValue("editor.inlineSuggest.allowQuickSuggestions");return void 0!==i&&Boolean(i)}function canShowSuggestOnTriggerCharacters(e,t,n){if(!Boolean(t.getContextKeyValue("inlineSuggestionVisible")))return!0;const i=n.getValue("editor.inlineSuggest.allowSuggestOnTriggerCharacters");return void 0!==i&&Boolean(i)}let SuggestModel=class e{constructor(e,t,n,i,o,r,s,a){this._editor=e,this._editorWorkerService=t,this._clipboardService=n,this._telemetryService=i,this._logService=o,this._contextKeyService=r,this._configurationService=s,this._languageFeaturesService=a,this._toDispose=new DisposableStore,this._quickSuggestDelay=10,this._triggerCharacterListener=new DisposableStore,this._triggerQuickSuggest=new TimeoutTimer,this._state=0,this._completionDisposables=new DisposableStore,this._onDidCancel=new Emitter$1,this._onDidTrigger=new Emitter$1,this._onDidSuggest=new Emitter$1,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new Selection$1(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel((()=>{this._updateTriggerCharacters(),this.cancel()}))),this._toDispose.add(this._editor.onDidChangeModelLanguage((()=>{this._updateTriggerCharacters(),this.cancel()}))),this._toDispose.add(this._editor.onDidChangeConfiguration((()=>{this._updateTriggerCharacters(),this._updateQuickSuggest()}))),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange((()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()})));let l=!1;this._toDispose.add(this._editor.onDidCompositionStart((()=>{l=!0}))),this._toDispose.add(this._editor.onDidCompositionEnd((()=>{l=!1,this._onCompositionEnd()}))),this._toDispose.add(this._editor.onDidChangeCursorSelection((e=>{l||this._onCursorChange(e)}))),this._toDispose.add(this._editor.onDidChangeModelContent((()=>{l||this._refilterCompletionItems()}))),this._updateTriggerCharacters(),this._updateQuickSuggest()}dispose(){dispose(this._triggerCharacterListener),dispose([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateQuickSuggest(){this._quickSuggestDelay=this._editor.getOption(80),(isNaN(this._quickSuggestDelay)||!this._quickSuggestDelay&&0!==this._quickSuggestDelay||this._quickSuggestDelay<0)&&(this._quickSuggestDelay=10)}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(81)||!this._editor.hasModel()||!this._editor.getOption(109))return;const e=new Map;for(const n of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const t of n.triggerCharacters||[]){let i=e.get(t);i||(i=new Set,i.add(getSnippetSuggestSupport()),e.set(t,i)),i.add(n)}const t=t=>{if(!canShowSuggestOnTriggerCharacters(this._editor,this._contextKeyService,this._configurationService))return;if(LineContext.shouldAutoTrigger(this._editor))return;if(!t){const e=this._editor.getPosition();t=this._editor.getModel().getLineContent(e.lineNumber).substr(0,e.column-1)}let n="";isLowSurrogate(t.charCodeAt(t.length-1))?isHighSurrogate(t.charCodeAt(t.length-2))&&(n=t.substr(t.length-2)):n=t.charAt(t.length-1);const i=e.get(n);if(i){const e=this._completionModel?{items:this._completionModel.adopt(i),clipboardText:this._completionModel.clipboardText}:void 0;this.trigger({auto:!0,shy:!1,triggerCharacter:n},Boolean(this._completionModel),i,e)}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd((()=>t())))}get state(){return this._state}cancel(e=!1){var t;0!==this._state&&(this._triggerQuickSuggest.cancel(),null===(t=this._requestToken)||void 0===t||t.cancel(),this._requestToken=void 0,this._state=0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){0!==this._state&&(this._editor.hasModel()&&this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.trigger({auto:2===this._state,shy:!1},!0):this.cancel())}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||0!==e.reason&&3!==e.reason||"keyboard"!==e.source&&"deleteLeft"!==e.source?this.cancel():0===this._state&&0===e.reason?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():0!==this._state&&3===e.reason&&this._refilterCompletionItems()}_onCompositionEnd(){0===this._state?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;!1!==this._editor.getOption(79)&&(this._editor.getOption(106).snippetsPreventQuickSuggestions&&(null===(e=SnippetController2.get(this._editor))||void 0===e?void 0:e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet((()=>{if(0!==this._state)return;if(!LineContext.shouldAutoTrigger(this._editor))return;if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getPosition(),n=this._editor.getOption(79);if(!1!==n){if(!0===n);else{e.tokenizeIfCheap(t.lineNumber);const i=e.getLineTokens(t.lineNumber),o=i.getStandardTokenType(i.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(!(n.other&&0===o||n.comments&&1===o||n.strings&&2===o))return}canShowQuickSuggest(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0,shy:!1})}}),this._quickSuggestDelay)))}_refilterCompletionItems(){Promise.resolve().then((()=>{if(0===this._state)return;if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getPosition(),n=new LineContext(e,t,2===this._state,!1);this._onNewContext(n)}))}trigger(t,n=!1,i,o){var r;if(!this._editor.hasModel())return;const s=this._editor.getModel(),a=t.auto,l=new LineContext(s,this._editor.getPosition(),a,t.shy);this.cancel(n),this._state=a?2:1,this._onDidTrigger.fire({auto:a,shy:t.shy,position:this._editor.getPosition()}),this._context=l;let c={triggerKind:null!==(r=t.triggerKind)&&void 0!==r?r:0};t.triggerCharacter&&(c={triggerKind:1,triggerCharacter:t.triggerCharacter}),this._requestToken=new CancellationTokenSource$1;const d=this._editor.getOption(101);let u=1;switch(d){case"top":u=0;break;case"bottom":u=2}const{itemKind:h,showDeprecated:g}=e._createSuggestFilter(this._editor),p=WordDistance.create(this._editorWorkerService,this._editor),f=provideSuggestionItems(this._languageFeaturesService.completionProvider,s,this._editor.getPosition(),new CompletionOptions(u,h,i,g),c,this._requestToken.token);Promise.all([f,p]).then((([e,n])=>__awaiter$s(this,void 0,void 0,(function*(){var i;if(null===(i=this._requestToken)||void 0===i||i.dispose(),!this._editor.hasModel())return;let r=null==o?void 0:o.clipboardText;if(!r&&e.needsClipboard&&(r=yield this._clipboardService.readText()),0===this._state)return;const s=this._editor.getModel();let l=e.items;if(o){const e=getSuggestionComparator(u);l=l.concat(o.items).sort(e)}const c=new LineContext(s,this._editor.getPosition(),a,t.shy);this._completionModel=new CompletionModel(l,this._context.column,{leadingLineContent:c.leadingLineContent,characterCountDelta:c.column-this._context.column},n,this._editor.getOption(106),this._editor.getOption(101),r),this._completionDisposables.add(e.disposable),this._onNewContext(c),this._reportDurationsTelemetry(e.durations)})))).catch(onUnexpectedError)}_reportDurationsTelemetry(e){this._telemetryGate++%230==0&&setTimeout((()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)}))}static _createSuggestFilter(e){const t=new Set;"none"===e.getOption(101)&&t.add(27);const n=e.getOption(106);return n.showMethods||t.add(0),n.showFunctions||t.add(1),n.showConstructors||t.add(2),n.showFields||t.add(3),n.showVariables||t.add(4),n.showClasses||t.add(5),n.showStructs||t.add(6),n.showInterfaces||t.add(7),n.showModules||t.add(8),n.showProperties||t.add(9),n.showEvents||t.add(10),n.showOperators||t.add(11),n.showUnits||t.add(12),n.showValues||t.add(13),n.showConstants||t.add(14),n.showEnums||t.add(15),n.showEnumMembers||t.add(16),n.showKeywords||t.add(17),n.showWords||t.add(18),n.showColors||t.add(19),n.showFiles||t.add(20),n.showReferences||t.add(21),n.showColors||t.add(22),n.showFolders||t.add(23),n.showTypeParameters||t.add(24),n.showSnippets||t.add(27),n.showUsers||t.add(25),n.showIssues||t.add(26),{itemKind:t,showDeprecated:n.showDeprecated}}_onNewContext(e){if(this._context)if(e.lineNumber===this._context.lineNumber)if(getLeadingWhitespace(e.leadingLineContent)===getLeadingWhitespace(this._context.leadingLineContent)){if(e.column<this._context.column)e.leadingWord.word?this.trigger({auto:this._context.auto,shy:!1},!0):this.cancel();else if(this._completionModel)if(0!==e.leadingWord.word.length&&e.leadingWord.startColumn>this._context.leadingWord.startColumn){const e=new Set(this._languageFeaturesService.completionProvider.all(this._editor.getModel()));for(let n of this._completionModel.allProvider)e.delete(n);const t=this._completionModel.adopt(new Set);this.trigger({auto:this._context.auto,shy:!1},!0,e,{items:t,clipboardText:this._completionModel.clipboardText})}else if(e.column>this._context.column&&this._completionModel.incomplete.size>0&&0!==e.leadingWord.word.length){const{incomplete:e}=this._completionModel,t=this._completionModel.adopt(e);this.trigger({auto:2===this._state,shy:!1,triggerKind:2},!0,e,{items:t,clipboardText:this._completionModel.clipboardText})}else{let t=this._completionModel.lineContext,n=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},0===this._completionModel.items.length){if(LineContext.shouldAutoTrigger(this._editor)&&this._context.leadingWord.endColumn<e.leadingWord.startColumn)return void this.trigger({auto:this._context.auto,shy:!1},!0);if(this._context.auto)return void this.cancel();if(this._completionModel.lineContext=t,n=this._completionModel.items.length>0,n&&0===e.leadingWord.word.length)return void this.cancel()}this._onDidSuggest.fire({completionModel:this._completionModel,auto:this._context.auto,shy:this._context.shy,isFrozen:n})}}else this.cancel();else this.cancel()}};SuggestModel=__decorate$N([__param$M(1,IEditorWorkerService),__param$M(2,IClipboardService),__param$M(3,ITelemetryService),__param$M(4,ILogService),__param$M(5,IContextKeyService),__param$M(6,IConfigurationService),__param$M(7,ILanguageFeaturesService)],SuggestModel);class OvertypingCapturer{constructor(e,t){this._disposables=new DisposableStore,this._lastOvertyped=[],this._empty=!0,this._disposables.add(e.onWillType((()=>{if(!this._empty)return;if(!e.hasModel())return;const t=e.getSelections(),n=t.length;let i=!1;for(let e=0;e<n;e++)if(!t[e].isEmpty()){i=!0;break}if(!i)return;this._lastOvertyped=[];const o=e.getModel();for(let e=0;e<n;e++){const n=t[e];if(o.getValueLengthInRange(n)>OvertypingCapturer._maxSelectionLength)return;this._lastOvertyped[e]={value:o.getValueInRange(n),multiline:n.startLineNumber!==n.endLineNumber}}this._empty=!1}))),this._disposables.add(t.onDidCancel((e=>{this._empty||e.retrigger||(this._empty=!0)})))}getLastOvertypedInfo(e){if(!this._empty&&e>=0&&e<this._lastOvertyped.length)return this._lastOvertyped[e]}dispose(){this._disposables.dispose()}}OvertypingCapturer._maxSelectionLength=51200;var codicon="",codiconModifiers="";function formatRule(e){let t=e.definition;for(;t instanceof Codicon;)t=t.definition;return`.codicon-${e.id}:before { content: '${t.fontCharacter}'; }`}var suggest="",__decorate$M=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$L=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};class StatusBarViewItem extends MenuEntryActionViewItem{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=localize("ddd","{0} ({1})",this._action.label,StatusBarViewItem.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return null===(t=e.getLabel())||void 0===t?void 0:t.replace(/\benter\b/gi,"⏎")}}let SuggestWidgetStatus=class{constructor(e,t,n,i){this._menuService=n,this._contextKeyService=i,this._menuDisposables=new DisposableStore,this.element=append$1(e,$$c(".suggest-status-bar"));const o=e=>e instanceof MenuItemAction?t.createInstance(StatusBarViewItem,e,void 0):void 0;this._leftActions=new ActionBar(this.element,{actionViewItemProvider:o}),this._rightActions=new ActionBar(this.element,{actionViewItemProvider:o}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(suggestWidgetStatusbarMenu,this._contextKeyService),t=()=>{const t=[],n=[];for(let[i,o]of e.getActions())"left"===i?t.push(...o):n.push(...o);this._leftActions.clear(),this._leftActions.push(t),this._rightActions.clear(),this._rightActions.push(n)};this._menuDisposables.add(e.onDidChange((()=>t()))),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};SuggestWidgetStatus=__decorate$M([__param$L(1,IInstantiationService),__param$L(2,IMenuService),__param$L(3,IContextKeyService)],SuggestWidgetStatus);const SYMBOL_ICON_ARRAY_FOREGROUND=registerColor("symbolIcon.arrayForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_BOOLEAN_FOREGROUND=registerColor("symbolIcon.booleanForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_CLASS_FOREGROUND=registerColor("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},localize("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_COLOR_FOREGROUND=registerColor("symbolIcon.colorForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_CONSTANT_FOREGROUND=registerColor("symbolIcon.constantForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_CONSTRUCTOR_FOREGROUND=registerColor("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},localize("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_ENUMERATOR_FOREGROUND=registerColor("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},localize("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_ENUMERATOR_MEMBER_FOREGROUND=registerColor("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},localize("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_EVENT_FOREGROUND=registerColor("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},localize("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_FIELD_FOREGROUND=registerColor("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},localize("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_FILE_FOREGROUND=registerColor("symbolIcon.fileForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_FOLDER_FOREGROUND=registerColor("symbolIcon.folderForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_FUNCTION_FOREGROUND=registerColor("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},localize("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_INTERFACE_FOREGROUND=registerColor("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},localize("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_KEY_FOREGROUND=registerColor("symbolIcon.keyForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_KEYWORD_FOREGROUND=registerColor("symbolIcon.keywordForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_METHOD_FOREGROUND=registerColor("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},localize("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_MODULE_FOREGROUND=registerColor("symbolIcon.moduleForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_NAMESPACE_FOREGROUND=registerColor("symbolIcon.namespaceForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_NULL_FOREGROUND=registerColor("symbolIcon.nullForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_NUMBER_FOREGROUND=registerColor("symbolIcon.numberForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_OBJECT_FOREGROUND=registerColor("symbolIcon.objectForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_OPERATOR_FOREGROUND=registerColor("symbolIcon.operatorForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_PACKAGE_FOREGROUND=registerColor("symbolIcon.packageForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_PROPERTY_FOREGROUND=registerColor("symbolIcon.propertyForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_REFERENCE_FOREGROUND=registerColor("symbolIcon.referenceForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_SNIPPET_FOREGROUND=registerColor("symbolIcon.snippetForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_STRING_FOREGROUND=registerColor("symbolIcon.stringForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_STRUCT_FOREGROUND=registerColor("symbolIcon.structForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_TEXT_FOREGROUND=registerColor("symbolIcon.textForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_TYPEPARAMETER_FOREGROUND=registerColor("symbolIcon.typeParameterForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_UNIT_FOREGROUND=registerColor("symbolIcon.unitForeground",{dark:foreground,light:foreground,hc:foreground},localize("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),SYMBOL_ICON_VARIABLE_FOREGROUND=registerColor("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},localize("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerThemingParticipant(((e,t)=>{const n=e.getColor(SYMBOL_ICON_ARRAY_FOREGROUND);n&&t.addRule(`${Codicon.symbolArray.cssSelector} { color: ${n}; }`);const i=e.getColor(SYMBOL_ICON_BOOLEAN_FOREGROUND);i&&t.addRule(`${Codicon.symbolBoolean.cssSelector} { color: ${i}; }`);const o=e.getColor(SYMBOL_ICON_CLASS_FOREGROUND);o&&t.addRule(`${Codicon.symbolClass.cssSelector} { color: ${o}; }`);const r=e.getColor(SYMBOL_ICON_METHOD_FOREGROUND);r&&t.addRule(`${Codicon.symbolMethod.cssSelector} { color: ${r}; }`);const s=e.getColor(SYMBOL_ICON_COLOR_FOREGROUND);s&&t.addRule(`${Codicon.symbolColor.cssSelector} { color: ${s}; }`);const a=e.getColor(SYMBOL_ICON_CONSTANT_FOREGROUND);a&&t.addRule(`${Codicon.symbolConstant.cssSelector} { color: ${a}; }`);const l=e.getColor(SYMBOL_ICON_CONSTRUCTOR_FOREGROUND);l&&t.addRule(`${Codicon.symbolConstructor.cssSelector} { color: ${l}; }`);const c=e.getColor(SYMBOL_ICON_ENUMERATOR_FOREGROUND);c&&t.addRule(`\n\t\t\t${Codicon.symbolValue.cssSelector},${Codicon.symbolEnum.cssSelector} { color: ${c}; }`);const d=e.getColor(SYMBOL_ICON_ENUMERATOR_MEMBER_FOREGROUND);d&&t.addRule(`${Codicon.symbolEnumMember.cssSelector} { color: ${d}; }`);const u=e.getColor(SYMBOL_ICON_EVENT_FOREGROUND);u&&t.addRule(`${Codicon.symbolEvent.cssSelector} { color: ${u}; }`);const h=e.getColor(SYMBOL_ICON_FIELD_FOREGROUND);h&&t.addRule(`${Codicon.symbolField.cssSelector} { color: ${h}; }`);const g=e.getColor(SYMBOL_ICON_FILE_FOREGROUND);g&&t.addRule(`${Codicon.symbolFile.cssSelector} { color: ${g}; }`);const p=e.getColor(SYMBOL_ICON_FOLDER_FOREGROUND);p&&t.addRule(`${Codicon.symbolFolder.cssSelector} { color: ${p}; }`);const f=e.getColor(SYMBOL_ICON_FUNCTION_FOREGROUND);f&&t.addRule(`${Codicon.symbolFunction.cssSelector} { color: ${f}; }`);const m=e.getColor(SYMBOL_ICON_INTERFACE_FOREGROUND);m&&t.addRule(`${Codicon.symbolInterface.cssSelector} { color: ${m}; }`);const v=e.getColor(SYMBOL_ICON_KEY_FOREGROUND);v&&t.addRule(`${Codicon.symbolKey.cssSelector} { color: ${v}; }`);const _=e.getColor(SYMBOL_ICON_KEYWORD_FOREGROUND);_&&t.addRule(`${Codicon.symbolKeyword.cssSelector} { color: ${_}; }`);const C=e.getColor(SYMBOL_ICON_MODULE_FOREGROUND);C&&t.addRule(`${Codicon.symbolModule.cssSelector} { color: ${C}; }`);const b=e.getColor(SYMBOL_ICON_NAMESPACE_FOREGROUND);b&&t.addRule(`${Codicon.symbolNamespace.cssSelector} { color: ${b}; }`);const y=e.getColor(SYMBOL_ICON_NULL_FOREGROUND);y&&t.addRule(`${Codicon.symbolNull.cssSelector} { color: ${y}; }`);const S=e.getColor(SYMBOL_ICON_NUMBER_FOREGROUND);S&&t.addRule(`${Codicon.symbolNumber.cssSelector} { color: ${S}; }`);const w=e.getColor(SYMBOL_ICON_OBJECT_FOREGROUND);w&&t.addRule(`${Codicon.symbolObject.cssSelector} { color: ${w}; }`);const E=e.getColor(SYMBOL_ICON_OPERATOR_FOREGROUND);E&&t.addRule(`${Codicon.symbolOperator.cssSelector} { color: ${E}; }`);const x=e.getColor(SYMBOL_ICON_PACKAGE_FOREGROUND);x&&t.addRule(`${Codicon.symbolPackage.cssSelector} { color: ${x}; }`);const T=e.getColor(SYMBOL_ICON_PROPERTY_FOREGROUND);T&&t.addRule(`${Codicon.symbolProperty.cssSelector} { color: ${T}; }`);const I=e.getColor(SYMBOL_ICON_REFERENCE_FOREGROUND);I&&t.addRule(`${Codicon.symbolReference.cssSelector} { color: ${I}; }`);const k=e.getColor(SYMBOL_ICON_SNIPPET_FOREGROUND);k&&t.addRule(`${Codicon.symbolSnippet.cssSelector} { color: ${k}; }`);const L=e.getColor(SYMBOL_ICON_STRING_FOREGROUND);L&&t.addRule(`${Codicon.symbolString.cssSelector} { color: ${L}; }`);const D=e.getColor(SYMBOL_ICON_STRUCT_FOREGROUND);D&&t.addRule(`${Codicon.symbolStruct.cssSelector} { color: ${D}; }`);const N=e.getColor(SYMBOL_ICON_TEXT_FOREGROUND);N&&t.addRule(`${Codicon.symbolText.cssSelector} { color: ${N}; }`);const O=e.getColor(SYMBOL_ICON_TYPEPARAMETER_FOREGROUND);O&&t.addRule(`${Codicon.symbolTypeParameter.cssSelector} { color: ${O}; }`);const A=e.getColor(SYMBOL_ICON_UNIT_FOREGROUND);A&&t.addRule(`${Codicon.symbolUnit.cssSelector} { color: ${A}; }`);const P=e.getColor(SYMBOL_ICON_VARIABLE_FOREGROUND);P&&t.addRule(`${Codicon.symbolVariable.cssSelector} { color: ${P}; }`)}));class ResizableHTMLElement{constructor(){let e;this._onDidWillResize=new Emitter$1,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new Emitter$1,this.onDidResize=this._onDidResize.event,this._sashListener=new DisposableStore,this._size=new Dimension(0,0),this._minSize=new Dimension(0,0),this._maxSize=new Dimension(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Sash(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Sash(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Sash(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:OrthogonalEdge.North}),this._southSash=new Sash(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:OrthogonalEdge.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let t=0,n=0;this._sashListener.add(Event$1.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)((()=>{void 0===e&&(this._onDidWillResize.fire(),e=this._size,t=0,n=0)}))),this._sashListener.add(Event$1.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)((()=>{void 0!==e&&(e=void 0,t=0,n=0,this._onDidResize.fire({dimension:this._size,done:!0}))}))),this._sashListener.add(this._eastSash.onDidChange((i=>{e&&(n=i.currentX-i.startX,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))}))),this._sashListener.add(this._westSash.onDidChange((i=>{e&&(n=-(i.currentX-i.startX),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))}))),this._sashListener.add(this._northSash.onDidChange((i=>{e&&(t=-(i.currentY-i.startY),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))}))),this._sashListener.add(this._southSash.onDidChange((i=>{e&&(t=i.currentY-i.startY,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))}))),this._sashListener.add(Event$1.any(this._eastSash.onDidReset,this._westSash.onDidReset)((e=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))),this._sashListener.add(Event$1.any(this._northSash.onDidReset,this._southSash.onDidReset)((e=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))})))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,n,i){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=n?3:0,this._westSash.state=i?3:0}layout(e=this.size.height,t=this.size.width){const{height:n,width:i}=this._minSize,{height:o,width:r}=this._maxSize;e=Math.max(n,Math.min(o,e)),t=Math.max(i,Math.min(r,t));const s=new Dimension(t,e);Dimension.equals(s,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=s,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}var __decorate$L=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$K=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};function canExpandCompletionItem(e){return!!e&&Boolean(e.completion.documentation||e.completion.detail&&e.completion.detail!==e.completion.label)}let SuggestDetailsWidget=class{constructor(e,t){this._editor=e,this._onDidClose=new Emitter$1,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new Emitter$1,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new DisposableStore,this._renderDisposeable=new DisposableStore,this._borderWidth=1,this._size=new Dimension(330,0),this.domNode=$$c(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(MarkdownRenderer,{editor:e}),this._body=$$c(".body"),this._scrollbar=new DomScrollableElement(this._body,{}),append$1(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=append$1(this._body,$$c(".header")),this._close=append$1(this._header,$$c("span"+Codicon.close.cssSelector)),this._close.title=localize("details.close","Close"),this._type=append$1(this._header,$$c("p.type")),this._docs=append$1(this._body,$$c("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(44)&&this._configureFont()})))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(44),n=t.getMassagedFontFamily(isSafari?EDITOR_FONT_DEFAULTS.fontFamily:null),i=e.get(107)||t.fontSize,o=e.get(108)||t.lineHeight,r=t.fontWeight,s=`${i}px`,a=`${o}px`;this.domNode.style.fontSize=s,this.domNode.style.lineHeight=""+o/i,this.domNode.style.fontWeight=r,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=n,this._close.style.height=a,this._close.style.width=a}getLayoutInfo(){const e=this._editor.getOption(108)||this._editor.getOption(44).lineHeight,t=this._borderWidth;return{lineHeight:e,borderWidth:t,borderHeight:2*t,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=localize("loading","Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,2*this.getLayoutInfo().lineHeight),this._onDidChangeContents.fire(this)}renderItem(e,t){var n,i;this._renderDisposeable.clear();let{detail:o,documentation:r}=e.completion;if(t){let t="";t+=`score: ${e.score[0]}\n`,t+=`prefix: ${null!==(n=e.word)&&void 0!==n?n:"(no prefix)"}\n`,t+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}\n`,t+=`distance: ${e.distance} (localityBonus-setting)\n`,t+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}\n`,t+=`commit_chars: ${null===(i=e.completion.commitCharacters)||void 0===i?void 0:i.join("")}\n`,r=(new MarkdownString).appendCodeblock("empty",t),o=`Provider: ${e.provider._debugDisplayName}`}if(t||canExpandCompletionItem(e)){if(this.domNode.classList.remove("no-docs","no-type"),o){const e=o.length>1e5?`${o.substr(0,1e5)}…`:o;this._type.textContent=e,this._type.title=e,show(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gim.test(e))}else clearNode(this._type),this._type.title="",hide(this._type),this.domNode.classList.add("no-type");if(clearNode(this._docs),"string"==typeof r)this._docs.classList.remove("markdown-docs"),this._docs.textContent=r;else if(r){this._docs.classList.add("markdown-docs"),clearNode(this._docs);const e=this._markdownRenderer.render(r);this._docs.appendChild(e.element),this._renderDisposeable.add(e),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync((()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)})))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=e=>{e.preventDefault(),e.stopPropagation()},this._close.onclick=e=>{e.preventDefault(),e.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}else this.clearContents()}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get size(){return this._size}layout(e,t){const n=new Dimension(e,t);Dimension.equals(n,this._size)||(this._size=n,size(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};SuggestDetailsWidget=__decorate$L([__param$K(1,IInstantiationService)],SuggestDetailsWidget);class SuggestDetailsOverlay{constructor(e,t){let n,i;this.widget=e,this._editor=t,this._disposables=new DisposableStore,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new ResizableHTMLElement,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let o=0,r=0;this._disposables.add(this._resizable.onDidWillResize((()=>{n=this._topLeft,i=this._resizable.size}))),this._disposables.add(this._resizable.onDidResize((e=>{if(n&&i){this.widget.layout(e.dimension.width,e.dimension.height);let t=!1;e.west&&(r=i.width-e.dimension.width,t=!0),e.north&&(o=i.height-e.dimension.height,t=!0),t&&this._applyTopLeft({top:n.top+o,left:n.left+r})}e.done&&(n=void 0,i=void 0,o=0,r=0,this._userSize=e.dimension)}))),this._disposables.add(this.widget.onDidChangeContents((()=>{var e;this._anchorBox&&this._placeAtAnchor(this._anchorBox,null!==(e=this._userSize)&&void 0!==e?e:this.widget.size,this._preferAlignAtTop)})))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return null}show(){this._added||(this._editor.addOverlayWidget(this),this.getDomNode().style.position="fixed",this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){var n;const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,null!==(n=this._userSize)&&void 0!==n?n:this.widget.size,t)}_placeAtAnchor(e,t,n){var i;const o=getClientArea(document.body),r=this.widget.getLayoutInfo(),s=new Dimension(220,2*r.lineHeight),a=e.top,l=function(){const n=o.width-(e.left+e.width+r.borderWidth+r.horizontalPadding),i=-r.borderWidth+e.left+e.width,l=new Dimension(n,o.height-e.top-r.borderHeight-r.verticalPadding),c=l.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:a,left:i,fit:n-t.width,maxSizeTop:l,maxSizeBottom:c,minSize:s.with(Math.min(n,s.width))}}(),c=[l,function(){const n=e.left-r.borderWidth-r.horizontalPadding,i=Math.max(r.horizontalPadding,e.left-t.width-r.borderWidth),l=new Dimension(n,o.height-e.top-r.borderHeight-r.verticalPadding),c=l.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:a,left:i,fit:n-t.width,maxSizeTop:l,maxSizeBottom:c,minSize:s.with(Math.min(n,s.width))}}(),function(){const n=e.left,i=-r.borderWidth+e.top+e.height,a=new Dimension(e.width-r.borderHeight,o.height-e.top-e.height-r.verticalPadding);return{top:i,left:n,fit:a.height-t.height,maxSizeBottom:a,maxSizeTop:a,minSize:s.with(a.width)}}()],d=null!==(i=c.find((e=>e.fit>=0)))&&void 0!==i?i:c.sort(((e,t)=>t.fit-e.fit))[0],u=e.top+e.height-r.borderHeight;let h,g=t.height;const p=Math.max(d.maxSizeTop.height,d.maxSizeBottom.height);let f;g>p&&(g=p),n?g<=d.maxSizeTop.height?(h=!0,f=d.maxSizeTop):(h=!1,f=d.maxSizeBottom):g<=d.maxSizeBottom.height?(h=!1,f=d.maxSizeBottom):(h=!0,f=d.maxSizeTop),this._applyTopLeft({left:d.left,top:h?d.top:u-g}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!h,d===l,h,d!==l),this._resizable.minSize=d.minSize,this._resizable.maxSize=f,this._resizable.layout(g,Math.min(f.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left=`${this._topLeft.left}px`,this.getDomNode().style.top=`${this._topLeft.top}px`}}var FileKind,FileKind2;FileKind2=FileKind||(FileKind={}),FileKind2[FileKind2.FILE=0]="FILE",FileKind2[FileKind2.FOLDER=1]="FOLDER",FileKind2[FileKind2.ROOT_FOLDER=2]="ROOT_FOLDER";const fileIconDirectoryRegex=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function getIconClasses(e,t,n,i){const o=i===FileKind.ROOT_FOLDER?["rootfolder-icon"]:i===FileKind.FOLDER?["folder-icon"]:["file-icon"];if(n){let r;if(n.scheme===Schemas.data){r=DataUri.parseMetaData(n).get(DataUri.META_DATA_LABEL)}else{const e=n.path.match(fileIconDirectoryRegex);e?(r=cssEscape(e[2].toLowerCase()),e[1]&&o.push(`${cssEscape(e[1].toLowerCase())}-name-dir-icon`)):r=cssEscape(n.authority.toLowerCase())}if(i===FileKind.FOLDER)o.push(`${r}-name-folder-icon`);else{if(r){if(o.push(`${r}-name-file-icon`),o.push("name-file-icon"),r.length<=255){const e=r.split(".");for(let t=1;t<e.length;t++)o.push(`${e.slice(t).join(".")}-ext-file-icon`)}o.push("ext-file-icon")}const i=detectLanguageId(e,t,n);i&&o.push(`${cssEscape(i)}-lang-file-icon`)}}return o}function detectLanguageId(e,t,n){if(!n)return null;let i=null;if(n.scheme===Schemas.data){const e=DataUri.parseMetaData(n).get(DataUri.META_DATA_MIME);e&&(i=t.getLanguageIdByMimeType(e))}else{const t=e.getModel(n);t&&(i=t.getLanguageId())}return i&&i!==PLAINTEXT_LANGUAGE_ID?i:t.guessLanguageIdByFilepathOrFirstLine(n)}function cssEscape(e){return e.replace(/[\11\12\14\15\40]/g,"/")}var __decorate$K=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$J=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},_a$5;function getAriaId(e){return`suggest-aria-id:${e}`}const suggestMoreInfoIcon=registerIcon("suggest-more-info",Codicon.chevronRight,localize("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),_completionItemColor=new(_a$5=class e{extract(t,n){if(t.textLabel.match(e._regexStrict))return n[0]=t.textLabel,!0;if(t.completion.detail&&t.completion.detail.match(e._regexStrict))return n[0]=t.completion.detail,!0;if("string"==typeof t.completion.documentation){const i=e._regexRelaxed.exec(t.completion.documentation);if(i&&(0===i.index||i.index+i[0].length===t.completion.documentation.length))return n[0]=i[0],!0}return!1}},_a$5._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,_a$5._regexStrict=new RegExp(`^${_a$5._regexRelaxed.source}$`,"i"),_a$5);let ItemRenderer=class{constructor(e,t,n,i){this._editor=e,this._modelService=t,this._languageService=n,this._themeService=i,this._onDidToggleDetails=new Emitter$1,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=Object.create(null);t.disposables=new DisposableStore,t.root=e,t.root.classList.add("show-file-icons"),t.icon=append$1(e,$$c(".icon")),t.colorspan=append$1(t.icon,$$c("span.colorspan"));const n=append$1(e,$$c(".contents")),i=append$1(n,$$c(".main"));t.iconContainer=append$1(i,$$c(".icon-label.codicon")),t.left=append$1(i,$$c("span.left")),t.right=append$1(i,$$c("span.right")),t.iconLabel=new IconLabel(t.left,{supportHighlights:!0,supportIcons:!0}),t.disposables.add(t.iconLabel),t.parametersLabel=append$1(t.left,$$c("span.signature-label")),t.qualifierLabel=append$1(t.left,$$c("span.qualifier-label")),t.detailsLabel=append$1(t.right,$$c("span.details-label")),t.readMore=append$1(t.right,$$c("span.readMore"+ThemeIcon.asCSSSelector(suggestMoreInfoIcon))),t.readMore.title=localize("readMore","Read More");const o=()=>{const e=this._editor.getOptions(),n=e.get(44),o=n.getMassagedFontFamily(isSafari?EDITOR_FONT_DEFAULTS.fontFamily:null),r=n.fontFeatureSettings,s=e.get(107)||n.fontSize,a=e.get(108)||n.lineHeight,l=n.fontWeight,c=`${s}px`,d=`${a}px`;t.root.style.fontSize=c,t.root.style.fontWeight=l,i.style.fontFamily=o,i.style.fontFeatureSettings=r,i.style.lineHeight=d,t.icon.style.height=d,t.icon.style.width=d,t.readMore.style.height=d,t.readMore.style.width=d};return o(),t.disposables.add(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(44)||e.hasChanged(107)||e.hasChanged(108))&&o()}))),t}renderElement(e,t,n){const{completion:i}=e;n.root.id=getAriaId(t),n.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:createMatches(e.score)};let r=[];if(19===i.kind&&_completionItemColor.extract(e,r))n.icon.className="icon customcolor",n.iconContainer.className="icon hide",n.colorspan.style.backgroundColor=r[0];else if(20===i.kind&&this._themeService.getFileIconTheme().hasFileIcons){n.icon.className="icon hide",n.iconContainer.className="icon hide";const t=getIconClasses(this._modelService,this._languageService,URI.from({scheme:"fake",path:e.textLabel}),FileKind.FILE),r=getIconClasses(this._modelService,this._languageService,URI.from({scheme:"fake",path:i.detail}),FileKind.FILE);o.extraClasses=t.length>r.length?t:r}else 23===i.kind&&this._themeService.getFileIconTheme().hasFolderIcons?(n.icon.className="icon hide",n.iconContainer.className="icon hide",o.extraClasses=flatten([getIconClasses(this._modelService,this._languageService,URI.from({scheme:"fake",path:e.textLabel}),FileKind.FOLDER),getIconClasses(this._modelService,this._languageService,URI.from({scheme:"fake",path:i.detail}),FileKind.FOLDER)])):(n.icon.className="icon hide",n.iconContainer.className="",n.iconContainer.classList.add("suggest-icon",...CSSIcon.asClassNameArray(CompletionItemKinds.toIcon(i.kind))));i.tags&&i.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),n.iconLabel.setLabel(e.textLabel,void 0,o),"string"==typeof i.label?(n.parametersLabel.textContent="",n.detailsLabel.textContent=stripNewLines(i.detail||""),n.root.classList.add("string-label")):(n.parametersLabel.textContent=stripNewLines(i.label.detail||""),n.detailsLabel.textContent=stripNewLines(i.label.description||""),n.root.classList.remove("string-label")),this._editor.getOption(106).showInlineDetails?show(n.detailsLabel):hide(n.detailsLabel),canExpandCompletionItem(e)?(n.right.classList.add("can-expand-details"),show(n.readMore),n.readMore.onmousedown=e=>{e.stopPropagation(),e.preventDefault()},n.readMore.onclick=e=>{e.stopPropagation(),e.preventDefault(),this._onDidToggleDetails.fire()}):(n.right.classList.remove("can-expand-details"),hide(n.readMore),n.readMore.onmousedown=null,n.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};function stripNewLines(e){return e.replace(/\r\n|\r|\n/g,"")}ItemRenderer=__decorate$K([__param$J(1,IModelService),__param$J(2,ILanguageService),__param$J(3,IThemeService)],ItemRenderer);var __decorate$J=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$I=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$r=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};registerColor("editorSuggestWidget.background",{dark:editorWidgetBackground,light:editorWidgetBackground,hc:editorWidgetBackground},localize("editorSuggestWidgetBackground","Background color of the suggest widget.")),registerColor("editorSuggestWidget.border",{dark:editorWidgetBorder,light:editorWidgetBorder,hc:editorWidgetBorder},localize("editorSuggestWidgetBorder","Border color of the suggest widget."));const editorSuggestWidgetForeground=registerColor("editorSuggestWidget.foreground",{dark:editorForeground,light:editorForeground,hc:editorForeground},localize("editorSuggestWidgetForeground","Foreground color of the suggest widget."));registerColor("editorSuggestWidget.selectedForeground",{dark:quickInputListFocusForeground,light:quickInputListFocusForeground,hc:quickInputListFocusForeground},localize("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget.")),registerColor("editorSuggestWidget.selectedIconForeground",{dark:quickInputListFocusIconForeground,light:quickInputListFocusIconForeground,hc:quickInputListFocusIconForeground},localize("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const editorSuggestWidgetSelectedBackground=registerColor("editorSuggestWidget.selectedBackground",{dark:quickInputListFocusBackground,light:quickInputListFocusBackground,hc:quickInputListFocusBackground},localize("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));registerColor("editorSuggestWidget.highlightForeground",{dark:listHighlightForeground,light:listHighlightForeground,hc:listHighlightForeground},localize("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget.")),registerColor("editorSuggestWidget.focusHighlightForeground",{dark:listFocusHighlightForeground,light:listFocusHighlightForeground,hc:listFocusHighlightForeground},localize("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused.")),registerColor("editorSuggestWidgetStatus.foreground",{dark:transparent(editorSuggestWidgetForeground,.5),light:transparent(editorSuggestWidgetForeground,.5),hc:transparent(editorSuggestWidgetForeground,.5)},localize("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class PersistedWidgetSize{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof EmbeddedCodeEditorWidget}`}restore(){var e;const t=null!==(e=this._service.get(this._key,0))&&void 0!==e?e:"";try{const e=JSON.parse(t);if(Dimension.is(e))return Dimension.lift(e)}catch(n){}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let SuggestWidget=class e{constructor(e,t,n,i,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new TimeoutTimer,this._disposables=new DisposableStore,this._onDidSelect=new Emitter$1,this._onDidFocus=new Emitter$1,this._onDidHide=new Emitter$1,this._onDidShow=new Emitter$1,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new Emitter$1,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new ResizableHTMLElement,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new SuggestContentWidget(this,e),this._persistedSize=new PersistedWidgetSize(t,e);class r{constructor(e,t,n=!1,i=!1){this.persistedSize=e,this.currentSize=t,this.persistHeight=n,this.persistWidth=i}}let s;this._disposables.add(this.element.onDidWillResize((()=>{this._contentWidget.lockPreference(),s=new r(this._persistedSize.restore(),this.element.size)}))),this._disposables.add(this.element.onDidResize((e=>{var t,n,i,o;if(this._resize(e.dimension.width,e.dimension.height),s&&(s.persistHeight=s.persistHeight||!!e.north||!!e.south,s.persistWidth=s.persistWidth||!!e.east||!!e.west),e.done){if(s){const{itemHeight:e,defaultSize:r}=this.getLayoutInfo(),a=Math.round(e/2);let{width:l,height:c}=this.element.size;(!s.persistHeight||Math.abs(s.currentSize.height-c)<=a)&&(c=null!==(n=null===(t=s.persistedSize)||void 0===t?void 0:t.height)&&void 0!==n?n:r.height),(!s.persistWidth||Math.abs(s.currentSize.width-l)<=a)&&(l=null!==(o=null===(i=s.persistedSize)||void 0===i?void 0:i.width)&&void 0!==o?o:r.width),this._persistedSize.store(new Dimension(l,c))}this._contentWidget.unlockPreference(),s=void 0}}))),this._messageElement=append$1(this.element.domNode,$$c(".message")),this._listElement=append$1(this.element.domNode,$$c(".tree"));const a=o.createInstance(SuggestDetailsWidget,this.editor);a.onDidClose(this.toggleDetails,this,this._disposables),this._details=new SuggestDetailsOverlay(a,this.editor);const l=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(106).showIcons);l();const c=o.createInstance(ItemRenderer,this.editor);this._disposables.add(c),this._disposables.add(c.onDidToggleDetails((()=>this.toggleDetails()))),this._list=new List("SuggestWidget",this._listElement,{getHeight:e=>this.getLayoutInfo().itemHeight,getTemplateId:e=>"suggestion"},[c],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>localize("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:e=>{let t=e.textLabel;if("string"!=typeof e.completion.label){const{detail:n,description:i}=e.completion.label;n&&i?t=localize("label.full","{0}{1}, {2}",t,n,i):n?t=localize("label.detail","{0}{1}",t,n):i&&(t=localize("label.desc","{0}, {1}",t,i))}if(!e.isResolved||!this._isDetailsVisible())return t;const{documentation:n,detail:i}=e.completion;return localize("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",t,format("{0}{1}",i||"",n?"string"==typeof n?n:n.value:""))}}}),this._status=o.createInstance(SuggestWidgetStatus,this.element.domNode);const d=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(106).showStatusBar);d(),this._disposables.add(attachListStyler(this._list,i,{listInactiveFocusBackground:editorSuggestWidgetSelectedBackground,listInactiveFocusOutline:activeContrastBorder})),this._disposables.add(i.onDidColorThemeChange((e=>this._onThemeChange(e)))),this._onThemeChange(i.getColorTheme()),this._disposables.add(this._list.onMouseDown((e=>this._onListMouseDownOrTap(e)))),this._disposables.add(this._list.onTap((e=>this._onListMouseDownOrTap(e)))),this._disposables.add(this._list.onDidChangeSelection((e=>this._onListSelection(e)))),this._disposables.add(this._list.onDidChangeFocus((e=>this._onListFocus(e)))),this._disposables.add(this.editor.onDidChangeCursorSelection((()=>this._onCursorSelectionChanged()))),this._disposables.add(this.editor.onDidChangeConfiguration((e=>{e.hasChanged(106)&&(d(),l())}))),this._ctxSuggestWidgetVisible=Context$2.Visible.bindTo(n),this._ctxSuggestWidgetDetailsVisible=Context$2.DetailsVisible.bindTo(n),this._ctxSuggestWidgetMultipleSuggestions=Context$2.MultipleSuggestions.bindTo(n),this._disposables.add(addStandardDisposableListener(this._details.widget.domNode,"keydown",(e=>{this._onDetailsKeydown.fire(e)}))),this._disposables.add(this.editor.onMouseDown((e=>this._onEditorMouseDown(e))))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),null===(e=this._loadingTimeout)||void 0===e||e.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){0!==this._state&&this._contentWidget.layout()}_onListMouseDownOrTap(e){void 0!==e.element&&void 0!==e.index&&(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const n=this._completionModel;n&&(this._onDidSelect.fire({item:e,index:t,model:n}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth="hc"===e.type?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length)return this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),void this.editor.setAriaOptions({activeDescendant:void 0});if(!this._completionModel)return;const n=e.elements[0],i=e.indexes[0];n!==this._focusedItem&&(null===(t=this._currentSuggestionDetails)||void 0===t||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=n,this._list.reveal(i),this._currentSuggestionDetails=createCancelablePromise((e=>__awaiter$r(this,void 0,void 0,(function*(){const t=disposableTimeout((()=>{this._isDetailsVisible()&&this.showDetails(!0)}),250),i=e.onCancellationRequested((()=>t.dispose())),o=yield n.resolve(e);return t.dispose(),i.dispose(),o})))),this._currentSuggestionDetails.then((()=>{i>=this._list.length||n!==this._list.element(i)||(this._ignoreFocusEvents=!0,this._list.splice(i,1,[n]),this._list.setFocus([i]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:getAriaId(i)}))})).catch(onUnexpectedError)),this._onDidFocus.fire({item:n,index:i,model:this._completionModel})}_setState(t){if(this._state!==t)switch(this._state=t,this.element.domNode.classList.toggle("frozen",4===t),this.element.domNode.classList.remove("message"),t){case 0:hide(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=e.LOADING_MESSAGE,hide(this._listElement,this._status.element),show(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0;break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=e.NO_SUGGESTIONS_MESSAGE,hide(this._listElement,this._status.element),show(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0;break;case 3:case 4:hide(this._messageElement),show(this._listElement,this._status.element),this._show();break;case 5:hide(this._messageElement),show(this._listElement,this._status.element),this._details.show(),this._show()}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet((()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)}),100)}showTriggered(e,t){0===this._state&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=disposableTimeout((()=>this._setState(1)),t)))}showSuggestions(e,t,n,i){var o,r;if(this._contentWidget.setPosition(this.editor.getPosition()),null===(o=this._loadingTimeout)||void 0===o||o.dispose(),null===(r=this._currentSuggestionDetails)||void 0===r||r.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),n&&2!==this._state&&0!==this._state)return void this._setState(4);const s=this._completionModel.items.length,a=0===s;if(this._ctxSuggestWidgetMultipleSuggestions.set(s>1),a)return this._setState(i?0:2),void(this._completionModel=void 0);this._focusedItem=void 0,this._list.splice(0,this._list.length,this._completionModel.items),this._setState(n?4:3),this._list.reveal(t,0),this._list.setFocus([t]),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(0!==this._state&&2!==this._state&&1!==this._state&&this._completionModel)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){5===this._state?(this._setState(3),this._details.widget.domNode.classList.remove("focused")):3===this._state&&this._isDetailsVisible()&&(this._setState(5),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):!canExpandCompletionItem(this._list.getFocusedElements()[0])&&!this._explainMode||3!==this._state&&5!==this._state&&4!==this._state||(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._positionDetails(),this.editor.focus(),this.element.domNode.classList.add("shows-details")}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;null===(e=this._loadingTimeout)||void 0===e||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),n=Math.ceil(4.3*this.getLayoutInfo().itemHeight);t&&t.height<n&&this._persistedSize.store(t.with(void 0,n))}isFrozen(){return 4===this._state}_afterRender(e){null!==e?2!==this._state&&1!==this._state&&(this._isDetailsVisible()&&this._details.show(),this._positionDetails()):this._isDetailsVisible()&&this._details.hide()}_layout(e){var t,n,i;if(!this.editor.hasModel())return;if(!this.editor.getDomNode())return;const o=getClientArea(document.body),r=this.getLayoutInfo();e||(e=r.defaultSize);let s=e.height,a=e.width;if(this._status.element.style.lineHeight=`${r.itemHeight}px`,2===this._state||1===this._state)s=r.itemHeight+r.borderHeight,a=r.defaultSize.width/2,this.element.enableSashes(!1,!1,!1,!1),this.element.minSize=this.element.maxSize=new Dimension(a,s),this._contentWidget.setPreference(2);else{const l=o.width-r.borderHeight-2*r.horizontalPadding;a>l&&(a=l);const c=this._completionModel?this._completionModel.stats.pLabelLen*r.typicalHalfwidthCharacterWidth:a,d=r.statusBarHeight+this._list.contentHeight+r.borderHeight,u=r.itemHeight+r.statusBarHeight,h=getDomNodePagePosition(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),p=h.top+g.top+g.height,f=Math.min(o.height-p-r.verticalPadding,d),m=h.top+g.top-r.verticalPadding,v=Math.min(m,d);let _=Math.min(Math.max(v,f)+r.borderHeight,d);s===(null===(t=this._cappedHeight)||void 0===t?void 0:t.capped)&&(s=this._cappedHeight.wanted),s<u&&(s=u),s>_&&(s=_);const C=150;s>f||this._forceRenderingAbove&&m>C?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),_=v):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),_=f),this.element.preferredSize=new Dimension(c,r.defaultSize.height),this.element.maxSize=new Dimension(l,_),this.element.minSize=new Dimension(220,u),this._cappedHeight=s===d?{wanted:null!==(i=null===(n=this._cappedHeight)||void 0===n?void 0:n.wanted)&&void 0!==i?i:e.height,capped:s}:void 0}this._resize(a,s)}_resize(e,t){const{width:n,height:i}=this.element.maxSize;e=Math.min(n,e),t=Math.min(i,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=t-o+"px",this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,2===(null===(e=this._contentWidget.getPosition())||void 0===e?void 0:e.preference[0]))}getLayoutInfo(){const e=this.editor.getOption(44),t=clamp(this.editor.getOption(108)||e.lineHeight,8,1e3),n=this.editor.getOption(106).showStatusBar&&2!==this._state&&1!==this._state?t:0,i=this._details.widget.borderWidth,o=2*i;return{itemHeight:t,statusBarHeight:n,borderWidth:i,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Dimension(430,n+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};SuggestWidget.LOADING_MESSAGE=localize("suggestWidget.loading","Loading..."),SuggestWidget.NO_SUGGESTIONS_MESSAGE=localize("suggestWidget.noSuggestions","No suggestions."),SuggestWidget=__decorate$J([__param$I(1,IStorageService),__param$I(2,IContextKeyService),__param$I(3,IThemeService),__param$I(4,IInstantiationService)],SuggestWidget);class SuggestContentWidget{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return!this._hidden&&this._position&&this._preference?{position:this._position,preference:[this._preference]}:null}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:n,horizontalPadding:i}=this._widget.getLayoutInfo();return new Dimension(t+2*n+i,e+2*n)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var __decorate$I=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$H=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};class LineSuffix{constructor(e,t){this._model=e,this._position=t;if(e.getLineMaxColumn(t.lineNumber)!==t.column){const n=e.getOffsetAt(t),i=e.getPositionAt(n+1);this._marker=e.deltaDecorations([],[{range:Range$2.fromPositions(t,i),options:{description:"suggest-line-suffix",stickiness:1}}])}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.deltaDecorations(this._marker,[])}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker[0]);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let SuggestController=class e{constructor(e,t,n,i,o,r,s){this._memoryService=t,this._commandService=n,this._contextKeyService=i,this._instantiationService=o,this._logService=r,this._telemetryService=s,this._lineSuffix=new MutableDisposable,this._toDispose=new DisposableStore,this._selectors=new PriorityRegistry((e=>e.priority)),this._telemetryGate=0,this.editor=e,this.model=o.createInstance(SuggestModel,this.editor);const a=Context$2.InsertMode.bindTo(i);a.set(e.getOption(106).insertMode),this.model.onDidTrigger((()=>a.set(e.getOption(106).insertMode))),this.widget=this._toDispose.add(new IdleValue((()=>{const e=this._instantiationService.createInstance(SuggestWidget,this.editor);this._toDispose.add(e),this._toDispose.add(e.onDidSelect((e=>this._insertSuggestion(e,0)),this));const t=new CommitCharacterController(this.editor,e,(e=>this._insertSuggestion(e,2)));this._toDispose.add(t),this._toDispose.add(this.model.onDidSuggest((e=>{0===e.completionModel.items.length&&t.reset()})));const n=Context$2.MakesTextEdit.bindTo(this._contextKeyService),i=Context$2.HasInsertAndReplaceRange.bindTo(this._contextKeyService),o=Context$2.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(toDisposable((()=>{n.reset(),i.reset(),o.reset()}))),this._toDispose.add(e.onDidFocus((({item:e})=>{const t=this.editor.getPosition(),r=e.editStart.column,s=t.column;let a=!0;if(!("smart"!==this.editor.getOption(1)||2!==this.model.state||e.completion.additionalTextEdits||4&e.completion.insertTextRules||s-r!==e.completion.insertText.length)){a=this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:r,endLineNumber:t.lineNumber,endColumn:s})!==e.completion.insertText}n.set(a),i.set(!Position$1.equals(e.editInsertEnd,e.editReplaceEnd)),o.set(Boolean(e.provider.resolveCompletionItem)||Boolean(e.completion.documentation)||e.completion.detail!==e.completion.label)}))),this._toDispose.add(e.onDetailsKeyDown((e=>{e.toKeybinding().equals(new SimpleKeybinding(!0,!1,!1,!1,33))||isMacintosh&&e.toKeybinding().equals(new SimpleKeybinding(!1,!1,!1,!0,33))?e.stopPropagation():e.toKeybinding().isModifierKey()||this.editor.focus()}))),e}))),this._overtypingCapturer=this._toDispose.add(new IdleValue((()=>this._toDispose.add(new OvertypingCapturer(this.editor,this.model))))),this._alternatives=this._toDispose.add(new IdleValue((()=>this._toDispose.add(new SuggestAlternatives(this.editor,this._contextKeyService))))),this._toDispose.add(o.createInstance(WordContextKey,e)),this._toDispose.add(this.model.onDidTrigger((e=>{this.widget.value.showTriggered(e.auto,e.shy?250:50),this._lineSuffix.value=new LineSuffix(this.editor.getModel(),e.position)}))),this._toDispose.add(this.model.onDidSuggest((e=>{if(!e.shy){let t=-1;for(const n of this._selectors.itemsOrderedByPriorityDesc)if(t=n.select(this.editor.getModel(),this.editor.getPosition(),e.completionModel.items),-1!==t)break;-1===t&&(t=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),e.completionModel.items)),this.widget.value.showSuggestions(e.completionModel,t,e.isFrozen,e.auto)}}))),this._toDispose.add(this.model.onDidCancel((e=>{e.retrigger||this.widget.value.hideWidget()}))),this._toDispose.add(this.editor.onDidBlurEditorWidget((()=>{this.model.cancel(),this.model.clear()})));let l=Context$2.AcceptSuggestionsOnEnter.bindTo(i),c=()=>{const e=this.editor.getOption(1);l.set("on"===e||"smart"===e)};this._toDispose.add(this.editor.onDidChangeConfiguration((()=>c()))),c()}static get(t){return t.getContribution(e.ID)}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose()}_insertSuggestion(e,t){if(!e||!e.item)return this._alternatives.value.reset(),this.model.cancel(),void this.model.clear();if(!this.editor.hasModel())return;const n=SnippetController2.get(this.editor);if(!n)return;const i=this.editor.getModel(),o=i.getAlternativeVersionId(),{item:r}=e,s=[],a=new CancellationTokenSource$1;1&t||this.editor.pushUndoStop();const l=this.getOverwriteInfo(r,Boolean(8&t));if(this._memoryService.memorize(i,this.editor.getPosition(),r),Array.isArray(r.completion.additionalTextEdits)){const e=StableEditorScrollState.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",r.completion.additionalTextEdits.map((e=>EditOperation.replace(Range$2.lift(e.range),e.text)))),e.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!r.isResolved){const e=new StopWatch(!0);let n;const o=i.onDidChangeContent((e=>{if(e.isFlush)return a.cancel(),void o.dispose();for(let t of e.changes){const e=Range$2.getEndPosition(t.range);n&&!Position$1.isBefore(e,n)||(n=e)}}));let l=t;t|=2;let c=!1,d=this.editor.onWillType((()=>{d.dispose(),c=!0,2&l||this.editor.pushUndoStop()}));s.push(r.resolve(a.token).then((()=>{if(!r.completion.additionalTextEdits||a.token.isCancellationRequested)return!1;if(n&&r.completion.additionalTextEdits.some((e=>Position$1.isBefore(n,Range$2.getStartPosition(e.range)))))return!1;c&&this.editor.pushUndoStop();const e=StableEditorScrollState.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",r.completion.additionalTextEdits.map((e=>EditOperation.replace(Range$2.lift(e.range),e.text)))),e.restoreRelativeVerticalPositionOfCursor(this.editor),!c&&2&l||this.editor.pushUndoStop(),!0})).then((t=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",e.elapsed(),t),o.dispose(),d.dispose()})))}let{insertText:c}=r.completion;4&r.completion.insertTextRules||(c=SnippetParser.escape(c)),n.insert(c,{overwriteBefore:l.overwriteBefore,overwriteAfter:l.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(1&r.completion.insertTextRules),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),2&t||this.editor.pushUndoStop(),r.completion.command?r.completion.command.id===TriggerSuggestAction.id?this.model.trigger({auto:!0,shy:!1},!0):(s.push(this._commandService.executeCommand(r.completion.command.id,...r.completion.command.arguments?[...r.completion.command.arguments]:[]).catch(onUnexpectedError)),this.model.cancel()):this.model.cancel(),4&t&&this._alternatives.value.set(e,(e=>{for(a.cancel();i.canUndo();){o!==i.getAlternativeVersionId()&&i.undo(),this._insertSuggestion(e,3|(8&t?8:0));break}})),this._alertCompletionItem(r),Promise.all(s).finally((()=>{this._reportSuggestionAcceptedTelemetry(i,e),this.model.clear(),a.dispose()}))}_reportSuggestionAcceptedTelemetry(e,t){var n;if(this._telemetryGate++%100!=0)return;const i=(null!==(n=t.item.provider._debugDisplayName)&&void 0!==n?n:"unknown").split("(",1)[0].toLowerCase();this._telemetryService.publicLog2("suggest.acceptedSuggestion",{providerId:i,basenameHash:hash(basename(e.uri)).toString(16),languageId:e.getLanguageId(),fileExtension:extname(e.uri)})}getOverwriteInfo(e,t){assertType(this.editor.hasModel());let n="replace"===this.editor.getOption(106).insertMode;t&&(n=!n);const i=e.position.column-e.editStart.column,o=(n?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column;return{overwriteBefore:i+(this.editor.getPosition().column-e.position.column),overwriteAfter:o+(this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0)}}_alertCompletionItem(e){if(isNonEmptyArray(e.completion.additionalTextEdits)){alert(localize("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length))}}triggerSuggest(e,t){this.editor.hasModel()&&(this.model.trigger({auto:null!=t&&t,shy:!1},!1,e),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),n=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},i=e=>{if(4&e.completion.insertTextRules||e.completion.additionalTextEdits)return!0;const t=this.editor.getPosition(),n=e.editStart.column,i=t.column;if(i-n!==e.completion.insertText.length)return!0;return this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:n,endLineNumber:t.lineNumber,endColumn:i})!==e.completion.insertText};Event$1.once(this.model.onDidTrigger)((e=>{let t=[];Event$1.any(this.model.onDidTrigger,this.model.onDidCancel)((()=>{dispose(t),n()}),void 0,t),this.model.onDidSuggest((({completionModel:e})=>{if(dispose(t),0===e.items.length)return void n();const o=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),e.items),r=e.items[o];i(r)?(this.editor.pushUndoStop(),this._insertSuggestion({index:o,item:r,model:e},7)):n()}),void 0,t)})),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const n=this.widget.value.getFocusedItem();let i=0;e&&(i|=4),t&&(i|=8),this._insertSuggestion(n,i)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}};SuggestController.ID="editor.contrib.suggestController",SuggestController=__decorate$I([__param$H(1,ISuggestMemoryService),__param$H(2,ICommandService),__param$H(3,IContextKeyService),__param$H(4,IInstantiationService),__param$H(5,ILogService),__param$H(6,ITelemetryService)],SuggestController);class PriorityRegistry{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(-1!==this._items.indexOf(e))throw new Error("Value is already registered");return this._items.push(e),this._items.sort(((e,t)=>this.prioritySelector(t)-this.prioritySelector(e))),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class TriggerSuggestAction extends EditorAction{constructor(){super({id:TriggerSuggestAction.id,label:localize("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.hasCompletionItemProvider),kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,n){const i=SuggestController.get(t);if(!i)return;let o;n&&"object"==typeof n&&!0===n.auto&&(o=!0),i.triggerSuggest(void 0,o)}}TriggerSuggestAction.id="editor.action.triggerSuggest",registerEditorContribution(SuggestController.ID,SuggestController),registerEditorAction(TriggerSuggestAction);const weight$1=190,SuggestCommand=EditorCommand.bindToContribution(SuggestController.get);registerEditorCommand(new SuggestCommand({id:"acceptSelectedSuggestion",precondition:Context$2.Visible,handler(e){e.acceptSelectedSuggestion(!0,!1)}})),KeybindingsRegistry.registerKeybindingRule({id:"acceptSelectedSuggestion",when:ContextKeyExpr.and(Context$2.Visible,EditorContextKeys.textInputFocus),primary:2,weight:weight$1}),KeybindingsRegistry.registerKeybindingRule({id:"acceptSelectedSuggestion",when:ContextKeyExpr.and(Context$2.Visible,EditorContextKeys.textInputFocus,Context$2.AcceptSuggestionsOnEnter,Context$2.MakesTextEdit),primary:3,weight:weight$1}),MenuRegistry.appendMenuItem(suggestWidgetStatusbarMenu,{command:{id:"acceptSelectedSuggestion",title:localize("accept.insert","Insert")},group:"left",order:1,when:Context$2.HasInsertAndReplaceRange.toNegated()}),MenuRegistry.appendMenuItem(suggestWidgetStatusbarMenu,{command:{id:"acceptSelectedSuggestion",title:localize("accept.insert","Insert")},group:"left",order:1,when:ContextKeyExpr.and(Context$2.HasInsertAndReplaceRange,Context$2.InsertMode.isEqualTo("insert"))}),MenuRegistry.appendMenuItem(suggestWidgetStatusbarMenu,{command:{id:"acceptSelectedSuggestion",title:localize("accept.replace","Replace")},group:"left",order:1,when:ContextKeyExpr.and(Context$2.HasInsertAndReplaceRange,Context$2.InsertMode.isEqualTo("replace"))}),registerEditorCommand(new SuggestCommand({id:"acceptAlternativeSelectedSuggestion",precondition:ContextKeyExpr.and(Context$2.Visible,EditorContextKeys.textInputFocus),kbOpts:{weight:weight$1,kbExpr:EditorContextKeys.textInputFocus,primary:1027,secondary:[1026]},handler(e){e.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:suggestWidgetStatusbarMenu,group:"left",order:2,when:ContextKeyExpr.and(Context$2.HasInsertAndReplaceRange,Context$2.InsertMode.isEqualTo("insert")),title:localize("accept.replace","Replace")},{menuId:suggestWidgetStatusbarMenu,group:"left",order:2,when:ContextKeyExpr.and(Context$2.HasInsertAndReplaceRange,Context$2.InsertMode.isEqualTo("replace")),title:localize("accept.insert","Insert")}]})),CommandsRegistry.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion"),registerEditorCommand(new SuggestCommand({id:"hideSuggestWidget",precondition:Context$2.Visible,handler:e=>e.cancelSuggestWidget(),kbOpts:{weight:weight$1,kbExpr:EditorContextKeys.textInputFocus,primary:9,secondary:[1033]}})),registerEditorCommand(new SuggestCommand({id:"selectNextSuggestion",precondition:ContextKeyExpr.and(Context$2.Visible,Context$2.MultipleSuggestions),handler:e=>e.selectNextSuggestion(),kbOpts:{weight:weight$1,kbExpr:EditorContextKeys.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})),registerEditorCommand(new SuggestCommand({id:"selectNextPageSuggestion",precondition:ContextKeyExpr.and(Context$2.Visible,Context$2.MultipleSuggestions),handler:e=>e.selectNextPageSuggestion(),kbOpts:{weight:weight$1,kbExpr:EditorContextKeys.textInputFocus,primary:12,secondary:[2060]}})),registerEditorCommand(new SuggestCommand({id:"selectLastSuggestion",precondition:ContextKeyExpr.and(Context$2.Visible,Context$2.MultipleSuggestions),handler:e=>e.selectLastSuggestion()})),registerEditorCommand(new SuggestCommand({id:"selectPrevSuggestion",precondition:ContextKeyExpr.and(Context$2.Visible,Context$2.MultipleSuggestions),handler:e=>e.selectPrevSuggestion(),kbOpts:{weight:weight$1,kbExpr:EditorContextKeys.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})),registerEditorCommand(new SuggestCommand({id:"selectPrevPageSuggestion",precondition:ContextKeyExpr.and(Context$2.Visible,Context$2.MultipleSuggestions),handler:e=>e.selectPrevPageSuggestion(),kbOpts:{weight:weight$1,kbExpr:EditorContextKeys.textInputFocus,primary:11,secondary:[2059]}})),registerEditorCommand(new SuggestCommand({id:"selectFirstSuggestion",precondition:ContextKeyExpr.and(Context$2.Visible,Context$2.MultipleSuggestions),handler:e=>e.selectFirstSuggestion()})),registerEditorCommand(new SuggestCommand({id:"toggleSuggestionDetails",precondition:Context$2.Visible,handler:e=>e.toggleSuggestionDetails(),kbOpts:{weight:weight$1,kbExpr:EditorContextKeys.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:suggestWidgetStatusbarMenu,group:"right",order:1,when:ContextKeyExpr.and(Context$2.DetailsVisible,Context$2.CanResolve),title:localize("detail.more","show less")},{menuId:suggestWidgetStatusbarMenu,group:"right",order:1,when:ContextKeyExpr.and(Context$2.DetailsVisible.toNegated(),Context$2.CanResolve),title:localize("detail.less","show more")}]})),registerEditorCommand(new SuggestCommand({id:"toggleExplainMode",precondition:Context$2.Visible,handler:e=>e.toggleExplainMode(),kbOpts:{weight:100,primary:2133}})),registerEditorCommand(new SuggestCommand({id:"toggleSuggestionFocus",precondition:Context$2.Visible,handler:e=>e.toggleSuggestionFocus(),kbOpts:{weight:weight$1,kbExpr:EditorContextKeys.textInputFocus,primary:2570,mac:{primary:778}}})),registerEditorCommand(new SuggestCommand({id:"insertBestCompletion",precondition:ContextKeyExpr.and(EditorContextKeys.textInputFocus,ContextKeyExpr.equals("config.editor.tabCompletion","on"),WordContextKey.AtEnd,Context$2.Visible.toNegated(),SuggestAlternatives.OtherSuggestions.toNegated(),SnippetController2.InSnippetMode.toNegated()),handler:(e,t)=>{e.triggerSuggestAndAcceptBest(isObject(t)?Object.assign({fallback:"tab"},t):{fallback:"tab"})},kbOpts:{weight:weight$1,primary:2}})),registerEditorCommand(new SuggestCommand({id:"insertNextSuggestion",precondition:ContextKeyExpr.and(EditorContextKeys.textInputFocus,ContextKeyExpr.equals("config.editor.tabCompletion","on"),SuggestAlternatives.OtherSuggestions,Context$2.Visible.toNegated(),SnippetController2.InSnippetMode.toNegated()),handler:e=>e.acceptNextSuggestion(),kbOpts:{weight:weight$1,kbExpr:EditorContextKeys.textInputFocus,primary:2}})),registerEditorCommand(new SuggestCommand({id:"insertPrevSuggestion",precondition:ContextKeyExpr.and(EditorContextKeys.textInputFocus,ContextKeyExpr.equals("config.editor.tabCompletion","on"),SuggestAlternatives.OtherSuggestions,Context$2.Visible.toNegated(),SnippetController2.InSnippetMode.toNegated()),handler:e=>e.acceptPrevSuggestion(),kbOpts:{weight:weight$1,kbExpr:EditorContextKeys.textInputFocus,primary:1026}})),registerEditorAction(class extends EditorAction{constructor(){super({id:"editor.action.resetSuggestSize",label:localize("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(e,t){var n;null===(n=SuggestController.get(t))||void 0===n||n.resetWidgetSize()}});class SuggestWidgetInlineCompletionProvider extends Disposable{constructor(e,t){super(),this.editor=e,this.suggestControllerPreselector=t,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this.onDidChangeEmitter=new Emitter$1,this.onDidChange=this.onDidChangeEmitter.event,this.setInactiveDelayed=this._register(new RunOnceScheduler((()=>{this.isSuggestWidgetVisible||this._isActive&&(this._isActive=!1,this.onDidChangeEmitter.fire())}),100)),this._register(e.onKeyDown((e=>{e.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))}))),this._register(e.onKeyUp((e=>{e.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))})));const n=SuggestController.get(this.editor);if(n){this._register(n.registerSelector({priority:100,select:(e,t,i)=>{const o=this.editor.getModel(),r=minimizeInlineCompletion(o,this.suggestControllerPreselector());if(!r)return-1;const s=Position$1.lift(t),a=findMaxBy(i.map(((e,t)=>{const i=suggestionToSuggestItemInfo(n,s,e,this.isShiftKeyPressed),a=minimizeInlineCompletion(o,null==i?void 0:i.normalizedInlineCompletion);if(!a)return;return{index:t,valid:rangeStartsWith(r.range,a.range)&&r.text.startsWith(a.text),prefixLength:a.text.length,suggestItem:e}})).filter((e=>e&&e.valid)),compareBy((e=>e.prefixLength),numberComparator));return a?a.index:-1}}));let e=!1;const t=()=>{e||(e=!0,this._register(n.widget.value.onDidShow((()=>{this.isSuggestWidgetVisible=!0,this.update(!0)}))),this._register(n.widget.value.onDidHide((()=>{this.isSuggestWidgetVisible=!1,this.setInactiveDelayed.schedule(),this.update(this._isActive)}))),this._register(n.widget.value.onDidFocus((()=>{this.isSuggestWidgetVisible=!0,this.update(!0)}))))};this._register(Event$1.once(n.model.onDidTrigger)((e=>{t()})))}this.update(this._isActive)}get state(){if(this._isActive)return{selectedItem:this._currentSuggestItemInfo}}update(e){const t=this.getSuggestItemInfo();let n=!1;suggestItemInfoEquals(this._currentSuggestItemInfo,t)||(this._currentSuggestItemInfo=t,n=!0),this._isActive!==e&&(this._isActive=e,n=!0),n&&this.onDidChangeEmitter.fire()}getSuggestItemInfo(){const e=SuggestController.get(this.editor);if(!e)return;if(!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem();return t?suggestionToSuggestItemInfo(e,this.editor.getPosition(),t.item,this.isShiftKeyPressed):void 0}stopForceRenderingAbove(){const e=SuggestController.get(this.editor);e&&e.stopForceRenderingAbove()}forceRenderingAbove(){const e=SuggestController.get(this.editor);e&&e.forceRenderingAbove()}}function rangeStartsWith(e,t){return t.startLineNumber===e.startLineNumber&&t.startColumn===e.startColumn&&(t.endLineNumber<e.endLineNumber||t.endLineNumber===e.endLineNumber&&t.endColumn<=e.endColumn)}function suggestItemInfoEquals(e,t){return e===t||!(!e||!t)&&(e.completionItemKind===t.completionItemKind&&e.isSnippetText===t.isSnippetText&&normalizedInlineCompletionsEquals(e.normalizedInlineCompletion,t.normalizedInlineCompletion))}function suggestionToSuggestItemInfo(e,t,n,i){if(Array.isArray(n.completion.additionalTextEdits)&&n.completion.additionalTextEdits.length>0)return{completionItemKind:n.completion.kind,isSnippetText:!1,normalizedInlineCompletion:{range:Range$2.fromPositions(t,t),text:""}};let{insertText:o}=n.completion,r=!1;if(4&n.completion.insertTextRules){const n=(new SnippetParser).parse(o),i=e.editor.getModel();if(n.children.length>100)return;SnippetSession.adjustWhitespace(i,t,n,!0,!0),o=n.toString(),r=!0}const s=e.getOverwriteInfo(n,i);return{isSnippetText:r,completionItemKind:n.completion.kind,normalizedInlineCompletion:{text:o,range:Range$2.fromPositions(t.delta(0,-s.overwriteBefore),t.delta(0,Math.max(s.overwriteAfter,0)))}}}var __decorate$H=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$G=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$q=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};let SuggestWidgetPreviewModel=class extends BaseGhostTextWidgetModel{constructor(e,t,n){super(e),this.cache=t,this.languageFeaturesService=n,this.suggestionInlineCompletionSource=this._register(new SuggestWidgetInlineCompletionProvider(this.editor,(()=>{var e,t;return null===(t=null===(e=this.cache.value)||void 0===e?void 0:e.completions[0])||void 0===t?void 0:t.toLiveInlineCompletion()}))),this.updateOperation=this._register(new MutableDisposable),this.updateCacheSoon=this._register(new RunOnceScheduler((()=>this.updateCache()),50)),this.minReservedLineCount=0,this._register(this.suggestionInlineCompletionSource.onDidChange((()=>{this.updateCacheSoon.schedule();this.suggestionInlineCompletionSource.state||(this.minReservedLineCount=0);const e=this.ghostText;e&&(this.minReservedLineCount=Math.max(this.minReservedLineCount,sum(e.parts.map((e=>e.lines.length-1))))),this.minReservedLineCount>=1?this.suggestionInlineCompletionSource.forceRenderingAbove():this.suggestionInlineCompletionSource.stopForceRenderingAbove(),this.onDidChangeEmitter.fire()}))),this._register(this.cache.onDidChange((()=>{this.onDidChangeEmitter.fire()}))),this._register(this.editor.onDidChangeCursorPosition((e=>{this.minReservedLineCount=0,this.updateCacheSoon.schedule(),this.onDidChangeEmitter.fire()}))),this._register(toDisposable((()=>this.suggestionInlineCompletionSource.stopForceRenderingAbove())))}get isActive(){return void 0!==this.suggestionInlineCompletionSource.state}isSuggestionPreviewEnabled(){return this.editor.getOption(106).preview}updateCache(){return __awaiter$q(this,void 0,void 0,(function*(){const e=this.suggestionInlineCompletionSource.state;if(!e||!e.selectedItem)return;const t={text:e.selectedItem.normalizedInlineCompletion.text,range:e.selectedItem.normalizedInlineCompletion.range,isSnippetText:e.selectedItem.isSnippetText,completionKind:e.selectedItem.completionItemKind},n=this.editor.getPosition(),i=createCancelablePromise((e=>__awaiter$q(this,void 0,void 0,(function*(){let i;try{i=yield provideInlineCompletions(this.languageFeaturesService.inlineCompletionsProvider,n,this.editor.getModel(),{triggerKind:InlineCompletionTriggerKind$1.Automatic,selectedSuggestionInfo:t},e)}catch(e2){return void onUnexpectedError(e2)}e.isCancellationRequested||(this.cache.setValue(this.editor,i,InlineCompletionTriggerKind$1.Automatic),this.onDidChangeEmitter.fire())})))),o=new UpdateOperation(i,InlineCompletionTriggerKind$1.Automatic);this.updateOperation.value=o,yield i,this.updateOperation.value===o&&this.updateOperation.clear()}))}get ghostText(){var e,t,n;const i=this.isSuggestionPreviewEnabled(),o=minimizeInlineCompletion(this.editor.getModel(),null===(t=null===(e=this.cache.value)||void 0===e?void 0:e.completions[0])||void 0===t?void 0:t.toLiveInlineCompletion()),r=this.suggestionInlineCompletionSource.state,s=minimizeInlineCompletion(this.editor.getModel(),null===(n=null==r?void 0:r.selectedItem)||void 0===n?void 0:n.normalizedInlineCompletion),a=o&&s&&o.text.startsWith(s.text)&&o.range.equalsRange(s.range);if(!i&&!a)return;const l=a?o:s||o,c=a?l.text.length-s.text.length:0;return this.toGhostText(l,c)}toGhostText(e,t){const n=this.editor.getOptions().get(106).previewMode;return e?inlineCompletionToGhostText(e,this.editor.getModel(),n,this.editor.getPosition(),t)||new GhostText(e.range.endLineNumber,[],this.minReservedLineCount):void 0}};function sum(e){return e.reduce(((e,t)=>e+t),0)}function createDisposableRef(e,t){return{object:e,dispose:()=>null==t?void 0:t.dispose()}}SuggestWidgetPreviewModel=__decorate$H([__param$G(2,ILanguageFeaturesService)],SuggestWidgetPreviewModel);var __decorate$G=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$F=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$p=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class DelegatingModel extends Disposable{constructor(){super(...arguments),this.onDidChangeEmitter=new Emitter$1,this.onDidChange=this.onDidChangeEmitter.event,this.hasCachedGhostText=!1,this.currentModelRef=this._register(new MutableDisposable)}get targetModel(){var e;return null===(e=this.currentModelRef.value)||void 0===e?void 0:e.object}setTargetModel(e){var t;(null===(t=this.currentModelRef.value)||void 0===t?void 0:t.object)!==e&&(this.currentModelRef.clear(),this.currentModelRef.value=e?createDisposableRef(e,e.onDidChange((()=>{this.hasCachedGhostText=!1,this.onDidChangeEmitter.fire()}))):void 0,this.hasCachedGhostText=!1,this.onDidChangeEmitter.fire())}get ghostText(){var e,t;return this.hasCachedGhostText||(this.cachedGhostText=null===(t=null===(e=this.currentModelRef.value)||void 0===e?void 0:e.object)||void 0===t?void 0:t.ghostText,this.hasCachedGhostText=!0),this.cachedGhostText}setExpanded(e){var t;null===(t=this.targetModel)||void 0===t||t.setExpanded(e)}get minReservedLineCount(){return this.targetModel?this.targetModel.minReservedLineCount:0}}let GhostTextModel=class extends DelegatingModel{constructor(e,t){super(),this.editor=e,this.instantiationService=t,this.sharedCache=this._register(new SharedInlineCompletionCache),this.suggestWidgetAdapterModel=this._register(this.instantiationService.createInstance(SuggestWidgetPreviewModel,this.editor,this.sharedCache)),this.inlineCompletionsModel=this._register(this.instantiationService.createInstance(InlineCompletionsModel,this.editor,this.sharedCache)),this._register(this.suggestWidgetAdapterModel.onDidChange((()=>{this.updateModel()}))),this.updateModel()}get activeInlineCompletionsModel(){if(this.targetModel===this.inlineCompletionsModel)return this.inlineCompletionsModel}updateModel(){this.setTargetModel(this.suggestWidgetAdapterModel.isActive?this.suggestWidgetAdapterModel:this.inlineCompletionsModel),this.inlineCompletionsModel.setActive(this.targetModel===this.inlineCompletionsModel)}shouldShowHoverAt(e){var t;const n=null===(t=this.activeInlineCompletionsModel)||void 0===t?void 0:t.ghostText;return!!n&&n.parts.some((t=>e.containsPosition(new Position$1(n.lineNumber,t.column))))}triggerInlineCompletion(){var e;null===(e=this.activeInlineCompletionsModel)||void 0===e||e.trigger(InlineCompletionTriggerKind$1.Explicit)}commitInlineCompletion(){var e;null===(e=this.activeInlineCompletionsModel)||void 0===e||e.commitCurrentSuggestion()}hideInlineCompletion(){var e;null===(e=this.activeInlineCompletionsModel)||void 0===e||e.hide()}showNextInlineCompletion(){var e;null===(e=this.activeInlineCompletionsModel)||void 0===e||e.showNext()}showPreviousInlineCompletion(){var e;null===(e=this.activeInlineCompletionsModel)||void 0===e||e.showPrevious()}hasMultipleInlineCompletions(){var e;return __awaiter$p(this,void 0,void 0,(function*(){const t=yield null===(e=this.activeInlineCompletionsModel)||void 0===e?void 0:e.hasMultipleInlineCompletions();return void 0!==t&&t}))}};GhostTextModel=__decorate$G([__param$F(1,IInstantiationService)],GhostTextModel);class SharedInlineCompletionCache extends Disposable{constructor(){super(...arguments),this.onDidChangeEmitter=new Emitter$1,this.onDidChange=this.onDidChangeEmitter.event,this.cache=this._register(new MutableDisposable)}get value(){return this.cache.value}setValue(e,t,n){this.cache.value=new SynchronizedInlineCompletionsCache(e,t,(()=>this.onDidChangeEmitter.fire()),n)}clearAndLeak(){return this.cache.clearAndLeak()}clear(){this.cache.clear()}}var ghostText="",__decorate$F=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$E=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},_a$4;const ttPolicy$2=null===(_a$4=window.trustedTypes)||void 0===_a$4?void 0:_a$4.createPolicy("editorGhostText",{createHTML:e=>e});let GhostTextWidget=class extends Disposable{constructor(e,t,n,i){super(),this.editor=e,this.model=t,this.instantiationService=n,this.languageService=i,this.disposed=!1,this.partsWidget=this._register(this.instantiationService.createInstance(DecorationsWidget,this.editor)),this.additionalLinesWidget=this._register(new AdditionalLinesWidget(this.editor,this.languageService.languageIdCodec)),this.viewMoreContentWidget=void 0,this._register(this.editor.onDidChangeConfiguration((e=>{(e.hasChanged(29)||e.hasChanged(105)||e.hasChanged(88)||e.hasChanged(83)||e.hasChanged(45)||e.hasChanged(44)||e.hasChanged(59))&&this.update()}))),this._register(toDisposable((()=>{var e;this.disposed=!0,this.update(),null===(e=this.viewMoreContentWidget)||void 0===e||e.dispose(),this.viewMoreContentWidget=void 0}))),this._register(t.onDidChange((()=>{this.update()}))),this.update()}shouldShowHoverAtViewZone(e){return this.additionalLinesWidget.viewZoneId===e}update(){var e;const t=this.model.ghostText;if(!this.editor.hasModel()||!t||this.disposed)return this.partsWidget.clear(),void this.additionalLinesWidget.clear();const n=new Array,i=new Array;function o(e,t){if(i.length>0){const n=i[i.length-1];t&&n.decorations.push(new LineDecoration(n.content.length+1,n.content.length+1+e[0].length,t,0)),n.content+=e[0],e=e.slice(1)}for(const n of e)i.push({content:n,decorations:t?[new LineDecoration(1,n.length+1,t,0)]:[]})}const r=this.editor.getModel().getLineContent(t.lineNumber);let s;this.editor.getModel().getLineTokens(t.lineNumber);let a=0;for(const l of t.parts){let e=l.lines;void 0===s?(n.push({column:l.column,text:e[0],preview:l.preview}),e=e.slice(1)):o([r.substring(a,l.column-1)],void 0),e.length>0&&(o(e,"ghost-text"),void 0===s&&l.column<=r.length&&(s=l.column)),a=l.column-1}void 0!==s&&o([r.substring(a)],void 0),this.partsWidget.setParts(t.lineNumber,n,void 0!==s?{column:s,length:r.length+1-s}:void 0),this.additionalLinesWidget.updateLines(t.lineNumber,i,t.additionalReservedLineCount),t.parts.some((e=>e.lines.length<0))?this.viewMoreContentWidget=this.renderViewMoreLines(new Position$1(t.lineNumber,this.editor.getModel().getLineMaxColumn(t.lineNumber)),"",0):(null===(e=this.viewMoreContentWidget)||void 0===e||e.dispose(),this.viewMoreContentWidget=void 0)}renderViewMoreLines(e,t,n){const i=this.editor.getOption(44),o=document.createElement("div");o.className="suggest-preview-additional-widget",applyFontInfo(o,i);const r=document.createElement("span");r.className="content-spacer",r.append(t),o.append(r);const s=document.createElement("span");s.className="content-newline suggest-preview-text",s.append("⏎ "),o.append(s);const a=new DisposableStore,l=document.createElement("div");return l.className="button suggest-preview-text",l.append(`+${n} lines…`),a.add(addStandardDisposableListener(l,"mousedown",(e=>{var t;null===(t=this.model)||void 0===t||t.setExpanded(!0),e.preventDefault(),this.editor.focus()}))),o.append(l),new ViewMoreLinesContentWidget(this.editor,e,o,a)}};GhostTextWidget=__decorate$F([__param$E(2,IInstantiationService),__param$E(3,ILanguageService)],GhostTextWidget);class DecorationsWidget{constructor(e){this.editor=e,this.decorationIds=[],this.disposableStore=new DisposableStore}dispose(){this.clear(),this.disposableStore.dispose()}clear(){this.editor.deltaDecorations(this.decorationIds,[]),this.disposableStore.clear()}setParts(e,t,n){this.disposableStore.clear();if(!this.editor.getModel())return;const i=new Array;n&&i.push({range:Range$2.fromPositions(new Position$1(e,n.column),new Position$1(e,n.column+n.length)),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}}),this.decorationIds=this.editor.deltaDecorations(this.decorationIds,t.map((t=>({range:Range$2.fromPositions(new Position$1(e,t.column)),options:{description:"ghost-text",after:{content:t.text,inlineClassName:t.preview?"ghost-text-decoration-preview":"ghost-text-decoration"},showIfCollapsed:!0}}))).concat(i))}}class AdditionalLinesWidget{constructor(e,t){this.editor=e,this.languageIdCodec=t,this._viewZoneId=void 0}get viewZoneId(){return this._viewZoneId}dispose(){this.clear()}clear(){this.editor.changeViewZones((e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)}))}updateLines(e,t,n){const i=this.editor.getModel();if(!i)return;const{tabSize:o}=i.getOptions();this.editor.changeViewZones((i=>{this._viewZoneId&&(i.removeZone(this._viewZoneId),this._viewZoneId=void 0);const r=Math.max(t.length,n);if(r>0){const n=document.createElement("div");renderLines(n,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=i.addZone({afterLineNumber:e,heightInLines:r,domNode:n,afterColumnAffinity:1})}}))}}function renderLines(e,t,n,i,o){const r=i.get(29),s=i.get(105),a=i.get(83),l=i.get(45),c=i.get(44),d=i.get(59),u=createStringBuilder(1e4);u.appendASCIIString('<div class="suggest-preview-text">');for(let p=0,f=n.length;p<f;p++){const e=n[p],i=e.content;u.appendASCIIString('<div class="view-line'),u.appendASCIIString('" style="top:'),u.appendASCIIString(String(p*d)),u.appendASCIIString('px;width:1000000px;">');const h=isBasicASCII(i),g=containsRTL(i),f=LineTokens.createEmpty(i,o);renderViewLine(new RenderLineInput(c.isMonospace&&!r,c.canUseHalfwidthRightwardsArrow,i,!1,h,g,0,f,e.decorations,t,0,c.spaceWidth,c.middotWidth,c.wsmiddotWidth,s,"none",a,l!==EditorFontLigatures.OFF,null),u),u.appendASCIIString("</div>")}u.appendASCIIString("</div>"),applyFontInfo(e,c);const h=u.build(),g=ttPolicy$2?ttPolicy$2.createHTML(h):h;e.innerHTML=g}class ViewMoreLinesContentWidget extends Disposable{constructor(e,t,n,i){super(),this.editor=e,this.position=t,this.domNode=n,this.allowEditorOverflow=!1,this.suppressMouseDown=!1,this._register(i),this._register(toDisposable((()=>{this.editor.removeContentWidget(this)}))),this.editor.addContentWidget(this)}getId(){return"editor.widget.viewMoreLinesWidget"}getDomNode(){return this.domNode}getPosition(){return{position:this.position,preference:[0]}}}registerThemingParticipant(((e,t)=>{const n=e.getColor(ghostTextForeground);n&&(t.addRule(`.monaco-editor .ghost-text-decoration { color: ${n.toString()} !important; }`),t.addRule(`.monaco-editor .ghost-text-decoration-preview { color: ${n.toString()} !important; }`),t.addRule(`.monaco-editor .suggest-preview-text .ghost-text { color: ${n.toString()} !important; }`));const i=e.getColor(ghostTextBackground);i&&(t.addRule(`.monaco-editor .ghost-text-decoration { background-color: ${i.toString()}; }`),t.addRule(`.monaco-editor .ghost-text-decoration-preview { background-color: ${i.toString()}; }`),t.addRule(`.monaco-editor .suggest-preview-text .ghost-text { background-color: ${i.toString()}; }`));const o=e.getColor(ghostTextBorder);o&&(t.addRule(`.monaco-editor .suggest-preview-text .ghost-text { border: 1px solid ${o}; }`),t.addRule(`.monaco-editor .ghost-text-decoration { border: 1px solid ${o}; }`),t.addRule(`.monaco-editor .ghost-text-decoration-preview { border: 1px solid ${o}; }`))}));var __decorate$E=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$D=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$o=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};let GhostTextController=class e extends Disposable{constructor(e,t){super(),this.editor=e,this.instantiationService=t,this.triggeredExplicitly=!1,this.activeController=this._register(new MutableDisposable),this.activeModelDidChangeEmitter=this._register(new Emitter$1),this._register(this.editor.onDidChangeModel((()=>{this.updateModelController()}))),this._register(this.editor.onDidChangeConfiguration((e=>{e.hasChanged(106)&&this.updateModelController(),e.hasChanged(55)&&this.updateModelController()}))),this.updateModelController()}static get(t){return t.getContribution(e.ID)}get activeModel(){var e;return null===(e=this.activeController.value)||void 0===e?void 0:e.model}updateModelController(){const e=this.editor.getOption(106),t=this.editor.getOption(55);this.activeController.value=void 0,this.activeController.value=this.editor.hasModel()&&(e.preview||t.enabled||this.triggeredExplicitly)?this.instantiationService.createInstance(ActiveGhostTextController,this.editor):void 0,this.activeModelDidChangeEmitter.fire()}shouldShowHoverAt(e){var t;return(null===(t=this.activeModel)||void 0===t?void 0:t.shouldShowHoverAt(e))||!1}shouldShowHoverAtViewZone(e){var t,n;return(null===(n=null===(t=this.activeController.value)||void 0===t?void 0:t.widget)||void 0===n?void 0:n.shouldShowHoverAtViewZone(e))||!1}trigger(){var e;this.triggeredExplicitly=!0,this.activeController.value||this.updateModelController(),null===(e=this.activeModel)||void 0===e||e.triggerInlineCompletion()}commit(){var e;null===(e=this.activeModel)||void 0===e||e.commitInlineCompletion()}hide(){var e;null===(e=this.activeModel)||void 0===e||e.hideInlineCompletion()}showNextInlineCompletion(){var e;null===(e=this.activeModel)||void 0===e||e.showNextInlineCompletion()}showPreviousInlineCompletion(){var e;null===(e=this.activeModel)||void 0===e||e.showPreviousInlineCompletion()}hasMultipleInlineCompletions(){var e;return __awaiter$o(this,void 0,void 0,(function*(){const t=yield null===(e=this.activeModel)||void 0===e?void 0:e.hasMultipleInlineCompletions();return void 0!==t&&t}))}};GhostTextController.inlineSuggestionVisible=new RawContextKey("inlineSuggestionVisible",!1,localize("inlineSuggestionVisible","Whether an inline suggestion is visible")),GhostTextController.inlineSuggestionHasIndentation=new RawContextKey("inlineSuggestionHasIndentation",!1,localize("inlineSuggestionHasIndentation","Whether the inline suggestion starts with whitespace")),GhostTextController.inlineSuggestionHasIndentationLessThanTabSize=new RawContextKey("inlineSuggestionHasIndentationLessThanTabSize",!0,localize("inlineSuggestionHasIndentationLessThanTabSize","Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab")),GhostTextController.ID="editor.contrib.ghostTextController",GhostTextController=__decorate$E([__param$D(1,IInstantiationService)],GhostTextController);class GhostTextContextKeys{constructor(e){this.contextKeyService=e,this.inlineCompletionVisible=GhostTextController.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=GhostTextController.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=GhostTextController.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService)}}let ActiveGhostTextController=class extends Disposable{constructor(e,t,n){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=n,this.contextKeys=new GhostTextContextKeys(this.contextKeyService),this.model=this._register(this.instantiationService.createInstance(GhostTextModel,this.editor)),this.widget=this._register(this.instantiationService.createInstance(GhostTextWidget,this.editor,this.model)),this._register(toDisposable((()=>{this.contextKeys.inlineCompletionVisible.set(!1),this.contextKeys.inlineCompletionSuggestsIndentation.set(!1),this.contextKeys.inlineCompletionSuggestsIndentationLessThanTabSize.set(!0)}))),this._register(this.model.onDidChange((()=>{this.updateContextKeys()}))),this.updateContextKeys()}updateContextKeys(){var e;this.contextKeys.inlineCompletionVisible.set(void 0!==(null===(e=this.model.activeInlineCompletionsModel)||void 0===e?void 0:e.ghostText));let t=!1,n=!0;const i=this.model.inlineCompletionsModel.ghostText;if(this.model.activeInlineCompletionsModel&&i&&i.parts.length>0){const{column:e,lines:o}=i.parts[0],r=o[0];if(e<=this.editor.getModel().getLineIndentColumn(i.lineNumber)){let e=firstNonWhitespaceIndex(r);-1===e&&(e=r.length-1),t=e>0;const i=this.editor.getModel().getOptions().tabSize;n=CursorColumns.visibleColumnFromColumn(r,e+1,i)<i}}this.contextKeys.inlineCompletionSuggestsIndentation.set(t),this.contextKeys.inlineCompletionSuggestsIndentationLessThanTabSize.set(n)}};ActiveGhostTextController=__decorate$E([__param$D(1,IInstantiationService),__param$D(2,IContextKeyService)],ActiveGhostTextController);const GhostTextCommand=EditorCommand.bindToContribution(GhostTextController.get),commitInlineSuggestionAction=new GhostTextCommand({id:inlineSuggestCommitId,precondition:GhostTextController.inlineSuggestionVisible,handler(e){e.commit(),e.editor.focus()}});registerEditorCommand(commitInlineSuggestionAction),KeybindingsRegistry.registerKeybindingRule({primary:2,weight:200,id:commitInlineSuggestionAction.id,when:ContextKeyExpr.and(commitInlineSuggestionAction.precondition,EditorContextKeys.tabMovesFocus.toNegated(),GhostTextController.inlineSuggestionHasIndentationLessThanTabSize)}),registerEditorCommand(new GhostTextCommand({id:"editor.action.inlineSuggest.hide",precondition:GhostTextController.inlineSuggestionVisible,kbOpts:{weight:100,primary:9},handler(e){e.hide()}}));class ShowNextInlineSuggestionAction extends EditorAction{constructor(){super({id:ShowNextInlineSuggestionAction.ID,label:localize("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:ContextKeyExpr.and(EditorContextKeys.writable,GhostTextController.inlineSuggestionVisible),kbOpts:{weight:100,primary:601}})}run(e,t){return __awaiter$o(this,void 0,void 0,(function*(){const e=GhostTextController.get(t);e&&(e.showNextInlineCompletion(),t.focus())}))}}ShowNextInlineSuggestionAction.ID="editor.action.inlineSuggest.showNext";class ShowPreviousInlineSuggestionAction extends EditorAction{constructor(){super({id:ShowPreviousInlineSuggestionAction.ID,label:localize("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:ContextKeyExpr.and(EditorContextKeys.writable,GhostTextController.inlineSuggestionVisible),kbOpts:{weight:100,primary:599}})}run(e,t){return __awaiter$o(this,void 0,void 0,(function*(){const e=GhostTextController.get(t);e&&(e.showPreviousInlineCompletion(),t.focus())}))}}ShowPreviousInlineSuggestionAction.ID="editor.action.inlineSuggest.showPrevious";class TriggerInlineSuggestionAction extends EditorAction{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:localize("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:EditorContextKeys.writable})}run(e,t){return __awaiter$o(this,void 0,void 0,(function*(){const e=GhostTextController.get(t);e&&e.trigger()}))}}var __decorate$D=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$C=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};class InlineCompletionsHover{constructor(e,t,n){this.owner=e,this.range=t,this.controller=n}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}hasMultipleSuggestions(){return this.controller.hasMultipleInlineCompletions()}}let InlineCompletionsHoverParticipant=class{constructor(e,t,n,i,o,r,s){this._editor=e,this._commandService=t,this._menuService=n,this._contextKeyService=i,this._languageService=o,this._openerService=r,this.accessibilityService=s,this.hoverOrdinal=3}suggestHoverAnchor(e){const t=GhostTextController.get(this._editor);if(!t)return null;const n=e.target;if(8===n.type){const e=n.detail;if(t.shouldShowHoverAtViewZone(e.viewZoneId))return new HoverForeignElementAnchor(1e3,this,Range$2.fromPositions(e.positionBefore||e.position,e.positionBefore||e.position))}if(7===n.type&&t.shouldShowHoverAt(n.range))return new HoverForeignElementAnchor(1e3,this,n.range);if(6===n.type){if(n.detail.mightBeForeignElement&&t.shouldShowHoverAt(n.range))return new HoverForeignElementAnchor(1e3,this,n.range)}return null}computeSync(e,t){const n=GhostTextController.get(this._editor);return n&&n.shouldShowHoverAt(e.range)?[new InlineCompletionsHover(this,e.range,n)]:[]}renderHoverParts(e,t){const n=new DisposableStore,i=t[0];this.accessibilityService.isScreenReaderOptimized()&&this.renderScreenReaderText(e,i,n);const o=n.add(this._menuService.createMenu(MenuId.InlineCompletionsActions,this._contextKeyService)),r=e.statusBar.addAction({label:localize("showNextInlineSuggestion","Next"),commandId:ShowNextInlineSuggestionAction.ID,run:()=>this._commandService.executeCommand(ShowNextInlineSuggestionAction.ID)}),s=e.statusBar.addAction({label:localize("showPreviousInlineSuggestion","Previous"),commandId:ShowPreviousInlineSuggestionAction.ID,run:()=>this._commandService.executeCommand(ShowPreviousInlineSuggestionAction.ID)});e.statusBar.addAction({label:localize("acceptInlineSuggestion","Accept"),commandId:commitInlineSuggestionAction.id,run:()=>this._commandService.executeCommand(commitInlineSuggestionAction.id)});const a=[r,s];for(const l of a)l.setEnabled(!1);i.hasMultipleSuggestions().then((e=>{for(const t of a)t.setEnabled(e)}));for(const[l,c]of o.getActions())for(const t of c)t instanceof MenuItemAction&&e.statusBar.addAction({label:t.label,commandId:t.item.id,run:()=>this._commandService.executeCommand(t.item.id)});return n}renderScreenReaderText(e,t,n){var i,o;const r=$$c,s=r("div.hover-row.markdown-hover"),a=append$1(s,r("div.hover-contents")),l=n.add(new MarkdownRenderer({editor:this._editor},this._languageService,this._openerService)),c=null===(o=null===(i=t.controller.activeModel)||void 0===i?void 0:i.inlineCompletionsModel)||void 0===o?void 0:o.ghostText;if(c){const t=this._editor.getModel().getLineContent(c.lineNumber);(t=>{n.add(l.onDidRenderAsync((()=>{a.className="hover-contents code-hover-contents",e.onContentsChanged()})));const i=localize("inlineSuggestionFollows","Suggestion:"),o=n.add(l.render((new MarkdownString).appendText(i).appendCodeblock("text",t)));a.replaceChildren(o.element)})(c.renderForScreenReader(t))}e.fragment.appendChild(s)}};function getSpaceCnt(e,t){let n=0;for(let i=0;i<e.length;i++)"\t"===e.charAt(i)?n+=t:n++;return n}function generateIndent(e,t,n){e=e<0?0:e;let i="";if(!n){let n=Math.floor(e/t);e%=t;for(let e=0;e<n;e++)i+="\t"}for(let o=0;o<e;o++)i+=" ";return i}function getReindentEditOperations(e,t,n,i,o){if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return[];const r=t.getLanguageConfiguration(e.getLanguageId()).indentationRules;if(!r)return[];for(i=Math.min(i,e.getLineCount());n<=i&&r.unIndentedLinePattern;){let t=e.getLineContent(n);if(!r.unIndentedLinePattern.test(t))break;n++}if(n>i-1)return[];const{tabSize:s,indentSize:a,insertSpaces:l}=e.getOptions(),c=(e,t)=>(t=t||1,ShiftCommand.shiftIndent(e,e.length+t,s,a,l)),d=(e,t)=>(t=t||1,ShiftCommand.unshiftIndent(e,e.length+t,s,a,l));let u,h=[],g=e.getLineContent(n),p=g;if(null!=o){u=o;let e=getLeadingWhitespace(g);p=u+g.substring(e.length),r.decreaseIndentPattern&&r.decreaseIndentPattern.test(p)&&(u=d(u),p=u+g.substring(e.length)),g!==p&&h.push(EditOperation.replaceMove(new Selection$1(n,1,n,e.length+1),normalizeIndentation(u,a,l)))}else u=getLeadingWhitespace(g);let f=u;r.increaseIndentPattern&&r.increaseIndentPattern.test(p)?(f=c(f),u=c(u)):r.indentNextLinePattern&&r.indentNextLinePattern.test(p)&&(f=c(f));for(let m=++n;m<=i;m++){let t=e.getLineContent(m),n=getLeadingWhitespace(t),i=f+t.substring(n.length);r.decreaseIndentPattern&&r.decreaseIndentPattern.test(i)&&(f=d(f),u=d(u)),n!==f&&h.push(EditOperation.replaceMove(new Selection$1(m,1,m,n.length+1),normalizeIndentation(f,a,l))),r.unIndentedLinePattern&&r.unIndentedLinePattern.test(t)||(r.increaseIndentPattern&&r.increaseIndentPattern.test(i)?(u=c(u),f=u):f=r.indentNextLinePattern&&r.indentNextLinePattern.test(i)?c(f):u)}return h}InlineCompletionsHoverParticipant=__decorate$D([__param$C(1,ICommandService),__param$C(2,IMenuService),__param$C(3,IContextKeyService),__param$C(4,ILanguageService),__param$C(5,IOpenerService),__param$C(6,IAccessibilityService)],InlineCompletionsHoverParticipant),registerEditorContribution(GhostTextController.ID,GhostTextController),registerEditorAction(TriggerInlineSuggestionAction),registerEditorAction(ShowNextInlineSuggestionAction),registerEditorAction(ShowPreviousInlineSuggestionAction),HoverParticipantRegistry.register(InlineCompletionsHoverParticipant);class IndentationToSpacesAction extends EditorAction{constructor(){super({id:IndentationToSpacesAction.ID,label:localize("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:EditorContextKeys.writable})}run(e,t){let n=t.getModel();if(!n)return;let i=n.getOptions(),o=t.getSelection();if(!o)return;const r=new IndentationToSpacesCommand(o,i.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),n.updateOptions({insertSpaces:!0})}}IndentationToSpacesAction.ID="editor.action.indentationToSpaces";class IndentationToTabsAction extends EditorAction{constructor(){super({id:IndentationToTabsAction.ID,label:localize("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:EditorContextKeys.writable})}run(e,t){let n=t.getModel();if(!n)return;let i=n.getOptions(),o=t.getSelection();if(!o)return;const r=new IndentationToTabsCommand(o,i.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),n.updateOptions({insertSpaces:!1})}}IndentationToTabsAction.ID="editor.action.indentationToTabs";class ChangeIndentationSizeAction extends EditorAction{constructor(e,t){super(t),this.insertSpaces=e}run(e,t){const n=e.get(IQuickInputService),i=e.get(IModelService);let o=t.getModel();if(!o)return;const r=i.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),s=[1,2,3,4,5,6,7,8].map((e=>({id:e.toString(),label:e.toString(),description:e===r.tabSize?localize("configuredTabSize","Configured Tab Size"):void 0}))),a=Math.min(o.getOptions().tabSize-1,7);setTimeout((()=>{n.pick(s,{placeHolder:localize({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:s[a]}).then((e=>{e&&o&&!o.isDisposed()&&o.updateOptions({tabSize:parseInt(e.label,10),insertSpaces:this.insertSpaces})}))}),50)}}class IndentUsingTabs extends ChangeIndentationSizeAction{constructor(){super(!1,{id:IndentUsingTabs.ID,label:localize("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}IndentUsingTabs.ID="editor.action.indentUsingTabs";class IndentUsingSpaces extends ChangeIndentationSizeAction{constructor(){super(!0,{id:IndentUsingSpaces.ID,label:localize("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}IndentUsingSpaces.ID="editor.action.indentUsingSpaces";class DetectIndentation extends EditorAction{constructor(){super({id:DetectIndentation.ID,label:localize("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const n=e.get(IModelService);let i=t.getModel();if(!i)return;const o=n.getCreationOptions(i.getLanguageId(),i.uri,i.isForSimpleWidget);i.detectIndentation(o.insertSpaces,o.tabSize)}}DetectIndentation.ID="editor.action.detectIndentation";class ReindentLinesAction extends EditorAction{constructor(){super({id:"editor.action.reindentlines",label:localize("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:EditorContextKeys.writable})}run(e,t){const n=e.get(ILanguageConfigurationService);let i=t.getModel();if(!i)return;let o=getReindentEditOperations(i,n,1,i.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class ReindentSelectedLinesAction extends EditorAction{constructor(){super({id:"editor.action.reindentselectedlines",label:localize("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:EditorContextKeys.writable})}run(e,t){const n=e.get(ILanguageConfigurationService);let i=t.getModel();if(!i)return;let o=t.getSelections();if(null===o)return;let r=[];for(let s of o){let e=s.startLineNumber,t=s.endLineNumber;if(e!==t&&1===s.endColumn&&t--,1===e){if(e===t)continue}else e--;let o=getReindentEditOperations(i,n,e,t);r.push(...o)}r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class AutoIndentOnPasteCommand{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(let n of e)n.range&&"string"==typeof n.text&&this._edits.push(n)}getEditOperations(e,t){for(let i of this._edits)t.addEditOperation(Range$2.lift(i.range),i.text);let n=!1;Array.isArray(this._edits)&&1===this._edits.length&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(n=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),n||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}class AutoIndentOnPaste{constructor(e){this.callOnDispose=new DisposableStore,this.callOnModel=new DisposableStore,this.editor=e,this.callOnDispose.add(e.onDidChangeConfiguration((()=>this.update()))),this.callOnDispose.add(e.onDidChangeModel((()=>this.update()))),this.callOnDispose.add(e.onDidChangeModelLanguage((()=>this.update())))}update(){this.callOnModel.clear(),this.editor.getOption(9)<4||this.editor.getOption(48)||this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste((({range:e})=>{this.trigger(e)})))}trigger(e){let t=this.editor.getSelections();if(null===t||t.length>1)return;const n=this.editor.getModel();if(!n)return;if(!n.isCheapToTokenize(e.getStartPosition().lineNumber))return;const i=this.editor.getOption(9),{tabSize:o,indentSize:r,insertSpaces:s}=n.getOptions();let a=[],l={shiftIndent:e=>ShiftCommand.shiftIndent(e,e.length+1,o,r,s),unshiftIndent:e=>ShiftCommand.unshiftIndent(e,e.length+1,o,r,s)},c=e.startLineNumber;for(;c<=e.endLineNumber&&this.shouldIgnoreLine(n,c);)c++;if(c>e.endLineNumber)return;let d=n.getLineContent(c);if(!/\S/.test(d.substring(0,e.startColumn-1))){const e=LanguageConfigurationRegistry.getGoodIndentForLine(i,n,n.getLanguageId(),c,l);if(null!==e){let t=getLeadingWhitespace(d),i=getSpaceCnt(e,o);if(i!==getSpaceCnt(t,o)){let e=generateIndent(i,o,s);a.push({range:new Range$2(c,1,c,t.length+1),text:e}),d=e+d.substr(t.length)}else{let e=LanguageConfigurationRegistry.getIndentMetadata(n,c);if(0===e||8===e)return}}}const u=c;for(;c<e.endLineNumber&&!/\S/.test(n.getLineContent(c+1));)c++;if(c!==e.endLineNumber){let t={getLineTokens:e=>n.getLineTokens(e),getLanguageId:()=>n.getLanguageId(),getLanguageIdAtPosition:(e,t)=>n.getLanguageIdAtPosition(e,t),getLineContent:e=>e===u?d:n.getLineContent(e)},r=LanguageConfigurationRegistry.getGoodIndentForLine(i,t,n.getLanguageId(),c+1,l);if(null!==r){let t=getSpaceCnt(r,o),i=getSpaceCnt(getLeadingWhitespace(n.getLineContent(c+1)),o);if(t!==i){let r=t-i;for(let t=c+1;t<=e.endLineNumber;t++){let e=getLeadingWhitespace(n.getLineContent(t)),i=generateIndent(getSpaceCnt(e,o)+r,o,s);i!==e&&a.push({range:new Range$2(t,1,t,e.length+1),text:i})}}}}if(a.length>0){this.editor.pushUndoStop();let e=new AutoIndentOnPasteCommand(a,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",e),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.forceTokenization(t);let n=e.getLineFirstNonWhitespaceColumn(t);if(0===n)return!0;let i=e.getLineTokens(t);if(i.getCount()>0){let e=i.findTokenIndexAtOffset(n);if(e>=0&&1===i.getStandardTokenType(e))return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}}function getIndentationEditOperations(e,t,n,i){if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return;let o="";for(let s=0;s<n;s++)o+=" ";let r=new RegExp(o,"gi");for(let s=1,a=e.getLineCount();s<=a;s++){let n=e.getLineFirstNonWhitespaceColumn(s);if(0===n&&(n=e.getLineMaxColumn(s)),1===n)continue;const a=new Range$2(s,1,s,n),l=e.getValueInRange(a),c=i?l.replace(/\t/gi,o):l.replace(r,"\t");t.addEditOperation(a,c)}}AutoIndentOnPaste.ID="editor.contrib.autoIndentOnPaste";class IndentationToSpacesCommand{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),getIndentationEditOperations(e,t,this.tabSize,!0)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}class IndentationToTabsCommand{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),getIndentationEditOperations(e,t,this.tabSize,!1)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}registerEditorContribution(AutoIndentOnPaste.ID,AutoIndentOnPaste),registerEditorAction(IndentationToSpacesAction),registerEditorAction(IndentationToTabsAction),registerEditorAction(IndentUsingTabs),registerEditorAction(IndentUsingSpaces),registerEditorAction(DetectIndentation),registerEditorAction(ReindentLinesAction),registerEditorAction(ReindentSelectedLinesAction);var __awaiter$n=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class InlayHintAnchor{constructor(e,t){this.range=e,this.direction=t}}class InlayHintItem{constructor(e,t,n){this.hint=e,this.anchor=t,this.provider=n,this._isResolved=!1}with(e){const t=new InlayHintItem(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}resolve(e){return __awaiter$n(this,void 0,void 0,(function*(){if("function"==typeof this.provider.resolveInlayHint){if(this._currentResolve){if(yield this._currentResolve,e.isCancellationRequested)return;return this.resolve(e)}this._isResolved||(this._currentResolve=this._doResolve(e).finally((()=>this._currentResolve=void 0))),yield this._currentResolve}}))}_doResolve(e){var t,n;return __awaiter$n(this,void 0,void 0,(function*(){try{const i=yield Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=null!==(t=null==i?void 0:i.tooltip)&&void 0!==t?t:this.hint.tooltip,this.hint.label=null!==(n=null==i?void 0:i.label)&&void 0!==n?n:this.hint.label,this._isResolved=!0}catch(i){onUnexpectedExternalError(i),this._isResolved=!1}}))}}class InlayHintsFragments{constructor(e,t,n){this._disposables=new DisposableStore,this.ranges=e,this.provider=new Set;const i=[];for(const[o,r]of t){this._disposables.add(o),this.provider.add(r);for(const e of o.hints){let t=n.validatePosition(e.position),o="before";const s=InlayHintsFragments._getRangeAtPosition(n,t);let a;s.getStartPosition().isBefore(t)?(a=Range$2.fromPositions(s.getStartPosition(),t),o="after"):(a=Range$2.fromPositions(t,s.getEndPosition()),o="before"),i.push(new InlayHintItem(e,new InlayHintAnchor(a,o),r))}}this.items=i.sort(((e,t)=>Position$1.compare(e.hint.position,t.hint.position)))}static create(e,t,n,i){return __awaiter$n(this,void 0,void 0,(function*(){const o=[],r=e.ordered(t).reverse().map((e=>n.map((n=>__awaiter$n(this,void 0,void 0,(function*(){try{const r=yield e.provideInlayHints(t,n,i);(null==r?void 0:r.hints.length)&&o.push([r,e])}catch(r){onUnexpectedExternalError(r)}}))))));if(yield Promise.all(r.flat()),i.isCancellationRequested||t.isDisposed())throw new CancellationError;return new InlayHintsFragments(n,o,t)}))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const n=t.lineNumber,i=e.getWordAtPosition(t);if(i)return new Range$2(n,i.startColumn,n,i.endColumn);e.tokenizeIfCheap(n);const o=e.getLineTokens(n),r=t.column-1,s=o.findTokenIndexAtOffset(r);let a=o.getStartOffset(s),l=o.getEndOffset(s);return l-a==1&&(a===r&&s>1?(a=o.getStartOffset(s-1),l=o.getEndOffset(s-1)):l===r&&s<o.getCount()-1&&(a=o.getStartOffset(s+1),l=o.getEndOffset(s+1))),new Range$2(n,a+1,n,l+1)}}function asCommandLink(e){return URI.from({scheme:Schemas.command,path:e.id,query:e.arguments&&encodeURIComponent(JSON.stringify(e.arguments))}).toString()}var __awaiter$m=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};function showGoToContextMenu(e,t,n,i){var o;return __awaiter$m(this,void 0,void 0,(function*(){const r=e.get(ITextModelService),s=e.get(IContextMenuService),a=e.get(ICommandService),l=e.get(IInstantiationService),c=e.get(INotificationService);if(yield i.item.resolve(CancellationToken.None),!i.part.location)return;const d=i.part.location,u=[],h=new Set(MenuRegistry.getMenuItems(MenuId.EditorContext).map((e=>isIMenuItem(e)?e.command.id:"")));for(const e of EditorExtensionsRegistry.getEditorActions())e instanceof SymbolNavigationAction&&h.has(e.id)&&u.push(new Action(e.id,e.label,void 0,!0,(()=>__awaiter$m(this,void 0,void 0,(function*(){const n=yield r.createModelReference(d.uri);try{yield l.invokeFunction(e.run.bind(e),t,new SymbolNavigationAnchor(n.object.textEditorModel,Range$2.getStartPosition(d.range)))}finally{n.dispose()}})))));if(i.part.command){const{command:e}=i.part;u.push(new Separator),u.push(new Action(e.id,e.title,void 0,!0,(()=>__awaiter$m(this,void 0,void 0,(function*(){var t;try{yield a.executeCommand(e.id,...null!==(t=e.arguments)&&void 0!==t?t:[])}catch(n){c.notify({severity:Severity.Error,source:i.item.provider.displayName,message:n})}})))))}const g=t.getOption(115);s.showContextMenu({domForShadowRoot:g&&null!==(o=t.getDomNode())&&void 0!==o?o:void 0,getAnchor:()=>{const e=getDomNodePagePosition(n);return{x:e.left,y:e.top+e.height+8}},getActions:()=>u,onHide:()=>{t.focus()},autoSelectFirstItem:!0})}))}function goToDefinitionWithLocation(e,t,n,i){return __awaiter$m(this,void 0,void 0,(function*(){const o=e.get(ITextModelService),r=yield o.createModelReference(i.uri);yield n.invokeWithinContext((e=>__awaiter$m(this,void 0,void 0,(function*(){const o=t.hasSideBySideModifier,s=e.get(IContextKeyService),a=PeekContext.inPeekEditor.getValue(s),l=!o&&n.getOption(78)&&!a;return new DefinitionAction({openToSide:o,openInPeek:l,muteMessage:!0},{alias:"",label:"",id:"",precondition:void 0}).run(e,n,{model:r.object.textEditorModel,position:Range$2.getStartPosition(i.range)})})))),r.dispose()}))}var __decorate$C=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$B=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$l=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class InlayHintsCache{constructor(){this._entries=new LRUCache(50)}get(e){const t=InlayHintsCache._key(e);return this._entries.get(t)}set(e,t){const n=InlayHintsCache._key(e);this._entries.set(n,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const IInlayHintsCache=createDecorator("IInlayHintsCache");registerSingleton(IInlayHintsCache,InlayHintsCache,!0);class RenderedInlayHintLabelPart{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return"string"==typeof e?{label:e}:e[this.index]}}class ActiveInlayHintInfo{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let InlayHintsController=class e{constructor(e,t,n,i,o,r,s){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=i,this._commandService=o,this._notificationService=r,this._instaService=s,this._disposables=new DisposableStore,this._sessionDisposables=new DisposableStore,this._decorationsMetadata=new Map,this._ruleFactory=new DynamicCssRules(this._editor),this._debounceInfo=n.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange((()=>this._update()))),this._disposables.add(e.onDidChangeModel((()=>this._update()))),this._disposables.add(e.onDidChangeModelLanguage((()=>this._update()))),this._disposables.add(e.onDidChangeConfiguration((e=>{e.hasChanged(127)&&this._update()}))),this._update()}static get(t){var n;return null!==(n=t.getContribution(e.ID))&&void 0!==n?n:void 0}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){if(this._sessionDisposables.clear(),this._removeAllDecorations(),!this._editor.getOption(127).enabled)return;const e=this._editor.getModel();if(!e||!this._languageFeaturesService.inlayHintsProvider.has(e))return;const t=this._inlayHintsCache.get(e);let n;t&&this._updateHintsDecorators([e.getFullModelRange()],t),this._sessionDisposables.add(toDisposable((()=>{e.isDisposed()||this._cacheHintsForFastRestore(e)})));let i=new Set;const o=new RunOnceScheduler((()=>__awaiter$l(this,void 0,void 0,(function*(){const t=Date.now();null==n||n.dispose(!0),n=new CancellationTokenSource$1;const r=e.onWillDispose((()=>null==n?void 0:n.cancel()));try{const s=n.token,a=yield InlayHintsFragments.create(this._languageFeaturesService.inlayHintsProvider,e,this._getHintsRanges(),s);if(o.delay=this._debounceInfo.update(e,Date.now()-t),s.isCancellationRequested)return void a.dispose();for(const e of a.provider)"function"!=typeof e.onDidChangeInlayHints||i.has(e)||(i.add(e),this._sessionDisposables.add(e.onDidChangeInlayHints((()=>{o.isScheduled()||o.schedule()}))));this._sessionDisposables.add(a),this._updateHintsDecorators(a.ranges,a.items),this._cacheHintsForFastRestore(e)}catch(s){onUnexpectedError(s)}finally{n.dispose(),r.dispose()}}))),this._debounceInfo.get(e));this._sessionDisposables.add(o),this._sessionDisposables.add(toDisposable((()=>null==n?void 0:n.dispose(!0)))),o.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange((e=>{!e.scrollTopChanged&&o.isScheduled()||o.schedule()}))),this._sessionDisposables.add(this._editor.onDidChangeModelContent((e=>{const t=Math.max(o.delay,1250);o.schedule(t)}))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installDblClickGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new DisposableStore,t=e.add(new ClickLinkGesture(this._editor)),n=new DisposableStore;return e.add(n),e.add(t.onMouseMoveOrRelevantKeyDown((e=>{const[t]=e,i=this._getInlayHintLabelPart(t),o=this._editor.getModel();if(!i||!o)return void n.clear();const r=new CancellationTokenSource$1;n.add(toDisposable((()=>r.dispose(!0)))),i.item.resolve(r.token),this._activeInlayHintPart=i.part.command||i.part.location?new ActiveInlayHintInfo(i,t.hasTriggerModifier):void 0;const s=i.item.hint.position.lineNumber,a=new Range$2(s,1,s,o.getLineMaxColumn(s)),l=new Set;for(const n of this._decorationsMetadata.values())a.containsRange(n.item.anchor.range)&&l.add(n.item);this._updateHintsDecorators([a],Array.from(l)),n.add(toDisposable((()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([a],Array.from(l))})))}))),e.add(t.onCancel((()=>n.clear()))),e.add(t.onExecute((e=>__awaiter$l(this,void 0,void 0,(function*(){const t=this._getInlayHintLabelPart(e);if(t){const n=t.part;n.location?this._instaService.invokeFunction(goToDefinitionWithLocation,e,this._editor,n.location):Command.is(n.command)&&(yield this._invokeCommand(n.command,t.item))}}))))),e}_installDblClickGesture(){return this._editor.onMouseUp((e=>__awaiter$l(this,void 0,void 0,(function*(){if(2!==e.event.detail)return;const t=this._getInlayHintLabelPart(e);t&&(e.event.preventDefault(),yield t.item.resolve(CancellationToken.None),t.item.hint.command&&(yield this._invokeCommand(t.item.hint.command,t.item)))}))))}_installContextMenu(){return this._editor.onContextMenu((e=>__awaiter$l(this,void 0,void 0,(function*(){if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&(yield this._instaService.invokeFunction(showGoToContextMenu,this._editor,e.event.target,t))}))))}_getInlayHintLabelPart(e){var t;if(6!==e.target.type)return;const n=null===(t=e.target.detail.injectedText)||void 0===t?void 0:t.options;return n instanceof ModelDecorationInjectedTextOptions&&(null==n?void 0:n.attachedData)instanceof RenderedInlayHintLabelPart?n.attachedData:void 0}_invokeCommand(e,t){var n;return __awaiter$l(this,void 0,void 0,(function*(){try{yield this._commandService.executeCommand(e.id,...null!==(n=e.arguments)&&void 0!==n?n:[])}catch(i){this._notificationService.notify({severity:Severity.Error,source:t.provider.displayName,message:i})}}))}_cacheHintsForFastRestore(e){const t=new Map;for(const[n,i]of this._decorationsMetadata){if(t.has(i.item))continue;let o=i.item;const r=e.getDecorationRange(n);if(r){const e=new InlayHintAnchor(r,i.item.anchor.direction);o=i.item.with({anchor:e})}t.set(i.item,o)}this._inlayHintsCache.set(e,Array.from(t.values()))}_getHintsRanges(){const e=this._editor.getModel(),t=this._editor.getVisibleRangesPlusViewportAboveBelow(),n=[];for(const i of t.sort(Range$2.compareRangesUsingStarts)){const t=e.validateRange(new Range$2(i.startLineNumber-30,i.startColumn,i.endLineNumber+30,i.endColumn));0!==n.length&&Range$2.areIntersectingOrTouching(n[n.length-1],t)?n[n.length-1]=Range$2.plusRange(n[n.length-1],t):n.push(t)}return n}_updateHintsDecorators(t,n){var i,o;const r=[],s=(e,t,n,i,o)=>{r.push({item:e,classNameRef:t,decoration:{range:e.anchor.range,options:{description:"InlayHint",showIfCollapsed:e.anchor.range.isEmpty(),collapseOnReplaceEdit:!e.anchor.range.isEmpty(),stickiness:0,[e.anchor.direction]:{content:n,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:t.className,cursorStops:i,attachedData:o}}}})},a=(e,t)=>{const n=this._ruleFactory.createClassNameRef({width:(l/3|0)+"px",display:"inline-block"});s(e,n," ",t?InjectedTextCursorStops$1.Right:InjectedTextCursorStops$1.None)},{fontSize:l,fontFamily:c}=this._getLayoutInfo(),d="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(d,c);for(const g of n){g.hint.paddingLeft&&a(g,!1);const t="string"==typeof g.hint.label?[{label:g.hint.label}]:g.hint.label;for(let e=0;e<t.length;e++){const n=t[e],o=0===e,r=e===t.length-1,a={fontSize:`${l}px`,fontFamily:`var(${d}), ${EDITOR_FONT_DEFAULTS.fontFamily}`,verticalAlign:"middle"};g.hint.command&&(a.cursor="pointer"),this._fillInColors(a,g.hint),(n.command||n.location)&&(null===(i=this._activeInlayHintPart)||void 0===i?void 0:i.part.item)===g&&this._activeInlayHintPart.part.index===e&&(a.textDecoration="underline",this._activeInlayHintPart.hasTriggerModifier&&(a.color=themeColorFromId(editorActiveLinkForeground),a.cursor="pointer")),o&&r?(a.padding=`1px ${0|Math.max(1,l/4)}px`,a.borderRadius=(l/4|0)+"px"):o?(a.padding=`1px 0 1px ${0|Math.max(1,l/4)}px`,a.borderRadius=`${l/4|0}px 0 0 ${l/4|0}px`):r?(a.padding=`1px ${0|Math.max(1,l/4)}px 1px 0`,a.borderRadius=`0 ${l/4|0}px ${l/4|0}px 0`):a.padding="1px 0 1px 0",s(g,this._ruleFactory.createClassNameRef(a),fixSpace(n.label),r&&!g.hint.paddingRight?InjectedTextCursorStops$1.Right:InjectedTextCursorStops$1.None,new RenderedInlayHintLabelPart(g,e))}if(g.hint.paddingRight&&a(g,!0),r.length>e._MAX_DECORATORS)break}const u=[];for(const e of t)for(const{id:t}of null!==(o=this._editor.getDecorationsInRange(e))&&void 0!==o?o:[]){const e=this._decorationsMetadata.get(t);e&&(u.push(t),e.classNameRef.dispose(),this._decorationsMetadata.delete(t))}const h=this._editor.deltaDecorations(u,r.map((e=>e.decoration)));for(let e=0;e<h.length;e++){const t=r[e];this._decorationsMetadata.set(h[e],{item:t.item,classNameRef:t.classNameRef})}}_fillInColors(e,t){t.kind===InlayHintKind$1.Parameter?(e.backgroundColor=themeColorFromId(editorInlayHintParameterBackground),e.color=themeColorFromId(editorInlayHintParameterForeground)):t.kind===InlayHintKind$1.Type?(e.backgroundColor=themeColorFromId(editorInlayHintTypeBackground),e.color=themeColorFromId(editorInlayHintTypeForeground)):(e.backgroundColor=themeColorFromId(editorInlayHintBackground),e.color=themeColorFromId(editorInlayHintForeground))}_getLayoutInfo(){const e=this._editor.getOption(127),t=this._editor.getOption(46);let n=e.fontSize;(!n||n<5||n>t)&&(n=.9*t|0);return{fontSize:n,fontFamily:e.fontFamily||this._editor.getOption(43)}}_removeAllDecorations(){this._editor.deltaDecorations(Array.from(this._decorationsMetadata.keys()),[]);for(let e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};function fixSpace(e){return e.replace(/[ \t]/g," ")}InlayHintsController.ID="editor.contrib.InlayHints",InlayHintsController._MAX_DECORATORS=1500,InlayHintsController=__decorate$C([__param$B(1,ILanguageFeaturesService),__param$B(2,ILanguageFeatureDebounceService),__param$B(3,IInlayHintsCache),__param$B(4,ICommandService),__param$B(5,INotificationService),__param$B(6,IInstantiationService)],InlayHintsController),CommandsRegistry.registerCommand("_executeInlayHintProvider",((e,...t)=>__awaiter$l(void 0,void 0,void 0,(function*(){const[n,i]=t;assertType(URI.isUri(n)),assertType(Range$2.isIRange(i));const{inlayHintsProvider:o}=e.get(ILanguageFeaturesService),r=yield e.get(ITextModelService).createModelReference(n);try{const e=yield InlayHintsFragments.create(o,r.object.textEditorModel,[Range$2.lift(i)],CancellationToken.None),t=e.items.map((e=>e.hint));return setTimeout((()=>e.dispose()),0),t}finally{r.dispose()}}))));var __decorate$B=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$A=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$k=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},__asyncValues=globalThis&&globalThis.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise((function(i,o){(function(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)})(i,o,(t=e[n](t)).done,t.value)}))}}};class InlayHintsHoverAnchor extends HoverForeignElementAnchor{constructor(e,t){super(10,t,e.item.anchor.range),this.part=e}}let InlayHintsHover=class extends MarkdownHoverParticipant{constructor(e,t,n,i,o,r){super(e,t,n,i,r),this._resolverService=o,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!InlayHintsController.get(this._editor))return null;if(6!==e.target.type)return null;const n=null===(t=e.target.detail.injectedText)||void 0===t?void 0:t.options;return n instanceof ModelDecorationInjectedTextOptions&&n.attachedData instanceof RenderedInlayHintLabelPart?new InlayHintsHoverAnchor(n.attachedData,this):null}computeSync(){return[]}computeAsync(e,t,n){return e instanceof InlayHintsHoverAnchor?new AsyncIterableObject((t=>__awaiter$k(this,void 0,void 0,(function*(){var i,o;const{part:r}=e;if(yield r.item.resolve(n),n.isCancellationRequested)return;let s,a;if("string"==typeof r.item.hint.tooltip?s=(new MarkdownString).appendText(r.item.hint.tooltip):r.item.hint.tooltip&&(s=r.item.hint.tooltip),s&&t.emitOne(new MarkdownHover(this,e.range,[s],0)),"string"==typeof r.part.tooltip?a=(new MarkdownString).appendText(r.part.tooltip):r.part.tooltip&&(a=r.part.tooltip),a&&t.emitOne(new MarkdownHover(this,e.range,[a],1)),r.part.location||r.part.command){let n;const i="altKey"===this._editor.getOption(70)?isMacintosh?localize("links.navigate.kb.meta.mac","cmd + click"):localize("links.navigate.kb.meta","ctrl + click"):isMacintosh?localize("links.navigate.kb.alt.mac","option + click"):localize("links.navigate.kb.alt","alt + click");r.part.location&&r.part.command?n=(new MarkdownString).appendText(localize("hint.defAndCommand","Go to Definition ({0}), right click for more",i)):r.part.location?n=(new MarkdownString).appendText(localize("hint.def","Go to Definition ({0})",i)):r.part.command&&(n=new MarkdownString(`[${localize("hint.cmd","Execute Command")}](${asCommandLink(r.part.command)} "${r.part.command.title}") (${i})`,{isTrusted:!0})),n&&t.emitOne(new MarkdownHover(this,e.range,[n],1e4))}const l=yield this._resolveInlayHintLabelPartHover(r,n);try{for(var c,d=__asyncValues(l);!(c=yield d.next()).done;){let e=c.value;t.emitOne(e)}}catch(u){i={error:u}}finally{try{c&&!c.done&&(o=d.return)&&(yield o.call(d))}finally{if(i)throw i.error}}})))):AsyncIterableObject.EMPTY}_resolveInlayHintLabelPartHover(e,t){return __awaiter$k(this,void 0,void 0,(function*(){if(!e.part.location)return AsyncIterableObject.EMPTY;const{uri:n,range:i}=e.part.location,o=yield this._resolverService.createModelReference(n);try{const n=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(n)?getHover(this._languageFeaturesService.hoverProvider,n,new Position$1(i.startLineNumber,i.startColumn),t).filter((e=>!isEmptyMarkdownString(e.hover.contents))).map((t=>new MarkdownHover(this,e.item.anchor.range,t.hover.contents,2+t.ordinal))):AsyncIterableObject.EMPTY}finally{o.dispose()}}))}};InlayHintsHover=__decorate$B([__param$A(1,ILanguageService),__param$A(2,IOpenerService),__param$A(3,IConfigurationService),__param$A(4,ITextModelService),__param$A(5,ILanguageFeaturesService)],InlayHintsHover),registerEditorContribution(InlayHintsController.ID,InlayHintsController),HoverParticipantRegistry.register(InlayHintsHover);class InPlaceReplaceCommand{constructor(e,t,n){this._editRange=e,this._originalSelection=t,this._text=n}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new Selection$1(n.endLineNumber,Math.min(this._originalSelection.positionColumn,n.endColumn),n.endLineNumber,Math.min(this._originalSelection.positionColumn,n.endColumn)):new Selection$1(n.endLineNumber,n.endColumn-this._text.length,n.endLineNumber,n.endColumn)}}var __decorate$A=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$z=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let InPlaceReplaceController=class e{constructor(e,t){this.decorationIds=[],this.editor=e,this.editorWorkerService=t}static get(t){return t.getContribution(e.ID)}dispose(){}run(t,n){this.currentRequest&&this.currentRequest.cancel();const i=this.editor.getSelection(),o=this.editor.getModel();if(!o||!i)return;let r=i;if(r.startLineNumber!==r.endLineNumber)return;const s=new EditorState$1(this.editor,5),a=o.uri;return this.editorWorkerService.canNavigateValueSet(a)?(this.currentRequest=createCancelablePromise((e=>this.editorWorkerService.navigateValueSet(a,r,n))),this.currentRequest.then((n=>{if(!n||!n.range||!n.value)return;if(!s.validate(this.editor))return;let i=Range$2.lift(n.range),o=n.range,a=n.value.length-(r.endColumn-r.startColumn);o={startLineNumber:o.startLineNumber,startColumn:o.startColumn,endLineNumber:o.endLineNumber,endColumn:o.startColumn+n.value.length},a>1&&(r=new Selection$1(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn+a-1));const l=new InPlaceReplaceCommand(i,r,n.value);this.editor.pushUndoStop(),this.editor.executeCommand(t,l),this.editor.pushUndoStop(),this.decorationIds=this.editor.deltaDecorations(this.decorationIds,[{range:o,options:e.DECORATION}]),this.decorationRemover&&this.decorationRemover.cancel(),this.decorationRemover=timeout(350),this.decorationRemover.then((()=>this.decorationIds=this.editor.deltaDecorations(this.decorationIds,[]))).catch(onUnexpectedError)})).catch(onUnexpectedError)):Promise.resolve(void 0)}};InPlaceReplaceController.ID="editor.contrib.inPlaceReplaceController",InPlaceReplaceController.DECORATION=ModelDecorationOptions.register({description:"in-place-replace",className:"valueSetReplacement"}),InPlaceReplaceController=__decorate$A([__param$z(1,IEditorWorkerService)],InPlaceReplaceController);class InPlaceReplaceUp extends EditorAction{constructor(){super({id:"editor.action.inPlaceReplace.up",label:localize("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3154,weight:100}})}run(e,t){const n=InPlaceReplaceController.get(t);return n?n.run(this.id,!0):Promise.resolve(void 0)}}class InPlaceReplaceDown extends EditorAction{constructor(){super({id:"editor.action.inPlaceReplace.down",label:localize("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3156,weight:100}})}run(e,t){const n=InPlaceReplaceController.get(t);return n?n.run(this.id,!1):Promise.resolve(void 0)}}registerEditorContribution(InPlaceReplaceController.ID,InPlaceReplaceController),registerEditorAction(InPlaceReplaceUp),registerEditorAction(InPlaceReplaceDown),registerThemingParticipant(((e,t)=>{const n=e.getColor(editorBracketMatchBorder);n&&t.addRule(`.monaco-editor.vs .valueSetReplacement { outline: solid 2px ${n}; }`)}));class ExpandLineSelectionAction extends EditorAction{constructor(){super({id:"expandLineSelection",label:localize("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:EditorContextKeys.textInputFocus,primary:2090}})}run(e,t,n){if(n=n||{},!t.hasModel())return;const i=t._getViewModel();i.model.pushStackElement(),i.setCursorStates(n.source,3,CursorMoveCommands.expandLineSelection(i,i.getCursorStates())),i.revealPrimaryCursor(n.source,!0)}}registerEditorAction(ExpandLineSelectionAction);class TrimTrailingWhitespaceCommand{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const n=trimTrailingWhitespace(e,this._cursors);for(let i=0,o=n.length;i<o;i++){const e=n[i];t.addEditOperation(e.range,e.text)}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function trimTrailingWhitespace(e,t){t.sort(((e,t)=>e.lineNumber===t.lineNumber?e.column-t.column:e.lineNumber-t.lineNumber));for(let s=t.length-2;s>=0;s--)t[s].lineNumber===t[s+1].lineNumber&&t.splice(s,1);const n=[];let i=0,o=0;const r=t.length;for(let s=1,a=e.getLineCount();s<=a;s++){const a=e.getLineContent(s),l=a.length+1;let c=0;if(o<r&&t[o].lineNumber===s&&(c=t[o].column,o++,c===l))continue;if(0===a.length)continue;const d=lastNonWhitespaceIndex(a);let u=0;if(-1===d)u=1;else{if(d===a.length-1)continue;u=d+2}u=Math.max(c,u),n[i++]=EditOperation.delete(new Range$2(s,u,s,l))}return n}class CopyLinesCommand{constructor(e,t,n){this._selection=e,this._isCopyingDown=t,this._noop=n||!1,this._selectionDirection=0,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let n=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,n.startLineNumber<n.endLineNumber&&1===n.endColumn&&(this._endLineNumberDelta=1,n=n.setEndPosition(n.endLineNumber-1,e.getLineMaxColumn(n.endLineNumber-1)));let i=[];for(let r=n.startLineNumber;r<=n.endLineNumber;r++)i.push(e.getLineContent(r));const o=i.join("\n");""===o&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new Range$2(n.endLineNumber,e.getLineMaxColumn(n.endLineNumber),n.endLineNumber+1,1),n.endLineNumber===e.getLineCount()?"":"\n"):this._isCopyingDown?t.addEditOperation(new Range$2(n.startLineNumber,1,n.startLineNumber,1),o+"\n"):t.addEditOperation(new Range$2(n.endLineNumber,e.getLineMaxColumn(n.endLineNumber),n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)),"\n"+o),this._selectionId=t.trackSelection(n),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let n=t.getTrackedSelection(this._selectionId);if(0!==this._startLineNumberDelta||0!==this._endLineNumberDelta){let e=n.startLineNumber,t=n.startColumn,i=n.endLineNumber,o=n.endColumn;0!==this._startLineNumberDelta&&(e+=this._startLineNumberDelta,t=1),0!==this._endLineNumberDelta&&(i+=this._endLineNumberDelta,o=1),n=Selection$1.createWithDirection(e,t,i,o,this._selectionDirection)}return n}}class MoveLinesCommand{constructor(e,t,n){this._selection=e,this._isMovingDown=t,this._autoIndent=n,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){let n=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===n)return void(this._selectionId=t.trackSelection(this._selection));if(!this._isMovingDown&&1===this._selection.startLineNumber)return void(this._selectionId=t.trackSelection(this._selection));this._moveEndPositionDown=!1;let i=this._selection;i.startLineNumber<i.endLineNumber&&1===i.endColumn&&(this._moveEndPositionDown=!0,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const{tabSize:o,indentSize:r,insertSpaces:s}=e.getOptions();let a=this.buildIndentConverter(o,r,s),l={getLineTokens:t=>e.getLineTokens(t),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(t,n)=>e.getLanguageIdAtPosition(t,n),getLineContent:null};if(i.startLineNumber===i.endLineNumber&&1===e.getLineMaxColumn(i.startLineNumber)){let n=i.startLineNumber,o=this._isMovingDown?n+1:n-1;1===e.getLineMaxColumn(o)?t.addEditOperation(new Range$2(1,1,1,1),null):(t.addEditOperation(new Range$2(n,1,n,1),e.getLineContent(o)),t.addEditOperation(new Range$2(o,1,o,e.getLineMaxColumn(o)),null)),i=new Selection$1(o,1,o,1)}else{let n,r;if(this._isMovingDown){n=i.endLineNumber+1,r=e.getLineContent(n),t.addEditOperation(new Range$2(n-1,e.getLineMaxColumn(n-1),n,e.getLineMaxColumn(n)),null);let c=r;if(this.shouldAutoIndent(e,i)){let d=this.matchEnterRule(e,a,o,n,i.startLineNumber-1);if(null!==d){let t=generateIndent(d+getSpaceCnt(getLeadingWhitespace(e.getLineContent(n)),o),o,s);c=t+this.trimLeft(r)}else{l.getLineContent=t=>t===i.startLineNumber?e.getLineContent(n):e.getLineContent(t);let t=LanguageConfigurationRegistry.getGoodIndentForLine(this._autoIndent,l,e.getLanguageIdAtPosition(n,1),i.startLineNumber,a);if(null!==t){let i=getLeadingWhitespace(e.getLineContent(n)),a=getSpaceCnt(t,o);if(a!==getSpaceCnt(i,o)){let e=generateIndent(a,o,s);c=e+this.trimLeft(r)}}}t.addEditOperation(new Range$2(i.startLineNumber,1,i.startLineNumber,1),c+"\n");let u=this.matchEnterRuleMovingDown(e,a,o,i.startLineNumber,n,c);if(null!==u)0!==u&&this.getIndentEditsOfMovingBlock(e,t,i,o,s,u);else{l.getLineContent=t=>t===i.startLineNumber?c:t>=i.startLineNumber+1&&t<=i.endLineNumber+1?e.getLineContent(t-1):e.getLineContent(t);let r=LanguageConfigurationRegistry.getGoodIndentForLine(this._autoIndent,l,e.getLanguageIdAtPosition(n,1),i.startLineNumber+1,a);if(null!==r){const n=getLeadingWhitespace(e.getLineContent(i.startLineNumber)),a=getSpaceCnt(r,o),l=getSpaceCnt(n,o);if(a!==l){const n=a-l;this.getIndentEditsOfMovingBlock(e,t,i,o,s,n)}}}}else t.addEditOperation(new Range$2(i.startLineNumber,1,i.startLineNumber,1),c+"\n")}else if(n=i.startLineNumber-1,r=e.getLineContent(n),t.addEditOperation(new Range$2(n,1,n+1,1),null),t.addEditOperation(new Range$2(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),"\n"+r),this.shouldAutoIndent(e,i)){l.getLineContent=t=>t===n?e.getLineContent(i.startLineNumber):e.getLineContent(t);let r=this.matchEnterRule(e,a,o,i.startLineNumber,i.startLineNumber-2);if(null!==r)0!==r&&this.getIndentEditsOfMovingBlock(e,t,i,o,s,r);else{let r=LanguageConfigurationRegistry.getGoodIndentForLine(this._autoIndent,l,e.getLanguageIdAtPosition(i.startLineNumber,1),n,a);if(null!==r){let n=getLeadingWhitespace(e.getLineContent(i.startLineNumber)),a=getSpaceCnt(r,o),l=getSpaceCnt(n,o);if(a!==l){let n=a-l;this.getIndentEditsOfMovingBlock(e,t,i,o,s,n)}}}}}this._selectionId=t.trackSelection(i)}buildIndentConverter(e,t,n){return{shiftIndent:i=>ShiftCommand.shiftIndent(i,i.length+1,e,t,n),unshiftIndent:i=>ShiftCommand.unshiftIndent(i,i.length+1,e,t,n)}}parseEnterResult(e,t,n,i,o){if(o){let r=o.indentation;o.indentAction===IndentAction$1.None||o.indentAction===IndentAction$1.Indent?r=o.indentation+o.appendText:o.indentAction===IndentAction$1.IndentOutdent?r=o.indentation:o.indentAction===IndentAction$1.Outdent&&(r=t.unshiftIndent(o.indentation)+o.appendText);let s=e.getLineContent(i);if(this.trimLeft(s).indexOf(this.trimLeft(r))>=0){let o=getLeadingWhitespace(e.getLineContent(i)),s=getLeadingWhitespace(r),a=LanguageConfigurationRegistry.getIndentMetadata(e,i);return null!==a&&2&a&&(s=t.unshiftIndent(s)),getSpaceCnt(s,n)-getSpaceCnt(o,n)}}return null}matchEnterRuleMovingDown(e,t,n,i,o,r){if(lastNonWhitespaceIndex(r)>=0){let r=e.getLineMaxColumn(o),s=LanguageConfigurationRegistry.getEnterAction(this._autoIndent,e,new Range$2(o,r,o,r));return this.parseEnterResult(e,t,n,i,s)}{let o=i-1;for(;o>=1;){if(lastNonWhitespaceIndex(e.getLineContent(o))>=0)break;o--}if(o<1||i>e.getLineCount())return null;let r=e.getLineMaxColumn(o),s=LanguageConfigurationRegistry.getEnterAction(this._autoIndent,e,new Range$2(o,r,o,r));return this.parseEnterResult(e,t,n,i,s)}}matchEnterRule(e,t,n,i,o,r){let s=o;for(;s>=1;){let t;if(t=s===o&&void 0!==r?r:e.getLineContent(s),lastNonWhitespaceIndex(t)>=0)break;s--}if(s<1||i>e.getLineCount())return null;let a=e.getLineMaxColumn(s),l=LanguageConfigurationRegistry.getEnterAction(this._autoIndent,e,new Range$2(s,a,s,a));return this.parseEnterResult(e,t,n,i,l)}trimLeft(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4)return!1;if(!e.isCheapToTokenize(t.startLineNumber))return!1;let n=e.getLanguageIdAtPosition(t.startLineNumber,1);return n===e.getLanguageIdAtPosition(t.endLineNumber,1)&&null!==LanguageConfigurationRegistry.getIndentRulesSupport(n)}getIndentEditsOfMovingBlock(e,t,n,i,o,r){for(let s=n.startLineNumber;s<=n.endLineNumber;s++){let a=getLeadingWhitespace(e.getLineContent(s)),l=generateIndent(getSpaceCnt(a,i)+r,i,o);l!==a&&(t.addEditOperation(new Range$2(s,1,s,a.length+1),l),s===n.endLineNumber&&n.endColumn<=a.length+1&&""===l&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let n=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(n=n.setEndPosition(n.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&n.startLineNumber<n.endLineNumber&&(n=n.setEndPosition(n.endLineNumber,2)),n}}class SortLinesCommand{constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}static getCollator(){return SortLinesCommand._COLLATOR||(SortLinesCommand._COLLATOR=new Intl.Collator),SortLinesCommand._COLLATOR}getEditOperations(e,t){let n=sortLines(e,this.selection,this.descending);n&&t.addEditOperation(n.range,n.text),this.selectionId=t.trackSelection(this.selection)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}static canRun(e,t,n){if(null===e)return!1;let i=getSortData(e,t,n);if(!i)return!1;for(let o=0,r=i.before.length;o<r;o++)if(i.before[o]!==i.after[o])return!0;return!1}}function getSortData(e,t,n){let i=t.startLineNumber,o=t.endLineNumber;if(1===t.endColumn&&o--,i>=o)return null;let r=[];for(let a=i;a<=o;a++)r.push(e.getLineContent(a));let s=r.slice(0);return s.sort(SortLinesCommand.getCollator().compare),!0===n&&(s=s.reverse()),{startLineNumber:i,endLineNumber:o,before:r,after:s}}function sortLines(e,t,n){let i=getSortData(e,t,n);return i?EditOperation.replace(new Range$2(i.startLineNumber,1,i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),i.after.join("\n")):null}SortLinesCommand._COLLATOR=null;class AbstractCopyLinesAction extends EditorAction{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const n=t.getSelections().map(((e,t)=>({selection:e,index:t,ignore:!1})));n.sort(((e,t)=>Range$2.compareRangesUsingStarts(e.selection,t.selection)));let i=n[0];for(let r=1;r<n.length;r++){const e=n[r];i.selection.endLineNumber===e.selection.startLineNumber&&(i.index<e.index?e.ignore=!0:(i.ignore=!0,i=e))}const o=[];for(const r of n)o.push(new CopyLinesCommand(r.selection,this.down,r.ignore));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class CopyLinesUpAction extends AbstractCopyLinesAction{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:localize("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"2_line",title:localize({key:"miCopyLinesUp",comment:["&& denotes a mnemonic"]},"&&Copy Line Up"),order:1}})}}class CopyLinesDownAction extends AbstractCopyLinesAction{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:localize("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"2_line",title:localize({key:"miCopyLinesDown",comment:["&& denotes a mnemonic"]},"Co&&py Line Down"),order:2}})}}class DuplicateSelectionAction extends EditorAction{constructor(){super({id:"editor.action.duplicateSelection",label:localize("duplicateSelection","Duplicate Selection"),alias:"Duplicate Selection",precondition:EditorContextKeys.writable,menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"2_line",title:localize({key:"miDuplicateSelection",comment:["&& denotes a mnemonic"]},"&&Duplicate Selection"),order:5}})}run(e,t,n){if(!t.hasModel())return;const i=[],o=t.getSelections(),r=t.getModel();for(const s of o)if(s.isEmpty())i.push(new CopyLinesCommand(s,!0));else{const e=new Selection$1(s.endLineNumber,s.endColumn,s.endLineNumber,s.endColumn);i.push(new ReplaceCommandThatSelectsText(e,r.getValueInRange(s)))}t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class AbstractMoveLinesAction extends EditorAction{constructor(e,t){super(t),this.down=e}run(e,t){let n=[],i=t.getSelections()||[];const o=t.getOption(9);for(const r of i)n.push(new MoveLinesCommand(r,this.down,o));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class MoveLinesUpAction extends AbstractMoveLinesAction{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:localize("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"2_line",title:localize({key:"miMoveLinesUp",comment:["&& denotes a mnemonic"]},"Mo&&ve Line Up"),order:3}})}}class MoveLinesDownAction extends AbstractMoveLinesAction{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:localize("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"2_line",title:localize({key:"miMoveLinesDown",comment:["&& denotes a mnemonic"]},"Move &&Line Down"),order:4}})}}class AbstractSortLinesAction extends EditorAction{constructor(e,t){super(t),this.descending=e}run(e,t){const n=t.getSelections()||[];for(const o of n)if(!SortLinesCommand.canRun(t.getModel(),o,this.descending))return;let i=[];for(let o=0,r=n.length;o<r;o++)i[o]=new SortLinesCommand(n[o],this.descending);t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class SortLinesAscendingAction extends AbstractSortLinesAction{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:localize("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:EditorContextKeys.writable})}}class SortLinesDescendingAction extends AbstractSortLinesAction{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:localize("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:EditorContextKeys.writable})}}class DeleteDuplicateLinesAction extends EditorAction{constructor(){super({id:"editor.action.removeDuplicateLines",label:localize("lines.deleteDuplicates","Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:EditorContextKeys.writable})}run(e,t){if(!t.hasModel())return;let n=t.getModel();if(1===n.getLineCount()&&1===n.getLineMaxColumn(1))return;let i=[],o=[],r=0;for(let s of t.getSelections()){let e=new Set,t=[];for(let i=s.startLineNumber;i<=s.endLineNumber;i++){let o=n.getLineContent(i);e.has(o)||(t.push(o),e.add(o))}let a=new Selection$1(s.startLineNumber,1,s.endLineNumber,n.getLineMaxColumn(s.endLineNumber)),l=s.startLineNumber-r,c=new Selection$1(l,1,l+t.length-1,t[t.length-1].length);i.push(EditOperation.replace(a,t.join("\n"))),o.push(c),r+=s.endLineNumber-s.startLineNumber+1-t.length}t.pushUndoStop(),t.executeEdits(this.id,i,o),t.pushUndoStop()}}class TrimTrailingWhitespaceAction extends EditorAction{constructor(){super({id:TrimTrailingWhitespaceAction.ID,label:localize("lines.trimTrailingWhitespace","Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2102),weight:100}})}run(e,t,n){let i=[];"auto-save"===n.reason&&(i=(t.getSelections()||[]).map((e=>new Position$1(e.positionLineNumber,e.positionColumn))));let o=t.getSelection();if(null===o)return;let r=new TrimTrailingWhitespaceCommand(o,i);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop()}}TrimTrailingWhitespaceAction.ID="editor.action.trimTrailingWhitespace";class DeleteLinesAction extends EditorAction{constructor(){super({id:"editor.action.deleteLines",label:localize("lines.delete","Delete Line"),alias:"Delete Line",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;let n=this._getLinesToRemove(t),i=t.getModel();if(1===i.getLineCount()&&1===i.getLineMaxColumn(1))return;let o=0,r=[],s=[];for(let a=0,l=n.length;a<l;a++){const e=n[a];let t=e.startLineNumber,l=e.endLineNumber,c=1,d=i.getLineMaxColumn(l);l<i.getLineCount()?(l+=1,d=1):t>1&&(t-=1,c=i.getLineMaxColumn(t)),r.push(EditOperation.replace(new Selection$1(t,c,l,d),"")),s.push(new Selection$1(t-o,e.positionColumn,t-o,e.positionColumn)),o+=e.endLineNumber-e.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,s),t.pushUndoStop()}_getLinesToRemove(e){let t=e.getSelections().map((e=>{let t=e.endLineNumber;return e.startLineNumber<e.endLineNumber&&1===e.endColumn&&(t-=1),{startLineNumber:e.startLineNumber,selectionStartColumn:e.selectionStartColumn,endLineNumber:t,positionColumn:e.positionColumn}}));t.sort(((e,t)=>e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber));let n=[],i=t[0];for(let o=1;o<t.length;o++)i.endLineNumber+1>=t[o].startLineNumber?i.endLineNumber=t[o].endLineNumber:(n.push(i),i=t[o]);return n.push(i),n}}class IndentLinesAction extends EditorAction{constructor(){super({id:"editor.action.indentLines",label:localize("lines.indent","Indent Line"),alias:"Indent Line",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:2137,weight:100}})}run(e,t){const n=t._getViewModel();n&&(t.pushUndoStop(),t.executeCommands(this.id,TypeOperations.indent(n.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class OutdentLinesAction extends EditorAction{constructor(){super({id:"editor.action.outdentLines",label:localize("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:2135,weight:100}})}run(e,t){CoreEditingCommands.Outdent.runEditorCommand(e,t,null)}}class InsertLineBeforeAction extends EditorAction{constructor(){super({id:"editor.action.insertLineBefore",label:localize("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3075,weight:100}})}run(e,t){const n=t._getViewModel();n&&(t.pushUndoStop(),t.executeCommands(this.id,TypeOperations.lineInsertBefore(n.cursorConfig,t.getModel(),t.getSelections())))}}class InsertLineAfterAction extends EditorAction{constructor(){super({id:"editor.action.insertLineAfter",label:localize("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:2051,weight:100}})}run(e,t){const n=t._getViewModel();n&&(t.pushUndoStop(),t.executeCommands(this.id,TypeOperations.lineInsertAfter(n.cursorConfig,t.getModel(),t.getSelections())))}}class AbstractDeleteAllToBoundaryAction extends EditorAction{run(e,t){if(!t.hasModel())return;const n=t.getSelection();let i=this._getRangesToDelete(t),o=[];for(let a=0,l=i.length-1;a<l;a++){let e=i[a],t=i[a+1];null===Range$2.intersectRanges(e,t)?o.push(e):i[a+1]=Range$2.plusRange(e,t)}o.push(i[i.length-1]);let r=this._getEndCursorState(n,o),s=o.map((e=>EditOperation.replace(e,"")));t.pushUndoStop(),t.executeEdits(this.id,s,r),t.pushUndoStop()}}class DeleteAllLeftAction extends AbstractDeleteAllToBoundaryAction{constructor(){super({id:"deleteAllLeft",label:localize("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let n=null,i=[],o=0;return t.forEach((t=>{let r;if(1===t.endColumn&&o>0){let e=t.startLineNumber-o;r=new Selection$1(e,t.startColumn,e,t.startColumn)}else r=new Selection$1(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn);o+=t.endLineNumber-t.startLineNumber,t.intersectRanges(e)?n=r:i.push(r)})),n&&i.unshift(n),i}_getRangesToDelete(e){let t=e.getSelections();if(null===t)return[];let n=t,i=e.getModel();return null===i?[]:(n.sort(Range$2.compareRangesUsingStarts),n=n.map((e=>{if(e.isEmpty()){if(1===e.startColumn){let t=Math.max(1,e.startLineNumber-1),n=1===e.startLineNumber?1:i.getLineContent(t).length+1;return new Range$2(t,n,e.startLineNumber,1)}return new Range$2(e.startLineNumber,1,e.startLineNumber,e.startColumn)}return new Range$2(e.startLineNumber,1,e.endLineNumber,e.endColumn)})),n)}}class DeleteAllRightAction extends AbstractDeleteAllToBoundaryAction{constructor(){super({id:"deleteAllRight",label:localize("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let n=null,i=[];for(let o=0,r=t.length,s=0;o<r;o++){let r=t[o],a=new Selection$1(r.startLineNumber-s,r.startColumn,r.startLineNumber-s,r.startColumn);r.intersectRanges(e)?n=a:i.push(a)}return n&&i.unshift(n),i}_getRangesToDelete(e){let t=e.getModel();if(null===t)return[];let n=e.getSelections();if(null===n)return[];let i=n.map((e=>{if(e.isEmpty()){const n=t.getLineMaxColumn(e.startLineNumber);return e.startColumn===n?new Range$2(e.startLineNumber,e.startColumn,e.startLineNumber+1,1):new Range$2(e.startLineNumber,e.startColumn,e.startLineNumber,n)}return e}));return i.sort(Range$2.compareRangesUsingStarts),i}}class JoinLinesAction extends EditorAction{constructor(){super({id:"editor.action.joinLines",label:localize("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){let n=t.getSelections();if(null===n)return;let i=t.getSelection();if(null===i)return;n.sort(Range$2.compareRangesUsingStarts);let o=[],r=n.reduce(((e,t)=>e.isEmpty()?e.endLineNumber===t.startLineNumber?(i.equalsSelection(e)&&(i=t),t):t.startLineNumber>e.endLineNumber+1?(o.push(e),t):new Selection$1(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn):t.startLineNumber>e.endLineNumber?(o.push(e),t):new Selection$1(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn)));o.push(r);let s=t.getModel();if(null===s)return;let a=[],l=[],c=i,d=0;for(let u=0,h=o.length;u<h;u++){let e,t,n=o[u],r=n.startLineNumber,h=1,g=0,p=s.getLineContent(n.endLineNumber).length-n.endColumn;if(n.isEmpty()||n.startLineNumber===n.endLineNumber){let i=n.getStartPosition();i.lineNumber<s.getLineCount()?(e=r+1,t=s.getLineMaxColumn(e)):(e=i.lineNumber,t=s.getLineMaxColumn(i.lineNumber))}else e=n.endLineNumber,t=s.getLineMaxColumn(e);let f=s.getLineContent(r);for(let i=r+1;i<=e;i++){let e=s.getLineContent(i),t=s.getLineFirstNonWhitespaceColumn(i);if(t>=1){let n=!0;""===f&&(n=!1),!n||" "!==f.charAt(f.length-1)&&"\t"!==f.charAt(f.length-1)||(n=!1,f=f.replace(/[\s\uFEFF\xA0]+$/g," "));let i=e.substr(t-1);f+=(n?" ":"")+i,g=n?i.length+1:i.length}else g=0}let m=new Range$2(r,h,e,t);if(!m.isEmpty()){let e;n.isEmpty()?(a.push(EditOperation.replace(m,f)),e=new Selection$1(m.startLineNumber-d,f.length-g+1,r-d,f.length-g+1)):n.startLineNumber===n.endLineNumber?(a.push(EditOperation.replace(m,f)),e=new Selection$1(n.startLineNumber-d,n.startColumn,n.endLineNumber-d,n.endColumn)):(a.push(EditOperation.replace(m,f)),e=new Selection$1(n.startLineNumber-d,n.startColumn,n.startLineNumber-d,f.length-p)),null!==Range$2.intersectRanges(m,i)?c=e:l.push(e)}d+=m.endLineNumber-m.startLineNumber}l.unshift(c),t.pushUndoStop(),t.executeEdits(this.id,a,l),t.pushUndoStop()}}class TransposeAction extends EditorAction{constructor(){super({id:"editor.action.transpose",label:localize("editor.transpose","Transpose characters around the cursor"),alias:"Transpose characters around the cursor",precondition:EditorContextKeys.writable})}run(e,t){let n=t.getSelections();if(null===n)return;let i=t.getModel();if(null===i)return;let o=[];for(let r=0,s=n.length;r<s;r++){let e=n[r];if(!e.isEmpty())continue;let t=e.getStartPosition(),s=i.getLineMaxColumn(t.lineNumber);if(t.column>=s){if(t.lineNumber===i.getLineCount())continue;let e=new Range$2(t.lineNumber,Math.max(1,t.column-1),t.lineNumber+1,1),n=i.getValueInRange(e).split("").reverse().join("");o.push(new ReplaceCommand(new Selection$1(t.lineNumber,Math.max(1,t.column-1),t.lineNumber+1,1),n))}else{let e=new Range$2(t.lineNumber,Math.max(1,t.column-1),t.lineNumber,t.column+1),n=i.getValueInRange(e).split("").reverse().join("");o.push(new ReplaceCommandThatPreservesSelection(e,n,new Selection$1(t.lineNumber,t.column+1,t.lineNumber,t.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class AbstractCaseAction extends EditorAction{run(e,t){const n=t.getSelections();if(null===n)return;const i=t.getModel();if(null===i)return;const o=t.getOption(117),r=[];for(const s of n)if(s.isEmpty()){const e=s.getStartPosition(),n=t.getConfiguredWordAtPosition(e);if(!n)continue;const a=new Range$2(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn),l=i.getValueInRange(a);r.push(EditOperation.replace(a,this._modifyText(l,o)))}else{const e=i.getValueInRange(s);r.push(EditOperation.replace(s,this._modifyText(e,o)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class UpperCaseAction extends AbstractCaseAction{constructor(){super({id:"editor.action.transformToUppercase",label:localize("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:EditorContextKeys.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class LowerCaseAction extends AbstractCaseAction{constructor(){super({id:"editor.action.transformToLowercase",label:localize("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:EditorContextKeys.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class BackwardsCompatibleRegExp{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch(e){}}return this._actual}isSupported(){return null!==this.get()}}class TitleCaseAction extends AbstractCaseAction{constructor(){super({id:"editor.action.transformToTitlecase",label:localize("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:EditorContextKeys.writable})}_modifyText(e,t){const n=TitleCaseAction.titleBoundary.get();return n?e.toLocaleLowerCase().replace(n,(e=>e.toLocaleUpperCase())):e}}TitleCaseAction.titleBoundary=new BackwardsCompatibleRegExp("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class SnakeCaseAction extends AbstractCaseAction{constructor(){super({id:"editor.action.transformToSnakecase",label:localize("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:EditorContextKeys.writable})}_modifyText(e,t){const n=SnakeCaseAction.caseBoundary.get(),i=SnakeCaseAction.singleLetters.get();return n&&i?e.replace(n,"$1_$2").replace(i,"$1_$2$3").toLocaleLowerCase():e}}SnakeCaseAction.caseBoundary=new BackwardsCompatibleRegExp("(\\p{Ll})(\\p{Lu})","gmu"),SnakeCaseAction.singleLetters=new BackwardsCompatibleRegExp("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu"),registerEditorAction(CopyLinesUpAction),registerEditorAction(CopyLinesDownAction),registerEditorAction(DuplicateSelectionAction),registerEditorAction(MoveLinesUpAction),registerEditorAction(MoveLinesDownAction),registerEditorAction(SortLinesAscendingAction),registerEditorAction(SortLinesDescendingAction),registerEditorAction(DeleteDuplicateLinesAction),registerEditorAction(TrimTrailingWhitespaceAction),registerEditorAction(DeleteLinesAction),registerEditorAction(IndentLinesAction),registerEditorAction(OutdentLinesAction),registerEditorAction(InsertLineBeforeAction),registerEditorAction(InsertLineAfterAction),registerEditorAction(DeleteAllLeftAction),registerEditorAction(DeleteAllRightAction),registerEditorAction(JoinLinesAction),registerEditorAction(TransposeAction),registerEditorAction(UpperCaseAction),registerEditorAction(LowerCaseAction),SnakeCaseAction.caseBoundary.isSupported()&&SnakeCaseAction.singleLetters.isSupported()&®isterEditorAction(SnakeCaseAction),TitleCaseAction.titleBoundary.isSupported()&®isterEditorAction(TitleCaseAction);var __decorate$z=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$y=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$j=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE=new RawContextKey("LinkedEditingInputVisible",!1),DECORATION_CLASS_NAME="linked-editing-decoration";let LinkedEditingContribution=class e extends Disposable{constructor(e,t,n,i,o){super(),this.languageConfigurationService=i,this._localToDispose=this._register(new DisposableStore),this._editor=e,this._providers=n.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{min:200}),this._currentDecorations=[],this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new DisposableStore),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequest=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel((()=>this.reinitialize(!0)))),this._register(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(62)||e.hasChanged(82))&&this.reinitialize(!1)}))),this._register(this._providers.onDidChange((()=>this.reinitialize(!1)))),this._register(this._editor.onDidChangeModelLanguage((()=>this.reinitialize(!0)))),this.reinitialize(!0)}static get(t){return t.getContribution(e.ID)}reinitialize(e){const t=this._editor.getModel(),n=null!==t&&(this._editor.getOption(62)||this._editor.getOption(82))&&this._providers.has(t);if(n===this._enabled&&!e)return;if(this._enabled=n,this.clearRanges(),this._localToDispose.clear(),!n||null===t)return;this._localToDispose.add(Event$1.runAndSubscribe(t.onDidChangeLanguageConfiguration,(()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()})));const i=new Delayer(this._debounceInformation.get(t)),o=()=>{var e;this._rangeUpdateTriggerPromise=i.trigger((()=>this.updateRanges()),null!==(e=this._debounceDuration)&&void 0!==e?e:this._debounceInformation.get(t))},r=new Delayer(0),s=e=>{this._rangeSyncTriggerPromise=r.trigger((()=>this._syncRanges(e)))};this._localToDispose.add(this._editor.onDidChangeCursorPosition((()=>{o()}))),this._localToDispose.add(this._editor.onDidChangeModelContent((e=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const n=t.getDecorationRange(this._currentDecorations[0]);if(n&&e.changes.every((e=>n.intersectRanges(e.range))))return void s(this._currentDecorations)}o()}))),this._localToDispose.add({dispose:()=>{i.dispose(),r.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._currentDecorations||0===e.length)return;const t=this._editor.getModel(),n=t.getDecorationRange(e[0]);if(!n||n.startLineNumber!==n.endLineNumber)return this.clearRanges();const i=t.getValueInRange(n);if(this._currentWordPattern){const e=i.match(this._currentWordPattern);if((e?e[0].length:0)!==i.length)return this.clearRanges()}let o=[];for(let r=1,s=e.length;r<s;r++){const n=t.getDecorationRange(e[r]);if(n)if(n.startLineNumber!==n.endLineNumber)o.push({range:n,text:i});else{let e=t.getValueInRange(n),r=i,s=n.startColumn,a=n.endColumn;const l=commonPrefixLength(e,r);s+=l,e=e.substr(l),r=r.substr(l);const c=commonSuffixLength(e,r);a-=c,e=e.substr(0,e.length-c),r=r.substr(0,r.length-c),s===a&&0===r.length||o.push({range:new Range$2(n.startLineNumber,s,n.endLineNumber,a),text:r})}}if(0!==o.length)try{this._editor.popUndoStop(),this._ignoreChangeEvent=!0;const e=this._editor._getViewModel().getPrevEditOperationType();this._editor.executeEdits("linkedEditing",o),this._editor._getViewModel().setPrevEditOperationType(e)}finally{this._ignoreChangeEvent=!1}}dispose(){this.clearRanges(),super.dispose()}clearRanges(){this._visibleContextKey.set(!1),this._currentDecorations=this._editor.deltaDecorations(this._currentDecorations,[]),this._currentRequest&&(this._currentRequest.cancel(),this._currentRequest=null,this._currentRequestPosition=null)}updateRanges(t=!1){return __awaiter$j(this,void 0,void 0,(function*(){if(!this._editor.hasModel())return void this.clearRanges();const n=this._editor.getPosition();if(!this._enabled&&!t||this._editor.getSelections().length>1)return void this.clearRanges();const i=this._editor.getModel(),o=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===o){if(n.equals(this._currentRequestPosition))return;if(this._currentDecorations&&this._currentDecorations.length>0){const e=i.getDecorationRange(this._currentDecorations[0]);if(e&&e.containsPosition(n))return}}this._currentRequestPosition=n,this._currentRequestModelVersion=o;const r=createCancelablePromise((t=>__awaiter$j(this,void 0,void 0,(function*(){try{const s=new StopWatch(!1),a=yield getLinkedEditingRanges(this._providers,i,n,t);if(this._debounceInformation.update(i,s.elapsed()),r!==this._currentRequest)return;if(this._currentRequest=null,o!==i.getVersionId())return;let l=[];(null==a?void 0:a.ranges)&&(l=a.ranges),this._currentWordPattern=(null==a?void 0:a.wordPattern)||this._languageWordPattern;let c=!1;for(let e=0,t=l.length;e<t;e++)if(Range$2.containsPosition(l[e],n)){if(c=!0,0!==e){const t=l[e];l.splice(e,1),l.unshift(t)}break}if(!c)return void this.clearRanges();const d=l.map((t=>({range:t,options:e.DECORATION})));this._visibleContextKey.set(!0),this._currentDecorations=this._editor.deltaDecorations(this._currentDecorations,d)}catch(s){isCancellationError(s)||onUnexpectedError(s),this._currentRequest!==r&&this._currentRequest||this.clearRanges()}}))));return this._currentRequest=r,r}))}};LinkedEditingContribution.ID="editor.contrib.linkedEditing",LinkedEditingContribution.DECORATION=ModelDecorationOptions.register({description:"linked-editing",stickiness:0,className:DECORATION_CLASS_NAME}),LinkedEditingContribution=__decorate$z([__param$y(1,IContextKeyService),__param$y(2,ILanguageFeaturesService),__param$y(3,ILanguageConfigurationService),__param$y(4,ILanguageFeatureDebounceService)],LinkedEditingContribution);class LinkedEditingAction extends EditorAction{constructor(){super({id:"editor.action.linkedEditing",label:localize("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.hasRenameProvider),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const n=e.get(ICodeEditorService),[i,o]=Array.isArray(t)&&t||[void 0,void 0];return URI.isUri(i)&&Position$1.isIPosition(o)?n.openCodeEditor({resource:i},n.getActiveCodeEditor()).then((e=>{e&&(e.setPosition(o),e.invokeWithinContext((t=>(this.reportTelemetry(t,e),this.run(t,e)))))}),onUnexpectedError):super.runCommand(e,t)}run(e,t){const n=LinkedEditingContribution.get(t);return n?Promise.resolve(n.updateRanges(!0)):Promise.resolve()}}const LinkedEditingCommand=EditorCommand.bindToContribution(LinkedEditingContribution.get);function getLinkedEditingRanges(e,t,n,i){return first(e.ordered(t).map((e=>()=>__awaiter$j(this,void 0,void 0,(function*(){try{return yield e.provideLinkedEditingRanges(t,n,i)}catch(e2){return void onUnexpectedExternalError(e2)}})))),(e=>!!e&&isNonEmptyArray(null==e?void 0:e.ranges)))}registerEditorCommand(new LinkedEditingCommand({id:"cancelLinkedEditingInput",precondition:CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE,handler:e=>e.clearRanges(),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,weight:199,primary:9,secondary:[1033]}}));const editorLinkedEditingBackground=registerColor("editor.linkedEditingBackground",{dark:Color.fromHex("#f00").transparent(.3),light:Color.fromHex("#f00").transparent(.3),hc:Color.fromHex("#f00").transparent(.3)},localize("editorLinkedEditingBackground","Background color when the editor auto renames on type."));registerThemingParticipant(((e,t)=>{const n=e.getColor(editorLinkedEditingBackground);n&&t.addRule(`.monaco-editor .${DECORATION_CLASS_NAME} { background: ${n}; border-left-color: ${n}; }`)})),registerModelAndPositionCommand("_executeLinkedEditingProvider",((e,t,n)=>{const{linkedEditingRangeProvider:i}=e.get(ILanguageFeaturesService);return getLinkedEditingRanges(i,t,n,CancellationToken.None)})),registerEditorContribution(LinkedEditingContribution.ID,LinkedEditingContribution),registerEditorAction(LinkedEditingAction);var links="",__awaiter$i=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class Link$1{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}resolve(e){return __awaiter$i(this,void 0,void 0,(function*(){return this._link.url?this._link.url:"function"==typeof this._provider.resolveLink?Promise.resolve(this._provider.resolveLink(this._link,e)).then((t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing"))))):Promise.reject(new Error("missing"))}))}}class LinksList{constructor(e){this._disposables=new DisposableStore;let t=[];for(const[n,i]of e){const e=n.links.map((e=>new Link$1(e,i)));t=LinksList._union(t,e),isDisposable(n)&&this._disposables.add(n)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){let n,i,o,r,s=[];for(n=0,o=0,i=e.length,r=t.length;n<i&&o<r;){const i=e[n],r=t[o];if(Range$2.areIntersectingOrTouching(i.range,r.range)){n++;continue}Range$2.compareRangesUsingStarts(i.range,r.range)<0?(s.push(i),n++):(s.push(r),o++)}for(;n<i;n++)s.push(e[n]);for(;o<r;o++)s.push(t[o]);return s}}function getLinks(e,t,n){const i=[],o=e.ordered(t).reverse().map(((e,o)=>Promise.resolve(e.provideLinks(t,n)).then((t=>{t&&(i[o]=[t,e])}),onUnexpectedExternalError)));return Promise.all(o).then((()=>{const e=new LinksList(coalesce(i));return n.isCancellationRequested?(e.dispose(),new LinksList([])):e}))}CommandsRegistry.registerCommand("_executeLinkProvider",((e,...t)=>__awaiter$i(void 0,void 0,void 0,(function*(){let[n,i]=t;assertType(n instanceof URI),"number"!=typeof i&&(i=0);const{linkProvider:o}=e.get(ILanguageFeaturesService),r=e.get(IModelService).getModel(n);if(!r)return[];const s=yield getLinks(o,r,CancellationToken.None);if(!s)return[];for(let e=0;e<Math.min(i,s.links.length);e++)yield s.links[e].resolve(CancellationToken.None);const a=s.links.slice(0);return s.dispose(),a}))));var __decorate$y=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$x=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$h=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};let LinkDetector=class e extends Disposable{constructor(e,t,n,i,o){super(),this.editor=e,this.openerService=t,this.notificationService=n,this.languageFeaturesService=i,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new RunOnceScheduler((()=>this.computeLinksNow()),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const r=this._register(new ClickLinkGesture(e));this._register(r.onMouseMoveOrRelevantKeyDown((([e,t])=>{this._onEditorMouseMove(e,t)}))),this._register(r.onExecute((e=>{this.onEditorMouseUp(e)}))),this._register(r.onCancel((e=>{this.cleanUpActiveLinkDecoration()}))),this._register(e.onDidChangeConfiguration((e=>{e.hasChanged(63)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))}))),this._register(e.onDidChangeModelContent((e=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))}))),this._register(e.onDidChangeModel((e=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)}))),this._register(e.onDidChangeModelLanguage((e=>{this.stop(),this.computeLinks.schedule(0)}))),this._register(this.providers.onDidChange((e=>{this.stop(),this.computeLinks.schedule(0)}))),this.computeLinks.schedule(0)}static get(t){return t.getContribution(e.ID)}computeLinksNow(){return __awaiter$h(this,void 0,void 0,(function*(){if(!this.editor.hasModel()||!this.editor.getOption(63))return;const e=this.editor.getModel();if(this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=createCancelablePromise((t=>getLinks(this.providers,e,t)));try{const t=new StopWatch(!1);if(this.activeLinksList=yield this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){onUnexpectedError(t)}finally{this.computePromise=null}}}))}updateDecorations(e){const t="altKey"===this.editor.getOption(70),n=[],i=Object.keys(this.currentOccurrences);for(const s of i){const e=this.currentOccurrences[s];n.push(e.decorationId)}const o=[];if(e)for(const s of e)o.push(LinkOccurrence.decoration(s,t));const r=this.editor.deltaDecorations(n,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let s=0,a=r.length;s<a;s++){const t=new LinkOccurrence(e[s],r[s]);this.currentOccurrences[t.decorationId]=t}}_onEditorMouseMove(e,t){const n="altKey"===this.editor.getOption(70);if(this.isEnabled(e,t)){this.cleanUpActiveLinkDecoration();const t=this.getLinkOccurrence(e.target.position);t&&this.editor.changeDecorations((e=>{t.activate(e,n),this.activeLinkDecorationId=t.decorationId}))}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e="altKey"===this.editor.getOption(70);if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations((n=>{t.deactivate(n,e)})),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,n=!1){if(!this.openerService)return;const{link:i}=e;i.resolve(CancellationToken.None).then((e=>{if("string"==typeof e&&this.editor.hasModel()){const t=this.editor.getModel().uri;if(t.scheme===Schemas.file&&e.startsWith(`${Schemas.file}:`)){const n=URI.parse(e);if(n.scheme===Schemas.file){const i=originalFSPath(n);let o=null;i.startsWith("/./")?o=`.${i.substr(1)}`:i.startsWith("//./")&&(o=`.${i.substr(2)}`),o&&(e=joinPath(t,o))}}}return this.openerService.open(e,{openToSide:t,fromUserGesture:n,allowContributedOpeners:!0,allowCommands:!0})}),(e=>{const t=e instanceof Error?e.message:e;"invalid"===t?this.notificationService.warn(localize("invalid.url","Failed to open this link because it is not well-formed: {0}",i.url.toString())):"missing"===t?this.notificationService.warn(localize("missing.url","Failed to open this link because its target is missing.")):onUnexpectedError(e)}))}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const n of t){const e=this.currentOccurrences[n.id];if(e)return e}return null}isEnabled(e,t){return Boolean(6===e.target.type&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&(null===(e=this.activeLinksList)||void 0===e||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};LinkDetector.ID="editor.linkDetector",LinkDetector=__decorate$y([__param$x(1,IOpenerService),__param$x(2,INotificationService),__param$x(3,ILanguageFeaturesService),__param$x(4,ILanguageFeatureDebounceService)],LinkDetector);const decoration={general:ModelDecorationOptions.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:ModelDecorationOptions.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class LinkOccurrence{constructor(e,t){this.link=e,this.decorationId=t}static decoration(e,t){return{range:e.range,options:LinkOccurrence._getOptions(e,t,!1)}}static _getOptions(e,t,n){const i=Object.assign({},n?decoration.active:decoration.general);return i.hoverMessage=getHoverMessage(e,t),i}activate(e,t){e.changeDecorationOptions(this.decorationId,LinkOccurrence._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,LinkOccurrence._getOptions(this.link,t,!1))}}function getHoverMessage(e,t){const n=e.url&&/^command:/i.test(e.url.toString()),i=e.tooltip?e.tooltip:n?localize("links.navigate.executeCmd","Execute command"):localize("links.navigate.follow","Follow link"),o=t?isMacintosh?localize("links.navigate.kb.meta.mac","cmd + click"):localize("links.navigate.kb.meta","ctrl + click"):isMacintosh?localize("links.navigate.kb.alt.mac","option + click"):localize("links.navigate.kb.alt","alt + click");if(e.url){let t="";if(/^command:/i.test(e.url.toString())){const n=e.url.toString().match(/^command:([^?#]+)/);if(n){t=` "${localize("tooltip.explanation","Execute command {0}",n[1])}"`}}return new MarkdownString("",!0).appendMarkdown(`[${i}](${e.url.toString(!0).replace(/ /g,"%20")}${t}) (${o})`)}return(new MarkdownString).appendText(`${i} (${o})`)}class OpenLinkAction extends EditorAction{constructor(){super({id:"editor.action.openLink",label:localize("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const n=LinkDetector.get(t);if(!n)return;if(!t.hasModel())return;const i=t.getSelections();for(const o of i){const e=n.getLinkOccurrence(o.getEndPosition());e&&n.openLinkOccurrence(e,!1)}}}registerEditorContribution(LinkDetector.ID,LinkDetector),registerEditorAction(OpenLinkAction),registerThemingParticipant(((e,t)=>{const n=e.getColor(editorActiveLinkForeground);n&&t.addRule(`.monaco-editor .detected-link-active { color: ${n} !important; }`)}));var __decorate$x=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$w=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};function announceCursorChange(e,t){const n=t.filter((t=>!e.find((e=>e.equals(t)))));if(n.length>=1){const e=n.map((e=>`line ${e.viewState.position.lineNumber} column ${e.viewState.position.column}`)).join(", ");status(1===n.length?localize("cursorAdded","Cursor added: {0}",e):localize("cursorsAdded","Cursors added: {0}",e))}}class InsertCursorAbove extends EditorAction{constructor(){super({id:"editor.action.insertCursorAbove",label:localize("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"3_multi",title:localize({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,n){if(!t.hasModel())return;let i=!0;n&&!1===n.logicalLine&&(i=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(n.source,3,CursorMoveCommands.addCursorUp(o,r,i)),o.revealTopMostCursor(n.source),announceCursorChange(r,o.getCursorStates())}}class InsertCursorBelow extends EditorAction{constructor(){super({id:"editor.action.insertCursorBelow",label:localize("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"3_multi",title:localize({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,n){if(!t.hasModel())return;let i=!0;n&&!1===n.logicalLine&&(i=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(n.source,3,CursorMoveCommands.addCursorDown(o,r,i)),o.revealBottomMostCursor(n.source),announceCursorChange(r,o.getCursorStates())}}class InsertCursorAtEndOfEachLineSelected extends EditorAction{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:localize("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"3_multi",title:localize({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,n){if(!e.isEmpty()){for(let i=e.startLineNumber;i<e.endLineNumber;i++){let e=t.getLineMaxColumn(i);n.push(new Selection$1(i,e,i,e))}e.endColumn>1&&n.push(new Selection$1(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const n=t.getModel(),i=t.getSelections(),o=t._getViewModel(),r=o.getCursorStates();let s=[];i.forEach((e=>this.getCursorsForSelection(e,n,s))),s.length>0&&t.setSelections(s),announceCursorChange(r,o.getCursorStates())}}class InsertCursorAtEndOfLineSelected extends EditorAction{constructor(){super({id:"editor.action.addCursorsToBottom",label:localize("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections(),i=t.getModel().getLineCount();let o=[];for(let a=n[0].startLineNumber;a<=i;a++)o.push(new Selection$1(a,n[0].startColumn,a,n[0].endColumn));const r=t._getViewModel(),s=r.getCursorStates();o.length>0&&t.setSelections(o),announceCursorChange(s,r.getCursorStates())}}class InsertCursorAtTopOfLineSelected extends EditorAction{constructor(){super({id:"editor.action.addCursorsToTop",label:localize("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getSelections();let i=[];for(let s=n[0].startLineNumber;s>=1;s--)i.push(new Selection$1(s,n[0].startColumn,s,n[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();i.length>0&&t.setSelections(i),announceCursorChange(r,o.getCursorStates())}}class MultiCursorSessionResult{constructor(e,t,n){this.selections=e,this.revealRange=t,this.revealScrollType=n}}class MultiCursorSession{constructor(e,t,n,i,o,r,s){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=n,this.searchText=i,this.wholeWord=o,this.matchCase=r,this.currentMatch=s}static create(e,t){if(!e.hasModel())return null;const n=t.getState();if(!e.hasTextFocus()&&n.isRevealed&&n.searchString.length>0)return new MultiCursorSession(e,t,!1,n.searchString,n.wholeWord,n.matchCase,null);let i,o,r=!1;const s=e.getSelections();1===s.length&&s[0].isEmpty()?(r=!0,i=!0,o=!0):(i=n.wholeWord,o=n.matchCase);const a=e.getSelection();let l,c=null;if(a.isEmpty()){const t=e.getConfiguredWordAtPosition(a.getStartPosition());if(!t)return null;l=t.word,c=new Selection$1(a.startLineNumber,t.startColumn,a.startLineNumber,t.endColumn)}else l=e.getModel().getValueInRange(a).replace(/\r\n/g,"\n");return new MultiCursorSession(e,t,r,l,i,o,c)}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new MultiCursorSessionResult(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new MultiCursorSessionResult(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(117):null,!1);return n?new Selection$1(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new MultiCursorSessionResult(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new MultiCursorSessionResult(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(117):null,!1);return n?new Selection$1(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.range.endColumn):null}selectAll(){return this._editor.hasModel()?(this.findController.highlightFindOptions(),this._editor.getModel().findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(117):null,!1,1073741824)):[]}}class MultiCursorSelectionController extends Disposable{constructor(e){super(),this._sessionDispose=this._register(new DisposableStore),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}static get(e){return e.getContribution(MultiCursorSelectionController.ID)}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=MultiCursorSession.create(this._editor,e);if(!t)return;this._session=t;const n={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(n.wholeWordOverride=1,n.matchCaseOverride=1,n.isRegexOverride=2),e.getState().change(n,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection((e=>{this._ignoreSelectionChange||this._endSession()}))),this._sessionDispose.add(this._editor.onDidBlurEditorText((()=>{this._endSession()}))),this._sessionDispose.add(e.getState().onFindReplaceStateChange((e=>{(e.matchCase||e.wholeWord)&&this._endSession()})))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const n=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return n?new Selection$1(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const n=e.getState().matchCase;if(!modelRangesContainSameText(this._editor.getModel(),t,n)){const e=this._editor.getModel();let n=[];for(let i=0,o=t.length;i<o;i++)n[i]=this._expandEmptyToWord(e,t[i]);return void this._editor.setSelections(n)}}}this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToNextFindMatch())}}addSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToPreviousFindMatch())}moveSelectionToNextFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToNextFindMatch())}moveSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToPreviousFindMatch())}selectAll(e){if(!this._editor.hasModel())return;let t=null;const n=e.getState();if(n.isRevealed&&n.searchString.length>0&&n.isRegex)t=this._editor.getModel().findMatches(n.searchString,!0,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(117):null,!1,1073741824);else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll()}if(n.searchScope){const e=n.searchScope;let i=[];t.forEach((t=>{e.forEach((e=>{t.range.endLineNumber<=e.endLineNumber&&t.range.startLineNumber>=e.startLineNumber&&i.push(t)}))})),t=i}if(t.length>0){const e=this._editor.getSelection();for(let n=0,i=t.length;n<i;n++){const i=t[n];if(i.range.intersectRanges(e)){t[n]=t[0],t[0]=i;break}}this._setSelections(t.map((e=>new Selection$1(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn))))}}}MultiCursorSelectionController.ID="editor.contrib.multiCursorController";class MultiCursorSelectionControllerAction extends EditorAction{run(e,t){const n=MultiCursorSelectionController.get(t);if(!n)return;const i=CommonFindController.get(t);if(!i)return;const o=t._getViewModel();if(o){const e=o.getCursorStates();this._run(n,i),announceCursorChange(e,o.getCursorStates())}}}class AddSelectionToNextFindMatchAction extends MultiCursorSelectionControllerAction{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:localize("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:2082,weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"3_multi",title:localize({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class AddSelectionToPreviousFindMatchAction extends MultiCursorSelectionControllerAction{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:localize("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"3_multi",title:localize({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class MoveSelectionToNextFindMatchAction extends MultiCursorSelectionControllerAction{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:localize("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:KeyChord(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class MoveSelectionToPreviousFindMatchAction extends MultiCursorSelectionControllerAction{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:localize("moveSelectionToPreviousFindMatch","Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class SelectHighlightsAction extends MultiCursorSelectionControllerAction{constructor(){super({id:"editor.action.selectHighlights",label:localize("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:3114,weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"3_multi",title:localize({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class CompatChangeAll extends MultiCursorSelectionControllerAction{constructor(){super({id:"editor.action.changeAll",label:localize("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.editorTextFocus),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class SelectionHighlighterState{constructor(e,t,n,i,o){this._model=e,this._searchText=t,this._matchCase=n,this._wordSeparators=i,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return null===this._cachedFindMatches&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map((e=>e.range)),this._cachedFindMatches.sort(Range$2.compareRangesUsingStarts)),this._cachedFindMatches}}let SelectionHighlighter=class e extends Disposable{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(97),this.decorations=[],this.updateSoon=this._register(new RunOnceScheduler((()=>this._update()),300)),this.state=null,this._register(e.onDidChangeConfiguration((t=>{this._isEnabled=e.getOption(97)}))),this._register(e.onDidChangeCursorSelection((e=>{this._isEnabled&&(e.selection.isEmpty()?3===e.reason?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())}))),this._register(e.onDidChangeModel((e=>{this._setState(null)}))),this._register(e.onDidChangeModelContent((e=>{this._isEnabled&&this.updateSoon.schedule()})));const n=CommonFindController.get(e);n&&this._register(n.getState().onFindReplaceStateChange((e=>{this._update()})))}_update(){this._setState(e._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,n){if(!t)return null;if(!n.hasModel())return null;const i=n.getSelection();if(i.startLineNumber!==i.endLineNumber)return null;const o=MultiCursorSelectionController.get(n);if(!o)return null;const r=CommonFindController.get(n);if(!r)return null;let s=o.getSession(r);if(!s){const e=n.getSelections();if(e.length>1){const t=r.getState().matchCase;if(!modelRangesContainSameText(n.getModel(),e,t))return null}s=MultiCursorSession.create(n,r)}if(!s)return null;if(s.currentMatch)return null;if(/^[ \t]+$/.test(s.searchText))return null;if(s.searchText.length>200)return null;const a=r.getState(),l=a.matchCase;if(a.isRevealed){let e=a.searchString;l||(e=e.toLowerCase());let t=s.searchText;if(l||(t=t.toLowerCase()),e===t&&s.matchCase===a.matchCase&&s.wholeWord===a.wholeWord&&!a.isRegex)return null}return new SelectionHighlighterState(n.getModel(),s.searchText,s.matchCase,s.wholeWord?n.getOption(117):null,e)}_setState(t){if(this.state=t,!this.state)return void(this.decorations=this.editor.deltaDecorations(this.decorations,[]));if(!this.editor.hasModel())return;const n=this.editor.getModel();if(n.isTooLargeForTokenization())return;const i=this.state.findMatches(),o=this.editor.getSelections();o.sort(Range$2.compareRangesUsingStarts);const r=[];for(let e=0,l=0,c=i.length,d=o.length;e<c;){const t=i[e];if(l>=d)r.push(t),e++;else{const n=Range$2.compareRangesUsingStarts(t,o[l]);n<0?(!o[l].isEmpty()&&Range$2.areIntersecting(t,o[l])||r.push(t),e++):(n>0||e++,l++)}}const s=this._languageFeaturesService.documentHighlightProvider.has(n)&&this.editor.getOption(72),a=r.map((t=>({range:t,options:s?e._SELECTION_HIGHLIGHT:e._SELECTION_HIGHLIGHT_OVERVIEW})));this.decorations=this.editor.deltaDecorations(this.decorations,a)}dispose(){this._setState(null),super.dispose()}};function modelRangesContainSameText(e,t,n){const i=getValueInRange(e,t[0],!n);for(let o=1,r=t.length;o<r;o++){const r=t[o];if(r.isEmpty())return!1;if(i!==getValueInRange(e,r,!n))return!1}return!0}function getValueInRange(e,t,n){const i=e.getValueInRange(t);return n?i.toLowerCase():i}SelectionHighlighter.ID="editor.contrib.selectionHighlighter",SelectionHighlighter._SELECTION_HIGHLIGHT_OVERVIEW=ModelDecorationOptions.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",minimap:{color:themeColorFromId(minimapSelectionOccurrenceHighlight),position:MinimapPosition$1.Inline},overviewRuler:{color:themeColorFromId(overviewRulerSelectionHighlightForeground),position:OverviewRulerLane$1.Center}}),SelectionHighlighter._SELECTION_HIGHLIGHT=ModelDecorationOptions.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),SelectionHighlighter=__decorate$x([__param$w(1,ILanguageFeaturesService)],SelectionHighlighter),registerEditorContribution(MultiCursorSelectionController.ID,MultiCursorSelectionController),registerEditorContribution(SelectionHighlighter.ID,SelectionHighlighter),registerEditorAction(InsertCursorAbove),registerEditorAction(InsertCursorBelow),registerEditorAction(InsertCursorAtEndOfEachLineSelected),registerEditorAction(AddSelectionToNextFindMatchAction),registerEditorAction(AddSelectionToPreviousFindMatchAction),registerEditorAction(MoveSelectionToNextFindMatchAction),registerEditorAction(MoveSelectionToPreviousFindMatchAction),registerEditorAction(SelectHighlightsAction),registerEditorAction(CompatChangeAll),registerEditorAction(InsertCursorAtEndOfLineSelected),registerEditorAction(InsertCursorAtTopOfLineSelected);var __awaiter$g=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const Context$1={Visible:new RawContextKey("parameterHintsVisible",!1),MultipleSignatures:new RawContextKey("parameterHintsMultipleSignatures",!1)};function provideSignatureHelp(e,t,n,i,o){return __awaiter$g(this,void 0,void 0,(function*(){const r=e.ordered(t);for(const e of r)try{const r=yield e.provideSignatureHelp(t,n,o,i);if(r)return r}catch(s){onUnexpectedExternalError(s)}}))}CommandsRegistry.registerCommand("_executeSignatureHelpProvider",((e,...t)=>__awaiter$g(void 0,void 0,void 0,(function*(){const[n,i,o]=t;assertType(URI.isUri(n)),assertType(Position$1.isIPosition(i)),assertType("string"==typeof o||!o);const r=e.get(ILanguageFeaturesService),s=yield e.get(ITextModelService).createModelReference(n);try{const e=yield provideSignatureHelp(r.signatureHelpProvider,s.object.textEditorModel,Position$1.lift(i),{triggerKind:SignatureHelpTriggerKind$1.Invoke,isRetrigger:!1,triggerCharacter:o},CancellationToken.None);if(!e)return;return setTimeout((()=>e.dispose()),0),e.value}finally{s.dispose()}}))));var parameterHints="",__awaiter$f=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},ParameterHintState;!function(e){e.Default={type:0};e.Pending=class{constructor(e,t){this.request=e,this.previouslyActiveHints=t,this.type=2}};e.Active=class{constructor(e){this.hints=e,this.type=1}}}(ParameterHintState||(ParameterHintState={}));class ParameterHintsModel extends Disposable{constructor(e,t,n=ParameterHintsModel.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new Emitter$1),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=ParameterHintState.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new MutableDisposable),this.triggerChars=new CharacterSet,this.retriggerChars=new CharacterSet,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Delayer(n),this._register(this.editor.onDidBlurEditorWidget((()=>this.cancel()))),this._register(this.editor.onDidChangeConfiguration((()=>this.onEditorConfigurationChange()))),this._register(this.editor.onDidChangeModel((e=>this.onModelChanged()))),this._register(this.editor.onDidChangeModelLanguage((e=>this.onModelChanged()))),this._register(this.editor.onDidChangeCursorSelection((e=>this.onCursorChange(e)))),this._register(this.editor.onDidChangeModelContent((e=>this.onModelContentChange()))),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType((e=>this.onDidType(e)))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){2===this._state.type&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=ParameterHintState.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const n=this.editor.getModel();if(!n||!this.providers.has(n))return;const i=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger((()=>this.doTrigger(i)),t).catch(onUnexpectedError)}next(){if(1!==this.state.type)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t%e==e-1,i=this.editor.getOption(76).cycle;!(e<2||n)||i?this.updateActiveSignature(n&&i?0:t+1):this.cancel()}previous(){if(1!==this.state.type)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=0===t,i=this.editor.getOption(76).cycle;!(e<2||n)||i?this.updateActiveSignature(n&&i?e-1:t-1):this.cancel()}updateActiveSignature(e){1===this.state.type&&(this.state=new ParameterHintState.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return __awaiter$f(this,void 0,void 0,(function*(){const t=1===this.state.type||2===this.state.type,n=this.getLastActiveHints();if(this.cancel(!0),0===this._pendingTriggers.length)return!1;const i=this._pendingTriggers.reduce(mergeTriggerContexts);this._pendingTriggers=[];const o={triggerKind:i.triggerKind,triggerCharacter:i.triggerCharacter,isRetrigger:t,activeSignatureHelp:n};if(!this.editor.hasModel())return!1;const r=this.editor.getModel(),s=this.editor.getPosition();this.state=new ParameterHintState.Pending(createCancelablePromise((e=>provideSignatureHelp(this.providers,r,s,o,e))),n);try{const t=yield this.state.request;return e!==this.triggerId?(null==t||t.dispose(),!1):t&&t.value.signatures&&0!==t.value.signatures.length?(this.state=new ParameterHintState.Active(t.value),this._lastSignatureHelpResult.value=t,this._onChangedHints.fire(this.state.hints),!0):(null==t||t.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1)}catch(a){return e===this.triggerId&&(this.state=ParameterHintState.Default),onUnexpectedError(a),!1}}))}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return 1===this.state.type||2===this.state.type||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars=new CharacterSet,this.retriggerChars=new CharacterSet;const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const e of t.signatureHelpTriggerCharacters||[])this.triggerChars.add(e.charCodeAt(0)),this.retriggerChars.add(e.charCodeAt(0));for(const e of t.signatureHelpRetriggerCharacters||[])this.retriggerChars.add(e.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,n=e.charCodeAt(t);(this.triggerChars.has(n)||this.isTriggered&&this.retriggerChars.has(n))&&this.trigger({triggerKind:SignatureHelpTriggerKind$1.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){"mouse"===e.source?this.cancel():this.isTriggered&&this.trigger({triggerKind:SignatureHelpTriggerKind$1.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:SignatureHelpTriggerKind$1.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(76).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}function mergeTriggerContexts(e,t){switch(t.triggerKind){case SignatureHelpTriggerKind$1.Invoke:return t;case SignatureHelpTriggerKind$1.ContentChange:return e;case SignatureHelpTriggerKind$1.TriggerCharacter:default:return t}}ParameterHintsModel.DEFAULT_DELAY=120;var __decorate$w=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$v=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const $$4=$$c,parameterHintsNextIcon=registerIcon("parameter-hints-next",Codicon.chevronDown,localize("parameterHintsNextIcon","Icon for show next parameter hint.")),parameterHintsPreviousIcon=registerIcon("parameter-hints-previous",Codicon.chevronUp,localize("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let ParameterHintsWidget=class e extends Disposable{constructor(e,t,n,i,o){super(),this.editor=e,this.renderDisposeables=this._register(new DisposableStore),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new MarkdownRenderer({editor:e},i,n)),this.model=this._register(new ParameterHintsModel(e,o.signatureHelpProvider)),this.keyVisible=Context$1.Visible.bindTo(t),this.keyMultipleSignatures=Context$1.MultipleSignatures.bindTo(t),this._register(this.model.onChangedHints((e=>{e?(this.show(),this.render(e)):this.hide()})))}createParameterHintDOMNodes(){const e=$$4(".editor-widget.parameter-hints-widget"),t=append$1(e,$$4(".phwrapper"));t.tabIndex=-1;const n=append$1(t,$$4(".controls")),i=append$1(n,$$4(".button"+ThemeIcon.asCSSSelector(parameterHintsPreviousIcon))),o=append$1(n,$$4(".overloads")),r=append$1(n,$$4(".button"+ThemeIcon.asCSSSelector(parameterHintsNextIcon)));this._register(addDisposableListener(i,"click",(e=>{EventHelper.stop(e),this.previous()}))),this._register(addDisposableListener(r,"click",(e=>{EventHelper.stop(e),this.next()})));const s=$$4(".body"),a=new DomScrollableElement(s,{});this._register(a),t.appendChild(a.getDomNode());const l=append$1(s,$$4(".signature")),c=append$1(s,$$4(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:l,overloads:o,docs:c,scrollbar:a},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection((e=>{this.visible&&this.editor.layoutContentWidget(this)})));const d=()=>{if(!this.domNodes)return;const e=this.editor.getOption(44);this.domNodes.element.style.fontSize=`${e.fontSize}px`,this.domNodes.element.style.lineHeight=""+e.lineHeight/e.fontSize};d(),this._register(Event$1.chain(this.editor.onDidChangeConfiguration.bind(this.editor)).filter((e=>e.hasChanged(44))).on(d,null)),this._register(this.editor.onDidLayoutChange((e=>this.updateMaxHeight()))),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout((()=>{this.domNodes&&this.domNodes.element.classList.add("visible")}),100),this.editor.layoutContentWidget(this))}hide(){this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,this.domNodes&&this.domNodes.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const n=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",n),this.keyMultipleSignatures.set(n),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const i=e.signatures[e.activeSignature];if(!i)return;const o=append$1(this.domNodes.signature,$$4(".code")),r=this.editor.getOption(44);o.style.fontSize=`${r.fontSize}px`,o.style.fontFamily=r.fontFamily;const s=i.parameters.length>0,a=null!==(t=i.activeParameter)&&void 0!==t?t:e.activeParameter;if(s)this.renderParameters(o,i,a);else{append$1(o,$$4("span")).textContent=i.label}const l=i.parameters[a];if(null==l?void 0:l.documentation){const e=$$4("span.documentation");if("string"==typeof l.documentation)e.textContent=l.documentation;else{const t=this.renderMarkdownDocs(l.documentation);e.appendChild(t.element)}append$1(this.domNodes.docs,$$4("p",{},e))}if(void 0===i.documentation);else if("string"==typeof i.documentation)append$1(this.domNodes.docs,$$4("p",{},i.documentation));else{const e=this.renderMarkdownDocs(i.documentation);append$1(this.domNodes.docs,e.element)}const c=this.hasDocs(i,l);if(this.domNodes.signature.classList.toggle("has-docs",c),this.domNodes.docs.classList.toggle("empty",!c),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,l){let e="";const t=i.parameters[a];e=Array.isArray(t.label)?i.label.substring(t.label[0],t.label[1]):t.label,t.documentation&&(e+="string"==typeof t.documentation?`, ${t.documentation}`:`, ${t.documentation.value}`),i.documentation&&(e+="string"==typeof i.documentation?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==e&&(alert(localize("hint","{0}, hint",e)),this.announcedLabel=e)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var e;null===(e=this.domNodes)||void 0===e||e.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&"string"==typeof t.documentation&&assertIsDefined(t.documentation).length>0)||(!!(t&&"object"==typeof t.documentation&&assertIsDefined(t.documentation).value.length>0)||(!!(e.documentation&&"string"==typeof e.documentation&&assertIsDefined(e.documentation).length>0)||!!(e.documentation&&"object"==typeof e.documentation&&assertIsDefined(e.documentation.value).length>0)))}renderParameters(e,t,n){const[i,o]=this.getParameterLabelOffsets(t,n),r=document.createElement("span");r.textContent=t.label.substring(0,i);const s=document.createElement("span");s.textContent=t.label.substring(i,o),s.className="parameter active";const a=document.createElement("span");a.textContent=t.label.substring(o),append$1(e,r,s,a)}getParameterLabelOffsets(e,t){const n=e.parameters[t];if(n){if(Array.isArray(n.label))return n.label;if(n.label.length){const t=new RegExp(`(\\W|^)${escapeRegExpCharacters(n.label)}(?=\\W|$)`,"g");t.test(e.label);const i=t.lastIndex-n.label.length;return i>=0?[i,t.lastIndex]:[0,0]}return[0,0]}return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}cancel(){this.model.cancel()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return e.ID}trigger(e){this.model.trigger(e,0)}updateMaxHeight(){if(!this.domNodes)return;const e=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=e;const t=this.domNodes.element.getElementsByClassName("phwrapper");t.length&&(t[0].style.maxHeight=e)}};ParameterHintsWidget.ID="editor.widget.parameterHintsWidget",ParameterHintsWidget=__decorate$w([__param$v(1,IContextKeyService),__param$v(2,IOpenerService),__param$v(3,ILanguageService),__param$v(4,ILanguageFeaturesService)],ParameterHintsWidget);const editorHoverWidgetHighlightForeground=registerColor("editorHoverWidget.highlightForeground",{dark:listHighlightForeground,light:listHighlightForeground,hc:listHighlightForeground},localize("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));registerThemingParticipant(((e,t)=>{const n=e.getColor(editorHoverBorder);if(n){const i=e.type===ColorScheme.HIGH_CONTRAST?2:1;t.addRule(`.monaco-editor .parameter-hints-widget { border: ${i}px solid ${n}; }`),t.addRule(`.monaco-editor .parameter-hints-widget.multiple .body { border-left: 1px solid ${n.transparent(.5)}; }`),t.addRule(`.monaco-editor .parameter-hints-widget .signature.has-docs { border-bottom: 1px solid ${n.transparent(.5)}; }`)}const i=e.getColor(editorHoverBackground);i&&t.addRule(`.monaco-editor .parameter-hints-widget { background-color: ${i}; }`);const o=e.getColor(textLinkForeground);o&&t.addRule(`.monaco-editor .parameter-hints-widget a { color: ${o}; }`);const r=e.getColor(textLinkActiveForeground);r&&t.addRule(`.monaco-editor .parameter-hints-widget a:hover { color: ${r}; }`);const s=e.getColor(editorHoverForeground);s&&t.addRule(`.monaco-editor .parameter-hints-widget { color: ${s}; }`);const a=e.getColor(textCodeBlockBackground);a&&t.addRule(`.monaco-editor .parameter-hints-widget code { background-color: ${a}; }`);const l=e.getColor(editorHoverWidgetHighlightForeground);l&&t.addRule(`.monaco-editor .parameter-hints-widget .parameter.active { color: ${l}}`)}));var __decorate$v=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$u=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let ParameterHintsController=class e extends Disposable{constructor(e,t){super(),this.editor=e,this.widget=this._register(t.createInstance(ParameterHintsWidget,this.editor))}static get(t){return t.getContribution(e.ID)}cancel(){this.widget.cancel()}previous(){this.widget.previous()}next(){this.widget.next()}trigger(e){this.widget.trigger(e)}};ParameterHintsController.ID="editor.controller.parameterHints",ParameterHintsController=__decorate$v([__param$u(1,IInstantiationService)],ParameterHintsController);class TriggerParameterHintsAction extends EditorAction{constructor(){super({id:"editor.action.triggerParameterHints",label:localize("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:EditorContextKeys.hasSignatureHelpProvider,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3082,weight:100}})}run(e,t){const n=ParameterHintsController.get(t);n&&n.trigger({triggerKind:SignatureHelpTriggerKind$1.Invoke})}}registerEditorContribution(ParameterHintsController.ID,ParameterHintsController),registerEditorAction(TriggerParameterHintsAction);const weight=175,ParameterHintsCommand=EditorCommand.bindToContribution(ParameterHintsController.get);registerEditorCommand(new ParameterHintsCommand({id:"closeParameterHints",precondition:Context$1.Visible,handler:e=>e.cancel(),kbOpts:{weight:weight,kbExpr:EditorContextKeys.focus,primary:9,secondary:[1033]}})),registerEditorCommand(new ParameterHintsCommand({id:"showPrevParameterHint",precondition:ContextKeyExpr.and(Context$1.Visible,Context$1.MultipleSignatures),handler:e=>e.previous(),kbOpts:{weight:weight,kbExpr:EditorContextKeys.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}})),registerEditorCommand(new ParameterHintsCommand({id:"showNextParameterHint",precondition:ContextKeyExpr.and(Context$1.Visible,Context$1.MultipleSignatures),handler:e=>e.next(),kbOpts:{weight:weight,kbExpr:EditorContextKeys.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));const ITextResourceConfigurationService=createDecorator("textResourceConfigurationService"),ITextResourcePropertiesService=createDecorator("textResourcePropertiesService");var renameInputField="",__decorate$u=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$t=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const CONTEXT_RENAME_INPUT_VISIBLE=new RawContextKey("renameInputVisible",!1,localize("renameInputVisible","Whether the rename input widget is visible"));let RenameInputField=class{constructor(e,t,n,i,o){this._editor=e,this._acceptKeybindings=t,this._themeService=n,this._keybindingService=i,this._disposables=new DisposableStore,this.allowEditorOverflow=!0,this._visibleContextKey=CONTEXT_RENAME_INPUT_VISIBLE.bindTo(o),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(44)&&this._updateFont()}))),this._disposables.add(n.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){if(!this._domNode){this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",localize("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._input),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label);const e=()=>{var e,t;const[n,i]=this._acceptKeybindings;this._keybindingService.lookupKeybinding(n),this._label.innerText=localize({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",null===(e=this._keybindingService.lookupKeybinding(n))||void 0===e?void 0:e.getLabel(),null===(t=this._keybindingService.lookupKeybinding(i))||void 0===t?void 0:t.getLabel())};e(),this._disposables.add(this._keybindingService.onDidUpdateKeybindings(e)),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())}return this._domNode}_updateStyles(e){var t,n,i,o;if(!this._input||!this._domNode)return;const r=e.getColor(widgetShadow);this._domNode.style.backgroundColor=String(null!==(t=e.getColor(editorWidgetBackground))&&void 0!==t?t:""),this._domNode.style.boxShadow=r?` 0 0 8px 2px ${r}`:"",this._domNode.style.color=String(null!==(n=e.getColor(inputForeground))&&void 0!==n?n:""),this._input.style.backgroundColor=String(null!==(i=e.getColor(inputBackground))&&void 0!==i?i:"");const s=e.getColor(inputBorder);this._input.style.borderWidth=s?"1px":"0px",this._input.style.borderStyle=s?"solid":"none",this._input.style.borderColor=null!==(o=null==s?void 0:s.toString())&&void 0!==o?o:"none"}_updateFont(){if(!this._input||!this._label)return;const e=this._editor.getOption(44);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._label.style.fontSize=.8*e.fontSize+"px"}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}afterRender(e){e||this.cancelInput(!0)}acceptInput(e){this._currentAcceptInput&&this._currentAcceptInput(e)}cancelInput(e){this._currentCancelInput&&this._currentCancelInput(e)}getInput(e,t,n,i,o,r){this._domNode.classList.toggle("preview",o),this._position=new Position$1(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",n.toString()),this._input.setAttribute("selectionEnd",i.toString()),this._input.size=Math.max(1.1*(e.endColumn-e.startColumn),20);const s=new DisposableStore;return new Promise((e=>{this._currentCancelInput=t=>(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,e(t),!0),this._currentAcceptInput=n=>{0!==this._input.value.trim().length&&this._input.value!==t?(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,e({newName:this._input.value,wantsPreview:o&&n})):this.cancelInput(!0)},s.add(r.onCancellationRequested((()=>this.cancelInput(!0)))),s.add(this._editor.onDidBlurEditorWidget((()=>this.cancelInput(!1)))),this._show()})).finally((()=>{s.dispose(),this._hide()}))}_show(){this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout((()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))}),100)}_hide(){this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}};RenameInputField=__decorate$u([__param$t(2,IThemeService),__param$t(3,IKeybindingService),__param$t(4,IContextKeyService)],RenameInputField);var __decorate$t=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$s=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$e=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class RenameSkeleton{constructor(e,t,n){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=n.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return __awaiter$e(this,void 0,void 0,(function*(){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx<this._providers.length;this._providerRenameIdx++){const n=this._providers[this._providerRenameIdx];if(!n.resolveRenameLocation)break;let i=yield n.resolveRenameLocation(this.model,this.position,e);if(i){if(!i.rejectReason)return i;t.push(i.rejectReason)}}const n=this.model.getWordAtPosition(this.position);return n?{range:new Range$2(this.position.lineNumber,n.startColumn,this.position.lineNumber,n.endColumn),text:n.word,rejectReason:t.length>0?t.join("\n"):void 0}:{range:Range$2.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join("\n"):void 0}}))}provideRenameEdits(e,t){return __awaiter$e(this,void 0,void 0,(function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}))}_provideRenameEdits(e,t,n,i){return __awaiter$e(this,void 0,void 0,(function*(){const o=this._providers[t];if(!o)return{edits:[],rejectReason:n.join("\n")};const r=yield o.provideRenameEdits(this.model,this.position,e,i);return r?r.rejectReason?this._provideRenameEdits(e,t+1,n.concat(r.rejectReason),i):r:this._provideRenameEdits(e,t+1,n.concat(localize("no result","No result.")),i)}))}}function rename(e,t,n,i){return __awaiter$e(this,void 0,void 0,(function*(){const o=new RenameSkeleton(t,n,e),r=yield o.resolveRenameLocation(CancellationToken.None);return(null==r?void 0:r.rejectReason)?{edits:[],rejectReason:r.rejectReason}:o.provideRenameEdits(i,CancellationToken.None)}))}let RenameController=class e{constructor(e,t,n,i,o,r,s,a){this.editor=e,this._instaService=t,this._notificationService=n,this._bulkEditService=i,this._progressService=o,this._logService=r,this._configService=s,this._languageFeaturesService=a,this._dispoableStore=new DisposableStore,this._cts=new CancellationTokenSource$1,this._renameInputField=this._dispoableStore.add(new IdleValue((()=>this._dispoableStore.add(this._instaService.createInstance(RenameInputField,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"])))))}static get(t){return t.getContribution(e.ID)}dispose(){this._dispoableStore.dispose(),this._cts.dispose(!0)}run(){var e,t;return __awaiter$e(this,void 0,void 0,(function*(){if(this._cts.dispose(!0),!this.editor.hasModel())return;const n=this.editor.getPosition(),i=new RenameSkeleton(this.editor.getModel(),n,this._languageFeaturesService.renameProvider);if(!i.hasProvider())return;let o;this._cts=new EditorStateCancellationTokenSource(this.editor,5);try{const e=i.resolveRenameLocation(this._cts.token);this._progressService.showWhile(e,250),o=yield e}catch(e2){return void(null===(e=MessageController.get(this.editor))||void 0===e||e.showMessage(e2||localize("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),n))}if(!o)return;if(o.rejectReason)return void(null===(t=MessageController.get(this.editor))||void 0===t||t.showMessage(o.rejectReason,n));if(this._cts.token.isCancellationRequested)return;this._cts.dispose(),this._cts=new EditorStateCancellationTokenSource(this.editor,5,o.range);let r=this.editor.getSelection(),s=0,a=o.text.length;Range$2.isEmpty(r)||Range$2.spansMultipleLines(r)||!Range$2.containsRange(o.range,r)||(s=Math.max(0,r.startColumn-o.range.startColumn),a=Math.min(o.range.endColumn,r.endColumn)-o.range.startColumn);const l=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),c=yield this._renameInputField.value.getInput(o.range,o.text,s,a,l,this._cts.token);if("boolean"==typeof c)return void(c&&this.editor.focus());this.editor.focus();const d=raceCancellation(i.provideRenameEdits(c.newName,this._cts.token),this._cts.token).then((e=>__awaiter$e(this,void 0,void 0,(function*(){e&&this.editor.hasModel()&&(e.rejectReason?this._notificationService.info(e.rejectReason):(this.editor.setSelection(Range$2.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(ResourceEdit.convert(e),{editor:this.editor,showPreview:c.wantsPreview,label:localize("label","Renaming '{0}'",null==o?void 0:o.text),quotableLabel:localize("quotableLabel","Renaming {0}",null==o?void 0:o.text)}).then((e=>{e.ariaSummary&&alert(localize("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",o.text,c.newName,e.ariaSummary))})).catch((e=>{this._notificationService.error(localize("rename.failedApply","Rename failed to apply edits")),this._logService.error(e)}))))}))),(e=>{this._notificationService.error(localize("rename.failed","Rename failed to compute edits")),this._logService.error(e)}));return this._progressService.showWhile(d,250),d}))}acceptRenameInput(e){this._renameInputField.value.acceptInput(e)}cancelRenameInput(){this._renameInputField.value.cancelInput(!0)}};RenameController.ID="editor.contrib.renameController",RenameController=__decorate$t([__param$s(1,IInstantiationService),__param$s(2,INotificationService),__param$s(3,IBulkEditService),__param$s(4,IEditorProgressService),__param$s(5,ILogService),__param$s(6,ITextResourceConfigurationService),__param$s(7,ILanguageFeaturesService)],RenameController);class RenameAction extends EditorAction{constructor(){super({id:"editor.action.rename",label:localize("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.hasRenameProvider),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const n=e.get(ICodeEditorService),[i,o]=Array.isArray(t)&&t||[void 0,void 0];return URI.isUri(i)&&Position$1.isIPosition(o)?n.openCodeEditor({resource:i},n.getActiveCodeEditor()).then((e=>{e&&(e.setPosition(o),e.invokeWithinContext((t=>(this.reportTelemetry(t,e),this.run(t,e)))))}),onUnexpectedError):super.runCommand(e,t)}run(e,t){const n=RenameController.get(t);return n?n.run():Promise.resolve()}}registerEditorContribution(RenameController.ID,RenameController),registerEditorAction(RenameAction);const RenameCommand=EditorCommand.bindToContribution(RenameController.get);registerEditorCommand(new RenameCommand({id:"acceptRenameInput",precondition:CONTEXT_RENAME_INPUT_VISIBLE,handler:e=>e.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:EditorContextKeys.focus,primary:3}})),registerEditorCommand(new RenameCommand({id:"acceptRenameInputWithPreview",precondition:ContextKeyExpr.and(CONTEXT_RENAME_INPUT_VISIBLE,ContextKeyExpr.has("config.editor.rename.enablePreview")),handler:e=>e.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:EditorContextKeys.focus,primary:1027}})),registerEditorCommand(new RenameCommand({id:"cancelRenameInput",precondition:CONTEXT_RENAME_INPUT_VISIBLE,handler:e=>e.cancelRenameInput(),kbOpts:{weight:199,kbExpr:EditorContextKeys.focus,primary:9,secondary:[1033]}})),registerModelAndPositionCommand("_executeDocumentRenameProvider",(function(e,t,n,...i){const[o]=i;assertType("string"==typeof o);const{renameProvider:r}=e.get(ILanguageFeaturesService);return rename(r,t,n,o)})),registerModelAndPositionCommand("_executePrepareRename",(function(e,t,n){return __awaiter$e(this,void 0,void 0,(function*(){const{renameProvider:i}=e.get(ILanguageFeaturesService),o=new RenameSkeleton(t,n,i),r=yield o.resolveRenameLocation(CancellationToken.None);if(null==r?void 0:r.rejectReason)throw new Error(r.rejectReason);return r}))})),Registry.as(Extensions$3.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:localize("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});class WordSelectionRangeProvider{provideSelectionRanges(e,t){const n=[];for(const i of t){const t=[];n.push(t),this._addInWordRanges(t,e,i),this._addWordRanges(t,e,i),this._addWhitespaceLine(t,e,i),t.push({range:e.getFullModelRange()})}return n}_addInWordRanges(e,t,n){const i=t.getWordAtPosition(n);if(!i)return;let{word:o,startColumn:r}=i,s=n.column-r,a=s,l=s,c=0;for(;a>=0;a--){let e=o.charCodeAt(a);if(a!==s&&(95===e||45===e))break;if(isLowerAsciiLetter(e)&&isUpperAsciiLetter(c))break;c=e}for(a+=1;l<o.length;l++){let e=o.charCodeAt(l);if(isUpperAsciiLetter(e)&&isLowerAsciiLetter(c))break;if(95===e||45===e)break;c=e}a<l&&e.push({range:new Range$2(n.lineNumber,r+a,n.lineNumber,r+l)})}_addWordRanges(e,t,n){const i=t.getWordAtPosition(n);i&&e.push({range:new Range$2(n.lineNumber,i.startColumn,n.lineNumber,i.endColumn)})}_addWhitespaceLine(e,t,n){t.getLineLength(n.lineNumber)>0&&0===t.getLineFirstNonWhitespaceColumn(n.lineNumber)&&0===t.getLineLastNonWhitespaceColumn(n.lineNumber)&&e.push({range:new Range$2(n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})}}var __decorate$s=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$r=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$d=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class SelectionRanges{constructor(e,t){this.index=e,this.ranges=t}mov(e){let t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const n=new SelectionRanges(t,this.ranges);return n.ranges[t].equalsRange(this.ranges[this.index])?n.mov(e):n}}let SmartSelectController=class e{constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}static get(t){return t.getContribution(e.ID)}dispose(){var e;null===(e=this._selectionListener)||void 0===e||e.dispose()}run(e){return __awaiter$d(this,void 0,void 0,(function*(){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),n=this._editor.getModel();if(this._state||(yield provideSelectionRanges(this._languageFeaturesService.selectionRangeProvider,n,t.map((e=>e.getPosition())),this._editor.getOption(102),CancellationToken.None).then((e=>{var n;if(isNonEmptyArray(e)&&e.length===t.length&&this._editor.hasModel()&&equals$1(this._editor.getSelections(),t,((e,t)=>e.equalsSelection(t)))){for(let n=0;n<e.length;n++)e[n]=e[n].filter((e=>e.containsPosition(t[n].getStartPosition())&&e.containsPosition(t[n].getEndPosition()))),e[n].unshift(t[n]);this._state=e.map((e=>new SelectionRanges(0,e))),null===(n=this._selectionListener)||void 0===n||n.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition((()=>{var e;this._ignoreSelection||(null===(e=this._selectionListener)||void 0===e||e.dispose(),this._state=void 0)}))}}))),!this._state)return;this._state=this._state.map((t=>t.mov(e)));const i=this._state.map((e=>Selection$1.fromPositions(e.ranges[e.index].getStartPosition(),e.ranges[e.index].getEndPosition())));this._ignoreSelection=!0;try{this._editor.setSelections(i)}finally{this._ignoreSelection=!1}}))}};SmartSelectController.ID="editor.contrib.smartSelectController",SmartSelectController=__decorate$s([__param$r(1,ILanguageFeaturesService)],SmartSelectController);class AbstractSmartSelect extends EditorAction{constructor(e,t){super(t),this._forward=e}run(e,t){return __awaiter$d(this,void 0,void 0,(function*(){let e=SmartSelectController.get(t);e&&(yield e.run(this._forward))}))}}class GrowSelectionAction extends AbstractSmartSelect{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:localize("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"1_basic",title:localize({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}CommandsRegistry.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class ShrinkSelectionAction extends AbstractSmartSelect{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:localize("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"1_basic",title:localize({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}function provideSelectionRanges(e,t,n,i,o){return __awaiter$d(this,void 0,void 0,(function*(){const r=e.all(t).concat(new WordSelectionRangeProvider);1===r.length&&r.unshift(new BracketSelectionRangeProvider);let s=[],a=[];for(const e of r)s.push(Promise.resolve(e.provideSelectionRanges(t,n,o)).then((e=>{if(isNonEmptyArray(e)&&e.length===n.length)for(let t=0;t<n.length;t++){a[t]||(a[t]=[]);for(const i of e[t])Range$2.isIRange(i.range)&&Range$2.containsPosition(i.range,n[t])&&a[t].push(Range$2.lift(i.range))}}),onUnexpectedExternalError));return yield Promise.all(s),a.map((e=>{if(0===e.length)return[];e.sort(((e,t)=>Position$1.isBefore(e.getStartPosition(),t.getStartPosition())?1:Position$1.isBefore(t.getStartPosition(),e.getStartPosition())||Position$1.isBefore(e.getEndPosition(),t.getEndPosition())?-1:Position$1.isBefore(t.getEndPosition(),e.getEndPosition())?1:0));let n,o=[];for(const t of e)(!n||Range$2.containsRange(t,n)&&!Range$2.equalsRange(t,n))&&(o.push(t),n=t);if(!i.selectLeadingAndTrailingWhitespace)return o;let r=[o[0]];for(let i=1;i<o.length;i++){const e=o[i-1],n=o[i];if(n.startLineNumber!==e.startLineNumber||n.endLineNumber!==e.endLineNumber){const i=new Range$2(e.startLineNumber,t.getLineFirstNonWhitespaceColumn(e.startLineNumber),e.endLineNumber,t.getLineLastNonWhitespaceColumn(e.endLineNumber));i.containsRange(e)&&!i.equalsRange(e)&&n.containsRange(i)&&!n.equalsRange(i)&&r.push(i);const o=new Range$2(e.startLineNumber,1,e.endLineNumber,t.getLineMaxColumn(e.endLineNumber));o.containsRange(e)&&!o.equalsRange(i)&&n.containsRange(o)&&!n.equalsRange(o)&&r.push(o)}r.push(n)}return r}))}))}registerEditorContribution(SmartSelectController.ID,SmartSelectController),registerEditorAction(GrowSelectionAction),registerEditorAction(ShrinkSelectionAction),CommandsRegistry.registerCommand("_executeSelectionRangeProvider",(function(e,...t){return __awaiter$d(this,void 0,void 0,(function*(){const[n,i]=t;assertType(URI.isUri(n));const o=e.get(ILanguageFeaturesService).selectionRangeProvider,r=yield e.get(ITextModelService).createModelReference(n);try{return provideSelectionRanges(o,r.object.textEditorModel,i,{selectLeadingAndTrailingWhitespace:!0},CancellationToken.None)}finally{r.dispose()}}))}));class ForceRetokenizeAction extends EditorAction{constructor(){super({id:"editor.action.forceRetokenize",label:localize("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getModel();n.resetTokenization();const i=new StopWatch(!0);n.forceTokenization(n.getLineCount()),i.stop()}}registerEditorAction(ForceRetokenizeAction);class ToggleTabFocusModeAction extends EditorAction{constructor(){super({id:ToggleTabFocusModeAction.ID,label:localize({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),alias:"Toggle Tab Key Moves Focus",precondition:void 0,kbOpts:{kbExpr:null,primary:2091,mac:{primary:1323},weight:100}})}run(e,t){const n=!TabFocus.getTabFocusMode();TabFocus.setTabFocusMode(n),alert(n?localize("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):localize("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}ToggleTabFocusModeAction.ID="editor.action.toggleTabFocusMode",registerEditorAction(ToggleTabFocusModeAction);var unicodeHighlighter="";class UnicodeTextModelHighlighter{static computeUnicodeHighlights(e,t,n){const i=n?n.startLineNumber:1,o=n?n.endLineNumber:e.getLineCount(),r=new CodePointHighlighter(t),s=r.getCandidateCodePoints();let a;a="allNonBasicAscii"===s?new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):new RegExp(`${buildRegExpCharClassExpr(Array.from(s))}`,"g");const l=new Searcher(null,a),c=[];let d,u=!1,h=0,g=0,p=0;e:for(let f=i,m=o;f<=m;f++){const t=e.getLineContent(f),n=t.length;l.reset(0);do{if(d=l.next(t),d){let e=d.index,i=d.index+d[0].length;if(e>0){isHighSurrogate(t.charCodeAt(e-1))&&e--}if(i+1<n){isHighSurrogate(t.charCodeAt(i-1))&&i++}const o=t.substring(e,i),s=getWordAtText(e+1,DEFAULT_WORD_REGEXP,t,0),a=r.shouldHighlightNonBasicASCII(o,s?s.word:null);if(0!==a){3===a?h++:2===a?g++:1===a?p++:assertNever();const t=1e3;if(c.length>=t){u=!0;break e}c.push(new Range$2(f,e+1,f,i+1))}}}while(d)}return{ranges:c,hasMore:u,ambiguousCharacterCount:h,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const n=new CodePointHighlighter(t);switch(n.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const i=e.codePointAt(0),o=n.ambiguousCharacters.getPrimaryConfusable(i),r=AmbiguousCharacters.getLocales().filter((e=>!AmbiguousCharacters.getInstance(new Set([...t.allowedLocales,e])).isAmbiguous(i)));return{kind:0,confusableWith:String.fromCodePoint(o),notAmbiguousInLocales:r}}case 1:return{kind:2}}}}function buildRegExpCharClassExpr(e,t){return`[${escapeRegExpCharacters(e.map((e=>String.fromCodePoint(e))).join(""))}]`}class CodePointHighlighter{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=AmbiguousCharacters.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of InvisibleCharacters.codePoints)isAllowedInvisibleCharacter(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const n=e.codePointAt(0);if(this.allowedCodePoints.has(n))return 0;if(this.options.nonBasicASCII)return 1;let i=!1,o=!1;if(t)for(let r of t){const e=r.codePointAt(0),t=isBasicASCII(r);i=i||t,t||this.ambiguousCharacters.isAmbiguous(e)||InvisibleCharacters.isInvisibleCharacter(e)||(o=!0)}return!i&&o?0:this.options.invisibleCharacters&&!isAllowedInvisibleCharacter(e)&&InvisibleCharacters.isInvisibleCharacter(n)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(n)?3:0}}function isAllowedInvisibleCharacter(e){return" "===e||"\n"===e||"\t"===e}var bannerController="",__decorate$r=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$q=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let Link=class extends Disposable{constructor(e,t,n={},i){var o;super(),this._link=t,this._enabled=!0,this.el=append$1(e,$$c("a.monaco-link",{tabIndex:null!==(o=t.tabIndex)&&void 0!==o?o:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const r=this._register(new DomEmitter(this.el,"click")),s=this._register(new DomEmitter(this.el,"keypress")),a=Event$1.chain(s.event).map((e=>new StandardKeyboardEvent(e))).filter((e=>3===e.keyCode)).event,l=this._register(new DomEmitter(this.el,EventType.Tap)).event;this._register(Gesture.addTarget(this.el));const c=Event$1.any(r.event,a,l);this._register(c((e=>{this.enabled&&(EventHelper.stop(e,!0),(null==n?void 0:n.opener)?n.opener(this._link.href):i.open(this._link.href,{allowCommands:!0}))}))),this.enabled=!0}get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}};Link=__decorate$r([__param$q(3,IOpenerService)],Link),registerThemingParticipant(((e,t)=>{const n=e.getColor(textLinkForeground);n&&t.addRule(`.monaco-link { color: ${n}; }`);const i=e.getColor(textLinkActiveForeground);i&&t.addRule(`.monaco-link:hover { color: ${i}; }`)}));var __decorate$q=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$p=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const BANNER_ELEMENT_HEIGHT=26;let BannerController=class extends Disposable{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(Banner))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show(Object.assign(Object.assign({},e),{onClose:()=>{this.hide(),e.onClose&&e.onClose()}})),this._editor.setBanner(this.banner.element,BANNER_ELEMENT_HEIGHT)}};BannerController=__decorate$q([__param$p(1,IInstantiationService)],BannerController);let Banner=class extends Disposable{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(MarkdownRenderer,{}),this.element=$$c("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){return e.ariaLabel?e.ariaLabel:"string"==typeof e.message?e.message:void 0}getBannerMessage(e){if("string"==typeof e){const t=$$c("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){clearNode(this.element)}show(e){clearNode(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const n=append$1(this.element,$$c("div.icon-container"));n.setAttribute("aria-hidden","true"),e.icon&&n.appendChild($$c(`div${ThemeIcon.asCSSSelector(e.icon)}`));const i=append$1(this.element,$$c("div.message-container"));if(i.setAttribute("aria-hidden","true"),i.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=append$1(this.element,$$c("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(Link,this.messageActionsContainer,Object.assign(Object.assign({},r),{tabIndex:-1}),{}));const o=append$1(this.element,$$c("div.action-container"));this.actionBar=this._register(new ActionBar(o)),this.actionBar.push(this._register(new Action("banner.close","Close Banner",ThemeIcon.asClassName(widgetClose),!0,(()=>{"function"==typeof e.onClose&&e.onClose()}))),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};Banner=__decorate$q([__param$p(0,IInstantiationService)],Banner);const IWorkspaceTrustManagementService=createDecorator("workspaceTrustManagementService");var __decorate$p=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$o=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$c=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const warningIcon=registerIcon("extensions-warning-message",Codicon.warning,localize("warningIcon","Icon shown with a warning message in the extensions editor."));let UnicodeHighlighter=class extends Disposable{constructor(e,t,n,i){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=n,this._highlighter=null,this._bannerClosed=!1,this._updateState=e=>{if(e&&e.hasMore){if(this._bannerClosed)return;const t=Math.max(e.ambiguousCharacterCount,e.nonBasicAsciiCharacterCount,e.invisibleCharacterCount);let n;if(e.nonBasicAsciiCharacterCount>=t)n={message:localize("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new DisableHighlightingOfNonBasicAsciiCharactersAction};else if(e.ambiguousCharacterCount>=t)n={message:localize("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new DisableHighlightingOfAmbiguousCharactersAction};else{if(!(e.invisibleCharacterCount>=t))throw new Error("Unreachable");n={message:localize("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new DisableHighlightingOfInvisibleCharactersAction}}this._bannerController.show({id:"unicodeHighlightBanner",message:n.message,icon:warningIcon,actions:[{label:n.command.shortLabel,href:`command:${n.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(i.createInstance(BannerController,e)),this._register(this._editor.onDidChangeModel((()=>{this._bannerClosed=!1,this._updateHighlighter()}))),this._options=e.getOption(113),this._register(n.onDidChangeTrust((e=>{this._updateHighlighter()}))),this._register(e.onDidChangeConfiguration((t=>{t.hasChanged(113)&&(this._options=e.getOption(113),this._updateHighlighter())}))),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=resolveOptions(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every((e=>!1===e)))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map((e=>e.codePointAt(0))),allowedLocales:Object.keys(e.allowedLocales).map((e=>{if("_os"===e){return(new Intl.NumberFormat).resolvedOptions().locale}return"_vscode"===e?language:e}))};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new DocumentUnicodeHighlighter(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new ViewportUnicodeHighlighter(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};function resolveOptions(e,t){return{nonBasicASCII:t.nonBasicASCII===inUntrustedWorkspace?!e:t.nonBasicASCII,ambiguousCharacters:t.ambiguousCharacters,invisibleCharacters:t.invisibleCharacters,includeComments:t.includeComments===inUntrustedWorkspace?!e:t.includeComments,includeStrings:t.includeStrings===inUntrustedWorkspace?!e:t.includeStrings,allowedCharacters:t.allowedCharacters,allowedLocales:t.allowedLocales}}UnicodeHighlighter.ID="editor.contrib.unicodeHighlighter",UnicodeHighlighter=__decorate$p([__param$o(1,IEditorWorkerService),__param$o(2,IWorkspaceTrustManagementService),__param$o(3,IInstantiationService)],UnicodeHighlighter);let DocumentUnicodeHighlighter=class extends Disposable{constructor(e,t,n,i){super(),this._editor=e,this._options=t,this._updateState=n,this._editorWorkerService=i,this._model=this._editor.getModel(),this._decorationIds=new Set,this._updateSoon=this._register(new RunOnceScheduler((()=>this._update()),250)),this._register(this._editor.onDidChangeModelContent((()=>{this._updateSoon.schedule()}))),this._updateSoon.schedule()}dispose(){this._decorationIds=new Set(this._model.deltaDecorations(Array.from(this._decorationIds),[])),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII())return void(this._decorationIds=new Set(this._editor.deltaDecorations(Array.from(this._decorationIds),[])));const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then((t=>{if(this._model.isDisposed())return;if(this._model.getVersionId()!==e)return;this._updateState(t);const n=[];if(!t.hasMore)for(const e of t.ranges)n.push({range:e,options:Decorations.instance.getDecorationFromOptions(this._options)});this._decorationIds=new Set(this._editor.deltaDecorations(Array.from(this._decorationIds),n))}))}getDecorationInfo(e){if(!this._decorationIds.has(e))return null;const t=this._editor.getModel(),n=t.getDecorationRange(e),i={range:n,options:Decorations.instance.getDecorationFromOptions(this._options),id:e,ownerId:0};if(!isModelDecorationVisible(t,i))return null;return{reason:computeReason(t.getValueInRange(n),this._options),inComment:isModelDecorationInComment(t,i),inString:isModelDecorationInString(t,i)}}};DocumentUnicodeHighlighter=__decorate$p([__param$o(3,IEditorWorkerService)],DocumentUnicodeHighlighter);class ViewportUnicodeHighlighter extends Disposable{constructor(e,t,n){super(),this._editor=e,this._options=t,this._updateState=n,this._model=this._editor.getModel(),this._decorationIds=new Set,this._updateSoon=this._register(new RunOnceScheduler((()=>this._update()),250)),this._register(this._editor.onDidLayoutChange((()=>{this._updateSoon.schedule()}))),this._register(this._editor.onDidScrollChange((()=>{this._updateSoon.schedule()}))),this._register(this._editor.onDidChangeHiddenAreas((()=>{this._updateSoon.schedule()}))),this._register(this._editor.onDidChangeModelContent((()=>{this._updateSoon.schedule()}))),this._updateSoon.schedule()}dispose(){this._decorationIds=new Set(this._model.deltaDecorations(Array.from(this._decorationIds),[])),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII())return void(this._decorationIds=new Set(this._editor.deltaDecorations(Array.from(this._decorationIds),[])));const e=this._editor.getVisibleRanges(),t=[],n={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const i of e){const e=UnicodeTextModelHighlighter.computeUnicodeHighlights(this._model,this._options,i);for(const t of e.ranges)n.ranges.push(t);n.ambiguousCharacterCount+=n.ambiguousCharacterCount,n.invisibleCharacterCount+=n.invisibleCharacterCount,n.nonBasicAsciiCharacterCount+=n.nonBasicAsciiCharacterCount,n.hasMore=n.hasMore||e.hasMore}if(!n.hasMore)for(const i of n.ranges)t.push({range:i,options:Decorations.instance.getDecorationFromOptions(this._options)});this._updateState(n),this._decorationIds=new Set(this._editor.deltaDecorations(Array.from(this._decorationIds),t))}getDecorationInfo(e){if(!this._decorationIds.has(e))return null;const t=this._editor.getModel(),n=t.getDecorationRange(e),i=t.getValueInRange(n),o={range:n,options:Decorations.instance.getDecorationFromOptions(this._options),id:e,ownerId:0};return isModelDecorationVisible(t,o)?{reason:computeReason(i,this._options),inComment:isModelDecorationInComment(t,o),inString:isModelDecorationInString(t,o)}:null}}let UnicodeHighlighterHoverParticipant=class{constructor(e,t,n){this._editor=e,this._languageService=t,this._openerService=n,this.hoverOrdinal=4}computeSync(e,t){if(!this._editor.hasModel()||1!==e.type)return[];const n=this._editor.getModel(),i=this._editor.getContribution(UnicodeHighlighter.ID);if(!i)return[];const o=[];let r=300;for(const s of t){const e=i.getDecorationInfo(s.id);if(!e)continue;const t=n.getValueInRange(s.range).codePointAt(0),a=formatCodePointMarkdown(t);let l;switch(e.reason.kind){case 0:l=localize("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",a,formatCodePointMarkdown(e.reason.confusableWith.codePointAt(0)));break;case 1:l=localize("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",a);break;case 2:l=localize("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",a)}const c={codePoint:t,reason:e.reason,inComment:e.inComment,inString:e.inString},d=[{value:`${l} [${localize("unicodeHighlight.adjustSettings","Adjust settings")}](command:${ShowExcludeOptions.ID}?${encodeURIComponent(JSON.stringify(c))})`,isTrusted:!0}];o.push(new MarkdownHover(this,s.range,d,r++))}return o}renderHoverParts(e,t){return renderMarkdownHovers(e,t,this._editor,this._languageService,this._openerService)}};function codePointToHex(e){return`U+${e.toString(16).padStart(4,"0")}`}function formatCodePointMarkdown(e){let t=`\`${codePointToHex(e)}\``;return InvisibleCharacters.isInvisibleCharacter(e)||(t+=` "${renderCodePointAsInlineCode(e)}"`),t}function renderCodePointAsInlineCode(e){return 96===e?"`` ` ``":"`"+String.fromCodePoint(e)+"`"}function computeReason(e,t){return UnicodeTextModelHighlighter.computeUnicodeHighlightReason(e,t)}UnicodeHighlighterHoverParticipant=__decorate$p([__param$o(1,ILanguageService),__param$o(2,IOpenerService)],UnicodeHighlighterHoverParticipant);class Decorations{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const n=`${e}${t}`;let i=this.map.get(n);return i||(i=ModelDecorationOptions.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(n,i)),i}}Decorations.instance=new Decorations;class DisableHighlightingInCommentsAction extends EditorAction{constructor(){super({id:DisableHighlightingOfAmbiguousCharactersAction.ID,label:localize("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=localize("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}run(e,t,n){return __awaiter$c(this,void 0,void 0,(function*(){let t=null==e?void 0:e.get(IConfigurationService);t&&this.runAction(t)}))}runAction(e){return __awaiter$c(this,void 0,void 0,(function*(){yield e.updateValue(unicodeHighlightConfigKeys.includeComments,!1,1)}))}}class DisableHighlightingInStringsAction extends EditorAction{constructor(){super({id:DisableHighlightingOfAmbiguousCharactersAction.ID,label:localize("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=localize("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}run(e,t,n){return __awaiter$c(this,void 0,void 0,(function*(){let t=null==e?void 0:e.get(IConfigurationService);t&&this.runAction(t)}))}runAction(e){return __awaiter$c(this,void 0,void 0,(function*(){yield e.updateValue(unicodeHighlightConfigKeys.includeStrings,!1,1)}))}}class DisableHighlightingOfAmbiguousCharactersAction extends EditorAction{constructor(){super({id:DisableHighlightingOfAmbiguousCharactersAction.ID,label:localize("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=localize("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}run(e,t,n){return __awaiter$c(this,void 0,void 0,(function*(){let t=null==e?void 0:e.get(IConfigurationService);t&&this.runAction(t)}))}runAction(e){return __awaiter$c(this,void 0,void 0,(function*(){yield e.updateValue(unicodeHighlightConfigKeys.ambiguousCharacters,!1,1)}))}}DisableHighlightingOfAmbiguousCharactersAction.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class DisableHighlightingOfInvisibleCharactersAction extends EditorAction{constructor(){super({id:DisableHighlightingOfInvisibleCharactersAction.ID,label:localize("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=localize("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}run(e,t,n){return __awaiter$c(this,void 0,void 0,(function*(){let t=null==e?void 0:e.get(IConfigurationService);t&&this.runAction(t)}))}runAction(e){return __awaiter$c(this,void 0,void 0,(function*(){yield e.updateValue(unicodeHighlightConfigKeys.invisibleCharacters,!1,1)}))}}DisableHighlightingOfInvisibleCharactersAction.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class DisableHighlightingOfNonBasicAsciiCharactersAction extends EditorAction{constructor(){super({id:DisableHighlightingOfNonBasicAsciiCharactersAction.ID,label:localize("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=localize("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}run(e,t,n){return __awaiter$c(this,void 0,void 0,(function*(){let t=null==e?void 0:e.get(IConfigurationService);t&&this.runAction(t)}))}runAction(e){return __awaiter$c(this,void 0,void 0,(function*(){yield e.updateValue(unicodeHighlightConfigKeys.nonBasicASCII,!1,1)}))}}DisableHighlightingOfNonBasicAsciiCharactersAction.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class ShowExcludeOptions extends EditorAction{constructor(){super({id:ShowExcludeOptions.ID,label:localize("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}run(e,t,n){return __awaiter$c(this,void 0,void 0,(function*(){const{codePoint:t,reason:i,inString:o,inComment:r}=n,s=String.fromCodePoint(t),a=e.get(IQuickInputService),l=e.get(IConfigurationService);const c=[];if(0===i.kind)for(const e of i.notAmbiguousInLocales)c.push({label:localize("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',e),run:()=>__awaiter$c(this,void 0,void 0,(function*(){excludeLocaleFromBeingHighlighted(l,[e])}))});var d;if(c.push({label:(d=t,InvisibleCharacters.isInvisibleCharacter(d)?localize("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",codePointToHex(d)):localize("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${codePointToHex(d)} "${s}"`)),run:()=>excludeCharFromBeingHighlighted(l,[t])}),r){const e=new DisableHighlightingInCommentsAction;c.push({label:e.label,run:()=>__awaiter$c(this,void 0,void 0,(function*(){return e.runAction(l)}))})}else if(o){const e=new DisableHighlightingInStringsAction;c.push({label:e.label,run:()=>__awaiter$c(this,void 0,void 0,(function*(){return e.runAction(l)}))})}if(0===i.kind){const e=new DisableHighlightingOfAmbiguousCharactersAction;c.push({label:e.label,run:()=>__awaiter$c(this,void 0,void 0,(function*(){return e.runAction(l)}))})}else if(1===i.kind){const e=new DisableHighlightingOfInvisibleCharactersAction;c.push({label:e.label,run:()=>__awaiter$c(this,void 0,void 0,(function*(){return e.runAction(l)}))})}else if(2===i.kind){const e=new DisableHighlightingOfNonBasicAsciiCharactersAction;c.push({label:e.label,run:()=>__awaiter$c(this,void 0,void 0,(function*(){return e.runAction(l)}))})}else expectNever(i);const u=yield a.pick(c,{title:localize("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options")});u&&(yield u.run())}))}}function excludeCharFromBeingHighlighted(e,t){return __awaiter$c(this,void 0,void 0,(function*(){const n=e.getValue(unicodeHighlightConfigKeys.allowedCharacters);let i;i="object"==typeof n&&n?n:{};for(const e of t)i[String.fromCodePoint(e)]=!0;yield e.updateValue(unicodeHighlightConfigKeys.allowedCharacters,i,1)}))}function excludeLocaleFromBeingHighlighted(e,t){var n;return __awaiter$c(this,void 0,void 0,(function*(){const i=null===(n=e.inspect(unicodeHighlightConfigKeys.allowedLocales).user)||void 0===n?void 0:n.value;let o;o="object"==typeof i&&i?Object.assign({},i):{};for(const e of t)o[e]=!0;yield e.updateValue(unicodeHighlightConfigKeys.allowedLocales,o,1)}))}function expectNever(e){throw new Error(`Unexpected value: ${e}`)}ShowExcludeOptions.ID="editor.action.unicodeHighlight.showExcludeOptions",registerEditorAction(DisableHighlightingOfAmbiguousCharactersAction),registerEditorAction(DisableHighlightingOfInvisibleCharactersAction),registerEditorAction(DisableHighlightingOfNonBasicAsciiCharactersAction),registerEditorAction(ShowExcludeOptions),registerEditorContribution(UnicodeHighlighter.ID,UnicodeHighlighter),HoverParticipantRegistry.register(UnicodeHighlighterHoverParticipant);const IDialogService=createDecorator("dialogService");var __decorate$o=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$n=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$b=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const ignoreUnusualLineTerminators="ignoreUnusualLineTerminators";function writeIgnoreState(e,t,n){e.setModelProperty(t.uri,ignoreUnusualLineTerminators,n)}function readIgnoreState(e,t){return e.getModelProperty(t.uri,ignoreUnusualLineTerminators)}let UnusualLineTerminatorsDetector=class extends Disposable{constructor(e,t,n){super(),this._editor=e,this._dialogService=t,this._codeEditorService=n,this._config=this._editor.getOption(114),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(114)&&(this._config=this._editor.getOption(114),this._checkForUnusualLineTerminators())}))),this._register(this._editor.onDidChangeModel((()=>{this._checkForUnusualLineTerminators()}))),this._register(this._editor.onDidChangeModelContent((e=>{e.isUndoing||this._checkForUnusualLineTerminators()})))}_checkForUnusualLineTerminators(){return __awaiter$b(this,void 0,void 0,(function*(){if("off"===this._config)return;if(!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators())return;if(!0===readIgnoreState(this._codeEditorService,e))return;if(this._editor.getOption(81))return;if("auto"===this._config)return void e.removeUnusualLineTerminators(this._editor.getSelections());(yield this._dialogService.confirm({title:localize("unusualLineTerminators.title","Unusual Line Terminators"),message:localize("unusualLineTerminators.message","Detected unusual line terminators"),detail:localize("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",basename(e.uri)),primaryButton:localize("unusualLineTerminators.fix","Remove Unusual Line Terminators"),secondaryButton:localize("unusualLineTerminators.ignore","Ignore")})).confirmed?e.removeUnusualLineTerminators(this._editor.getSelections()):writeIgnoreState(this._codeEditorService,e,!0)}))}};function reverseEndianness(e){for(let t=0,n=e.length;t<n;t+=4){const n=e[t+0],i=e[t+1],o=e[t+2],r=e[t+3];e[t+0]=r,e[t+1]=o,e[t+2]=i,e[t+3]=n}}function toLittleEndianBuffer(e){const t=new Uint8Array(e.buffer,e.byteOffset,4*e.length);return isLittleEndian()||reverseEndianness(t),VSBuffer.wrap(t)}function encodeSemanticTokensDto(e){const t=new Uint32Array(encodeSemanticTokensDtoSize(e));let n=0;if(t[n++]=e.id,"full"===e.type)t[n++]=1,t[n++]=e.data.length,t.set(e.data,n),n+=e.data.length;else{t[n++]=2,t[n++]=e.deltas.length;for(const i of e.deltas)t[n++]=i.start,t[n++]=i.deleteCount,i.data?(t[n++]=i.data.length,t.set(i.data,n),n+=i.data.length):t[n++]=0}return toLittleEndianBuffer(t)}function encodeSemanticTokensDtoSize(e){let t=0;if(t+=2,"full"===e.type)t+=1+e.data.length;else{t+=1,t+=3*e.deltas.length;for(const n of e.deltas)n.data&&(t+=n.data.length)}return t}UnusualLineTerminatorsDetector.ID="editor.contrib.unusualLineTerminatorsDetector",UnusualLineTerminatorsDetector=__decorate$o([__param$n(1,IDialogService),__param$n(2,ICodeEditorService)],UnusualLineTerminatorsDetector),registerEditorContribution(UnusualLineTerminatorsDetector.ID,UnusualLineTerminatorsDetector);var __awaiter$a=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};function isSemanticTokens(e){return e&&!!e.data}function isSemanticTokensEdits(e){return e&&Array.isArray(e.edits)}class DocumentSemanticTokensResult{constructor(e,t,n){this.provider=e,this.tokens=t,this.error=n}}function hasDocumentSemanticTokensProvider(e,t){return e.has(t)}function getDocumentSemanticTokensProviders(e,t){const n=e.orderedGroups(t);return n.length>0?n[0]:[]}function getDocumentSemanticTokens(e,t,n,i,o){return __awaiter$a(this,void 0,void 0,(function*(){const r=getDocumentSemanticTokensProviders(e,t),s=yield Promise.all(r.map((e=>__awaiter$a(this,void 0,void 0,(function*(){let r,s=null;try{r=yield e.provideDocumentSemanticTokens(t,e===n?i:null,o)}catch(a){s=a,r=null}return r&&(isSemanticTokens(r)||isSemanticTokensEdits(r))||(r=null),new DocumentSemanticTokensResult(e,r,s)})))));for(const e of s){if(e.error)throw e.error;if(e.tokens)return e}return s.length>0?s[0]:null}))}function _getDocumentSemanticTokensProviderHighestGroup(e,t){const n=e.orderedGroups(t);return n.length>0?n[0]:null}class DocumentRangeSemanticTokensResult{constructor(e,t){this.provider=e,this.tokens=t}}function hasDocumentRangeSemanticTokensProvider(e,t){return e.has(t)}function getDocumentRangeSemanticTokensProviders(e,t){const n=e.orderedGroups(t);return n.length>0?n[0]:[]}function getDocumentRangeSemanticTokens(e,t,n,i){return __awaiter$a(this,void 0,void 0,(function*(){const o=getDocumentRangeSemanticTokensProviders(e,t),r=yield Promise.all(o.map((e=>__awaiter$a(this,void 0,void 0,(function*(){let o;try{o=yield e.provideDocumentRangeSemanticTokens(t,n,i)}catch(r){onUnexpectedExternalError(r),o=null}return o&&isSemanticTokens(o)||(o=null),new DocumentRangeSemanticTokensResult(e,o)})))));for(const e of r)if(e.tokens)return e;return r.length>0?r[0]:null}))}CommandsRegistry.registerCommand("_provideDocumentSemanticTokensLegend",((e,...t)=>__awaiter$a(void 0,void 0,void 0,(function*(){const[n]=t;assertType(n instanceof URI);const i=e.get(IModelService).getModel(n);if(!i)return;const{documentSemanticTokensProvider:o}=e.get(ILanguageFeaturesService),r=_getDocumentSemanticTokensProviderHighestGroup(o,i);return r?r[0].getLegend():e.get(ICommandService).executeCommand("_provideDocumentRangeSemanticTokensLegend",n)})))),CommandsRegistry.registerCommand("_provideDocumentSemanticTokens",((e,...t)=>__awaiter$a(void 0,void 0,void 0,(function*(){const[n]=t;assertType(n instanceof URI);const i=e.get(IModelService).getModel(n);if(!i)return;const{documentSemanticTokensProvider:o}=e.get(ILanguageFeaturesService);if(!hasDocumentSemanticTokensProvider(o,i))return e.get(ICommandService).executeCommand("_provideDocumentRangeSemanticTokens",n,i.getFullModelRange());const r=yield getDocumentSemanticTokens(o,i,null,null,CancellationToken.None);if(!r)return;const{provider:s,tokens:a}=r;if(!a||!isSemanticTokens(a))return;const l=encodeSemanticTokensDto({id:0,type:"full",data:a.data});return a.resultId&&s.releaseDocumentSemanticTokens(a.resultId),l})))),CommandsRegistry.registerCommand("_provideDocumentRangeSemanticTokensLegend",((e,...t)=>__awaiter$a(void 0,void 0,void 0,(function*(){const[n,i]=t;assertType(n instanceof URI);const o=e.get(IModelService).getModel(n);if(!o)return;const{documentRangeSemanticTokensProvider:r}=e.get(ILanguageFeaturesService),s=getDocumentRangeSemanticTokensProviders(r,o);if(0===s.length)return;if(1===s.length)return s[0].getLegend();if(!i||!Range$2.isIRange(i))return s[0].getLegend();const a=yield getDocumentRangeSemanticTokens(r,o,Range$2.lift(i),CancellationToken.None);return a?a.provider.getLegend():void 0})))),CommandsRegistry.registerCommand("_provideDocumentRangeSemanticTokens",((e,...t)=>__awaiter$a(void 0,void 0,void 0,(function*(){const[n,i]=t;assertType(n instanceof URI),assertType(Range$2.isIRange(i));const o=e.get(IModelService).getModel(n);if(!o)return;const{documentRangeSemanticTokensProvider:r}=e.get(ILanguageFeaturesService),s=yield getDocumentRangeSemanticTokens(r,o,Range$2.lift(i),CancellationToken.None);return s&&s.tokens?encodeSemanticTokensDto({id:0,type:"full",data:s.tokens.data}):void 0}))));class SparseMultilineTokens{constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}static create(e,t){return new SparseMultilineTokens(e,new SparseMultilineTokensStorage(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e?new Range$2(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn):e}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,n,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber,[i,o,r]=this._tokens.split(t,e.startColumn-1,n,e.endColumn-1);return[new SparseMultilineTokens(this._startLineNumber,i),new SparseMultilineTokens(this._startLineNumber+r,o)]}applyEdit(e,t){const[n,i,o]=countEOL(t);this.acceptEdit(e,n,i,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,n,i,o){this._acceptDeleteRange(e),this._acceptInsertText(new Position$1(e.startLineNumber,e.startColumn),t,n,i,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,n=e.endLineNumber-this._startLineNumber;if(n<0){const e=n-t;return void(this._startLineNumber-=e)}const i=this._tokens.getMaxDeltaLine();if(!(t>=i+1)){if(t<0&&n>=i+1)return this._startLineNumber=0,void this._tokens.clear();if(t<0){const i=-t;this._startLineNumber-=i,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,n,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,n,e.endColumn-1)}}_acceptInsertText(e,t,n,i,o){if(0===t&&0===n)return;const r=e.lineNumber-this._startLineNumber;if(r<0)return void(this._startLineNumber+=t);r>=this._tokens.getMaxDeltaLine()+1||this._tokens.acceptInsertText(r,e.column-1,t,n,i,o)}}class SparseMultilineTokensStorage{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let n=0;n<this._tokenCount;n++)t.push(`(${this._getDeltaLine(n)+e},${this._getStartCharacter(n)}-${this._getEndCharacter(n)})`);return`[${t.join(",")}]`}getMaxDeltaLine(){const e=this._getTokenCount();return 0===e?-1:this._getDeltaLine(e-1)}getRange(){const e=this._getTokenCount();if(0===e)return null;const t=this._getStartCharacter(0),n=this._getDeltaLine(e-1),i=this._getEndCharacter(e-1);return new Range$2(0,t+1,n,i+1)}_getTokenCount(){return this._tokenCount}_getDeltaLine(e){return this._tokens[4*e]}_getStartCharacter(e){return this._tokens[4*e+1]}_getEndCharacter(e){return this._tokens[4*e+2]}isEmpty(){return 0===this._getTokenCount()}getLineTokens(e){let t=0,n=this._getTokenCount()-1;for(;t<n;){const i=t+Math.floor((n-t)/2),o=this._getDeltaLine(i);if(o<e)t=i+1;else{if(!(o>e)){let o=i;for(;o>t&&this._getDeltaLine(o-1)===e;)o--;let r=i;for(;r<n&&this._getDeltaLine(r+1)===e;)r++;return new SparseLineTokens(this._tokens.subarray(4*o,4*r+4))}n=i-1}}return this._getDeltaLine(t)===e?new SparseLineTokens(this._tokens.subarray(4*t,4*t+4)):null}clear(){this._tokenCount=0}removeTokens(e,t,n,i){const o=this._tokens,r=this._tokenCount;let s=0,a=!1,l=0;for(let c=0;c<r;c++){const r=4*c,d=o[r],u=o[r+1],h=o[r+2],g=o[r+3];if((d>e||d===e&&h>=t)&&(d<n||d===n&&u<=i))a=!0;else{if(0===s&&(l=d),a){const e=4*s;o[e]=d-l,o[e+1]=u,o[e+2]=h,o[e+3]=g}s++}}return this._tokenCount=s,l}split(e,t,n,i){const o=this._tokens,r=this._tokenCount,s=[],a=[];let l=s,c=0,d=0;for(let u=0;u<r;u++){const r=4*u,s=o[r],h=o[r+1],g=o[r+2],p=o[r+3];if(s>e||s===e&&g>=t){if(s<n||s===n&&h<=i)continue;l!==a&&(l=a,c=0,d=s)}l[c++]=s-d,l[c++]=h,l[c++]=g,l[c++]=p}return[new SparseMultilineTokensStorage(new Uint32Array(s)),new SparseMultilineTokensStorage(new Uint32Array(a)),d]}acceptDeleteRange(e,t,n,i,o){const r=this._tokens,s=this._tokenCount,a=i-t;let l=0,c=!1;for(let d=0;d<s;d++){const u=4*d;let h=r[u],g=r[u+1],p=r[u+2];const f=r[u+3];if(h<t||h===t&&p<=n){l++;continue}if(h===t&&g<n)h===i&&p>o?p-=o-n:p=n;else if(h===t&&g===n){if(!(h===i&&p>o)){c=!0;continue}p-=o-n}else if(h<i||h===i&&g<o){if(!(h===i&&p>o)){c=!0;continue}h===t?(g=n,p=g+(p-o)):(g=0,p=g+(p-o))}else if(h>i){if(0===a&&!c){l=s;break}h-=a}else{if(!(h===i&&g>=o))throw new Error("Not possible!");e&&0===h&&(g+=e,p+=e),h-=a,g-=o-n,p-=o-n}const m=4*l;r[m]=h,r[m+1]=g,r[m+2]=p,r[m+3]=f,l++}this._tokenCount=l}acceptInsertText(e,t,n,i,o,r){const s=0===n&&1===i&&(r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122),a=this._tokens,l=this._tokenCount;for(let c=0;c<l;c++){const r=4*c;let l=a[r],d=a[r+1],u=a[r+2];if(!(l<e||l===e&&u<t)){if(l===e&&u===t){if(!s)continue;u+=1}else if(l===e&&d<t&&t<u)0===n?u+=i:u=t;else{if(l===e&&d===t&&s)continue;if(l===e)if(l+=n,0===n)d+=i,u+=i;else{const e=u-d;d=o+(d-t),u=d+e}else l+=n}a[r]=l,a[r+1]=d,a[r+2]=u}}}}class SparseLineTokens{constructor(e){this._tokens=e}getCount(){return this._tokens.length/4}getStartCharacter(e){return this._tokens[4*e+1]}getEndCharacter(e){return this._tokens[4*e+2]}getMetadata(e){return this._tokens[4*e+3]}}var __decorate$n=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$m=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let SemanticTokensProviderStyling=class{constructor(e,t,n,i){this._legend=e,this._themeService=t,this._languageService=n,this._logService=i,this._hashTable=new HashTable,this._hasWarnedOverlappingTokens=!1}getMetadata(e,t,n){const i=this._languageService.languageIdCodec.encodeLanguageId(n),o=this._hashTable.get(e,t,i);let r;if(o)r=o.metadata,this._logService.getLevel()===LogLevel.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${TokenMetadata.getForeground(r)}, fontStyle ${TokenMetadata.getFontStyle(r).toString(2)}`);else{let o=this._legend.tokenTypes[e];const s=[];if(o){let e=t;for(let t=0;e>0&&t<this._legend.tokenModifiers.length;t++)1&e&&s.push(this._legend.tokenModifiers[t]),e>>=1;e>0&&this._logService.getLevel()===LogLevel.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),s.push("not-in-legend"));const i=this._themeService.getColorTheme().getTokenStyleMetadata(o,s,n);if(void 0===i)r=2147483647;else{if(r=0,void 0!==i.italic){r|=1|(i.italic?1:0)<<10}if(void 0!==i.bold){r|=2|(i.bold?2:0)<<10}if(void 0!==i.underline){r|=4|(i.underline?4:0)<<10}if(void 0!==i.strikethrough){r|=8|(i.strikethrough?8:0)<<10}if(i.foreground){r|=16|i.foreground<<14}0===r&&(r=2147483647)}}else this._logService.getLevel()===LogLevel.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),r=2147483647,o="not-in-legend";this._hashTable.add(e,t,i,r),this._logService.getLevel()===LogLevel.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${o}) / ${t} (${s.join(" ")}): foreground ${TokenMetadata.getForeground(r)}, fontStyle ${TokenMetadata.getFontStyle(r).toString(2)}`)}return r}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0)}};function toMultilineTokens2(e,t,n){const i=e.data,o=e.data.length/5|0,r=Math.max(Math.ceil(o/1024),400),s=[];let a=0,l=1,c=0;for(;a<o;){const e=a;let d=Math.min(e+r,o);if(d<o){let t=d;for(;t-1>e&&0===i[5*t];)t--;if(t-1===e){let e=d;for(;e+1<o&&0===i[5*e];)e++;d=e}else d=t}let u=new Uint32Array(4*(d-e)),h=0,g=0,p=0,f=0,m=0;for(;a<d;){const e=5*a,o=i[e],r=i[e+1],s=l+o|0,d=0===o?c+r|0:r,v=i[e+2],_=i[e+3],C=i[e+4],b=t.getMetadata(_,C,n);2147483647!==b&&(0===g&&(g=s),p===s&&m>d&&(t.warnOverlappingSemanticTokens(s,d+1),f<d?u[h-4+2]=d:h-=4),u[h]=s-g,u[h+1]=d,u[h+2]=d+v,u[h+3]=b,h+=4,p=s,f=d,m=d+v),l=s,c=d,a++}h!==u.length&&(u=u.subarray(0,h));const v=SparseMultilineTokens.create(g,u);s.push(v)}return s}SemanticTokensProviderStyling=__decorate$n([__param$m(1,IThemeService),__param$m(2,ILanguageService),__param$m(3,ILogService)],SemanticTokensProviderStyling);class HashTableEntry{constructor(e,t,n,i){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=n,this.metadata=i,this.next=null}}class HashTable{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=HashTable._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<HashTable._SIZES.length?2/3*this._currentLength:0),this._elements=[],HashTable._nullOutEntries(this._elements,this._currentLength)}static _nullOutEntries(e,t){for(let n=0;n<t;n++)e[n]=null}_hash2(e,t){return(e<<5)-e+t|0}_hashFunc(e,t,n){return this._hash2(this._hash2(e,t),n)%this._currentLength}get(e,t,n){const i=this._hashFunc(e,t,n);let o=this._elements[i];for(;o;){if(o.tokenTypeIndex===e&&o.tokenModifierSet===t&&o.languageId===n)return o;o=o.next}return null}add(e,t,n,i){if(this._elementsCount++,0!==this._growCount&&this._elementsCount>=this._growCount){const e=this._elements;this._currentLengthIndex++,this._currentLength=HashTable._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<HashTable._SIZES.length?2/3*this._currentLength:0),this._elements=[],HashTable._nullOutEntries(this._elements,this._currentLength);for(const t of e){let e=t;for(;e;){const t=e.next;e.next=null,this._add(e),e=t}}}this._add(new HashTableEntry(e,t,n,i))}_add(e){const t=this._hashFunc(e.tokenTypeIndex,e.tokenModifierSet,e.languageId);e.next=this._elements[t],this._elements[t]=e}}HashTable._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143];var __decorate$m=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$l=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};function MODEL_ID(e){return e.toString()}function computeModelSha1(e){const t=new StringSHA1,n=e.createSnapshot();let i;for(;i=n.read();)t.update(i);return t.digest()}class ModelData{constructor(e,t,n){this._modelEventListeners=new DisposableStore,this.model=e,this._languageSelection=null,this._languageSelectionListener=null,this._modelEventListeners.add(e.onWillDispose((()=>t(e)))),this._modelEventListeners.add(e.onDidChangeLanguage((t=>n(e,t))))}_disposeLanguageSelection(){this._languageSelectionListener&&(this._languageSelectionListener.dispose(),this._languageSelectionListener=null)}dispose(){this._modelEventListeners.dispose(),this._disposeLanguageSelection()}setLanguage(e){this._disposeLanguageSelection(),this._languageSelection=e,this._languageSelectionListener=this._languageSelection.onDidChange((()=>this.model.setMode(e.languageId))),this.model.setMode(e.languageId)}}const DEFAULT_EOL=isLinux||isMacintosh?1:2;class DisposedModelInfo{constructor(e,t,n,i,o,r,s,a){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=n,this.sharesUndoRedoStack=i,this.heapSize=o,this.sha1=r,this.versionId=s,this.alternativeVersionId=a}}let ModelService=class e extends Disposable{constructor(e,t,n,i,o,r,s,a,l){super(),this._configurationService=e,this._resourcePropertiesService=t,this._themeService=n,this._logService=i,this._undoRedoService=o,this._languageService=r,this._languageConfigurationService=s,this._languageFeatureDebounceService=a,this._onModelAdded=this._register(new Emitter$1),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new Emitter$1),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new Emitter$1),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._semanticStyling=this._register(new SemanticStyling(this._themeService,this._languageService,this._logService)),this._register(this._configurationService.onDidChangeConfiguration((()=>this._updateModelOptions()))),this._updateModelOptions(),this._register(new SemanticColoringFeature(this._semanticStyling,this,this._themeService,this._configurationService,this._languageFeatureDebounceService,l))}static _readModelOptions(e,t){var n;let i=EDITOR_MODEL_DEFAULTS.tabSize;if(e.editor&&void 0!==e.editor.tabSize){const t=parseInt(e.editor.tabSize,10);isNaN(t)||(i=t),i<1&&(i=1)}let o=i;if(e.editor&&void 0!==e.editor.indentSize&&"tabSize"!==e.editor.indentSize){const t=parseInt(e.editor.indentSize,10);isNaN(t)||(o=t),o<1&&(o=1)}let r=EDITOR_MODEL_DEFAULTS.insertSpaces;e.editor&&void 0!==e.editor.insertSpaces&&(r="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));let s=DEFAULT_EOL;const a=e.eol;"\r\n"===a?s=2:"\n"===a&&(s=1);let l=EDITOR_MODEL_DEFAULTS.trimAutoWhitespace;e.editor&&void 0!==e.editor.trimAutoWhitespace&&(l="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));let c=EDITOR_MODEL_DEFAULTS.detectIndentation;e.editor&&void 0!==e.editor.detectIndentation&&(c="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));let d=EDITOR_MODEL_DEFAULTS.largeFileOptimizations;e.editor&&void 0!==e.editor.largeFileOptimizations&&(d="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations));let u=EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions;return(null===(n=e.editor)||void 0===n?void 0:n.bracketPairColorization)&&"object"==typeof e.editor.bracketPairColorization&&(u={enabled:!!e.editor.bracketPairColorization.enabled}),{isForSimpleWidget:t,tabSize:i,indentSize:o,insertSpaces:r,detectIndentation:c,defaultEOL:s,trimAutoWhitespace:l,largeFileOptimizations:d,bracketPairColorizationOptions:u}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const n=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return n&&"string"==typeof n&&"auto"!==n?n:3===OS||2===OS?"\n":"\r\n"}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return"boolean"!=typeof e||e}getCreationOptions(t,n,i){let o=this._modelCreationOptionsByLanguageAndResource[t+n];if(!o){const r=this._configurationService.getValue("editor",{overrideIdentifier:t,resource:n}),s=this._getEOL(n,t);o=e._readModelOptions({editor:r,eol:s},i),this._modelCreationOptionsByLanguageAndResource[t+n]=o}return o}_updateModelOptions(){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const n=Object.keys(this._models);for(let i=0,o=n.length;i<o;i++){const o=n[i],r=this._models[o],s=r.model.getLanguageId(),a=r.model.uri,l=t[s+a],c=this.getCreationOptions(s,a,r.model.isForSimpleWidget);e._setModelOptionsForModel(r.model,c,l)}}static _setModelOptionsForModel(e,t,n){n&&n.defaultEOL!==t.defaultEOL&&1===e.getLineCount()&&e.setEOL(1===t.defaultEOL?0:1),n&&n.detectIndentation===t.detectIndentation&&n.insertSpaces===t.insertSpaces&&n.tabSize===t.tabSize&&n.indentSize===t.indentSize&&n.trimAutoWhitespace===t.trimAutoWhitespace&&equals(n.bracketPairColorizationOptions,t.bracketPairColorizationOptions)||(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(MODEL_ID(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(MODEL_ID(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(MODEL_ID(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach((e=>{e.sharesUndoRedoStack||t.push(e)})),t.sort(((e,t)=>e.time-t.time));t.length>0&&this._disposedModelsHeapSize>e;){const e=t.shift();this._removeDisposedModel(e.uri),null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}}}_createModelData(e,t,n,i){const o=this.getCreationOptions(t,n,i),r=new TextModel(e,t,o,n,this._undoRedoService,this._languageService,this._languageConfigurationService);if(n&&this._disposedModels.has(MODEL_ID(n))){const e=this._removeDisposedModel(n),t=this._undoRedoService.getElements(n),i=computeModelSha1(r)===e.sha1;if(i||e.sharesUndoRedoStack){for(const e of t.past)isEditStackElement(e)&&e.matchesResource(n)&&e.setModel(r);for(const e of t.future)isEditStackElement(e)&&e.matchesResource(n)&&e.setModel(r);this._undoRedoService.setElementsValidFlag(n,!0,(e=>isEditStackElement(e)&&e.matchesResource(n))),i&&(r._overwriteVersionId(e.versionId),r._overwriteAlternativeVersionId(e.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot))}else null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}const s=MODEL_ID(r.uri);if(this._models[s])throw new Error("ModelService: Cannot add model because it already exists!");const a=new ModelData(r,(e=>this._onWillDispose(e)),((e,t)=>this._onDidChangeLanguage(e,t)));return this._models[s]=a,a}createModel(e,t,n,i=!1){let o;return t?(o=this._createModelData(e,t.languageId,n,i),this.setMode(o.model,t)):o=this._createModelData(e,PLAINTEXT_LANGUAGE_ID,n,i),this._onModelAdded.fire(o.model),o.model}setMode(e,t){if(!t)return;const n=this._models[MODEL_ID(e.uri)];n&&n.setLanguage(t)}getModels(){const e=[],t=Object.keys(this._models);for(let n=0,i=t.length;n<i;n++){const i=t[n];e.push(this._models[i].model)}return e}getModel(e){const t=MODEL_ID(e),n=this._models[t];return n?n.model:null}getSemanticTokensProviderStyling(e){return this._semanticStyling.get(e)}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===Schemas.file||e.scheme===Schemas.vscodeRemote||e.scheme===Schemas.userData||e.scheme===Schemas.vscodeNotebookCell||"fake-fs"===e.scheme}_onWillDispose(t){const n=MODEL_ID(t.uri),i=this._models[n],o=this._undoRedoService.getUriComparisonKey(t.uri)!==t.uri.toString();let r=!1,s=0;if(o||this._shouldRestoreUndoStack()&&this._schemaShouldMaintainUndoRedoElements(t.uri)){const e=this._undoRedoService.getElements(t.uri);if(e.past.length>0||e.future.length>0){for(const n of e.past)isEditStackElement(n)&&n.matchesResource(t.uri)&&(r=!0,s+=n.heapSize(t.uri),n.setModel(t.uri));for(const n of e.future)isEditStackElement(n)&&n.matchesResource(t.uri)&&(r=!0,s+=n.heapSize(t.uri),n.setModel(t.uri))}}const a=e.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK;if(r)if(!o&&s>a){const e=i.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}else this._ensureDisposedModelsHeapSize(a-s),this._undoRedoService.setElementsValidFlag(t.uri,!1,(e=>isEditStackElement(e)&&e.matchesResource(t.uri))),this._insertDisposedModel(new DisposedModelInfo(t.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),o,s,computeModelSha1(t),t.getVersionId(),t.getAlternativeVersionId()));else if(!o){const e=i.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}delete this._models[n],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[t.getLanguageId()+t.uri],this._onModelRemoved.fire(t)}_onDidChangeLanguage(t,n){const i=n.oldLanguage,o=t.getLanguageId(),r=this.getCreationOptions(i,t.uri,t.isForSimpleWidget),s=this.getCreationOptions(o,t.uri,t.isForSimpleWidget);e._setModelOptionsForModel(t,s,r),this._onModelModeChanged.fire({model:t,oldLanguageId:i})}};ModelService.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20971520,ModelService=__decorate$m([__param$l(0,IConfigurationService),__param$l(1,ITextResourcePropertiesService),__param$l(2,IThemeService),__param$l(3,ILogService),__param$l(4,IUndoRedoService),__param$l(5,ILanguageService),__param$l(6,ILanguageConfigurationService),__param$l(7,ILanguageFeatureDebounceService),__param$l(8,ILanguageFeaturesService)],ModelService);const SEMANTIC_HIGHLIGHTING_SETTING_ID="editor.semanticHighlighting";function isSemanticColoringEnabled(e,t,n){var i;const o=null===(i=n.getValue(SEMANTIC_HIGHLIGHTING_SETTING_ID,{overrideIdentifier:e.getLanguageId(),resource:e.uri}))||void 0===i?void 0:i.enabled;return"boolean"==typeof o?o:t.getColorTheme().semanticHighlighting}let SemanticColoringFeature=class extends Disposable{constructor(e,t,n,i,o,r){super(),this._watchers=Object.create(null),this._semanticStyling=e;const s=e=>{this._watchers[e.uri.toString()]=new ModelSemanticColoring(e,this._semanticStyling,n,o,r)},a=(e,t)=>{t.dispose(),delete this._watchers[e.uri.toString()]},l=()=>{for(let e of t.getModels()){const t=this._watchers[e.uri.toString()];isSemanticColoringEnabled(e,n,i)?t||s(e):t&&a(e,t)}};this._register(t.onModelAdded((e=>{isSemanticColoringEnabled(e,n,i)&&s(e)}))),this._register(t.onModelRemoved((e=>{const t=this._watchers[e.uri.toString()];t&&a(e,t)}))),this._register(i.onDidChangeConfiguration((e=>{e.affectsConfiguration(SEMANTIC_HIGHLIGHTING_SETTING_ID)&&l()}))),this._register(n.onDidColorThemeChange(l))}};SemanticColoringFeature=__decorate$m([__param$l(1,IModelService),__param$l(2,IThemeService),__param$l(3,IConfigurationService),__param$l(4,ILanguageFeatureDebounceService),__param$l(5,ILanguageFeaturesService)],SemanticColoringFeature);class SemanticStyling extends Disposable{constructor(e,t,n){super(),this._themeService=e,this._languageService=t,this._logService=n,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange((()=>{this._caches=new WeakMap})))}get(e){return this._caches.has(e)||this._caches.set(e,new SemanticTokensProviderStyling(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}}class SemanticTokensResponse{constructor(e,t,n){this.provider=e,this.resultId=t,this.data=n}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}let ModelSemanticColoring=class e extends Disposable{constructor(t,n,i,o,r){super(),this._isDisposed=!1,this._model=t,this._semanticStyling=n,this._provider=r.documentSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentSemanticTokens",{min:e.REQUEST_MIN_DELAY,max:e.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new RunOnceScheduler((()=>this._fetchDocumentSemanticTokensNow()),e.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._register(this._model.onDidChangeContent((()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._register(this._model.onDidChangeLanguage((()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)})));const s=()=>{dispose(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const e of this._provider.all(t))"function"==typeof e.onDidChange&&this._documentProvidersChangeListeners.push(e.onDidChange((()=>this._fetchDocumentSemanticTokens.schedule(0))))};s(),this._register(this._provider.onDidChange((()=>{s(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._register(i.onDidColorThemeChange((e=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!hasDocumentSemanticTokensProvider(this._provider,this._model))return void(this._currentDocumentResponse&&this._model.setSemanticTokens(null,!1));const e=new CancellationTokenSource$1,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,n=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,i=getDocumentSemanticTokens(this._provider,this._model,t,n,e.token);this._currentDocumentRequestCancellationTokenSource=e;const o=[],r=this._model.onDidChangeContent((e=>{o.push(e)})),s=new StopWatch(!1);i.then((e=>{if(this._debounceInformation.update(this._model,s.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),e){const{provider:t,tokens:n}=e,i=this._semanticStyling.get(t);this._setDocumentSemanticTokens(t,n||null,i,o)}else this._setDocumentSemanticTokens(null,null,null,o)}),(e=>{e&&(isCancellationError(e)||"string"==typeof e.message&&-1!==e.message.indexOf("busy"))||onUnexpectedError(e),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),o.length>0&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))}))}static _copy(e,t,n,i,o){for(let r=0;r<o;r++)n[i+r]=e[t+r]}_setDocumentSemanticTokens(t,n,i,o){const r=this._currentDocumentResponse,s=()=>{o.length>0&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed)t&&n&&t.releaseDocumentSemanticTokens(n.resultId);else if(t&&i){if(!n)return this._model.setSemanticTokens(null,!0),void s();if(isSemanticTokensEdits(n)){if(!r)return void this._model.setSemanticTokens(null,!0);if(0===n.edits.length)n={resultId:n.resultId,data:r.data};else{let t=0;for(const e of n.edits)t+=(e.data?e.data.length:0)-e.deleteCount;const i=r.data,o=new Uint32Array(i.length+t);let s=i.length,a=o.length;for(let r=n.edits.length-1;r>=0;r--){const t=n.edits[r],l=s-(t.start+t.deleteCount);l>0&&(e._copy(i,s-l,o,a-l,l),a-=l),t.data&&(e._copy(t.data,0,o,a-t.data.length,t.data.length),a-=t.data.length),s=t.start}s>0&&e._copy(i,0,o,0,s),n={resultId:n.resultId,data:o}}}if(isSemanticTokens(n)){this._currentDocumentResponse=new SemanticTokensResponse(t,n.resultId,n.data);const e=toMultilineTokens2(n,i,this._model.getLanguageId());if(o.length>0)for(const t of o)for(const n of e)for(const e of t.changes)n.applyEdit(e.range,e.text);this._model.setSemanticTokens(e,!0)}else this._model.setSemanticTokens(null,!0);s()}else this._model.setSemanticTokens(null,!1)}};ModelSemanticColoring.REQUEST_MIN_DELAY=300,ModelSemanticColoring.REQUEST_MAX_DELAY=2e3,ModelSemanticColoring=__decorate$m([__param$l(2,IThemeService),__param$l(3,ILanguageFeatureDebounceService),__param$l(4,ILanguageFeaturesService)],ModelSemanticColoring);var __decorate$l=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$k=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let ViewportSemanticTokensContribution=class extends Disposable{constructor(e,t,n,i,o,r){super(),this._modelService=t,this._themeService=n,this._configurationService=i,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new RunOnceScheduler((()=>this._tokenizeViewportNow()),100)),this._outstandingRequests=[];const s=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange((()=>{s()}))),this._register(this._editor.onDidChangeModel((()=>{this._cancelAll(),s()}))),this._register(this._editor.onDidChangeModelContent((e=>{this._cancelAll(),s()}))),this._register(this._provider.onDidChange((()=>{this._cancelAll(),s()}))),this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(SEMANTIC_HIGHLIGHTING_SETTING_ID)&&(this._cancelAll(),s())}))),this._register(this._themeService.onDidColorThemeChange((()=>{this._cancelAll(),s()})))}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,n=this._outstandingRequests.length;t<n;t++)if(this._outstandingRequests[t]===e)return void this._outstandingRequests.splice(t,1)}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.hasCompleteSemanticTokens())return;if(!isSemanticColoringEnabled(e,this._themeService,this._configurationService))return void(e.hasSomeSemanticTokens()&&e.setSemanticTokens(null,!1));if(!hasDocumentRangeSemanticTokensProvider(this._provider,e))return void(e.hasSomeSemanticTokens()&&e.setSemanticTokens(null,!1));const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map((t=>this._requestRange(e,t))))}_requestRange(e,t){const n=e.getVersionId(),i=createCancelablePromise((n=>Promise.resolve(getDocumentRangeSemanticTokens(this._provider,e,t,n)))),o=new StopWatch(!1);return i.then((i=>{if(this._debounceInformation.update(e,o.elapsed()),!i||!i.tokens||e.isDisposed()||e.getVersionId()!==n)return;const{provider:r,tokens:s}=i,a=this._modelService.getSemanticTokensProviderStyling(r);e.setPartialSemanticTokens(t,toMultilineTokens2(s,a,e.getLanguageId()))})).then((()=>this._removeOutstandingRequest(i)),(()=>this._removeOutstandingRequest(i))),i}};ViewportSemanticTokensContribution.ID="editor.contrib.viewportSemanticTokens",ViewportSemanticTokensContribution=__decorate$l([__param$k(1,IModelService),__param$k(2,IThemeService),__param$k(3,IConfigurationService),__param$k(4,ILanguageFeatureDebounceService),__param$k(5,ILanguageFeaturesService)],ViewportSemanticTokensContribution),registerEditorContribution(ViewportSemanticTokensContribution.ID,ViewportSemanticTokensContribution);var __decorate$k=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$j=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const editorWordHighlight=registerColor("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hc:null},localize("wordHighlight","Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0),editorWordHighlightStrong=registerColor("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hc:null},localize("wordHighlightStrong","Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0),editorWordHighlightBorder=registerColor("editor.wordHighlightBorder",{light:null,dark:null,hc:activeContrastBorder},localize("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable.")),editorWordHighlightStrongBorder=registerColor("editor.wordHighlightStrongBorder",{light:null,dark:null,hc:activeContrastBorder},localize("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable.")),overviewRulerWordHighlightForeground=registerColor("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},localize("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),overviewRulerWordHighlightStrongForeground=registerColor("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hc:"#C0A0C0CC"},localize("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),ctxHasWordHighlights=new RawContextKey("hasWordHighlights",!1);function getOccurrencesAtPosition(e,t,n,i){return first(e.ordered(t).map((e=>()=>Promise.resolve(e.provideDocumentHighlights(t,n,i)).then(void 0,onUnexpectedExternalError))),isNonEmptyArray)}class OccurenceAtPositionRequest{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=createCancelablePromise((e=>this._compute(this._model,this._selection,this._wordSeparators,e)))),this._result}_getCurrentWordRange(e,t){const n=e.getWordAtPosition(t.getPosition());return n?new Range$2(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}isValid(e,t,n){const i=t.startLineNumber,o=t.startColumn,r=t.endColumn,s=this._getCurrentWordRange(e,t);let a=Boolean(this._wordRange&&this._wordRange.equalsRange(s));for(let l=0,c=n.length;!a&&l<c;l++){let t=e.getDecorationRange(n[l]);t&&t.startLineNumber===i&&t.startColumn<=o&&t.endColumn>=r&&(a=!0)}return a}cancel(){this.result.cancel()}}class SemanticOccurenceAtPositionRequest extends OccurenceAtPositionRequest{constructor(e,t,n,i){super(e,t,n),this._providers=i}_compute(e,t,n,i){return getOccurrencesAtPosition(this._providers,e,t.getPosition(),i).then((e=>e||[]))}}class TextualOccurenceAtPositionRequest extends OccurenceAtPositionRequest{constructor(e,t,n){super(e,t,n),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,n,i){return timeout(250,i).then((()=>{if(!t.isEmpty())return[];const i=e.getWordAtPosition(t.getPosition());if(!i||i.word.length>1e3)return[];return e.findMatches(i.word,!0,!1,!0,n,!1).map((e=>({range:e.range,kind:DocumentHighlightKind$1.Text})))}))}isValid(e,t,n){const i=t.isEmpty();return this._selectionIsEmpty===i&&super.isValid(e,t,n)}}function computeOccurencesAtPosition(e,t,n,i){return e.has(t)?new SemanticOccurenceAtPositionRequest(t,n,i,e):new TextualOccurenceAtPositionRequest(t,n,i)}registerModelAndPositionCommand("_executeDocumentHighlights",((e,t,n)=>getOccurrencesAtPosition(e.get(ILanguageFeaturesService).documentHighlightProvider,t,n,CancellationToken.None)));class WordHighlighter{constructor(e,t,n){this.toUnhook=new DisposableStore,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=[],this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this._hasWordHighlights=ctxHasWordHighlights.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(72),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition((e=>{this._ignorePositionChangeEvent||this.occurrencesHighlight&&this._onPositionChanged(e)}))),this.toUnhook.add(e.onDidChangeModelContent((e=>{this._stopAll()}))),this.toUnhook.add(e.onDidChangeConfiguration((e=>{let t=this.editor.getOption(72);this.occurrencesHighlight!==t&&(this.occurrencesHighlight=t,this._stopAll())}))),this._decorationIds=[],this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}hasDecorations(){return this._decorationIds.length>0}restore(){this.occurrencesHighlight&&this._run()}_getSortedHighlights(){return coalesce(this._decorationIds.map((e=>this.model.getDecorationRange(e))).sort(Range$2.compareRangesUsingStarts))}moveNext(){let e=this._getSortedHighlights(),t=(e.findIndex((e=>e.containsPosition(this.editor.getPosition())))+1)%e.length,n=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const i=this._getWord();if(i){alert(`${this.editor.getModel().getLineContent(n.startLineNumber)}, ${t+1} of ${e.length} for '${i.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){let e=this._getSortedHighlights(),t=(e.findIndex((e=>e.containsPosition(this.editor.getPosition())))-1+e.length)%e.length,n=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const i=this._getWord();if(i){alert(`${this.editor.getModel().getLineContent(n.startLineNumber)}, ${t+1} of ${e.length} for '${i.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeDecorations(){this._decorationIds.length>0&&(this._decorationIds=this.editor.deltaDecorations(this._decorationIds,[]),this._hasWordHighlights.set(!1))}_stopAll(){this._removeDecorations(),-1!==this.renderDecorationsTimer&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),null!==this.workerRequest&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){this.occurrencesHighlight&&3===e.reason?this._run():this._stopAll()}_getWord(){let e=this.editor.getSelection(),t=e.startLineNumber,n=e.startColumn;return this.model.getWordAtPosition({lineNumber:t,column:n})}_run(){let e=this.editor.getSelection();if(e.startLineNumber!==e.endLineNumber)return void this._stopAll();let t=e.startColumn,n=e.endColumn;const i=this._getWord();if(!i||i.startColumn>t||i.endColumn<n)return void this._stopAll();const o=this.workerRequest&&this.workerRequest.isValid(this.model,e,this._decorationIds);if(this.lastCursorPositionChangeTime=(new Date).getTime(),o)this.workerRequestCompleted&&-1!==this.renderDecorationsTimer&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else{this._stopAll();let e=++this.workerRequestTokenId;this.workerRequestCompleted=!1,this.workerRequest=computeOccurencesAtPosition(this.providers,this.model,this.editor.getSelection(),this.editor.getOption(117)),this.workerRequest.result.then((t=>{e===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=t||[],this._beginRenderDecorations())}),onUnexpectedError)}}_beginRenderDecorations(){let e=(new Date).getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout((()=>{this.renderDecorations()}),t-e)}renderDecorations(){this.renderDecorationsTimer=-1;let e=[];for(const t of this.workerRequestValue)t.range&&e.push({range:t.range,options:WordHighlighter._getDecorationOptions(t.kind)});this._decorationIds=this.editor.deltaDecorations(this._decorationIds,e),this._hasWordHighlights.set(this.hasDecorations())}static _getDecorationOptions(e){return e===DocumentHighlightKind$1.Write?this._WRITE_OPTIONS:e===DocumentHighlightKind$1.Text?this._TEXT_OPTIONS:this._REGULAR_OPTIONS}dispose(){this._stopAll(),this.toUnhook.dispose()}}WordHighlighter._WRITE_OPTIONS=ModelDecorationOptions.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:themeColorFromId(overviewRulerWordHighlightStrongForeground),position:OverviewRulerLane$1.Center},minimap:{color:themeColorFromId(minimapSelectionOccurrenceHighlight),position:MinimapPosition$1.Inline}}),WordHighlighter._TEXT_OPTIONS=ModelDecorationOptions.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight",overviewRuler:{color:themeColorFromId(overviewRulerSelectionHighlightForeground),position:OverviewRulerLane$1.Center},minimap:{color:themeColorFromId(minimapSelectionOccurrenceHighlight),position:MinimapPosition$1.Inline}}),WordHighlighter._REGULAR_OPTIONS=ModelDecorationOptions.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:themeColorFromId(overviewRulerWordHighlightForeground),position:OverviewRulerLane$1.Center},minimap:{color:themeColorFromId(minimapSelectionOccurrenceHighlight),position:MinimapPosition$1.Inline}});let WordHighlighterContribution=class e extends Disposable{constructor(e,t,n){super(),this.wordHighlighter=null;const i=()=>{e.hasModel()&&(this.wordHighlighter=new WordHighlighter(e,n.documentHighlightProvider,t))};this._register(e.onDidChangeModel((e=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),i()}))),i()}static get(t){return t.getContribution(e.ID)}saveViewState(){return!(!this.wordHighlighter||!this.wordHighlighter.hasDecorations())}moveNext(){this.wordHighlighter&&this.wordHighlighter.moveNext()}moveBack(){this.wordHighlighter&&this.wordHighlighter.moveBack()}restoreViewState(e){this.wordHighlighter&&e&&this.wordHighlighter.restore()}dispose(){this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),super.dispose()}};WordHighlighterContribution.ID="editor.contrib.wordHighlighter",WordHighlighterContribution=__decorate$k([__param$j(1,IContextKeyService),__param$j(2,ILanguageFeaturesService)],WordHighlighterContribution);class WordHighlightNavigationAction extends EditorAction{constructor(e,t){super(t),this._isNext=e}run(e,t){const n=WordHighlighterContribution.get(t);n&&(this._isNext?n.moveNext():n.moveBack())}}class NextWordHighlightAction extends WordHighlightNavigationAction{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:localize("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:ctxHasWordHighlights,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:65,weight:100}})}}class PrevWordHighlightAction extends WordHighlightNavigationAction{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:localize("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:ctxHasWordHighlights,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:1089,weight:100}})}}class TriggerWordHighlightAction extends EditorAction{constructor(){super({id:"editor.action.wordHighlight.trigger",label:localize("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:ctxHasWordHighlights.toNegated(),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:0,weight:100}})}run(e,t,n){const i=WordHighlighterContribution.get(t);i&&i.restoreViewState(!0)}}registerEditorContribution(WordHighlighterContribution.ID,WordHighlighterContribution),registerEditorAction(NextWordHighlightAction),registerEditorAction(PrevWordHighlightAction),registerEditorAction(TriggerWordHighlightAction),registerThemingParticipant(((e,t)=>{const n=e.getColor(editorSelectionHighlight);n&&(t.addRule(`.monaco-editor .focused .selectionHighlight { background-color: ${n}; }`),t.addRule(`.monaco-editor .selectionHighlight { background-color: ${n.transparent(.5)}; }`));const i=e.getColor(editorWordHighlight);i&&t.addRule(`.monaco-editor .wordHighlight { background-color: ${i}; }`);const o=e.getColor(editorWordHighlightStrong);o&&t.addRule(`.monaco-editor .wordHighlightStrong { background-color: ${o}; }`);const r=e.getColor(editorSelectionHighlightBorder);r&&t.addRule(`.monaco-editor .selectionHighlight { border: 1px ${"hc"===e.type?"dotted":"solid"} ${r}; box-sizing: border-box; }`);const s=e.getColor(editorWordHighlightBorder);s&&t.addRule(`.monaco-editor .wordHighlight { border: 1px ${"hc"===e.type?"dashed":"solid"} ${s}; box-sizing: border-box; }`);const a=e.getColor(editorWordHighlightStrongBorder);a&&t.addRule(`.monaco-editor .wordHighlightStrong { border: 1px ${"hc"===e.type?"dashed":"solid"} ${a}; box-sizing: border-box; }`)}));class MoveWordCommand extends EditorCommand{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;const i=getMapForWordSeparators(t.getOption(117)),o=t.getModel(),r=t.getSelections().map((e=>{const t=new Position$1(e.positionLineNumber,e.positionColumn),n=this._move(i,o,t,this._wordNavigationType);return this._moveTo(e,n,this._inSelectionMode)}));if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,r.map((e=>CursorState$1.fromModelSelection(e)))),1===r.length){const e=new Position$1(r[0].positionLineNumber,r[0].positionColumn);t.revealPosition(e,0)}}_moveTo(e,t,n){return n?new Selection$1(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new Selection$1(t.lineNumber,t.column,t.lineNumber,t.column)}}class WordLeftCommand extends MoveWordCommand{_move(e,t,n,i){return WordOperations.moveWordLeft(e,t,n,i)}}class WordRightCommand extends MoveWordCommand{_move(e,t,n,i){return WordOperations.moveWordRight(e,t,n,i)}}class CursorWordStartLeft extends WordLeftCommand{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class CursorWordEndLeft extends WordLeftCommand{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class CursorWordLeft extends WordLeftCommand{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:ContextKeyExpr.and(EditorContextKeys.textInputFocus,null===(e=ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED,IsWindowsContext))||void 0===e?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class CursorWordStartLeftSelect extends WordLeftCommand{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class CursorWordEndLeftSelect extends WordLeftCommand{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class CursorWordLeftSelect extends WordLeftCommand{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:ContextKeyExpr.and(EditorContextKeys.textInputFocus,null===(e=ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED,IsWindowsContext))||void 0===e?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class CursorWordAccessibilityLeft extends WordLeftCommand{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,n,i){return super._move(getMapForWordSeparators(EditorOptions.wordSeparators.defaultValue),t,n,i)}}class CursorWordAccessibilityLeftSelect extends WordLeftCommand{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,n,i){return super._move(getMapForWordSeparators(EditorOptions.wordSeparators.defaultValue),t,n,i)}}class CursorWordStartRight extends WordRightCommand{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class CursorWordEndRight extends WordRightCommand{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:ContextKeyExpr.and(EditorContextKeys.textInputFocus,null===(e=ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED,IsWindowsContext))||void 0===e?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class CursorWordRight extends WordRightCommand{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class CursorWordStartRightSelect extends WordRightCommand{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class CursorWordEndRightSelect extends WordRightCommand{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:ContextKeyExpr.and(EditorContextKeys.textInputFocus,null===(e=ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED,IsWindowsContext))||void 0===e?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class CursorWordRightSelect extends WordRightCommand{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class CursorWordAccessibilityRight extends WordRightCommand{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,n,i){return super._move(getMapForWordSeparators(EditorOptions.wordSeparators.defaultValue),t,n,i)}}class CursorWordAccessibilityRightSelect extends WordRightCommand{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,n,i){return super._move(getMapForWordSeparators(EditorOptions.wordSeparators.defaultValue),t,n,i)}}class DeleteWordCommand extends EditorCommand{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){const i=e.get(ILanguageConfigurationService);if(!t.hasModel())return;const o=getMapForWordSeparators(t.getOption(117)),r=t.getModel(),s=t.getSelections(),a=t.getOption(5),l=t.getOption(8),c=i.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),d=t._getViewModel(),u=s.map((e=>{const n=this._delete({wordSeparators:o,model:r,selection:e,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(6),autoClosingBrackets:a,autoClosingQuotes:l,autoClosingPairs:c,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new ReplaceCommand(n,"")}));t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class DeleteWordLeftCommand extends DeleteWordCommand{_delete(e,t){let n=WordOperations.deleteWordLeft(e,t);return n||new Range$2(1,1,1,1)}}class DeleteWordRightCommand extends DeleteWordCommand{_delete(e,t){let n=WordOperations.deleteWordRight(e,t);if(n)return n;const i=e.model.getLineCount(),o=e.model.getLineMaxColumn(i);return new Range$2(i,o,i,o)}}class DeleteWordStartLeft extends DeleteWordLeftCommand{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:EditorContextKeys.writable})}}class DeleteWordEndLeft extends DeleteWordLeftCommand{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:EditorContextKeys.writable})}}class DeleteWordLeft extends DeleteWordLeftCommand{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class DeleteWordStartRight extends DeleteWordRightCommand{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:EditorContextKeys.writable})}}class DeleteWordEndRight extends DeleteWordRightCommand{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:EditorContextKeys.writable})}}class DeleteWordRight extends DeleteWordRightCommand{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class DeleteInsideWord extends EditorAction{constructor(){super({id:"deleteInsideWord",precondition:EditorContextKeys.writable,label:localize("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,n){if(!t.hasModel())return;const i=getMapForWordSeparators(t.getOption(117)),o=t.getModel(),r=t.getSelections().map((e=>{const t=WordOperations.deleteInsideWord(i,o,e);return new ReplaceCommand(t,"")}));t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}registerEditorCommand(new CursorWordStartLeft),registerEditorCommand(new CursorWordEndLeft),registerEditorCommand(new CursorWordLeft),registerEditorCommand(new CursorWordStartLeftSelect),registerEditorCommand(new CursorWordEndLeftSelect),registerEditorCommand(new CursorWordLeftSelect),registerEditorCommand(new CursorWordStartRight),registerEditorCommand(new CursorWordEndRight),registerEditorCommand(new CursorWordRight),registerEditorCommand(new CursorWordStartRightSelect),registerEditorCommand(new CursorWordEndRightSelect),registerEditorCommand(new CursorWordRightSelect),registerEditorCommand(new CursorWordAccessibilityLeft),registerEditorCommand(new CursorWordAccessibilityLeftSelect),registerEditorCommand(new CursorWordAccessibilityRight),registerEditorCommand(new CursorWordAccessibilityRightSelect),registerEditorCommand(new DeleteWordStartLeft),registerEditorCommand(new DeleteWordEndLeft),registerEditorCommand(new DeleteWordLeft),registerEditorCommand(new DeleteWordStartRight),registerEditorCommand(new DeleteWordEndRight),registerEditorCommand(new DeleteWordRight),registerEditorAction(DeleteInsideWord);class DeleteWordPartLeft extends DeleteWordCommand{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){let n=WordPartOperations.deleteWordPartLeft(e);return n||new Range$2(1,1,1,1)}}class DeleteWordPartRight extends DeleteWordCommand{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){let n=WordPartOperations.deleteWordPartRight(e);if(n)return n;const i=e.model.getLineCount(),o=e.model.getLineMaxColumn(i);return new Range$2(i,o,i,o)}}class WordPartLeftCommand extends MoveWordCommand{_move(e,t,n,i){return WordPartOperations.moveWordPartLeft(e,t,n)}}class CursorWordPartLeft extends WordPartLeftCommand{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}CommandsRegistry.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class CursorWordPartLeftSelect extends WordPartLeftCommand{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}CommandsRegistry.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class WordPartRightCommand extends MoveWordCommand{_move(e,t,n,i){return WordPartOperations.moveWordPartRight(e,t,n)}}class CursorWordPartRight extends WordPartRightCommand{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class CursorWordPartRightSelect extends WordPartRightCommand{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}var AccessibilityHelpNLS,AccessibilityHelpNLS2,InspectTokensNLS,GoToLineNLS,QuickHelpNLS,QuickCommandNLS,QuickCommandNLS2,QuickOutlineNLS,QuickOutlineNLS2,StandaloneCodeEditorNLS,StandaloneCodeEditorNLS2,ToggleHighContrastNLS,StandaloneServicesNLS;registerEditorCommand(new DeleteWordPartLeft),registerEditorCommand(new DeleteWordPartRight),registerEditorCommand(new CursorWordPartLeft),registerEditorCommand(new CursorWordPartLeftSelect),registerEditorCommand(new CursorWordPartRight),registerEditorCommand(new CursorWordPartRightSelect),AccessibilityHelpNLS2=AccessibilityHelpNLS||(AccessibilityHelpNLS={}),AccessibilityHelpNLS2.noSelection=localize("noSelection","No selection"),AccessibilityHelpNLS2.singleSelectionRange=localize("singleSelectionRange","Line {0}, Column {1} ({2} selected)"),AccessibilityHelpNLS2.singleSelection=localize("singleSelection","Line {0}, Column {1}"),AccessibilityHelpNLS2.multiSelectionRange=localize("multiSelectionRange","{0} selections ({1} characters selected)"),AccessibilityHelpNLS2.multiSelection=localize("multiSelection","{0} selections"),AccessibilityHelpNLS2.emergencyConfOn=localize("emergencyConfOn","Now changing the setting `accessibilitySupport` to 'on'."),AccessibilityHelpNLS2.openingDocs=localize("openingDocs","Now opening the Editor Accessibility documentation page."),AccessibilityHelpNLS2.readonlyDiffEditor=localize("readonlyDiffEditor"," in a read-only pane of a diff editor."),AccessibilityHelpNLS2.editableDiffEditor=localize("editableDiffEditor"," in a pane of a diff editor."),AccessibilityHelpNLS2.readonlyEditor=localize("readonlyEditor"," in a read-only code editor"),AccessibilityHelpNLS2.editableEditor=localize("editableEditor"," in a code editor"),AccessibilityHelpNLS2.changeConfigToOnMac=localize("changeConfigToOnMac","To configure the editor to be optimized for usage with a Screen Reader press Command+E now."),AccessibilityHelpNLS2.changeConfigToOnWinLinux=localize("changeConfigToOnWinLinux","To configure the editor to be optimized for usage with a Screen Reader press Control+E now."),AccessibilityHelpNLS2.auto_on=localize("auto_on","The editor is configured to be optimized for usage with a Screen Reader."),AccessibilityHelpNLS2.auto_off=localize("auto_off","The editor is configured to never be optimized for usage with a Screen Reader, which is not the case at this time."),AccessibilityHelpNLS2.tabFocusModeOnMsg=localize("tabFocusModeOnMsg","Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}."),AccessibilityHelpNLS2.tabFocusModeOnMsgNoKb=localize("tabFocusModeOnMsgNoKb","Pressing Tab in the current editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding."),AccessibilityHelpNLS2.tabFocusModeOffMsg=localize("tabFocusModeOffMsg","Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}."),AccessibilityHelpNLS2.tabFocusModeOffMsgNoKb=localize("tabFocusModeOffMsgNoKb","Pressing Tab in the current editor will insert the tab character. The command {0} is currently not triggerable by a keybinding."),AccessibilityHelpNLS2.openDocMac=localize("openDocMac","Press Command+H now to open a browser window with more information related to editor accessibility."),AccessibilityHelpNLS2.openDocWinLinux=localize("openDocWinLinux","Press Control+H now to open a browser window with more information related to editor accessibility."),AccessibilityHelpNLS2.outroMsg=localize("outroMsg","You can dismiss this tooltip and return to the editor by pressing Escape or Shift+Escape."),AccessibilityHelpNLS2.showAccessibilityHelpAction=localize("showAccessibilityHelpAction","Show Accessibility Help"),(InspectTokensNLS||(InspectTokensNLS={})).inspectTokensAction=localize("inspectTokens","Developer: Inspect Tokens"),(GoToLineNLS||(GoToLineNLS={})).gotoLineActionLabel=localize("gotoLineActionLabel","Go to Line/Column..."),(QuickHelpNLS||(QuickHelpNLS={})).helpQuickAccessActionLabel=localize("helpQuickAccess","Show all Quick Access Providers"),QuickCommandNLS2=QuickCommandNLS||(QuickCommandNLS={}),QuickCommandNLS2.quickCommandActionLabel=localize("quickCommandActionLabel","Command Palette"),QuickCommandNLS2.quickCommandHelp=localize("quickCommandActionHelp","Show And Run Commands"),QuickOutlineNLS2=QuickOutlineNLS||(QuickOutlineNLS={}),QuickOutlineNLS2.quickOutlineActionLabel=localize("quickOutlineActionLabel","Go to Symbol..."),QuickOutlineNLS2.quickOutlineByCategoryActionLabel=localize("quickOutlineByCategoryActionLabel","Go to Symbol by Category..."),StandaloneCodeEditorNLS2=StandaloneCodeEditorNLS||(StandaloneCodeEditorNLS={}),StandaloneCodeEditorNLS2.editorViewAccessibleLabel=localize("editorViewAccessibleLabel","Editor content"),StandaloneCodeEditorNLS2.accessibilityHelpMessage=localize("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options."),(ToggleHighContrastNLS||(ToggleHighContrastNLS={})).toggleHighContrast=localize("toggleHighContrast","Toggle High Contrast Theme"),(StandaloneServicesNLS||(StandaloneServicesNLS={})).bulkEditServiceSummary=localize("bulkEditServiceSummary","Made {0} edits in {1} files");var accessibilityHelp="",__decorate$j=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$i=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE=new RawContextKey("accessibilityHelpWidgetVisible",!1);let AccessibilityHelpController=class e extends Disposable{constructor(e,t){super(),this._editor=e,this._widget=this._register(t.createInstance(AccessibilityHelpWidget,this._editor))}static get(t){return t.getContribution(e.ID)}show(){this._widget.show()}hide(){this._widget.hide()}};function getSelectionLabel(e,t){return e&&0!==e.length?1===e.length?t?format(AccessibilityHelpNLS.singleSelectionRange,e[0].positionLineNumber,e[0].positionColumn,t):format(AccessibilityHelpNLS.singleSelection,e[0].positionLineNumber,e[0].positionColumn):t?format(AccessibilityHelpNLS.multiSelectionRange,e.length,t):e.length>0?format(AccessibilityHelpNLS.multiSelection,e.length):"":AccessibilityHelpNLS.noSelection}AccessibilityHelpController.ID="editor.contrib.accessibilityHelpController",AccessibilityHelpController=__decorate$j([__param$i(1,IInstantiationService)],AccessibilityHelpController);let AccessibilityHelpWidget=class e extends Widget{constructor(e,t,n,i){super(),this._contextKeyService=t,this._keybindingService=n,this._openerService=i,this._editor=e,this._isVisibleKey=CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE.bindTo(this._contextKeyService),this._domNode=createFastDomNode(document.createElement("div")),this._domNode.setClassName("accessibilityHelpWidget"),this._domNode.setDisplay("none"),this._domNode.setAttribute("role","dialog"),this._domNode.setAttribute("aria-hidden","true"),this._contentDomNode=createFastDomNode(document.createElement("div")),this._contentDomNode.setAttribute("role","document"),this._domNode.appendChild(this._contentDomNode),this._isVisible=!1,this._register(this._editor.onDidLayoutChange((()=>{this._isVisible&&this._layout()}))),this._register(addStandardDisposableListener(this._contentDomNode.domNode,"keydown",(e=>{if(this._isVisible&&(e.equals(2083)&&(alert(AccessibilityHelpNLS.emergencyConfOn),this._editor.updateOptions({accessibilitySupport:"on"}),clearNode(this._contentDomNode.domNode),this._buildContent(),this._contentDomNode.domNode.focus(),e.preventDefault(),e.stopPropagation()),e.equals(2086))){alert(AccessibilityHelpNLS.openingDocs);let t=this._editor.getRawOptions().accessibilityHelpUrl;void 0===t&&(t="https://go.microsoft.com/fwlink/?linkid=852450"),this._openerService.open(URI.parse(t)),e.preventDefault(),e.stopPropagation()}}))),this.onblur(this._contentDomNode.domNode,(()=>{this.hide()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return e.ID}getDomNode(){return this._domNode.domNode}getPosition(){return{preference:null}}show(){this._isVisible||(this._isVisible=!0,this._isVisibleKey.set(!0),this._layout(),this._domNode.setDisplay("block"),this._domNode.setAttribute("aria-hidden","false"),this._contentDomNode.domNode.tabIndex=0,this._buildContent(),this._contentDomNode.domNode.focus())}_descriptionForCommand(e,t,n){const i=this._keybindingService.lookupKeybinding(e);return i?format(t,i.getAriaLabel()):format(n,e)}_buildContent(){const e=this._editor.getOptions(),t=this._editor.getSelections();let n=0;if(t){const e=this._editor.getModel();e&&t.forEach((t=>{n+=e.getValueLengthInRange(t)}))}let i=getSelectionLabel(t,n);e.get(54)?e.get(81)?i+=AccessibilityHelpNLS.readonlyDiffEditor:i+=AccessibilityHelpNLS.editableDiffEditor:e.get(81)?i+=AccessibilityHelpNLS.readonlyEditor:i+=AccessibilityHelpNLS.editableEditor;const o=isMacintosh?AccessibilityHelpNLS.changeConfigToOnMac:AccessibilityHelpNLS.changeConfigToOnWinLinux;switch(e.get(2)){case 0:i+="\n\n - "+o;break;case 2:i+="\n\n - "+AccessibilityHelpNLS.auto_on;break;case 1:i+="\n\n - "+AccessibilityHelpNLS.auto_off,i+=" "+o}e.get(130)?i+="\n\n - "+this._descriptionForCommand(ToggleTabFocusModeAction.ID,AccessibilityHelpNLS.tabFocusModeOnMsg,AccessibilityHelpNLS.tabFocusModeOnMsgNoKb):i+="\n\n - "+this._descriptionForCommand(ToggleTabFocusModeAction.ID,AccessibilityHelpNLS.tabFocusModeOffMsg,AccessibilityHelpNLS.tabFocusModeOffMsgNoKb);i+="\n\n - "+(isMacintosh?AccessibilityHelpNLS.openDocMac:AccessibilityHelpNLS.openDocWinLinux),i+="\n\n"+AccessibilityHelpNLS.outroMsg,this._contentDomNode.domNode.appendChild(renderFormattedText(i)),this._contentDomNode.domNode.setAttribute("aria-label",i)}hide(){this._isVisible&&(this._isVisible=!1,this._isVisibleKey.reset(),this._domNode.setDisplay("none"),this._domNode.setAttribute("aria-hidden","true"),this._contentDomNode.domNode.tabIndex=-1,clearNode(this._contentDomNode.domNode),this._editor.focus())}_layout(){const t=this._editor.getLayoutInfo(),n=Math.max(5,Math.min(e.WIDTH,t.width-40)),i=Math.max(5,Math.min(e.HEIGHT,t.height-40));this._domNode.setWidth(n),this._domNode.setHeight(i);const o=Math.round((t.height-i)/2);this._domNode.setTop(o);const r=Math.round((t.width-n)/2);this._domNode.setLeft(r)}};AccessibilityHelpWidget.ID="editor.contrib.accessibilityHelpWidget",AccessibilityHelpWidget.WIDTH=500,AccessibilityHelpWidget.HEIGHT=300,AccessibilityHelpWidget=__decorate$j([__param$i(1,IContextKeyService),__param$i(2,IKeybindingService),__param$i(3,IOpenerService)],AccessibilityHelpWidget);class ShowAccessibilityHelpAction extends EditorAction{constructor(){super({id:"editor.action.showAccessibilityHelp",label:AccessibilityHelpNLS.showAccessibilityHelpAction,alias:"Show Accessibility Help",precondition:void 0,kbOpts:{primary:571,weight:100,linux:{primary:1595,secondary:[571]}}})}run(e,t){const n=AccessibilityHelpController.get(t);n&&n.show()}}registerEditorContribution(AccessibilityHelpController.ID,AccessibilityHelpController),registerEditorAction(ShowAccessibilityHelpAction);const AccessibilityHelpCommand=EditorCommand.bindToContribution(AccessibilityHelpController.get);var AccessibilitySupport,AccessibilitySupport2,CompletionItemInsertTextRule,CompletionItemInsertTextRule2,CompletionItemKind,CompletionItemKind2,CompletionItemTag,CompletionItemTag2,CompletionTriggerKind,CompletionTriggerKind2,ContentWidgetPositionPreference,ContentWidgetPositionPreference2,CursorChangeReason,CursorChangeReason2,DefaultEndOfLine,DefaultEndOfLine2,DocumentHighlightKind,EditorAutoIndentStrategy,EditorAutoIndentStrategy2,EditorOption,EditorOption2,EndOfLinePreference,EndOfLinePreference2,EndOfLineSequence,EndOfLineSequence2,IndentAction,InjectedTextCursorStops,InlayHintKind,InlineCompletionTriggerKind,KeyCode$1,KeyCode2,MarkerSeverity$1,MarkerTag$1,MarkerTag2,MinimapPosition,MouseTargetType,MouseTargetType2,OverlayWidgetPositionPreference,OverlayWidgetPositionPreference2,OverviewRulerLane,PositionAffinity,PositionAffinity2,RenderLineNumbersType,RenderLineNumbersType2,RenderMinimap,RenderMinimap2,ScrollType,ScrollType2,ScrollbarVisibility,ScrollbarVisibility2,SelectionDirection$1,SelectionDirection2,SignatureHelpTriggerKind,SymbolKind,SymbolKind2,SymbolTag,SymbolTag2,TextEditorCursorBlinkingStyle,TextEditorCursorBlinkingStyle2,TextEditorCursorStyle,TrackedRangeStickiness,TrackedRangeStickiness2,WrappingIndent,WrappingIndent2;registerEditorCommand(new AccessibilityHelpCommand({id:"closeAccessibilityHelp",precondition:CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE,handler:e=>e.hide(),kbOpts:{weight:200,kbExpr:EditorContextKeys.focus,primary:9,secondary:[1033]}})),registerThemingParticipant(((e,t)=>{const n=e.getColor(editorWidgetBackground);n&&t.addRule(`.monaco-editor .accessibilityHelpWidget { background-color: ${n}; }`);const i=e.getColor(editorWidgetForeground);i&&t.addRule(`.monaco-editor .accessibilityHelpWidget { color: ${i}; }`);const o=e.getColor(widgetShadow);o&&t.addRule(`.monaco-editor .accessibilityHelpWidget { box-shadow: 0 2px 8px ${o}; }`);const r=e.getColor(contrastBorder);r&&t.addRule(`.monaco-editor .accessibilityHelpWidget { border: 2px solid ${r}; }`)})),AccessibilitySupport2=AccessibilitySupport||(AccessibilitySupport={}),AccessibilitySupport2[AccessibilitySupport2.Unknown=0]="Unknown",AccessibilitySupport2[AccessibilitySupport2.Disabled=1]="Disabled",AccessibilitySupport2[AccessibilitySupport2.Enabled=2]="Enabled",CompletionItemInsertTextRule2=CompletionItemInsertTextRule||(CompletionItemInsertTextRule={}),CompletionItemInsertTextRule2[CompletionItemInsertTextRule2.KeepWhitespace=1]="KeepWhitespace",CompletionItemInsertTextRule2[CompletionItemInsertTextRule2.InsertAsSnippet=4]="InsertAsSnippet",CompletionItemKind2=CompletionItemKind||(CompletionItemKind={}),CompletionItemKind2[CompletionItemKind2.Method=0]="Method",CompletionItemKind2[CompletionItemKind2.Function=1]="Function",CompletionItemKind2[CompletionItemKind2.Constructor=2]="Constructor",CompletionItemKind2[CompletionItemKind2.Field=3]="Field",CompletionItemKind2[CompletionItemKind2.Variable=4]="Variable",CompletionItemKind2[CompletionItemKind2.Class=5]="Class",CompletionItemKind2[CompletionItemKind2.Struct=6]="Struct",CompletionItemKind2[CompletionItemKind2.Interface=7]="Interface",CompletionItemKind2[CompletionItemKind2.Module=8]="Module",CompletionItemKind2[CompletionItemKind2.Property=9]="Property",CompletionItemKind2[CompletionItemKind2.Event=10]="Event",CompletionItemKind2[CompletionItemKind2.Operator=11]="Operator",CompletionItemKind2[CompletionItemKind2.Unit=12]="Unit",CompletionItemKind2[CompletionItemKind2.Value=13]="Value",CompletionItemKind2[CompletionItemKind2.Constant=14]="Constant",CompletionItemKind2[CompletionItemKind2.Enum=15]="Enum",CompletionItemKind2[CompletionItemKind2.EnumMember=16]="EnumMember",CompletionItemKind2[CompletionItemKind2.Keyword=17]="Keyword",CompletionItemKind2[CompletionItemKind2.Text=18]="Text",CompletionItemKind2[CompletionItemKind2.Color=19]="Color",CompletionItemKind2[CompletionItemKind2.File=20]="File",CompletionItemKind2[CompletionItemKind2.Reference=21]="Reference",CompletionItemKind2[CompletionItemKind2.Customcolor=22]="Customcolor",CompletionItemKind2[CompletionItemKind2.Folder=23]="Folder",CompletionItemKind2[CompletionItemKind2.TypeParameter=24]="TypeParameter",CompletionItemKind2[CompletionItemKind2.User=25]="User",CompletionItemKind2[CompletionItemKind2.Issue=26]="Issue",CompletionItemKind2[CompletionItemKind2.Snippet=27]="Snippet",CompletionItemTag2=CompletionItemTag||(CompletionItemTag={}),CompletionItemTag2[CompletionItemTag2.Deprecated=1]="Deprecated",CompletionTriggerKind2=CompletionTriggerKind||(CompletionTriggerKind={}),CompletionTriggerKind2[CompletionTriggerKind2.Invoke=0]="Invoke",CompletionTriggerKind2[CompletionTriggerKind2.TriggerCharacter=1]="TriggerCharacter",CompletionTriggerKind2[CompletionTriggerKind2.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions",ContentWidgetPositionPreference2=ContentWidgetPositionPreference||(ContentWidgetPositionPreference={}),ContentWidgetPositionPreference2[ContentWidgetPositionPreference2.EXACT=0]="EXACT",ContentWidgetPositionPreference2[ContentWidgetPositionPreference2.ABOVE=1]="ABOVE",ContentWidgetPositionPreference2[ContentWidgetPositionPreference2.BELOW=2]="BELOW",CursorChangeReason2=CursorChangeReason||(CursorChangeReason={}),CursorChangeReason2[CursorChangeReason2.NotSet=0]="NotSet",CursorChangeReason2[CursorChangeReason2.ContentFlush=1]="ContentFlush",CursorChangeReason2[CursorChangeReason2.RecoverFromMarkers=2]="RecoverFromMarkers",CursorChangeReason2[CursorChangeReason2.Explicit=3]="Explicit",CursorChangeReason2[CursorChangeReason2.Paste=4]="Paste",CursorChangeReason2[CursorChangeReason2.Undo=5]="Undo",CursorChangeReason2[CursorChangeReason2.Redo=6]="Redo",DefaultEndOfLine2=DefaultEndOfLine||(DefaultEndOfLine={}),DefaultEndOfLine2[DefaultEndOfLine2.LF=1]="LF",DefaultEndOfLine2[DefaultEndOfLine2.CRLF=2]="CRLF",function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(DocumentHighlightKind||(DocumentHighlightKind={})),EditorAutoIndentStrategy2=EditorAutoIndentStrategy||(EditorAutoIndentStrategy={}),EditorAutoIndentStrategy2[EditorAutoIndentStrategy2.None=0]="None",EditorAutoIndentStrategy2[EditorAutoIndentStrategy2.Keep=1]="Keep",EditorAutoIndentStrategy2[EditorAutoIndentStrategy2.Brackets=2]="Brackets",EditorAutoIndentStrategy2[EditorAutoIndentStrategy2.Advanced=3]="Advanced",EditorAutoIndentStrategy2[EditorAutoIndentStrategy2.Full=4]="Full",EditorOption2=EditorOption||(EditorOption={}),EditorOption2[EditorOption2.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",EditorOption2[EditorOption2.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",EditorOption2[EditorOption2.accessibilitySupport=2]="accessibilitySupport",EditorOption2[EditorOption2.accessibilityPageSize=3]="accessibilityPageSize",EditorOption2[EditorOption2.ariaLabel=4]="ariaLabel",EditorOption2[EditorOption2.autoClosingBrackets=5]="autoClosingBrackets",EditorOption2[EditorOption2.autoClosingDelete=6]="autoClosingDelete",EditorOption2[EditorOption2.autoClosingOvertype=7]="autoClosingOvertype",EditorOption2[EditorOption2.autoClosingQuotes=8]="autoClosingQuotes",EditorOption2[EditorOption2.autoIndent=9]="autoIndent",EditorOption2[EditorOption2.automaticLayout=10]="automaticLayout",EditorOption2[EditorOption2.autoSurround=11]="autoSurround",EditorOption2[EditorOption2.bracketPairColorization=12]="bracketPairColorization",EditorOption2[EditorOption2.guides=13]="guides",EditorOption2[EditorOption2.codeLens=14]="codeLens",EditorOption2[EditorOption2.codeLensFontFamily=15]="codeLensFontFamily",EditorOption2[EditorOption2.codeLensFontSize=16]="codeLensFontSize",EditorOption2[EditorOption2.colorDecorators=17]="colorDecorators",EditorOption2[EditorOption2.columnSelection=18]="columnSelection",EditorOption2[EditorOption2.comments=19]="comments",EditorOption2[EditorOption2.contextmenu=20]="contextmenu",EditorOption2[EditorOption2.copyWithSyntaxHighlighting=21]="copyWithSyntaxHighlighting",EditorOption2[EditorOption2.cursorBlinking=22]="cursorBlinking",EditorOption2[EditorOption2.cursorSmoothCaretAnimation=23]="cursorSmoothCaretAnimation",EditorOption2[EditorOption2.cursorStyle=24]="cursorStyle",EditorOption2[EditorOption2.cursorSurroundingLines=25]="cursorSurroundingLines",EditorOption2[EditorOption2.cursorSurroundingLinesStyle=26]="cursorSurroundingLinesStyle",EditorOption2[EditorOption2.cursorWidth=27]="cursorWidth",EditorOption2[EditorOption2.disableLayerHinting=28]="disableLayerHinting",EditorOption2[EditorOption2.disableMonospaceOptimizations=29]="disableMonospaceOptimizations",EditorOption2[EditorOption2.domReadOnly=30]="domReadOnly",EditorOption2[EditorOption2.dragAndDrop=31]="dragAndDrop",EditorOption2[EditorOption2.emptySelectionClipboard=32]="emptySelectionClipboard",EditorOption2[EditorOption2.extraEditorClassName=33]="extraEditorClassName",EditorOption2[EditorOption2.fastScrollSensitivity=34]="fastScrollSensitivity",EditorOption2[EditorOption2.find=35]="find",EditorOption2[EditorOption2.fixedOverflowWidgets=36]="fixedOverflowWidgets",EditorOption2[EditorOption2.folding=37]="folding",EditorOption2[EditorOption2.foldingStrategy=38]="foldingStrategy",EditorOption2[EditorOption2.foldingHighlight=39]="foldingHighlight",EditorOption2[EditorOption2.foldingImportsByDefault=40]="foldingImportsByDefault",EditorOption2[EditorOption2.foldingMaximumRegions=41]="foldingMaximumRegions",EditorOption2[EditorOption2.unfoldOnClickAfterEndOfLine=42]="unfoldOnClickAfterEndOfLine",EditorOption2[EditorOption2.fontFamily=43]="fontFamily",EditorOption2[EditorOption2.fontInfo=44]="fontInfo",EditorOption2[EditorOption2.fontLigatures=45]="fontLigatures",EditorOption2[EditorOption2.fontSize=46]="fontSize",EditorOption2[EditorOption2.fontWeight=47]="fontWeight",EditorOption2[EditorOption2.formatOnPaste=48]="formatOnPaste",EditorOption2[EditorOption2.formatOnType=49]="formatOnType",EditorOption2[EditorOption2.glyphMargin=50]="glyphMargin",EditorOption2[EditorOption2.gotoLocation=51]="gotoLocation",EditorOption2[EditorOption2.hideCursorInOverviewRuler=52]="hideCursorInOverviewRuler",EditorOption2[EditorOption2.hover=53]="hover",EditorOption2[EditorOption2.inDiffEditor=54]="inDiffEditor",EditorOption2[EditorOption2.inlineSuggest=55]="inlineSuggest",EditorOption2[EditorOption2.letterSpacing=56]="letterSpacing",EditorOption2[EditorOption2.lightbulb=57]="lightbulb",EditorOption2[EditorOption2.lineDecorationsWidth=58]="lineDecorationsWidth",EditorOption2[EditorOption2.lineHeight=59]="lineHeight",EditorOption2[EditorOption2.lineNumbers=60]="lineNumbers",EditorOption2[EditorOption2.lineNumbersMinChars=61]="lineNumbersMinChars",EditorOption2[EditorOption2.linkedEditing=62]="linkedEditing",EditorOption2[EditorOption2.links=63]="links",EditorOption2[EditorOption2.matchBrackets=64]="matchBrackets",EditorOption2[EditorOption2.minimap=65]="minimap",EditorOption2[EditorOption2.mouseStyle=66]="mouseStyle",EditorOption2[EditorOption2.mouseWheelScrollSensitivity=67]="mouseWheelScrollSensitivity",EditorOption2[EditorOption2.mouseWheelZoom=68]="mouseWheelZoom",EditorOption2[EditorOption2.multiCursorMergeOverlapping=69]="multiCursorMergeOverlapping",EditorOption2[EditorOption2.multiCursorModifier=70]="multiCursorModifier",EditorOption2[EditorOption2.multiCursorPaste=71]="multiCursorPaste",EditorOption2[EditorOption2.occurrencesHighlight=72]="occurrencesHighlight",EditorOption2[EditorOption2.overviewRulerBorder=73]="overviewRulerBorder",EditorOption2[EditorOption2.overviewRulerLanes=74]="overviewRulerLanes",EditorOption2[EditorOption2.padding=75]="padding",EditorOption2[EditorOption2.parameterHints=76]="parameterHints",EditorOption2[EditorOption2.peekWidgetDefaultFocus=77]="peekWidgetDefaultFocus",EditorOption2[EditorOption2.definitionLinkOpensInPeek=78]="definitionLinkOpensInPeek",EditorOption2[EditorOption2.quickSuggestions=79]="quickSuggestions",EditorOption2[EditorOption2.quickSuggestionsDelay=80]="quickSuggestionsDelay",EditorOption2[EditorOption2.readOnly=81]="readOnly",EditorOption2[EditorOption2.renameOnType=82]="renameOnType",EditorOption2[EditorOption2.renderControlCharacters=83]="renderControlCharacters",EditorOption2[EditorOption2.renderFinalNewline=84]="renderFinalNewline",EditorOption2[EditorOption2.renderLineHighlight=85]="renderLineHighlight",EditorOption2[EditorOption2.renderLineHighlightOnlyWhenFocus=86]="renderLineHighlightOnlyWhenFocus",EditorOption2[EditorOption2.renderValidationDecorations=87]="renderValidationDecorations",EditorOption2[EditorOption2.renderWhitespace=88]="renderWhitespace",EditorOption2[EditorOption2.revealHorizontalRightPadding=89]="revealHorizontalRightPadding",EditorOption2[EditorOption2.roundedSelection=90]="roundedSelection",EditorOption2[EditorOption2.rulers=91]="rulers",EditorOption2[EditorOption2.scrollbar=92]="scrollbar",EditorOption2[EditorOption2.scrollBeyondLastColumn=93]="scrollBeyondLastColumn",EditorOption2[EditorOption2.scrollBeyondLastLine=94]="scrollBeyondLastLine",EditorOption2[EditorOption2.scrollPredominantAxis=95]="scrollPredominantAxis",EditorOption2[EditorOption2.selectionClipboard=96]="selectionClipboard",EditorOption2[EditorOption2.selectionHighlight=97]="selectionHighlight",EditorOption2[EditorOption2.selectOnLineNumbers=98]="selectOnLineNumbers",EditorOption2[EditorOption2.showFoldingControls=99]="showFoldingControls",EditorOption2[EditorOption2.showUnused=100]="showUnused",EditorOption2[EditorOption2.snippetSuggestions=101]="snippetSuggestions",EditorOption2[EditorOption2.smartSelect=102]="smartSelect",EditorOption2[EditorOption2.smoothScrolling=103]="smoothScrolling",EditorOption2[EditorOption2.stickyTabStops=104]="stickyTabStops",EditorOption2[EditorOption2.stopRenderingLineAfter=105]="stopRenderingLineAfter",EditorOption2[EditorOption2.suggest=106]="suggest",EditorOption2[EditorOption2.suggestFontSize=107]="suggestFontSize",EditorOption2[EditorOption2.suggestLineHeight=108]="suggestLineHeight",EditorOption2[EditorOption2.suggestOnTriggerCharacters=109]="suggestOnTriggerCharacters",EditorOption2[EditorOption2.suggestSelection=110]="suggestSelection",EditorOption2[EditorOption2.tabCompletion=111]="tabCompletion",EditorOption2[EditorOption2.tabIndex=112]="tabIndex",EditorOption2[EditorOption2.unicodeHighlighting=113]="unicodeHighlighting",EditorOption2[EditorOption2.unusualLineTerminators=114]="unusualLineTerminators",EditorOption2[EditorOption2.useShadowDOM=115]="useShadowDOM",EditorOption2[EditorOption2.useTabStops=116]="useTabStops",EditorOption2[EditorOption2.wordSeparators=117]="wordSeparators",EditorOption2[EditorOption2.wordWrap=118]="wordWrap",EditorOption2[EditorOption2.wordWrapBreakAfterCharacters=119]="wordWrapBreakAfterCharacters",EditorOption2[EditorOption2.wordWrapBreakBeforeCharacters=120]="wordWrapBreakBeforeCharacters",EditorOption2[EditorOption2.wordWrapColumn=121]="wordWrapColumn",EditorOption2[EditorOption2.wordWrapOverride1=122]="wordWrapOverride1",EditorOption2[EditorOption2.wordWrapOverride2=123]="wordWrapOverride2",EditorOption2[EditorOption2.wrappingIndent=124]="wrappingIndent",EditorOption2[EditorOption2.wrappingStrategy=125]="wrappingStrategy",EditorOption2[EditorOption2.showDeprecated=126]="showDeprecated",EditorOption2[EditorOption2.inlayHints=127]="inlayHints",EditorOption2[EditorOption2.editorClassName=128]="editorClassName",EditorOption2[EditorOption2.pixelRatio=129]="pixelRatio",EditorOption2[EditorOption2.tabFocusMode=130]="tabFocusMode",EditorOption2[EditorOption2.layoutInfo=131]="layoutInfo",EditorOption2[EditorOption2.wrappingInfo=132]="wrappingInfo",EndOfLinePreference2=EndOfLinePreference||(EndOfLinePreference={}),EndOfLinePreference2[EndOfLinePreference2.TextDefined=0]="TextDefined",EndOfLinePreference2[EndOfLinePreference2.LF=1]="LF",EndOfLinePreference2[EndOfLinePreference2.CRLF=2]="CRLF",EndOfLineSequence2=EndOfLineSequence||(EndOfLineSequence={}),EndOfLineSequence2[EndOfLineSequence2.LF=0]="LF",EndOfLineSequence2[EndOfLineSequence2.CRLF=1]="CRLF",function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(IndentAction||(IndentAction={})),function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"}(InjectedTextCursorStops||(InjectedTextCursorStops={})),function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(InlayHintKind||(InlayHintKind={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(InlineCompletionTriggerKind||(InlineCompletionTriggerKind={})),KeyCode2=KeyCode$1||(KeyCode$1={}),KeyCode2[KeyCode2.DependsOnKbLayout=-1]="DependsOnKbLayout",KeyCode2[KeyCode2.Unknown=0]="Unknown",KeyCode2[KeyCode2.Backspace=1]="Backspace",KeyCode2[KeyCode2.Tab=2]="Tab",KeyCode2[KeyCode2.Enter=3]="Enter",KeyCode2[KeyCode2.Shift=4]="Shift",KeyCode2[KeyCode2.Ctrl=5]="Ctrl",KeyCode2[KeyCode2.Alt=6]="Alt",KeyCode2[KeyCode2.PauseBreak=7]="PauseBreak",KeyCode2[KeyCode2.CapsLock=8]="CapsLock",KeyCode2[KeyCode2.Escape=9]="Escape",KeyCode2[KeyCode2.Space=10]="Space",KeyCode2[KeyCode2.PageUp=11]="PageUp",KeyCode2[KeyCode2.PageDown=12]="PageDown",KeyCode2[KeyCode2.End=13]="End",KeyCode2[KeyCode2.Home=14]="Home",KeyCode2[KeyCode2.LeftArrow=15]="LeftArrow",KeyCode2[KeyCode2.UpArrow=16]="UpArrow",KeyCode2[KeyCode2.RightArrow=17]="RightArrow",KeyCode2[KeyCode2.DownArrow=18]="DownArrow",KeyCode2[KeyCode2.Insert=19]="Insert",KeyCode2[KeyCode2.Delete=20]="Delete",KeyCode2[KeyCode2.Digit0=21]="Digit0",KeyCode2[KeyCode2.Digit1=22]="Digit1",KeyCode2[KeyCode2.Digit2=23]="Digit2",KeyCode2[KeyCode2.Digit3=24]="Digit3",KeyCode2[KeyCode2.Digit4=25]="Digit4",KeyCode2[KeyCode2.Digit5=26]="Digit5",KeyCode2[KeyCode2.Digit6=27]="Digit6",KeyCode2[KeyCode2.Digit7=28]="Digit7",KeyCode2[KeyCode2.Digit8=29]="Digit8",KeyCode2[KeyCode2.Digit9=30]="Digit9",KeyCode2[KeyCode2.KeyA=31]="KeyA",KeyCode2[KeyCode2.KeyB=32]="KeyB",KeyCode2[KeyCode2.KeyC=33]="KeyC",KeyCode2[KeyCode2.KeyD=34]="KeyD",KeyCode2[KeyCode2.KeyE=35]="KeyE",KeyCode2[KeyCode2.KeyF=36]="KeyF",KeyCode2[KeyCode2.KeyG=37]="KeyG",KeyCode2[KeyCode2.KeyH=38]="KeyH",KeyCode2[KeyCode2.KeyI=39]="KeyI",KeyCode2[KeyCode2.KeyJ=40]="KeyJ",KeyCode2[KeyCode2.KeyK=41]="KeyK",KeyCode2[KeyCode2.KeyL=42]="KeyL",KeyCode2[KeyCode2.KeyM=43]="KeyM",KeyCode2[KeyCode2.KeyN=44]="KeyN",KeyCode2[KeyCode2.KeyO=45]="KeyO",KeyCode2[KeyCode2.KeyP=46]="KeyP",KeyCode2[KeyCode2.KeyQ=47]="KeyQ",KeyCode2[KeyCode2.KeyR=48]="KeyR",KeyCode2[KeyCode2.KeyS=49]="KeyS",KeyCode2[KeyCode2.KeyT=50]="KeyT",KeyCode2[KeyCode2.KeyU=51]="KeyU",KeyCode2[KeyCode2.KeyV=52]="KeyV",KeyCode2[KeyCode2.KeyW=53]="KeyW",KeyCode2[KeyCode2.KeyX=54]="KeyX",KeyCode2[KeyCode2.KeyY=55]="KeyY",KeyCode2[KeyCode2.KeyZ=56]="KeyZ",KeyCode2[KeyCode2.Meta=57]="Meta",KeyCode2[KeyCode2.ContextMenu=58]="ContextMenu",KeyCode2[KeyCode2.F1=59]="F1",KeyCode2[KeyCode2.F2=60]="F2",KeyCode2[KeyCode2.F3=61]="F3",KeyCode2[KeyCode2.F4=62]="F4",KeyCode2[KeyCode2.F5=63]="F5",KeyCode2[KeyCode2.F6=64]="F6",KeyCode2[KeyCode2.F7=65]="F7",KeyCode2[KeyCode2.F8=66]="F8",KeyCode2[KeyCode2.F9=67]="F9",KeyCode2[KeyCode2.F10=68]="F10",KeyCode2[KeyCode2.F11=69]="F11",KeyCode2[KeyCode2.F12=70]="F12",KeyCode2[KeyCode2.F13=71]="F13",KeyCode2[KeyCode2.F14=72]="F14",KeyCode2[KeyCode2.F15=73]="F15",KeyCode2[KeyCode2.F16=74]="F16",KeyCode2[KeyCode2.F17=75]="F17",KeyCode2[KeyCode2.F18=76]="F18",KeyCode2[KeyCode2.F19=77]="F19",KeyCode2[KeyCode2.NumLock=78]="NumLock",KeyCode2[KeyCode2.ScrollLock=79]="ScrollLock",KeyCode2[KeyCode2.Semicolon=80]="Semicolon",KeyCode2[KeyCode2.Equal=81]="Equal",KeyCode2[KeyCode2.Comma=82]="Comma",KeyCode2[KeyCode2.Minus=83]="Minus",KeyCode2[KeyCode2.Period=84]="Period",KeyCode2[KeyCode2.Slash=85]="Slash",KeyCode2[KeyCode2.Backquote=86]="Backquote",KeyCode2[KeyCode2.BracketLeft=87]="BracketLeft",KeyCode2[KeyCode2.Backslash=88]="Backslash",KeyCode2[KeyCode2.BracketRight=89]="BracketRight",KeyCode2[KeyCode2.Quote=90]="Quote",KeyCode2[KeyCode2.OEM_8=91]="OEM_8",KeyCode2[KeyCode2.IntlBackslash=92]="IntlBackslash",KeyCode2[KeyCode2.Numpad0=93]="Numpad0",KeyCode2[KeyCode2.Numpad1=94]="Numpad1",KeyCode2[KeyCode2.Numpad2=95]="Numpad2",KeyCode2[KeyCode2.Numpad3=96]="Numpad3",KeyCode2[KeyCode2.Numpad4=97]="Numpad4",KeyCode2[KeyCode2.Numpad5=98]="Numpad5",KeyCode2[KeyCode2.Numpad6=99]="Numpad6",KeyCode2[KeyCode2.Numpad7=100]="Numpad7",KeyCode2[KeyCode2.Numpad8=101]="Numpad8",KeyCode2[KeyCode2.Numpad9=102]="Numpad9",KeyCode2[KeyCode2.NumpadMultiply=103]="NumpadMultiply",KeyCode2[KeyCode2.NumpadAdd=104]="NumpadAdd",KeyCode2[KeyCode2.NUMPAD_SEPARATOR=105]="NUMPAD_SEPARATOR",KeyCode2[KeyCode2.NumpadSubtract=106]="NumpadSubtract",KeyCode2[KeyCode2.NumpadDecimal=107]="NumpadDecimal",KeyCode2[KeyCode2.NumpadDivide=108]="NumpadDivide",KeyCode2[KeyCode2.KEY_IN_COMPOSITION=109]="KEY_IN_COMPOSITION",KeyCode2[KeyCode2.ABNT_C1=110]="ABNT_C1",KeyCode2[KeyCode2.ABNT_C2=111]="ABNT_C2",KeyCode2[KeyCode2.AudioVolumeMute=112]="AudioVolumeMute",KeyCode2[KeyCode2.AudioVolumeUp=113]="AudioVolumeUp",KeyCode2[KeyCode2.AudioVolumeDown=114]="AudioVolumeDown",KeyCode2[KeyCode2.BrowserSearch=115]="BrowserSearch",KeyCode2[KeyCode2.BrowserHome=116]="BrowserHome",KeyCode2[KeyCode2.BrowserBack=117]="BrowserBack",KeyCode2[KeyCode2.BrowserForward=118]="BrowserForward",KeyCode2[KeyCode2.MediaTrackNext=119]="MediaTrackNext",KeyCode2[KeyCode2.MediaTrackPrevious=120]="MediaTrackPrevious",KeyCode2[KeyCode2.MediaStop=121]="MediaStop",KeyCode2[KeyCode2.MediaPlayPause=122]="MediaPlayPause",KeyCode2[KeyCode2.LaunchMediaPlayer=123]="LaunchMediaPlayer",KeyCode2[KeyCode2.LaunchMail=124]="LaunchMail",KeyCode2[KeyCode2.LaunchApp2=125]="LaunchApp2",KeyCode2[KeyCode2.Clear=126]="Clear",KeyCode2[KeyCode2.MAX_VALUE=127]="MAX_VALUE",function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(MarkerSeverity$1||(MarkerSeverity$1={})),MarkerTag2=MarkerTag$1||(MarkerTag$1={}),MarkerTag2[MarkerTag2.Unnecessary=1]="Unnecessary",MarkerTag2[MarkerTag2.Deprecated=2]="Deprecated",function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"}(MinimapPosition||(MinimapPosition={})),MouseTargetType2=MouseTargetType||(MouseTargetType={}),MouseTargetType2[MouseTargetType2.UNKNOWN=0]="UNKNOWN",MouseTargetType2[MouseTargetType2.TEXTAREA=1]="TEXTAREA",MouseTargetType2[MouseTargetType2.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",MouseTargetType2[MouseTargetType2.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",MouseTargetType2[MouseTargetType2.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",MouseTargetType2[MouseTargetType2.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",MouseTargetType2[MouseTargetType2.CONTENT_TEXT=6]="CONTENT_TEXT",MouseTargetType2[MouseTargetType2.CONTENT_EMPTY=7]="CONTENT_EMPTY",MouseTargetType2[MouseTargetType2.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",MouseTargetType2[MouseTargetType2.CONTENT_WIDGET=9]="CONTENT_WIDGET",MouseTargetType2[MouseTargetType2.OVERVIEW_RULER=10]="OVERVIEW_RULER",MouseTargetType2[MouseTargetType2.SCROLLBAR=11]="SCROLLBAR",MouseTargetType2[MouseTargetType2.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",MouseTargetType2[MouseTargetType2.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR",OverlayWidgetPositionPreference2=OverlayWidgetPositionPreference||(OverlayWidgetPositionPreference={}),OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2.TOP_CENTER=2]="TOP_CENTER",function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(OverviewRulerLane||(OverviewRulerLane={})),PositionAffinity2=PositionAffinity||(PositionAffinity={}),PositionAffinity2[PositionAffinity2.Left=0]="Left",PositionAffinity2[PositionAffinity2.Right=1]="Right",PositionAffinity2[PositionAffinity2.None=2]="None",RenderLineNumbersType2=RenderLineNumbersType||(RenderLineNumbersType={}),RenderLineNumbersType2[RenderLineNumbersType2.Off=0]="Off",RenderLineNumbersType2[RenderLineNumbersType2.On=1]="On",RenderLineNumbersType2[RenderLineNumbersType2.Relative=2]="Relative",RenderLineNumbersType2[RenderLineNumbersType2.Interval=3]="Interval",RenderLineNumbersType2[RenderLineNumbersType2.Custom=4]="Custom",RenderMinimap2=RenderMinimap||(RenderMinimap={}),RenderMinimap2[RenderMinimap2.None=0]="None",RenderMinimap2[RenderMinimap2.Text=1]="Text",RenderMinimap2[RenderMinimap2.Blocks=2]="Blocks",ScrollType2=ScrollType||(ScrollType={}),ScrollType2[ScrollType2.Smooth=0]="Smooth",ScrollType2[ScrollType2.Immediate=1]="Immediate",ScrollbarVisibility2=ScrollbarVisibility||(ScrollbarVisibility={}),ScrollbarVisibility2[ScrollbarVisibility2.Auto=1]="Auto",ScrollbarVisibility2[ScrollbarVisibility2.Hidden=2]="Hidden",ScrollbarVisibility2[ScrollbarVisibility2.Visible=3]="Visible",SelectionDirection2=SelectionDirection$1||(SelectionDirection$1={}),SelectionDirection2[SelectionDirection2.LTR=0]="LTR",SelectionDirection2[SelectionDirection2.RTL=1]="RTL",function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(SignatureHelpTriggerKind||(SignatureHelpTriggerKind={})),SymbolKind2=SymbolKind||(SymbolKind={}),SymbolKind2[SymbolKind2.File=0]="File",SymbolKind2[SymbolKind2.Module=1]="Module",SymbolKind2[SymbolKind2.Namespace=2]="Namespace",SymbolKind2[SymbolKind2.Package=3]="Package",SymbolKind2[SymbolKind2.Class=4]="Class",SymbolKind2[SymbolKind2.Method=5]="Method",SymbolKind2[SymbolKind2.Property=6]="Property",SymbolKind2[SymbolKind2.Field=7]="Field",SymbolKind2[SymbolKind2.Constructor=8]="Constructor",SymbolKind2[SymbolKind2.Enum=9]="Enum",SymbolKind2[SymbolKind2.Interface=10]="Interface",SymbolKind2[SymbolKind2.Function=11]="Function",SymbolKind2[SymbolKind2.Variable=12]="Variable",SymbolKind2[SymbolKind2.Constant=13]="Constant",SymbolKind2[SymbolKind2.String=14]="String",SymbolKind2[SymbolKind2.Number=15]="Number",SymbolKind2[SymbolKind2.Boolean=16]="Boolean",SymbolKind2[SymbolKind2.Array=17]="Array",SymbolKind2[SymbolKind2.Object=18]="Object",SymbolKind2[SymbolKind2.Key=19]="Key",SymbolKind2[SymbolKind2.Null=20]="Null",SymbolKind2[SymbolKind2.EnumMember=21]="EnumMember",SymbolKind2[SymbolKind2.Struct=22]="Struct",SymbolKind2[SymbolKind2.Event=23]="Event",SymbolKind2[SymbolKind2.Operator=24]="Operator",SymbolKind2[SymbolKind2.TypeParameter=25]="TypeParameter",SymbolTag2=SymbolTag||(SymbolTag={}),SymbolTag2[SymbolTag2.Deprecated=1]="Deprecated",TextEditorCursorBlinkingStyle2=TextEditorCursorBlinkingStyle||(TextEditorCursorBlinkingStyle={}),TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2.Hidden=0]="Hidden",TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2.Blink=1]="Blink",TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2.Smooth=2]="Smooth",TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2.Phase=3]="Phase",TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2.Expand=4]="Expand",TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2.Solid=5]="Solid",function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(TextEditorCursorStyle||(TextEditorCursorStyle={})),TrackedRangeStickiness2=TrackedRangeStickiness||(TrackedRangeStickiness={}),TrackedRangeStickiness2[TrackedRangeStickiness2.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",TrackedRangeStickiness2[TrackedRangeStickiness2.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",TrackedRangeStickiness2[TrackedRangeStickiness2.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",TrackedRangeStickiness2[TrackedRangeStickiness2.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter",WrappingIndent2=WrappingIndent||(WrappingIndent={}),WrappingIndent2[WrappingIndent2.None=0]="None",WrappingIndent2[WrappingIndent2.Same=1]="Same",WrappingIndent2[WrappingIndent2.Indent=2]="Indent",WrappingIndent2[WrappingIndent2.DeepIndent=3]="DeepIndent";class KeyMod$1{static chord(e,t){return KeyChord(e,t)}}function createMonacoBaseAPI(){return{editor:void 0,languages:void 0,CancellationTokenSource:CancellationTokenSource$1,Emitter:Emitter$1,KeyCode:KeyCode$1,KeyMod:KeyMod$1,Position:Position$1,Range:Range$2,Selection:Selection$1,SelectionDirection:SelectionDirection$1,MarkerSeverity:MarkerSeverity$1,MarkerTag:MarkerTag$1,Uri:URI,Token:Token$2}}KeyMod$1.CtrlCmd=2048,KeyMod$1.Shift=1024,KeyMod$1.Alt=512,KeyMod$1.WinCtrl=256;var standaloneTokens="";const INITIALIZE="$initialize";let webWorkerWarningLogged=!1;function logOnceWebWorkerWarning(e){isWeb&&(webWorkerWarningLogged||(webWorkerWarningLogged=!0))}class RequestMessage{constructor(e,t,n,i){this.vsWorker=e,this.req=t,this.method=n,this.args=i,this.type=0}}class ReplyMessage{constructor(e,t,n,i){this.vsWorker=e,this.seq=t,this.res=n,this.err=i,this.type=1}}class SubscribeEventMessage{constructor(e,t,n,i){this.vsWorker=e,this.req=t,this.eventName=n,this.arg=i,this.type=2}}class EventMessage{constructor(e,t,n){this.vsWorker=e,this.req=t,this.event=n,this.type=3}}class UnsubscribeEventMessage{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class SimpleWorkerProtocol{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const n=String(++this._lastSentReq);return new Promise(((i,o)=>{this._pendingReplies[n]={resolve:i,reject:o},this._send(new RequestMessage(this._workerId,n,e,t))}))}listen(e,t){let n=null;const i=new Emitter$1({onFirstListenerAdd:()=>{n=String(++this._lastSentReq),this._pendingEmitters.set(n,i),this._send(new SubscribeEventMessage(this._workerId,n,e,t))},onLastListenerRemove:()=>{this._pendingEmitters.delete(n),this._send(new UnsubscribeEventMessage(this._workerId,n)),n=null}});return i.event}handleMessage(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq])return;let t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let n=e.err;return e.err.$isError&&(n=new Error,n.name=e.err.name,n.message=e.err.message,n.stack=e.err.stack),void t.reject(n)}t.resolve(e.res)}_handleRequestMessage(e){let t=e.req;this._handler.handleMessage(e.method,e.args).then((e=>{this._send(new ReplyMessage(this._workerId,t,e,void 0))}),(e=>{e.detail instanceof Error&&(e.detail=transformErrorForSerialization(e.detail)),this._send(new ReplyMessage(this._workerId,t,void 0,transformErrorForSerialization(e)))}))}_handleSubscribeEventMessage(e){const t=e.req,n=this._handler.handleEvent(e.eventName,e.arg)((e=>{this._send(new EventMessage(this._workerId,t,e))}));this._pendingEvents.set(t,n)}_handleEventMessage(e){this._pendingEmitters.has(e.req)&&this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){this._pendingEvents.has(e.req)&&(this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req))}_send(e){let t=[];if(0===e.type)for(let n=0;n<e.args.length;n++)e.args[n]instanceof ArrayBuffer&&t.push(e.args[n]);else 1===e.type&&e.res instanceof ArrayBuffer&&t.push(e.res);this._handler.sendMessage(e,t)}}class SimpleWorkerClient extends Disposable{constructor(e,t,n){super();let i=null;this._worker=this._register(e.create("vs/base/common/worker/simpleWorker",(e=>{this._protocol.handleMessage(e)}),(e=>{i&&i(e)}))),this._protocol=new SimpleWorkerProtocol({sendMessage:(e,t)=>{this._worker.postMessage(e,t)},handleMessage:(e,t)=>{if("function"!=typeof n[e])return Promise.reject(new Error("Missing method "+e+" on main thread host."));try{return Promise.resolve(n[e].apply(n,t))}catch(e2){return Promise.reject(e2)}},handleEvent:(e,t)=>{if(propertyIsDynamicEvent(e)){const i=n[e].call(n,t);if("function"!=typeof i)throw new Error(`Missing dynamic event ${e} on main thread host.`);return i}if(propertyIsEvent(e)){const t=n[e];if("function"!=typeof t)throw new Error(`Missing event ${e} on main thread host.`);return t}throw new Error(`Malformed event name ${e}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;void 0!==globals.require&&"function"==typeof globals.require.getConfig?o=globals.require.getConfig():void 0!==globals.requirejs&&(o=globals.requirejs.s.contexts._.config);const r=getAllMethodNames(n);this._onModuleLoaded=this._protocol.sendMessage(INITIALIZE,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,r]);const s=(e,t)=>this._request(e,t),a=(e,t)=>this._protocol.listen(e,t);this._lazyProxy=new Promise(((e,n)=>{i=n,this._onModuleLoaded.then((t=>{e(createProxyObject(t,s,a))}),(e=>{n(e),this._onError("Worker failed to load "+t,e)}))}))}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise(((n,i)=>{this._onModuleLoaded.then((()=>{this._protocol.sendMessage(e,t).then(n,i)}),i)}))}_onError(e,t){}}function propertyIsEvent(e){return"o"===e[0]&&"n"===e[1]&&isUpperAsciiLetter(e.charCodeAt(2))}function propertyIsDynamicEvent(e){return/^onDynamic/.test(e)&&isUpperAsciiLetter(e.charCodeAt(9))}function createProxyObject(e,t,n){const i=e=>function(){const n=Array.prototype.slice.call(arguments,0);return t(e,n)},o=e=>function(t){return n(e,t)};let r={};for(const s of e)propertyIsDynamicEvent(s)?r[s]=o(s):propertyIsEvent(s)?r[s]=n(s,void 0):r[s]=i(s);return r}var _a$3;const ttPolicy$1=null===(_a$3=window.trustedTypes)||void 0===_a$3?void 0:_a$3.createPolicy("defaultWorkerFactory",{createScriptURL:e=>e});function getWorker(e){if(globals.MonacoEnvironment){if("function"==typeof globals.MonacoEnvironment.getWorker)return globals.MonacoEnvironment.getWorker("workerMain.js",e);if("function"==typeof globals.MonacoEnvironment.getWorkerUrl){const t=globals.MonacoEnvironment.getWorkerUrl("workerMain.js",e);return new Worker(ttPolicy$1?ttPolicy$1.createScriptURL(t):t,{name:e})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function isPromiseLike(e){return"function"==typeof e.then}class WebWorker{constructor(e,t,n,i,o){this.id=t;const r=getWorker(n);isPromiseLike(r)?this.worker=r:this.worker=Promise.resolve(r),this.postMessage(e,[]),this.worker.then((e=>{e.onmessage=function(e){i(e.data)},e.onmessageerror=o,"function"==typeof e.addEventListener&&e.addEventListener("error",o)}))}getId(){return this.id}postMessage(e,t){this.worker&&this.worker.then((n=>n.postMessage(e,t)))}dispose(){this.worker&&this.worker.then((e=>e.terminate())),this.worker=null}}class DefaultWorkerFactory{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,n){let i=++DefaultWorkerFactory.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new WebWorker(e,i,this._label||"anonymous"+i,t,(e=>{logOnceWebWorkerWarning(e),this._webWorkerFailedBeforeError=e,n(e)}))}}DefaultWorkerFactory.LAST_WORKER_ID=0;const MINIMUM_MATCHING_CHARACTER_LENGTH=3;function computeDiff(e,t,n,i){return new LcsDiff(e,t,n).ComputeDiff(i)}class LineSequence{constructor(e){const t=[],n=[];for(let i=0,o=e.length;i<o;i++)t[i]=getFirstNonBlankColumn(e[i],1),n[i]=getLastNonBlankColumn(e[i],1);this.lines=e,this._startColumns=t,this._endColumns=n}getElements(){const e=[];for(let t=0,n=this.lines.length;t<n;t++)e[t]=this.lines[t].substring(this._startColumns[t]-1,this._endColumns[t]-1);return e}getStrictElement(e){return this.lines[e]}getStartLineNumber(e){return e+1}getEndLineNumber(e){return e+1}createCharSequence(e,t,n){const i=[],o=[],r=[];let s=0;for(let a=t;a<=n;a++){const t=this.lines[a],n=e?this._startColumns[a]:1,l=e?this._endColumns[a]:t.length+1;for(let e=n;e<l;e++)i[s]=t.charCodeAt(e-1),o[s]=a+1,r[s]=e,s++}return new CharSequence(i,o,r)}}class CharSequence{constructor(e,t,n){this._charCodes=e,this._lineNumbers=t,this._columns=n}getElements(){return this._charCodes}getStartLineNumber(e){return this._lineNumbers[e]}getStartColumn(e){return this._columns[e]}getEndLineNumber(e){return this._lineNumbers[e]}getEndColumn(e){return this._columns[e]+1}}class CharChange{constructor(e,t,n,i,o,r,s,a){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=n,this.originalEndColumn=i,this.modifiedStartLineNumber=o,this.modifiedStartColumn=r,this.modifiedEndLineNumber=s,this.modifiedEndColumn=a}static createFromDiffChange(e,t,n){let i,o,r,s,a,l,c,d;return 0===e.originalLength?(i=0,o=0,r=0,s=0):(i=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),r=t.getEndLineNumber(e.originalStart+e.originalLength-1),s=t.getEndColumn(e.originalStart+e.originalLength-1)),0===e.modifiedLength?(a=0,l=0,c=0,d=0):(a=n.getStartLineNumber(e.modifiedStart),l=n.getStartColumn(e.modifiedStart),c=n.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),d=n.getEndColumn(e.modifiedStart+e.modifiedLength-1)),new CharChange(i,o,r,s,a,l,c,d)}}function postProcessCharChanges(e){if(e.length<=1)return e;const t=[e[0]];let n=t[0];for(let i=1,o=e.length;i<o;i++){const o=e[i],r=o.originalStart-(n.originalStart+n.originalLength),s=o.modifiedStart-(n.modifiedStart+n.modifiedLength);Math.min(r,s)<MINIMUM_MATCHING_CHARACTER_LENGTH?(n.originalLength=o.originalStart+o.originalLength-n.originalStart,n.modifiedLength=o.modifiedStart+o.modifiedLength-n.modifiedStart):(t.push(o),n=o)}return t}class LineChange{constructor(e,t,n,i,o){this.originalStartLineNumber=e,this.originalEndLineNumber=t,this.modifiedStartLineNumber=n,this.modifiedEndLineNumber=i,this.charChanges=o}static createFromDiffResult(e,t,n,i,o,r,s){let a,l,c,d,u;if(0===t.originalLength?(a=n.getStartLineNumber(t.originalStart)-1,l=0):(a=n.getStartLineNumber(t.originalStart),l=n.getEndLineNumber(t.originalStart+t.originalLength-1)),0===t.modifiedLength?(c=i.getStartLineNumber(t.modifiedStart)-1,d=0):(c=i.getStartLineNumber(t.modifiedStart),d=i.getEndLineNumber(t.modifiedStart+t.modifiedLength-1)),r&&t.originalLength>0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const r=n.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),a=i.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);let l=computeDiff(r,a,o,!0).changes;s&&(l=postProcessCharChanges(l)),u=[];for(let e=0,t=l.length;e<t;e++)u.push(CharChange.createFromDiffChange(l[e],r,a))}return new LineChange(a,l,c,d,u)}}class DiffComputer{constructor(e,t,n){this.shouldComputeCharChanges=n.shouldComputeCharChanges,this.shouldPostProcessCharChanges=n.shouldPostProcessCharChanges,this.shouldIgnoreTrimWhitespace=n.shouldIgnoreTrimWhitespace,this.shouldMakePrettyDiff=n.shouldMakePrettyDiff,this.originalLines=e,this.modifiedLines=t,this.original=new LineSequence(e),this.modified=new LineSequence(t),this.continueLineDiff=createContinueProcessingPredicate(n.maxComputationTime),this.continueCharDiff=createContinueProcessingPredicate(0===n.maxComputationTime?0:Math.min(n.maxComputationTime,5e3))}computeDiff(){if(1===this.original.lines.length&&0===this.original.lines[0].length)return 1===this.modified.lines.length&&0===this.modified.lines[0].length?{quitEarly:!1,changes:[]}:{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:1,modifiedStartLineNumber:1,modifiedEndLineNumber:this.modified.lines.length,charChanges:[{modifiedEndColumn:0,modifiedEndLineNumber:0,modifiedStartColumn:0,modifiedStartLineNumber:0,originalEndColumn:0,originalEndLineNumber:0,originalStartColumn:0,originalStartLineNumber:0}]}]};if(1===this.modified.lines.length&&0===this.modified.lines[0].length)return{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:this.original.lines.length,modifiedStartLineNumber:1,modifiedEndLineNumber:1,charChanges:[{modifiedEndColumn:0,modifiedEndLineNumber:0,modifiedStartColumn:0,modifiedStartLineNumber:0,originalEndColumn:0,originalEndLineNumber:0,originalStartColumn:0,originalStartLineNumber:0}]}]};const e=computeDiff(this.original,this.modified,this.continueLineDiff,this.shouldMakePrettyDiff),t=e.changes,n=e.quitEarly;if(this.shouldIgnoreTrimWhitespace){const e=[];for(let n=0,i=t.length;n<i;n++)e.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace,t[n],this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges));return{quitEarly:n,changes:e}}const i=[];let o=0,r=0;for(let s=-1,a=t.length;s<a;s++){const e=s+1<a?t[s+1]:null,n=e?e.originalStart:this.originalLines.length,l=e?e.modifiedStart:this.modifiedLines.length;for(;o<n&&r<l;){const e=this.originalLines[o],t=this.modifiedLines[r];if(e!==t){{let n=getFirstNonBlankColumn(e,1),s=getFirstNonBlankColumn(t,1);for(;n>1&&s>1;){if(e.charCodeAt(n-2)!==t.charCodeAt(s-2))break;n--,s--}(n>1||s>1)&&this._pushTrimWhitespaceCharChange(i,o+1,1,n,r+1,1,s)}{let n=getLastNonBlankColumn(e,1),s=getLastNonBlankColumn(t,1);const a=e.length+1,l=t.length+1;for(;n<a&&s<l;){if(e.charCodeAt(n-1)!==e.charCodeAt(s-1))break;n++,s++}(n<a||s<l)&&this._pushTrimWhitespaceCharChange(i,o+1,n,a,r+1,s,l)}}o++,r++}e&&(i.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace,e,this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges)),o+=e.originalLength,r+=e.modifiedLength)}return{quitEarly:n,changes:i}}_pushTrimWhitespaceCharChange(e,t,n,i,o,r,s){if(this._mergeTrimWhitespaceCharChange(e,t,n,i,o,r,s))return;let a;this.shouldComputeCharChanges&&(a=[new CharChange(t,n,t,i,o,r,o,s)]),e.push(new LineChange(t,t,o,o,a))}_mergeTrimWhitespaceCharChange(e,t,n,i,o,r,s){const a=e.length;if(0===a)return!1;const l=e[a-1];return 0!==l.originalEndLineNumber&&0!==l.modifiedEndLineNumber&&(l.originalEndLineNumber+1===t&&l.modifiedEndLineNumber+1===o&&(l.originalEndLineNumber=t,l.modifiedEndLineNumber=o,this.shouldComputeCharChanges&&l.charChanges&&l.charChanges.push(new CharChange(t,n,t,i,o,r,o,s)),!0))}}function getFirstNonBlankColumn(e,t){const n=firstNonWhitespaceIndex(e);return-1===n?t:n+1}function getLastNonBlankColumn(e,t){const n=lastNonWhitespaceIndex(e);return-1===n?t:n+2}function createContinueProcessingPredicate(e){if(0===e)return()=>!0;const t=Date.now();return()=>Date.now()-t<e}class MirrorTextModel{constructor(e,t,n,i){this._uri=e,this._lines=t,this._eol=n,this._versionId=i,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return null===this._cachedTextValue&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const t=e.changes;for(const n of t)this._acceptDeleteRange(n.range),this._acceptInsertText(new Position$1(n.range.startLineNumber,n.range.startColumn),n.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,n=new Uint32Array(t);for(let i=0;i<t;i++)n[i]=this._lines[i].length+e;this._lineStarts=new PrefixSumComputer(n)}}_setLineText(e,t){this._lines[e]=t,this._lineStarts&&this._lineStarts.setValue(e,this._lines[e].length+this._eol.length)}_acceptDeleteRange(e){if(e.startLineNumber!==e.endLineNumber)this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.endLineNumber-1].substring(e.endColumn-1)),this._lines.splice(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineStarts&&this._lineStarts.removeValues(e.startLineNumber,e.endLineNumber-e.startLineNumber);else{if(e.startColumn===e.endColumn)return;this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.startLineNumber-1].substring(e.endColumn-1))}}_acceptInsertText(e,t){if(0===t.length)return;const n=splitLines(t);if(1===n.length)return void this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+n[0]+this._lines[e.lineNumber-1].substring(e.column-1));n[n.length-1]+=this._lines[e.lineNumber-1].substring(e.column-1),this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+n[0]);const i=new Uint32Array(n.length-1);for(let o=1;o<n.length;o++)this._lines.splice(e.lineNumber+o-1,0,n[o]),i[o-1]=n[o].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,i)}}class Uint8Matrix{constructor(e,t,n){const i=new Uint8Array(e*t);for(let o=0,r=e*t;o<r;o++)i[o]=n;this._data=i,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,n){this._data[e*this.cols+t]=n}}class StateMachine{constructor(e){let t=0,n=0;for(let o=0,r=e.length;o<r;o++){const[i,r,s]=e[o];r>t&&(t=r),i>n&&(n=i),s>n&&(n=s)}t++,n++;const i=new Uint8Matrix(n,t,0);for(let o=0,r=e.length;o<r;o++){const[t,n,r]=e[o];i.set(t,n,r)}this._states=i,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?0:this._states.get(e,t)}}let _stateMachine=null;function getStateMachine(){return null===_stateMachine&&(_stateMachine=new StateMachine([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),_stateMachine}let _classifier=null;function getClassifier(){if(null===_classifier){_classifier=new CharacterClassifier(0);const e=" \t<>'\"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…";for(let n=0;n<e.length;n++)_classifier.set(e.charCodeAt(n),1);const t=".,;";for(let n=0;n<t.length;n++)_classifier.set(t.charCodeAt(n),2)}return _classifier}class LinkComputer{static _createLink(e,t,n,i,o){let r=o-1;do{const n=t.charCodeAt(r);if(2!==e.get(n))break;r--}while(r>i);if(i>0){const e=t.charCodeAt(i-1),n=t.charCodeAt(r);(40===e&&41===n||91===e&&93===n||123===e&&125===n)&&r--}return{range:{startLineNumber:n,startColumn:i+1,endLineNumber:n,endColumn:r+2},url:t.substring(i,r+1)}}static computeLinks(e,t=getStateMachine()){const n=getClassifier(),i=[];for(let o=1,r=e.getLineCount();o<=r;o++){const r=e.getLineContent(o),s=r.length;let a=0,l=0,c=0,d=1,u=!1,h=!1,g=!1,p=!1;for(;a<s;){let e=!1;const s=r.charCodeAt(a);if(13===d){let t;switch(s){case 40:u=!0,t=0;break;case 41:t=u?0:1;break;case 91:g=!0,h=!0,t=0;break;case 93:g=!1,t=h?0:1;break;case 123:p=!0,t=0;break;case 125:t=p?0:1;break;case 39:t=34===c||96===c?0:1;break;case 34:t=39===c||96===c?0:1;break;case 96:t=39===c||34===c?0:1;break;case 42:t=42===c?1:0;break;case 124:t=124===c?1:0;break;case 32:t=g?0:1;break;default:t=n.get(s)}1===t&&(i.push(LinkComputer._createLink(n,r,o,l,a)),e=!0)}else if(12===d){let t;91===s?(h=!0,t=0):t=n.get(s),1===t?e=!0:d=13}else d=t.nextState(d,s),0===d&&(e=!0);e&&(d=1,u=!1,h=!1,p=!1,l=a+1,c=s),a++}13===d&&i.push(LinkComputer._createLink(n,r,o,l,s))}return i}}function computeLinks(e){return e&&"function"==typeof e.getLineCount&&"function"==typeof e.getLineContent?LinkComputer.computeLinks(e):[]}class BasicInplaceReplace{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}navigateValueSet(e,t,n,i,o){if(e&&t){const n=this.doNavigateValueSet(t,o);if(n)return{range:e,value:n}}if(n&&i){const e=this.doNavigateValueSet(i,o);if(e)return{range:n,value:e}}return null}doNavigateValueSet(e,t){const n=this.numberReplace(e,t);return null!==n?n:this.textReplace(e,t)}numberReplace(e,t){const n=Math.pow(10,e.length-(e.lastIndexOf(".")+1));let i=Number(e),o=parseFloat(e);return isNaN(i)||isNaN(o)||i!==o?null:0!==i||t?(i=Math.floor(i*n),i+=t?n:-n,String(i/n)):null}textReplace(e,t){return this.valueSetsReplace(this._defaultValueSet,e,t)}valueSetsReplace(e,t,n){let i=null;for(let o=0,r=e.length;null===i&&o<r;o++)i=this.valueSetReplace(e[o],t,n);return i}valueSetReplace(e,t,n){let i=e.indexOf(t);return i>=0?(i+=n?1:-1,i<0?i=e.length-1:i%=e.length,e[i]):null}}BasicInplaceReplace.INSTANCE=new BasicInplaceReplace;var __awaiter$9=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class MirrorModel extends MirrorTextModel{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){const n=getWordAtText(e.column,ensureValidWordDefinition(t),this._lines[e.lineNumber-1],0);return n?new Range$2(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn):null}words(e){const t=this._lines,n=this._wordenize.bind(this);let i=0,o="",r=0,s=[];return{*[Symbol.iterator](){for(;;)if(r<s.length){const e=o.substring(s[r].start,s[r].end);r+=1,yield e}else{if(!(i<t.length))break;o=t[i],s=n(o,e),r=0,i+=1}}}}getLineWords(e,t){const n=this._lines[e-1],i=this._wordenize(n,t),o=[];for(const r of i)o.push({word:n.substring(r.start,r.end),startColumn:r.start+1,endColumn:r.end+1});return o}_wordenize(e,t){const n=[];let i;for(t.lastIndex=0;(i=t.exec(e))&&0!==i[0].length;)n.push({start:i.index,end:i.index+i[0].length});return n}getValueInRange(e){if((e=this._validateRange(e)).startLineNumber===e.endLineNumber)return this._lines[e.startLineNumber-1].substring(e.startColumn-1,e.endColumn-1);const t=this._eol,n=e.startLineNumber-1,i=e.endLineNumber-1,o=[];o.push(this._lines[n].substring(e.startColumn-1));for(let r=n+1;r<i;r++)o.push(this._lines[r]);return o.push(this._lines[i].substring(0,e.endColumn-1)),o.join(t)}offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.lineNumber-2)+(e.column-1)}positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();const t=this._lineStarts.getIndexOf(e),n=this._lines[t.index].length;return{lineNumber:1+t.index,column:1+Math.min(t.remainder,n)}}_validateRange(e){const t=this._validatePosition({lineNumber:e.startLineNumber,column:e.startColumn}),n=this._validatePosition({lineNumber:e.endLineNumber,column:e.endColumn});return t.lineNumber!==e.startLineNumber||t.column!==e.startColumn||n.lineNumber!==e.endLineNumber||n.column!==e.endColumn?{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:n.lineNumber,endColumn:n.column}:e}_validatePosition(e){if(!Position$1.isIPosition(e))throw new Error("bad position");let{lineNumber:t,column:n}=e,i=!1;if(t<1)t=1,n=1,i=!0;else if(t>this._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,i=!0;else{const e=this._lines[t-1].length+1;n<1?(n=1,i=!0):n>e&&(n=e,i=!0)}return i?{lineNumber:t,column:n}:e}}class EditorSimpleWorker{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach((t=>e.push(this._models[t]))),e}acceptNewModel(e){this._models[e.url]=new MirrorModel(URI.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeUnicodeHighlights(e,t,n){return __awaiter$9(this,void 0,void 0,(function*(){const i=this._getModel(e);return i?UnicodeTextModelHighlighter.computeUnicodeHighlights(i,t,n):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}))}computeDiff(e,t,n,i){return __awaiter$9(this,void 0,void 0,(function*(){const o=this._getModel(e),r=this._getModel(t);if(!o||!r)return null;const s=o.getLinesContent(),a=r.getLinesContent(),l=new DiffComputer(s,a,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:n,shouldMakePrettyDiff:!0,maxComputationTime:i}).computeDiff(),c=!(l.changes.length>0)&&this._modelsAreIdentical(o,r);return{quitEarly:l.quitEarly,identical:c,changes:l.changes}}))}_modelsAreIdentical(e,t){const n=e.getLineCount();if(n!==t.getLineCount())return!1;for(let i=1;i<=n;i++){if(e.getLineContent(i)!==t.getLineContent(i))return!1}return!0}computeMoreMinimalEdits(e,t){return __awaiter$9(this,void 0,void 0,(function*(){const n=this._getModel(e);if(!n)return t;const i=[];let o;t=t.slice(0).sort(((e,t)=>{if(e.range&&t.range)return Range$2.compareRangesUsingStarts(e.range,t.range);return(e.range?0:1)-(t.range?0:1)}));for(let{range:e,text:r,eol:s}of t){if("number"==typeof s&&(o=s),Range$2.isEmpty(e)&&!r)continue;const t=n.getValueInRange(e);if(r=r.replace(/\r\n|\n|\r/g,n.eol),t===r)continue;if(Math.max(r.length,t.length)>EditorSimpleWorker._diffLimit){i.push({range:e,text:r});continue}const a=stringDiff(t,r,!1),l=n.offsetAt(Range$2.lift(e).getStartPosition());for(const e of a){const t=n.positionAt(l+e.originalStart),o=n.positionAt(l+e.originalStart+e.originalLength),s={text:r.substr(e.modifiedStart,e.modifiedLength),range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:o.lineNumber,endColumn:o.column}};n.getValueInRange(s.range)!==s.text&&i.push(s)}}return"number"==typeof o&&i.push({eol:o,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),i}))}computeLinks(e){return __awaiter$9(this,void 0,void 0,(function*(){const t=this._getModel(e);return t?computeLinks(t):null}))}textualSuggest(e,t,n,i){return __awaiter$9(this,void 0,void 0,(function*(){const o=new StopWatch(!0),r=new RegExp(n,i),s=new Set;e:for(let n of e){const e=this._getModel(n);if(e)for(let n of e.words(r))if(n!==t&&isNaN(Number(n))&&(s.add(n),s.size>EditorSimpleWorker._suggestionsLimit))break e}return{words:Array.from(s),duration:o.elapsed()}}))}computeWordRanges(e,t,n,i){return __awaiter$9(this,void 0,void 0,(function*(){const o=this._getModel(e);if(!o)return Object.create(null);const r=new RegExp(n,i),s=Object.create(null);for(let e=t.startLineNumber;e<t.endLineNumber;e++){const t=o.getLineWords(e,r);for(const n of t){if(!isNaN(Number(n.word)))continue;let t=s[n.word];t||(t=[],s[n.word]=t),t.push({startLineNumber:e,startColumn:n.startColumn,endLineNumber:e,endColumn:n.endColumn})}}return s}))}navigateValueSet(e,t,n,i,o){return __awaiter$9(this,void 0,void 0,(function*(){const r=this._getModel(e);if(!r)return null;const s=new RegExp(i,o);t.startColumn===t.endColumn&&(t={startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn+1});const a=r.getValueInRange(t),l=r.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn},s);if(!l)return null;const c=r.getValueInRange(l);return BasicInplaceReplace.INSTANCE.navigateValueSet(t,a,l,c,n)}))}loadForeignModule(e,t,n){const i={host:createProxyObject$1(n,((e,t)=>this._host.fhr(e,t))),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(i,t),Promise.resolve(getAllMethodNames(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||"function"!=typeof this._foreignModule[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(e2){return Promise.reject(e2)}}}EditorSimpleWorker._diffLimit=1e5,EditorSimpleWorker._suggestionsLimit=1e4,"function"==typeof importScripts&&(globals.monaco=createMonacoBaseAPI());var __decorate$i=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$h=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$8=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const STOP_SYNC_MODEL_DELTA_TIME_MS=6e4,STOP_WORKER_DELTA_TIME_MS=3e5;function canSyncModel(e,t){const n=e.getModel(t);return!!n&&!n.isTooLargeForSyncing()}let EditorWorkerService=class extends Disposable{constructor(e,t,n,i,o){super(),this._modelService=e,this._workerManager=this._register(new WorkerManager(this._modelService,i)),this._logService=n,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(e,t)=>canSyncModel(this._modelService,e.uri)?this._workerManager.withWorker().then((t=>t.computeLinks(e.uri))).then((e=>e&&{links:e})):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new WordBasedCompletionItemProvider(this._workerManager,t,this._modelService,i)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return canSyncModel(this._modelService,e)}computedUnicodeHighlights(e,t,n){return this._workerManager.withWorker().then((i=>i.computedUnicodeHighlights(e,t,n)))}computeDiff(e,t,n,i){return this._workerManager.withWorker().then((o=>o.computeDiff(e,t,n,i)))}computeMoreMinimalEdits(e,t){if(isNonEmptyArray(t)){if(!canSyncModel(this._modelService,e))return Promise.resolve(t);const n=StopWatch.create(!0),i=this._workerManager.withWorker().then((n=>n.computeMoreMinimalEdits(e,t)));return i.finally((()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed()))),Promise.race([i,timeout(1e3).then((()=>t))])}return Promise.resolve(void 0)}canNavigateValueSet(e){return canSyncModel(this._modelService,e)}navigateValueSet(e,t,n){return this._workerManager.withWorker().then((i=>i.navigateValueSet(e,t,n)))}canComputeWordRanges(e){return canSyncModel(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then((n=>n.computeWordRanges(e,t)))}};EditorWorkerService=__decorate$i([__param$h(0,IModelService),__param$h(1,ITextResourceConfigurationService),__param$h(2,ILogService),__param$h(3,ILanguageConfigurationService),__param$h(4,ILanguageFeaturesService)],EditorWorkerService);class WordBasedCompletionItemProvider{constructor(e,t,n,i){this.languageConfigurationService=i,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=n}provideCompletionItems(e,t){return __awaiter$8(this,void 0,void 0,(function*(){const n=this._configurationService.getValue(e.uri,t,"editor");if(!n.wordBasedSuggestions)return;const i=[];if("currentDocument"===n.wordBasedSuggestionsMode)canSyncModel(this._modelService,e.uri)&&i.push(e.uri);else for(const t of this._modelService.getModels())canSyncModel(this._modelService,t.uri)&&(t===e?i.unshift(t.uri):"allDocuments"!==n.wordBasedSuggestionsMode&&t.getLanguageId()!==e.getLanguageId()||i.push(t.uri));if(0===i.length)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),s=r?new Range$2(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):Range$2.fromPositions(t),a=s.setEndPosition(t.lineNumber,t.column),l=yield this._workerManager.withWorker(),c=yield l.textualSuggest(i,null==r?void 0:r.word,o);return c?{duration:c.duration,suggestions:c.words.map((e=>({kind:18,label:e,insertText:e,range:{insert:a,replace:s}})))}:void 0}))}}class WorkerManager extends Disposable{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=(new Date).getTime();this._register(new IntervalTimer).cancelAndSet((()=>this._checkStopIdleWorker()),Math.round(STOP_WORKER_DELTA_TIME_MS/2)),this._register(this._modelService.onModelRemoved((e=>this._checkStopEmptyWorker())))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;0===this._modelService.getModels().length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;(new Date).getTime()-this._lastWorkerUsedTime>STOP_WORKER_DELTA_TIME_MS&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new EditorWorkerClient(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class EditorModelManager extends Disposable{constructor(e,t,n){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!n){const e=new IntervalTimer;e.cancelAndSet((()=>this._checkStopModelSync()),Math.round(STOP_SYNC_MODEL_DELTA_TIME_MS/2)),this._register(e)}}dispose(){for(let e in this._syncedModels)dispose(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const n of e){const e=n.toString();this._syncedModels[e]||this._beginModelSync(n,t),this._syncedModels[e]&&(this._syncedModelsLastUsedTime[e]=(new Date).getTime())}}_checkStopModelSync(){const e=(new Date).getTime(),t=[];for(let n in this._syncedModelsLastUsedTime){e-this._syncedModelsLastUsedTime[n]>STOP_SYNC_MODEL_DELTA_TIME_MS&&t.push(n)}for(const n of t)this._stopModelSync(n)}_beginModelSync(e,t){const n=this._modelService.getModel(e);if(!n)return;if(!t&&n.isTooLargeForSyncing())return;const i=e.toString();this._proxy.acceptNewModel({url:n.uri.toString(),lines:n.getLinesContent(),EOL:n.getEOL(),versionId:n.getVersionId()});const o=new DisposableStore;o.add(n.onDidChangeContent((e=>{this._proxy.acceptModelChanged(i.toString(),e)}))),o.add(n.onWillDispose((()=>{this._stopModelSync(i)}))),o.add(toDisposable((()=>{this._proxy.acceptRemovedModel(i)}))),this._syncedModels[i]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],dispose(t)}}class SynchronousWorkerClient{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class EditorWorkerHost{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class EditorWorkerClient extends Disposable{constructor(e,t,n,i){super(),this.languageConfigurationService=i,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new DefaultWorkerFactory(n),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new SimpleWorkerClient(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new EditorWorkerHost(this)))}catch(e){logOnceWebWorkerWarning(e),this._worker=new SynchronousWorkerClient(new EditorSimpleWorker(new EditorWorkerHost(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,(e=>(logOnceWebWorkerWarning(e),this._worker=new SynchronousWorkerClient(new EditorSimpleWorker(new EditorWorkerHost(this),null)),this._getOrCreateWorker().getProxyObject())))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new EditorModelManager(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return __awaiter$8(this,void 0,void 0,(function*(){return this._disposed?Promise.reject(canceled()):this._getProxy().then((n=>(this._getOrCreateModelManager(n).ensureSyncedResources(e,t),n)))}))}computedUnicodeHighlights(e,t,n){return this._withSyncedResources([e]).then((i=>i.computeUnicodeHighlights(e.toString(),t,n)))}computeDiff(e,t,n,i){return this._withSyncedResources([e,t],!0).then((o=>o.computeDiff(e.toString(),t.toString(),n,i)))}computeMoreMinimalEdits(e,t){return this._withSyncedResources([e]).then((n=>n.computeMoreMinimalEdits(e.toString(),t)))}computeLinks(e){return this._withSyncedResources([e]).then((t=>t.computeLinks(e.toString())))}textualSuggest(e,t,n){return __awaiter$8(this,void 0,void 0,(function*(){const i=yield this._withSyncedResources(e),o=n.source,r=regExpFlags(n);return i.textualSuggest(e.map((e=>e.toString())),t,o,r)}))}computeWordRanges(e,t){return this._withSyncedResources([e]).then((n=>{const i=this._modelService.getModel(e);if(!i)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(i.getLanguageId()).getWordDefinition(),r=o.source,s=regExpFlags(o);return n.computeWordRanges(e.toString(),t,r,s)}))}navigateValueSet(e,t,n){return this._withSyncedResources([e]).then((i=>{const o=this._modelService.getModel(e);if(!o)return null;const r=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),s=r.source,a=regExpFlags(r);return i.navigateValueSet(e.toString(),t,n,s,a)}))}dispose(){super.dispose(),this._disposed=!0}}function createWebWorker$1(e,t,n){return new MonacoWebWorkerImpl(e,t,n)}class MonacoWebWorkerImpl extends EditorWorkerClient{constructor(e,t,n){super(e,n.keepIdleModels||!1,n.label,t),this._foreignModuleId=n.moduleId,this._foreignModuleCreateData=n.createData||null,this._foreignModuleHost=n.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||"function"!=typeof this._foreignModuleHost[e])return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(e2){return Promise.reject(e2)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then((e=>{const t=this._foreignModuleHost?getAllMethodNames(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then((t=>{this._foreignModuleCreateData=null;const n=(t,n)=>e.fmr(t,n),i=(e,t)=>function(){const n=Array.prototype.slice.call(arguments,0);return t(e,n)},o={};for(const e of t)o[e]=i(e,n);return o}))}))),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then((e=>this.getProxy()))}}function isFuzzyActionArr(e){return Array.isArray(e)}function isFuzzyAction(e){return!isFuzzyActionArr(e)}function isString(e){return"string"==typeof e}function isIAction(e){return!isString(e)}function empty(e){return!e}function fixCase(e,t){return e.ignoreCase&&t?t.toLowerCase():t}function sanitize(e){return e.replace(/[&<>'"_]/g,"-")}function log(e,t){}function createError(e,t){return new Error(`${e.languageId}: ${t}`)}function substituteMatches(e,t,n,i,o){let r=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,(function(t,s,a,l,c,d,u,h,g){return empty(a)?empty(l)?!empty(c)&&c<i.length?fixCase(e,i[c]):!empty(u)&&e&&"string"==typeof e[u]?e[u]:(null===r&&(r=o.split("."),r.unshift(o)),!empty(d)&&d<r.length?fixCase(e,r[d]):""):fixCase(e,n):"$"}))}function findRules(e,t){let n=t;for(;n&&n.length>0;){const t=e.tokenizer[n];if(t)return t;const i=n.lastIndexOf(".");n=i<0?null:n.substr(0,i)}return null}function stateExists(e,t){let n=t;for(;n&&n.length>0;){if(e.stateNames[n])return!0;const t=n.lastIndexOf(".");n=t<0?null:n.substr(0,t)}return!1}const CACHE_STACK_DEPTH=5;class MonarchStackElementFactory{constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}static create(e,t){return this._INSTANCE.create(e,t)}create(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new MonarchStackElement(e,t);let n=MonarchStackElement.getStackElementId(e);n.length>0&&(n+="|"),n+=t;let i=this._entries[n];return i||(i=new MonarchStackElement(e,t),this._entries[n]=i,i)}}MonarchStackElementFactory._INSTANCE=new MonarchStackElementFactory(CACHE_STACK_DEPTH);class MonarchStackElement{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;null!==e;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;null!==e&&null!==t;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t}equals(e){return MonarchStackElement._equals(this,e)}push(e){return MonarchStackElementFactory.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return MonarchStackElementFactory.create(this.parent,e)}}class EmbeddedLanguageData{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new EmbeddedLanguageData(this.languageId,this.state)}}class MonarchLineStateFactory{constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}static create(e,t){return this._INSTANCE.create(e,t)}create(e,t){if(null!==t)return new MonarchLineState(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new MonarchLineState(e,t);const n=MonarchStackElement.getStackElementId(e);let i=this._entries[n];return i||(i=new MonarchLineState(e,null),this._entries[n]=i,i)}}MonarchLineStateFactory._INSTANCE=new MonarchLineStateFactory(CACHE_STACK_DEPTH);class MonarchLineState{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:MonarchLineStateFactory.create(this.stack,this.embeddedLanguageData)}equals(e){return e instanceof MonarchLineState&&(!!this.stack.equals(e.stack)&&(null===this.embeddedLanguageData&&null===e.embeddedLanguageData||null!==this.embeddedLanguageData&&null!==e.embeddedLanguageData&&this.embeddedLanguageData.equals(e.embeddedLanguageData)))}}class MonarchClassicTokensCollector{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new Token$2(e,t,this._languageId)))}nestedLanguageTokenize(e,t,n,i){const o=n.languageId,r=n.state,s=TokenizationRegistry.get(o);if(!s)return this.enterLanguage(o),this.emit(i,""),r;const a=s.tokenize(e,t,r);if(0!==i)for(const l of a.tokens)this._tokens.push(new Token$2(l.offset+i,l.type,l.language));else this._tokens=this._tokens.concat(a.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,a.endState}finalize(e){return new TokenizationResult(this._tokens,e)}}class MonarchModernTokensCollector{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const n=this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==n&&(this._lastTokenMetadata=n,this._tokens.push(e),this._tokens.push(n))}static _merge(e,t,n){const i=null!==e?e.length:0,o=t.length,r=null!==n?n.length:0;if(0===i&&0===o&&0===r)return new Uint32Array(0);if(0===i&&0===o)return n;if(0===o&&0===r)return e;const s=new Uint32Array(i+o+r);null!==e&&s.set(e);for(let a=0;a<o;a++)s[i+a]=t[a];return null!==n&&s.set(n,i+o),s}nestedLanguageTokenize(e,t,n,i){const o=n.languageId,r=n.state,s=TokenizationRegistry.get(o);if(!s)return this.enterLanguage(o),this.emit(i,""),r;const a=s.tokenizeEncoded(e,t,r);if(0!==i)for(let l=0,c=a.tokens.length;l<c;l+=2)a.tokens[l]+=i;return this._prependTokens=MonarchModernTokensCollector._merge(this._prependTokens,this._tokens,a.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,a.endState}finalize(e){return new EncodedTokenizationResult(MonarchModernTokensCollector._merge(this._prependTokens,this._tokens,null),e)}}class MonarchTokenizer{constructor(e,t,n,i){this._languageService=e,this._standaloneThemeService=t,this._languageId=n,this._lexer=i,this._embeddedLanguages=Object.create(null),this.embeddedLoaded=Promise.resolve(void 0);let o=!1;this._tokenizationRegistryListener=TokenizationRegistry.onDidChange((e=>{if(o)return;let t=!1;for(let n=0,i=e.changedLanguages.length;n<i;n++){const i=e.changedLanguages[n];if(this._embeddedLanguages[i]){t=!0;break}}t&&(o=!0,TokenizationRegistry.fire([this._languageId]),o=!1)}))}dispose(){this._tokenizationRegistryListener.dispose()}getLoadStatus(){const e=[];for(let t in this._embeddedLanguages){const n=TokenizationRegistry.get(t);if(n){if(n instanceof MonarchTokenizer){const t=n.getLoadStatus();!1===t.loaded&&e.push(t.promise)}}else TokenizationRegistry.isResolved(t)||e.push(TokenizationRegistry.getOrCreate(t))}return 0===e.length?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then((e=>{}))}}getInitialState(){const e=MonarchStackElementFactory.create(null,this._lexer.start);return MonarchLineStateFactory.create(e,null)}tokenize(e,t,n){const i=new MonarchClassicTokensCollector,o=this._tokenize(e,t,n,i);return i.finalize(o)}tokenizeEncoded(e,t,n){const i=new MonarchModernTokensCollector(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,n,i);return i.finalize(o)}_tokenize(e,t,n,i){return n.embeddedLanguageData?this._nestedTokenize(e,t,n,0,i):this._myTokenize(e,t,n,0,i)}_findLeavingNestedLanguageOffset(e,t){let n=this._lexer.tokenizer[t.stack.state];if(!n&&(n=findRules(this._lexer,t.stack.state),!n))throw createError(this._lexer,"tokenizer state is not defined: "+t.stack.state);let i=-1,o=!1;for(const r of n){if(!isIAction(r.action)||"@pop"!==r.action.nextEmbedded)continue;o=!0;let t=r.regex;const n=r.regex.source;if("^(?:"===n.substr(0,4)&&")"===n.substr(n.length-1,1)){const e=(t.ignoreCase?"i":"")+(t.unicode?"u":"");t=new RegExp(n.substr(4,n.length-5),e)}const s=e.search(t);-1===s||0!==s&&r.matchOnlyAtLineStart||(-1===i||s<i)&&(i=s)}if(!o)throw createError(this._lexer,'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: '+t.stack.state);return i}_nestedTokenize(e,t,n,i,o){const r=this._findLeavingNestedLanguageOffset(e,n);if(-1===r){const r=o.nestedLanguageTokenize(e,t,n.embeddedLanguageData,i);return MonarchLineStateFactory.create(n.stack,new EmbeddedLanguageData(n.embeddedLanguageData.languageId,r))}const s=e.substring(0,r);s.length>0&&o.nestedLanguageTokenize(s,!1,n.embeddedLanguageData,i);const a=e.substring(r);return this._myTokenize(a,t,n,i+r,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,n,i,o){o.enterLanguage(this._languageId);const r=e.length,s=t&&this._lexer.includeLF?e+"\n":e,a=s.length;let l=n.embeddedLanguageData,c=n.stack,d=0,u=null,h=!0;for(;h||d<a;){const n=d,g=c.depth,p=u?u.groups.length:0,f=c.state;let m=null,v=null,_=null,C=null,b=null;if(u){m=u.matches;const e=u.groups.shift();v=e.matched,_=e.action,C=u.rule,0===u.groups.length&&(u=null)}else{if(!h&&d>=a)break;h=!1;let e=this._lexer.tokenizer[f];if(!e&&(e=findRules(this._lexer,f),!e))throw createError(this._lexer,"tokenizer state is not defined: "+f);let t=s.substr(d);for(const n of e)if((0===d||!n.matchOnlyAtLineStart)&&(m=t.match(n.regex),m)){v=m[0],_=n.action;break}}if(m||(m=[""],v=""),_||(d<a&&(m=[s.charAt(d)],v=m[0]),_=this._lexer.defaultToken),null===v)break;for(d+=v.length;isFuzzyAction(_)&&isIAction(_)&&_.test;)_=_.test(v,m,f,d===a);let y=null;if("string"==typeof _||Array.isArray(_))y=_;else if(_.group)y=_.group;else if(null!==_.token&&void 0!==_.token){if(y=_.tokenSubst?substituteMatches(this._lexer,_.token,v,m,f):_.token,_.nextEmbedded)if("@pop"===_.nextEmbedded){if(!l)throw createError(this._lexer,"cannot pop embedded language if not inside one");l=null}else{if(l)throw createError(this._lexer,"cannot enter embedded language from within an embedded language");b=substituteMatches(this._lexer,_.nextEmbedded,v,m,f)}if(_.goBack&&(d=Math.max(0,d-_.goBack)),_.switchTo&&"string"==typeof _.switchTo){let e=substituteMatches(this._lexer,_.switchTo,v,m,f);if("@"===e[0]&&(e=e.substr(1)),!findRules(this._lexer,e))throw createError(this._lexer,"trying to switch to a state '"+e+"' that is undefined in rule: "+this._safeRuleName(C));c=c.switchTo(e)}else{if(_.transform&&"function"==typeof _.transform)throw createError(this._lexer,"action.transform not supported");if(_.next)if("@push"===_.next){if(c.depth>=this._lexer.maxStack)throw createError(this._lexer,"maximum tokenizer stack size reached: ["+c.state+","+c.parent.state+",...]");c=c.push(f)}else if("@pop"===_.next){if(c.depth<=1)throw createError(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(C));c=c.pop()}else if("@popall"===_.next)c=c.popall();else{let e=substituteMatches(this._lexer,_.next,v,m,f);if("@"===e[0]&&(e=e.substr(1)),!findRules(this._lexer,e))throw createError(this._lexer,"trying to set a next state '"+e+"' that is undefined in rule: "+this._safeRuleName(C));c=c.push(e)}}_.log&&"string"==typeof _.log&&log(this._lexer,this._lexer.languageId+": "+substituteMatches(this._lexer,_.log,v,m,f))}if(null===y)throw createError(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(C));const S=n=>{const r=this._languageService.getLanguageIdByLanguageName(n)||this._languageService.getLanguageIdByMimeType(n)||n,s=this._getNestedEmbeddedLanguageData(r);if(d<a){const n=e.substr(d);return this._nestedTokenize(n,t,MonarchLineStateFactory.create(c,s),i+d,o)}return MonarchLineStateFactory.create(c,s)};if(Array.isArray(y)){if(u&&u.groups.length>0)throw createError(this._lexer,"groups cannot be nested: "+this._safeRuleName(C));if(m.length!==y.length+1)throw createError(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(C));let e=0;for(let t=1;t<m.length;t++)e+=m[t].length;if(e!==v.length)throw createError(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(C));u={rule:C,matches:m,groups:[]};for(let t=0;t<y.length;t++)u.groups[t]={action:y[t],matched:m[t+1]};d-=v.length}else{{if("@rematch"===y&&(d-=v.length,v="",m=null,y="",null!==b))return S(b);if(0===v.length){if(0===a||g!==c.depth||f!==c.state||(u?u.groups.length:0)!==p)continue;throw createError(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(C))}let e=null;if(isString(y)&&0===y.indexOf("@brackets")){const t=y.substr("@brackets".length),n=findBracket(this._lexer,v);if(!n)throw createError(this._lexer,"@brackets token returned but no bracket defined as: "+v);e=sanitize(n.token+t)}else{e=sanitize(""===y?"":y+this._lexer.tokenPostfix)}n<r&&o.emit(n+i,e)}if(null!==b)return S(b)}}return MonarchLineStateFactory.create(c,l)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new EmbeddedLanguageData(e,NullState);e!==this._languageId&&(TokenizationRegistry.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=TokenizationRegistry.get(e);return new EmbeddedLanguageData(e,t?t.getInitialState():NullState)}}function findBracket(e,t){if(!t)return null;t=fixCase(e,t);const n=e.brackets;for(const i of n){if(i.open===t)return{token:i.token,bracketType:1};if(i.close===t)return{token:i.token,bracketType:-1}}return null}var __awaiter$7=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},_a$2;const ttPolicy=null===(_a$2=window.trustedTypes)||void 0===_a$2?void 0:_a$2.createPolicy("standaloneColorizer",{createHTML:e=>e});class Colorizer{static colorizeElement(e,t,n,i){const o=(i=i||{}).theme||"vs",r=i.mimeType||n.getAttribute("lang")||n.getAttribute("data-lang");if(!r)return Promise.resolve();const s=t.getLanguageIdByMimeType(r)||r;e.setTheme(o);const a=n.firstChild?n.firstChild.nodeValue:"";n.className+=" "+o;return this.colorize(t,a||"",s,i).then((e=>{var t;const i=null!==(t=null==ttPolicy?void 0:ttPolicy.createHTML(e))&&void 0!==t?t:e;n.innerHTML=i}),(e=>{}))}static colorize(e,t,n,i){return __awaiter$7(this,void 0,void 0,(function*(){const o=e.languageIdCodec;let r=4;i&&"number"==typeof i.tabSize&&(r=i.tabSize),startsWithUTF8BOM(t)&&(t=t.substr(1));const s=splitLines(t);if(!e.isRegisteredLanguageId(n))return _fakeColorize(s,r,o);const a=yield TokenizationRegistry.getOrCreate(n);return a?_colorize(s,r,a,o):_fakeColorize(s,r,o)}))}static colorizeLine(e,t,n,i,o=4){const r=ViewLineRenderingData.isBasicASCII(e,t),s=ViewLineRenderingData.containsRTL(e,r,n);return renderViewLine2(new RenderLineInput(!1,!0,e,!1,r,s,0,i,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,n=4){const i=e.getLineContent(t);e.forceTokenization(t);const o=e.getLineTokens(t).inflate();return this.colorizeLine(i,e.mightContainNonBasicASCII(),e.mightContainRTL(),o,n)}}function _colorize(e,t,n,i){return new Promise(((o,r)=>{const s=()=>{const a=_actualColorize(e,t,n,i);if(n instanceof MonarchTokenizer){const e=n.getLoadStatus();if(!1===e.loaded)return void e.promise.then(s,r)}o(a)};s()}))}function _fakeColorize(e,t,n){let i=[];const o=new Uint32Array(2);o[0]=0,o[1]=16793600;for(let r=0,s=e.length;r<s;r++){const s=e[r];o[0]=s.length;const a=new LineTokens(o,s,n),l=ViewLineRenderingData.isBasicASCII(s,!0),c=ViewLineRenderingData.containsRTL(s,l,!0),d=renderViewLine2(new RenderLineInput(!1,!0,s,!1,l,c,0,a,[],t,0,0,0,0,-1,"none",!1,!1,null));i=i.concat(d.html),i.push("<br/>")}return i.join("")}function _actualColorize(e,t,n,i){let o=[],r=n.getInitialState();for(let s=0,a=e.length;s<a;s++){const a=e[s],l=n.tokenizeEncoded(a,!0,r);LineTokens.convertToEndOffset(l.tokens,a.length);const c=new LineTokens(l.tokens,a,i),d=ViewLineRenderingData.isBasicASCII(a,!0),u=ViewLineRenderingData.containsRTL(a,d,!0),h=renderViewLine2(new RenderLineInput(!1,!0,a,!1,d,u,0,c.inflate(),[],t,0,0,0,0,-1,"none",!1,!1,null));o=o.concat(h.html),o.push("<br/>"),r=l.endState}return o.join("")}var __decorate$h=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$g=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let AbstractCodeEditorService=class extends Disposable{constructor(e){super(),this._themeService=e,this._onCodeEditorAdd=this._register(new Emitter$1),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new Emitter$1),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onDiffEditorAdd=this._register(new Emitter$1),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new Emitter$1),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map((e=>this._codeEditors[e]))}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map((e=>this._diffEditors[e]))}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const n of t){if(n.hasTextFocus())return n;n.hasWidgetFocus()&&(e=n)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach((t=>t.removeDecorations(e)))))}setModelProperty(e,t,n){const i=e.toString();let o;this._modelProperties.has(i)?o=this._modelProperties.get(i):(o=new Map,this._modelProperties.set(i,o)),o.set(t,n)}getModelProperty(e,t){const n=e.toString();if(this._modelProperties.has(n)){return this._modelProperties.get(n).get(t)}}};AbstractCodeEditorService=__decorate$h([__param$g(0,IThemeService)],AbstractCodeEditorService);var __decorate$g=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$f=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let StandaloneCodeEditorService=class extends AbstractCodeEditorService{constructor(e,t){super(t),this.onCodeEditorAdd((()=>this._checkContextKey())),this.onCodeEditorRemove((()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}openCodeEditor(e,t,n){return t?Promise.resolve(this.doOpenEditor(t,e)):Promise.resolve(null)}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const n=t.resource.scheme;if(n===Schemas.http||n===Schemas.https)return windowOpenNoOpener(t.resource.toString()),e}return null}const n=t.options?t.options.selection:null;if(n)if("number"==typeof n.endLineNumber&&"number"==typeof n.endColumn)e.setSelection(n),e.revealRangeInCenter(n,1);else{const t={lineNumber:n.startLineNumber,column:n.startColumn};e.setPosition(t),e.revealPositionInCenter(t,1)}return e}findModel(e,t){const n=e.getModel();return n&&n.uri.toString()!==t.toString()?null:n}};StandaloneCodeEditorService=__decorate$g([__param$f(0,IContextKeyService),__param$f(1,IThemeService)],StandaloneCodeEditorService),registerSingleton(ICodeEditorService,StandaloneCodeEditorService);const ILayoutService=createDecorator("layoutService");var __decorate$f=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$e=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let StandaloneLayoutService=class{constructor(e){this._codeEditorService=e,this.onDidLayout=Event$1.None}get dimension(){return this._dimension||(this._dimension=getClientArea(window.document.body)),this._dimension}get hasContainer(){return!1}get container(){throw new Error("ILayoutService.container is not available in the standalone editor!")}focus(){var e;null===(e=this._codeEditorService.getFocusedCodeEditor())||void 0===e||e.focus()}};StandaloneLayoutService=__decorate$f([__param$e(0,ICodeEditorService)],StandaloneLayoutService);let EditorScopedLayoutService=class extends StandaloneLayoutService{constructor(e,t){super(t),this._container=e}get hasContainer(){return!1}get container(){return this._container}};EditorScopedLayoutService=__decorate$f([__param$e(1,ICodeEditorService)],EditorScopedLayoutService),registerSingleton(ILayoutService,StandaloneLayoutService);var __decorate$e=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$d=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$6=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};function getResourceLabel(e){return e.scheme===Schemas.file?e.fsPath:e.path}let stackElementCounter=0;class ResourceStackElement{constructor(e,t,n,i,o,r,s){this.id=++stackElementCounter,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=n,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=i,this.groupOrder=o,this.sourceId=r,this.sourceOrder=s,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class ResourceReasonPair{constructor(e,t){this.resourceLabel=e,this.reason=t}}class RemovedResources{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,i]of this.elements){(0===i.reason?e:t).push(i.resourceLabel)}let n=[];return e.length>0&&n.push(localize({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&n.push(localize({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),n.join("\n")}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class WorkspaceStackElement{constructor(e,t,n,i,o,r,s){this.id=++stackElementCounter,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=n,this.groupId=i,this.groupOrder=o,this.sourceId=r,this.sourceOrder=s,this.removedResources=null,this.invalidatedResources=null}canSplit(){return"function"==typeof this.actual.split}removeResource(e,t,n){this.removedResources||(this.removedResources=new RemovedResources),this.removedResources.has(t)||this.removedResources.set(t,new ResourceReasonPair(e,n))}setValid(e,t,n){n?this.invalidatedResources&&(this.invalidatedResources.delete(t),0===this.invalidatedResources.size&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new RemovedResources),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new ResourceReasonPair(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class ResourceEditStack{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){let e=[];e.push(`* ${this.strResource}:`);for(let t=0;t<this._past.length;t++)e.push(` * [UNDO] ${this._past[t]}`);for(let t=this._future.length-1;t>=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join("\n")}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){1===e.type?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const n of this._past)t(n.actual)&&this._setElementValidFlag(n,e);for(const n of this._future)t(n.actual)&&this._setElementValidFlag(n,e)}pushElement(e){for(const t of this._future)1===t.type&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let n=0,i=this._past.length;n<i;n++)t.push(this._past[n].id);for(let n=this._future.length-1;n>=0;n--)t.push(this._future[n].id);return new ResourceEditStackSnapshot(e,t)}restoreSnapshot(e){const t=e.elements.length;let n=!0,i=0,o=-1;for(let s=0,a=this._past.length;s<a;s++,i++){const r=this._past[s];n&&(i>=t||r.id!==e.elements[i])&&(n=!1,o=0),n||1!==r.type||r.removeResource(this.resourceLabel,this.strResource,0)}let r=-1;for(let s=this._future.length-1;s>=0;s--,i++){const o=this._future[s];n&&(i>=t||o.id!==e.elements[i])&&(n=!1,r=s),n||1!==o.type||o.removeResource(this.resourceLabel,this.strResource,0)}-1!==o&&(this._past=this._past.slice(0,o)),-1!==r&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const n of this._past)e.push(n.actual);for(const n of this._future)t.push(n.actual);return{past:e,future:t}}getClosestPastElement(){return 0===this._past.length?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return 0===this._future.length?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let n=this._past.length-1;n>=0;n--)if(this._past[n]===e){t.has(this.strResource)?this._past[n]=t.get(this.strResource):this._past.splice(n,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let n=this._future.length-1;n>=0;n--)if(this._future[n]===e){t.has(this.strResource)?this._future[n]=t.get(this.strResource):this._future.splice(n,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class EditStackSnapshot{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,n=this.editStacks.length;t<n;t++)this._versionIds[t]=this.editStacks[t].versionId}isValid(){for(let e=0,t=this.editStacks.length;e<t;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}}const missingEditStack=new ResourceEditStack("","");missingEditStack.locked=!0;let UndoRedoService=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){let t=[];for(const n of this._editStacks)t.push(n[1].toString())}pushElement(e,t=UndoRedoGroup.None,n=UndoRedoSource.None){if(0===e.type){const i=getResourceLabel(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new ResourceStackElement(e,i,o,t.id,t.nextOrder(),n.id,n.nextOrder()))}else{const i=new Set,o=[],r=[];for(const t of e.resources){const e=getResourceLabel(t),n=this.getUriComparisonKey(t);i.has(n)||(i.add(n),o.push(e),r.push(n))}1===o.length?this._pushElement(new ResourceStackElement(e,o[0],r[0],t.id,t.nextOrder(),n.id,n.nextOrder())):this._pushElement(new WorkspaceStackElement(e,o,r,t.id,t.nextOrder(),n.id,n.nextOrder()))}}_pushElement(e){for(let t=0,n=e.strResources.length;t<n;t++){const n=e.resourceLabels[t],i=e.strResources[t];let o;this._editStacks.has(i)?o=this._editStacks.get(i):(o=new ResourceEditStack(n,i),this._editStacks.set(i,o)),o.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const e=this._editStacks.get(t);if(e.hasFutureElements())return null;const n=e.getClosestPastElement();return n?n.actual:null}return null}_splitPastWorkspaceElement(e,t){const n=e.actual.split(),i=new Map;for(const o of n){const e=getResourceLabel(o.resource),t=this.getUriComparisonKey(o.resource),n=new ResourceStackElement(o,e,t,0,0,0,0);i.set(n.strResource,n)}for(const o of e.strResources){if(t&&t.has(o))continue;this._editStacks.get(o).splitPastWorkspaceElement(e,i)}}_splitFutureWorkspaceElement(e,t){const n=e.actual.split(),i=new Map;for(const o of n){const e=getResourceLabel(o.resource),t=this.getUriComparisonKey(o.resource),n=new ResourceStackElement(o,e,t,0,0,0,0);i.set(n.strResource,n)}for(const o of e.strResources){if(t&&t.has(o))continue;this._editStacks.get(o).splitFutureWorkspaceElement(e,i)}}removeElements(e){const t="string"==typeof e?e:this.getUriComparisonKey(e);if(this._editStacks.has(t)){this._editStacks.get(t).dispose(),this._editStacks.delete(t)}}setElementsValidFlag(e,t,n){const i=this.getUriComparisonKey(e);if(this._editStacks.has(i)){this._editStacks.get(i).setElementsValidFlag(t,n)}}createSnapshot(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){return this._editStacks.get(t).createSnapshot(e)}return new ResourceEditStackSnapshot(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const n=this._editStacks.get(t);n.restoreSnapshot(e),n.hasPastElements()||n.hasFutureElements()||(n.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){return this._editStacks.get(t).getElements()}return{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,n=null;for(const[i,o]of this._editStacks){const r=o.getClosestPastElement();r&&(r.sourceId===e&&(!t||r.sourceOrder>t.sourceOrder)&&(t=r,n=i))}return[t,n]}canUndo(e){if(e instanceof UndoRedoSource){const[,t]=this._findClosestUndoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){return this._editStacks.get(t).hasPastElements()}return!1}_onError(e,t){onUnexpectedError(e);for(const n of t.strResources)this.removeElements(n);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,n,i,o){const r=this._acquireLocks(n);let s;try{s=t()}catch(a){return r(),i.dispose(),this._onError(a,e)}return s?s.then((()=>(r(),i.dispose(),o())),(t=>(r(),i.dispose(),this._onError(t,e)))):(r(),i.dispose(),o())}_invokeWorkspacePrepare(e){return __awaiter$6(this,void 0,void 0,(function*(){if(void 0===e.actual.prepareUndoRedo)return Disposable.None;const t=e.actual.prepareUndoRedo();return void 0===t?Disposable.None:t}))}_invokeResourcePrepare(e,t){if(1!==e.actual.type||void 0===e.actual.prepareUndoRedo)return t(Disposable.None);const n=e.actual.prepareUndoRedo();return n?isDisposable(n)?t(n):n.then((e=>t(e))):t(Disposable.None)}_getAffectedEditStacks(e){const t=[];for(const n of e.strResources)t.push(this._editStacks.get(n)||missingEditStack);return new EditStackSnapshot(t)}_tryToSplitAndUndo(e,t,n,i){if(t.canSplit())return this._splitPastWorkspaceElement(t,n),this._notificationService.warn(i),new WorkspaceVerificationError(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(i),new WorkspaceVerificationError}_checkWorkspaceUndo(e,t,n,i){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,localize({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(i&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,localize({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const s of n.editStacks)s.getClosestPastElement()!==t&&o.push(s.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,localize({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const s of n.editStacks)s.locked&&r.push(s.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,localize({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):n.isValid()?null:this._tryToSplitAndUndo(e,t,null,localize({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,n){const i=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,i,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,i,n)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const n=t.getClosestPastElement();if(n){if(n===e){const n=t.getSecondClosestPastElement();if(n&&n.groupId===e.groupId)return!0}if(n.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,n,i){return __awaiter$6(this,void 0,void 0,(function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){const o=yield this._dialogService.show(Severity$2.Info,localize("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),[localize({key:"ok",comment:["{0} denotes a number that is > 1"]},"Undo in {0} Files",n.editStacks.length),localize("nok","Undo this File"),localize("cancel","Cancel")],{cancelId:2});if(2===o.choice)return;if(1===o.choice)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const r=this._checkWorkspaceUndo(e,t,n,!1);if(r)return r.returnValue;i=!0}let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(s){return this._onError(s,t)}const r=this._checkWorkspaceUndo(e,t,n,!0);if(r)return o.dispose(),r.returnValue;for(const e of n.editStacks)e.moveBackward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.undo()),n,o,(()=>this._continueUndoInGroup(t.groupId,i)))}))}_resourceUndo(e,t,n){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(i=>(e.moveBackward(t),this._safeInvokeWithLocks(t,(()=>t.actual.undo()),new EditStackSnapshot([e]),i,(()=>this._continueUndoInGroup(t.groupId,n))))));{const e=localize({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[i,o]of this._editStacks){const r=o.getClosestPastElement();r&&(r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,n=i))}return[t,n]}_continueUndoInGroup(e,t){if(!e)return;const[,n]=this._findClosestUndoElementInGroup(e);return n?this._undo(n,0,t):void 0}undo(e){if(e instanceof UndoRedoSource){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return"string"==typeof e?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,n){if(!this._editStacks.has(e))return;const i=this._editStacks.get(e),o=i.getClosestPastElement();if(!o)return;if(o.groupId){const[e,i]=this._findClosestUndoElementInGroup(o.groupId);if(o!==e&&i)return this._undo(i,t,n)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!n)return this._confirmAndContinueUndo(e,t,o);try{return 1===o.type?this._workspaceUndo(e,o,n):this._resourceUndo(i,o,n)}finally{}}_confirmAndContinueUndo(e,t,n){return __awaiter$6(this,void 0,void 0,(function*(){if(1!==(yield this._dialogService.show(Severity$2.Info,localize("confirmDifferentSource","Would you like to undo '{0}'?",n.label),[localize("confirmDifferentSource.yes","Yes"),localize("confirmDifferentSource.no","No")],{cancelId:1})).choice)return this._undo(e,t,!0)}))}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,n=null;for(const[i,o]of this._editStacks){const r=o.getClosestFutureElement();r&&(r.sourceId===e&&(!t||r.sourceOrder<t.sourceOrder)&&(t=r,n=i))}return[t,n]}canRedo(e){if(e instanceof UndoRedoSource){const[,t]=this._findClosestRedoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){return this._editStacks.get(t).hasFutureElements()}return!1}_tryToSplitAndRedo(e,t,n,i){if(t.canSplit())return this._splitFutureWorkspaceElement(t,n),this._notificationService.warn(i),new WorkspaceVerificationError(this._redo(e));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(i),new WorkspaceVerificationError}_checkWorkspaceRedo(e,t,n,i){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,localize({key:"cannotWorkspaceRedo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not redo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(i&&t.invalidatedResources)return this._tryToSplitAndRedo(e,t,t.invalidatedResources,localize({key:"cannotWorkspaceRedo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not redo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const s of n.editStacks)s.getClosestFutureElement()!==t&&o.push(s.resourceLabel);if(o.length>0)return this._tryToSplitAndRedo(e,t,null,localize({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const s of n.editStacks)s.locked&&r.push(s.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,localize({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):n.isValid()?null:this._tryToSplitAndRedo(e,t,null,localize({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const n=this._getAffectedEditStacks(t),i=this._checkWorkspaceRedo(e,t,n,!1);return i?i.returnValue:this._executeWorkspaceRedo(e,t,n)}_executeWorkspaceRedo(e,t,n){return __awaiter$6(this,void 0,void 0,(function*(){let i;try{i=yield this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceRedo(e,t,n,!0);if(o)return i.dispose(),o.returnValue;for(const e of n.editStacks)e.moveForward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.redo()),n,i,(()=>this._continueRedoInGroup(t.groupId)))}))}_resourceRedo(e,t){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(n=>(e.moveForward(t),this._safeInvokeWithLocks(t,(()=>t.actual.redo()),new EditStackSnapshot([e]),n,(()=>this._continueRedoInGroup(t.groupId))))));{const e=localize({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,n=null;for(const[i,o]of this._editStacks){const r=o.getClosestFutureElement();r&&(r.groupId===e&&(!t||r.groupOrder<t.groupOrder)&&(t=r,n=i))}return[t,n]}_continueRedoInGroup(e){if(!e)return;const[,t]=this._findClosestRedoElementInGroup(e);return t?this._redo(t):void 0}redo(e){if(e instanceof UndoRedoSource){const[,t]=this._findClosestRedoElementWithSource(e.id);return t?this._redo(t):void 0}return"string"==typeof e?this._redo(e):this._redo(this.getUriComparisonKey(e))}_redo(e){if(!this._editStacks.has(e))return;const t=this._editStacks.get(e),n=t.getClosestFutureElement();if(n){if(n.groupId){const[e,t]=this._findClosestRedoElementInGroup(n.groupId);if(n!==e&&t)return this._redo(t)}try{return 1===n.type?this._workspaceRedo(e,n):this._resourceRedo(t,n)}finally{}}}};UndoRedoService=__decorate$e([__param$d(0,IDialogService),__param$d(1,INotificationService)],UndoRedoService);class WorkspaceVerificationError{constructor(e){this.returnValue=e}}registerSingleton(IUndoRedoService,UndoRedoService);const editorConfigurationBaseNode=Object.freeze({id:"editor",order:5,type:"object",title:localize("editorConfigurationTitle","Editor"),scope:5}),editorConfiguration=Object.assign(Object.assign({},editorConfigurationBaseNode),{properties:{"editor.tabSize":{type:"number",default:EDITOR_MODEL_DEFAULTS.tabSize,minimum:1,markdownDescription:localize("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")},"editor.insertSpaces":{type:"boolean",default:EDITOR_MODEL_DEFAULTS.insertSpaces,markdownDescription:localize("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")},"editor.detectIndentation":{type:"boolean",default:EDITOR_MODEL_DEFAULTS.detectIndentation,markdownDescription:localize("detectIndentation","Controls whether `#editor.tabSize#` and `#editor.insertSpaces#` will be automatically detected when a file is opened based on the file contents.")},"editor.trimAutoWhitespace":{type:"boolean",default:EDITOR_MODEL_DEFAULTS.trimAutoWhitespace,description:localize("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:EDITOR_MODEL_DEFAULTS.largeFileOptimizations,description:localize("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:localize("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[localize("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),localize("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),localize("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:localize("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[localize("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),localize("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),localize("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:localize("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:localize("stablePeek","Keep peek editors open even when double clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:localize("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.language.brackets":{type:"array",default:!1,description:localize("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:localize("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:localize("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:"array",default:!1,description:localize("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:localize("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:localize("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:5e3,description:localize("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:50,description:localize("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:!0,description:localize("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:!0,description:localize("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:!0,description:localize("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:!1,description:localize("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:"inherit",markdownEnumDescriptions:[localize("wordWrap.off","Lines will never wrap."),localize("wordWrap.on","Lines will wrap at the viewport width."),localize("wordWrap.inherit","Lines will wrap according to the `#editor.wordWrap#` setting.")]}}});function isConfigurationPropertySchema(e){return void 0!==e.type||void 0!==e.anyOf}for(const C of editorOptionsRegistry){const e=C.schema;if(void 0!==e)if(isConfigurationPropertySchema(e))editorConfiguration.properties[`editor.${C.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(editorConfiguration.properties[t]=e[t])}let cachedEditorConfigurationKeys=null;function getEditorConfigurationKeys(){return null===cachedEditorConfigurationKeys&&(cachedEditorConfigurationKeys=Object.create(null),Object.keys(editorConfiguration.properties).forEach((e=>{cachedEditorConfigurationKeys[e]=!0}))),cachedEditorConfigurationKeys}function isEditorConfigurationKey(e){return getEditorConfigurationKeys()[`editor.${e}`]||!1}function isDiffEditorConfigurationKey(e){return getEditorConfigurationKeys()[`diffEditor.${e}`]||!1}const configurationRegistry=Registry.as(Extensions$3.Configuration);configurationRegistry.registerConfiguration(editorConfiguration);class ConfigurationModel{constructor(e={},t=[],n=[]){this._contents=e,this._keys=t,this._overrides=n,this.isFrozen=!1,this.overrideConfigurations=new Map}get contents(){return this.checkAndFreeze(this._contents)}get overrides(){return this.checkAndFreeze(this._overrides)}get keys(){return this.checkAndFreeze(this._keys)}isEmpty(){return 0===this._keys.length&&0===Object.keys(this._contents).length&&0===this._overrides.length}getValue(e){return e?getConfigurationValue(this.contents,e):this.contents}getOverrideValue(e,t){const n=this.getContentsForOverrideIdentifer(t);return n?e?getConfigurationValue(n,e):n:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){const t=deepClone(this.contents),n=deepClone(this.overrides),i=[...this.keys];for(const o of e){this.mergeContents(t,o.contents);for(const e of o.overrides){const[t]=n.filter((t=>equals$1(t.identifiers,e.identifiers)));t?(this.mergeContents(t.contents,e.contents),t.keys.push(...e.keys),t.keys=distinct(t.keys)):n.push(deepClone(e))}for(const e of o.keys)-1===i.indexOf(e)&&i.push(e)}return new ConfigurationModel(t,i,n)}freeze(){return this.isFrozen=!0,this}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||"object"!=typeof t||!Object.keys(t).length)return this;let n={};for(const i of distinct([...Object.keys(this.contents),...Object.keys(t)])){let e=this.contents[i],o=t[i];o&&("object"==typeof e&&"object"==typeof o?(e=deepClone(e),this.mergeContents(e,o)):e=o),n[i]=e}return new ConfigurationModel(n,this.keys,this.overrides)}mergeContents(e,t){for(const n of Object.keys(t))n in e&&isObject(e[n])&&isObject(t[n])?this.mergeContents(e[n],t[n]):e[n]=deepClone(t[n])}checkAndFreeze(e){return this.isFrozen&&!Object.isFrozen(e)?deepFreeze(e):e}getContentsForOverrideIdentifer(e){let t=null,n=null;const i=e=>{e&&(n?this.mergeContents(n,e):n=deepClone(e))};for(const o of this.overrides)equals$1(o.identifiers,[e])?t=o.contents:o.identifiers.includes(e)&&i(o.contents);return i(t),n}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.addKey(e),addToValueTree(this.contents,e,t,(e=>{throw new Error(e)}))}removeValue(e){this.removeKey(e)&&removeFromValueTree(this.contents,e)}addKey(e){let t=this.keys.length;for(let n=0;n<t;n++)0===e.indexOf(this.keys[n])&&(t=n);this.keys.splice(t,1,e)}removeKey(e){let t=this.keys.indexOf(e);return-1!==t&&(this.keys.splice(t,1),!0)}}class DefaultConfigurationModel extends ConfigurationModel{constructor(e={}){const t=Registry.as(Extensions$3.Configuration).getConfigurationProperties(),n=Object.keys(t),i=Object.create(null),o=[];for(const r in t){const n=e[r];addToValueTree(i,r,void 0!==n?n:t[r].default,(e=>{}))}for(const r of Object.keys(i))OVERRIDE_PROPERTY_REGEX.test(r)&&o.push({identifiers:overrideIdentifiersFromKey(r),keys:Object.keys(i[r]),contents:toValuesTree(i[r],(e=>{}))});super(i,n,o)}}class Configuration{constructor(e,t,n=new ConfigurationModel,i=new ConfigurationModel,o=new ResourceMap,r=new ConfigurationModel,s=new ResourceMap,a=!0){this._defaultConfiguration=e,this._localUserConfiguration=t,this._remoteUserConfiguration=n,this._workspaceConfiguration=i,this._folderConfigurations=o,this._memoryConfiguration=r,this._memoryConfigurationByResource=s,this._freeze=a,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new ResourceMap,this._userConfiguration=null}getValue(e,t,n){return this.getConsolidateConfigurationModel(t,n).getValue(e)}updateValue(e,t,n={}){let i;n.resource?(i=this._memoryConfigurationByResource.get(n.resource),i||(i=new ConfigurationModel,this._memoryConfigurationByResource.set(n.resource,i))):i=this._memoryConfiguration,void 0===t?i.removeValue(e):i.setValue(e,t),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,n){const i=this.getConsolidateConfigurationModel(t,n),o=this.getFolderConfigurationModelForResource(t.resource,n),r=t.resource&&this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration,s=t.overrideIdentifier?this._defaultConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this._defaultConfiguration.freeze().getValue(e),a=t.overrideIdentifier?this.userConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this.userConfiguration.freeze().getValue(e),l=t.overrideIdentifier?this.localUserConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this.localUserConfiguration.freeze().getValue(e),c=t.overrideIdentifier?this.remoteUserConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this.remoteUserConfiguration.freeze().getValue(e),d=n?t.overrideIdentifier?this._workspaceConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this._workspaceConfiguration.freeze().getValue(e):void 0,u=o?t.overrideIdentifier?o.freeze().override(t.overrideIdentifier).getValue(e):o.freeze().getValue(e):void 0,h=t.overrideIdentifier?r.override(t.overrideIdentifier).getValue(e):r.getValue(e),g=i.getValue(e),p=distinct(flatten(i.overrides.map((e=>e.identifiers)))).filter((t=>void 0!==i.getOverrideValue(e,t)));return{defaultValue:s,userValue:a,userLocalValue:l,userRemoteValue:c,workspaceValue:d,workspaceFolderValue:u,memoryValue:h,value:g,default:void 0!==s?{value:this._defaultConfiguration.freeze().getValue(e),override:t.overrideIdentifier?this._defaultConfiguration.freeze().getOverrideValue(e,t.overrideIdentifier):void 0}:void 0,user:void 0!==a?{value:this.userConfiguration.freeze().getValue(e),override:t.overrideIdentifier?this.userConfiguration.freeze().getOverrideValue(e,t.overrideIdentifier):void 0}:void 0,userLocal:void 0!==l?{value:this.localUserConfiguration.freeze().getValue(e),override:t.overrideIdentifier?this.localUserConfiguration.freeze().getOverrideValue(e,t.overrideIdentifier):void 0}:void 0,userRemote:void 0!==c?{value:this.remoteUserConfiguration.freeze().getValue(e),override:t.overrideIdentifier?this.remoteUserConfiguration.freeze().getOverrideValue(e,t.overrideIdentifier):void 0}:void 0,workspace:void 0!==d?{value:this._workspaceConfiguration.freeze().getValue(e),override:t.overrideIdentifier?this._workspaceConfiguration.freeze().getOverrideValue(e,t.overrideIdentifier):void 0}:void 0,workspaceFolder:void 0!==u?{value:null==o?void 0:o.freeze().getValue(e),override:t.overrideIdentifier?null==o?void 0:o.freeze().getOverrideValue(e,t.overrideIdentifier):void 0}:void 0,memory:void 0!==h?{value:r.getValue(e),override:t.overrideIdentifier?r.getOverrideValue(e,t.overrideIdentifier):void 0}:void 0,overrideIdentifiers:p.length?p:void 0}}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration),this._freeze&&this._userConfiguration.freeze()),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidateConfigurationModel(e,t){let n=this.getConsolidatedConfigurationModelForResource(e,t);return e.overrideIdentifier?n.override(e.overrideIdentifier):n}getConsolidatedConfigurationModelForResource({resource:e},t){let n=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const i=t.getFolder(e);i&&(n=this.getFolderConsolidatedConfiguration(i.uri)||n);const o=this._memoryConfigurationByResource.get(e);o&&(n=n.merge(o))}return n}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration),this._freeze&&(this._workspaceConfiguration=this._workspaceConfiguration.freeze())),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const n=this.getWorkspaceConsolidatedConfiguration(),i=this._folderConfigurations.get(e);i?(t=n.merge(i),this._freeze&&(t=t.freeze()),this._foldersConsolidatedConfigurations.set(e,t)):t=n}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const n=t.getFolder(e);if(n)return this._folderConfigurations.get(n.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce(((e,t)=>{const{contents:n,overrides:i,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:n,overrides:i,keys:o}]),e}),[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),n=this.parseConfigurationModel(e.user),i=this.parseConfigurationModel(e.workspace),o=e.folders.reduce(((e,t)=>(e.set(URI.revive(t[0]),this.parseConfigurationModel(t[1])),e)),new ResourceMap);return new Configuration(t,n,new ConfigurationModel,i,o,new ConfigurationModel,new ResourceMap,!1)}static parseConfigurationModel(e){return new ConfigurationModel(e.contents,e.keys,e.overrides).freeze()}}class ConfigurationChangeEvent{constructor(e,t,n,i){this.change=e,this.previous=t,this.currentConfiguraiton=n,this.currentWorkspace=i,this._previousConfiguration=void 0;const o=new Set;e.keys.forEach((e=>o.add(e))),e.overrides.forEach((([,e])=>e.forEach((e=>o.add(e))))),this.affectedKeys=[...o.values()];const r=new ConfigurationModel;this.affectedKeys.forEach((e=>r.setValue(e,{}))),this.affectedKeysTree=r.contents}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Configuration.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var n;if(this.doesAffectedKeysTreeContains(this.affectedKeysTree,e)){if(t){return!equals(this.previousConfiguration?this.previousConfiguration.getValue(e,t,null===(n=this.previous)||void 0===n?void 0:n.workspace):void 0,this.currentConfiguraiton.getValue(e,t,this.currentWorkspace))}return!0}return!1}doesAffectedKeysTreeContains(e,t){let n,i=toValuesTree({[t]:!0},(()=>{}));for(;"object"==typeof i&&(n=Object.keys(i)[0]);){if(!(e=e[n]))return!1;i=i[n]}return!0}}const HIGH_FREQ_COMMANDS=/^(cursor|delete)/;class AbstractKeybindingService extends Disposable{constructor(e,t,n,i,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=n,this._notificationService=i,this._logService=o,this._onDidUpdateKeybindings=this._register(new Emitter$1),this._currentChord=null,this._currentChordChecker=new IntervalTimer,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=KeybindingModifierSet.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new TimeoutTimer,this._logging=!1}get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:Event$1.None}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const n=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(n)return n.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){const n=this.resolveKeyboardEvent(e);if(n.isChord())return null;const[i]=n.getDispatchParts();if(null===i)return null;const o=this._contextKeyService.getContext(t),r=this._currentChord?this._currentChord.keypress:null;return this._getResolver().resolve(o,r,i)}_enterChordMode(e,t){this._currentChord={keypress:e,label:t},this._currentChordStatusMessage=this._notificationService.status(localize("first.chord","({0}) was pressed. Waiting for second key of chord...",t));const n=Date.now();this._currentChordChecker.cancelAndSet((()=>{this._documentHasFocus()?Date.now()-n>5e3&&this._leaveChordMode():this._leaveChordMode()}),500)}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChord=null}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const n=this.resolveKeyboardEvent(e),[i]=n.getSingleModifierDispatchParts();if(i)return this._ignoreSingleModifiers.has(i)?(this._log(`+ Ignoring single modifier ${i} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=KeybindingModifierSet.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=KeybindingModifierSet.EMPTY,null===this._currentSingleModifier?(this._log(`+ Storing single modifier for possible chord ${i}.`),this._currentSingleModifier=i,this._currentSingleModifierClearTimeout.cancelAndSet((()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null}),300),!1):i===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${i} ${i}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(n,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${i}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=n.getParts();return this._ignoreSingleModifiers=new KeybindingModifierSet(o),null!==this._currentSingleModifier&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,n=!1){let i=!1;if(e.isChord())return!1;let o=null,r=null;if(n){const[t]=e.getSingleModifierDispatchParts();o=t,r=t}else[o]=e.getDispatchParts(),r=this._currentChord?this._currentChord.keypress:null;if(null===o)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),i;const s=this._contextKeyService.getContext(t),a=e.getLabel(),l=this._getResolver().resolve(s,r,o);return this._logService.trace("KeybindingService#dispatch",a,null==l?void 0:l.commandId),l&&l.enterChord?(i=!0,this._enterChordMode(o,a),i):(this._currentChord&&(l&&l.commandId||(this._notificationService.status(localize("missing.chord","The key combination ({0}, {1}) is not a command.",this._currentChord.label,a),{hideAfter:1e4}),i=!0)),this._leaveChordMode(),l&&l.commandId&&(l.bubble||(i=!0),void 0===l.commandArgs?this._commandService.executeCommand(l.commandId).then(void 0,(e=>this._notificationService.warn(e))):this._commandService.executeCommand(l.commandId,l.commandArgs).then(void 0,(e=>this._notificationService.warn(e))),HIGH_FREQ_COMMANDS.test(l.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:l.commandId,from:"keybinding"})),i)}mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)}}class KeybindingModifierSet{constructor(e){this._ctrlKey=!!e&&e.ctrlKey,this._shiftKey=!!e&&e.shiftKey,this._altKey=!!e&&e.altKey,this._metaKey=!!e&&e.metaKey}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}KeybindingModifierSet.EMPTY=new KeybindingModifierSet(null);class KeybindingResolver{constructor(e,t,n){this._log=n,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const i of e){const e=i.command;e&&"-"!==e.charAt(0)&&this._defaultBoundCommands.set(e,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=KeybindingResolver.handleRemovals([].concat(e).concat(t));for(let i=0,o=this._keybindings.length;i<o;i++){let e=this._keybindings[i];0!==e.keypressParts.length&&(e.when&&0===e.when.type||this._addKeyPress(e.keypressParts[0],e))}}static _isTargetedForRemoval(e,t,n,i){if(t&&e.keypressParts[0]!==t)return!1;if(n&&e.keypressParts[1]!==n)return!1;if(i){if(!e.when)return!1;if(!expressionsAreEqualWithConstantSubstitution(i,e.when))return!1}return!0}static handleRemovals(e){const t=new Map;for(let i=0,o=e.length;i<o;i++){const n=e[i];if(n.command&&"-"===n.command.charAt(0)){const e=n.command.substring(1);t.has(e)?t.get(e).push(n):t.set(e,[n])}}if(0===t.size)return e;const n=[];for(let i=0,o=e.length;i<o;i++){const o=e[i];if(!o.command||0===o.command.length){n.push(o);continue}if("-"===o.command.charAt(0))continue;const r=t.get(o.command);if(!r||!o.isDefault){n.push(o);continue}let s=!1;for(const e of r){const t=e.keypressParts[0],n=e.keypressParts[1],i=e.when;if(this._isTargetedForRemoval(o,t,n,i)){s=!0;break}}s||n.push(o)}return n}_addKeyPress(e,t){const n=this._map.get(e);if(void 0===n)return this._map.set(e,[t]),void this._addToLookupMap(t);for(let i=n.length-1;i>=0;i--){let e=n[i];if(e.command===t.command)continue;const o=e.keypressParts.length>1,r=t.keypressParts.length>1;o&&r&&e.keypressParts[1]!==t.keypressParts[1]||KeybindingResolver.whenIsEntirelyIncluded(e.when,t.when)&&this._removeFromLookupMap(e)}n.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);void 0===t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);if(void 0!==t)for(let n=0,i=t.length;n<i;n++)if(t[n]===e)return void t.splice(n,1)}static whenIsEntirelyIncluded(e,t){return!t||1===t.type||!(!e||1===e.type)&&implies(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t){const n=this._lookupMap.get(e);if(void 0===n||0===n.length)return null;if(1===n.length)return n[0];for(let i=n.length-1;i>=0;i--){const e=n[i];if(t.contextMatchesRules(e.when))return e}return n[n.length-1]}resolve(e,t,n){this._log(`| Resolving ${n}${t?` chorded from ${t}`:""}`);let i=null;if(null!==t){const e=this._map.get(t);if(void 0===e)return this._log("\\ No keybinding entries."),null;i=[];for(let t=0,o=e.length;t<o;t++){let o=e[t];o.keypressParts[1]===n&&i.push(o)}}else{const e=this._map.get(n);if(void 0===e)return this._log("\\ No keybinding entries."),null;i=e}let o=this._findCommand(e,i);return o?null===t&&o.keypressParts.length>1&&null!==o.keypressParts[1]?(this._log(`\\ From ${i.length} keybinding entries, matched chord, when: ${printWhenExplanation(o.when)}, source: ${printSourceExplanation(o)}.`),{enterChord:!0,leaveChord:!1,commandId:null,commandArgs:null,bubble:!1}):(this._log(`\\ From ${i.length} keybinding entries, matched ${o.command}, when: ${printWhenExplanation(o.when)}, source: ${printSourceExplanation(o)}.`),{enterChord:!1,leaveChord:o.keypressParts.length>1,commandId:o.command,commandArgs:o.commandArgs,bubble:o.bubble}):(this._log(`\\ From ${i.length} keybinding entries, no when clauses matched the context.`),null)}_findCommand(e,t){for(let n=t.length-1;n>=0;n--){let i=t[n];if(KeybindingResolver._contextMatchesRules(e,i.when))return i}return null}static _contextMatchesRules(e,t){return!t||t.evaluate(e)}}function printWhenExplanation(e){return e?`${e.serialize()}`:"no when condition"}function printSourceExplanation(e){return e.extensionId?e.isBuiltinExtension?`built-in extension ${e.extensionId}`:`user extension ${e.extensionId}`:e.isDefault?"built-in":"user"}class ResolvedKeybindingItem{constructor(e,t,n,i,o,r,s){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.keypressParts=e?removeElementsAfterNulls(e.getDispatchParts()):[],e&&0===this.keypressParts.length&&(this.keypressParts=removeElementsAfterNulls(e.getSingleModifierDispatchParts())),this.bubble=!!t&&94===t.charCodeAt(0),this.command=this.bubble?t.substr(1):t,this.commandArgs=n,this.when=i,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=s}}function removeElementsAfterNulls(e){let t=[];for(let n=0,i=e.length;n<i;n++){const i=e[n];if(!i)return t;t.push(i)}return t}class BaseResolvedKeybinding extends ResolvedKeybinding{constructor(e,t){if(super(),0===t.length)throw illegalArgument("parts");this._os=e,this._parts=t}getLabel(){return UILabelProvider.toLabel(this._os,this._parts,(e=>this._getLabel(e)))}getAriaLabel(){return AriaLabelProvider.toLabel(this._os,this._parts,(e=>this._getAriaLabel(e)))}getElectronAccelerator(){return this._parts.length>1||this._parts[0].isDuplicateModifierCase()?null:ElectronAcceleratorLabelProvider.toLabel(this._os,this._parts,(e=>this._getElectronAccelerator(e)))}isChord(){return this._parts.length>1}getParts(){return this._parts.map((e=>this._getPart(e)))}_getPart(e){return new ResolvedKeybindingPart(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchParts(){return this._parts.map((e=>this._getDispatchPart(e)))}getSingleModifierDispatchParts(){return this._parts.map((e=>this._getSingleModifierDispatchPart(e)))}}class USLayoutResolvedKeybinding extends BaseResolvedKeybinding{constructor(e,t){super(t,e.parts)}_keyCodeToUILabel(e){if(2===this._os)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return KeyCodeUtils.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":KeyCodeUtils.toString(e.keyCode)}_getElectronAccelerator(e){return KeyCodeUtils.toElectronAccelerator(e.keyCode)}_getDispatchPart(e){return USLayoutResolvedKeybinding.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=KeyCodeUtils.toString(e.keyCode),t}_getSingleModifierDispatchPart(e){return 5!==e.keyCode||e.shiftKey||e.altKey||e.metaKey?4!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey?6!==e.keyCode||e.ctrlKey||e.shiftKey||e.metaKey?57!==e.keyCode||e.ctrlKey||e.shiftKey||e.altKey?null:"meta":"alt":"shift":"ctrl"}static _scanCodeToKeyCode(e){const t=IMMUTABLE_CODE_TO_KEY_CODE[e];if(-1!==t)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 83;case 52:return 81;case 53:return 87;case 54:return 89;case 55:return 88;case 56:return 0;case 57:return 80;case 58:return 90;case 59:return 86;case 60:return 82;case 61:return 84;case 62:return 85;case 106:return 92}return 0}static _resolveSimpleUserBinding(e){if(!e)return null;if(e instanceof SimpleKeybinding)return e;const t=this._scanCodeToKeyCode(e.scanCode);return 0===t?null:new SimpleKeybinding(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveUserBinding(e,t){const n=removeElementsAfterNulls(e.map((e=>this._resolveSimpleUserBinding(e))));return n.length>0?[new USLayoutResolvedKeybinding(new ChordKeybinding(n),t)]:[]}}var contextview="",LayoutAnchorMode,LayoutAnchorMode2;function layout(e,t,n){const i=n.mode===LayoutAnchorMode.ALIGN?n.offset:n.offset+n.size,o=n.mode===LayoutAnchorMode.ALIGN?n.offset+n.size:n.offset;return 0===n.position?t<=e-i?i:t<=o?o-t:Math.max(e-t,0):t<=o?o-t:t<=e-i?i:0}LayoutAnchorMode2=LayoutAnchorMode||(LayoutAnchorMode={}),LayoutAnchorMode2[LayoutAnchorMode2.AVOID=0]="AVOID",LayoutAnchorMode2[LayoutAnchorMode2.ALIGN=1]="ALIGN";class ContextView extends Disposable{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=Disposable.None,this.toDisposeOnSetContainer=Disposable.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=$$c(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,hide(this.view),this.setContainer(e,t),this._register(toDisposable((()=>this.setContainer(null,1))))}setContainer(e,t){var n;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,null===(n=this.shadowRootHostElement)||void 0===n||n.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=1!==t,this.useShadowDOM=3===t,this.useShadowDOM){this.shadowRootHostElement=$$c(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=SHADOW_ROOT_CSS,this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild($$c("slot"))}else this.container.appendChild(this.view);const n=new DisposableStore;ContextView.BUBBLE_UP_EVENTS.forEach((e=>{n.add(addStandardDisposableListener(this.container,e,(e=>{this.onDOMEvent(e,!1)})))})),ContextView.BUBBLE_DOWN_EVENTS.forEach((e=>{n.add(addStandardDisposableListener(this.container,e,(e=>{this.onDOMEvent(e,!0)}),!0))})),this.toDisposeOnSetContainer=n}}show(e){this.isVisible()&&this.hide(),clearNode(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2500",this.view.style.position=this.useFixedPosition?"fixed":"absolute",show(this.view),this.toDisposeOnClean=e.render(this.view)||Disposable.None,this.delegate=e,this.doLayout(),this.delegate.focus&&this.delegate.focus()}getViewElement(){return this.view}layout(){this.isVisible()&&(!1!==this.delegate.canRelayout||isIOS&&BrowserFeatures.pointerEvents?(this.delegate.layout&&this.delegate.layout(),this.doLayout()):this.hide())}doLayout(){if(!this.isVisible())return;let e,t=this.delegate.getAnchor();if(isHTMLElement(t)){let n=getDomNodePagePosition(t);e={top:n.top,left:n.left,width:n.width,height:n.height}}else e={top:t.y,left:t.x,width:t.width||1,height:t.height||2};const n=getTotalWidth(this.view),i=getTotalHeight(this.view),o=this.delegate.anchorPosition||0,r=this.delegate.anchorAlignment||0;let s,a;if(0===(this.delegate.anchorAxisAlignment||0)){const t={offset:e.top-window.pageYOffset,size:e.height,position:0===o?0:1},l={offset:e.left,size:e.width,position:0===r?0:1,mode:LayoutAnchorMode.ALIGN};s=layout(window.innerHeight,i,t)+window.pageYOffset,Range$1.intersects({start:s,end:s+i},{start:t.offset,end:t.offset+t.size})&&(l.mode=LayoutAnchorMode.AVOID),a=layout(window.innerWidth,n,l)}else{const t={offset:e.left,size:e.width,position:0===r?0:1},l={offset:e.top,size:e.height,position:0===o?0:1,mode:LayoutAnchorMode.ALIGN};a=layout(window.innerWidth,n,t),Range$1.intersects({start:a,end:a+n},{start:t.offset,end:t.offset+t.size})&&(l.mode=LayoutAnchorMode.AVOID),s=layout(window.innerHeight,i,l)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(0===o?"bottom":"top"),this.view.classList.add(0===r?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const l=getDomNodePagePosition(this.container);this.view.style.top=s-(this.useFixedPosition?getDomNodePagePosition(this.view).top:l.top)+"px",this.view.style.left=a-(this.useFixedPosition?getDomNodePagePosition(this.view).left:l.left)+"px",this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,(null==t?void 0:t.onHide)&&t.onHide(e),this.toDisposeOnClean.dispose(),hide(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!isAncestor$1(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}ContextView.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],ContextView.BUBBLE_DOWN_EVENTS=["click"];let SHADOW_ROOT_CSS='\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t@font-face {\n\t\tfont-family: "codicon";\n\t\tfont-display: block;\n\t\tsrc: url("./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6") format("truetype");\n\t}\n\n\t.codicon[class*=\'codicon-\'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }\n\n\t:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }\n';var __decorate$d=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$c=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let ContextViewService=class extends Disposable{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=Disposable.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new ContextView(this.container,1)),this.layout(),this._register(e.onDidLayout((()=>this.layout())))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,n){t?t!==this.container&&(this.container=t,this.setContainer(t,n?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.contextView.show(e);const i=toDisposable((()=>{this.currentViewDisposable===i&&this.hideContextView()}));return this.currentViewDisposable=i,i}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};ContextViewService=__decorate$d([__param$c(0,ILayoutService)],ContextViewService);const GLOBSTAR="**",GLOB_SPLIT="/",PATH_REGEX="[/\\\\]",NO_PATH_REGEX="[^/\\\\]",ALL_FORWARD_SLASHES=/\//g;function starsToRegExp(e){switch(e){case 0:return"";case 1:return`${NO_PATH_REGEX}*?`;default:return`(?:${PATH_REGEX}|${NO_PATH_REGEX}+${PATH_REGEX}|${PATH_REGEX}${NO_PATH_REGEX}+)*?`}}function splitGlobAware(e,t){if(!e)return[];const n=[];let i=!1,o=!1,r="";for(const s of e){switch(s){case t:if(!i&&!o){n.push(r),r="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":o=!0;break;case"]":o=!1}r+=s}return r&&n.push(r),n}function parseRegExp(e){if(!e)return"";let t="";const n=splitGlobAware(e,GLOB_SPLIT);if(n.every((e=>e===GLOBSTAR)))t=".*";else{let e=!1;n.forEach(((i,o)=>{if(i===GLOBSTAR)return void(e||(t+=starsToRegExp(2),e=!0));let r=!1,s="",a=!1,l="";for(const e of i)if("}"!==e&&r)s+=e;else if(!a||"]"===e&&l)switch(e){case"{":r=!0;continue;case"[":a=!0;continue;case"}":{const e=`(?:${splitGlobAware(s,",").map((e=>parseRegExp(e))).join("|")})`;t+=e,r=!1,s="";break}case"]":t+="["+l+"]",a=!1,l="";break;case"?":t+=NO_PATH_REGEX;continue;case"*":t+=starsToRegExp(1);continue;default:t+=escapeRegExpCharacters(e)}else{let t;t="-"===e?e:"^"!==e&&"!"!==e||l?e===GLOB_SPLIT?"":escapeRegExpCharacters(e):"^",l+=t}o<n.length-1&&(n[o+1]!==GLOBSTAR||o+2<n.length)&&(t+=PATH_REGEX),e=!1}))}return t}const T1=/^\*\*\/\*\.[\w\.-]+$/,T2=/^\*\*\/([\w\.-]+)\/?$/,T3=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,T3_2=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,T4=/^\*\*((\/[\w\.-]+)+)\/?$/,T5=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,CACHE=new LRUCache(1e4),FALSE=function(){return!1},NULL=function(){return null};function parsePattern(e,t){if(!e)return NULL;let n;n="string"!=typeof e?e.pattern:e,n=n.trim();const i=`${n}_${!!t.trimForExclusions}`;let o,r=CACHE.get(i);if(r)return wrapRelativePattern(r,e);if(T1.test(n)){const e=n.substr(4);r=function(t,i){return"string"==typeof t&&t.endsWith(e)?n:null}}else r=(o=T2.exec(trimForExclusions(n,t)))?trivia2(o[1],n):(t.trimForExclusions?T3_2:T3).test(n)?trivia3(n,t):(o=T4.exec(trimForExclusions(n,t)))?trivia4and5(o[1].substr(1),n,!0):(o=T5.exec(trimForExclusions(n,t)))?trivia4and5(o[1],n,!1):toRegExp(n);return CACHE.set(i,r),wrapRelativePattern(r,e)}function wrapRelativePattern(e,t){return"string"==typeof t?e:function(n,i){return isEqualOrParent(n,t.base,!isLinux)?e(n.substr(t.base.length+1),i):null}}function trimForExclusions(e,t){return t.trimForExclusions&&e.endsWith("/**")?e.substr(0,e.length-2):e}function trivia2(e,t){const n=`/${e}`,i=`\\${e}`,o=function(o,r){return"string"!=typeof o?null:r?r===e?t:null:o===e||o.endsWith(n)||o.endsWith(i)?t:null},r=[e];return o.basenames=r,o.patterns=[t],o.allBasenames=r,o}function trivia3(e,t){const n=aggregateBasenameMatches(e.slice(1,-1).split(",").map((e=>parsePattern(e,t))).filter((e=>e!==NULL)),e),i=n.length;if(!i)return NULL;if(1===i)return n[0];const o=function(t,i){for(let o=0,r=n.length;o<r;o++)if(n[o](t,i))return e;return null},r=n.find((e=>!!e.allBasenames));r&&(o.allBasenames=r.allBasenames);const s=n.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return s.length&&(o.allPaths=s),o}function trivia4and5(e,t,n){const i=sep===posix.sep,o=i?e:e.replace(ALL_FORWARD_SLASHES,sep),r=sep+o,s=posix.sep+e,a=n?function(n,a){return"string"!=typeof n||n!==o&&!n.endsWith(r)&&(i||n!==e&&!n.endsWith(s))?null:t}:function(n,r){return"string"!=typeof n||n!==o&&(i||n!==e)?null:t};return a.allPaths=[(n?"*/":"./")+e],a}function toRegExp(e){try{const t=new RegExp(`^${parseRegExp(e)}$`);return function(n){return t.lastIndex=0,"string"==typeof n&&t.test(n)?e:null}}catch(t){return NULL}}function match(e,t,n){return!(!e||"string"!=typeof t)&&parse(e)(t,void 0,n)}function parse(e,t={}){if(!e)return FALSE;if("string"==typeof e||isRelativePattern(e)){const n=parsePattern(e,t);if(n===NULL)return FALSE;const i=function(e,t){return!!n(e,t)};return n.allBasenames&&(i.allBasenames=n.allBasenames),n.allPaths&&(i.allPaths=n.allPaths),i}return parsedExpression(e,t)}function isRelativePattern(e){const t=e;return!!t&&("string"==typeof t.base&&"string"==typeof t.pattern)}function parsedExpression(e,t){const n=aggregateBasenameMatches(Object.getOwnPropertyNames(e).map((n=>parseExpressionPattern(n,e[n],t))).filter((e=>e!==NULL))),i=n.length;if(!i)return NULL;if(!n.some((e=>!!e.requiresSiblings))){if(1===i)return n[0];const e=function(e,t){for(let i=0,o=n.length;i<o;i++){const o=n[i](e,t);if(o)return o}return null},t=n.find((e=>!!e.allBasenames));t&&(e.allBasenames=t.allBasenames);const o=n.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return o.length&&(e.allPaths=o),e}const o=function(e,t,i){let o;for(let r=0,s=n.length;r<s;r++){const s=n[r];s.requiresSiblings&&i&&(t||(t=basename$1(e)),o||(o=t.substr(0,t.length-extname$1(e).length)));const a=s(e,t,o,i);if(a)return a}return null},r=n.find((e=>!!e.allBasenames));r&&(o.allBasenames=r.allBasenames);const s=n.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return s.length&&(o.allPaths=s),o}function parseExpressionPattern(e,t,n){if(!1===t)return NULL;const i=parsePattern(e,n);if(i===NULL)return NULL;if("boolean"==typeof t)return i;if(t){const n=t.when;if("string"==typeof n){const t=(t,o,r,s)=>{if(!s||!i(t,o))return null;const a=s(n.replace("$(basename)",r));return isThenable$1(a)?a.then((t=>t?e:null)):a?e:null};return t.requiresSiblings=!0,t}}return i}function aggregateBasenameMatches(e,t){const n=e.filter((e=>!!e.basenames));if(n.length<2)return e;const i=n.reduce(((e,t)=>{const n=t.basenames;return n?e.concat(n):e}),[]);let o;if(t){o=[];for(let e=0,n=i.length;e<n;e++)o.push(t)}else o=n.reduce(((e,t)=>{const n=t.patterns;return n?e.concat(n):e}),[]);const r=function(e,t){if("string"!=typeof e)return null;if(!t){let n;for(n=e.length;n>0;n--){const t=e.charCodeAt(n-1);if(47===t||92===t)break}t=e.substr(n)}const n=i.indexOf(t);return-1!==n?o[n]:null};r.basenames=i,r.patterns=o,r.allBasenames=i;const s=e.filter((e=>!e.basenames));return s.push(r),s}let registeredAssociations=[],nonUserRegisteredAssociations=[],userRegisteredAssociations=[];function registerPlatformLanguageAssociation(e,t=!1){_registerLanguageAssociation(e,!1,t)}function _registerLanguageAssociation(e,t,n){const i=toLanguageAssociationItem(e,t);registeredAssociations.push(i),i.userConfigured?userRegisteredAssociations.push(i):nonUserRegisteredAssociations.push(i),n&&!i.userConfigured&®isteredAssociations.forEach((e=>{e.mime===i.mime||e.userConfigured||(i.extension&&(e.extension,i.extension),i.filename&&(e.filename,i.filename),i.filepattern&&(e.filepattern,i.filepattern),i.firstline&&(e.firstline,i.firstline))}))}function toLanguageAssociationItem(e,t){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:t,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?parse(e.filepattern.toLowerCase()):void 0,filepatternOnPath:!!e.filepattern&&e.filepattern.indexOf(posix.sep)>=0}}function clearPlatformLanguageAssociations(){registeredAssociations=registeredAssociations.filter((e=>e.userConfigured)),nonUserRegisteredAssociations=[]}function getMimeTypes(e,t){let n;if(e)switch(e.scheme){case Schemas.file:n=e.fsPath;break;case Schemas.data:n=DataUri.parseMetaData(e).get(DataUri.META_DATA_LABEL);break;default:n=e.path}if(!n)return[Mimes.unknown];n=n.toLowerCase();const i=basename$1(n),o=getMimeByPath(n,i,userRegisteredAssociations);if(o)return[o,Mimes.text];const r=getMimeByPath(n,i,nonUserRegisteredAssociations);if(r)return[r,Mimes.text];if(t){const e=getMimeByFirstline(t);if(e)return[e,Mimes.text]}return[Mimes.unknown]}function getMimeByPath(e,t,n){var i;let o,r,s;for(let a=n.length-1;a>=0;a--){const l=n[a];if(t===l.filenameLowercase){o=l;break}if(l.filepattern&&(!r||l.filepattern.length>r.filepattern.length)){const n=l.filepatternOnPath?e:t;(null===(i=l.filepatternLowercase)||void 0===i?void 0:i.call(l,n))&&(r=l)}l.extension&&(!s||l.extension.length>s.extension.length)&&t.endsWith(l.extensionLowercase)&&(s=l)}return o?o.mime:r?r.mime:s?s.mime:void 0}function getMimeByFirstline(e){if(startsWithUTF8BOM(e)&&(e=e.substr(1)),e.length>0)for(let t=registeredAssociations.length-1;t>=0;t--){const n=registeredAssociations[t];if(!n.firstline)continue;const i=e.match(n.firstline);if(i&&i.length>0)return n.mime}}const hasOwnProperty=Object.prototype.hasOwnProperty,NULL_LANGUAGE_ID="vs.editor.nullLanguage";LanguageConfigurationRegistry.register(NULL_LANGUAGE_ID,{});class LanguageIdCodec{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(NULL_LANGUAGE_ID,0),this._register(PLAINTEXT_LANGUAGE_ID,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||NULL_LANGUAGE_ID}}class LanguagesRegistry extends Disposable{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new Emitter$1),this.onDidChange=this._onDidChange.event,LanguagesRegistry.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new LanguageIdCodec,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(ModesRegistry.onDidChangeLanguages((e=>{this._initializeFromRegistry()}))))}dispose(){LanguagesRegistry.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},clearPlatformLanguageAssociations();const e=[].concat(ModesRegistry.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach((e=>{const t=this._languages[e];t.name&&(this._nameMap[t.name]=t.identifier),t.aliases.forEach((e=>{this._lowercaseNameMap[e.toLowerCase()]=t.identifier})),t.mimetypes.forEach((e=>{this._mimeTypesMap[e]=t.identifier}))})),Registry.as(Extensions$3.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let n;hasOwnProperty.call(this._languages,t)?n=this._languages[t]:(this.languageIdCodec.register(t),n={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=n),this._mergeLanguage(n,e)}_mergeLanguage(e,t){const n=t.id;let i=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),i=t.mimetypes[0]),i||(i=`text/x-${n}`,e.mimetypes.push(i)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(let e of t.extensions)registerPlatformLanguageAssociation({id:n,mime:i,extension:e},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(let a of t.filenames)registerPlatformLanguageAssociation({id:n,mime:i,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(let a of t.filenamePatterns)registerPlatformLanguageAssociation({id:n,mime:i,filepattern:a},this._warnOnOverwrite);if("string"==typeof t.firstLine&&t.firstLine.length>0){let e=t.firstLine;"^"!==e.charAt(0)&&(e="^"+e);try{const t=new RegExp(e);regExpLeadsToEndlessLoop(t)||registerPlatformLanguageAssociation({id:n,mime:i,firstline:t},this._warnOnOverwrite)}catch(s){onUnexpectedError(s)}}e.aliases.push(n);let o=null;if(void 0!==t.aliases&&Array.isArray(t.aliases)&&(o=0===t.aliases.length?[null]:t.aliases),null!==o)for(const a of o)a&&0!==a.length&&e.aliases.push(a);const r=null!==o&&o.length>0;if(r&&null===o[0]);else{const t=(r?o[0]:null)||n;!r&&e.name||(e.name=t)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return!!e&&hasOwnProperty.call(this._languages,e)}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return hasOwnProperty.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&hasOwnProperty.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){if(!e&&!t)return[];return coalesce(getMimeTypes(e,t).map((e=>this.getLanguageIdByMimeType(e))))}}LanguagesRegistry.instanceCount=0;class LanguageService extends Disposable{constructor(e=!1){super(),this._onDidEncounterLanguage=this._register(new Emitter$1),this.onDidEncounterLanguage=this._onDidEncounterLanguage.event,this._onDidChange=this._register(new Emitter$1({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,LanguageService.instanceCount++,this._encounteredLanguages=new Set,this._registry=this._register(new LanguagesRegistry(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange((()=>this._onDidChange.fire())))}dispose(){LanguageService.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){return firstOrDefault(this._registry.guessLanguageIdByFilepathOrFirstLine(e,t),null)}createById(e){return new LanguageSelection(this.onDidChange,(()=>this._createAndGetLanguageIdentifier(e)))}createByFilepathOrFirstLine(e,t){return new LanguageSelection(this.onDidChange,(()=>{const n=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(n)}))}_createAndGetLanguageIdentifier(e){return e&&this.isRegisteredLanguageId(e)||(e=PLAINTEXT_LANGUAGE_ID),this._encounteredLanguages.has(e)||(this._encounteredLanguages.add(e),TokenizationRegistry.getOrCreate(e),this._onDidEncounterLanguage.fire(e)),e}}LanguageService.instanceCount=0;class LanguageSelection{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages((()=>this._evaluate()))),this._emitter||(this._emitter=new Emitter$1({onLastListenerRemove:()=>{this._dispose()}})),this._emitter.event}_evaluate(){const e=this._selector();e!==this.languageId&&(this.languageId=e,this._emitter&&this._emitter.fire(this.languageId))}}const MENU_MNEMONIC_REGEX=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,MENU_ESCAPED_MNEMONIC_REGEX=/(&)?(&)([^\s&])/g;var Direction,Direction2;Direction2=Direction||(Direction={}),Direction2[Direction2.Right=0]="Right",Direction2[Direction2.Left=1]="Left";class Menu$1 extends ActionBar{constructor(e,t,n={}){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const i=document.createElement("div");i.classList.add("monaco-menu"),i.setAttribute("role","presentation"),super(i,{orientation:1,actionViewItemProvider:e=>this.doGetActionViewItem(e,n,o),context:n.context,actionRunner:n.actionRunner,ariaLabel:n.ariaLabel,focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...isMacintosh||isLinux?[10]:[]],keyDown:!0}}),this.menuElement=i,this.actionsList.setAttribute("role","menu"),this.actionsList.tabIndex=0,this.menuDisposables=this._register(new DisposableStore),this.initializeOrUpdateStyleSheet(e,{}),this._register(Gesture.addTarget(i)),addDisposableListener(i,EventType$1.KEY_DOWN,(e=>{new StandardKeyboardEvent(e).equals(2)&&e.preventDefault()})),n.enableMnemonics&&this.menuDisposables.add(addDisposableListener(i,EventType$1.KEY_DOWN,(e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){EventHelper.stop(e,!0);const n=this.mnemonics.get(t);if(1===n.length&&(n[0]instanceof SubmenuMenuActionViewItem&&n[0].container&&this.focusItemByElement(n[0].container),n[0].onClick(e)),n.length>1){const e=n.shift();e&&e.container&&(this.focusItemByElement(e.container),n.push(e)),this.mnemonics.set(t,n)}}}))),isLinux&&this._register(addDisposableListener(i,EventType$1.KEY_DOWN,(e=>{const t=new StandardKeyboardEvent(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),EventHelper.stop(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),EventHelper.stop(e,!0))}))),this._register(addDisposableListener(this.domNode,EventType$1.MOUSE_OUT,(e=>{isAncestor$1(e.relatedTarget,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())}))),this._register(addDisposableListener(this.actionsList,EventType$1.MOUSE_OVER,(e=>{let t=e.target;if(t&&isAncestor$1(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}}))),this._register(Gesture.addTarget(this.actionsList)),this._register(addDisposableListener(this.actionsList,EventType.Tap,(e=>{let t=e.initialTarget;if(t&&isAncestor$1(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}})));let o={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new DomScrollableElement(i,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const r=this.scrollableElement.getDomNode();r.style.position="",this._register(addDisposableListener(i,EventType.Change,(e=>{EventHelper.stop(e,!0);const t=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:t-e.translationY})}))),this._register(addDisposableListener(r,EventType$1.MOUSE_UP,(e=>{e.preventDefault()}))),i.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((e=>{var t;return!(null===(t=n.submenuIds)||void 0===t?void 0:t.has(e.id))})),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter((e=>!(e instanceof MenuSeparatorActionViewItem))).forEach(((e,t,n)=>{e.updatePositionInSet(t+1,n.length)}))}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(isInShadowDOM(e)?this.styleSheet=createStyleSheet(e):(Menu$1.globalStyleSheet||(Menu$1.globalStyleSheet=createStyleSheet()),this.styleSheet=Menu$1.globalStyleSheet)),this.styleSheet.textContent=getMenuWidgetCSS(t,isInShadowDOM(e))}style(e){const t=this.getContainer();this.initializeOrUpdateStyleSheet(t,e);const n=e.foregroundColor?`${e.foregroundColor}`:"",i=e.backgroundColor?`${e.backgroundColor}`:"",o=e.borderColor?`1px solid ${e.borderColor}`:"",r=e.shadowColor?`0 2px 4px ${e.shadowColor}`:"";t.style.border=o,this.domNode.style.color=n,this.domNode.style.backgroundColor=i,t.style.boxShadow=r,this.viewItems&&this.viewItems.forEach((t=>{(t instanceof BaseMenuActionViewItem||t instanceof MenuSeparatorActionViewItem)&&t.style(e)}))}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t<this.actionsList.children.length;t++){if(e===this.actionsList.children[t]){this.focusedItem=t;break}}}updateFocus(e){super.updateFocus(e,!0,!0),void 0!==this.focusedItem&&this.scrollableElement.setScrollPosition({scrollTop:Math.round(this.menuElement.scrollTop)})}doGetActionViewItem(e,t,n){if(e instanceof Separator)return new MenuSeparatorActionViewItem(t.context,e,{icon:!0});if(e instanceof SubmenuAction){const i=new SubmenuMenuActionViewItem(e,e.actions,n,Object.assign(Object.assign({},t),{submenuIds:new Set([...t.submenuIds||[],e.id])}));if(t.enableMnemonics){const e=i.getMnemonic();if(e&&i.isEnabled()){let t=[];this.mnemonics.has(e)&&(t=this.mnemonics.get(e)),t.push(i),this.mnemonics.set(e,t)}}return i}{const n={enableMnemonics:t.enableMnemonics,useEventAsContext:t.useEventAsContext};if(t.getKeyBinding){const i=t.getKeyBinding(e);if(i){const e=i.getLabel();e&&(n.keybinding=e)}}const i=new BaseMenuActionViewItem(t.context,e,n);if(t.enableMnemonics){const e=i.getMnemonic();if(e&&i.isEnabled()){let t=[];this.mnemonics.has(e)&&(t=this.mnemonics.get(e)),t.push(i),this.mnemonics.set(e,t)}}return i}}}class BaseMenuActionViewItem extends BaseActionViewItem{constructor(e,t,n={}){if(n.isMenu=!0,super(t,t,n),this.options=n,this.options.icon=void 0!==n.icon&&n.icon,this.options.label=void 0===n.label||n.label,this.cssClass="",this.options.label&&n.enableMnemonics){let e=this.getAction().label;if(e){let t=MENU_MNEMONIC_REGEX.exec(e);t&&(this.mnemonic=(t[1]?t[1]:t[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new RunOnceScheduler((()=>{this.element&&(this._register(addDisposableListener(this.element,EventType$1.MOUSE_UP,(e=>{if(EventHelper.stop(e,!0),isFirefox){if(new StandardMouseEvent(e).rightButton)return;this.onClick(e)}else setTimeout((()=>{this.onClick(e)}),0)}))),this._register(addDisposableListener(this.element,EventType$1.CONTEXT_MENU,(e=>{EventHelper.stop(e,!0)}))))}),100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=append$1(this.element,$$c("a.action-menu-item")),this._action.id===Separator.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=append$1(this.item,$$c("span.menu-item-check"+Codicon.menuSelection.cssSelector)),this.check.setAttribute("role","none"),this.label=append$1(this.item,$$c("span.action-label")),this.options.label&&this.options.keybinding&&(append$1(this.item,$$c("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item&&this.item.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){clearNode(this.label);let e=stripIcons(this.getAction().label);if(e){const t=cleanMnemonic(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const n=MENU_MNEMONIC_REGEX.exec(e);if(n){e=escape(e),MENU_ESCAPED_MNEMONIC_REGEX.lastIndex=0;let t=MENU_ESCAPED_MNEMONIC_REGEX.exec(e);for(;t&&t[1];)t=MENU_ESCAPED_MNEMONIC_REGEX.exec(e);const i=e=>e.replace(/&&/g,"&");t?this.label.append(ltrim(i(e.substr(0,t.index))," "),$$c("u",{"aria-hidden":"true"},t[3]),rtrim(i(e.substr(t.index+t[0].length))," ")):this.label.innerText=i(e).trim(),this.item&&this.item.setAttribute("aria-keyshortcuts",(n[1]?n[1]:n[3]).toLocaleLowerCase())}else this.label.innerText=e.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.getAction().class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.getAction().enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.getAction().checked;this.item.classList.toggle("checked",!!e),void 0!==e?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){if(!this.menuStyle)return;const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,n=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,i=e&&this.menuStyle.selectionBorderColor?`thin solid ${this.menuStyle.selectionBorderColor}`:"";this.item&&(this.item.style.color=t?t.toString():"",this.item.style.backgroundColor=n?n.toString():""),this.check&&(this.check.style.color=t?t.toString():""),this.container&&(this.container.style.border=i)}style(e){this.menuStyle=e,this.applyStyle()}}class SubmenuMenuActionViewItem extends BaseMenuActionViewItem{constructor(e,t,n,i){super(e,e,i),this.submenuActions=t,this.parentData=n,this.submenuOptions=i,this.mysubmenu=null,this.submenuDisposables=this._register(new DisposableStore),this.mouseOver=!1,this.expandDirection=i&&void 0!==i.expandDirection?i.expandDirection:Direction.Right,this.showScheduler=new RunOnceScheduler((()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))}),250),this.hideScheduler=new RunOnceScheduler((()=>{this.element&&!isAncestor$1(getActiveElement(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))}),750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=append$1(this.item,$$c("span.submenu-indicator"+Codicon.menuSubmenu.cssSelector)),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(addDisposableListener(this.element,EventType$1.KEY_UP,(e=>{let t=new StandardKeyboardEvent(e);(t.equals(17)||t.equals(3))&&(EventHelper.stop(e,!0),this.createSubmenu(!0))}))),this._register(addDisposableListener(this.element,EventType$1.KEY_DOWN,(e=>{let t=new StandardKeyboardEvent(e);getActiveElement()===this.item&&(t.equals(17)||t.equals(3))&&EventHelper.stop(e,!0)}))),this._register(addDisposableListener(this.element,EventType$1.MOUSE_OVER,(e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())}))),this._register(addDisposableListener(this.element,EventType$1.MOUSE_LEAVE,(e=>{this.mouseOver=!1}))),this._register(addDisposableListener(this.element,EventType$1.FOCUS_OUT,(e=>{this.element&&!isAncestor$1(getActiveElement(),this.element)&&this.hideScheduler.schedule()}))),this._register(this.parentData.parent.onScroll((()=>{this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!1)}))))}updateEnabled(){}onClick(e){EventHelper.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch(t){}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,n,i){const o={top:0,left:0};return o.left=layout(e.width,t.width,{position:i===Direction.Right?0:1,offset:n.left,size:n.width}),o.left>=n.left&&o.left<n.left+n.width&&(n.left+10+t.width<=e.width&&(o.left=n.left+10),n.top+=10,n.height=0),o.top=layout(e.height,t.height,{position:0,offset:n.top,size:0}),o.top+t.height===n.top&&o.top+n.height+t.height<=e.height&&(o.top+=n.height),o}createSubmenu(e=!0){if(this.element)if(this.parentData.submenu)this.parentData.submenu.focus(!1);else{this.updateAriaExpanded("true"),this.submenuContainer=append$1(this.element,$$c("div.monaco-submenu")),this.submenuContainer.classList.add("menubar-menu-items-holder","context-view");const t=getComputedStyle(this.parentData.parent.domNode),n=parseFloat(t.paddingTop||"0")||0;this.submenuContainer.style.zIndex="1",this.submenuContainer.style.position="fixed",this.submenuContainer.style.top="0",this.submenuContainer.style.left="0",this.parentData.submenu=new Menu$1(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new EmptySubmenuAction],this.submenuOptions),this.menuStyle&&this.parentData.submenu.style(this.menuStyle);const i=this.element.getBoundingClientRect(),o={top:i.top-n,left:i.left,height:i.height+2*n,width:i.width},r=this.submenuContainer.getBoundingClientRect(),{top:s,left:a}=this.calculateSubmenuMenuLayout(new Dimension(window.innerWidth,window.innerHeight),Dimension.lift(r),o,this.expandDirection);this.submenuContainer.style.left=a-r.left+"px",this.submenuContainer.style.top=s-r.top+"px",this.submenuDisposables.add(addDisposableListener(this.submenuContainer,EventType$1.KEY_UP,(e=>{new StandardKeyboardEvent(e).equals(15)&&(EventHelper.stop(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))}))),this.submenuDisposables.add(addDisposableListener(this.submenuContainer,EventType$1.KEY_DOWN,(e=>{new StandardKeyboardEvent(e).equals(15)&&EventHelper.stop(e,!0)}))),this.submenuDisposables.add(this.parentData.submenu.onDidCancel((()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)}))),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&(null===(t=this.item)||void 0===t||t.setAttribute("aria-expanded",e))}applyStyle(){if(super.applyStyle(),!this.menuStyle)return;const e=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=e?`${e}`:""),this.parentData.submenu&&this.parentData.submenu.style(this.menuStyle)}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class MenuSeparatorActionViewItem extends ActionViewItem{style(e){this.label&&(this.label.style.borderBottomColor=e.separatorColor?`${e.separatorColor}`:"")}}function cleanMnemonic(e){const t=MENU_MNEMONIC_REGEX,n=t.exec(e);if(!n)return e;const i=!n[1];return e.replace(t,i?"$2$3":"").trim()}function getMenuWidgetCSS(e,t){let n=`\n.monaco-menu {\n\tfont-size: 13px;\n\n}\n\n${formatRule(Codicon.menuSelection)}\n${formatRule(Codicon.menuSubmenu)}\n\n.monaco-menu .monaco-action-bar {\n\ttext-align: right;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 100%;\n\tjustify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n\tflex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: transform 50ms ease;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-menu .monaco-action-bar.animated .action-item.active {\n\ttransform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n\tfont-size: 11px;\n\tmargin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n\topacity: 0.4;\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid #bbb;\n\tpadding-top: 1px;\n\tmargin-left: .8em;\n\tmargin-right: .8em;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n\tmargin-left: 0;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tpadding: 0;\n\ttransform: none;\n\tdisplay: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n\ttransform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\theight: 2em;\n\talign-items: center;\n\tposition: relative;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n\tflex: 1 1 auto;\n\ttext-decoration: none;\n\tpadding: 0 1em;\n\tbackground: none;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tdisplay: inline-block;\n\tflex: 2 1 auto;\n\tpadding: 0 1em;\n\ttext-align: right;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n\tfont-size: 16px !important;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n\tmargin-left: auto;\n\tmargin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n\topacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\tmargin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tposition: static;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n\tposition: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tpadding: 0.5em 0 0 0;\n\tmargin-bottom: 0.5em;\n\twidth: 100%;\n\theight: 0px !important;\n\tmargin-left: .8em !important;\n\tmargin-right: .8em !important;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n\tpadding: 0.7em 1em 0.1em 1em;\n\tfont-weight: bold;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n\tcolor: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tposition: absolute;\n\tvisibility: hidden;\n\twidth: 1em;\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n\tvisibility: visible;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n\toutline: 0;\n\tborder: none;\n\tanimation: fadeIn 0.083s linear;\n\t-webkit-app-region: no-drag;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n\toutline: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tborder: thin solid transparent; /* prevents jumping behaviour on hover or focus */\n}\n\n\n/* High Contrast Theming */\n:host-context(.hc-black) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n\tbackground: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n\tpadding: .5em 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 1.8em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n\tfont-size: inherit;\n\tpadding: 0 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tfont-size: inherit;\n\twidth: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tfont-size: inherit;\n\tpadding: 0.2em 0 0 0;\n\tmargin-bottom: 0.2em;\n}\n\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tfont-size: 60%;\n\tpadding: 0 1.8em;\n}\n\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n\tmask-size: 10px 10px;\n\t-webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n\tcursor: default;\n}`;if(t){n+="\n\t\t\t/* Arrows */\n\t\t\t.monaco-scrollable-element > .scrollbar > .scra {\n\t\t\t\tcursor: pointer;\n\t\t\t\tfont-size: 11px !important;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .visible {\n\t\t\t\topacity: 1;\n\n\t\t\t\t/* Background rule added for IE9 - to allow clicks on dom node */\n\t\t\t\tbackground:rgba(0,0,0,0);\n\n\t\t\t\ttransition: opacity 100ms linear;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible {\n\t\t\t\topacity: 0;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible.fade {\n\t\t\t\ttransition: opacity 800ms linear;\n\t\t\t}\n\n\t\t\t/* Scrollable Content Inset Shadow */\n\t\t\t.monaco-scrollable-element > .shadow {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 3px;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 3px;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 100%;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top-left-corner {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t";const t=e.scrollbarShadow;t&&(n+=`\n\t\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\t\tbox-shadow: ${t} 0 6px 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 0 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 6px 6px -6px inset;\n\t\t\t\t}\n\t\t\t`);const i=e.scrollbarSliderBackground;i&&(n+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\t\tbackground: ${i};\n\t\t\t\t}\n\t\t\t`);const o=e.scrollbarSliderHoverBackground;o&&(n+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\t\tbackground: ${o};\n\t\t\t\t}\n\t\t\t`);const r=e.scrollbarSliderActiveBackground;r&&(n+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\t\tbackground: ${r};\n\t\t\t\t}\n\t\t\t`)}return n}var contextMenuHandler="";class ContextMenuHandler{constructor(e,t,n,i,o){this.contextViewService=e,this.telemetryService=t,this.notificationService=n,this.keybindingService=i,this.themeService=o,this.focusToReturn=null,this.block=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;let n;this.focusToReturn=document.activeElement;let i=isHTMLElement(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:i=>{let o=e.getMenuClassName?e.getMenuClassName():"";o&&(i.className+=" "+o),this.options.blockMouse&&(this.block=i.appendChild($$c(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",addDisposableListener(this.block,EventType$1.MOUSE_DOWN,(e=>e.stopPropagation())));const r=new DisposableStore,s=e.actionRunner||new ActionRunner;return s.onBeforeRun(this.onActionRun,this,r),s.onDidRun(this.onDidActionRun,this,r),n=new Menu$1(i,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:s,getKeyBinding:e.getKeyBinding?e.getKeyBinding:e=>this.keybindingService.lookupKeybinding(e.id)}),r.add(attachMenuStyler(n,this.themeService)),n.onDidCancel((()=>this.contextViewService.hideContextView(!0)),null,r),n.onDidBlur((()=>this.contextViewService.hideContextView(!0)),null,r),r.add(addDisposableListener(window,EventType$1.BLUR,(()=>this.contextViewService.hideContextView(!0)))),r.add(addDisposableListener(window,EventType$1.MOUSE_DOWN,(e=>{if(e.defaultPrevented)return;let t=new StandardMouseEvent(e),n=t.target;if(!t.rightButton){for(;n;){if(n===i)return;n=n.parentElement}this.contextViewService.hideContextView(!0)}}))),combinedDisposable(r,n)},focus:()=>{n&&n.focus(!!e.autoSelectFirstItem)},onHide:t=>{e.onHide&&e.onHide(!!t),this.block&&(this.block.remove(),this.block=null),this.focusToReturn&&this.focusToReturn.focus()}},i,!!i)}onActionRun(e){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1),this.focusToReturn&&this.focusToReturn.focus()}onDidActionRun(e){e.error&&!isCancellationError(e.error)&&this.notificationService.error(e.error)}}var __decorate$c=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$b=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let ContextMenuService=class extends Disposable{constructor(e,t,n,i,o){super(),this._onDidShowContextMenu=new Emitter$1,this._onDidHideContextMenu=new Emitter$1,this.contextMenuHandler=new ContextMenuHandler(n,e,t,i,o)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{e.onHide&&e.onHide(t),this._onDidHideContextMenu.fire()}})),ModifierKeyEmitter.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};var EditorOpenSource,EditorOpenSource2;ContextMenuService=__decorate$c([__param$b(0,ITelemetryService),__param$b(1,INotificationService),__param$b(2,IContextViewService),__param$b(3,IKeybindingService),__param$b(4,IThemeService)],ContextMenuService),EditorOpenSource2=EditorOpenSource||(EditorOpenSource={}),EditorOpenSource2[EditorOpenSource2.API=0]="API",EditorOpenSource2[EditorOpenSource2.USER=1]="USER";var __decorate$b=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$a=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$5=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};let CommandOpener=class{constructor(e){this._commandService=e}open(e,t){return __awaiter$5(this,void 0,void 0,(function*(){if(!matchesScheme(e,Schemas.command))return!1;if(!(null==t?void 0:t.allowCommands))return!0;"string"==typeof e&&(e=URI.parse(e));let n=[];try{n=parse$1(decodeURIComponent(e.query))}catch(i){try{n=parse$1(e.query)}catch(o){}}return Array.isArray(n)||(n=[n]),yield this._commandService.executeCommand(e.path,...n),!0}))}};CommandOpener=__decorate$b([__param$a(0,ICommandService)],CommandOpener);let EditorOpener=class{constructor(e){this._editorService=e}open(e,t){return __awaiter$5(this,void 0,void 0,(function*(){"string"==typeof e&&(e=URI.parse(e));const{selection:n,uri:i}=extractSelection(e);return(e=i).scheme===Schemas.file&&(e=normalizePath(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:n,source:(null==t?void 0:t.fromUserGesture)?EditorOpenSource.USER:EditorOpenSource.API},null==t?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),null==t?void 0:t.openToSide),!0}))}};EditorOpener=__decorate$b([__param$a(0,ICodeEditorService)],EditorOpener);let OpenerService=class{constructor(e,t){this._openers=new LinkedList,this._validators=new LinkedList,this._resolvers=new LinkedList,this._resolvedUriTargets=new ResourceMap((e=>e.with({path:null,fragment:null,query:null}).toString())),this._externalOpeners=new LinkedList,this._defaultExternalOpener={openExternal:e=>__awaiter$5(this,void 0,void 0,(function*(){return matchesSomeScheme(e,Schemas.http,Schemas.https)?windowOpenNoOpener(e):window.location.href=e,!0}))},this._openers.push({open:(e,t)=>__awaiter$5(this,void 0,void 0,(function*(){return!(!(null==t?void 0:t.openExternal)&&!matchesSomeScheme(e,Schemas.mailto,Schemas.http,Schemas.https,Schemas.vsls))&&(yield this._doOpenExternal(e,t),!0)}))}),this._openers.push(new CommandOpener(t)),this._openers.push(new EditorOpener(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}registerValidator(e){return{dispose:this._validators.push(e)}}registerExternalUriResolver(e){return{dispose:this._resolvers.push(e)}}setDefaultExternalOpener(e){this._defaultExternalOpener=e}registerExternalOpener(e){return{dispose:this._externalOpeners.push(e)}}open(e,t){var n;return __awaiter$5(this,void 0,void 0,(function*(){const i="string"==typeof e?URI.parse(e):e,o=null!==(n=this._resolvedUriTargets.get(i))&&void 0!==n?n:e;for(const e of this._validators)if(!(yield e.shouldOpen(o)))return!1;for(const n of this._openers){if(yield n.open(e,t))return!0}return!1}))}resolveExternalUri(e,t){return __awaiter$5(this,void 0,void 0,(function*(){for(const i of this._resolvers)try{const n=yield i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch(n){}throw new Error("Could not resolve external URI: "+e.toString())}))}_doOpenExternal(e,t){return __awaiter$5(this,void 0,void 0,(function*(){const n="string"==typeof e?URI.parse(e):e;let i,o;try{i=(yield this.resolveExternalUri(n,t)).resolved}catch(r){i=n}if(o="string"==typeof e&&n.toString()===i.toString()?e:encodeURI(i.toString(!0)),null==t?void 0:t.allowContributedOpeners){const e="string"==typeof(null==t?void 0:t.allowContributedOpeners)?null==t?void 0:t.allowContributedOpeners:void 0;for(const t of this._externalOpeners){if(yield t.openExternal(o,{sourceUri:n,preferredOpenerId:e},CancellationToken.None))return!0}}return this._defaultExternalOpener.openExternal(o,{sourceUri:n},CancellationToken.None)}))}dispose(){this._validators.clear()}};OpenerService=__decorate$b([__param$a(0,ICodeEditorService),__param$a(1,ICommandService)],OpenerService);var __decorate$a=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$9=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};class MarkerDecorations extends Disposable{constructor(e){super(),this.model=e,this._markersData=new Map,this._register(toDisposable((()=>{this.model.deltaDecorations([...this._markersData.keys()],[]),this._markersData.clear()})))}update(e,t){const n=[...this._markersData.keys()];this._markersData.clear();const i=this.model.deltaDecorations(n,t);for(let o=0;o<i.length;o++)this._markersData.set(i[o],e[o]);return 0!==n.length||0!==i.length}getMarker(e){return this._markersData.get(e.id)}}let MarkerDecorationsService=class extends Disposable{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new Emitter$1),this._markerDecorations=new ResourceMap,e.getModels().forEach((e=>this._onModelAdded(e))),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach((e=>e.dispose())),this._markerDecorations.clear()}getMarker(e,t){const n=this._markerDecorations.get(e);return n&&n.getMarker(t)||null}_handleMarkerChange(e){e.forEach((e=>{const t=this._markerDecorations.get(e);t&&this._updateDecorations(t)}))}_onModelAdded(e){const t=new MarkerDecorations(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),e.uri.scheme!==Schemas.inMemory&&e.uri.scheme!==Schemas.internal&&e.uri.scheme!==Schemas.vscode||this._markerService&&this._markerService.read({resource:e.uri}).map((e=>e.owner)).forEach((t=>this._markerService.remove(t,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500}),n=t.map((t=>({range:this._createDecorationRange(e.model,t),options:this._createDecorationOption(t)})));e.update(t,n)&&this._onDidChangeMarker.fire(e.model)}_createDecorationRange(e,t){let n=Range$2.lift(t);if(t.severity!==MarkerSeverity$2.Hint||this._hasMarkerTag(t,1)||this._hasMarkerTag(t,2)||(n=n.setEndPosition(n.startLineNumber,n.startColumn+2)),n=e.validateRange(n),n.isEmpty()){const t=e.getLineLastNonWhitespaceColumn(n.startLineNumber)||e.getLineMaxColumn(n.startLineNumber);if(1===t||n.endColumn>=t)return n;const i=e.getWordAtPosition(n.getStartPosition());i&&(n=new Range$2(n.startLineNumber,i.startColumn,n.endLineNumber,i.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&1===t.startColumn&&n.startLineNumber===n.endLineNumber){let i=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);i<n.endColumn&&(n=new Range$2(n.startLineNumber,i,n.endLineNumber,n.endColumn),t.startColumn=i)}return n}_createDecorationOption(e){let t,n,i,o,r;switch(e.severity){case MarkerSeverity$2.Hint:t=this._hasMarkerTag(e,2)?void 0:this._hasMarkerTag(e,1)?"squiggly-unnecessary":"squiggly-hint",i=0;break;case MarkerSeverity$2.Warning:t="squiggly-warning",n=themeColorFromId(overviewRulerWarning),i=20,r={color:themeColorFromId(minimapWarning),position:MinimapPosition$1.Inline};break;case MarkerSeverity$2.Info:t="squiggly-info",n=themeColorFromId(overviewRulerInfo),i=10;break;case MarkerSeverity$2.Error:default:t="squiggly-error",n=themeColorFromId(overviewRulerError),i=30,r={color:themeColorFromId(minimapError),position:MinimapPosition$1.Inline}}return e.tags&&(-1!==e.tags.indexOf(1)&&(o="squiggly-inline-unnecessary"),-1!==e.tags.indexOf(2)&&(o="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:n,position:OverviewRulerLane$1.Right},minimap:r,zIndex:i,inlineClassName:o}}_hasMarkerTag(e,t){return!!e.tags&&e.tags.indexOf(t)>=0}};MarkerDecorationsService=__decorate$a([__param$9(0,IModelService),__param$9(1,IMarkerService)],MarkerDecorationsService);var standaloneQuickInput="",button="";const defaultOptions={buttonBackground:Color.fromHex("#0E639C"),buttonHoverBackground:Color.fromHex("#006BB3"),buttonForeground:Color.white};class Button extends Disposable{constructor(e,t){super(),this._onDidClick=this._register(new Emitter$1),this.options=t||Object.create(null),mixin(this.options,defaultOptions,!1),this.buttonForeground=this.options.buttonForeground,this.buttonBackground=this.options.buttonBackground,this.buttonHoverBackground=this.options.buttonHoverBackground,this.buttonSecondaryForeground=this.options.buttonSecondaryForeground,this.buttonSecondaryBackground=this.options.buttonSecondaryBackground,this.buttonSecondaryHoverBackground=this.options.buttonSecondaryHoverBackground,this.buttonBorder=this.options.buttonBorder,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),e.appendChild(this._element),this._register(Gesture.addTarget(this._element)),[EventType$1.CLICK,EventType.Tap].forEach((e=>{this._register(addDisposableListener(this._element,e,(e=>{this.enabled?this._onDidClick.fire(e):EventHelper.stop(e)})))})),this._register(addDisposableListener(this._element,EventType$1.KEY_DOWN,(e=>{const t=new StandardKeyboardEvent(e);let n=!1;this.enabled&&(t.equals(3)||t.equals(10))?(this._onDidClick.fire(e),n=!0):t.equals(9)&&(this._element.blur(),n=!0),n&&EventHelper.stop(t,!0)}))),this._register(addDisposableListener(this._element,EventType$1.MOUSE_OVER,(e=>{this._element.classList.contains("disabled")||this.setHoverBackground()}))),this._register(addDisposableListener(this._element,EventType$1.MOUSE_OUT,(e=>{this.applyStyles()}))),this.focusTracker=this._register(trackFocus(this._element)),this._register(this.focusTracker.onDidFocus((()=>this.setHoverBackground()))),this._register(this.focusTracker.onDidBlur((()=>this.applyStyles()))),this.applyStyles()}get onDidClick(){return this._onDidClick.event}setHoverBackground(){let e;e=this.options.secondary?this.buttonSecondaryHoverBackground?this.buttonSecondaryHoverBackground.toString():null:this.buttonHoverBackground?this.buttonHoverBackground.toString():null,e&&(this._element.style.backgroundColor=e)}style(e){this.buttonForeground=e.buttonForeground,this.buttonBackground=e.buttonBackground,this.buttonHoverBackground=e.buttonHoverBackground,this.buttonSecondaryForeground=e.buttonSecondaryForeground,this.buttonSecondaryBackground=e.buttonSecondaryBackground,this.buttonSecondaryHoverBackground=e.buttonSecondaryHoverBackground,this.buttonBorder=e.buttonBorder,this.applyStyles()}applyStyles(){if(this._element){let e,t;this.options.secondary?(t=this.buttonSecondaryForeground?this.buttonSecondaryForeground.toString():"",e=this.buttonSecondaryBackground?this.buttonSecondaryBackground.toString():""):(t=this.buttonForeground?this.buttonForeground.toString():"",e=this.buttonBackground?this.buttonBackground.toString():"");const n=this.buttonBorder?this.buttonBorder.toString():"";this._element.style.color=t,this._element.style.backgroundColor=e,this._element.style.borderWidth=n?"1px":"",this._element.style.borderStyle=n?"solid":"",this._element.style.borderColor=n}}get element(){return this._element}set label(e){this._element.classList.add("monaco-text-button"),this.options.supportIcons?reset(this._element,...renderLabelWithIcons(e)):this._element.textContent=e,"string"==typeof this.options.title?this._element.title=this.options.title:this.options.title&&(this._element.title=e)}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}}var progressbar="";const CSS_DONE="done",CSS_ACTIVE="active",CSS_INFINITE="infinite",CSS_INFINITE_LONG_RUNNING="infinite-long-running",CSS_DISCRETE="discrete",defaultOpts={progressBarBackground:Color.fromHex("#0E70C0")};class ProgressBar extends Disposable{constructor(e,t){super(),this.options=t||Object.create(null),mixin(this.options,defaultOpts,!1),this.workedVal=0,this.progressBarBackground=this.options.progressBarBackground,this.showDelayedScheduler=this._register(new RunOnceScheduler((()=>show(this.element)),0)),this.longRunningScheduler=this._register(new RunOnceScheduler((()=>this.infiniteLongRunning()),ProgressBar.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e)}create(e){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.element.appendChild(this.bit),this.applyStyles()}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(CSS_ACTIVE,CSS_INFINITE,CSS_INFINITE_LONG_RUNNING,CSS_DISCRETE),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(CSS_DONE),this.element.classList.contains(CSS_INFINITE)?(this.bit.style.opacity="0",e?setTimeout((()=>this.off()),200):this.off()):(this.bit.style.width="inherit",e?setTimeout((()=>this.off()),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(CSS_DISCRETE,CSS_DONE,CSS_INFINITE_LONG_RUNNING),this.element.classList.add(CSS_ACTIVE,CSS_INFINITE),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(CSS_INFINITE_LONG_RUNNING)}getContainer(){return this.element}style(e){this.progressBarBackground=e.progressBarBackground,this.applyStyles()}applyStyles(){if(this.bit){const e=this.progressBarBackground?this.progressBarBackground.toString():"";this.bit.style.backgroundColor=e}}}ProgressBar.LONG_RUNNING_INFINITE_THRESHOLD=1e4;var quickInput="";const iconPathToClass={},iconClassGenerator=new IdGenerator("quick-input-button-icon-");function getIconClass(e){if(!e)return;let t;const n=e.dark.toString();return iconPathToClass[n]?t=iconPathToClass[n]:(t=iconClassGenerator.nextId(),createCSSRule(`.${t}`,`background-image: ${asCSSUrl(e.light||e.dark)}`),createCSSRule(`.vs-dark .${t}, .hc-black .${t}`,`background-image: ${asCSSUrl(e.dark)}`),iconPathToClass[n]=t),t}const $$3=$$c;class QuickInputBox extends Disposable{constructor(e){super(),this.parent=e,this.onKeyDown=e=>addDisposableListener(this.inputBox.inputElement,EventType$1.KEY_DOWN,(t=>{e(new StandardKeyboardEvent(t))})),this.onMouseDown=e=>addDisposableListener(this.inputBox.inputElement,EventType$1.MOUSE_DOWN,(t=>{e(new StandardMouseEvent(t))})),this.onDidChange=e=>this.inputBox.onDidChange(e),this.container=append$1(this.parent,$$3(".quick-input-box")),this.inputBox=this._register(new InputBox(this.container,void 0))}get value(){return this.inputBox.value}set value(e){this.inputBox.value=e}select(e=null){this.inputBox.select(e)}isSelectionAtEnd(){return this.inputBox.isSelectionAtEnd()}get placeholder(){return this.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.inputBox.setPlaceHolder(e)}get ariaLabel(){return this.inputBox.getAriaLabel()}set ariaLabel(e){this.inputBox.setAriaLabel(e)}get password(){return"password"===this.inputBox.inputElement.type}set password(e){this.inputBox.inputElement.type=e?"password":"text"}setAttribute(e,t){this.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===Severity$2.Ignore?this.inputBox.hideMessage():this.inputBox.showMessage({type:e===Severity$2.Info?1:e===Severity$2.Warning?2:3,content:""})}stylesForType(e){return this.inputBox.stylesForType(e===Severity$2.Info?1:e===Severity$2.Warning?2:3)}setFocus(){this.inputBox.focus()}layout(){this.inputBox.layout()}style(e){this.inputBox.style(e)}}var keybindingLabel="";const $$2=$$c;class KeybindingLabel{constructor(e,t,n){this.os=t,this.keyElements=new Set,this.options=n||Object.create(null),this.labelBackground=this.options.keybindingLabelBackground,this.labelForeground=this.options.keybindingLabelForeground,this.labelBorder=this.options.keybindingLabelBorder,this.labelBottomBorder=this.options.keybindingLabelBottomBorder,this.labelShadow=this.options.keybindingLabelShadow,this.domNode=append$1(e,$$2(".monaco-keybinding")),this.didEverRender=!1,e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t){this.didEverRender&&this.keybinding===e&&KeybindingLabel.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}render(){if(this.clear(),this.keybinding){let[e,t]=this.keybinding.getParts();e&&this.renderPart(this.domNode,e,this.matches?this.matches.firstPart:null),t&&(append$1(this.domNode,$$2("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderPart(this.domNode,t,this.matches?this.matches.chordPart:null)),this.domNode.title=this.keybinding.getAriaLabel()||""}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.applyStyles(),this.didEverRender=!0}clear(){clearNode(this.domNode),this.keyElements.clear()}renderPart(e,t,n){const i=UILabelProvider.modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,i.ctrlKey,Boolean(null==n?void 0:n.ctrlKey),i.separator),t.shiftKey&&this.renderKey(e,i.shiftKey,Boolean(null==n?void 0:n.shiftKey),i.separator),t.altKey&&this.renderKey(e,i.altKey,Boolean(null==n?void 0:n.altKey),i.separator),t.metaKey&&this.renderKey(e,i.metaKey,Boolean(null==n?void 0:n.metaKey),i.separator);const o=t.keyLabel;o&&this.renderKey(e,o,Boolean(null==n?void 0:n.keyCode),"")}renderKey(e,t,n,i){append$1(e,this.createKeyElement(t,n?".highlight":"")),i&&append$1(e,$$2("span.monaco-keybinding-key-separator",void 0,i))}renderUnbound(e){append$1(e,this.createKeyElement(localize("unbound","Unbound")))}createKeyElement(e,t=""){const n=$$2("span.monaco-keybinding-key"+t,void 0,e);return this.keyElements.add(n),n}style(e){this.labelBackground=e.keybindingLabelBackground,this.labelForeground=e.keybindingLabelForeground,this.labelBorder=e.keybindingLabelBorder,this.labelBottomBorder=e.keybindingLabelBottomBorder,this.labelShadow=e.keybindingLabelShadow,this.applyStyles()}applyStyles(){var e;if(this.element){for(const t of this.keyElements)this.labelBackground&&(t.style.backgroundColor=null===(e=this.labelBackground)||void 0===e?void 0:e.toString()),this.labelBorder&&(t.style.borderColor=this.labelBorder.toString()),this.labelBottomBorder&&(t.style.borderBottomColor=this.labelBottomBorder.toString()),this.labelShadow&&(t.style.boxShadow=`inset 0 -1px 0 ${this.labelShadow}`);this.labelForeground&&(this.element.style.color=this.labelForeground.toString())}}static areSame(e,t){return e===t||!e&&!t||!!e&&!!t&&equals(e.firstPart,t.firstPart)&&equals(e.chordPart,t.chordPart)}}const intlFileNameCollatorBaseNumeric=new IdleValue((()=>{const e=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}}));function compareFileNames(e,t,n=!1){const i=e||"",o=t||"",r=intlFileNameCollatorBaseNumeric.value.collator.compare(i,o);return intlFileNameCollatorBaseNumeric.value.collatorIsNumeric&&0===r&&i!==o?i<o?-1:1:r}function compareAnything(e,t,n){const i=e.toLowerCase(),o=t.toLowerCase(),r=compareByPrefix(e,t,n);if(r)return r;const s=i.endsWith(n);if(s!==o.endsWith(n))return s?-1:1;const a=compareFileNames(i,o);return 0!==a?a:i.localeCompare(o)}function compareByPrefix(e,t,n){const i=e.toLowerCase(),o=t.toLowerCase(),r=i.startsWith(n),s=o.startsWith(n);if(r!==s)return r?-1:1;if(r&&s){if(i.length<o.length)return-1;if(i.length>o.length)return 1}return 0}new IdleValue((()=>({collator:new Intl.Collator(void 0,{numeric:!0})}))),new IdleValue((()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})})));var __decorate$9=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__awaiter$4=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const $$1=$$c;class ListElement{constructor(e){this.hidden=!1,this._onChecked=new Emitter$1,this.onChecked=this._onChecked.event,Object.assign(this,e)}get checked(){return!!this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire(e))}dispose(){this._onChecked.dispose()}}class ListElementRenderer{get templateId(){return ListElementRenderer.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=append$1(e,$$1(".quick-input-list-entry"));const n=append$1(t.entry,$$1("label.quick-input-list-label"));t.toDisposeTemplate.push(addStandardDisposableListener(n,EventType$1.CLICK,(e=>{t.checkbox.offsetParent||e.preventDefault()}))),t.checkbox=append$1(n,$$1("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(addStandardDisposableListener(t.checkbox,EventType$1.CHANGE,(e=>{t.element.checked=t.checkbox.checked})));const i=append$1(n,$$1(".quick-input-list-rows")),o=append$1(i,$$1(".quick-input-list-row")),r=append$1(i,$$1(".quick-input-list-row"));t.label=new IconLabel(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0});const s=append$1(o,$$1(".quick-input-list-entry-keybinding"));t.keybinding=new KeybindingLabel(s,OS);const a=append$1(r,$$1(".quick-input-list-label-meta"));return t.detail=new IconLabel(a,{supportHighlights:!0,supportIcons:!0}),t.separator=append$1(t.entry,$$1(".quick-input-list-separator")),t.actionBar=new ActionBar(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,n){n.toDisposeElement=dispose(n.toDisposeElement),n.element=e,n.checkbox.checked=e.checked,n.toDisposeElement.push(e.onChecked((e=>n.checkbox.checked=e)));const{labelHighlights:i,descriptionHighlights:o,detailHighlights:r}=e,s=Object.create(null);s.matches=i||[],s.descriptionTitle=e.saneDescription,s.descriptionMatches=o||[],s.extraClasses=e.item.iconClasses,s.italic=e.item.italic,s.strikethrough=e.item.strikethrough,n.label.setLabel(e.saneLabel,e.saneDescription,s),n.keybinding.set(e.item.keybinding),e.saneDetail&&n.detail.setLabel(e.saneDetail,void 0,{matches:r,title:e.saneDetail}),e.separator&&e.separator.label?(n.separator.textContent=e.separator.label,n.separator.style.display=""):n.separator.style.display="none",n.entry.classList.toggle("quick-input-list-separator-border",!!e.separator),n.actionBar.clear();const a=e.item.buttons;a&&a.length?(n.actionBar.push(a.map(((t,n)=>{let i=t.iconClass||(t.iconPath?getIconClass(t.iconPath):void 0);t.alwaysVisible&&(i=i?`${i} always-visible`:"always-visible");const o=new Action(`id-${n}`,"",i,!0,(()=>__awaiter$4(this,void 0,void 0,(function*(){e.fireButtonTriggered({button:t,item:e.item})}))));return o.tooltip=t.tooltip||"",o})),{icon:!0,label:!1}),n.entry.classList.add("has-actions")):n.entry.classList.remove("has-actions")}disposeElement(e,t,n){n.toDisposeElement=dispose(n.toDisposeElement)}disposeTemplate(e){e.toDisposeElement=dispose(e.toDisposeElement),e.toDisposeTemplate=dispose(e.toDisposeTemplate)}}ListElementRenderer.ID="listelement";class ListElementDelegate{getHeight(e){return e.saneDetail?44:22}getTemplateId(e){return ListElementRenderer.ID}}var QuickInputListFocus,QuickInputListFocus2;QuickInputListFocus2=QuickInputListFocus||(QuickInputListFocus={}),QuickInputListFocus2[QuickInputListFocus2.First=1]="First",QuickInputListFocus2[QuickInputListFocus2.Second=2]="Second",QuickInputListFocus2[QuickInputListFocus2.Last=3]="Last",QuickInputListFocus2[QuickInputListFocus2.Next=4]="Next",QuickInputListFocus2[QuickInputListFocus2.Previous=5]="Previous",QuickInputListFocus2[QuickInputListFocus2.NextPage=6]="NextPage",QuickInputListFocus2[QuickInputListFocus2.PreviousPage=7]="PreviousPage";class QuickInputList{constructor(e,t,n){this.parent=e,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnMeta=!0,this.sortByLabel=!0,this._onChangedAllVisibleChecked=new Emitter$1,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new Emitter$1,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new Emitter$1,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new Emitter$1,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new Emitter$1,this.onButtonTriggered=this._onButtonTriggered.event,this._onKeyDown=new Emitter$1,this.onKeyDown=this._onKeyDown.event,this._onLeave=new Emitter$1,this.onLeave=this._onLeave.event,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=append$1(this.parent,$$1(".quick-input-list"));const i=new ListElementDelegate,o=new QuickInputAccessibilityProvider;this.list=n.createList("QuickInput",this.container,i,[new ListElementRenderer],{identityProvider:{getId:e=>e.saneLabel},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:o}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown((e=>{const t=new StandardKeyboardEvent(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(isMacintosh?e.metaKey:e.ctrlKey)&&this.list.setFocus(range(this.list.length));break;case 16:{const e=this.list.getFocus();1===e.length&&0===e[0]&&this._onLeave.fire();break}case 18:{const e=this.list.getFocus();1===e.length&&e[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(t)}))),this.disposables.push(this.list.onMouseDown((e=>{2!==e.browserEvent.button&&e.browserEvent.preventDefault()}))),this.disposables.push(addDisposableListener(this.container,EventType$1.CLICK,(e=>{(e.x||e.y)&&this._onLeave.fire()}))),this.disposables.push(this.list.onMouseMiddleClick((e=>{this._onLeave.fire()}))),this.disposables.push(this.list.onContextMenu((e=>{"number"==typeof e.index&&(e.browserEvent.preventDefault(),this.list.setSelection([e.index]))}))),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return Event$1.map(this.list.onDidChangeFocus,(e=>e.elements.map((e=>e.item))))}get onDidChangeSelection(){return Event$1.map(this.list.onDidChangeSelection,(e=>({items:e.elements.map((e=>e.item)),event:e.browserEvent})))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let n=0,i=e.length;n<i;n++){const i=e[n];if(!i.hidden){if(!i.checked)return!1;t=!0}}return t}getCheckedCount(){let e=0;const t=this.elements;for(let n=0,i=t.length;n<i;n++)t[n].checked&&e++;return e}getVisibleCount(){let e=0;const t=this.elements;for(let n=0,i=t.length;n<i;n++)t[n].hidden||e++;return e}setAllVisibleChecked(e){try{this._fireCheckedEvents=!1,this.elements.forEach((t=>{t.hidden||(t.checked=e)}))}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=dispose(this.elementDisposables);const t=e=>this.fireButtonTriggered(e);this.inputElements=e,this.elements=e.reduce(((n,i,o)=>{var r,s,a;if("separator"!==i.type){const l=o&&e[o-1],c=i.label&&i.label.replace(/\r?\n/g," "),d=i.meta&&i.meta.replace(/\r?\n/g," "),u=i.description&&i.description.replace(/\r?\n/g," "),h=i.detail&&i.detail.replace(/\r?\n/g," "),g=i.ariaLabel||[c,u,h].map((e=>getCodiconAriaLabel(e))).filter((e=>!!e)).join(", "),p=this.parent.classList.contains("show-checkboxes");n.push(new ListElement({hasCheckbox:p,index:o,item:i,saneLabel:c,saneMeta:d,saneAriaLabel:g,saneDescription:u,saneDetail:h,labelHighlights:null===(r=i.highlights)||void 0===r?void 0:r.label,descriptionHighlights:null===(s=i.highlights)||void 0===s?void 0:s.description,detailHighlights:null===(a=i.highlights)||void 0===a?void 0:a.detail,checked:!1,separator:l&&"separator"===l.type?l:void 0,fireButtonTriggered:t}))}return n}),[]),this.elementDisposables.push(...this.elements),this.elementDisposables.push(...this.elements.map((e=>e.onChecked((()=>this.fireCheckedEvents()))))),this.elementsToIndexes=this.elements.reduce(((e,t,n)=>(e.set(t.item,n),e)),new Map),this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map((e=>e.item))}setFocusedElements(e){if(this.list.setFocus(e.filter((e=>this.elementsToIndexes.has(e))).map((e=>this.elementsToIndexes.get(e)))),e.length>0){const e=this.list.getFocus()[0];"number"==typeof e&&this.list.reveal(e)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter((e=>this.elementsToIndexes.has(e))).map((e=>this.elementsToIndexes.get(e))))}getCheckedElements(){return this.elements.filter((e=>e.checked)).map((e=>e.item))}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const n of e)t.add(n);for(const e of this.elements)e.checked=t.has(e.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===QuickInputListFocus.Next&&this.list.getFocus()[0]===this.list.length-1&&(e=QuickInputListFocus.First),e===QuickInputListFocus.Previous&&0===this.list.getFocus()[0]&&(e=QuickInputListFocus.Last),e===QuickInputListFocus.Second&&this.list.length<2&&(e=QuickInputListFocus.First),e){case QuickInputListFocus.First:this.list.focusFirst();break;case QuickInputListFocus.Second:this.list.focusNth(1);break;case QuickInputListFocus.Last:this.list.focusLast();break;case QuickInputListFocus.Next:this.list.focusNext();break;case QuickInputListFocus.Previous:this.list.focusPrevious();break;case QuickInputListFocus.NextPage:this.list.focusNextPage();break;case QuickInputListFocus.PreviousPage:this.list.focusPreviousPage()}const t=this.list.getFocus()[0];"number"==typeof t&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}layout(e){this.list.getHTMLElement().style.maxHeight=e?`calc(${44*Math.floor(e/44)}px)`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;if((e=e.trim())&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)){let t;this.elements.forEach((n=>{const i=this.matchOnLabel?withNullAsUndefined(matchesFuzzyIconAware(e,parseLabelWithIcons(n.saneLabel))):void 0,o=this.matchOnDescription?withNullAsUndefined(matchesFuzzyIconAware(e,parseLabelWithIcons(n.saneDescription||""))):void 0,r=this.matchOnDetail?withNullAsUndefined(matchesFuzzyIconAware(e,parseLabelWithIcons(n.saneDetail||""))):void 0,s=this.matchOnMeta?withNullAsUndefined(matchesFuzzyIconAware(e,parseLabelWithIcons(n.saneMeta||""))):void 0;if(i||o||r||s?(n.labelHighlights=i,n.descriptionHighlights=o,n.detailHighlights=r,n.hidden=!1):(n.labelHighlights=void 0,n.descriptionHighlights=void 0,n.detailHighlights=void 0,n.hidden=!n.item.alwaysShow),n.separator=void 0,!this.sortByLabel){const e=n.index&&this.inputElements[n.index-1];t=e&&"separator"===e.type?e:t,t&&!n.hidden&&(n.separator=t,t=void 0)}}))}else this.elements.forEach((e=>{e.labelHighlights=void 0,e.descriptionHighlights=void 0,e.detailHighlights=void 0,e.hidden=!1;const t=e.index&&this.inputElements[e.index-1];e.separator=t&&"separator"===t.type?t:void 0}));const t=this.elements.filter((e=>!e.hidden));if(this.sortByLabel&&e){const n=e.toLowerCase();t.sort(((e,t)=>compareEntries(e,t,n)))}return this.elementsToIndexes=t.reduce(((e,t,n)=>(e.set(t.item,n),e)),new Map),this.list.splice(0,this.list.length,t),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(t.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const n of e)n.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return"none"!==this.container.style.display}dispose(){this.elementDisposables=dispose(this.elementDisposables),this.disposables=dispose(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}style(e){this.list.style(e)}}function compareEntries(e,t,n){const i=e.labelHighlights||[],o=t.labelHighlights||[];return i.length&&!o.length?-1:!i.length&&o.length?1:0===i.length&&0===o.length?0:compareAnything(e.saneLabel,t.saneLabel,n)}__decorate$9([memoize],QuickInputList.prototype,"onDidChangeFocus",null),__decorate$9([memoize],QuickInputList.prototype,"onDidChangeSelection",null);class QuickInputAccessibilityProvider{getWidgetAriaLabel(){return localize("quickInput","Quick Input")}getAriaLabel(e){return e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var __awaiter$3=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};const $=$$c,backButton={iconClass:Codicon.quickInputBack.classNames,tooltip:localize("quickInput.back","Back"),handle:-1};class QuickInput extends Disposable{constructor(e){super(),this.ui=e,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.noValidationMessage=QuickInput.noPromptMessage,this._severity=Severity$2.Ignore,this.buttonsUpdated=!1,this.onDidTriggerButtonEmitter=this._register(new Emitter$1),this.onDidHideEmitter=this._register(new Emitter$1),this.onDisposeEmitter=this._register(new Emitter$1),this.visibleDisposables=this._register(new DisposableStore),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!isIOS;this._ignoreFocusOut=e&&!isIOS,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton((e=>{-1!==this.buttons.indexOf(e)&&this.onDidTriggerButtonEmitter.fire(e)}))),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=QuickInputHideReason.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:e||" "===this.ui.title.innerHTML||(this.ui.title.innerText=" ");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this.busy&&!this.busyDelay&&(this.busyDelay=new TimeoutTimer,this.busyDelay.setIfNotSet((()=>{this.visible&&this.ui.progressBar.infinite()}),800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const e=this.buttons.filter((e=>e===backButton));this.ui.leftActionBar.push(e.map(((e,t)=>{const n=new Action(`id-${t}`,"",e.iconClass||getIconClass(e.iconPath),!0,(()=>__awaiter$3(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)}))));return n.tooltip=e.tooltip||"",n})),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const t=this.buttons.filter((e=>e!==backButton));this.ui.rightActionBar.push(t.map(((e,t)=>{const n=new Action(`id-${t}`,"",e.iconClass||getIconClass(e.iconPath),!0,(()=>__awaiter$3(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)}))));return n.tooltip=e.tooltip||"",n})),{icon:!0,label:!1})}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const n=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==n&&(this._lastValidationMessage=n,reset(this.ui.message,...renderLabelWithIcons(n))),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?localize("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==Severity$2.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}QuickInput.noPromptMessage=localize("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class QuickPick extends QuickInput{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new Emitter$1),this.onWillAcceptEmitter=this._register(new Emitter$1),this.onDidAcceptEmitter=this._register(new Emitter$1),this.onDidCustomEmitter=this._register(new Emitter$1),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._sortByLabel=!0,this._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=this.ui.isScreenReaderOptimized()?ItemActivation.NONE:ItemActivation.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new Emitter$1),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new Emitter$1),this.onDidTriggerItemButtonEmitter=this._register(new Emitter$1),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){if(this._value!==e){if(this._value=e,t||this.update(),this.visible){this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst()}this.onDidChangeValueEmitter.fire(this._value)}}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?NO_KEY_MODS:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(QuickInputListFocus.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange((e=>{this.doSetValue(e,!0)}))),this.visibleDisposables.add(this.ui.inputBox.onMouseDown((e=>{this.autoFocusOnList||this.ui.list.clearFocus()}))),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown((e=>{switch(e.keyCode){case 18:this.ui.list.focus(QuickInputListFocus.Next),this.canSelectMany&&this.ui.list.domFocus(),EventHelper.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(QuickInputListFocus.Previous):this.ui.list.focus(QuickInputListFocus.Last),this.canSelectMany&&this.ui.list.domFocus(),EventHelper.stop(e,!0);break;case 12:this.ui.list.focus(QuickInputListFocus.NextPage),this.canSelectMany&&this.ui.list.domFocus(),EventHelper.stop(e,!0);break;case 11:this.ui.list.focus(QuickInputListFocus.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),EventHelper.stop(e,!0);break;case 17:if(!this._canAcceptInBackground)return;if(!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(QuickInputListFocus.First),EventHelper.stop(e,!0));break;case 13:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(QuickInputListFocus.Last),EventHelper.stop(e,!0))}}))),this.visibleDisposables.add(this.ui.onDidAccept((()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)}))),this.visibleDisposables.add(this.ui.onDidCustom((()=>{this.onDidCustomEmitter.fire()}))),this.visibleDisposables.add(this.ui.list.onDidChangeFocus((e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&equals$1(e,this._activeItems,((e,t)=>e===t))||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))}))),this.visibleDisposables.add(this.ui.list.onDidChangeSelection((({items:e,event:t})=>{this.canSelectMany?e.length&&this.ui.list.setSelectedElements([]):this.selectedItemsToConfirm!==this._selectedItems&&equals$1(e,this._selectedItems,((e,t)=>e===t))||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&1===t.button))}))),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements((e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&equals$1(e,this._selectedItems,((e,t)=>e===t))||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))}))),this.visibleDisposables.add(this.ui.list.onButtonTriggered((e=>this.onDidTriggerItemButtonEmitter.fire(e)))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return addDisposableListener(this.ui.container,EventType$1.KEY_UP,(e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new StandardKeyboardEvent(e),n=t.keyCode;this._quickNavigate.keybindings.some((e=>{const[i,o]=e.getParts();return!o&&(i.shiftKey&&4===n?!(t.ctrlKey||t.altKey||t.metaKey):!(!i.altKey||6!==n)||(!(!i.ctrlKey||5!==n)||!(!i.metaKey||57!==n)))}))&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)}))}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this._hideInput&&this._items.length>0;this.ui.container.classList.toggle("hidden-input",t&&!this.description);const n={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!t,progressBar:!t,visibleCount:!0,count:this.canSelectMany,ok:"default"===this.ok?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(n),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");const i=this.ariaLabel||this.placeholder||QuickPick.DEFAULT_ARIA_LABEL;if(this.ui.inputBox.ariaLabel!==i&&(this.ui.inputBox.ariaLabel=i),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case ItemActivation.NONE:this._itemActivation=ItemActivation.FIRST;break;case ItemActivation.SECOND:this.ui.list.focus(QuickInputListFocus.Second),this._itemActivation=ItemActivation.FIRST;break;case ItemActivation.LAST:this.ui.list.focus(QuickInputListFocus.Last),this._itemActivation=ItemActivation.FIRST;break;default:this.trySelectFirst()}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",this.ui.setComboboxAccessibility(!0),n.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(QuickInputListFocus.First)),this.keepScrollPosition&&(this.scrollTop=e)}}QuickPick.DEFAULT_ARIA_LABEL=localize("quickInputBox.ariaLabel","Type to narrow down results.");class QuickInputController extends Disposable{constructor(e){super(),this.options=e,this.comboboxAccessibility=!1,this.enabled=!0,this.onDidAcceptEmitter=this._register(new Emitter$1),this.onDidCustomEmitter=this._register(new Emitter$1),this.onDidTriggerButtonEmitter=this._register(new Emitter$1),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new Emitter$1),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new Emitter$1),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey};this._register(addDisposableListener(window,EventType$1.KEY_DOWN,e,!0)),this._register(addDisposableListener(window,EventType$1.KEY_UP,e,!0)),this._register(addDisposableListener(window,EventType$1.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=append$1(this.parentElement,$(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=createStyleSheet(e),n=append$1(e,$(".quick-input-titlebar")),i=this._register(new ActionBar(n));i.domNode.classList.add("quick-input-left-action-bar");const o=append$1(n,$(".quick-input-title")),r=this._register(new ActionBar(n));r.domNode.classList.add("quick-input-right-action-bar");const s=append$1(e,$(".quick-input-description")),a=append$1(e,$(".quick-input-header")),l=append$1(a,$("input.quick-input-check-all"));l.type="checkbox",this._register(addStandardDisposableListener(l,EventType$1.CHANGE,(e=>{const t=l.checked;S.setAllVisibleChecked(t)}))),this._register(addDisposableListener(l,EventType$1.CLICK,(e=>{(e.x||e.y)&&h.setFocus()})));const c=append$1(a,$(".quick-input-description")),d=append$1(a,$(".quick-input-and-message")),u=append$1(d,$(".quick-input-filter")),h=this._register(new QuickInputBox(u));h.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=append$1(u,$(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new CountBadge(g,{countFormat:localize({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")}),f=append$1(u,$(".quick-input-count"));f.setAttribute("aria-live","polite");const m=new CountBadge(f,{countFormat:localize({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")}),v=append$1(a,$(".quick-input-action")),_=new Button(v);_.label=localize("ok","OK"),this._register(_.onDidClick((e=>{this.onDidAcceptEmitter.fire()})));const C=append$1(a,$(".quick-input-action")),b=new Button(C);b.label=localize("custom","Custom"),this._register(b.onDidClick((e=>{this.onDidCustomEmitter.fire()})));const y=append$1(d,$(`#${this.idPrefix}message.quick-input-message`)),S=this._register(new QuickInputList(e,this.idPrefix+"list",this.options));this._register(S.onChangedAllVisibleChecked((e=>{l.checked=e}))),this._register(S.onChangedVisibleCount((e=>{p.setCount(e)}))),this._register(S.onChangedCheckedCount((e=>{m.setCount(e)}))),this._register(S.onLeave((()=>{setTimeout((()=>{h.setFocus(),this.controller instanceof QuickPick&&this.controller.canSelectMany&&S.clearFocus()}),0)}))),this._register(S.onDidChangeFocus((()=>{this.comboboxAccessibility&&this.getUI().inputBox.setAttribute("aria-activedescendant",this.getUI().list.getActiveDescendant()||"")})));const w=new ProgressBar(e);w.getContainer().classList.add("quick-input-progress");const E=trackFocus(e);return this._register(E),this._register(addDisposableListener(e,EventType$1.FOCUS,(e=>{this.previousFocusElement=e.relatedTarget instanceof HTMLElement?e.relatedTarget:void 0}),!0)),this._register(E.onDidBlur((()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(QuickInputHideReason.Blur),this.previousFocusElement=void 0}))),this._register(addDisposableListener(e,EventType$1.FOCUS,(e=>{h.setFocus()}))),this._register(addDisposableListener(e,EventType$1.KEY_DOWN,(t=>{const n=new StandardKeyboardEvent(t);switch(n.keyCode){case 3:EventHelper.stop(t,!0),this.onDidAcceptEmitter.fire();break;case 9:EventHelper.stop(t,!0),this.hide(QuickInputHideReason.Gesture);break;case 2:if(!n.altKey&&!n.ctrlKey&&!n.metaKey){const i=[".action-label.codicon"];e.classList.contains("show-checkboxes")?i.push("input"):i.push("input[type=text]"),this.getUI().list.isDisplayed()&&i.push(".monaco-list");const o=e.querySelectorAll(i.join(", "));n.shiftKey&&n.target===o[0]?(EventHelper.stop(t,!0),o[o.length-1].focus()):n.shiftKey||n.target!==o[o.length-1]||(EventHelper.stop(t,!0),o[0].focus())}}}))),this.ui={container:e,styleSheet:t,leftActionBar:i,titleBar:n,title:o,description1:s,description2:c,rightActionBar:r,checkAll:l,filterContainer:u,inputBox:h,visibleCountContainer:g,visibleCount:p,countContainer:f,count:m,okContainer:v,ok:_,message:y,customButtonContainer:C,customButton:b,list:S,progressBar:w,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,isScreenReaderOptimized:()=>this.options.isScreenReaderOptimized(),show:e=>this.show(e),hide:()=>this.hide(),setVisibilities:e=>this.setVisibilities(e),setComboboxAccessibility:e=>this.setComboboxAccessibility(e),setEnabled:e=>this.setEnabled(e),setContextKey:e=>this.options.setContextKey(e)},this.updateStyles(),this.ui}pick(e,t={},n=CancellationToken.None){return new Promise(((i,o)=>{let r=e=>{r=i,t.onKeyMods&&t.onKeyMods(s.keyMods),i(e)};if(n.isCancellationRequested)return void r(void 0);const s=this.createQuickPick();let a;const l=[s,s.onDidAccept((()=>{if(s.canSelectMany)r(s.selectedItems.slice()),s.hide();else{const e=s.activeItems[0];e&&(r(e),s.hide())}})),s.onDidChangeActive((e=>{const n=e[0];n&&t.onDidFocus&&t.onDidFocus(n)})),s.onDidChangeSelection((e=>{if(!s.canSelectMany){const t=e[0];t&&(r(t),s.hide())}})),s.onDidTriggerItemButton((e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},e),{removeItem:()=>{const t=s.items.indexOf(e.item);if(-1!==t){const e=s.items.slice(),n=e.splice(t,1),i=s.activeItems.filter((e=>e!==n[0])),o=s.keepScrollPosition;s.keepScrollPosition=!0,s.items=e,i&&(s.activeItems=i),s.keepScrollPosition=o}}})))),s.onDidChangeValue((e=>{!a||e||1===s.activeItems.length&&s.activeItems[0]===a||(s.activeItems=[a])})),n.onCancellationRequested((()=>{s.hide()})),s.onDidHide((()=>{dispose(l),r(void 0)}))];s.title=t.title,s.canSelectMany=!!t.canPickMany,s.placeholder=t.placeHolder,s.ignoreFocusOut=!!t.ignoreFocusLost,s.matchOnDescription=!!t.matchOnDescription,s.matchOnDetail=!!t.matchOnDetail,s.matchOnLabel=void 0===t.matchOnLabel||t.matchOnLabel,s.autoFocusOnList=void 0===t.autoFocusOnList||t.autoFocusOnList,s.quickNavigate=t.quickNavigate,s.contextKey=t.contextKey,s.busy=!0,Promise.all([e,t.activeItem]).then((([e,t])=>{a=t,s.busy=!1,s.items=e,s.canSelectMany&&(s.selectedItems=e.filter((e=>"separator"!==e.type&&e.picked))),a&&(s.activeItems=[a])})),s.show(),Promise.resolve(e).then(void 0,(e=>{o(e),s.hide()}))}))}createQuickPick(){const e=this.getUI();return new QuickPick(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const n=this.controller;this.controller=e,n&&n.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Severity$2.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),reset(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,this.setComboboxAccessibility(!1),t.inputBox.ariaLabel="";const i=this.options.backKeybindingLabel();backButton.tooltip=i?localize("quickInput.backWithKeybinding","Back ({0})",i):localize("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=!e.description||e.inputBox||e.checkAll?"none":"",t.checkAll.style.display=e.checkAll?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList[e.checkBox?"add":"remove"]("show-checkboxes"),this.updateLayout()}setComboboxAccessibility(e){if(e!==this.comboboxAccessibility){const t=this.getUI();this.comboboxAccessibility=e,this.comboboxAccessibility?(t.inputBox.setAttribute("role","combobox"),t.inputBox.setAttribute("aria-haspopup","true"),t.inputBox.setAttribute("aria-autocomplete","list"),t.inputBox.setAttribute("aria-activedescendant",t.list.getActiveDescendant()||"")):(t.inputBox.removeAttribute("role"),t.inputBox.removeAttribute("aria-haspopup"),t.inputBox.removeAttribute("aria-autocomplete"),t.inputBox.removeAttribute("aria-activedescendant"))}}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.getAction().enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.getAction().enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t;const n=this.controller;if(n){const i=!(null===(t=this.ui)||void 0===t?void 0:t.container.contains(document.activeElement));if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!i){let e=this.previousFocusElement;for(;e&&!e.offsetParent;)e=withNullAsUndefined(e.parentElement);(null==e?void 0:e.offsetParent)?(e.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}n.didHide(e)}}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(.62*this.dimension.width,QuickInputController.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&.4*this.dimension.height)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:n,contrastBorder:i,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e?e.toString():"",this.ui.container.style.backgroundColor=t?t.toString():"",this.ui.container.style.color=n?n.toString():"",this.ui.container.style.border=i?`1px solid ${i}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.inputBox.style(this.styles.inputBox),this.ui.count.style(this.styles.countBadge),this.ui.ok.style(this.styles.button),this.ui.customButton.style(this.styles.button),this.ui.progressBar.style(this.styles.progressBar),this.ui.list.style(this.styles.list);const r=[];this.styles.list.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.list.pickerGroupBorder}; }`),this.styles.list.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.list.pickerGroupForeground}; }`),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));const s=r.join("\n");s!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=s)}}}var DefaultQuickAccessFilterValue,DefaultQuickAccessFilterValue2;QuickInputController.MAX_WIDTH=600,DefaultQuickAccessFilterValue2=DefaultQuickAccessFilterValue||(DefaultQuickAccessFilterValue={}),DefaultQuickAccessFilterValue2[DefaultQuickAccessFilterValue2.PRESERVE=0]="PRESERVE",DefaultQuickAccessFilterValue2[DefaultQuickAccessFilterValue2.LAST=1]="LAST";const Extensions={Quickaccess:"workbench.contributions.quickaccess"};class QuickAccessRegistry{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return 0===e.prefix.length?this.defaultProvider=e:this.providers.push(e),this.providers.sort(((e,t)=>t.prefix.length-e.prefix.length)),toDisposable((()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)}))}getQuickAccessProviders(){return coalesce([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find((t=>e.startsWith(t.prefix)))||void 0||this.defaultProvider}}Registry.add(Extensions.Quickaccess,new QuickAccessRegistry);var __decorate$8=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$8=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let QuickAccessController=class extends Disposable{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Registry.as(Extensions.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,n){var i;const[o,r]=this.getOrInstantiateProvider(e),s=this.visibleQuickAccess,a=null==s?void 0:s.descriptor;if(s&&r&&a===r)return e===r.prefix||(null==n?void 0:n.preserveValue)||(s.picker.value=e),void this.adjustValueSelection(s.picker,r,n);if(r&&!(null==n?void 0:n.preserveValue)){let t;if(s&&a&&a!==r){const e=s.value.substr(a.prefix.length);e&&(t=`${r.prefix}${e}`)}if(!t){const e=null==o?void 0:o.defaultFilterValue;e===DefaultQuickAccessFilterValue.LAST?t=this.lastAcceptedPickerValues.get(r):"string"==typeof e&&(t=`${r.prefix}${e}`)}"string"==typeof t&&(e=t)}const l=new DisposableStore,c=l.add(this.quickInputService.createQuickPick());let d;c.value=e,this.adjustValueSelection(c,r,n),c.placeholder=null==r?void 0:r.placeholder,c.quickNavigate=null==n?void 0:n.quickNavigateConfiguration,c.hideInput=!!c.quickNavigate&&!s,("number"==typeof(null==n?void 0:n.itemActivation)||(null==n?void 0:n.quickNavigateConfiguration))&&(c.itemActivation=null!==(i=null==n?void 0:n.itemActivation)&&void 0!==i?i:ItemActivation.SECOND),c.contextKey=null==r?void 0:r.contextKey,c.filterValue=e=>e.substring(r?r.prefix.length:0),(null==r?void 0:r.placeholder)&&(c.ariaLabel=null==r?void 0:r.placeholder),t&&(d=new DeferredPromise,l.add(once$1(c.onWillAccept)((e=>{e.veto(),c.hide()})))),l.add(this.registerPickerListeners(c,o,r,e));const u=l.add(new CancellationTokenSource$1);return o&&l.add(o.provide(c,u.token)),once$1(c.onDidHide)((()=>{0===c.selectedItems.length&&u.cancel(),l.dispose(),null==d||d.complete(c.selectedItems.slice(0))})),c.show(),t?null==d?void 0:d.p:void 0}adjustValueSelection(e,t,n){var i;let o;o=(null==n?void 0:n.preserveValue)?[e.value.length,e.value.length]:[null!==(i=null==t?void 0:t.prefix.length)&&void 0!==i?i:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,n,i){const o=new DisposableStore,r=this.visibleQuickAccess={picker:e,descriptor:n,value:i};return o.add(toDisposable((()=>{r===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)}))),o.add(e.onDidChangeValue((e=>{const[n]=this.getOrInstantiateProvider(e);n!==t?this.show(e,{preserveValue:!0}):r.value=e}))),n&&o.add(e.onDidAccept((()=>{this.lastAcceptedPickerValues.set(n,e.value)}))),o}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let n=this.mapProviderToDescriptor.get(t);return n||(n=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,n)),[n,t]}};QuickAccessController=__decorate$8([__param$8(0,IQuickInputService),__param$8(1,IInstantiationService)],QuickAccessController);var __decorate$7=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$7=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let QuickInputService=class extends Themable{constructor(e,t,n,i,o){super(n),this.instantiationService=e,this.contextKeyService=t,this.accessibilityService=i,this.layoutService=o,this.contexts=new Map}get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(QuickAccessController))),this._quickAccess}createController(e=this.layoutService,t){var n,i;const o={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,isScreenReaderOptimized:()=>this.accessibilityService.isScreenReaderOptimized(),backKeybindingLabel:()=>{},setContextKey:e=>this.setContextKey(e),returnFocus:()=>e.focus(),createList:(e,t,n,i,o)=>this.instantiationService.createInstance(WorkbenchList,e,t,n,i,o),styles:this.computeStyles()},r=this._register(new QuickInputController(Object.assign(Object.assign({},o),t)));return r.layout(e.dimension,null!==(i=null===(n=e.offset)||void 0===n?void 0:n.top)&&void 0!==i?i:0),this._register(e.onDidLayout((t=>{var n,i;return r.layout(t,null!==(i=null===(n=e.offset)||void 0===n?void 0:n.top)&&void 0!==i?i:0)}))),this._register(r.onShow((()=>this.resetContextKeys()))),this._register(r.onHide((()=>this.resetContextKeys()))),r}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new RawContextKey(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),t&&t.get()||(this.resetContextKeys(),t&&t.set(!0))}resetContextKeys(){this.contexts.forEach((e=>{e.get()&&e.reset()}))}pick(e,t={},n=CancellationToken.None){return this.controller.pick(e,t,n)}createQuickPick(){return this.controller.createQuickPick()}updateStyles(){this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:Object.assign({},computeStyles(this.theme,{quickInputBackground:quickInputBackground,quickInputForeground:quickInputForeground,quickInputTitleBackground:quickInputTitleBackground,contrastBorder:contrastBorder,widgetShadow:widgetShadow})),inputBox:computeStyles(this.theme,{inputForeground:inputForeground,inputBackground:inputBackground,inputBorder:inputBorder,inputValidationInfoBackground:inputValidationInfoBackground,inputValidationInfoForeground:inputValidationInfoForeground,inputValidationInfoBorder:inputValidationInfoBorder,inputValidationWarningBackground:inputValidationWarningBackground,inputValidationWarningForeground:inputValidationWarningForeground,inputValidationWarningBorder:inputValidationWarningBorder,inputValidationErrorBackground:inputValidationErrorBackground,inputValidationErrorForeground:inputValidationErrorForeground,inputValidationErrorBorder:inputValidationErrorBorder}),countBadge:computeStyles(this.theme,{badgeBackground:badgeBackground,badgeForeground:badgeForeground,badgeBorder:contrastBorder}),button:computeStyles(this.theme,{buttonForeground:buttonForeground,buttonBackground:buttonBackground,buttonHoverBackground:buttonHoverBackground,buttonBorder:contrastBorder}),progressBar:computeStyles(this.theme,{progressBarBackground:progressBarBackground}),keybindingLabel:computeStyles(this.theme,{keybindingLabelBackground:keybindingLabelBackground,keybindingLabelForeground:keybindingLabelForeground,keybindingLabelBorder:keybindingLabelBorder,keybindingLabelBottomBorder:keybindingLabelBottomBorder,keybindingLabelShadow:widgetShadow}),list:computeStyles(this.theme,{listBackground:quickInputBackground,listInactiveFocusForeground:quickInputListFocusForeground,listInactiveSelectionIconForeground:quickInputListFocusIconForeground,listInactiveFocusBackground:quickInputListFocusBackground,listFocusOutline:activeContrastBorder,listInactiveFocusOutline:activeContrastBorder,pickerGroupBorder:pickerGroupBorder,pickerGroupForeground:pickerGroupForeground})}}};QuickInputService=__decorate$7([__param$7(0,IInstantiationService),__param$7(1,IContextKeyService),__param$7(2,IThemeService),__param$7(3,IAccessibilityService),__param$7(4,ILayoutService)],QuickInputService);var __decorate$6=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$6=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let EditorScopedQuickInputService=class extends QuickInputService{constructor(e,t,n,i,o,r){super(t,n,i,o,new EditorScopedLayoutService(e.getContainerDomNode(),r)),this.host=void 0;const s=QuickInputEditorContribution.get(e);if(s){const t=s.widget;this.host={_serviceBrand:void 0,get hasContainer(){return!0},get container(){return t.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};EditorScopedQuickInputService=__decorate$6([__param$6(1,IInstantiationService),__param$6(2,IContextKeyService),__param$6(3,IThemeService),__param$6(4,IAccessibilityService),__param$6(5,ICodeEditorService)],EditorScopedQuickInputService);let StandaloneQuickInputService=class{constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const n=t=this.instantiationService.createInstance(EditorScopedQuickInputService,e);this.mapEditorToService.set(e,t),once$1(e.onDidDispose)((()=>{n.dispose(),this.mapEditorToService.delete(e)}))}return t}get quickAccess(){return this.activeService.quickAccess}pick(e,t={},n=CancellationToken.None){return this.activeService.pick(e,t,n)}createQuickPick(){return this.activeService.createQuickPick()}};StandaloneQuickInputService=__decorate$6([__param$6(0,IInstantiationService),__param$6(1,ICodeEditorService)],StandaloneQuickInputService);class QuickInputEditorContribution{constructor(e){this.editor=e,this.widget=new QuickInputEditorWidget(this.editor)}static get(e){return e.getContribution(QuickInputEditorContribution.ID)}dispose(){this.widget.dispose()}}QuickInputEditorContribution.ID="editor.controller.quickInput";class QuickInputEditorWidget{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return QuickInputEditorWidget.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}QuickInputEditorWidget.ID="editor.contrib.quickInputWidget",registerEditorContribution(QuickInputEditorContribution.ID,QuickInputEditorContribution);class ParsedTokenThemeRule{constructor(e,t,n,i,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=n,this.foreground=i,this.background=o}}function parseTokenTheme(e){if(!e||!Array.isArray(e))return[];const t=[];let n=0;for(let i=0,o=e.length;i<o;i++){const o=e[i];let r=-1;if("string"==typeof o.fontStyle){r=0;const e=o.fontStyle.split(" ");for(let t=0,n=e.length;t<n;t++){switch(e[t]){case"italic":r|=1;break;case"bold":r|=2;break;case"underline":r|=4;break;case"strikethrough":r|=8}}}let s=null;"string"==typeof o.foreground&&(s=o.foreground);let a=null;"string"==typeof o.background&&(a=o.background),t[n++]=new ParsedTokenThemeRule(o.token||"",i,r,s,a)}return t}function resolveParsedTokenThemeRules(e,t){e.sort(((e,t)=>{const n=strcmp(e.token,t.token);return 0!==n?n:e.index-t.index}));let n=0,i="000000",o="ffffff";for(;e.length>=1&&""===e[0].token;){const t=e.shift();-1!==t.fontStyle&&(n=t.fontStyle),null!==t.foreground&&(i=t.foreground),null!==t.background&&(o=t.background)}const r=new ColorMap;for(let d of t)r.getId(d);const s=r.getId(i),a=r.getId(o),l=new ThemeTrieElementRule(n,s,a),c=new ThemeTrieElement(l);for(let d=0,u=e.length;d<u;d++){const t=e[d];c.insert(t.token,t.fontStyle,r.getId(t.foreground),r.getId(t.background))}return new TokenTheme(r,c)}const colorRegExp=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class ColorMap{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(null===e)return 0;const t=e.match(colorRegExp);if(!t)throw new Error("Illegal value for token color: "+e);e=t[1].toUpperCase();let n=this._color2id.get(e);return n||(n=++this._lastColorId,this._color2id.set(e,n),this._id2color[n]=Color.fromHex("#"+e),n)}getColorMap(){return this._id2color.slice(0)}}class TokenTheme{constructor(e,t){this._colorMap=e,this._root=t,this._cache=new Map}static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(parseTokenTheme(e),t)}static createFromParsedTokenTheme(e,t){return resolveParsedTokenThemeRules(e,t)}getColorMap(){return this._colorMap.getColorMap()}_match(e){return this._root.match(e)}match(e,t){let n=this._cache.get(t);if(void 0===n){const e=this._match(t),i=toStandardTokenType(t);n=(e.metadata|i<<8)>>>0,this._cache.set(t,n)}return(n|e<<0)>>>0}}const STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|regexp)\b/;function toStandardTokenType(e){const t=e.match(STANDARD_TOKEN_TYPE_REGEXP);if(!t)return 0;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function strcmp(e,t){return e<t?-1:e>t?1:0}class ThemeTrieElementRule{constructor(e,t,n){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=n,this.metadata=(this._fontStyle<<10|this._foreground<<14|this._background<<23)>>>0}clone(){return new ThemeTrieElementRule(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,n){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==n&&(this._background=n),this.metadata=(this._fontStyle<<10|this._foreground<<14|this._background<<23)>>>0}}class ThemeTrieElement{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(""===e)return this._mainRule;const t=e.indexOf(".");let n,i;-1===t?(n=e,i=""):(n=e.substring(0,t),i=e.substring(t+1));const o=this._children.get(n);return void 0!==o?o.match(i):this._mainRule}insert(e,t,n,i){if(""===e)return void this._mainRule.acceptOverwrite(t,n,i);const o=e.indexOf(".");let r,s;-1===o?(r=e,s=""):(r=e.substring(0,o),s=e.substring(o+1));let a=this._children.get(r);void 0===a&&(a=new ThemeTrieElement(this._mainRule.clone()),this._children.set(r,a)),a.insert(s,t,n,i)}}function generateTokensCSSForColorMap(e){const t=[];for(let n=1,i=e.length;n<i;n++){const i=e[n];t[n]=`.mtk${n} { color: ${i}; }`}return t.push(".mtki { font-style: italic; }"),t.push(".mtkb { font-weight: bold; }"),t.push(".mtku { text-decoration: underline; text-underline-position: under; }"),t.push(".mtks { text-decoration: line-through; }"),t.push(".mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }"),t.join("\n")}const vs={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[editorBackground]:"#FFFFFE",[editorForeground]:"#000000",[editorInactiveSelection]:"#E5EBF1",[editorIndentGuides]:"#D3D3D3",[editorActiveIndentGuides]:"#939393",[editorSelectionHighlight]:"#ADD6FF4D"}},vs_dark={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[editorBackground]:"#1E1E1E",[editorForeground]:"#D4D4D4",[editorInactiveSelection]:"#3A3D41",[editorIndentGuides]:"#404040",[editorActiveIndentGuides]:"#707070",[editorSelectionHighlight]:"#ADD6FF26"}},hc_black={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[editorBackground]:"#000000",[editorForeground]:"#FFFFFF",[editorIndentGuides]:"#FFFFFF",[editorActiveIndentGuides]:"#FFFFFF"}};function getIconsStyleSheet(e){const t=new Emitter$1,n=getIconRegistry();return n.onDidChange((()=>t.fire())),null==e||e.onDidProductIconThemeChange((()=>t.fire())),{onDidChange:t.event,getCSS(){const t=e?e.getProductIconTheme():new UnthemedProductIconTheme,i={},o=e=>{const n=t.getIcon(e);if(!n)return;const o=n.font;return o?(i[o.id]=o.definition,`.codicon-${e.id}:before { content: '${n.fontCharacter}'; font-family: ${asCSSPropertyValue(o.id)}; }`):`.codicon-${e.id}:before { content: '${n.fontCharacter}'; }`},r=[];for(let e of n.getIcons()){const t=o(e);t&&r.push(t)}for(let e in i){const t=i[e],n=t.weight?`font-weight: ${t.weight};`:"",o=t.style?`font-style: ${t.style};`:"",s=t.src.map((e=>`${asCSSUrl(e.location)} format('${e.format}')`)).join(", ");r.push(`@font-face { src: ${s}; font-family: ${asCSSPropertyValue(e)};${n}${o} font-display: block; }`)}return r.join("\n")}}}class UnthemedProductIconTheme{getIcon(e){const t=getIconRegistry();let n=e.defaults;for(;ThemeIcon.isThemeIcon(n);){const e=t.getIcon(n.id);if(!e)return;n=e.defaults}return n}}const VS_THEME_NAME="vs",VS_DARK_THEME_NAME="vs-dark",HC_BLACK_THEME_NAME="hc-black",colorRegistry=Registry.as(Extensions$4.ColorContribution),themingRegistry=Registry.as(Extensions$8.ThemingContribution);class StandaloneTheme{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const n=t.base;e.length>0?(isBuiltinTheme(e)?this.id=e:this.id=n+" "+e,this.themeName=e):(this.id=n,this.themeName=n),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(let t in this.themeData.colors)e.set(t,Color.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=getBuiltinRules(this.themeData.base);for(let n in t.colors)e.has(n)||e.set(n,Color.fromHex(t.colors[n]))}this.colors=e}return this.colors}getColor(e,t){const n=this.getColors().get(e);return n||(!1!==t?this.getDefault(e):void 0)}getDefault(e){let t=this.defaultColors[e];return t||(t=colorRegistry.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)}get type(){switch(this.base){case VS_THEME_NAME:return ColorScheme.LIGHT;case HC_BLACK_THEME_NAME:return ColorScheme.HIGH_CONTRAST;default:return ColorScheme.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const n=getBuiltinRules(this.themeData.base);e=n.rules,n.encodedTokensColors&&(t=n.encodedTokensColors)}const n=this.themeData.colors["editor.foreground"],i=this.themeData.colors["editor.background"];if(n||i){const t={token:""};n&&(t.foreground=n),i&&(t.background=i),e.push(t)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=TokenTheme.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,n){const i=this.tokenTheme._match([e].concat(t).join(".")).metadata,o=TokenMetadata.getForeground(i),r=TokenMetadata.getFontStyle(i);return{foreground:o,italic:Boolean(1&r),bold:Boolean(2&r),underline:Boolean(4&r),strikethrough:Boolean(8&r)}}}function isBuiltinTheme(e){return e===VS_THEME_NAME||e===VS_DARK_THEME_NAME||e===HC_BLACK_THEME_NAME}function getBuiltinRules(e){switch(e){case VS_THEME_NAME:return vs;case VS_DARK_THEME_NAME:return vs_dark;case HC_BLACK_THEME_NAME:return hc_black}}function newBuiltInTheme(e){const t=getBuiltinRules(e);return new StandaloneTheme(e,t)}class StandaloneThemeService extends Disposable{constructor(){super(),this._onColorThemeChange=this._register(new Emitter$1),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new Emitter$1),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new UnthemedProductIconTheme,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(VS_THEME_NAME,newBuiltInTheme(VS_THEME_NAME)),this._knownThemes.set(VS_DARK_THEME_NAME,newBuiltInTheme(VS_DARK_THEME_NAME)),this._knownThemes.set(HC_BLACK_THEME_NAME,newBuiltInTheme(HC_BLACK_THEME_NAME));const e=getIconsStyleSheet(this);this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(VS_THEME_NAME),e.onDidChange((()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),addMatchMediaChangeListener("(forced-colors: active)",(()=>{this._updateActualTheme()}))}registerEditorContainer(e){return isInShadowDOM(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=createStyleSheet(),this._globalStyleElement.className="monaco-colors",this._globalStyleElement.textContent=this._allCSS,this._styleElements.push(this._globalStyleElement)),Disposable.None}_registerShadowDomContainer(e){const t=createStyleSheet(e);return t.className="monaco-colors",t.textContent=this._allCSS,this._styleElements.push(t),{dispose:()=>{for(let e=0;e<this._styleElements.length;e++)if(this._styleElements[e]===t)return void this._styleElements.splice(e,1)}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!isBuiltinTheme(t.base)&&!isBuiltinTheme(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new StandaloneTheme(e,t)),isBuiltinTheme(e)&&this._knownThemes.forEach((t=>{t.base===e&&t.notifyBaseUpdated()})),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get(VS_THEME_NAME),this._desiredTheme=t,this._updateActualTheme()}_updateActualTheme(){const e=this._autoDetectHighContrast&&window.matchMedia("(forced-colors: active)").matches?this._knownThemes.get(HC_BLACK_THEME_NAME):this._desiredTheme;this._theme!==e&&(this._theme=e,this._updateThemeOrColorMap())}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._updateActualTheme()}_updateThemeOrColorMap(){const e=[],t={},n={addRule:n=>{t[n]||(e.push(n),t[n]=!0)}};themingRegistry.getThemingParticipants().forEach((e=>e(this._theme,n,this._environment)));const i=[];for(const r of colorRegistry.getColors()){const e=this._theme.getColor(r.id,!0);e&&i.push(`${asCssVariableName(r.id)}: ${e.toString()};`)}n.addRule(`.monaco-editor { ${i.join("\n")} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();n.addRule(generateTokensCSSForColorMap(o)),this._themeCSS=e.join("\n"),this._updateCSS(),TokenizationRegistry.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._styleElements.forEach((e=>e.textContent=this._allCSS))}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const IStandaloneThemeService=createDecorator("themeService");var __decorate$5=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$5=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let AccessibilityService=class extends Disposable{constructor(e,t){super(),this._contextKeyService=e,this._configurationService=t,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new Emitter$1,this._accessibilityModeEnabledContext=CONTEXT_ACCESSIBILITY_MODE_ENABLED.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire())}))),n(),this.onDidChangeScreenReaderOptimized((()=>n()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return"on"===e||"auto"===e&&2===this._accessibilitySupport}getAccessibilitySupport(){return this._accessibilitySupport}};AccessibilityService=__decorate$5([__param$5(0,IContextKeyService),__param$5(1,IConfigurationService)],AccessibilityService);var __decorate$4=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$4=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let MenuService=class{constructor(e){this._commandService=e}createMenu(e,t,n){return new Menu(e,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},n),this._commandService,t,this)}};MenuService=__decorate$4([__param$4(0,ICommandService)],MenuService);let Menu=class e{constructor(e,t,n,i,o){this._id=e,this._options=t,this._commandService=n,this._contextKeyService=i,this._menuService=o,this._disposables=new DisposableStore,this._menuGroups=[],this._contextKeys=new Set,this._build();const r=new RunOnceScheduler((()=>{this._build(),this._onDidChange.fire(this)}),t.eventDebounceDelay);this._disposables.add(r),this._disposables.add(MenuRegistry.onDidChangeMenu((t=>{t.has(e)&&r.schedule()})));const s=this._disposables.add(new DisposableStore);this._onDidChange=new Emitter$1({onFirstListenerAdd:()=>{const e=new RunOnceScheduler((()=>this._onDidChange.fire(this)),t.eventDebounceDelay);s.add(e),s.add(i.onDidChangeContext((t=>{t.affectsSome(this._contextKeys)&&e.schedule()})))},onLastListenerRemove:s.clear.bind(s)}),this.onDidChange=this._onDidChange.event}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}_build(){this._menuGroups.length=0,this._contextKeys.clear();const t=MenuRegistry.getMenuItems(this._id);let n;t.sort(e._compareMenuItems);for(const e of t){const t=e.group||"";n&&n[0]===t||(n=[t,[]],this._menuGroups.push(n)),n[1].push(e),this._collectContextKeys(e)}}_collectContextKeys(t){if(e._fillInKbExprKeys(t.when,this._contextKeys),isIMenuItem(t)){if(t.command.precondition&&e._fillInKbExprKeys(t.command.precondition,this._contextKeys),t.command.toggled){const n=t.command.toggled.condition||t.command.toggled;e._fillInKbExprKeys(n,this._contextKeys)}}else this._options.emitEventsForSubmenuChanges&&MenuRegistry.getMenuItems(t.submenu).forEach(this._collectContextKeys,this)}getActions(e){const t=[];for(let n of this._menuGroups){const[i,o]=n,r=[];for(const t of o)if(this._contextKeyService.contextMatchesRules(t.when)){const n=isIMenuItem(t)?new MenuItemAction(t.command,t.alt,e,this._contextKeyService,this._commandService):new SubmenuItemAction(t,this._menuService,this._contextKeyService,e);r.push(n)}r.length>0&&t.push([i,r])}return t}static _fillInKbExprKeys(e,t){if(e)for(let n of e.keys())t.add(n)}static _compareMenuItems(t,n){let i=t.group,o=n.group;if(i!==o){if(!i)return 1;if(!o)return-1;if("navigation"===i)return-1;if("navigation"===o)return 1;let e=i.localeCompare(o);if(0!==e)return e}let r=t.order||0,s=n.order||0;return r<s?-1:r>s?1:e._compareTitles(isIMenuItem(t)?t.command.title:t.title,isIMenuItem(n)?n.command.title:n.title)}static _compareTitles(e,t){const n="string"==typeof e?e:e.original,i="string"==typeof t?t:t.original;return n.localeCompare(i)}};Menu=__decorate$4([__param$4(2,ICommandService),__param$4(3,IContextKeyService),__param$4(4,IMenuService)],Menu);var __decorate$3=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$3=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$2=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};let BrowserClipboardService=class extends Disposable{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",(isSafari||isWebkitWebView)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const e=new DeferredPromise;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=e,navigator.clipboard.write([new ClipboardItem({"text/plain":e.p})]).catch((t=>__awaiter$2(this,void 0,void 0,(function*(){t instanceof Error&&"NotAllowedError"===t.name&&e.isRejected||this.logService.error(t)}))))};this.layoutService.hasContainer&&(this._register(addDisposableListener(this.layoutService.container,"click",e)),this._register(addDisposableListener(this.layoutService.container,"keydown",e)))}writeText(e,t){return __awaiter$2(this,void 0,void 0,(function*(){if(t)return void this.mapTextToType.set(t,e);if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return yield navigator.clipboard.writeText(e)}catch(o){}const n=document.activeElement,i=document.body.appendChild($$c("textarea",{"aria-hidden":!0}));i.style.height="1px",i.style.width="1px",i.style.position="absolute",i.value=e,i.focus(),i.select(),document.execCommand("copy"),n instanceof HTMLElement&&n.focus(),document.body.removeChild(i)}))}readText(e){return __awaiter$2(this,void 0,void 0,(function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return""}}))}readFindText(){return __awaiter$2(this,void 0,void 0,(function*(){return this.findText}))}writeFindText(e){return __awaiter$2(this,void 0,void 0,(function*(){this.findText=e}))}};BrowserClipboardService=__decorate$3([__param$3(0,ILayoutService),__param$3(1,ILogService)],BrowserClipboardService);var __decorate$2=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$2=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};const KEYBINDING_CONTEXT_ATTR="data-keybinding-context";class Context{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}setValue(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)}removeValue(e){return e in this._value&&(delete this._value[e],!0)}getValue(e){const t=this._value[e];return void 0===t&&this._parent?this._parent.getValue(e):t}}class NullContext extends Context{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}NullContext.INSTANCE=new NullContext;class ConfigAwareContextValuesContainer extends Context{constructor(e,t,n){super(e,null),this._configurationService=t,this._values=TernarySearchTree.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration((e=>{if(6===e.source){const e=Array.from(Iterable.map(this._values,(([e])=>e)));this._values.clear(),n.fire(new ArrayContextKeyChangeEvent(e))}else{const t=[];for(const n of e.affectedKeys){const e=`config.${n}`,i=this._values.findSuperstr(e);void 0!==i&&(t.push(...Iterable.map(i,(([e])=>e))),this._values.deleteSuperstr(e)),this._values.has(e)&&(t.push(e),this._values.delete(e))}n.fire(new ArrayContextKeyChangeEvent(t))}}))}dispose(){this._listener.dispose()}getValue(e){if(0!==e.indexOf(ConfigAwareContextValuesContainer._keyPrefix))return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(ConfigAwareContextValuesContainer._keyPrefix.length),n=this._configurationService.getValue(t);let i;switch(typeof n){case"number":case"boolean":case"string":i=n;break;default:i=Array.isArray(n)?JSON.stringify(n):n}return this._values.set(e,i),i}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}ConfigAwareContextValuesContainer._keyPrefix="config.";class ContextKey{constructor(e,t,n){this._service=e,this._key=t,this._defaultValue=n,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){void 0===this._defaultValue?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class SimpleContextKeyChangeEvent{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}}class ArrayContextKeyChangeEvent{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}}class CompositeContextKeyChangeEvent{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}}class AbstractContextKeyService{constructor(e){this._onDidChangeContext=new PauseableEmitter({merge:e=>new CompositeContextKeyChangeEvent(e)}),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new ContextKey(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new ScopedContextKeyService(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return!e||e.evaluate(t)}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const n=this.getContextValuesContainer(this._myContextId);n&&n.setValue(e,t)&&this._onDidChangeContext.fire(new SimpleContextKeyChangeEvent(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new SimpleContextKeyChangeEvent(e))}getContext(e){return this._isDisposed?NullContext.INSTANCE:this.getContextValuesContainer(findContextAttr(e))}}let ContextKeyService=class extends AbstractContextKeyService{constructor(e){super(0),this._contexts=new Map,this._toDispose=new DisposableStore,this._lastContextId=0;const t=new ConfigAwareContextValuesContainer(this._myContextId,e,this._onDidChangeContext);this._contexts.set(this._myContextId,t),this._toDispose.add(t)}dispose(){this._onDidChangeContext.dispose(),this._isDisposed=!0,this._toDispose.dispose()}getContextValuesContainer(e){return this._isDisposed?NullContext.INSTANCE:this._contexts.get(e)||NullContext.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");let t=++this._lastContextId;return this._contexts.set(t,new Context(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};ContextKeyService=__decorate$2([__param$2(0,IConfigurationService)],ContextKeyService);class ScopedContextKeyService extends AbstractContextKeyService{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=new MutableDisposable,this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(KEYBINDING_CONTEXT_ATTR)){let e="";this._domNode.classList&&(e=Array.from(this._domNode.classList.values()).join(", "))}this._domNode.setAttribute(KEYBINDING_CONTEXT_ATTR,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(this._onDidChangeContext.fire,this._onDidChangeContext)}dispose(){this._isDisposed||(this._onDidChangeContext.dispose(),this._parent.disposeContext(this._myContextId),this._parentChangeListener.dispose(),this._domNode.removeAttribute(KEYBINDING_CONTEXT_ATTR),this._isDisposed=!0)}getContextValuesContainer(e){return this._isDisposed?NullContext.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function findContextAttr(e){for(;e;){if(e.hasAttribute(KEYBINDING_CONTEXT_ATTR)){const t=e.getAttribute(KEYBINDING_CONTEXT_ATTR);return t?parseInt(t,10):NaN}e=e.parentElement}return 0}CommandsRegistry.registerCommand(SET_CONTEXT_COMMAND_ID,(function(e,t,n){e.get(IContextKeyService).createKey(String(t),n)})),CommandsRegistry.registerCommand({id:"getContextKeyInfo",handler:()=>[...RawContextKey.all()].sort(((e,t)=>e.key.localeCompare(t.key))),description:{description:localize("getContextKeyInfo","A command that returns information about context keys"),args:[]}}),CommandsRegistry.registerCommand("_generateContextKeyInfo",(function(){const e=[],t=new Set;for(let n of RawContextKey.all())t.has(n.key)||(t.add(n.key),e.push(n));e.sort(((e,t)=>e.key.localeCompare(t.key)))}));class Node$1{constructor(e){this.incoming=new Map,this.outgoing=new Map,this.data=e}}class Graph{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(let t of this._nodes.values())0===t.outgoing.size&&e.push(t);return e}insertEdge(e,t){const n=this.lookupOrInsertNode(e),i=this.lookupOrInsertNode(t);n.outgoing.set(this._hashFn(t),i),i.incoming.set(this._hashFn(e),n)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(let n of this._nodes.values())n.outgoing.delete(t),n.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let n=this._nodes.get(t);return n||(n=new Node$1(e),this._nodes.set(t,n)),n}isEmpty(){return 0===this._nodes.size}toString(){let e=[];for(let[t,n]of this._nodes)e.push(`${t}, (incoming)[${[...n.incoming.keys()].join(", ")}], (outgoing)[${[...n.outgoing.keys()].join(",")}]`);return e.join("\n")}findCycleSlow(){for(let[e,t]of this._nodes){const n=new Set([e]),i=this._findCycle(t,n);if(i)return i}}_findCycle(e,t){for(let[n,i]of e.outgoing){if(t.has(n))return[...t,n].join(" -> ");t.add(n);const e=this._findCycle(i,t);if(e)return e;t.delete(n)}}}class CyclicDependencyError extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=null!==(t=e.findCycleSlow())&&void 0!==t?t:`UNABLE to detect cycle, dumping graph: \n${e.toString()}`}}class InstantiationService{constructor(e=new ServiceCollection,t=!1,n){this._activeInstantiations=new Set,this._services=e,this._strict=t,this._parent=n,this._services.set(IInstantiationService,this)}createChild(e){return new InstantiationService(e,this._strict,this)}invokeFunction(e,...t){let n=Trace.traceInvocation(e),i=!1;try{return e({get:e=>{if(i)throw illegalState("service accessor is only valid during the invocation of its target method");const t=this._getOrCreateServiceInstance(e,n);if(!t)throw new Error(`[invokeFunction] unknown service '${e}'`);return t}},...t)}finally{i=!0,n.stop()}}createInstance(e,...t){let n,i;return e instanceof SyncDescriptor?(n=Trace.traceCreation(e.ctor),i=this._createInstance(e.ctor,e.staticArguments.concat(t),n)):(n=Trace.traceCreation(e),i=this._createInstance(e,t,n)),n.stop(),i}_createInstance(e,t=[],n){let i=_util.getServiceDependencies(e).sort(((e,t)=>e.index-t.index)),o=[];for(const s of i){let t=this._getOrCreateServiceInstance(s.id,n);t||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${s.id}.`,!1),o.push(t)}let r=i.length>0?i[0].index:t.length;if(t.length!==r){let e=r-t.length;t=e>0?t.concat(new Array(e)):t.slice(0,r)}return new e(...[...t,...o])}_setServiceInstance(e,t){if(this._services.get(e)instanceof SyncDescriptor)this._services.set(e,t);else{if(!this._parent)throw new Error("illegalState - setting UNKNOWN service instance");this._parent._setServiceInstance(e,t)}}_getServiceInstanceOrDescriptor(e){let t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){let n=this._getServiceInstanceOrDescriptor(e);return n instanceof SyncDescriptor?this._safeCreateAndCacheServiceInstance(e,n,t.branch(e,!0)):(t.branch(e,!1),n)}_safeCreateAndCacheServiceInstance(e,t,n){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,n)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,n){const i=new Graph((e=>e.id.toString()));let o=0;const r=[{id:e,desc:t,_trace:n}];for(;r.length;){const t=r.pop();if(i.lookupOrInsertNode(t),o++>1e3)throw new CyclicDependencyError(i);for(let n of _util.getServiceDependencies(t.desc.ctor)){let o=this._getServiceInstanceOrDescriptor(n.id);if(o||this._throwIfStrict(`[createInstance] ${e} depends on ${n.id} which is NOT registered.`,!0),o instanceof SyncDescriptor){const e={id:n.id,desc:o,_trace:t._trace.branch(n.id,!0)};i.insertEdge(t,e),r.push(e)}}}for(;;){const e=i.roots();if(0===e.length){if(!i.isEmpty())throw new CyclicDependencyError(i);break}for(const{data:t}of e){if(this._getServiceInstanceOrDescriptor(t.id)instanceof SyncDescriptor){const e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setServiceInstance(t.id,e)}i.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,n=[],i,o){if(this._services.get(e)instanceof SyncDescriptor)return this._createServiceInstance(t,n,i,o);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,n,i,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t=[],n,i){if(n){const n=new IdleValue((()=>this._createInstance(e,t,i)));return new Proxy(Object.create(null),{get(e,t){if(t in e)return e[t];let i=n.value,o=i[t];return"function"!=typeof o||(o=o.bind(i),e[t]=o),o},set:(e,t,i)=>(n.value[t]=i,!0)})}return this._createInstance(e,t,i)}_throwIfStrict(e,t){if(this._strict)throw new Error(e)}}class Trace{constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}static traceInvocation(e){return Trace._None}static traceCreation(e){return Trace._None}branch(e,t){let n=new Trace(2,e.toString());return this._dep.push([e,t,n]),n}stop(){let e=Date.now()-this._start;Trace._totals+=e;let t=!1;this.type,this.name,function e(n,i){let o=[],r=new Array(n+1).join("\t");for(const[s,a,l]of i._dep)if(a&&l){t=!0,o.push(`${r}CREATES -> ${s}`);let i=e(n+1,l);i&&o.push(i)}else o.push(`${r}uses -> ${s}`);return o.join("\n")}(1,this),e.toFixed(2),Trace._totals.toFixed(2)}}Trace._None=new class extends Trace{constructor(){super(-1,null)}stop(){}branch(){return this}},Trace._totals=0;class DoubleResourceMap{constructor(){this._byResource=new ResourceMap,this._byOwner=new Map}set(e,t,n){let i=this._byResource.get(e);i||(i=new Map,this._byResource.set(e,i)),i.set(t,n);let o=this._byOwner.get(t);o||(o=new ResourceMap,this._byOwner.set(t,o)),o.set(e,n)}get(e,t){let n=this._byResource.get(e);return null==n?void 0:n.get(t)}delete(e,t){let n=!1,i=!1,o=this._byResource.get(e);o&&(n=o.delete(t));let r=this._byOwner.get(t);if(r&&(i=r.delete(e)),n!==i)throw new Error("illegal state");return n&&i}values(e){var t,n,i,o;return"string"==typeof e?null!==(n=null===(t=this._byOwner.get(e))||void 0===t?void 0:t.values())&&void 0!==n?n:Iterable.empty():URI.isUri(e)?null!==(o=null===(i=this._byResource.get(e))||void 0===i?void 0:i.values())&&void 0!==o?o:Iterable.empty():Iterable.map(Iterable.concat(...this._byOwner.values()),(e=>e[1]))}}class MarkerStats{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new ResourceMap,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const e=this._data.get(t);e&&this._substract(e);const n=this._resourceStats(t);this._add(n),this._data.set(t,n)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(e.scheme===Schemas.inMemory||e.scheme===Schemas.walkThrough||e.scheme===Schemas.walkThroughSnippet)return t;for(const{severity:n}of this._service.read({resource:e}))n===MarkerSeverity$2.Error?t.errors+=1:n===MarkerSeverity$2.Warning?t.warnings+=1:n===MarkerSeverity$2.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class MarkerService{constructor(){this._onMarkerChanged=new DebounceEmitter({delay:0,merge:MarkerService._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new DoubleResourceMap,this._stats=new MarkerStats(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const n of t||[])this.changeOne(e,n,[])}changeOne(e,t,n){if(isFalsyOrEmpty(n)){this._data.delete(t,e)&&this._onMarkerChanged.fire([t])}else{const i=[];for(const o of n){const n=MarkerService._toMarker(e,t,o);n&&i.push(n)}this._data.set(t,e,i),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,n){let{code:i,severity:o,message:r,source:s,startLineNumber:a,startColumn:l,endLineNumber:c,endColumn:d,relatedInformation:u,tags:h}=n;if(r)return a=a>0?a:1,l=l>0?l:1,c=c>=a?c:a,d=d>0?d:l,{resource:t,owner:e,code:i,severity:o,message:r,source:s,startLineNumber:a,startColumn:l,endLineNumber:c,endColumn:d,relatedInformation:u,tags:h}}read(e=Object.create(null)){let{owner:t,resource:n,severities:i,take:o}=e;if((!o||o<0)&&(o=-1),t&&n){const e=this._data.get(n,t);if(e){const t=[];for(const n of e)if(MarkerService._accept(n,i)){const e=t.push(n);if(o>0&&e===o)break}return t}return[]}if(t||n){const e=this._data.values(null!=n?n:t),r=[];for(const t of e)for(const e of t)if(MarkerService._accept(e,i)){const t=r.push(e);if(o>0&&t===o)return r}return r}{const e=[];for(let t of this._data.values())for(let n of t)if(MarkerService._accept(n,i)){const t=e.push(n);if(o>0&&t===o)return e}return e}}static _accept(e,t){return void 0===t||(t&e.severity)===e.severity}static _merge(e){const t=new ResourceMap;for(let n of e)for(let e of n)t.set(e,!0);return Array.from(t.keys())}}function score(e,t,n,i,o){if(Array.isArray(e)){let r=0;for(const s of e){const e=score(s,t,n,i,o);if(10===e)return e;e>r&&(r=e)}return r}if("string"==typeof e)return i?"*"===e?5:e===n?10:0:0;if(e){const{language:r,pattern:s,scheme:a,hasAccessToAllModels:l,notebookType:c}=e;if(!i&&!l)return 0;let d=0;if(a)if(a===t.scheme)d=10;else{if("*"!==a)return 0;d=5}if(r)if(r===n)d=10;else{if("*"!==r)return 0;d=Math.max(d,5)}if(c)if(c===o)d=10;else{if("*"!==c)return 0;d=Math.max(d,5)}if(s){let e;if(e="string"==typeof s?s:Object.assign(Object.assign({},s),{base:normalize(s.base)}),e!==t.fsPath&&!match(e,t.fsPath))return 0;d=10}return d}return 0}function isExclusive(e){return"string"!=typeof e&&(Array.isArray(e)?e.every(isExclusive):!!e.exclusive)}class LanguageFeatureRegistry{constructor(e){this._notebookTypeResolver=e,this._clock=0,this._entries=[],this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event}register(e,t){let n={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(n),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),toDisposable((()=>{if(n){const e=this._entries.indexOf(n);e>=0&&(this._entries.splice(e,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),n=void 0)}}))}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(let n of this._entries)n._score>0&&t.push(n.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,(e=>t.push(e.provider))),t}orderedGroups(e){const t=[];let n,i;return this._orderedForEach(e,(e=>{n&&i===e._score?n.push(e.provider):(i=e._score,n=[e.provider],t.push(n))})),t}_orderedForEach(e,t){if(e){this._updateScores(e);for(const e of this._entries)e._score>0&&t(e)}}_updateScores(e){var t;const n=null===(t=this._notebookTypeResolver)||void 0===t?void 0:t.call(this,e.uri),i={uri:e.uri.toString(),language:e.getLanguageId(),notebookType:n};if(!this._lastCandidate||this._lastCandidate.language!==i.language||this._lastCandidate.uri!==i.uri||this._lastCandidate.notebookType!==i.notebookType){this._lastCandidate=i;for(let t of this._entries)if(t._score=score(t.selector,e.uri,e.getLanguageId(),shouldSynchronizeModel(e),n),isExclusive(t.selector)&&t._score>0){for(let e of this._entries)e._score=0;t._score=1e3;break}this._entries.sort(LanguageFeatureRegistry._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._score<t._score?1:e._score>t._score?-1:e._time<t._time?1:e._time>t._time?-1:0}}class LanguageFeaturesService{constructor(){this.referenceProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.renameProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.codeActionProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.definitionProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.typeDefinitionProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.declarationProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.implementationProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.documentSymbolProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.inlayHintsProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.colorProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.codeLensProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.documentFormattingEditProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.documentRangeFormattingEditProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.onTypeFormattingEditProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.signatureHelpProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.hoverProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.documentHighlightProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.selectionRangeProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.foldingRangeProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.linkProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.inlineCompletionsProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.completionProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.linkedEditingRangeProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.documentSemanticTokensProvider=new LanguageFeatureRegistry(this._score.bind(this))}_score(e){var t;return null===(t=this._notebookTypeResolver)||void 0===t?void 0:t.call(this,e)}}registerSingleton(ILanguageFeaturesService,LanguageFeaturesService,!0);var __decorate$1=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param$1=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}},__awaiter$1=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class SimpleModel{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new Emitter$1}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let StandaloneTextModelService=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new ImmortalReference(new SimpleModel(t))):Promise.reject(new Error("Model not found"))}};StandaloneTextModelService=__decorate$1([__param$1(0,IModelService)],StandaloneTextModelService);class StandaloneEditorProgressService{show(){return StandaloneEditorProgressService.NULL_PROGRESS_RUNNER}showWhile(e,t){return __awaiter$1(this,void 0,void 0,(function*(){yield e}))}}StandaloneEditorProgressService.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class StandaloneDialogService{confirm(e){return this.doConfirm(e).then((e=>({confirmed:e,checkboxChecked:!1})))}doConfirm(e){let t=e.message;return e.detail&&(t=t+"\n\n"+e.detail),Promise.resolve(window.confirm(t))}show(e,t,n,i){return Promise.resolve({choice:0})}}class StandaloneNotificationService{info(e){return this.notify({severity:Severity$2.Info,message:e})}warn(e){return this.notify({severity:Severity$2.Warning,message:e})}error(e){return this.notify({severity:Severity$2.Error,message:e})}notify(e){switch(e.severity){case Severity$2.Error:case Severity$2.Warning:}return StandaloneNotificationService.NO_OP}status(e,t){return Disposable.None}}StandaloneNotificationService.NO_OP=new NoOpNotification;let StandaloneCommandService=class{constructor(e){this._onWillExecuteCommand=new Emitter$1,this._onDidExecuteCommand=new Emitter$1,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const n=CommandsRegistry.getCommand(e);if(!n)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const i=this._instantiationService.invokeFunction.apply(this._instantiationService,[n.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(i)}catch(i){return Promise.reject(i)}}};StandaloneCommandService=__decorate$1([__param$1(0,IInstantiationService)],StandaloneCommandService);let StandaloneKeybindingService=class extends AbstractKeybindingService{constructor(e,t,n,i,o,r){super(e,t,n,i,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const s=e=>{const t=new DisposableStore;t.add(addDisposableListener(e,EventType$1.KEY_DOWN,(e=>{const t=new StandardKeyboardEvent(e);this._dispatch(t,t.target)&&(t.preventDefault(),t.stopPropagation())}))),t.add(addDisposableListener(e,EventType$1.KEY_UP,(e=>{const t=new StandardKeyboardEvent(e);this._singleModifierDispatch(t,t.target)&&t.preventDefault()}))),this._domNodeListeners.push(new DomNodeListeners(e,t))},a=e=>{for(let t=0;t<this._domNodeListeners.length;t++){const n=this._domNodeListeners[t];n.domNode===e&&(this._domNodeListeners.splice(t,1),n.dispose())}},l=e=>{e.getOption(54)||s(e.getContainerDomNode())};this._register(r.onCodeEditorAdd(l)),this._register(r.onCodeEditorRemove((e=>{e.getOption(54)||a(e.getContainerDomNode())}))),r.listCodeEditors().forEach(l);const c=e=>{s(e.getContainerDomNode())};this._register(r.onDiffEditorAdd(c)),this._register(r.onDiffEditorRemove((e=>{a(e.getContainerDomNode())}))),r.listDiffEditors().forEach(c)}addDynamicKeybinding(e,t,n,i){const o=createKeybinding(t,OS),r=new DisposableStore;return o&&(this._dynamicKeybindings.push({keybinding:o.parts,command:e,when:i,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}),r.add(toDisposable((()=>{for(let t=0;t<this._dynamicKeybindings.length;t++){if(this._dynamicKeybindings[t].command===e)return this._dynamicKeybindings.splice(t,1),void this.updateResolver({source:1})}})))),r.add(CommandsRegistry.registerCommand(e,n)),this.updateResolver({source:1}),r}updateResolver(e){this._cachedResolver=null,this._onDidUpdateKeybindings.fire(e)}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(KeybindingsRegistry.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new KeybindingResolver(e,t,(e=>this._log(e)))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const n=[];let i=0;for(const o of e){const e=o.when||void 0,r=o.keybinding;if(r){const s=USLayoutResolvedKeybinding.resolveUserBinding(r,OS);for(const r of s)n[i++]=new ResolvedKeybindingItem(r,o.command,o.commandArgs,e,t,null,!1)}else n[i++]=new ResolvedKeybindingItem(void 0,o.command,o.commandArgs,e,t,null,!1)}return n}resolveKeyboardEvent(e){const t=new SimpleKeybinding(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode).toChord();return new USLayoutResolvedKeybinding(t,OS)}};StandaloneKeybindingService=__decorate$1([__param$1(0,IContextKeyService),__param$1(1,ICommandService),__param$1(2,ITelemetryService),__param$1(3,INotificationService),__param$1(4,ILogService),__param$1(5,ICodeEditorService)],StandaloneKeybindingService);class DomNodeListeners extends Disposable{constructor(e,t){super(),this.domNode=e,this._register(t)}}function isConfigurationOverrides(e){return e&&"object"==typeof e&&(!e.overrideIdentifier||"string"==typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof URI)}class StandaloneConfigurationService{constructor(){this._onDidChangeConfiguration=new Emitter$1,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configuration=new Configuration(new DefaultConfigurationModel,new ConfigurationModel)}getValue(e,t){const n="string"==typeof e?e:void 0,i=isConfigurationOverrides(e)?e:isConfigurationOverrides(t)?t:{};return this._configuration.getValue(n,i,void 0)}updateValues(e){const t={data:this._configuration.toData()},n=[];for(const i of e){const[e,t]=i;this.getValue(e)!==t&&(this._configuration.updateValue(e,t),n.push(e))}if(n.length>0){const e=new ConfigurationChangeEvent({keys:n,overrides:[]},t,this._configuration);e.source=7,e.sourceConfig=null,this._onDidChangeConfiguration.fire(e)}return Promise.resolve()}updateValue(e,t,n,i){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let StandaloneResourceConfigurationService=class{constructor(e){this.configurationService=e,this._onDidChangeConfiguration=new Emitter$1,this.configurationService.onDidChangeConfiguration((e=>{this._onDidChangeConfiguration.fire({affectedKeys:e.affectedKeys,affectsConfiguration:(t,n)=>e.affectsConfiguration(n)})}))}getValue(e,t,n){const i=(Position$1.isIPosition(t)?t:null)?"string"==typeof n?n:void 0:"string"==typeof t?t:void 0;return void 0===i?this.configurationService.getValue():this.configurationService.getValue(i)}};StandaloneResourceConfigurationService=__decorate$1([__param$1(0,IConfigurationService)],StandaloneResourceConfigurationService);let StandaloneResourcePropertiesService=class{constructor(e){this.configurationService=e}getEOL(e,t){const n=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return n&&"string"==typeof n&&"auto"!==n?n:isLinux||isMacintosh?"\n":"\r\n"}};StandaloneResourcePropertiesService=__decorate$1([__param$1(0,IConfigurationService)],StandaloneResourcePropertiesService);class StandaloneTelemetryService{publicLog(e,t){return Promise.resolve(void 0)}publicLog2(e,t){return this.publicLog(e,t)}}class StandaloneWorkspaceContextService{constructor(){const e=URI.from({scheme:StandaloneWorkspaceContextService.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new WorkspaceFolder({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}}function updateConfigurationService(e,t,n){if(!t)return;if(!(e instanceof StandaloneConfigurationService))return;const i=[];Object.keys(t).forEach((e=>{isEditorConfigurationKey(e)&&i.push([`editor.${e}`,t[e]]),n&&isDiffEditorConfigurationKey(e)&&i.push([`diffEditor.${e}`,t[e]])})),i.length>0&&e.updateValues(i)}StandaloneWorkspaceContextService.SCHEME="inmemory";let StandaloneBulkEditService=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return __awaiter$1(this,void 0,void 0,(function*(){const t=new Map;for(let o of e){if(!(o instanceof ResourceTextEdit))throw new Error("bad edit - only text edits are supported");const e=this._modelService.getModel(o.resource);if(!e)throw new Error("bad edit - model not found");if("number"==typeof o.versionId&&e.getVersionId()!==o.versionId)throw new Error("bad state - model changed in the meantime");let n=t.get(e);n||(n=[],t.set(e,n)),n.push(EditOperation.replaceMove(Range$2.lift(o.textEdit.range),o.textEdit.text))}let n=0,i=0;for(const[e,o]of t)e.pushStackElement(),e.pushEditOperations([],o,(()=>[])),e.pushStackElement(),i+=1,n+=o.length;return{ariaSummary:format(StandaloneServicesNLS.bulkEditServiceSummary,n,i)}}))}};StandaloneBulkEditService=__decorate$1([__param$1(0,IModelService)],StandaloneBulkEditService);class StandaloneUriLabelService{getUriLabel(e,t){return"file"===e.scheme?e.fsPath:e.path}}let StandaloneContextViewService=class extends ContextViewService{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,n){if(!t){const e=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();e&&(t=e.getContainerDomNode())}return super.showContextView(e,t,n)}};StandaloneContextViewService=__decorate$1([__param$1(0,ILayoutService),__param$1(1,ICodeEditorService)],StandaloneContextViewService);class StandaloneWorkspaceTrustManagementService{constructor(){this._neverEmitter=new Emitter$1,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class StandaloneLanguageService extends LanguageService{constructor(){super()}}class StandaloneLogService extends LogService{constructor(){super(new ConsoleLogger)}}let StandaloneContextMenuService=class extends ContextMenuService{constructor(e,t,n,i,o){super(e,t,n,i,o),this.configure({blockMouse:!1})}};var StandaloneServices;StandaloneContextMenuService=__decorate$1([__param$1(0,ITelemetryService),__param$1(1,INotificationService),__param$1(2,IContextViewService),__param$1(3,IKeybindingService),__param$1(4,IThemeService)],StandaloneContextMenuService),registerSingleton(IConfigurationService,StandaloneConfigurationService),registerSingleton(ITextResourceConfigurationService,StandaloneResourceConfigurationService),registerSingleton(ITextResourcePropertiesService,StandaloneResourcePropertiesService),registerSingleton(IWorkspaceContextService,StandaloneWorkspaceContextService),registerSingleton(ILabelService,StandaloneUriLabelService),registerSingleton(ITelemetryService,StandaloneTelemetryService),registerSingleton(IDialogService,StandaloneDialogService),registerSingleton(INotificationService,StandaloneNotificationService),registerSingleton(IMarkerService,MarkerService),registerSingleton(ILanguageService,StandaloneLanguageService),registerSingleton(IStandaloneThemeService,StandaloneThemeService),registerSingleton(ILogService,StandaloneLogService),registerSingleton(IModelService,ModelService),registerSingleton(IMarkerDecorationsService,MarkerDecorationsService),registerSingleton(IContextKeyService,ContextKeyService),registerSingleton(IEditorProgressService,StandaloneEditorProgressService),registerSingleton(IStorageService,InMemoryStorageService),registerSingleton(IEditorWorkerService,EditorWorkerService),registerSingleton(IBulkEditService,StandaloneBulkEditService),registerSingleton(IWorkspaceTrustManagementService,StandaloneWorkspaceTrustManagementService),registerSingleton(ITextModelService,StandaloneTextModelService),registerSingleton(IAccessibilityService,AccessibilityService),registerSingleton(IListService,ListService),registerSingleton(ICommandService,StandaloneCommandService),registerSingleton(IKeybindingService,StandaloneKeybindingService),registerSingleton(IQuickInputService,StandaloneQuickInputService),registerSingleton(IContextViewService,StandaloneContextViewService),registerSingleton(IOpenerService,OpenerService),registerSingleton(IClipboardService,BrowserClipboardService),registerSingleton(IContextMenuService,StandaloneContextMenuService),registerSingleton(IMenuService,MenuService),function(e){const t=new ServiceCollection;for(const[o,r]of getSingletonServiceDescriptors())t.set(o,r);const n=new InstantiationService(t,!0);t.set(IInstantiationService,n),e.get=function(e){const i=t.get(e);if(!i)throw new Error("Missing service "+e);return i instanceof SyncDescriptor?n.invokeFunction((t=>t.get(e))):i};let i=!1;e.initialize=function(e){if(i)return n;i=!0;for(const[n,i]of getSingletonServiceDescriptors())t.get(n)||t.set(n,i);for(const n in e)if(e.hasOwnProperty(n)){const i=createDecorator(n);t.get(i)instanceof SyncDescriptor&&t.set(i,e[n])}return n}}(StandaloneServices||(StandaloneServices={}));var __decorate=globalThis&&globalThis.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__param=globalThis&&globalThis.__param||function(e,t){return function(n,i){t(n,i,e)}};let LAST_GENERATED_COMMAND_ID=0,ariaDomNodeCreated=!1;function createAriaDomNode(e){if(!e){if(ariaDomNodeCreated)return;ariaDomNodeCreated=!0}setARIAContainer(e||document.body)}let StandaloneCodeEditor=class extends CodeEditorWidget{constructor(e,t,n,i,o,r,s,a,l,c,d,u){const h=Object.assign({},t);h.ariaLabel=h.ariaLabel||StandaloneCodeEditorNLS.editorViewAccessibleLabel,h.ariaLabel=h.ariaLabel+";"+StandaloneCodeEditorNLS.accessibilityHelpMessage,super(e,h,{},n,i,o,r,a,l,c,d,u),this._standaloneKeybindingService=s instanceof StandaloneKeybindingService?s:null,createAriaDomNode(h.ariaContainerElement)}addCommand(e,t,n){if(!this._standaloneKeybindingService)return null;const i="DYNAMIC_"+ ++LAST_GENERATED_COMMAND_ID,o=ContextKeyExpr.deserialize(n);return this._standaloneKeybindingService.addDynamicKeybinding(i,e,t,o),i}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return Disposable.None;const t=e.id,n=e.label,i=ContextKeyExpr.and(ContextKeyExpr.equals("editorId",this.getId()),ContextKeyExpr.deserialize(e.precondition)),o=e.keybindings,r=ContextKeyExpr.and(i,ContextKeyExpr.deserialize(e.keybindingContext)),s=e.contextMenuGroupId||null,a=e.contextMenuOrder||0,l=(t,...n)=>Promise.resolve(e.run(this,...n)),c=new DisposableStore,d=this.getId()+":"+t;if(c.add(CommandsRegistry.registerCommand(d,l)),s){const e={command:{id:d,title:n},when:i,group:s,order:a};c.add(MenuRegistry.appendMenuItem(MenuId.EditorContext,e))}if(Array.isArray(o))for(const h of o)c.add(this._standaloneKeybindingService.addDynamicKeybinding(d,h,l,r));const u=new InternalEditorAction(d,n,n,i,l,this._contextKeyService);return this._actions[t]=u,c.add(toDisposable((()=>{delete this._actions[t]}))),c}_triggerCommand(e,t){if(this._codeEditorService instanceof StandaloneCodeEditorService)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};StandaloneCodeEditor=__decorate([__param(2,IInstantiationService),__param(3,ICodeEditorService),__param(4,ICommandService),__param(5,IContextKeyService),__param(6,IKeybindingService),__param(7,IThemeService),__param(8,INotificationService),__param(9,IAccessibilityService),__param(10,ILanguageConfigurationService),__param(11,ILanguageFeaturesService)],StandaloneCodeEditor);let StandaloneEditor=class extends StandaloneCodeEditor{constructor(e,t,n,i,o,r,s,a,l,c,d,u,h,g,p){const f=Object.assign({},t);updateConfigurationService(c,f,!1);const m=a.registerEditorContainer(e);"string"==typeof f.theme&&a.setTheme(f.theme),void 0!==f.autoDetectHighContrast&&a.setAutoDetectHighContrast(Boolean(f.autoDetectHighContrast));const v=f.model;let _;if(delete f.model,super(e,f,n,i,o,r,s,a,l,d,g,p),this._configurationService=c,this._standaloneThemeService=a,this._register(m),void 0===v){const e=h.getLanguageIdByMimeType(f.language)||f.language||PLAINTEXT_LANGUAGE_ID;_=createTextModel(u,h,f.value||"",e,void 0),this._ownsModel=!0}else _=v,this._ownsModel=!1;if(this._attachModel(_),_){const e={oldModelUrl:null,newModelUrl:_.uri};this._onDidChangeModel.fire(e)}}dispose(){super.dispose()}updateOptions(e){updateConfigurationService(this._configurationService,e,!1),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};StandaloneEditor=__decorate([__param(2,IInstantiationService),__param(3,ICodeEditorService),__param(4,ICommandService),__param(5,IContextKeyService),__param(6,IKeybindingService),__param(7,IStandaloneThemeService),__param(8,INotificationService),__param(9,IConfigurationService),__param(10,IAccessibilityService),__param(11,IModelService),__param(12,ILanguageService),__param(13,ILanguageConfigurationService),__param(14,ILanguageFeaturesService)],StandaloneEditor);let StandaloneDiffEditor=class extends DiffEditorWidget{constructor(e,t,n,i,o,r,s,a,l,c,d,u){const h=Object.assign({},t);updateConfigurationService(l,h,!0);const g=s.registerEditorContainer(e);"string"==typeof h.theme&&s.setTheme(h.theme),void 0!==h.autoDetectHighContrast&&s.setAutoDetectHighContrast(Boolean(h.autoDetectHighContrast)),super(e,h,{},u,o,i,n,r,s,a,c,d),this._configurationService=l,this._standaloneThemeService=s,this._register(g)}dispose(){super.dispose()}updateOptions(e){updateConfigurationService(this._configurationService,e,!0),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_createInnerEditor(e,t,n){return e.createInstance(StandaloneCodeEditor,t,n)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,n){return this.getModifiedEditor().addCommand(e,t,n)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};function createTextModel(e,t,n,i,o){if(n=n||"",!i){const i=n.indexOf("\n");let r=n;return-1!==i&&(r=n.substring(0,i)),doCreateModel(e,n,t.createByFilepathOrFirstLine(o||null,r),o)}return doCreateModel(e,n,t.createById(i),o)}function doCreateModel(e,t,n,i){return e.createModel(t,n,i)}function create(e,t,n){return StandaloneServices.initialize(n||{}).createInstance(StandaloneEditor,e,t)}function onDidCreateEditor(e){return StandaloneServices.get(ICodeEditorService).onCodeEditorAdd((t=>{e(t)}))}function createDiffEditor(e,t,n){return StandaloneServices.initialize(n||{}).createInstance(StandaloneDiffEditor,e,t)}function createDiffNavigator(e,t){return new DiffNavigator(e,t)}function createModel(e,t,n){const i=StandaloneServices.get(ILanguageService),o=i.getLanguageIdByMimeType(t)||t;return createTextModel(StandaloneServices.get(IModelService),i,e,o,n)}function setModelLanguage(e,t){const n=StandaloneServices.get(ILanguageService);StandaloneServices.get(IModelService).setMode(e,n.createById(t))}function setModelMarkers(e,t,n){if(e){StandaloneServices.get(IMarkerService).changeOne(t,e.uri,n)}}function getModelMarkers(e){return StandaloneServices.get(IMarkerService).read(e)}function onDidChangeMarkers(e){return StandaloneServices.get(IMarkerService).onMarkerChanged(e)}function getModel(e){return StandaloneServices.get(IModelService).getModel(e)}function getModels(){return StandaloneServices.get(IModelService).getModels()}function onDidCreateModel(e){return StandaloneServices.get(IModelService).onModelAdded(e)}function onWillDisposeModel(e){return StandaloneServices.get(IModelService).onModelRemoved(e)}function onDidChangeModelLanguage(e){return StandaloneServices.get(IModelService).onModelLanguageChanged((t=>{e({model:t.model,oldLanguage:t.oldLanguageId})}))}function createWebWorker(e){return createWebWorker$1(StandaloneServices.get(IModelService),StandaloneServices.get(ILanguageConfigurationService),e)}function colorizeElement(e,t){const n=StandaloneServices.get(ILanguageService),i=StandaloneServices.get(IStandaloneThemeService);return i.registerEditorContainer(e),Colorizer.colorizeElement(i,n,e,t)}function colorize(e,t,n){const i=StandaloneServices.get(ILanguageService);return StandaloneServices.get(IStandaloneThemeService).registerEditorContainer(document.body),Colorizer.colorize(i,e,t,n)}function colorizeModelLine(e,t,n=4){return StandaloneServices.get(IStandaloneThemeService).registerEditorContainer(document.body),Colorizer.colorizeModelLine(e,t,n)}function getSafeTokenizationSupport(e){const t=TokenizationRegistry.get(e);return t||{getInitialState:()=>NullState,tokenize:(t,n,i)=>nullTokenize(e,i)}}function tokenize(e,t){TokenizationRegistry.getOrCreate(t);const n=getSafeTokenizationSupport(t),i=splitLines(e),o=[];let r=n.getInitialState();for(let s=0,a=i.length;s<a;s++){const e=i[s],t=n.tokenize(e,!0,r);o[s]=t.tokens,r=t.endState}return o}function defineTheme(e,t){StandaloneServices.get(IStandaloneThemeService).defineTheme(e,t)}function setTheme(e){StandaloneServices.get(IStandaloneThemeService).setTheme(e)}function remeasureFonts(){FontMeasurements.clearAllFontInfos()}function registerCommand(e,t){return CommandsRegistry.registerCommand({id:e,handler:t})}function createMonacoEditorAPI(){return{create:create,onDidCreateEditor:onDidCreateEditor,createDiffEditor:createDiffEditor,createDiffNavigator:createDiffNavigator,createModel:createModel,setModelLanguage:setModelLanguage,setModelMarkers:setModelMarkers,getModelMarkers:getModelMarkers,onDidChangeMarkers:onDidChangeMarkers,getModels:getModels,getModel:getModel,onDidCreateModel:onDidCreateModel,onWillDisposeModel:onWillDisposeModel,onDidChangeModelLanguage:onDidChangeModelLanguage,createWebWorker:createWebWorker,colorizeElement:colorizeElement,colorize:colorize,colorizeModelLine:colorizeModelLine,tokenize:tokenize,defineTheme:defineTheme,setTheme:setTheme,remeasureFonts:remeasureFonts,registerCommand:registerCommand,AccessibilitySupport:AccessibilitySupport,ContentWidgetPositionPreference:ContentWidgetPositionPreference,CursorChangeReason:CursorChangeReason,DefaultEndOfLine:DefaultEndOfLine,EditorAutoIndentStrategy:EditorAutoIndentStrategy,EditorOption:EditorOption,EndOfLinePreference:EndOfLinePreference,EndOfLineSequence:EndOfLineSequence,MinimapPosition:MinimapPosition,MouseTargetType:MouseTargetType,OverlayWidgetPositionPreference:OverlayWidgetPositionPreference,OverviewRulerLane:OverviewRulerLane,RenderLineNumbersType:RenderLineNumbersType,RenderMinimap:RenderMinimap,ScrollbarVisibility:ScrollbarVisibility,ScrollType:ScrollType,TextEditorCursorBlinkingStyle:TextEditorCursorBlinkingStyle,TextEditorCursorStyle:TextEditorCursorStyle,TrackedRangeStickiness:TrackedRangeStickiness,WrappingIndent:WrappingIndent,InjectedTextCursorStops:InjectedTextCursorStops,PositionAffinity:PositionAffinity,ConfigurationChangedEvent:ConfigurationChangedEvent,BareFontInfo:BareFontInfo,FontInfo:FontInfo,TextModelResolvedOptions:TextModelResolvedOptions,FindMatch:FindMatch,ApplyUpdateResult:ApplyUpdateResult,EditorType:EditorType,EditorOptions:EditorOptions}}function isArrayOf(e,t){if(!t)return!1;if(!Array.isArray(t))return!1;for(const n of t)if(!e(n))return!1;return!0}function bool(e,t){return"boolean"==typeof e?e:t}function string(e,t){return"string"==typeof e?e:t}function arrayToHash(e){const t={};for(const n of e)t[n]=!0;return t}function createKeywordMatcher(e,t=!1){t&&(e=e.map((function(e){return e.toLowerCase()})));const n=arrayToHash(e);return t?function(e){return void 0!==n[e.toLowerCase()]&&n.hasOwnProperty(e.toLowerCase())}:function(e){return void 0!==n[e]&&n.hasOwnProperty(e)}}function compileRegExp(e,t){t=t.replace(/@@/g,"");let n,i=0;do{n=!1,t=t.replace(/@(\w+)/g,(function(i,o){n=!0;let r="";if("string"==typeof e[o])r=e[o];else{if(!(e[o]&&e[o]instanceof RegExp))throw void 0===e[o]?createError(e,"language definition does not contain attribute '"+o+"', used at: "+t):createError(e,"attribute reference '"+o+"' must be a string, used at: "+t);r=e[o].source}return empty(r)?"":"(?:"+r+")"})),i++}while(n&&i<5);t=t.replace(/\x01/g,"@");const o=(e.ignoreCase?"i":"")+(e.unicode?"u":"");return new RegExp(t,o)}function selectScrutinee(e,t,n,i){if(i<0)return e;if(i<t.length)return t[i];if(i>=100){i-=100;const e=n.split(".");if(e.unshift(n),i<e.length)return e[i]}return null}function createGuard(e,t,n,i){let o=-1,r=n,s=n.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);s&&(s[3]&&(o=parseInt(s[3]),s[2]&&(o+=100)),r=s[4]);let a,l="~",c=r;if(r&&0!==r.length?/^\w*$/.test(c)?l="==":(s=r.match(/^(@|!@|~|!~|==|!=)(.*)$/),s&&(l=s[1],c=s[2])):(l="!=",c=""),"~"!==l&&"!~"!==l||!/^(\w|\|)*$/.test(c))if("@"===l||"!@"===l){const n=e[c];if(!n)throw createError(e,"the @ match target '"+c+"' is not defined, in rule: "+t);if(!isArrayOf((function(e){return"string"==typeof e}),n))throw createError(e,"the @ match target '"+c+"' must be an array of strings, in rule: "+t);const i=createKeywordMatcher(n,e.ignoreCase);a=function(e){return"@"===l?i(e):!i(e)}}else if("~"===l||"!~"===l)if(c.indexOf("$")<0){const t=compileRegExp(e,"^"+c+"$");a=function(e){return"~"===l?t.test(e):!t.test(e)}}else a=function(t,n,i,o){return compileRegExp(e,"^"+substituteMatches(e,c,n,i,o)+"$").test(t)};else if(c.indexOf("$")<0){const t=fixCase(e,c);a=function(e){return"=="===l?e===t:e!==t}}else{const t=fixCase(e,c);a=function(n,i,o,r,s){const a=substituteMatches(e,t,i,o,r);return"=="===l?n===a:n!==a}}else{const t=createKeywordMatcher(c.split("|"),e.ignoreCase);a=function(e){return"~"===l?t(e):!t(e)}}return-1===o?{name:n,value:i,test:function(e,t,n,i){return a(e,e,t,n,i)}}:{name:n,value:i,test:function(e,t,n,i){const r=selectScrutinee(e,t,n,o);return a(r||"",e,t,n,i)}}}function compileAction(e,t,n){if(n){if("string"==typeof n)return n;if(n.token||""===n.token){if("string"!=typeof n.token)throw createError(e,"a 'token' attribute must be of type string, in rule: "+t);{const i={token:n.token};if(n.token.indexOf("$")>=0&&(i.tokenSubst=!0),"string"==typeof n.bracket)if("@open"===n.bracket)i.bracket=1;else{if("@close"!==n.bracket)throw createError(e,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+t);i.bracket=-1}if(n.next){if("string"!=typeof n.next)throw createError(e,"the next state must be a string value in rule: "+t);{let o=n.next;if(!/^(@pop|@push|@popall)$/.test(o)&&("@"===o[0]&&(o=o.substr(1)),o.indexOf("$")<0&&!stateExists(e,substituteMatches(e,o,"",[],""))))throw createError(e,"the next state '"+n.next+"' is not defined in rule: "+t);i.next=o}}return"number"==typeof n.goBack&&(i.goBack=n.goBack),"string"==typeof n.switchTo&&(i.switchTo=n.switchTo),"string"==typeof n.log&&(i.log=n.log),"string"==typeof n.nextEmbedded&&(i.nextEmbedded=n.nextEmbedded,e.usesEmbedded=!0),i}}if(Array.isArray(n)){const i=[];for(let o=0,r=n.length;o<r;o++)i[o]=compileAction(e,t,n[o]);return{group:i}}if(n.cases){const i=[];for(let r in n.cases)if(n.cases.hasOwnProperty(r)){const o=compileAction(e,t,n.cases[r]);"@default"===r||"@"===r||""===r?i.push({test:void 0,value:o,name:r}):"@eos"===r?i.push({test:function(e,t,n,i){return i},value:o,name:r}):i.push(createGuard(e,t,r,o))}const o=e.defaultToken;return{test:function(e,t,n,r){for(const o of i){if(!o.test||o.test(e,t,n,r))return o.value}return o}}}throw createError(e,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+t)}return{token:""}}StandaloneDiffEditor=__decorate([__param(2,IInstantiationService),__param(3,IContextKeyService),__param(4,IEditorWorkerService),__param(5,ICodeEditorService),__param(6,IStandaloneThemeService),__param(7,INotificationService),__param(8,IConfigurationService),__param(9,IContextMenuService),__param(10,IEditorProgressService),__param(11,IClipboardService)],StandaloneDiffEditor);class Rule{constructor(e){this.regex=new RegExp(""),this.action={token:""},this.matchOnlyAtLineStart=!1,this.name="",this.name=e}setRegex(e,t){let n;if("string"==typeof t)n=t;else{if(!(t instanceof RegExp))throw createError(e,"rules must start with a match string or regular expression: "+this.name);n=t.source}this.matchOnlyAtLineStart=n.length>0&&"^"===n[0],this.name=this.name+": "+n,this.regex=compileRegExp(e,"^(?:"+(this.matchOnlyAtLineStart?n.substr(1):n)+")")}setAction(e,t){this.action=compileAction(e,this.name,t)}}function compile(e,t){if(!t||"object"!=typeof t)throw new Error("Monarch: expecting a language definition object");const n={};n.languageId=e,n.includeLF=bool(t.includeLF,!1),n.noThrow=!1,n.maxStack=100,n.start="string"==typeof t.start?t.start:null,n.ignoreCase=bool(t.ignoreCase,!1),n.unicode=bool(t.unicode,!1),n.tokenPostfix=string(t.tokenPostfix,"."+n.languageId),n.defaultToken=string(t.defaultToken,"source"),n.usesEmbedded=!1;const i=t;function o(e,r,s){for(const a of s){let s=a.include;if(s){if("string"!=typeof s)throw createError(n,"an 'include' attribute must be a string at: "+e);if("@"===s[0]&&(s=s.substr(1)),!t.tokenizer[s])throw createError(n,"include target '"+s+"' is not defined at: "+e);o(e+"."+s,r,t.tokenizer[s])}else{const t=new Rule(e);if(Array.isArray(a)&&a.length>=1&&a.length<=3)if(t.setRegex(i,a[0]),a.length>=3)if("string"==typeof a[1])t.setAction(i,{token:a[1],next:a[2]});else{if("object"!=typeof a[1])throw createError(n,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+e);{const e=a[1];e.next=a[2],t.setAction(i,e)}}else t.setAction(i,a[1]);else{if(!a.regex)throw createError(n,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+e);a.name&&"string"==typeof a.name&&(t.name=a.name),a.matchOnlyAtStart&&(t.matchOnlyAtLineStart=bool(a.matchOnlyAtLineStart,!1)),t.setRegex(i,a.regex),t.setAction(i,a.action)}r.push(t)}}}if(i.languageId=e,i.includeLF=n.includeLF,i.ignoreCase=n.ignoreCase,i.unicode=n.unicode,i.noThrow=n.noThrow,i.usesEmbedded=n.usesEmbedded,i.stateNames=t.tokenizer,i.defaultToken=n.defaultToken,!t.tokenizer||"object"!=typeof t.tokenizer)throw createError(n,"a language definition must define the 'tokenizer' attribute as an object");n.tokenizer=[];for(let s in t.tokenizer)if(t.tokenizer.hasOwnProperty(s)){n.start||(n.start=s);const e=t.tokenizer[s];n.tokenizer[s]=new Array,o("tokenizer."+s,n.tokenizer[s],e)}if(n.usesEmbedded=i.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw createError(n,"the 'brackets' attribute must be defined as an array")}else t.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const r=[];for(let s of t.brackets){let e=s;if(e&&Array.isArray(e)&&3===e.length&&(e={token:e[2],open:e[0],close:e[1]}),e.open===e.close)throw createError(n,"open and close brackets in a 'brackets' attribute must be different: "+e.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!=typeof e.open||"string"!=typeof e.token||"string"!=typeof e.close)throw createError(n,"every element in the 'brackets' array must be a '{open,close,token}' object or array");r.push({token:e.token+n.tokenPostfix,open:fixCase(n,e.open),close:fixCase(n,e.close)})}return n.brackets=r,n.noThrow=!0,n}var __awaiter=globalThis&&globalThis.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e2){r(e2)}}function a(e){try{l(i.throw(e))}catch(e2){r(e2)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))},_a$1;function register(e){ModesRegistry.registerLanguage(e)}function getLanguages(){let e=[];return e=e.concat(ModesRegistry.getLanguages()),e}function getEncodedLanguageId(e){return StandaloneServices.get(ILanguageService).languageIdCodec.encodeLanguageId(e)}function onLanguage(e,t){const n=StandaloneServices.get(ILanguageService).onDidEncounterLanguage((i=>{i===e&&(n.dispose(),t())}));return n}function setLanguageConfiguration(e,t){if(!StandaloneServices.get(ILanguageService).isRegisteredLanguageId(e))throw new Error(`Cannot set configuration for unknown language ${e}`);return LanguageConfigurationRegistry.register(e,t,100)}class EncodedTokenizationSupportAdapter{constructor(e,t){this._languageId=e,this._actual=t}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,n){if("function"==typeof this._actual.tokenize)return TokenizationSupportAdapter.adaptTokenize(this._languageId,this._actual,e,n);throw new Error("Not supported!")}tokenizeEncoded(e,t,n){const i=this._actual.tokenizeEncoded(e,n);return new EncodedTokenizationResult(i.tokens,i.endState)}}class TokenizationSupportAdapter{constructor(e,t,n,i){this._languageId=e,this._actual=t,this._languageService=n,this._standaloneThemeService=i}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const n=[];let i=0;for(let o=0,r=e.length;o<r;o++){const r=e[o];let s=r.startIndex;0===o?s=0:s<i&&(s=i),n[o]=new Token$2(s,r.scopes,t),i=s}return n}static adaptTokenize(e,t,n,i){const o=t.tokenize(n,i),r=TokenizationSupportAdapter._toClassicTokens(o.tokens,e);let s;return s=o.endState.equals(i)?i:o.endState,new TokenizationResult(r,s)}tokenize(e,t,n){return TokenizationSupportAdapter.adaptTokenize(this._languageId,this._actual,e,n)}_toBinaryTokens(e,t){const n=e.encodeLanguageId(this._languageId),i=this._standaloneThemeService.getColorTheme().tokenTheme,o=[];let r=0,s=0;for(let l=0,c=t.length;l<c;l++){const e=t[l],a=i.match(n,e.scopes);if(r>0&&o[r-1]===a)continue;let c=e.startIndex;0===l?c=0:c<s&&(c=s),o[r++]=c,o[r++]=a,s=c}const a=new Uint32Array(r);for(let l=0;l<r;l++)a[l]=o[l];return a}tokenizeEncoded(e,t,n){const i=this._actual.tokenize(e,n),o=this._toBinaryTokens(this._languageService.languageIdCodec,i.tokens);let r;return r=i.endState.equals(n)?n:i.endState,new EncodedTokenizationResult(o,r)}}function isATokensProvider(e){return"function"==typeof e.getInitialState}function isEncodedTokensProvider(e){return"tokenizeEncoded"in e}function isThenable(e){return e&&"function"==typeof e.then}function setColorMap(e){const t=StandaloneServices.get(IStandaloneThemeService);if(e){const n=[null];for(let t=1,i=e.length;t<i;t++)n[t]=Color.fromHex(e[t]);t.setColorMapOverride(n)}else t.setColorMapOverride(null)}function createTokenizationSupportAdapter(e,t){return isEncodedTokensProvider(t)?new EncodedTokenizationSupportAdapter(e,t):new TokenizationSupportAdapter(e,t,StandaloneServices.get(ILanguageService),StandaloneServices.get(IStandaloneThemeService))}function registerTokensProviderFactory(e,t){const n={createTokenizationSupport:()=>__awaiter(this,void 0,void 0,(function*(){const n=yield Promise.resolve(t.create());return n?isATokensProvider(n)?createTokenizationSupportAdapter(e,n):new MonarchTokenizer(StandaloneServices.get(ILanguageService),StandaloneServices.get(IStandaloneThemeService),e,compile(e,n)):null}))};return TokenizationRegistry.registerFactory(e,n)}function setTokensProvider(e,t){if(!StandaloneServices.get(ILanguageService).isRegisteredLanguageId(e))throw new Error(`Cannot set tokens provider for unknown language ${e}`);return isThenable(t)?registerTokensProviderFactory(e,{create:()=>t}):TokenizationRegistry.register(e,createTokenizationSupportAdapter(e,t))}function setMonarchTokensProvider(e,t){return isThenable(t)?registerTokensProviderFactory(e,{create:()=>t}):TokenizationRegistry.register(e,(n=t,new MonarchTokenizer(StandaloneServices.get(ILanguageService),StandaloneServices.get(IStandaloneThemeService),e,compile(e,n))));var n}function registerReferenceProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).referenceProvider.register(e,t)}function registerRenameProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).renameProvider.register(e,t)}function registerSignatureHelpProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).signatureHelpProvider.register(e,t)}function registerHoverProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).hoverProvider.register(e,{provideHover:(e,n,i)=>{const o=e.getWordAtPosition(n);return Promise.resolve(t.provideHover(e,n,i)).then((e=>{if(e)return!e.range&&o&&(e.range=new Range$2(n.lineNumber,o.startColumn,n.lineNumber,o.endColumn)),e.range||(e.range=new Range$2(n.lineNumber,n.column,n.lineNumber,n.column)),e}))}})}function registerDocumentSymbolProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).documentSymbolProvider.register(e,t)}function registerDocumentHighlightProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).documentHighlightProvider.register(e,t)}function registerLinkedEditingRangeProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).linkedEditingRangeProvider.register(e,t)}function registerDefinitionProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).definitionProvider.register(e,t)}function registerImplementationProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).implementationProvider.register(e,t)}function registerTypeDefinitionProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).typeDefinitionProvider.register(e,t)}function registerCodeLensProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).codeLensProvider.register(e,t)}function registerCodeActionProvider(e,t,n){return StandaloneServices.get(ILanguageFeaturesService).codeActionProvider.register(e,{providedCodeActionKinds:null==n?void 0:n.providedCodeActionKinds,provideCodeActions:(e,n,i,o)=>{const r=StandaloneServices.get(IMarkerService).read({resource:e.uri}).filter((e=>Range$2.areIntersectingOrTouching(e,n)));return t.provideCodeActions(e,n,{markers:r,only:i.only},o)},resolveCodeAction:t.resolveCodeAction})}function registerDocumentFormattingEditProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).documentFormattingEditProvider.register(e,t)}function registerDocumentRangeFormattingEditProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).documentRangeFormattingEditProvider.register(e,t)}function registerOnTypeFormattingEditProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).onTypeFormattingEditProvider.register(e,t)}function registerLinkProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).linkProvider.register(e,t)}function registerCompletionItemProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).completionProvider.register(e,t)}function registerColorProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).colorProvider.register(e,t)}function registerFoldingRangeProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).foldingRangeProvider.register(e,t)}function registerDeclarationProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).declarationProvider.register(e,t)}function registerSelectionRangeProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).selectionRangeProvider.register(e,t)}function registerDocumentSemanticTokensProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).documentSemanticTokensProvider.register(e,t)}function registerDocumentRangeSemanticTokensProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).documentRangeSemanticTokensProvider.register(e,t)}function registerInlineCompletionsProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).inlineCompletionsProvider.register(e,t)}function registerInlayHintsProvider(e,t){return StandaloneServices.get(ILanguageFeaturesService).inlayHintsProvider.register(e,t)}function createMonacoLanguagesAPI(){return{register:register,getLanguages:getLanguages,onLanguage:onLanguage,getEncodedLanguageId:getEncodedLanguageId,setLanguageConfiguration:setLanguageConfiguration,setColorMap:setColorMap,registerTokensProviderFactory:registerTokensProviderFactory,setTokensProvider:setTokensProvider,setMonarchTokensProvider:setMonarchTokensProvider,registerReferenceProvider:registerReferenceProvider,registerRenameProvider:registerRenameProvider,registerCompletionItemProvider:registerCompletionItemProvider,registerSignatureHelpProvider:registerSignatureHelpProvider,registerHoverProvider:registerHoverProvider,registerDocumentSymbolProvider:registerDocumentSymbolProvider,registerDocumentHighlightProvider:registerDocumentHighlightProvider,registerLinkedEditingRangeProvider:registerLinkedEditingRangeProvider,registerDefinitionProvider:registerDefinitionProvider,registerImplementationProvider:registerImplementationProvider,registerTypeDefinitionProvider:registerTypeDefinitionProvider,registerCodeLensProvider:registerCodeLensProvider,registerCodeActionProvider:registerCodeActionProvider,registerDocumentFormattingEditProvider:registerDocumentFormattingEditProvider,registerDocumentRangeFormattingEditProvider:registerDocumentRangeFormattingEditProvider,registerOnTypeFormattingEditProvider:registerOnTypeFormattingEditProvider,registerLinkProvider:registerLinkProvider,registerColorProvider:registerColorProvider,registerFoldingRangeProvider:registerFoldingRangeProvider,registerDeclarationProvider:registerDeclarationProvider,registerSelectionRangeProvider:registerSelectionRangeProvider,registerDocumentSemanticTokensProvider:registerDocumentSemanticTokensProvider,registerDocumentRangeSemanticTokensProvider:registerDocumentRangeSemanticTokensProvider,registerInlineCompletionsProvider:registerInlineCompletionsProvider,registerInlayHintsProvider:registerInlayHintsProvider,DocumentHighlightKind:DocumentHighlightKind,CompletionItemKind:CompletionItemKind,CompletionItemTag:CompletionItemTag,CompletionItemInsertTextRule:CompletionItemInsertTextRule,SymbolKind:SymbolKind,SymbolTag:SymbolTag,IndentAction:IndentAction,CompletionTriggerKind:CompletionTriggerKind,SignatureHelpTriggerKind:SignatureHelpTriggerKind,InlayHintKind:InlayHintKind,InlineCompletionTriggerKind:InlineCompletionTriggerKind,FoldingRangeKind:FoldingRangeKind}}EditorOptions.wrappingIndent.defaultValue=0,EditorOptions.glyphMargin.defaultValue=!1,EditorOptions.autoIndent.defaultValue=3,EditorOptions.overviewRulerLanes.defaultValue=2,FormattingConflicts.setFormatterSelector(((e,t,n)=>Promise.resolve(e[0])));const api=createMonacoBaseAPI();api.editor=createMonacoEditorAPI(),api.languages=createMonacoLanguagesAPI();const CancellationTokenSource=api.CancellationTokenSource,Emitter=api.Emitter,KeyCode=api.KeyCode,KeyMod=api.KeyMod,Position=api.Position,Range=api.Range,Selection=api.Selection,SelectionDirection=api.SelectionDirection,MarkerSeverity=api.MarkerSeverity,MarkerTag=api.MarkerTag,Uri=api.Uri,Token=api.Token,editor=api.editor,languages=api.languages;((null===(_a$1=globals.MonacoEnvironment)||void 0===_a$1?void 0:_a$1.globalAPI)||"function"==typeof define&&define.amd)&&(self.monaco=api),void 0!==self.require&&"function"==typeof self.require.config&&self.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});var monaco_editor_core_star=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:CancellationTokenSource,Emitter:Emitter,KeyCode:KeyCode,KeyMod:KeyMod,Position:Position,Range:Range,Selection:Selection,SelectionDirection:SelectionDirection,MarkerSeverity:MarkerSeverity,MarkerTag:MarkerTag,Uri:Uri,Token:Token,editor:editor,languages:languages},Symbol.toStringTag,{value:"Module"})),__defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__getOwnPropNames$2=Object.getOwnPropertyNames,__hasOwnProp$2=Object.prototype.hasOwnProperty,__reExport$2=(e,t,n,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of __getOwnPropNames$2(t))__hasOwnProp$2.call(e,o)||!n&&"default"===o||__defProp$2(e,o,{get:()=>t[o],enumerable:!(i=__getOwnPropDesc$2(t,o))||i.enumerable});return e},typescriptVersion="4.5.5",monaco_editor_core_exports$2={};
- /*!-----------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4)
- * Released under the MIT license
- * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
- *-----------------------------------------------------------------------------*/__reExport$2(monaco_editor_core_exports$2,monaco_editor_core_star);var ModuleKind=(e=>(e[e.None=0]="None",e[e.CommonJS=1]="CommonJS",e[e.AMD=2]="AMD",e[e.UMD=3]="UMD",e[e.System=4]="System",e[e.ES2015=5]="ES2015",e[e.ESNext=99]="ESNext",e))(ModuleKind||{}),JsxEmit=(e=>(e[e.None=0]="None",e[e.Preserve=1]="Preserve",e[e.React=2]="React",e[e.ReactNative=3]="ReactNative",e[e.ReactJSX=4]="ReactJSX",e[e.ReactJSXDev=5]="ReactJSXDev",e))(JsxEmit||{}),NewLineKind=(e=>(e[e.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",e[e.LineFeed=1]="LineFeed",e))(NewLineKind||{}),ScriptTarget=(e=>(e[e.ES3=0]="ES3",e[e.ES5=1]="ES5",e[e.ES2015=2]="ES2015",e[e.ES2016=3]="ES2016",e[e.ES2017=4]="ES2017",e[e.ES2018=5]="ES2018",e[e.ES2019=6]="ES2019",e[e.ES2020=7]="ES2020",e[e.ESNext=99]="ESNext",e[e.JSON=100]="JSON",e[e.Latest=99]="Latest",e))(ScriptTarget||{}),ModuleResolutionKind=(e=>(e[e.Classic=1]="Classic",e[e.NodeJs=2]="NodeJs",e))(ModuleResolutionKind||{}),LanguageServiceDefaultsImpl$1=class{constructor(e,t,n,i){__publicField(this,"_onDidChange",new monaco_editor_core_exports$2.Emitter),__publicField(this,"_onDidExtraLibsChange",new monaco_editor_core_exports$2.Emitter),__publicField(this,"_extraLibs"),__publicField(this,"_removedExtraLibs"),__publicField(this,"_eagerModelSync"),__publicField(this,"_compilerOptions"),__publicField(this,"_diagnosticsOptions"),__publicField(this,"_workerOptions"),__publicField(this,"_onDidExtraLibsChangeTimeout"),__publicField(this,"_inlayHintsOptions"),this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(e),this.setDiagnosticsOptions(t),this.setWorkerOptions(n),this.setInlayHintsOptions(i),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(e,t){let n;if(n=void 0===t?`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t,this._extraLibs[n]&&this._extraLibs[n].content===e)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[n]&&(i=this._removedExtraLibs[n]+1),this._extraLibs[n]&&(i=this._extraLibs[n].version+1),this._extraLibs[n]={content:e,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let e=this._extraLibs[n];e&&e.version===i&&(delete this._extraLibs[n],this._removedExtraLibs[n]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(e){for(const t in this._extraLibs)this._removedExtraLibs[t]=this._extraLibs[t].version;if(this._extraLibs=Object.create(null),e&&e.length>0)for(const t of e){const e=t.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=t.content;let i=1;this._removedExtraLibs[e]&&(i=this._removedExtraLibs[e]+1),this._extraLibs[e]={content:n,version:i}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){-1===this._onDidExtraLibsChangeTimeout&&(this._onDidExtraLibsChangeTimeout=window.setTimeout((()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)}),0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(e){this._compilerOptions=e||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(e){this._workerOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(e){this._inlayHintsOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(e){}setEagerModelSync(e){this._eagerModelSync=e}getEagerModelSync(){return this._eagerModelSync}},typescriptVersion2=typescriptVersion,typescriptDefaults=new LanguageServiceDefaultsImpl$1({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{}),javascriptDefaults=new LanguageServiceDefaultsImpl$1({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{}),getTypeScriptWorker=()=>getMode$1().then((e=>e.getTypeScriptWorker())),getJavaScriptWorker=()=>getMode$1().then((e=>e.getJavaScriptWorker()));function getMode$1(){return __vitePreload((()=>import("./tsMode.5dfe43d8.js")),[])}monaco_editor_core_exports$2.languages.typescript={ModuleKind:ModuleKind,JsxEmit:JsxEmit,NewLineKind:NewLineKind,ScriptTarget:ScriptTarget,ModuleResolutionKind:ModuleResolutionKind,typescriptVersion:typescriptVersion2,typescriptDefaults:typescriptDefaults,javascriptDefaults:javascriptDefaults,getTypeScriptWorker:getTypeScriptWorker,getJavaScriptWorker:getJavaScriptWorker},monaco_editor_core_exports$2.languages.onLanguage("typescript",(()=>getMode$1().then((e=>e.setupTypeScript(typescriptDefaults))))),monaco_editor_core_exports$2.languages.onLanguage("javascript",(()=>getMode$1().then((e=>e.setupJavaScript(javascriptDefaults)))));
- /*!-----------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4)
- * Released under the MIT license
- * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
- *-----------------------------------------------------------------------------*/
- var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__getOwnPropNames$1=Object.getOwnPropertyNames,__hasOwnProp$1=Object.prototype.hasOwnProperty,__reExport$1=(e,t,n,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of __getOwnPropNames$1(t))__hasOwnProp$1.call(e,o)||!n&&"default"===o||__defProp$1(e,o,{get:()=>t[o],enumerable:!(i=__getOwnPropDesc$1(t,o))||i.enumerable});return e},monaco_editor_core_exports$1={};__reExport$1(monaco_editor_core_exports$1,monaco_editor_core_star);var LanguageServiceDefaultsImpl=class{constructor(e,t,n){__publicField(this,"_onDidChange",new monaco_editor_core_exports$1.Emitter),__publicField(this,"_diagnosticsOptions"),__publicField(this,"_modeConfiguration"),__publicField(this,"_languageId"),this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(n)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},diagnosticDefault={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},modeConfigurationDefault={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},jsonDefaults=new LanguageServiceDefaultsImpl("json",diagnosticDefault,modeConfigurationDefault);function getMode(){return __vitePreload((()=>import("./jsonMode.e516ca73.js")),[])}monaco_editor_core_exports$1.languages.json={jsonDefaults:jsonDefaults},monaco_editor_core_exports$1.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]}),monaco_editor_core_exports$1.languages.onLanguage("json",(()=>{getMode().then((e=>e.setupMode(jsonDefaults)))}));
- /*!-----------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4)
- * Released under the MIT license
- * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
- *-----------------------------------------------------------------------------*/
- var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__reExport=(e,t,n,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of __getOwnPropNames(t))__hasOwnProp.call(e,o)||!n&&"default"===o||__defProp(e,o,{get:()=>t[o],enumerable:!(i=__getOwnPropDesc(t,o))||i.enumerable});return e},monaco_editor_core_exports={};__reExport(monaco_editor_core_exports,monaco_editor_core_star);var languageDefinitions={},lazyLanguageLoaders={},LazyLanguageLoader=class{constructor(e){__publicField(this,"_languageId"),__publicField(this,"_loadingTriggered"),__publicField(this,"_lazyLoadPromise"),__publicField(this,"_lazyLoadPromiseResolve"),__publicField(this,"_lazyLoadPromiseReject"),this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise(((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t}))}static getOrCreate(e){return lazyLanguageLoaders[e]||(lazyLanguageLoaders[e]=new LazyLanguageLoader(e)),lazyLanguageLoaders[e]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,languageDefinitions[this._languageId].loader().then((e=>this._lazyLoadPromiseResolve(e)),(e=>this._lazyLoadPromiseReject(e)))),this._lazyLoadPromise}};function registerLanguage(e){const t=e.id;languageDefinitions[t]=e,monaco_editor_core_exports.languages.register(e);const n=LazyLanguageLoader.getOrCreate(t);monaco_editor_core_exports.languages.registerTokensProviderFactory(t,{create:()=>__async(this,null,(function*(){return(yield n.load()).language}))}),monaco_editor_core_exports.languages.onLanguage(t,(()=>__async(this,null,(function*(){const e=yield n.load();monaco_editor_core_exports.languages.setLanguageConfiguration(t,e.conf)}))))}registerLanguage({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>__vitePreload((()=>import("./abap.bfbdc491.js")),[])}),registerLanguage({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>__vitePreload((()=>import("./apex.3a0bbd36.js")),[])}),registerLanguage({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>__vitePreload((()=>import("./azcli.2a21dcc8.js")),[])}),registerLanguage({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>__vitePreload((()=>import("./bat.cfc9382a.js")),[])}),registerLanguage({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>__vitePreload((()=>import("./bicep.1efc561e.js")),[])}),registerLanguage({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>__vitePreload((()=>import("./cameligo.94bd5dcf.js")),[])}),registerLanguage({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>__vitePreload((()=>import("./clojure.8543305e.js")),[])}),registerLanguage({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>__vitePreload((()=>import("./coffee.de0bee73.js")),[])}),registerLanguage({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>__vitePreload((()=>import("./cpp.2c1314ec.js")),[])}),registerLanguage({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>__vitePreload((()=>import("./cpp.2c1314ec.js")),[])}),registerLanguage({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>__vitePreload((()=>import("./csharp.3ef4312c.js")),[])}),registerLanguage({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>__vitePreload((()=>import("./csp.078b1205.js")),[])}),registerLanguage({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>__vitePreload((()=>import("./css.28b1e2dc.js")),[])}),registerLanguage({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>__vitePreload((()=>import("./dart.72c9207c.js")),[])}),registerLanguage({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>__vitePreload((()=>import("./dockerfile.eea0f5a9.js")),[])}),registerLanguage({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>__vitePreload((()=>import("./ecl.5e0f116e.js")),[])}),registerLanguage({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>__vitePreload((()=>import("./elixir.0c870cc0.js")),[])}),registerLanguage({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>__vitePreload((()=>import("./flow9.ddcaa44f.js")),[])}),registerLanguage({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>__vitePreload((()=>import("./fsharp.637308b5.js")),[])}),registerLanguage({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>__vitePreload((()=>import("./freemarker2.1665b27c.js")),[]).then((e=>e.TagAutoInterpolationDollar))}),registerLanguage({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>__vitePreload((()=>import("./freemarker2.1665b27c.js")),[]).then((e=>e.TagAngleInterpolationDollar))}),registerLanguage({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>__vitePreload((()=>import("./freemarker2.1665b27c.js")),[]).then((e=>e.TagBracketInterpolationDollar))}),registerLanguage({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>__vitePreload((()=>import("./freemarker2.1665b27c.js")),[]).then((e=>e.TagAngleInterpolationBracket))}),registerLanguage({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>__vitePreload((()=>import("./freemarker2.1665b27c.js")),[]).then((e=>e.TagBracketInterpolationBracket))}),registerLanguage({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>__vitePreload((()=>import("./freemarker2.1665b27c.js")),[]).then((e=>e.TagAutoInterpolationDollar))}),registerLanguage({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>__vitePreload((()=>import("./freemarker2.1665b27c.js")),[]).then((e=>e.TagAutoInterpolationBracket))}),registerLanguage({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>__vitePreload((()=>import("./go.a5321182.js")),[])}),registerLanguage({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>__vitePreload((()=>import("./graphql.e74c3061.js")),[])}),registerLanguage({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>__vitePreload((()=>import("./handlebars.ece64ec4.js")),[])}),registerLanguage({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>__vitePreload((()=>import("./hcl.980f5800.js")),[])}),registerLanguage({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>__vitePreload((()=>import("./html.863c643a.js")),[])}),registerLanguage({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>__vitePreload((()=>import("./ini.a565700d.js")),[])}),registerLanguage({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>__vitePreload((()=>import("./java.b5b4e25c.js")),[])}),registerLanguage({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>__vitePreload((()=>import("./javascript.6e871a34.js")),["assets/javascript.6e871a34.js","assets/typescript.81719fcd.js"])}),registerLanguage({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>__vitePreload((()=>import("./julia.4b9526f0.js")),[])}),registerLanguage({id:"kotlin",extensions:[".kt"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>__vitePreload((()=>import("./kotlin.16b1631b.js")),[])}),registerLanguage({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>__vitePreload((()=>import("./less.dfb20244.js")),[])}),registerLanguage({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>__vitePreload((()=>import("./lexon.2174f6b1.js")),[])}),registerLanguage({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>__vitePreload((()=>import("./lua.1b53f8d4.js")),[])}),registerLanguage({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>__vitePreload((()=>import("./liquid.7935f519.js")),[])}),registerLanguage({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>__vitePreload((()=>import("./m3.467f962e.js")),[])}),registerLanguage({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>__vitePreload((()=>import("./markdown.559a7ab3.js")),[])}),registerLanguage({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>__vitePreload((()=>import("./mips.d8754138.js")),[])}),registerLanguage({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>__vitePreload((()=>import("./msdax.6f267d6f.js")),[])}),registerLanguage({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>__vitePreload((()=>import("./mysql.af01dff1.js")),[])}),registerLanguage({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>__vitePreload((()=>import("./objective-c.b75ffb36.js")),[])}),registerLanguage({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>__vitePreload((()=>import("./pascal.44875784.js")),[])}),registerLanguage({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>__vitePreload((()=>import("./pascaligo.0522f100.js")),[])}),registerLanguage({id:"perl",extensions:[".pl"],aliases:["Perl","pl"],loader:()=>__vitePreload((()=>import("./perl.a7f16129.js")),[])}),registerLanguage({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>__vitePreload((()=>import("./pgsql.e49c480b.js")),[])}),registerLanguage({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>__vitePreload((()=>import("./php.9456e17c.js")),[])}),registerLanguage({id:"pla",extensions:[".pla"],loader:()=>__vitePreload((()=>import("./pla.e446910d.js")),[])}),registerLanguage({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>__vitePreload((()=>import("./postiats.51572fcb.js")),[])}),registerLanguage({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>__vitePreload((()=>import("./powerquery.c06fb3d4.js")),[])}),registerLanguage({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>__vitePreload((()=>import("./powershell.edac1ff2.js")),[])}),registerLanguage({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>__vitePreload((()=>import("./protobuf.9ea19330.js")),[])}),registerLanguage({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>__vitePreload((()=>import("./pug.9be1efca.js")),[])}),registerLanguage({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>__vitePreload((()=>import("./python.37a64f92.js")),[])}),registerLanguage({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>__vitePreload((()=>import("./qsharp.e9c3e37c.js")),[])}),registerLanguage({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>__vitePreload((()=>import("./r.000b11e3.js")),[])}),registerLanguage({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>__vitePreload((()=>import("./razor.b5824946.js")),[])}),registerLanguage({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>__vitePreload((()=>import("./redis.fb351a5f.js")),[])}),registerLanguage({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>__vitePreload((()=>import("./redshift.facc4811.js")),[])}),registerLanguage({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>__vitePreload((()=>import("./restructuredtext.03b9c8d7.js")),[])}),registerLanguage({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>__vitePreload((()=>import("./ruby.ac07c398.js")),[])}),registerLanguage({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>__vitePreload((()=>import("./rust.7956447c.js")),[])}),registerLanguage({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>__vitePreload((()=>import("./sb.64f7ffe9.js")),[])}),registerLanguage({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>__vitePreload((()=>import("./scala.ab6b2e4b.js")),[])}),registerLanguage({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>__vitePreload((()=>import("./scheme.0a9f32af.js")),[])}),registerLanguage({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>__vitePreload((()=>import("./scss.bb5a3a95.js")),[])}),registerLanguage({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>__vitePreload((()=>import("./shell.11589447.js")),[])}),registerLanguage({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>__vitePreload((()=>import("./solidity.731be3c2.js")),[])}),registerLanguage({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>__vitePreload((()=>import("./sophia.96bd523a.js")),[])}),registerLanguage({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>__vitePreload((()=>import("./sparql.f4d727b3.js")),[])}),registerLanguage({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>__vitePreload((()=>import("./sql.ae52386d.js")),[])}),registerLanguage({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib"],aliases:["StructuredText","scl","stl"],loader:()=>__vitePreload((()=>import("./st.b8efae94.js")),[])}),registerLanguage({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>__vitePreload((()=>import("./swift.90f88698.js")),[])}),registerLanguage({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>__vitePreload((()=>import("./systemverilog.95aaa20b.js")),[])}),registerLanguage({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>__vitePreload((()=>import("./systemverilog.95aaa20b.js")),[])}),registerLanguage({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>__vitePreload((()=>import("./tcl.66c7f2d0.js")),[])}),registerLanguage({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>__vitePreload((()=>import("./twig.dc81619a.js")),[])}),registerLanguage({id:"typescript",extensions:[".ts",".tsx"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>__vitePreload((()=>import("./typescript.81719fcd.js")),[])}),registerLanguage({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>__vitePreload((()=>import("./vb.e859ab61.js")),[])}),registerLanguage({id:"xml",extensions:[".xml",".dtd",".ascx",".csproj",".config",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>__vitePreload((()=>import("./xml.815ff5af.js")),[])}),registerLanguage({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>__vitePreload((()=>import("./yaml.3fb67a35.js")),[])});var MonacoEditor=defineComponent({props:{code:{type:String,required:!0},onChange:{type:Function},height:{type:String,default:"260px"},readOnly:{type:Boolean,default:!1},language:{type:String,default:"json"}},setup(e){const t=useAppStore(),n=shallowRef(),i=ref();let o,r=!1;function s(e){const t=e.toUpperCase();return MonacoEditorThemeEnum[t]}return onMounted((()=>{const a=n.value=editor.create(i.value,{value:e.code,language:e.language,formatOnPaste:!0,tabSize:2,automaticLayout:!1,readOnly:e.readOnly,foldingStrategy:"indentation",contextmenu:!1,minimap:{enabled:!1},theme:s(t.theme),scrollBeyondLastLine:!1});o=a.onDidChangeModelContent((t=>{!r&&e.onChange&&e.onChange(a.getValue(),t)}))})),onBeforeUnmount((()=>{o&&o.dispose()})),watch((()=>t.theme),(e=>{const t=s(e);editor.setTheme(t)})),watch((()=>e.code),(e=>{const t=n.value,i=t.getModel();e!==i.getValue()&&(t.pushUndoStop(),r=!0,i.pushEditOperations([],[{range:i.getFullModelRange(),text:e}]),t.pushUndoStop(),r=!1)})),()=>createVNode("div",{class:"code-editor-wraper",style:{height:e.height},ref:i},null)}}),CodeEditor_vue_vue_type_style_index_0_scoped_true_lang="";const _hoisted_1$a={class:"code-edit-actins"},_hoisted_2$7={key:0},_hoisted_3$5={key:1},_hoisted_4$3={class:"code-edit-box"},_sfc_main$h=defineComponent({__name:"CodeEditor",props:{language:{default:"json"},code:null,title:null,onChange:null,readOnly:{type:Boolean},height:null,hoverTipsParams:null},setup(e){const t=e,n=useAppStore(),i=useApidocStore(),o=reactive({visible:!1,isCopySuccess:!1}),r=e=>{t.onChange&&t.onChange(e)},s=()=>{o.visible=!0};function a(){t.code&©TextToClipboard(t.code),o.isCopySuccess=!0,setTimeout((()=>{o.isCopySuccess=!1}),1e3)}const l=debounce((()=>{i.setCurrentEditorHoverTipsParams(t.hoverTipsParams)}),300),c=()=>{i.setCurrentEditorHoverTipsParams(void 0)};return(i,d)=>{const u=Button$2,h=Modal$2;return openBlock(),createElementBlock(Fragment,null,[createBaseVNode("div",{class:normalizeClass(["code-edit-wraper",unref(n).device])},[createBaseVNode("div",{class:"code-edit-box",onMouseover:d[0]||(d[0]=(...e)=>unref(l)&&unref(l)(...e)),onMouseleave:c},[createVNode(unref(MonacoEditor),{code:t.code,readOnly:t.readOnly,onChange:r,height:e.height,language:e.language},null,8,["code","readOnly","height","language"])],32),createBaseVNode("div",_hoisted_1$a,[createVNode(u,{class:"full-button",size:"small",onClick:s},{default:withCtx((()=>[createBaseVNode("span",null,[createVNode(unref(FullscreenOutlined$1))])])),_:1}),createVNode(u,{class:"copy-button",size:"small",onClick:a},{default:withCtx((()=>[o.isCopySuccess?(openBlock(),createElementBlock("span",_hoisted_2$7,[createVNode(unref(CheckOutlined$1))])):(openBlock(),createElementBlock("span",_hoisted_3$5,[createVNode(unref(CopyOutlined$1))]))])),_:1})])],2),createVNode(h,{visible:o.visible,"onUpdate:visible":d[1]||(d[1]=e=>o.visible=e),centered:"",title:t.title,width:"90%",footer:!1,bodyStyle:{padding:"10px"}},{default:withCtx((()=>[createBaseVNode("div",_hoisted_4$3,[createVNode(unref(MonacoEditor),{code:e.code,onChange:r,readOnly:e.readOnly,height:"calc(100vh - 150px)",language:e.language},null,8,["code","readOnly","language"])])])),_:1},8,["visible","title"])],64)}}});var CodeEditor=_export_sfc(_sfc_main$h,[["__scopeId","data-v-65603bf5"]]),CodeTemplateModal_vue_vue_type_style_index_0_scoped_true_lang="";const _hoisted_1$9={class:"code-template-wraper"},_hoisted_2$6={class:"template-menu"},_hoisted_3$4={class:"api-tree-select-wraper"},_hoisted_4$2={class:"content-wraper"},_hoisted_5$1={class:"api-selected-wraper"},_hoisted_6={class:"flex"},_hoisted_7={style:{"padding-left":"5px"}},_hoisted_8={key:0},_hoisted_9={key:1},_hoisted_10=createTextVNode(" : "),_hoisted_11={key:0,class:"flex-item"},_hoisted_12={key:1,class:"flex-item text-placeholder"},_hoisted_13={key:0,class:"error-text"},_hoisted_14={key:0,class:"form-wraper"},_hoisted_15={class:"code-wraper"},_sfc_main$g=defineComponent({__name:"CodeTemplateModal",props:{onSuccess:{type:Function,default:()=>{}},onCancel:{type:Function,default:()=>{}}},setup(e){var t,n;const i=e,{t:o}=useI18n(),r=useAppStore(),s=ref(),a=reactive({visible:!1,modalTitle:o("codeTemplate.title"),loading:!1,menuSelectedKeys:[0],currentTemplate:{title:"",template:""},currentApiTreeSelectedKeys:[],formData:{},code:" ",currentParams:{appKey:"",selected:[],template:{title:"",template:""}},selectedData:[]});r.serverConfig.code_template&&r.serverConfig.code_template.length&&(a.currentTemplate=r.serverConfig.code_template[0],(null==(t=a.currentTemplate.form)?void 0:t.data)&&(a.formData=null==(n=a.currentTemplate.form)?void 0:n.data));const l=({key:e})=>{a.menuSelectedKeys=[e],r.serverConfig.code_template&&r.serverConfig.code_template[e]&&(a.currentTemplate=r.serverConfig.code_template[e]),a.code=" ",a.currentApiTreeSelectedKeys=[],a.selectedData=[]};onMounted((()=>{a.visible=!0}));const c=()=>{a.visible=!1,i.onCancel&&i.onCancel()},d=(e,t,n)=>{("controller"==a.currentTemplate.select_mode&&t.node.controller||"api"==a.currentTemplate.select_mode&&t.node.url)&&(a.currentTemplate.multiple?a.currentTemplate.limit?(a.selectedData.length<a.currentTemplate.limit&&a.selectedData.push(t.node),a.currentTemplate.limit===a.selectedData.length&&u(n,a.selectedData)):(a.selectedData.push(t.node),u(n,a.selectedData)):(a.selectedData=[t.node],u(n,a.selectedData)))};function u(e,t){return __async(this,null,(function*(){let n={};s.value&&s.value.onSubmit&&(n=yield s.value.onSubmit());let i=[];i="controller"==a.currentTemplate.select_mode?t.map((e=>e.path)):t.map((e=>e.menuKey));const o={appKey:e,template:a.currentTemplate,selected:i,form:n};a.currentParams=o,h(o)}))}function h(e){globalApi.renderCodeTemplate(e).then((e=>{a.code=e.data.code})).catch((e=>{if(a.loading=!1,e.response){const t=e.response&&e.response.data&&e.response.data.message?e.response.data.message:e.message;notification.error({message:e.response.status,description:t})}else notification.error({message:e.response.status,description:e.message})}))}function g(){return __async(this,null,(function*(){let e={};s.value&&s.value.onSubmit&&(e=yield s.value.onSubmit()),a.currentParams=__spreadProps(__spreadValues({},a.currentParams),{form:e}),h(a.currentParams)}))}const p=(e,t)=>{};return(e,t)=>{const n=__unplugin_components_0$5,i=Menu$2,u=__unplugin_components_1$2,h=Button$2,f=Modal$2;return openBlock(),createBlock(f,{visible:a.visible,width:"90%",bodyStyle:{padding:"0 10px 10px"},maskClosable:!1,title:a.modalTitle,centered:"",destroyOnClose:"",class:"code-template-modal",onCancel:c},{footer:withCtx((()=>[createVNode(h,{loading:a.loading,onClick:g},{default:withCtx((()=>[createTextVNode(toDisplayString$1(unref(o)("codeTemplate.reload")),1)])),_:1},8,["loading"]),createVNode(h,{onClick:c},{default:withCtx((()=>[createTextVNode(toDisplayString$1(unref(o)("common.close")),1)])),_:1})])),default:withCtx((()=>{var e;return[createBaseVNode("div",_hoisted_1$9,[createBaseVNode("div",_hoisted_2$6,[createVNode(i,{mode:"inline",selectedKeys:a.menuSelectedKeys,theme:unref(r).theme,forceSubMenuRender:!1,onSelect:l},{default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(r).serverConfig.code_template,((e,t)=>(openBlock(),createBlock(n,{key:t,title:e.title},{default:withCtx((()=>[createTextVNode(toDisplayString$1(e.title),1)])),_:2},1032,["title"])))),128))])),_:1},8,["selectedKeys","theme"])]),createBaseVNode("div",_hoisted_3$4,[createVNode(unref(ApiTreeSelect),{selectMode:a.currentTemplate.select_mode,treeHeight:548,selectedKeys:a.currentApiTreeSelectedKeys,onSelect:d,onCheck:p},null,8,["selectMode","selectedKeys"])]),createBaseVNode("div",_hoisted_4$2,[createBaseVNode("div",_hoisted_5$1,[createBaseVNode("div",_hoisted_6,[createBaseVNode("div",_hoisted_7,["controller"==a.currentTemplate.select_mode?(openBlock(),createElementBlock("span",_hoisted_8,toDisplayString$1(unref(o)("common.controller")),1)):(openBlock(),createElementBlock("span",_hoisted_9,toDisplayString$1(unref(o)("common.api")),1)),_hoisted_10]),a.selectedData&&a.selectedData.length?(openBlock(),createElementBlock("div",_hoisted_11,[(openBlock(!0),createElementBlock(Fragment,null,renderList(a.selectedData,(e=>(openBlock(),createBlock(u,{class:"tag-item",closable:a.currentTemplate.multiple,key:e.menuKey,onClose:t=>function(e){a.selectedData=a.selectedData.filter((t=>t.menuKey!=e.menuKey))}(e)},{default:withCtx((()=>[createTextVNode(toDisplayString$1(e.title),1)])),_:2},1032,["closable","onClose"])))),128))])):(openBlock(),createElementBlock("div",_hoisted_12,toDisplayString$1(unref(o)("common.please.select")),1))]),a.currentTemplate.tips?(openBlock(),createElementBlock("div",_hoisted_13,toDisplayString$1(a.currentTemplate.tips),1)):createCommentVNode("",!0)]),a.currentTemplate&&a.currentTemplate.form?(openBlock(),createElementBlock("div",_hoisted_14,[createVNode(unref(DataForm),{ref_key:"formRef",ref:s,layout:a.currentTemplate.form.layout?a.currentTemplate.form.layout:"grid",colspan:a.currentTemplate.form.colspan?a.currentTemplate.form.colspan:3,items:a.currentTemplate.form.items,data:a.formData},null,8,["layout","colspan","items","data"])])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_15,[createVNode(unref(CodeEditor),{title:unref(o)("apiPage.routeParam.title"),code:a.code,readOnly:!0,language:null==(e=a.currentTemplate)?void 0:e.language,height:"525px"},null,8,["title","code","language"])])])])]})),_:1},8,["visible","title"])}}});var Modal=_export_sfc(_sfc_main$g,[["__scopeId","data-v-dc0792fc"]]);function modal(e){const t=createApp(Modal,__spreadProps(__spreadValues({},e),{onSuccess:t=>{e.onSuccess&&e.onSuccess(t),n()},onCancel:()=>{e.onCancel&&e.onCancel(),n()}})).use(pinia),n=()=>{t.unmount(),document.body.removeChild(i)},i=document.createElement("div");return document.body.appendChild(i),t.mount(i),t}const _hoisted_1$8={key:0},_sfc_main$f=defineComponent({__name:"ToolsMenu",emits:["reloadMenu"],setup(e,{emit:t}){const n=useAppStore(),{t:i}=useI18n(),o=e=>{const{keyPath:n,key:o}=e;if(n&&n.length)if("generator"==n[0]){modal$2({generatorIndex:Number(n[1]),onSuccess:()=>{t("reloadMenu")}})}else if("cancelAllCache"==o)Modal$2.confirm({title:i("cache.cancelAllConfirm"),okText:i("common.ok"),cancelText:i("common.cancel"),onOk(){globalApi.cancelAllCache().then((()=>{message.success(i("cache.cancelSuccess"))}))}});else if("createAllApi"==o){modal$1({title:i("cache.createAllConfirm"),onOk(){return __async(this,null,(function*(){try{const e=yield globalApi.createAllCache();return message.success(i("cache.createSuccess")),e}catch(e){return Promise.reject(e)}}))}})}else"codeTemplate"==o&&modal({})};return(e,t)=>{const r=__unplugin_components_0$5,s=__unplugin_components_0$4,a=Menu$2,l=Button$2,c=Dropdown$1;return unref(n).serverConfig.generator&&unref(n).serverConfig.generator.length||unref(n).serverConfig.cache&&unref(n).serverConfig.cache.enable?(openBlock(),createBlock(c,{key:0},{overlay:withCtx((()=>[createVNode(a,{onClick:o},{default:withCtx((()=>[unref(n).serverConfig.generator&&unref(n).serverConfig.generator.length?(openBlock(),createBlock(s,{key:"generator",title:unref(i)("generator.title")},{default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(n).serverConfig.generator,((e,t)=>(openBlock(),createBlock(r,{key:t},{default:withCtx((()=>[createTextVNode(toDisplayString$1(e.title),1)])),_:2},1024)))),128))])),_:1},8,["title"])):createCommentVNode("",!0),unref(n).serverConfig.cache&&unref(n).serverConfig.cache.enable?(openBlock(),createBlock(s,{key:"cacheManage",title:unref(i)("cache.manage")},{default:withCtx((()=>[createVNode(r,{key:"cancelAllCache"},{default:withCtx((()=>[createTextVNode(toDisplayString$1(unref(i)("cache.cancelAll")),1)])),_:1}),createVNode(r,{key:"createAllApi"},{default:withCtx((()=>[createTextVNode(toDisplayString$1(unref(i)("cache.createAllApi")),1)])),_:1})])),_:1},8,["title"])):createCommentVNode("",!0),unref(n).serverConfig.code_template&&unref(n).serverConfig.code_template.length?(openBlock(),createBlock(r,{key:"codeTemplate"},{default:withCtx((()=>[createTextVNode(toDisplayString$1(unref(i)("codeTemplate.title")),1)])),_:1})):createCommentVNode("",!0)])),_:1})])),default:withCtx((()=>[createVNode(l,null,{default:withCtx((()=>[createVNode(unref(AppstoreOutlined$1)),unref(n).device!=unref(DeviceEnum).MOBILE?(openBlock(),createElementBlock("span",_hoisted_1$8,toDisplayString$1(unref(i)("tools.title")),1)):createCommentVNode("",!0),createVNode(unref(DownOutlined$1))])),_:1})])),_:1})):createCommentVNode("",!0)}}});var HostSelect_vue_vue_type_style_index_0_scoped_true_lang="";const _hoisted_1$7={key:0,class:"host-select"},_sfc_main$e=defineComponent({__name:"HostSelect",setup(e){const{t:t}=useI18n(),n=useAppStore(),i=reactive({currentHost:"",hostOptions:[]});if(n.feConfig.HTTP.HOSTS&&n.feConfig.HTTP.HOSTS.length){i.hostOptions=n.feConfig.HTTP.HOSTS;const e=WebStorage.get("HOST");if(e){const t=i.hostOptions.find((t=>t.host==e));t&&t.host?i.currentHost=t.host:i.currentHost=i.hostOptions[0].host}else i.currentHost=i.hostOptions[0].host}const o=e=>{const n=i.currentHost,o=i.hostOptions.find((t=>t.host===e)),r=o&&o.title?o.title:"";Modal$2.confirm({title:t("host.change.confirm.title",{hostTitle:r}),content:t("lang.change.confirm.content"),okText:t("common.ok"),cancelText:t("common.cancel"),onOk(){WebStorage.set("HOST",e),reloadHomePage()},onCancel(){i.currentHost=n}})};return(e,t)=>{const r=SelectOption,s=__unplugin_components_3;return i.hostOptions&&i.hostOptions.length>1?(openBlock(),createElementBlock("div",_hoisted_1$7,[createVNode(s,{value:i.currentHost,class:normalizeClass(["host-select_select",unref(n).device]),"option-label-prop":"label",onChange:o},{default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(i.hostOptions,(e=>(openBlock(),createBlock(r,{key:e.host,value:`${e.host}`,label:`${e.title}`},{default:withCtx((()=>[createTextVNode(toDisplayString$1(e.title),1)])),_:2},1032,["value","label"])))),128))])),_:1},8,["value","class"])])):createCommentVNode("",!0)}}});var HostSelect=_export_sfc(_sfc_main$e,[["__scopeId","data-v-10d10992"]]),index_vue_vue_type_style_index_0_scoped_true_lang$3="";const _hoisted_1$6={class:"layout-header_left"},_hoisted_2$5={class:"layout-header_right"},_hoisted_3$3={key:0},_sfc_main$d=defineComponent({__name:"index",emits:["reloadMenu"],setup(e,{emit:t}){const{t:n}=useI18n(),i=useAppStore(),o=()=>{i.toggleOpenSide(!0)},r=()=>{modal$3({})},s=()=>{t("reloadMenu")};return(e,t)=>{const a=Button$2,l=__unplugin_components_2;return openBlock(),createElementBlock("div",{class:normalizeClass(["layout-header",unref(i).device])},[createBaseVNode("div",_hoisted_1$6,[unref(i).device==unref(DeviceEnum).MOBILE?(openBlock(),createElementBlock("span",{key:0,class:"layout-header_button",onClick:o},[createVNode(unref(MenuOutlined$1))])):createCommentVNode("",!0),unref(i).device!=unref(DeviceEnum).MOBILE?(openBlock(),createBlock(Logo,{key:1})):createCommentVNode("",!0)]),createBaseVNode("div",_hoisted_2$5,[createVNode(l,null,{default:withCtx((()=>[createVNode(DarkSwitch),createVNode(a,{onClick:r},{default:withCtx((()=>[createVNode(unref(GlobalOutlined$1)),unref(i).device!=unref(DeviceEnum).MOBILE?(openBlock(),createElementBlock("span",_hoisted_3$3,toDisplayString$1(unref(n)("globalParam.title")),1)):createCommentVNode("",!0)])),_:1}),createVNode(unref(HostSelect)),createVNode(unref(LangSelect)),createVNode(_sfc_main$f,{onReloadMenu:s})])),_:1})])],2)}}});var LayoutHeader=_export_sfc(_sfc_main$d,[["__scopeId","data-v-4b8d6e76"]]),index$3="",index$2="",TagsSelect_vue_vue_type_style_index_0_scoped_true_lang="";const _hoisted_1$5={key:0,class:"tags-select"},_hoisted_2$4={class:"tags-select_list select-menu"},_hoisted_3$2=["onClick"],_hoisted_4$1={class:"tags-select_check"},_sfc_main$c=defineComponent({__name:"TagsSelect",emits:["change"],setup(e,{emit:t}){const n=useApidocStore();let i=ref([]);return(e,o)=>{const r=Button$2,s=Badge,a=__unplugin_components_2$2;return Object.keys(unref(n).dashboard.apiTagTotal).length?(openBlock(),createElementBlock("div",_hoisted_1$5,[createVNode(a,{placement:"bottom",overlayClassName:"tags-select_popover"},{content:withCtx((()=>[createBaseVNode("div",_hoisted_2$4,[createBaseVNode("ul",null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(n).dashboard.apiTagTotal,((e,n)=>(openBlock(),createElementBlock("li",{key:n,class:normalizeClass({active:unref(i).includes(n)}),onClick:e=>{return o=n,i.value.includes(o)?i.value=i.value.filter((e=>e!==o)):i.value=[...i.value,o],void t("change",i.value);var o}},[createTextVNode(toDisplayString$1(n)+" ",1),createBaseVNode("span",_hoisted_4$1,[createVNode(unref(CheckOutlined$1))])],10,_hoisted_3$2)))),128))])])])),default:withCtx((()=>[unref(i).length>0?(openBlock(),createBlock(s,{key:0,count:unref(i).length},{default:withCtx((()=>[createVNode(r,null,{icon:withCtx((()=>[createVNode(unref(TagsOutlined$1))])),_:1})])),_:1},8,["count"])):(openBlock(),createBlock(r,{key:1},{icon:withCtx((()=>[createVNode(unref(TagsOutlined$1))])),_:1}))])),_:1})])):createCommentVNode("",!0)}}});var TagsSelect=_export_sfc(_sfc_main$c,[["__scopeId","data-v-305e38c6"]]),MenuItemContent_vue_vue_type_style_index_0_scoped_true_lang="";const _hoisted_1$4={class:"menu-item-content"},_hoisted_2$3={key:1,class:normalizeClass(["api-method-icon","method-color_multiple"])},_hoisted_3$1={class:"method-icon_multiple"},_hoisted_4={key:5,class:"menu-item-text"},_hoisted_5={key:6,class:"menu-item-text"},_sfc_main$b=defineComponent({__name:"MenuItemContent",props:{item:null},setup(e){const t=e,n=useAppStore(),{t:i}=useI18n(),o=computed((()=>"未分组"===t.item.title?i("common.notGroup"):!t.item.title&&t.item.controller?t.item.controller:t.item.title));return(t,i)=>(openBlock(),createElementBlock("span",_hoisted_1$4,["controller"==e.item.type?(openBlock(),createBlock(unref(CopyrightCircleOutlined$1),{key:0})):e.item.method&&"object"==typeof e.item.method&&e.item.method.length?(openBlock(),createElementBlock("span",_hoisted_2$3,[createBaseVNode("span",_hoisted_3$1,toDisplayString$1(e.item.method.length),1)])):e.item.method?(openBlock(),createElementBlock("span",{key:2,class:normalizeClass(["api-method-icon",`method-color_${e.item.method}`]),style:normalizeStyle({color:unref(n).feConfig.METHOD_COLOR&&unref(n).feConfig.METHOD_COLOR[e.item.method]?unref(n).feConfig.METHOD_COLOR[e.item.method]:""})},toDisplayString$1(e.item.method),7)):e.item.path&&"md"===e.item.type?(openBlock(),createBlock(unref(FileMarkdownOutlined$1),{key:3})):(openBlock(),createBlock(unref(FolderOutlined$1),{key:4})),createBaseVNode("span",null,toDisplayString$1(unref(o)),1),e.item.controller&&unref(n).feConfig.MENU&&unref(n).feConfig.MENU.SHOWURL?(openBlock(),createElementBlock("span",_hoisted_4,toDisplayString$1(e.item.controller),1)):createCommentVNode("",!0),e.item.url&&unref(n).feConfig.MENU&&unref(n).feConfig.MENU.SHOWURL?(openBlock(),createElementBlock("span",_hoisted_5,toDisplayString$1(e.item.url),1)):createCommentVNode("",!0)]))}});var MenuItemContent=_export_sfc(_sfc_main$b,[["__scopeId","data-v-7e626c8d"]]);const _sfc_main$a=defineComponent({__name:"BasicMenuItem",props:{item:null},setup:e=>(t,n)=>{const i=__unplugin_components_0$5;return openBlock(),createBlock(i,{key:e.item.menuKey,title:e.item.title,url:e.item.url},{default:withCtx((()=>[createVNode(MenuItemContent,mergeProps(t.$props,{item:e.item}),null,16,["item"])])),_:1},8,["title","url"])}}),_sfc_main$9=defineComponent({__name:"BasicSubMenuItem",props:{item:null},setup:e=>(t,n)=>{const i=resolveComponent("BasicSubMenuItem",!0),o=__unplugin_components_0$4;return(e=>{const t=e.children;return t&&t.length>0})(e.item)?(openBlock(),createBlock(o,{key:e.item.menuKey,popupClassName:"app-top-menu-popup"},{title:withCtx((()=>[createVNode(MenuItemContent,mergeProps(t.$props,{item:e.item}),null,16,["item"])])),default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.item.children||[],(e=>(openBlock(),createBlock(i,mergeProps({key:e.menuKey},t.$props,{item:e}),null,16,["item"])))),128))])),_:1})):(openBlock(),createBlock(_sfc_main$a,normalizeProps(mergeProps({key:1},t.$props)),null,16))}});function filterTree(e,t,n="children"){return function e(i){return i.map((e=>__spreadValues({},e))).filter((i=>(i[n]=i[n]&&e(i[n]),t(i)||i[n]&&i[n].length)))}(e)}function getTreeValueByField(e,t="menuKey",n="children"){const i=[];return function e(o){for(let r=0;r<o.length;r++){const s=o[r];i.push(s[t]),s[n]&&e(s[n])}}(e),i}function getTreePath(e,t,n=[],i="menuKey",o="children"){if(!e)return[];for(let r=0;r<e.length;r++){const s=e[r];if(n.push(s[i]),t(s))return n;if(s[o]){const e=getTreePath(s[o],t,n,i,o);if(e.length)return e}n.pop()}return[]}const _sfc_main$8=defineComponent({__name:"BasicMenu",props:{data:null,keyword:null,tags:null,openAll:{type:Boolean,default:!1},type:null,defaultSelectedKey:null},emits:["select"],setup(e,{emit:t}){const n=e,i=useAppStore(),o=ref([]),r=ref([]),s=ref([]),a=e=>{o.value=e},l=e=>{s.value=[e.key],t("select",e)};let c=ref([]);const d=(e,t,n)=>{let i=cloneDeep(e);(t||(null==n?void 0:n.length))&&(i=filterTree(i,(e=>!!function(e,t,n=[]){let i=!1;n.length&&(i=n.some((t=>e.tag&&e.tag.indexOf(t)>-1)));const o=t&&(e.title&&e.title.indexOf(t)>-1||e.url&&e.url.indexOf(t)>-1);return!!(t&&n.length&&o&&i)||!(!t||n.length||!o)||!(t||!n.length||!i)}(e,t,n)),"children")),c.value=i,r.value=[],u()},u=()=>{if(n.defaultSelectedKey){if(s.value=[n.defaultSelectedKey],c.value&&c.value.length){let e=getTreePath(c.value,(e=>!(!n.defaultSelectedKey||e.menuKey!==n.defaultSelectedKey)));e.pop(),o.value=[...new Set([...o.value,...e])]}}else s.value=[]};return watch((()=>[n.data,n.keyword,n.tags]),(()=>{d(n.data,n.keyword,n.tags)})),n.data&&d(n.data,n.keyword,n.tags),watch((()=>n.defaultSelectedKey),(()=>{s.value=[n.defaultSelectedKey]})),watchEffect((()=>{n.openAll?(!r.value.length&&c.value.length&&(r.value=getTreeValueByField(c.value)),o.value=r.value):o.value=[]})),(e,t)=>{const n=Menu$2;return openBlock(),createBlock(n,{mode:"inline",theme:unref(i).theme,forceSubMenuRender:!1,openKeys:o.value,selectedKeys:s.value,onOpenChange:a,onSelect:l},{default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(c),(e=>(openBlock(),createBlock(_sfc_main$9,{key:e.menuKey,item:e},null,8,["item"])))),128))])),_:1},8,["theme","openKeys","selectedKeys"])}}});var XDragLine_vue_vue_type_style_index_0_scoped_true_lang="";const _sfc_main$7=defineComponent({__name:"XDragLine",props:{value:{default:200},min:{default:200},max:{default:1e3}},emits:["mouseMoveChange","mouseUpChange"],setup(e,{emit:t}){const n=e,i=ref(n.value),o=e=>{document.addEventListener("mousemove",r),i.value=e.screenX},r=e=>{const{screenX:o}=e;n.min>0&&o<n.min?(i.value=n.min,document.removeEventListener("mousemove",r)):n.max>0&&o>n.max?(i.value=n.max,document.removeEventListener("mousemove",r)):i.value=o,t("mouseMoveChange",i.value)},s=()=>{n.min>0&&i.value<n.min?i.value=n.min:n.max>0&&i.value>n.max&&(i.value=n.max),t("mouseUpChange",i.value),document.removeEventListener("mousemove",r)};return(e,t)=>(openBlock(),createElementBlock("div",{class:"drag-line-x",onMousedown:o,onMouseup:s,style:normalizeStyle({left:i.value+"px"})},null,36))}});var XDragLine=_export_sfc(_sfc_main$7,[["__scopeId","data-v-3b3732d1"]]),index_vue_vue_type_style_index_0_scoped_true_lang$2="";const _hoisted_1$3={class:"layout-side_header"},_hoisted_2$2={class:"layout-side_menus"},_hoisted_3={class:"layout-side_menus"},_sfc_main$6=defineComponent({__name:"index",setup(e,{expose:t}){const n=useAppStore(),i=useApidocStore(),o=useRouter(),r=useRoute(),{t:s}=useI18n();let a=ref("api"),l=ref([]),c=ref(!1),d=ref(""),u=ref("");"MdDetail"==r.name&&(a.value="docs"),r.query.key&&(u.value=r.query.key),onBeforeRouteUpdate((e=>{e.query.key?u.value=e.query.key:u.value=""}));const h=e=>{n.setSideWidth(e)},g=()=>{n.toggleOpenSide(!1)},p=e=>{d.value=e},f=e=>{a.value=e},m=e=>{l.value=e},v=e=>__async(this,null,(function*(){const t={appKey:e,lang:r.query.lang?r.query.lang:n.lang};n.setAppKey(e),yield i.fetchApiMenus(t),yield i.fetchDocsMenus(t)})),_=(e={})=>{const t=__spreadValues({appKey:n.appKey,lang:r.query.lang?r.query.lang:n.lang},e);"api"==a.value?i.fetchApiMenus(t):"docs"==a.value&&i.fetchDocsMenus(t)},C=()=>{c.value=!c.value},b=e=>{g(),e.item.url&&o.push({name:"ApiDetail",query:{appKey:n.appKey,key:e.key,title:encodeURIComponent(e.item.title)}})},y=e=>{g(),o.push({name:"MdDetail",query:{appKey:n.appKey,key:e.key,title:encodeURIComponent(e.item.title)}})};return t({onReload:_}),(e,t)=>{const o=__unplugin_components_4,r=Button$2,S=__unplugin_components_2$3,w=__unplugin_components_2,E=Tabs;return openBlock(),createElementBlock(Fragment,null,[createBaseVNode("div",{class:normalizeClass(["layout-side",unref(n).device,{open:unref(n).isOpenSide}]),style:normalizeStyle({width:`${unref(n).sideWidth}px`})},[createBaseVNode("div",_hoisted_1$3,[createVNode(Search,{onSearch:p,onAppChange:v})]),createVNode(E,{activeKey:unref(a),"onUpdate:activeKey":t[0]||(t[0]=e=>isRef(a)?a.value=e:a=e),onChange:f},{rightExtra:withCtx((()=>[createVNode(w,null,{default:withCtx((()=>["api"==unref(a)?(openBlock(),createBlock(unref(TagsSelect),{key:0,onChange:m})):createCommentVNode("",!0),"api"==unref(a)?(openBlock(),createBlock(S,{key:1},{title:withCtx((()=>[createTextVNode(toDisplayString$1(unref(s)("layout.menu.reload")),1)])),default:withCtx((()=>[createVNode(r,{onClick:_},{icon:withCtx((()=>[createVNode(unref(RedoOutlined$1))])),_:1})])),_:1})):createCommentVNode("",!0),createVNode(S,null,{title:withCtx((()=>[createTextVNode(toDisplayString$1(unref(c)?unref(s)("layout.menu.hideAll"):unref(s)("layout.menu.openAll")),1)])),default:withCtx((()=>[createVNode(r,{onClick:C},{icon:withCtx((()=>[unref(c)?(openBlock(),createBlock(unref(UpOutlined$1),{key:1})):(openBlock(),createBlock(unref(DownOutlined$1),{key:0}))])),_:1})])),_:1})])),_:1})])),default:withCtx((()=>[createVNode(o,{key:"api",tab:unref(s)("common.api")},{default:withCtx((()=>[createBaseVNode("div",_hoisted_2$2,[createVNode(unref(_sfc_main$8),{data:unref(i).apiMenus,keyword:unref(d),tags:unref(l),openAll:unref(c),defaultSelectedKey:unref(u),onSelect:b},null,8,["data","keyword","tags","openAll","defaultSelectedKey"])])])),_:1},8,["tab"]),createVNode(o,{key:"docs",tab:unref(s)("common.docs")},{default:withCtx((()=>[createBaseVNode("div",_hoisted_3,[createVNode(unref(_sfc_main$8),{data:unref(i).docsMenus,keyword:unref(d),openAll:unref(c),defaultSelectedKey:unref(u),onSelect:y},null,8,["data","keyword","openAll","defaultSelectedKey"])])])),_:1},8,["tab"])])),_:1},8,["activeKey"]),unref(n).device!==unref(DeviceEnum).MOBILE?(openBlock(),createBlock(unref(XDragLine),{key:0,min:250,max:800,value:unref(n).sideWidth,onMouseMoveChange:h},null,8,["value"])):createCommentVNode("",!0)],6),unref(n).isOpenSide?(openBlock(),createElementBlock("div",{key:0,class:"layout-side_mask",onClick:g})):createCommentVNode("",!0)],64)}}});var LayoutSider=_export_sfc(_sfc_main$6,[["__scopeId","data-v-a0dbed22"]]),index_vue_vue_type_style_index_0_scoped_true_lang$1="";const _hoisted_1$2={key:0,style:{userSelect:"none"}},_hoisted_2$1={style:{userSelect:"none"}},_sfc_main$5=defineComponent({__name:"index",setup(e){const t=useAppStore(),n=useRoute(),i=useRouter(),{t:o}=useI18n();let r=[{fullPath:"/home",hash:"",matched:[],meta:{title:o("home.title"),affix:!0,keepKey:"Home"},name:"Home",params:{},path:"/home",query:{},redirectedFrom:void 0}];const s=ref("Home");n.meta.affix||(r.push(__spreadValues({},n)),s.value=n.fullPath),t.setMultiTabs(r),"IframePage"==n.name&&t.addKeepPages(__spreadValues({},n));const a=e=>{let t=e.meta.title;return e.query.title&&(t=decodeURIComponent(e.query.title)),t};onBeforeRouteUpdate((e=>{r.find((t=>t.fullPath===e.fullPath))||(e.query.title||(e.query.title=o("common.page.404")),r.push(e),"IframePage"==e.name&&t.addKeepPages(e)),s.value=e.fullPath,t.setMultiTabs(r)}));const l=e=>{i.push(e)},c=(e,t)=>{if("remove"===t)d(e)},d=e=>{e&&isString$2(e)||(e=s.value),r=r.filter((t=>t.fullPath!==e)),e===s.value?u():t.setMultiTabs(r);const n=t.keepPages.filter((t=>t.fullPath!==e));t.setKeepPages(n)},u=()=>{const e=r;s.value=e[e.length-1].fullPath,i.push(s.value)};function h(e,n){const i=r.findIndex((t=>t.fullPath===e));if("left"===n&&i>0||"right"===n&&i<r.length-1){let e=[];r=r.filter(((t,o)=>!!("left"===n&&o>=i||"right"===n&&o<=i||t.meta.affix)||(e.push(t.fullPath),!1)));r.find((e=>e.fullPath===s.value))?t.setMultiTabs(r):u();const o=t.keepPages.filter((t=>!e.includes(t.fullPath)));t.setKeepPages(o)}else message.info(`${o("left"==n?"layout.tabs.leftSide":"layout.tabs.rightSide")}${o("layout.tabs.notTab")}`)}const g=({key:e},n)=>{switch(e){case"closeCurrent":d(n.fullPath);break;case"closeLeft":h(n.fullPath,"left");break;case"closeRight":h(n.fullPath,"right");break;case"closeAll":!function(){let e=[];r=r.filter((t=>!!t.meta.affix||(e.push(t.fullPath),!1))),r.find((e=>e.fullPath===s.value))||u();const n=t.keepPages.filter((t=>!e.includes(t.fullPath)));t.setKeepPages(n)}()}};return(e,n)=>{const i=__unplugin_components_0$5,r=Menu$2,d=Dropdown$1,u=__unplugin_components_4,h=Tabs;return openBlock(),createElementBlock("div",{class:normalizeClass(["multi-tabs-wrapper",unref(t).device]),style:normalizeStyle({left:`${unref(t).sideWidth}px`})},[createVNode(h,{type:"editable-card",size:"small",hideAdd:"",activeKey:s.value,"onUpdate:activeKey":n[0]||(n[0]=e=>s.value=e),onChange:l,onEdit:c},{default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(t).multiTabs,(e=>(openBlock(),createBlock(u,{key:e.fullPath,closable:!e.meta.affix},{tab:withCtx((()=>[e.meta.affix?(openBlock(),createElementBlock("span",_hoisted_1$2,toDisplayString$1(a(e)),1)):(openBlock(),createBlock(d,{key:1,trigger:["contextmenu"]},{overlay:withCtx((()=>[createVNode(r,{onClick:t=>g(t,e)},{default:withCtx((()=>[createVNode(i,{key:"closeCurrent"},{default:withCtx((()=>[createTextVNode(toDisplayString$1(unref(o)("layout.tabs.closeCurrent")),1)])),_:1}),createVNode(i,{key:"closeLeft"},{default:withCtx((()=>[createTextVNode(toDisplayString$1(unref(o)("layout.tabs.closeLeft")),1)])),_:1}),createVNode(i,{key:"closeRight"},{default:withCtx((()=>[createTextVNode(toDisplayString$1(unref(o)("layout.tabs.closeRight")),1)])),_:1}),createVNode(i,{key:"closeAll"},{default:withCtx((()=>[createTextVNode(toDisplayString$1(unref(o)("layout.tabs.closeAll")),1)])),_:1})])),_:2},1032,["onClick"])])),default:withCtx((()=>[createBaseVNode("span",_hoisted_2$1,toDisplayString$1(a(e)),1)])),_:2},1024))])),_:2},1032,["closable"])))),128))])),_:1},8,["activeKey"])],6)}}});var LayoutMultitabs=_export_sfc(_sfc_main$5,[["__scopeId","data-v-b9f2e12c"]]),KeepPages_vue_vue_type_style_index_0_scoped_true_lang="";const _hoisted_1$1={class:"keep-pages"},_hoisted_2=["src"],_sfc_main$4=defineComponent({__name:"KeepPages",setup(e){const t=useAppStore(),n=useRoute();return(e,i)=>(openBlock(),createElementBlock("div",_hoisted_1$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(t).keepPages,(e=>(openBlock(),createElementBlock("iframe",{key:e.fullPath,src:e.query.url,ref_for:!0,ref:"iframe",class:"iframe",style:normalizeStyle({display:e.fullPath==unref(n).fullPath?"block":"none"}),border:"0"},null,12,_hoisted_2)))),128))]))}});var KeepPages=_export_sfc(_sfc_main$4,[["__scopeId","data-v-50fbad9b"]]),useEditorHover=()=>{const e=useApidocStore();languages.registerHoverProvider("json",{provideHover:(t,n)=>{const i=t.getWordAtPosition(n);if(i&&i.word&&e.currentEditorHoverTipsParams){const t=`${i.word}_${n.lineNumber}_${i.startColumn}`;return{contents:e.currentEditorHoverTipsParams[t]}}}})},index_vue_vue_type_style_index_0_scoped_true_lang="";const _sfc_main$3=defineComponent({__name:"index",setup(e){const t=useAppStore();useEditorHover();const n=(e,t)=>(e.type.name=parseRouteKey(t),e);return(e,i)=>{const o=resolveComponent("router-view");return openBlock(),createElementBlock("div",{class:normalizeClass(["layout-content",unref(t).device]),style:normalizeStyle({marginLeft:`${unref(t).sideWidth}px`})},[createVNode(o,null,{default:withCtx((({Component:i})=>[createVNode(Transition,{name:"fade-slide",mode:"out-in"},{default:withCtx((()=>[(openBlock(),createBlock(KeepAlive,{include:unref(t).keepAliveKeys},[(openBlock(),createBlock(resolveDynamicComponent(n(i,e.$route)),{key:unref(parseRouteKey)(e.$route)}))],1032,["include"]))])),_:2},1024)])),_:1}),createVNode(KeepPages)],6)}}});var LayoutContent=_export_sfc(_sfc_main$3,[["__scopeId","data-v-5ef31af8"]]),LoadingCard_vue_vue_type_style_index_0_scoped_true_lang="";const _sfc_main$2={},_hoisted_1={class:"loading-card"};function _sfc_render$1(e,t){const n=Spin;return openBlock(),createElementBlock("div",_hoisted_1,[createVNode(n,{tip:"Loading..."})])}var LoadingCard=_export_sfc(_sfc_main$2,[["render",_sfc_render$1],["__scopeId","data-v-51d3a6eb"]]),_a;const isClient="undefined"!=typeof window;function tryOnScopeDispose(e){return!!getCurrentScope()&&(onScopeDispose(e),!0)}function tryOnBeforeMount(e,t=!0){getCurrentInstance()?onBeforeMount(e):t?e():nextTick(e)}isClient&&(null==(_a=null==window?void 0:window.navigator)?void 0:_a.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);const defaultWindow=isClient?window:void 0;function useMediaQuery(e,t={}){const{window:n=defaultWindow}=t,i=Boolean(n&&"matchMedia"in n&&"function"==typeof n.matchMedia);let o;const r=ref(!1),s=()=>{i&&(o||(o=n.matchMedia(e)),r.value=o.matches)};return tryOnBeforeMount((()=>{s(),o&&("addEventListener"in o?o.addEventListener("change",s):o.addListener(s),tryOnScopeDispose((()=>{"removeEventListener"in o?o.removeEventListener("change",s):o.removeListener(s)})))})),r}isClient&&window.document,isClient&&window.navigator,isClient&&window.location;const _global="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},globalKey="__vueuse_ssr_handlers__";var SwipeDirection,SwipeDirection2;_global[globalKey]=_global[globalKey]||{},_global[globalKey],SwipeDirection2=SwipeDirection||(SwipeDirection={}),SwipeDirection2.UP="UP",SwipeDirection2.RIGHT="RIGHT",SwipeDirection2.DOWN="DOWN",SwipeDirection2.LEFT="LEFT",SwipeDirection2.NONE="NONE";var useDevice=()=>{const e=useAppStore(),t=useMediaQuery("(max-width: 1024px)"),n=ref(i(t.value));function i(t){const n=!0===t?DeviceEnum.MOBILE:DeviceEnum.DESKTOP;return e.setDevice(n),n}return watch((()=>t.value),(e=>{n.value=i(e)})),{device:n}};function useWebsiteService(){const e=useRouter(),t={test:function(e){},openTab:function(t){e.push({name:"IframePage",query:{url:t.params.url,title:t.params.title}})}};return window.addEventListener("message",(function(e){const n=e.data.event;n&&t[n]&&t[n](e.data)}),!1),{}}const _sfc_main$1=defineComponent({__name:"index",setup(e){const t=useRoute(),n=ref();useDevice(),useWebsiteService();const i=useAppStore(),o=useApidocStore();i.fetchFeConfig(),i.setLang(t.query.lang),i.initTheme(),i.initAppAuth();const r=reactive({loading:!0,errorIframeUrl:""}),s={appKey:t.query.appKey?t.query.appKey:i.appKey,lang:t.query.lang?t.query.lang:i.lang};i.fetchSeverConfig(s).then((({appKey:e,config:t})=>{o.fetchApiMenus(__spreadProps(__spreadValues({},s),{appKey:e})),o.fetchDocsMenus(__spreadProps(__spreadValues({},s),{appKey:e})),r.loading=!1,o.initGlobalParams(t)})).catch((e=>{handleApidocHttpError(e).then((t=>{!1===t?(i.setGlobalError(e),r.loading=!1):(i.setGlobalError({}),location.reload())}))}));const a=()=>{n.value.onReload()};return(e,t)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(LayoutHeader,{onReloadMenu:a}),r.loading?(openBlock(),createBlock(unref(LoadingCard),{key:0})):unref(i).globalError&&unref(i).globalError.response?(openBlock(),createBlock(unref(Error$1),{key:1,error:unref(i).globalError},null,8,["error"])):(openBlock(),createElementBlock(Fragment,{key:2},[createVNode(LayoutSider,{ref_key:"sider",ref:n},null,512),createVNode(LayoutMultitabs),createVNode(LayoutContent)],64))],64))}}),_sfc_main={};function _sfc_render(e,t){return openBlock(),createElementBlock("div")}var KeepPage=_export_sfc(_sfc_main,[["render",_sfc_render]]),routes=[{path:"/",name:"index",component:_sfc_main$1,meta:{},redirect:"/home",children:[{path:"/home",name:"Home",component:()=>__vitePreload((()=>import("./index.410c3610.js")),["assets/index.410c3610.js","assets/index.978a0d55.css","assets/index.8eb0a8ae.js","assets/index.ec55b3ce.css"]),meta:{keepKey:"Home",affix:!0}},{path:"/api",name:"ApiDetail",component:()=>__vitePreload((()=>import("./index.f3accad4.js")),["assets/index.f3accad4.js","assets/index.369193c1.css","assets/index.8eb0a8ae.js","assets/index.ec55b3ce.css","assets/Skeleton.fec76bd9.js","assets/Skeleton.f112a820.css"]),meta:{}},{path:"/md",name:"MdDetail",component:()=>__vitePreload((()=>import("./index.5b0346c7.js")),["assets/index.5b0346c7.js","assets/index.755d13d6.css","assets/Skeleton.fec76bd9.js","assets/Skeleton.f112a820.css"]),meta:{}},{path:"/iframePage",name:"IframePage",component:KeepPage,meta:{}}]}],nprogress$1={exports:{}};nprogress$1.exports=function(){var e,t,n={version:"0.2.0"},i=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};function o(e,t,n){return e<t?t:e>n?n:e}function r(e){return 100*(-1+e)}function s(e,t,n){var o;return(o="translate3d"===i.positionUsing?{transform:"translate3d("+r(e)+"%,0,0)"}:"translate"===i.positionUsing?{transform:"translate("+r(e)+"%,0)"}:{"margin-left":r(e)+"%"}).transition="all "+t+"ms "+n,o}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(i[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=o(e,i.minimum,1),n.status=1===e?null:e;var r=n.render(!t),c=r.querySelector(i.barSelector),d=i.speed,u=i.easing;return r.offsetWidth,a((function(t){""===i.positionUsing&&(i.positionUsing=n.getPositioningCSS()),l(c,s(e,d,u)),1===e?(l(r,{transition:"none",opacity:1}),r.offsetWidth,setTimeout((function(){l(r,{transition:"all "+d+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),d)}),d)):setTimeout(t,d)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),i.trickleSpeed)};return i.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*o(Math.random()*t,.1,.95)),t=o(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*i.trickleRate)},e=0,t=0,n.promise=function(i){return i&&"resolved"!==i.state()?(0===t&&n.start(),e++,t++,i.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");d(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=i.template;var o,s=t.querySelector(i.barSelector),a=e?"-100":r(n.status||0),c=document.querySelector(i.parent);return l(s,{transition:"all 0 linear",transform:"translate3d("+a+"%,0,0)"}),i.showSpinner||(o=t.querySelector(i.spinnerSelector))&&g(o),c!=document.body&&d(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){u(document.documentElement,"nprogress-busy"),u(document.querySelector(i.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&g(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var a=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),l=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function i(t){var n=document.body.style;if(t in n)return t;for(var i,o=e.length,r=t.charAt(0).toUpperCase()+t.slice(1);o--;)if((i=e[o]+r)in n)return i;return t}function o(e){return e=n(e),t[e]||(t[e]=i(e))}function r(e,t,n){t=o(t),e.style[t]=n}return function(e,t){var n,i,o=arguments;if(2==o.length)for(n in t)void 0!==(i=t[n])&&t.hasOwnProperty(n)&&r(e,n,i);else r(e,o[1],o[2])}}();function c(e,t){return("string"==typeof e?e:h(e)).indexOf(" "+t+" ")>=0}function d(e,t){var n=h(e),i=n+t;c(n,t)||(e.className=i.substring(1))}function u(e,t){var n,i=h(e);c(e,t)&&(n=i.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function h(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function g(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n}();var NProgress=nprogress$1.exports,nprogress="";const router=createRouter({history:createWebHashHistory(),routes:routes});router.beforeEach(((e,t,n)=>{NProgress.start(),n()})),router.afterEach((()=>{NProgress.done()}));var iconfont="",index$1="",antd="",index="";if("undefined"!=typeof window){let e=function(){var e=document.body,t=document.getElementById("__svg__icons__dom__");t||((t=document.createElementNS("http://www.w3.org/2000/svg","svg")).style.position="absolute",t.style.width="0",t.style.height="0",t.id="__svg__icons__dom__",t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("xmlns:link","http://www.w3.org/1999/xlink")),t.innerHTML="",e.insertBefore(t,e.lastChild)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}const app=createApp(App);setupI18n(app),app.use(router).use(pinia).mount("#app");export{cloneElement as $,useI18n as A,createTextVNode as B,Col as C,renderList as D,__unplugin_components_1$1 as E,Fragment as F,normalizeStyle as G,createBlock as H,__unplugin_components_1$2 as I,__unplugin_components_7 as J,ref as K,useInjectSize as L,useBreakpoint as M,eagerComputed as N,_typeof$3 as O,PropTypes$1 as P,responsiveArray as Q,Row as R,watch as S,Tabs as T,nextTick as U,onMounted as V,_extends$1 as W,ResizeObserver$1 as X,_objectSpread2$1 as Y,useProvideSize as Z,_defineProperty$P as _,flattenChildren as a,onUpdated as a$,__unplugin_components_2$2 as a0,DownOutlined$1 as a1,Dropdown$1 as a2,Menu$2 as a3,warning$2 as a4,cloneVNode as a5,_toConsumableArray$2 as a6,AntdIcon as a7,inject as a8,classNames as a9,useAppOutsideStore as aA,getObjectValueByKey as aB,isArray$4 as aC,isObject$5 as aD,request as aE,Button$2 as aF,__unplugin_components_2 as aG,Badge as aH,normalizeClass as aI,__unplugin_components_0$6 as aJ,useRoute as aK,Error$1 as aL,globalApi as aM,handleTableDataRowKey as aN,handleApidocHttpError as aO,RedoOutlined$1 as aP,DeviceEnum as aQ,withDirectives as aR,vModelText as aS,CopyOutlined$1 as aT,copyTextToClipboard as aU,message as aV,__unplugin_components_3 as aW,SelectOption as aX,wrapperRaf as aY,addEventListenerWrap as aZ,supportsPassive$1 as a_,isStringElement as aa,initDefaultProps$1 as ab,provide as ac,toRef as ad,Pagination as ae,Spin as af,KeyCode$3 as ag,useDestroyed$1 as ah,isEmptyContent as ai,filterEmpty as aj,LocaleReceiver as ak,CodeEditor as al,h$1 as am,useSlots as an,normalizeProps as ao,mergeProps as ap,CheckOutlined$1 as aq,textToHtml as ar,cloneDeep as as,__unplugin_components_4 as at,commonjsGlobal as au,createIdcard as av,trim as aw,EditTable as ax,createRandKey as ay,useApidocOutsideStore as az,devWarning as b,onUnmounted as b0,omit$2 as b1,getCurrentInstance as b2,onBeforeUnmount as b3,getScroll$2 as b4,scrollTo as b5,Modal$2 as b6,createApp as b7,pinia as b8,createStaticVNode as b9,typescriptDefaults as ba,monaco_editor_core_star as bb,createVNode as c,defineComponent as d,isEmptyElement as e,filterEmptyWithUndefined as f,isPlainObject$3 as g,getPropsSlot as h,isVNode as i,computed as j,_export_sfc as k,useAppStore as l,useApidocStore as m,reactive as n,__unplugin_components_0$7 as o,watchEffect as p,openBlock as q,renderSlot as r,createElementBlock as s,createBaseVNode as t,useConfigInject as u,unref as v,withInstall as w,toDisplayString$1 as x,createCommentVNode as y,withCtx as z};
|